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>
9 #include <linux/socket.h>
11 #ifdef CONFIG_IP_NF_CONNTRACK_MARK
12 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
15 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
22 #endif /* CONFIG_IP_NF_CONNTRACK_MARK */
24 #ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
25 static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
28 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
35 #endif /* CONFIG_IP_NF_CONNTRACK_SECMARK */
37 #ifdef CONFIG_IP_NF_CT_ACCT
38 static inline struct ip_conntrack_counter *
39 nf_ct_get_counters(const struct sk_buff *skb)
41 enum ip_conntrack_info ctinfo;
42 struct ip_conntrack *ct = ip_conntrack_get(skb, &ctinfo);
49 #endif /* CONFIG_IP_NF_CT_ACCT */
51 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
53 return (skb->nfct == &ip_conntrack_untracked.ct_general);
56 static inline void nf_ct_untrack(struct sk_buff *skb)
58 skb->nfct = &ip_conntrack_untracked.ct_general;
61 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
62 enum ip_conntrack_info *ctinfo)
64 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
68 static inline int nf_ct_l3proto_try_module_get(unsigned short l3proto)
71 return l3proto == PF_INET ? 0 : -1;
74 static inline void nf_ct_l3proto_module_put(unsigned short l3proto)
78 #else /* CONFIG_IP_NF_CONNTRACK */
80 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
81 #include <net/netfilter/nf_conntrack.h>
83 #ifdef CONFIG_NF_CONNTRACK_MARK
85 static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
88 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
95 #endif /* CONFIG_NF_CONNTRACK_MARK */
97 #ifdef CONFIG_NF_CONNTRACK_SECMARK
98 static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
101 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
108 #endif /* CONFIG_NF_CONNTRACK_MARK */
110 #ifdef CONFIG_NF_CT_ACCT
111 static inline struct ip_conntrack_counter *
112 nf_ct_get_counters(const struct sk_buff *skb)
114 enum ip_conntrack_info ctinfo;
115 struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
122 #endif /* CONFIG_NF_CT_ACCT */
124 static inline int nf_ct_is_untracked(const struct sk_buff *skb)
126 return (skb->nfct == &nf_conntrack_untracked.ct_general);
129 static inline void nf_ct_untrack(struct sk_buff *skb)
131 skb->nfct = &nf_conntrack_untracked.ct_general;
134 static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
135 enum ip_conntrack_info *ctinfo)
137 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
141 #endif /* CONFIG_IP_NF_CONNTRACK */
143 #endif /* __KERNEL__ */
145 #endif /* _NF_CONNTRACK_COMPAT_H */