blob: b809265607d0427ecfba54750af897b40609e5b6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __LINUX_NETFILTER_H
2#define __LINUX_NETFILTER_H
3
4#ifdef __KERNEL__
5#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <linux/skbuff.h>
7#include <linux/net.h>
8#include <linux/if.h>
Jan Engelhardt2e3075a2008-01-14 23:40:34 -08009#include <linux/in.h>
10#include <linux/in6.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/wait.h>
12#include <linux/list.h>
13#endif
Patrick McHardyc8942f12008-05-21 14:08:38 -070014#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/compiler.h>
David S. Millerbee95252011-05-26 16:40:37 -040016#include <linux/sysctl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18/* Responses from hook functions. */
19#define NF_DROP 0
20#define NF_ACCEPT 1
21#define NF_STOLEN 2
22#define NF_QUEUE 3
23#define NF_REPEAT 4
24#define NF_STOP 5
25#define NF_MAX_VERDICT NF_STOP
26
Harald Welte0ab43f82005-08-09 19:43:44 -070027/* we overload the higher bits for encoding auxiliary data such as the queue
Florian Westphalf615df72011-01-18 15:52:14 +010028 * number or errno values. Not nice, but better than additional function
29 * arguments. */
30#define NF_VERDICT_MASK 0x000000ff
Harald Welte0ab43f82005-08-09 19:43:44 -070031
Florian Westphalf615df72011-01-18 15:52:14 +010032/* extra verdict flags have mask 0x0000ff00 */
Florian Westphal94b27cc2011-01-18 16:08:30 +010033#define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
Florian Westphalf615df72011-01-18 15:52:14 +010034
35/* queue number (NF_QUEUE) or errno (NF_DROP) */
Harald Welte0ab43f82005-08-09 19:43:44 -070036#define NF_VERDICT_QMASK 0xffff0000
37#define NF_VERDICT_QBITS 16
38
Florian Westphalf615df72011-01-18 15:52:14 +010039#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
Harald Welte0ab43f82005-08-09 19:43:44 -070040
Florian Westphalf615df72011-01-18 15:52:14 +010041#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
Eric Parisda683652010-11-16 11:52:38 +000042
Harald Welte6869c4d2005-08-09 19:24:19 -070043/* only for userspace compatibility */
44#ifndef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -070045/* Generic cache responses from hook functions.
46 <= 0x2000 is used for protocol-flags. */
47#define NFC_UNKNOWN 0x4000
48#define NFC_ALTERED 0x8000
Florian Westphalf615df72011-01-18 15:52:14 +010049
50/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
51#define NF_VERDICT_BITS 16
Harald Welte6869c4d2005-08-09 19:24:19 -070052#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Patrick McHardy6e23ae22007-11-19 18:53:30 -080054enum nf_inet_hooks {
55 NF_INET_PRE_ROUTING,
56 NF_INET_LOCAL_IN,
57 NF_INET_FORWARD,
58 NF_INET_LOCAL_OUT,
59 NF_INET_POST_ROUTING,
60 NF_INET_NUMHOOKS
61};
62
Jan Engelhardt7e9c6ee2008-10-08 11:35:00 +020063enum {
64 NFPROTO_UNSPEC = 0,
65 NFPROTO_IPV4 = 2,
66 NFPROTO_ARP = 3,
67 NFPROTO_BRIDGE = 7,
68 NFPROTO_IPV6 = 10,
69 NFPROTO_DECNET = 12,
70 NFPROTO_NUMPROTO,
71};
72
Jan Engelhardt643a2c12007-12-17 22:43:50 -080073union nf_inet_addr {
Patrick McHardy7b33ed22008-02-19 17:20:33 -080074 __u32 all[4];
Jan Engelhardt643a2c12007-12-17 22:43:50 -080075 __be32 ip;
76 __be32 ip6[4];
Jan Engelhardt2e3075a2008-01-14 23:40:34 -080077 struct in_addr in;
78 struct in6_addr in6;
Jan Engelhardt643a2c12007-12-17 22:43:50 -080079};
80
Linus Torvalds1da177e2005-04-16 15:20:36 -070081#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#ifdef CONFIG_NETFILTER
Florian Westphalf615df72011-01-18 15:52:14 +010083static inline int NF_DROP_GETERR(int verdict)
84{
85 return -(verdict >> NF_VERDICT_QBITS);
86}
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
Patrick McHardyb8beedd2008-03-25 20:09:33 -070088static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
89 const union nf_inet_addr *a2)
90{
91 return a1->all[0] == a2->all[0] &&
92 a1->all[1] == a2->all[1] &&
93 a1->all[2] == a2->all[2] &&
94 a1->all[3] == a2->all[3];
95}
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097extern void netfilter_init(void);
98
99/* Largest hook number + 1 */
100#define NF_MAX_HOOKS 8
101
102struct sk_buff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
104typedef unsigned int nf_hookfn(unsigned int hooknum,
Herbert Xu3db05fe2007-10-15 00:53:15 -0700105 struct sk_buff *skb,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 const struct net_device *in,
107 const struct net_device *out,
108 int (*okfn)(struct sk_buff *));
109
Eric Dumazetd94d9fe2009-11-04 09:50:58 -0800110struct nf_hook_ops {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 struct list_head list;
112
113 /* User fills in from here down. */
114 nf_hookfn *hook;
115 struct module *owner;
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200116 u_int8_t pf;
117 unsigned int hooknum;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 /* Hooks are ordered in ascending priority. */
119 int priority;
120};
121
Eric Dumazetd94d9fe2009-11-04 09:50:58 -0800122struct nf_sockopt_ops {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 struct list_head list;
124
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200125 u_int8_t pf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126
127 /* Non-inclusive ranges: use 0/0/NULL to never get called. */
128 int set_optmin;
129 int set_optmax;
130 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100131#ifdef CONFIG_COMPAT
Dmitry Mishin3fdadf72006-03-20 22:45:21 -0800132 int (*compat_set)(struct sock *sk, int optval,
133 void __user *user, unsigned int len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100134#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 int get_optmin;
136 int get_optmax;
137 int (*get)(struct sock *sk, int optval, void __user *user, int *len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100138#ifdef CONFIG_COMPAT
Dmitry Mishin3fdadf72006-03-20 22:45:21 -0800139 int (*compat_get)(struct sock *sk, int optval,
140 void __user *user, int *len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100141#endif
Neil Horman16fcec32007-09-11 11:28:26 +0200142 /* Use the module struct to lock set/get code in place */
143 struct module *owner;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144};
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146/* Function to register/unregister hook points. */
147int nf_register_hook(struct nf_hook_ops *reg);
148void nf_unregister_hook(struct nf_hook_ops *reg);
Patrick McHardy972d1cb2006-04-06 14:09:12 -0700149int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n);
150void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151
152/* Functions to register get/setsockopt ranges (non-inclusive). You
153 need to check permissions yourself! */
154int nf_register_sockopt(struct nf_sockopt_ops *reg);
155void nf_unregister_sockopt(struct nf_sockopt_ops *reg);
156
Patrick McHardyd62f9ed2006-11-29 02:35:17 +0100157#ifdef CONFIG_SYSCTL
158/* Sysctl registration */
Pavel Emelyanovb3fd3ff2008-01-09 00:34:02 -0800159extern struct ctl_path nf_net_netfilter_sysctl_path[];
160extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[];
Patrick McHardyd62f9ed2006-11-29 02:35:17 +0100161#endif /* CONFIG_SYSCTL */
162
Jan Engelhardt7e9c6ee2008-10-08 11:35:00 +0200163extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Eric Dumazeta2d7ec52011-11-18 17:32:46 +0000165#if defined(CONFIG_JUMP_LABEL)
166#include <linux/jump_label.h>
167extern struct jump_label_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
168static inline bool nf_hooks_active(u_int8_t pf, unsigned int hook)
169{
170 if (__builtin_constant_p(pf) &&
171 __builtin_constant_p(hook))
172 return static_branch(&nf_hooks_needed[pf][hook]);
173
174 return !list_empty(&nf_hooks[pf][hook]);
175}
176#else
177static inline bool nf_hooks_active(u_int8_t pf, unsigned int hook)
178{
179 return !list_empty(&nf_hooks[pf][hook]);
180}
181#endif
182
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200183int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
Patrick McHardy16a66772006-01-06 23:01:48 -0800184 struct net_device *indev, struct net_device *outdev,
185 int (*okfn)(struct sk_buff *), int thresh);
186
187/**
188 * nf_hook_thresh - call a netfilter hook
189 *
190 * Returns 1 if the hook has allowed the packet to pass. The function
191 * okfn must be invoked by the caller in this case. Any other return
192 * value indicates the packet has been consumed by the hook.
193 */
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200194static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
Herbert Xu3db05fe2007-10-15 00:53:15 -0700195 struct sk_buff *skb,
Patrick McHardy16a66772006-01-06 23:01:48 -0800196 struct net_device *indev,
197 struct net_device *outdev,
Jan Engelhardt23f37332009-06-05 17:31:46 +0200198 int (*okfn)(struct sk_buff *), int thresh)
Patrick McHardy16a66772006-01-06 23:01:48 -0800199{
Eric Dumazeta2d7ec52011-11-18 17:32:46 +0000200 if (nf_hooks_active(pf, hook))
201 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh);
202 return 1;
Patrick McHardy16a66772006-01-06 23:01:48 -0800203}
204
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200205static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
Patrick McHardy16a66772006-01-06 23:01:48 -0800206 struct net_device *indev, struct net_device *outdev,
207 int (*okfn)(struct sk_buff *))
208{
Jan Engelhardt23f37332009-06-05 17:31:46 +0200209 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN);
Patrick McHardy16a66772006-01-06 23:01:48 -0800210}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211
212/* Activate hook; either okfn or kfree_skb called, unless a hook
213 returns NF_STOLEN (in which case, it's up to the hook to deal with
214 the consequences).
215
216 Returns -ERRNO if packet dropped. Zero means queued, stolen or
217 accepted.
218*/
219
220/* RR:
221 > I don't want nf_hook to return anything because people might forget
222 > about async and trust the return value to mean "packet was ok".
223
224 AK:
225 Just document it clearly, then you can expect some sense from kernel
226 coders :)
227*/
228
Jan Engelhardt22490652009-06-13 04:13:26 +0200229static inline int
230NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb,
231 struct net_device *in, struct net_device *out,
232 int (*okfn)(struct sk_buff *), int thresh)
233{
234 int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh);
235 if (ret == 1)
236 ret = okfn(skb);
237 return ret;
238}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239
Jan Engelhardt22490652009-06-13 04:13:26 +0200240static inline int
241NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb,
242 struct net_device *in, struct net_device *out,
243 int (*okfn)(struct sk_buff *), bool cond)
244{
Patrick McHardy4bac6b12010-02-19 08:03:28 +0100245 int ret;
246
247 if (!cond ||
Eric Parisac5aa2e2010-11-12 08:26:06 +0100248 ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1))
Jan Engelhardt22490652009-06-13 04:13:26 +0200249 ret = okfn(skb);
250 return ret;
251}
Patrick McHardy16a66772006-01-06 23:01:48 -0800252
Jan Engelhardt22490652009-06-13 04:13:26 +0200253static inline int
254NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb,
255 struct net_device *in, struct net_device *out,
256 int (*okfn)(struct sk_buff *))
257{
258 return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN);
259}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
261/* Call setsockopt() */
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200262int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
David S. Millerb7058842009-09-30 16:12:20 -0700263 unsigned int len);
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200264int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265 int *len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100266#ifdef CONFIG_COMPAT
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200267int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
David S. Millerb7058842009-09-30 16:12:20 -0700268 char __user *opt, unsigned int len);
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200269int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
Dmitry Mishin3fdadf72006-03-20 22:45:21 -0800270 char __user *opt, int *len);
Alexey Dobriyanc30f5402010-02-02 15:03:24 +0100271#endif
Dmitry Mishin3fdadf72006-03-20 22:45:21 -0800272
Harald Welte089af262005-08-09 19:37:23 -0700273/* Call this before modifying an existing packet: ensures it is
274 modifiable and linear to the point you care about (writable_len).
275 Returns true or false. */
Herbert Xu37d41872007-10-14 00:39:18 -0700276extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
Harald Welte089af262005-08-09 19:37:23 -0700277
Patrick McHardy1841a4c2007-12-05 01:22:05 -0800278struct flowi;
Patrick McHardy02f014d2007-12-05 01:26:33 -0800279struct nf_queue_entry;
Patrick McHardyc01cd422007-12-05 01:24:48 -0800280
Patrick McHardybce80322006-04-06 14:18:09 -0700281struct nf_afinfo {
282 unsigned short family;
Al Virob51655b2006-11-14 21:40:42 -0800283 __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook,
Patrick McHardy422c3462006-04-06 14:18:43 -0700284 unsigned int dataoff, u_int8_t protocol);
Patrick McHardyd63a6502008-03-20 15:15:53 +0100285 __sum16 (*checksum_partial)(struct sk_buff *skb,
286 unsigned int hook,
287 unsigned int dataoff,
288 unsigned int len,
289 u_int8_t protocol);
Florian Westphal31ad3dd2011-04-04 16:56:29 +0200290 int (*route)(struct net *net, struct dst_entry **dst,
Florian Westphal0fae2e72011-04-04 17:00:54 +0200291 struct flowi *fl, bool strict);
Patrick McHardybce80322006-04-06 14:18:09 -0700292 void (*saveroute)(const struct sk_buff *skb,
Patrick McHardy02f014d2007-12-05 01:26:33 -0800293 struct nf_queue_entry *entry);
Herbert Xu3db05fe2007-10-15 00:53:15 -0700294 int (*reroute)(struct sk_buff *skb,
Patrick McHardy02f014d2007-12-05 01:26:33 -0800295 const struct nf_queue_entry *entry);
Patrick McHardybce80322006-04-06 14:18:09 -0700296 int route_key_size;
Harald Welte2cc7d572005-08-09 19:42:34 -0700297};
298
Eric Dumazet0e60ebe2010-11-15 18:17:21 +0100299extern const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO];
Patrick McHardy1e796fd2007-12-17 22:42:27 -0800300static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family)
Patrick McHardybce80322006-04-06 14:18:09 -0700301{
302 return rcu_dereference(nf_afinfo[family]);
303}
Harald Welte2cc7d572005-08-09 19:42:34 -0700304
Al Virob51655b2006-11-14 21:40:42 -0800305static inline __sum16
Patrick McHardy422c3462006-04-06 14:18:43 -0700306nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff,
307 u_int8_t protocol, unsigned short family)
308{
Patrick McHardy1e796fd2007-12-17 22:42:27 -0800309 const struct nf_afinfo *afinfo;
Al Virob51655b2006-11-14 21:40:42 -0800310 __sum16 csum = 0;
Patrick McHardy422c3462006-04-06 14:18:43 -0700311
312 rcu_read_lock();
313 afinfo = nf_get_afinfo(family);
314 if (afinfo)
315 csum = afinfo->checksum(skb, hook, dataoff, protocol);
316 rcu_read_unlock();
317 return csum;
318}
319
Patrick McHardyd63a6502008-03-20 15:15:53 +0100320static inline __sum16
321nf_checksum_partial(struct sk_buff *skb, unsigned int hook,
322 unsigned int dataoff, unsigned int len,
323 u_int8_t protocol, unsigned short family)
324{
325 const struct nf_afinfo *afinfo;
326 __sum16 csum = 0;
327
328 rcu_read_lock();
329 afinfo = nf_get_afinfo(family);
330 if (afinfo)
331 csum = afinfo->checksum_partial(skb, hook, dataoff, len,
332 protocol);
333 rcu_read_unlock();
334 return csum;
335}
336
Patrick McHardy1e796fd2007-12-17 22:42:27 -0800337extern int nf_register_afinfo(const struct nf_afinfo *afinfo);
338extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
Patrick McHardybce80322006-04-06 14:18:09 -0700339
Patrick McHardyeb9c7eb2006-01-06 23:06:30 -0800340#include <net/flow.h>
341extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
342
343static inline void
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200344nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
Patrick McHardyeb9c7eb2006-01-06 23:06:30 -0800345{
Patrick McHardy051578c2007-12-17 22:42:51 -0800346#ifdef CONFIG_NF_NAT_NEEDED
Patrick McHardyeb9c7eb2006-01-06 23:06:30 -0800347 void (*decodefn)(struct sk_buff *, struct flowi *);
348
Patrick McHardy051578c2007-12-17 22:42:51 -0800349 if (family == AF_INET) {
350 rcu_read_lock();
351 decodefn = rcu_dereference(ip_nat_decode_session);
352 if (decodefn)
353 decodefn(skb, fl);
354 rcu_read_unlock();
355 }
Patrick McHardyeb9c7eb2006-01-06 23:06:30 -0800356#endif
357}
358
Harald Welte608c8e42005-08-09 19:58:27 -0700359#ifdef CONFIG_PROC_FS
360#include <linux/proc_fs.h>
361extern struct proc_dir_entry *proc_net_netfilter;
362#endif
363
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364#else /* !CONFIG_NETFILTER */
365#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
Patrick McHardy48d5cad2006-02-15 15:10:22 -0800366#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200367static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
Herbert Xu3db05fe2007-10-15 00:53:15 -0700368 struct sk_buff *skb,
David S. Millerf53b61d2006-01-07 12:50:27 -0800369 struct net_device *indev,
370 struct net_device *outdev,
Jan Engelhardt23f37332009-06-05 17:31:46 +0200371 int (*okfn)(struct sk_buff *), int thresh)
David S. Millerf53b61d2006-01-07 12:50:27 -0800372{
Herbert Xu3db05fe2007-10-15 00:53:15 -0700373 return okfn(skb);
David S. Millerf53b61d2006-01-07 12:50:27 -0800374}
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200375static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
David S. Millerf53b61d2006-01-07 12:50:27 -0800376 struct net_device *indev, struct net_device *outdev,
377 int (*okfn)(struct sk_buff *))
378{
Patrick McHardy9c92d342006-02-15 15:18:19 -0800379 return 1;
David S. Millerf53b61d2006-01-07 12:50:27 -0800380}
David S. Millerf53b61d2006-01-07 12:50:27 -0800381struct flowi;
Patrick McHardyeb9c7eb2006-01-06 23:06:30 -0800382static inline void
Jan Engelhardt76108ce2008-10-08 11:35:00 +0200383nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
384{
385}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386#endif /*CONFIG_NETFILTER*/
387
Yasuyuki Kozakai5f79e0f2007-03-23 11:17:07 -0700388#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
Eric Dumazet0e60ebe2010-11-15 18:17:21 +0100389extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu;
Yasuyuki Kozakai5f79e0f2007-03-23 11:17:07 -0700390extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
Eric Dumazet0e60ebe2010-11-15 18:17:21 +0100391extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
Yasuyuki Kozakai5f79e0f2007-03-23 11:17:07 -0700392#else
393static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
394#endif
395
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396#endif /*__KERNEL__*/
397#endif /*__LINUX_NETFILTER_H*/