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 #else /* CONFIG_IP_NF_CONNTRACK */
69 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
70 #include <net/netfilter/nf_conntrack.h>
72 #ifdef CONFIG_NF_CONNTRACK_MARK
74 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
77 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
84 #endif /* CONFIG_NF_CONNTRACK_MARK */
86 #ifdef CONFIG_NF_CONNTRACK_SECMARK
87 static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
90 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
97 #endif /* CONFIG_NF_CONNTRACK_MARK */
99 #ifdef CONFIG_NF_CT_ACCT
100 static inline struct ip_conntrack_counter *
101 nf_ct_get_counters(const struct sk_buff *skb)
103 enum ip_conntrack_info ctinfo;
104 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
111 #endif /* CONFIG_NF_CT_ACCT */
113 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
115 return (skb->nfct == &nf_conntrack_untracked.ct_general);
118 static inline void nf_ct_untrack(struct sk_buff *skb)
120 skb->nfct = &nf_conntrack_untracked.ct_general;
123 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
124 enum ip_conntrack_info *ctinfo)
126 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
130 #endif /* CONFIG_IP_NF_CONNTRACK */
132 #endif /* __KERNEL__ */
134 #endif /* _NF_CONNTRACK_COMPAT_H */