[ARM] 4057/1: ixp23xx: unconditionally enable hardware coherency
[linux-2.6/verdex.git] / include / net / netfilter / nf_conntrack_compat.h
blobb9ce5c80d9d5cc83087593f25b6e186ffdebb75d
1 #ifndef _NF_CONNTRACK_COMPAT_H
2 #define _NF_CONNTRACK_COMPAT_H
4 #ifdef __KERNEL__
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,
12 u_int32_t *ctinfo)
14 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
16 if (ct)
17 return &ct->mark;
18 else
19 return NULL;
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,
25 u_int32_t *ctinfo)
27 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
29 if (ct)
30 return &ct->secmark;
31 else
32 return NULL;
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);
43 if (ct)
44 return ct->counters;
45 else
46 return NULL;
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);
64 return (ct != NULL);
67 static inline int nf_ct_l3proto_try_module_get(unsigned short l3proto)
69 need_conntrack();
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,
85 u_int32_t *ctinfo)
87 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
89 if (ct)
90 return &ct->mark;
91 else
92 return NULL;
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,
98 u_int32_t *ctinfo)
100 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
102 if (ct)
103 return &ct->secmark;
104 else
105 return NULL;
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);
116 if (ct)
117 return ct->counters;
118 else
119 return NULL;
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);
137 return (ct != NULL);
140 #endif /* CONFIG_IP_NF_CONNTRACK */
142 #endif /* __KERNEL__ */
144 #endif /* _NF_CONNTRACK_COMPAT_H */