Blame view
include/linux/netfilter.h
13.5 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4c Linux-2.6.12-rc2 |
2 3 |
#ifndef __LINUX_NETFILTER_H #define __LINUX_NETFILTER_H |
1da177e4c Linux-2.6.12-rc2 |
4 |
#include <linux/init.h> |
1da177e4c Linux-2.6.12-rc2 |
5 6 7 |
#include <linux/skbuff.h> #include <linux/net.h> #include <linux/if.h> |
2e3075a2c [NETFILTER]: Exte... |
8 9 |
#include <linux/in.h> #include <linux/in6.h> |
1da177e4c Linux-2.6.12-rc2 |
10 11 |
#include <linux/wait.h> #include <linux/list.h> |
d1c85c2eb netfilter: HAVE_J... |
12 |
#include <linux/static_key.h> |
a263653ed netfilter: don't ... |
13 |
#include <linux/netfilter_defs.h> |
085db2c04 netfilter: Per ne... |
14 |
#include <linux/netdevice.h> |
c2f12630c netfilter: switch... |
15 |
#include <linux/sockptr.h> |
085db2c04 netfilter: Per ne... |
16 |
#include <net/net_namespace.h> |
a263653ed netfilter: don't ... |
17 |
|
f615df76e netfilter: reduce... |
18 19 20 21 |
static inline int NF_DROP_GETERR(int verdict) { return -(verdict >> NF_VERDICT_QBITS); } |
1da177e4c Linux-2.6.12-rc2 |
22 |
|
b8beedd25 [NETFILTER]: Add ... |
23 24 25 |
static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1, const union nf_inet_addr *a2) { |
01902f8c8 netfilter: optimi... |
26 27 28 29 30 31 |
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 const unsigned long *ul1 = (const unsigned long *)a1; const unsigned long *ul2 = (const unsigned long *)a2; return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL; #else |
b8beedd25 [NETFILTER]: Add ... |
32 33 34 35 |
return a1->all[0] == a2->all[0] && a1->all[1] == a2->all[1] && a1->all[2] == a2->all[2] && a1->all[3] == a2->all[3]; |
01902f8c8 netfilter: optimi... |
36 |
#endif |
b8beedd25 [NETFILTER]: Add ... |
37 |
} |
efdedd542 netfilter: xt_rec... |
38 39 40 41 |
static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, union nf_inet_addr *result, const union nf_inet_addr *mask) { |
522e4077e netfilter: slight... |
42 43 44 45 46 47 48 49 |
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 const unsigned long *ua = (const unsigned long *)a1; unsigned long *ur = (unsigned long *)result; const unsigned long *um = (const unsigned long *)mask; ur[0] = ua[0] & um[0]; ur[1] = ua[1] & um[1]; #else |
efdedd542 netfilter: xt_rec... |
50 51 52 53 |
result->all[0] = a1->all[0] & mask->all[0]; result->all[1] = a1->all[1] & mask->all[1]; result->all[2] = a1->all[2] & mask->all[2]; result->all[3] = a1->all[3] & mask->all[3]; |
522e4077e netfilter: slight... |
54 |
#endif |
efdedd542 netfilter: xt_rec... |
55 |
} |
a0f4ecf34 netfilter: Remove... |
56 |
int netfilter_init(void); |
1da177e4c Linux-2.6.12-rc2 |
57 |
|
1da177e4c Linux-2.6.12-rc2 |
58 |
struct sk_buff; |
1da177e4c Linux-2.6.12-rc2 |
59 |
|
795aa6ef6 netfilter: pass h... |
60 |
struct nf_hook_ops; |
cfdfab314 netfilter: Create... |
61 |
|
1c984f8a5 netfilter: Add so... |
62 |
struct sock; |
cfdfab314 netfilter: Create... |
63 64 |
struct nf_hook_state { unsigned int hook; |
cfdfab314 netfilter: Create... |
65 66 67 |
u_int8_t pf; struct net_device *in; struct net_device *out; |
1c984f8a5 netfilter: Add so... |
68 |
struct sock *sk; |
b11b1f652 netfilter: Store ... |
69 |
struct net *net; |
0c4b51f00 netfilter: Pass n... |
70 |
int (*okfn)(struct net *, struct sock *, struct sk_buff *); |
cfdfab314 netfilter: Create... |
71 |
}; |
e3b37f11e netfilter: replac... |
72 73 74 75 |
typedef unsigned int nf_hookfn(void *priv, struct sk_buff *skb, const struct nf_hook_state *state); struct nf_hook_ops { |
e3b37f11e netfilter: replac... |
76 77 78 79 80 81 82 83 84 85 86 |
/* User fills in from here down. */ nf_hookfn *hook; struct net_device *dev; void *priv; u_int8_t pf; unsigned int hooknum; /* Hooks are ordered in ascending priority. */ int priority; }; struct nf_hook_entry { |
d415b9eb7 netfilter: decoup... |
87 88 |
nf_hookfn *hook; void *priv; |
e3b37f11e netfilter: replac... |
89 |
}; |
8c873e219 netfilter: core: ... |
90 91 92 93 |
struct nf_hook_entries_rcu_head { struct rcu_head head; void *allocation; }; |
960632ece netfilter: conver... |
94 95 96 97 |
struct nf_hook_entries { u16 num_hook_entries; /* padding */ struct nf_hook_entry hooks[]; |
8c873e219 netfilter: core: ... |
98 99 100 |
/* trailer: pointers to original orig_ops of each hook, * followed by rcu_head and scratch space used for freeing * the structure via call_rcu. |
960632ece netfilter: conver... |
101 |
* |
8c873e219 netfilter: core: ... |
102 103 |
* This is not part of struct nf_hook_entry since its only * needed in slow path (hook register/unregister): |
960632ece netfilter: conver... |
104 |
* const struct nf_hook_ops *orig_ops[] |
8c873e219 netfilter: core: ... |
105 106 107 108 109 |
* * For the same reason, we store this at end -- its * only needed when a hook is deleted, not during * packet path processing: * struct nf_hook_entries_rcu_head head |
960632ece netfilter: conver... |
110 111 |
*/ }; |
0aa8c57a0 netfilter: introd... |
112 |
|
f19438bdd netfilter: remove... |
113 |
#ifdef CONFIG_NETFILTER |
960632ece netfilter: conver... |
114 |
static inline struct nf_hook_ops **nf_hook_entries_get_hook_ops(const struct nf_hook_entries *e) |
0aa8c57a0 netfilter: introd... |
115 |
{ |
960632ece netfilter: conver... |
116 117 118 119 120 121 |
unsigned int n = e->num_hook_entries; const void *hook_end; hook_end = &e->hooks[n]; /* this is *past* ->hooks[]! */ return (struct nf_hook_ops **)hook_end; |
0aa8c57a0 netfilter: introd... |
122 123 124 125 126 127 |
} static inline int nf_hook_entry_hookfn(const struct nf_hook_entry *entry, struct sk_buff *skb, struct nf_hook_state *state) { |
d415b9eb7 netfilter: decoup... |
128 |
return entry->hook(entry->priv, skb, state); |
0aa8c57a0 netfilter: introd... |
129 |
} |
107a9f4dc netfilter: Add nf... |
130 131 |
static inline void nf_hook_state_init(struct nf_hook_state *p, unsigned int hook, |
1610a73c4 netfilter: kill N... |
132 |
u_int8_t pf, |
107a9f4dc netfilter: Add nf... |
133 134 |
struct net_device *indev, struct net_device *outdev, |
1c984f8a5 netfilter: Add so... |
135 |
struct sock *sk, |
b11b1f652 netfilter: Store ... |
136 |
struct net *net, |
0c4b51f00 netfilter: Pass n... |
137 |
int (*okfn)(struct net *, struct sock *, struct sk_buff *)) |
107a9f4dc netfilter: Add nf... |
138 139 |
{ p->hook = hook; |
107a9f4dc netfilter: Add nf... |
140 141 142 |
p->pf = pf; p->in = indev; p->out = outdev; |
1c984f8a5 netfilter: Add so... |
143 |
p->sk = sk; |
b11b1f652 netfilter: Store ... |
144 |
p->net = net; |
107a9f4dc netfilter: Add nf... |
145 146 |
p->okfn = okfn; } |
1da177e4c Linux-2.6.12-rc2 |
147 |
|
1da177e4c Linux-2.6.12-rc2 |
148 |
|
d94d9fee9 net: cleanup incl... |
149 |
struct nf_sockopt_ops { |
1da177e4c Linux-2.6.12-rc2 |
150 |
struct list_head list; |
76108cea0 netfilter: Use un... |
151 |
u_int8_t pf; |
1da177e4c Linux-2.6.12-rc2 |
152 153 154 155 |
/* Non-inclusive ranges: use 0/0/NULL to never get called. */ int set_optmin; int set_optmax; |
c2f12630c netfilter: switch... |
156 157 |
int (*set)(struct sock *sk, int optval, sockptr_t arg, unsigned int len); |
1da177e4c Linux-2.6.12-rc2 |
158 159 160 |
int get_optmin; int get_optmax; int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
16fcec35e [NETFILTER]: Fix/... |
161 162 |
/* Use the module struct to lock set/get code in place */ struct module *owner; |
1da177e4c Linux-2.6.12-rc2 |
163 |
}; |
1da177e4c Linux-2.6.12-rc2 |
164 |
/* Function to register/unregister hook points. */ |
085db2c04 netfilter: Per ne... |
165 166 167 168 169 170 |
int nf_register_net_hook(struct net *net, const struct nf_hook_ops *ops); void nf_unregister_net_hook(struct net *net, const struct nf_hook_ops *ops); int nf_register_net_hooks(struct net *net, const struct nf_hook_ops *reg, unsigned int n); void nf_unregister_net_hooks(struct net *net, const struct nf_hook_ops *reg, unsigned int n); |
1da177e4c Linux-2.6.12-rc2 |
171 172 173 174 |
/* Functions to register get/setsockopt ranges (non-inclusive). You need to check permissions yourself! */ int nf_register_sockopt(struct nf_sockopt_ops *reg); void nf_unregister_sockopt(struct nf_sockopt_ops *reg); |
e9666d10a jump_label: move ... |
175 |
#ifdef CONFIG_JUMP_LABEL |
c5905afb0 static keys: Intr... |
176 |
extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; |
a2d7ec58a netfilter: use ju... |
177 |
#endif |
01886bd91 netfilter: remove... |
178 |
int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state, |
960632ece netfilter: conver... |
179 |
const struct nf_hook_entries *e, unsigned int i); |
16a6677fd [XFRM]: Netfilter... |
180 |
|
ca58fbe06 netfilter: add an... |
181 182 |
void nf_hook_slow_list(struct list_head *head, struct nf_hook_state *state, const struct nf_hook_entries *e); |
16a6677fd [XFRM]: Netfilter... |
183 |
/** |
1610a73c4 netfilter: kill N... |
184 |
* nf_hook - call a netfilter hook |
b8d0aad0c netfilter: add nf... |
185 |
* |
16a6677fd [XFRM]: Netfilter... |
186 187 188 189 |
* Returns 1 if the hook has allowed the packet to pass. The function * okfn must be invoked by the caller in this case. Any other return * value indicates the packet has been consumed by the hook. */ |
1610a73c4 netfilter: kill N... |
190 191 192 193 |
static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct net *, struct sock *, struct sk_buff *)) |
16a6677fd [XFRM]: Netfilter... |
194 |
{ |
b0f38338a netfilter: reduce... |
195 |
struct nf_hook_entries *hook_head = NULL; |
e3b37f11e netfilter: replac... |
196 |
int ret = 1; |
af4610c39 netfilter: don't ... |
197 |
|
e9666d10a jump_label: move ... |
198 |
#ifdef CONFIG_JUMP_LABEL |
af4610c39 netfilter: don't ... |
199 200 201 202 203 |
if (__builtin_constant_p(pf) && __builtin_constant_p(hook) && !static_key_false(&nf_hooks_needed[pf][hook])) return 1; #endif |
e3b37f11e netfilter: replac... |
204 |
rcu_read_lock(); |
b0f38338a netfilter: reduce... |
205 206 207 208 209 210 211 212 |
switch (pf) { case NFPROTO_IPV4: hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); break; case NFPROTO_IPV6: hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]); break; case NFPROTO_ARP: |
2a95183a5 netfilter: don't ... |
213 |
#ifdef CONFIG_NETFILTER_FAMILY_ARP |
421c119f5 netfilter: avoid ... |
214 215 |
if (WARN_ON_ONCE(hook >= ARRAY_SIZE(net->nf.hooks_arp))) break; |
b0f38338a netfilter: reduce... |
216 |
hook_head = rcu_dereference(net->nf.hooks_arp[hook]); |
2a95183a5 netfilter: don't ... |
217 |
#endif |
b0f38338a netfilter: reduce... |
218 219 |
break; case NFPROTO_BRIDGE: |
2a95183a5 netfilter: don't ... |
220 |
#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE |
b0f38338a netfilter: reduce... |
221 |
hook_head = rcu_dereference(net->nf.hooks_bridge[hook]); |
2a95183a5 netfilter: don't ... |
222 |
#endif |
b0f38338a netfilter: reduce... |
223 |
break; |
bb4badf3a netfilter: don't ... |
224 |
#if IS_ENABLED(CONFIG_DECNET) |
b0f38338a netfilter: reduce... |
225 226 227 |
case NFPROTO_DECNET: hook_head = rcu_dereference(net->nf.hooks_decnet[hook]); break; |
bb4badf3a netfilter: don't ... |
228 |
#endif |
b0f38338a netfilter: reduce... |
229 230 231 232 |
default: WARN_ON_ONCE(1); break; } |
e3b37f11e netfilter: replac... |
233 |
if (hook_head) { |
107a9f4dc netfilter: Add nf... |
234 |
struct nf_hook_state state; |
cfdfab314 netfilter: Create... |
235 |
|
01886bd91 netfilter: remove... |
236 |
nf_hook_state_init(&state, hook, pf, indev, outdev, |
1610a73c4 netfilter: kill N... |
237 |
sk, net, okfn); |
fe72926b7 netfilter: call n... |
238 |
|
960632ece netfilter: conver... |
239 |
ret = nf_hook_slow(skb, &state, hook_head, 0); |
cfdfab314 netfilter: Create... |
240 |
} |
e3b37f11e netfilter: replac... |
241 242 243 |
rcu_read_unlock(); return ret; |
16a6677fd [XFRM]: Netfilter... |
244 |
} |
1da177e4c Linux-2.6.12-rc2 |
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
/* Activate hook; either okfn or kfree_skb called, unless a hook returns NF_STOLEN (in which case, it's up to the hook to deal with the consequences). Returns -ERRNO if packet dropped. Zero means queued, stolen or accepted. */ /* RR: > I don't want nf_hook to return anything because people might forget > about async and trust the return value to mean "packet was ok". AK: Just document it clearly, then you can expect some sense from kernel coders :) */ |
2249065f4 netfilter: get ri... |
261 |
static inline int |
29a26a568 netfilter: Pass s... |
262 |
NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, |
7026b1ddb netfilter: Pass s... |
263 |
struct sk_buff *skb, struct net_device *in, struct net_device *out, |
0c4b51f00 netfilter: Pass n... |
264 265 |
int (*okfn)(struct net *, struct sock *, struct sk_buff *), bool cond) |
2249065f4 netfilter: get ri... |
266 |
{ |
4bac6b180 netfilter: restor... |
267 268 269 |
int ret; if (!cond || |
1610a73c4 netfilter: kill N... |
270 |
((ret = nf_hook(pf, hook, net, sk, skb, in, out, okfn)) == 1)) |
0c4b51f00 netfilter: Pass n... |
271 |
ret = okfn(net, sk, skb); |
2249065f4 netfilter: get ri... |
272 273 |
return ret; } |
1da177e4c Linux-2.6.12-rc2 |
274 |
|
2249065f4 netfilter: get ri... |
275 |
static inline int |
29a26a568 netfilter: Pass s... |
276 |
NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, |
2249065f4 netfilter: get ri... |
277 |
struct net_device *in, struct net_device *out, |
0c4b51f00 netfilter: Pass n... |
278 |
int (*okfn)(struct net *, struct sock *, struct sk_buff *)) |
2249065f4 netfilter: get ri... |
279 |
{ |
1610a73c4 netfilter: kill N... |
280 281 282 283 |
int ret = nf_hook(pf, hook, net, sk, skb, in, out, okfn); if (ret == 1) ret = okfn(net, sk, skb); return ret; |
2249065f4 netfilter: get ri... |
284 |
} |
1da177e4c Linux-2.6.12-rc2 |
285 |
|
17266ee93 net: ipv4: listif... |
286 287 288 289 290 |
static inline void NF_HOOK_LIST(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct list_head *head, struct net_device *in, struct net_device *out, int (*okfn)(struct net *, struct sock *, struct sk_buff *)) { |
ca58fbe06 netfilter: add an... |
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
struct nf_hook_entries *hook_head = NULL; #ifdef CONFIG_JUMP_LABEL if (__builtin_constant_p(pf) && __builtin_constant_p(hook) && !static_key_false(&nf_hooks_needed[pf][hook])) return; #endif rcu_read_lock(); switch (pf) { case NFPROTO_IPV4: hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); break; case NFPROTO_IPV6: hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]); break; default: WARN_ON_ONCE(1); break; |
17266ee93 net: ipv4: listif... |
311 |
} |
ca58fbe06 netfilter: add an... |
312 313 314 315 316 317 318 319 320 |
if (hook_head) { struct nf_hook_state state; nf_hook_state_init(&state, hook, pf, in, out, sk, net, okfn); nf_hook_slow_list(head, &state, hook_head); } rcu_read_unlock(); |
17266ee93 net: ipv4: listif... |
321 |
} |
1da177e4c Linux-2.6.12-rc2 |
322 |
/* Call setsockopt() */ |
c2f12630c netfilter: switch... |
323 |
int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, sockptr_t opt, |
b7058842c net: Make setsock... |
324 |
unsigned int len); |
76108cea0 netfilter: Use un... |
325 |
int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
1da177e4c Linux-2.6.12-rc2 |
326 |
int *len); |
3fdadf7d2 [NET]: {get|set}s... |
327 |
|
1841a4c7a [NETFILTER]: nf_c... |
328 |
struct flowi; |
02f014d88 [NETFILTER]: nf_q... |
329 |
struct nf_queue_entry; |
c01cd429f [NETFILTER]: nf_q... |
330 |
|
ef71fe27e netfilter: move c... |
331 332 333 |
__sum16 nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, u_int8_t protocol, unsigned short family); |
422c346fa [NETFILTER]: Add ... |
334 |
|
f7dcbe2f3 netfilter: move c... |
335 336 337 |
__sum16 nf_checksum_partial(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, unsigned int len, u_int8_t protocol, unsigned short family); |
3f87c08c6 netfilter: move r... |
338 339 |
int nf_route(struct net *net, struct dst_entry **dst, struct flowi *fl, bool strict, unsigned short family); |
ce388f452 netfilter: move r... |
340 |
int nf_reroute(struct sk_buff *skb, struct nf_queue_entry *entry); |
d63a65073 [NETFILTER]: Add ... |
341 |
|
eb9c7ebe6 [NETFILTER]: Hand... |
342 |
#include <net/flow.h> |
2c205dd39 netfilter: add st... |
343 344 345 346 |
struct nf_conn; enum nf_nat_manip_type; struct nlattr; |
368982cd7 netfilter: nfnetl... |
347 |
enum ip_conntrack_dir; |
2c205dd39 netfilter: add st... |
348 349 350 351 352 |
struct nf_nat_hook { int (*parse_nat_setup)(struct nf_conn *ct, enum nf_nat_manip_type manip, const struct nlattr *attr); void (*decode_session)(struct sk_buff *skb, struct flowi *fl); |
368982cd7 netfilter: nfnetl... |
353 354 355 |
unsigned int (*manip_pkt)(struct sk_buff *skb, struct nf_conn *ct, enum nf_nat_manip_type mtype, enum ip_conntrack_dir dir); |
2c205dd39 netfilter: add st... |
356 357 358 |
}; extern struct nf_nat_hook __rcu *nf_nat_hook; |
eb9c7ebe6 [NETFILTER]: Hand... |
359 360 |
static inline void |
76108cea0 netfilter: Use un... |
361 |
nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
eb9c7ebe6 [NETFILTER]: Hand... |
362 |
{ |
4806e9757 netfilter: replac... |
363 |
#if IS_ENABLED(CONFIG_NF_NAT) |
2c205dd39 netfilter: add st... |
364 |
struct nf_nat_hook *nat_hook; |
eb9c7ebe6 [NETFILTER]: Hand... |
365 |
|
c7232c997 netfilter: add pr... |
366 |
rcu_read_lock(); |
2c205dd39 netfilter: add st... |
367 |
nat_hook = rcu_dereference(nf_nat_hook); |
155fb5c5f netfilter: fix nu... |
368 |
if (nat_hook && nat_hook->decode_session) |
2c205dd39 netfilter: add st... |
369 |
nat_hook->decode_session(skb, fl); |
c7232c997 netfilter: add pr... |
370 |
rcu_read_unlock(); |
eb9c7ebe6 [NETFILTER]: Hand... |
371 372 |
#endif } |
1da177e4c Linux-2.6.12-rc2 |
373 |
#else /* !CONFIG_NETFILTER */ |
008027c31 netfilter: turn N... |
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
static inline int NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, struct net_device *in, struct net_device *out, int (*okfn)(struct net *, struct sock *, struct sk_buff *), bool cond) { return okfn(net, sk, skb); } static inline int NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, struct net_device *in, struct net_device *out, int (*okfn)(struct net *, struct sock *, struct sk_buff *)) { return okfn(net, sk, skb); } |
17266ee93 net: ipv4: listif... |
390 391 392 393 394 395 396 |
static inline void NF_HOOK_LIST(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct list_head *head, struct net_device *in, struct net_device *out, int (*okfn)(struct net *, struct sock *, struct sk_buff *)) { /* nothing to do */ } |
29a26a568 netfilter: Pass s... |
397 398 399 |
static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, struct net_device *indev, struct net_device *outdev, |
0c4b51f00 netfilter: Pass n... |
400 |
int (*okfn)(struct net *, struct sock *, struct sk_buff *)) |
f53b61d8c [NETFILTER]: Add ... |
401 |
{ |
9c92d3486 [NETFILTER]: Don'... |
402 |
return 1; |
f53b61d8c [NETFILTER]: Add ... |
403 |
} |
f53b61d8c [NETFILTER]: Add ... |
404 |
struct flowi; |
eb9c7ebe6 [NETFILTER]: Hand... |
405 |
static inline void |
76108cea0 netfilter: Use un... |
406 407 408 |
nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) { } |
1da177e4c Linux-2.6.12-rc2 |
409 |
#endif /*CONFIG_NETFILTER*/ |
25d7cbcd2 netfilter: replac... |
410 |
#if IS_ENABLED(CONFIG_NF_CONNTRACK) |
62da98656 netfilter: nf_con... |
411 |
#include <linux/netfilter/nf_conntrack_zones_common.h> |
312a0c16c netfilter: nf_con... |
412 |
extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu; |
a0f4ecf34 netfilter: Remove... |
413 |
void nf_ct_attach(struct sk_buff *, const struct sk_buff *); |
b60a60405 netfilter: Add nf... |
414 415 416 |
struct nf_conntrack_tuple; bool nf_ct_get_tuple_skb(struct nf_conntrack_tuple *dst_tuple, const struct sk_buff *skb); |
b7bd1809e netfilter: nfnetl... |
417 418 |
#else static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
b60a60405 netfilter: Add nf... |
419 420 421 422 423 424 |
struct nf_conntrack_tuple; static inline bool nf_ct_get_tuple_skb(struct nf_conntrack_tuple *dst_tuple, const struct sk_buff *skb) { return false; } |
b7bd1809e netfilter: nfnetl... |
425 |
#endif |
9cb017665 netfilter: add gl... |
426 427 |
struct nf_conn; |
41d73ec05 netfilter: nf_con... |
428 |
enum ip_conntrack_info; |
1f4b24397 netfilter: add st... |
429 430 |
struct nf_ct_hook { |
368982cd7 netfilter: nfnetl... |
431 |
int (*update)(struct net *net, struct sk_buff *skb); |
1f4b24397 netfilter: add st... |
432 |
void (*destroy)(struct nf_conntrack *); |
b60a60405 netfilter: Add nf... |
433 434 |
bool (*get_tuple_skb)(struct nf_conntrack_tuple *, const struct sk_buff *); |
1f4b24397 netfilter: add st... |
435 436 |
}; extern struct nf_ct_hook __rcu *nf_ct_hook; |
9cb017665 netfilter: add gl... |
437 |
struct nlattr; |
a4b4766c3 netfilter: nfnetl... |
438 |
struct nfnl_ct_hook { |
224a05975 netfilter: ctnetl... |
439 |
struct nf_conn *(*get_ct)(const struct sk_buff *skb, |
b7bd1809e netfilter: nfnetl... |
440 |
enum ip_conntrack_info *ctinfo); |
9cb017665 netfilter: add gl... |
441 |
size_t (*build_size)(const struct nf_conn *ct); |
b7bd1809e netfilter: nfnetl... |
442 443 444 |
int (*build)(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info ctinfo, u_int16_t ct_attr, u_int16_t ct_info_attr); |
9cb017665 netfilter: add gl... |
445 |
int (*parse)(const struct nlattr *attr, struct nf_conn *ct); |
bd0779370 netfilter: nfnetl... |
446 447 |
int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct, u32 portid, u32 report); |
8c88f87cb netfilter: nfnetl... |
448 |
void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, |
41d73ec05 netfilter: nf_con... |
449 |
enum ip_conntrack_info ctinfo, s32 off); |
9cb017665 netfilter: add gl... |
450 |
}; |
a4b4766c3 netfilter: nfnetl... |
451 |
extern struct nfnl_ct_hook __rcu *nfnl_ct_hook; |
5f79e0f91 [NETFILTER]: nf_c... |
452 |
|
e7c8899f3 netfilter: move t... |
453 454 455 456 457 458 459 460 461 462 |
/** * nf_skb_duplicated - TEE target has sent a packet * * When a xtables target sends a packet, the OUTPUT and POSTROUTING * hooks are traversed again, i.e. nft and xtables are invoked recursively. * * This is used by xtables TEE target to prevent the duplicated skb from * being duplicated again. */ DECLARE_PER_CPU(bool, nf_skb_duplicated); |
1da177e4c Linux-2.6.12-rc2 |
463 |
#endif /*__LINUX_NETFILTER_H*/ |