Xiaoping Fan | 3f1fe51 | 2014-11-05 12:14:57 -0800 | [diff] [blame^] | 1 | #include <linux/version.h> |
| 2 | |
| 3 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) |
| 4 | #define sfe_cm_ipv4_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \ |
| 5 | static unsigned int __sfe_cm_ipv4_post_routing_hook(const struct nf_hook_ops *OPS, \ |
| 6 | struct sk_buff *SKB, \ |
| 7 | const struct net_device *UNUSED, \ |
| 8 | const struct net_device *OUT, \ |
| 9 | int (*OKFN)(struct sk_buff *)) |
| 10 | #else |
| 11 | #define sfe_cm_ipv4_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \ |
| 12 | static unsigned int __sfe_cm_ipv4_post_routing_hook(unsigned int HOOKNUM, \ |
| 13 | struct sk_buff *SKB, \ |
| 14 | const struct net_device *UNUSED, \ |
| 15 | const struct net_device *OUT, \ |
| 16 | int (*OKFN)(struct sk_buff *)) |
| 17 | #endif |
| 18 | |
| 19 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) |
| 20 | #define SFE_DEV_MASTER(DEV) netdev_master_upper_dev_get(DEV); |
| 21 | #else |
| 22 | #define SFE_DEV_MASTER(DEV) (DEV)->master; |
| 23 | #endif |
| 24 | |
| 25 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) |
| 26 | #define SFE_NF_CONN_ACCT(NM) struct nf_conn_acct *NM |
| 27 | #else |
| 28 | #define SFE_NF_CONN_ACCT(NM) struct nf_conn_counter *NM |
| 29 | #endif |
| 30 | |
| 31 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) |
| 32 | #define SFE_ACCT_COUNTER(NM) (NM)->counter |
| 33 | #else |
| 34 | #define SFE_ACCT_COUNTER(NM) (NM) |
| 35 | #endif |