1 #ifndef _NF_CONNTRACK_COMPAT_H
2 #define _NF_CONNTRACK_COMPAT_H
6 #if defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)
8 #include <linux/netfilter_ipv4/ip_conntrack.h>
10 #ifdef CONFIG_IP_NF_CONNTRACK_MARK
11 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
14 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
21 #endif /* CONFIG_IP_NF_CONNTRACK_MARK */
23 #ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
24 static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
27 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
34 #endif /* CONFIG_IP_NF_CONNTRACK_SECMARK */
36 #ifdef CONFIG_IP_NF_CT_ACCT
37 static inline struct ip_conntrack_counter *
38 nf_ct_get_counters(const struct sk_buff *skb)
40 enum ip_conntrack_info ctinfo;
41 struct ip_conntrack *ct = ip_conntrack_get(skb, &ctinfo);
48 #endif /* CONFIG_IP_NF_CT_ACCT */
50 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
52 return (skb->nfct == &ip_conntrack_untracked.ct_general);
55 static inline void nf_ct_untrack(struct sk_buff *skb)
57 skb->nfct = &ip_conntrack_untracked.ct_general;
60 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
61 enum ip_conntrack_info *ctinfo)
63 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
67 static inline int nf_ct_l3proto_try_module_get(unsigned short l3proto)
70 return l3proto == PF_INET ? 0 : -1;
73 static inline void nf_ct_l3proto_module_put(unsigned short l3proto)
77 #else /* CONFIG_IP_NF_CONNTRACK */
79 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
80 #include <net/netfilter/nf_conntrack.h>
82 #ifdef CONFIG_NF_CONNTRACK_MARK
84 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
87 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
94 #endif /* CONFIG_NF_CONNTRACK_MARK */
96 #ifdef CONFIG_NF_CONNTRACK_SECMARK
97 static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
100 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
107 #endif /* CONFIG_NF_CONNTRACK_MARK */
109 #ifdef CONFIG_NF_CT_ACCT
110 static inline struct ip_conntrack_counter *
111 nf_ct_get_counters(const struct sk_buff *skb)
113 enum ip_conntrack_info ctinfo;
114 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
121 #endif /* CONFIG_NF_CT_ACCT */
123 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
125 return (skb->nfct == &nf_conntrack_untracked.ct_general);
128 static inline void nf_ct_untrack(struct sk_buff *skb)
130 skb->nfct = &nf_conntrack_untracked.ct_general;
133 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
134 enum ip_conntrack_info *ctinfo)
136 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
140 #endif /* CONFIG_IP_NF_CONNTRACK */
142 #endif /* __KERNEL__ */
144 #endif /* _NF_CONNTRACK_COMPAT_H */