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_CT_ACCT
24 static inline struct ip_conntrack_counter *
25 nf_ct_get_counters(const struct sk_buff *skb)
27 enum ip_conntrack_info ctinfo;
28 struct ip_conntrack *ct = ip_conntrack_get(skb, &ctinfo);
35 #endif /* CONFIG_IP_NF_CT_ACCT */
37 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
39 return (skb->nfct == &ip_conntrack_untracked.ct_general);
42 static inline void nf_ct_untrack(struct sk_buff *skb)
44 skb->nfct = &ip_conntrack_untracked.ct_general;
47 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
48 enum ip_conntrack_info *ctinfo)
50 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
54 #else /* CONFIG_IP_NF_CONNTRACK */
56 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
57 #include <net/netfilter/nf_conntrack.h>
59 #ifdef CONFIG_NF_CONNTRACK_MARK
61 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
64 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
71 #endif /* CONFIG_NF_CONNTRACK_MARK */
73 #ifdef CONFIG_NF_CT_ACCT
74 static inline struct ip_conntrack_counter *
75 nf_ct_get_counters(const struct sk_buff *skb)
77 enum ip_conntrack_info ctinfo;
78 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
85 #endif /* CONFIG_NF_CT_ACCT */
87 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
89 return (skb->nfct == &nf_conntrack_untracked.ct_general);
92 static inline void nf_ct_untrack(struct sk_buff *skb)
94 skb->nfct = &nf_conntrack_untracked.ct_general;
97 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
98 enum ip_conntrack_info *ctinfo)
100 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
104 #endif /* CONFIG_IP_NF_CONNTRACK */
106 #endif /* __KERNEL__ */
108 #endif /* _NF_CONNTRACK_COMPAT_H */