aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipv6.h1
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_tuple_common.h3
-rw-r--r--include/linux/netfilter/x_tables.h36
-rw-r--r--include/linux/netfilter/xt_CONNMARK.h22
-rw-r--r--include/linux/netfilter/xt_MARK.h6
-rw-r--r--include/linux/netfilter/xt_TEE.h12
-rw-r--r--include/linux/netfilter/xt_connmark.h11
-rw-r--r--include/linux/netfilter/xt_mark.h4
-rw-r--r--include/linux/netfilter/xt_recent.h7
-rw-r--r--include/linux/netfilter_bridge.h22
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h4
-rw-r--r--include/net/neighbour.h14
14 files changed, 99 insertions, 50 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e0cc9a7db2b5..7bdf6ffe2b49 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -250,6 +250,7 @@ struct inet6_skb_parm {
250 250
251#define IP6SKB_XFRM_TRANSFORMED 1 251#define IP6SKB_XFRM_TRANSFORMED 1
252#define IP6SKB_FORWARDED 2 252#define IP6SKB_FORWARDED 2
253#define IP6SKB_REROUTED 4
253}; 254};
254 255
255#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 256#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 9365227dbaf6..a38d6bd6fde6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -4,6 +4,8 @@
4/* 4/*
5 * 'kernel.h' contains some often-used function prototypes etc 5 * 'kernel.h' contains some often-used function prototypes etc
6 */ 6 */
7#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
8#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
7 9
8#ifdef __KERNEL__ 10#ifdef __KERNEL__
9 11
@@ -37,8 +39,8 @@ extern const char linux_proc_banner[];
37 39
38#define STACK_MAGIC 0xdeadbeef 40#define STACK_MAGIC 0xdeadbeef
39 41
40#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 42#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
41#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 43#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
42#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 44#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
43#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 45#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
44 46
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index a5a63e41b8af..48767cd16453 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -16,6 +16,7 @@ header-y += xt_RATEEST.h
16header-y += xt_SECMARK.h 16header-y += xt_SECMARK.h
17header-y += xt_TCPMSS.h 17header-y += xt_TCPMSS.h
18header-y += xt_TCPOPTSTRIP.h 18header-y += xt_TCPOPTSTRIP.h
19header-y += xt_TEE.h
19header-y += xt_TPROXY.h 20header-y += xt_TPROXY.h
20header-y += xt_comment.h 21header-y += xt_comment.h
21header-y += xt_connbytes.h 22header-y += xt_connbytes.h
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h
index 8e145f0d61cb..2ea22b018a87 100644
--- a/include/linux/netfilter/nf_conntrack_tuple_common.h
+++ b/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -1,8 +1,7 @@
1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H 1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
2#define _NF_CONNTRACK_TUPLE_COMMON_H 2#define _NF_CONNTRACK_TUPLE_COMMON_H
3 3
4enum ip_conntrack_dir 4enum ip_conntrack_dir {
5{
6 IP_CT_DIR_ORIGINAL, 5 IP_CT_DIR_ORIGINAL,
7 IP_CT_DIR_REPLY, 6 IP_CT_DIR_REPLY,
8 IP_CT_DIR_MAX 7 IP_CT_DIR_MAX
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 84c7c928e9eb..50c867256ca3 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,6 +1,6 @@
1#ifndef _X_TABLES_H 1#ifndef _X_TABLES_H
2#define _X_TABLES_H 2#define _X_TABLES_H
3 3#include <linux/kernel.h>
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define XT_FUNCTION_MAXNAMELEN 30 6#define XT_FUNCTION_MAXNAMELEN 30
@@ -93,7 +93,7 @@ struct _xt_align {
93 __u64 u64; 93 __u64 u64;
94}; 94};
95 95
96#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) 96#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
97 97
98/* Standard return verdict, or do jump. */ 98/* Standard return verdict, or do jump. */
99#define XT_STANDARD_TARGET "" 99#define XT_STANDARD_TARGET ""
@@ -197,6 +197,7 @@ struct xt_counters_info {
197 * @family: Actual NFPROTO_* through which the function is invoked 197 * @family: Actual NFPROTO_* through which the function is invoked
198 * (helpful when match->family == NFPROTO_UNSPEC) 198 * (helpful when match->family == NFPROTO_UNSPEC)
199 * @hotdrop: drop packet if we had inspection problems 199 * @hotdrop: drop packet if we had inspection problems
200 * Network namespace obtainable using dev_net(in/out)
200 */ 201 */
201struct xt_match_param { 202struct xt_match_param {
202 const struct net_device *in, *out; 203 const struct net_device *in, *out;
@@ -213,12 +214,14 @@ struct xt_match_param {
213 * struct xt_mtchk_param - parameters for match extensions' 214 * struct xt_mtchk_param - parameters for match extensions'
214 * checkentry functions 215 * checkentry functions
215 * 216 *
217 * @net: network namespace through which the check was invoked
216 * @table: table the rule is tried to be inserted into 218 * @table: table the rule is tried to be inserted into
217 * @entryinfo: the family-specific rule data 219 * @entryinfo: the family-specific rule data
218 * (struct ipt_ip, ip6t_ip, ebt_entry) 220 * (struct ipt_ip, ip6t_ip, arpt_arp or (note) ebt_entry)
219 * @match: struct xt_match through which this function was invoked 221 * @match: struct xt_match through which this function was invoked
220 * @matchinfo: per-match data 222 * @matchinfo: per-match data
221 * @hook_mask: via which hooks the new rule is reachable 223 * @hook_mask: via which hooks the new rule is reachable
224 * Other fields as above.
222 */ 225 */
223struct xt_mtchk_param { 226struct xt_mtchk_param {
224 struct net *net; 227 struct net *net;
@@ -230,7 +233,10 @@ struct xt_mtchk_param {
230 u_int8_t family; 233 u_int8_t family;
231}; 234};
232 235
233/* Match destructor parameters */ 236/**
237 * struct xt_mdtor_param - match destructor parameters
238 * Fields as above.
239 */
234struct xt_mtdtor_param { 240struct xt_mtdtor_param {
235 struct net *net; 241 struct net *net;
236 const struct xt_match *match; 242 const struct xt_match *match;
@@ -297,7 +303,7 @@ struct xt_match {
297 const struct xt_match_param *); 303 const struct xt_match_param *);
298 304
299 /* Called when user tries to insert an entry of this type. */ 305 /* Called when user tries to insert an entry of this type. */
300 bool (*checkentry)(const struct xt_mtchk_param *); 306 int (*checkentry)(const struct xt_mtchk_param *);
301 307
302 /* Called when entry of this type deleted. */ 308 /* Called when entry of this type deleted. */
303 void (*destroy)(const struct xt_mtdtor_param *); 309 void (*destroy)(const struct xt_mtdtor_param *);
@@ -309,9 +315,6 @@ struct xt_match {
309 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 315 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
310 struct module *me; 316 struct module *me;
311 317
312 /* Free to use by each match */
313 unsigned long data;
314
315 const char *table; 318 const char *table;
316 unsigned int matchsize; 319 unsigned int matchsize;
317#ifdef CONFIG_COMPAT 320#ifdef CONFIG_COMPAT
@@ -328,6 +331,7 @@ struct xt_target {
328 struct list_head list; 331 struct list_head list;
329 332
330 const char name[XT_FUNCTION_MAXNAMELEN-1]; 333 const char name[XT_FUNCTION_MAXNAMELEN-1];
334 u_int8_t revision;
331 335
332 /* Returns verdict. Argument order changed since 2.6.9, as this 336 /* Returns verdict. Argument order changed since 2.6.9, as this
333 must now handle non-linear skbs, using skb_copy_bits and 337 must now handle non-linear skbs, using skb_copy_bits and
@@ -338,8 +342,8 @@ struct xt_target {
338 /* Called when user tries to insert an entry of this type: 342 /* Called when user tries to insert an entry of this type:
339 hook_mask is a bitmask of hooks from which it can be 343 hook_mask is a bitmask of hooks from which it can be
340 called. */ 344 called. */
341 /* Should return true or false. */ 345 /* Should return true or false, or an error code (-Exxxx). */
342 bool (*checkentry)(const struct xt_tgchk_param *); 346 int (*checkentry)(const struct xt_tgchk_param *);
343 347
344 /* Called when entry of this type deleted. */ 348 /* Called when entry of this type deleted. */
345 void (*destroy)(const struct xt_tgdtor_param *); 349 void (*destroy)(const struct xt_tgdtor_param *);
@@ -360,7 +364,6 @@ struct xt_target {
360 unsigned short proto; 364 unsigned short proto;
361 365
362 unsigned short family; 366 unsigned short family;
363 u_int8_t revision;
364}; 367};
365 368
366/* Furniture shopping... */ 369/* Furniture shopping... */
@@ -398,6 +401,13 @@ struct xt_table_info {
398 unsigned int hook_entry[NF_INET_NUMHOOKS]; 401 unsigned int hook_entry[NF_INET_NUMHOOKS];
399 unsigned int underflow[NF_INET_NUMHOOKS]; 402 unsigned int underflow[NF_INET_NUMHOOKS];
400 403
404 /*
405 * Number of user chains. Since tables cannot have loops, at most
406 * @stacksize jumps (number of user chains) can possibly be made.
407 */
408 unsigned int stacksize;
409 unsigned int *stackptr;
410 void ***jumpstack;
401 /* ipt_entry tables: one per CPU */ 411 /* ipt_entry tables: one per CPU */
402 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ 412 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
403 void *entries[1]; 413 void *entries[1];
@@ -433,6 +443,8 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table,
433 443
434extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); 444extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
435extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); 445extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
446extern struct xt_match *xt_request_find_match(u8 af, const char *name,
447 u8 revision);
436extern struct xt_target *xt_request_find_target(u8 af, const char *name, 448extern struct xt_target *xt_request_find_target(u8 af, const char *name,
437 u8 revision); 449 u8 revision);
438extern int xt_find_revision(u8 af, const char *name, u8 revision, 450extern int xt_find_revision(u8 af, const char *name, u8 revision,
@@ -598,7 +610,7 @@ struct _compat_xt_align {
598 compat_u64 u64; 610 compat_u64 u64;
599}; 611};
600 612
601#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) 613#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
602 614
603extern void xt_compat_lock(u_int8_t af); 615extern void xt_compat_lock(u_int8_t af);
604extern void xt_compat_unlock(u_int8_t af); 616extern void xt_compat_unlock(u_int8_t af);
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h
index 0a8545866752..2f2e48ec8023 100644
--- a/include/linux/netfilter/xt_CONNMARK.h
+++ b/include/linux/netfilter/xt_CONNMARK.h
@@ -1,26 +1,6 @@
1#ifndef _XT_CONNMARK_H_target 1#ifndef _XT_CONNMARK_H_target
2#define _XT_CONNMARK_H_target 2#define _XT_CONNMARK_H_target
3 3
4#include <linux/types.h> 4#include <linux/netfilter/xt_connmark.h>
5
6/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
7 * by Henrik Nordstrom <hno@marasystems.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15enum {
16 XT_CONNMARK_SET = 0,
17 XT_CONNMARK_SAVE,
18 XT_CONNMARK_RESTORE
19};
20
21struct xt_connmark_tginfo1 {
22 __u32 ctmark, ctmask, nfmask;
23 __u8 mode;
24};
25 5
26#endif /*_XT_CONNMARK_H_target*/ 6#endif /*_XT_CONNMARK_H_target*/
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h
index bc9561bdef79..41c456deba22 100644
--- a/include/linux/netfilter/xt_MARK.h
+++ b/include/linux/netfilter/xt_MARK.h
@@ -1,10 +1,6 @@
1#ifndef _XT_MARK_H_target 1#ifndef _XT_MARK_H_target
2#define _XT_MARK_H_target 2#define _XT_MARK_H_target
3 3
4#include <linux/types.h> 4#include <linux/netfilter/xt_mark.h>
5
6struct xt_mark_tginfo2 {
7 __u32 mark, mask;
8};
9 5
10#endif /*_XT_MARK_H_target */ 6#endif /*_XT_MARK_H_target */
diff --git a/include/linux/netfilter/xt_TEE.h b/include/linux/netfilter/xt_TEE.h
new file mode 100644
index 000000000000..5c21d5c829af
--- /dev/null
+++ b/include/linux/netfilter/xt_TEE.h
@@ -0,0 +1,12 @@
1#ifndef _XT_TEE_TARGET_H
2#define _XT_TEE_TARGET_H
3
4struct xt_tee_tginfo {
5 union nf_inet_addr gw;
6 char oif[16];
7
8 /* used internally by the kernel */
9 struct xt_tee_priv *priv __attribute__((aligned(8)));
10};
11
12#endif /* _XT_TEE_TARGET_H */
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h
index 619e47cde01a..efc17a8305fb 100644
--- a/include/linux/netfilter/xt_connmark.h
+++ b/include/linux/netfilter/xt_connmark.h
@@ -12,6 +12,17 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15enum {
16 XT_CONNMARK_SET = 0,
17 XT_CONNMARK_SAVE,
18 XT_CONNMARK_RESTORE
19};
20
21struct xt_connmark_tginfo1 {
22 __u32 ctmark, ctmask, nfmask;
23 __u8 mode;
24};
25
15struct xt_connmark_mtinfo1 { 26struct xt_connmark_mtinfo1 {
16 __u32 mark, mask; 27 __u32 mark, mask;
17 __u8 invert; 28 __u8 invert;
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h
index 6607c8f38ea5..ecadc40d5cde 100644
--- a/include/linux/netfilter/xt_mark.h
+++ b/include/linux/netfilter/xt_mark.h
@@ -3,6 +3,10 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct xt_mark_tginfo2 {
7 __u32 mark, mask;
8};
9
6struct xt_mark_mtinfo1 { 10struct xt_mark_mtinfo1 {
7 __u32 mark, mask; 11 __u32 mark, mask;
8 __u8 invert; 12 __u8 invert;
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h
index d2c276609925..83318e01425e 100644
--- a/include/linux/netfilter/xt_recent.h
+++ b/include/linux/netfilter/xt_recent.h
@@ -9,6 +9,7 @@ enum {
9 XT_RECENT_UPDATE = 1 << 2, 9 XT_RECENT_UPDATE = 1 << 2,
10 XT_RECENT_REMOVE = 1 << 3, 10 XT_RECENT_REMOVE = 1 << 3,
11 XT_RECENT_TTL = 1 << 4, 11 XT_RECENT_TTL = 1 << 4,
12 XT_RECENT_REAP = 1 << 5,
12 13
13 XT_RECENT_SOURCE = 0, 14 XT_RECENT_SOURCE = 0,
14 XT_RECENT_DEST = 1, 15 XT_RECENT_DEST = 1,
@@ -16,6 +17,12 @@ enum {
16 XT_RECENT_NAME_LEN = 200, 17 XT_RECENT_NAME_LEN = 200,
17}; 18};
18 19
20/* Only allowed with --rcheck and --update */
21#define XT_RECENT_MODIFIERS (XT_RECENT_TTL|XT_RECENT_REAP)
22
23#define XT_RECENT_VALID_FLAGS (XT_RECENT_CHECK|XT_RECENT_SET|XT_RECENT_UPDATE|\
24 XT_RECENT_REMOVE|XT_RECENT_TTL|XT_RECENT_REAP)
25
19struct xt_recent_mtinfo { 26struct xt_recent_mtinfo {
20 __u32 seconds; 27 __u32 seconds;
21 __u32 hit_count; 28 __u32 hit_count;
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index f8105e54716a..ea0e44b90432 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -41,10 +41,10 @@ enum nf_br_hook_priorities {
41 41
42#define BRNF_PKT_TYPE 0x01 42#define BRNF_PKT_TYPE 0x01
43#define BRNF_BRIDGED_DNAT 0x02 43#define BRNF_BRIDGED_DNAT 0x02
44#define BRNF_DONT_TAKE_PARENT 0x04 44#define BRNF_BRIDGED 0x04
45#define BRNF_BRIDGED 0x08 45#define BRNF_NF_BRIDGE_PREROUTING 0x08
46#define BRNF_NF_BRIDGE_PREROUTING 0x10 46#define BRNF_8021Q 0x10
47 47#define BRNF_PPPoE 0x20
48 48
49/* Only used in br_forward.c */ 49/* Only used in br_forward.c */
50extern int nf_bridge_copy_header(struct sk_buff *skb); 50extern int nf_bridge_copy_header(struct sk_buff *skb);
@@ -68,6 +68,20 @@ static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
68 } 68 }
69} 69}
70 70
71extern int br_handle_frame_finish(struct sk_buff *skb);
72/* Only used in br_device.c */
73static inline int br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
74{
75 struct nf_bridge_info *nf_bridge = skb->nf_bridge;
76
77 skb_pull(skb, ETH_HLEN);
78 nf_bridge->mask ^= BRNF_BRIDGED_DNAT;
79 skb_copy_to_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN),
80 skb->nf_bridge->data, ETH_HLEN-ETH_ALEN);
81 skb->dev = nf_bridge->physindev;
82 return br_handle_frame_finish(skb);
83}
84
71/* This is called by the IP fragmenting code and it ensures there is 85/* This is called by the IP fragmenting code and it ensures there is
72 * enough room for the encapsulating header (if there is one). */ 86 * enough room for the encapsulating header (if there is one). */
73static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) 87static inline unsigned int nf_bridge_pad(const struct sk_buff *skb)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index e5ba03d783c6..18442ff19c07 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -316,10 +316,6 @@ extern int ip6t_ext_hdr(u8 nexthdr);
316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
317 int target, unsigned short *fragoff); 317 int target, unsigned short *fragoff);
318 318
319extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
320 const struct in6_addr *mask,
321 const struct in6_addr *addr2);
322
323#define IP6T_ALIGN(s) XT_ALIGN(s) 319#define IP6T_ALIGN(s) XT_ALIGN(s)
324 320
325#ifdef CONFIG_COMPAT 321#ifdef CONFIG_COMPAT
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index da1d58be31b7..eb21340a573b 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -299,6 +299,20 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
299 return 0; 299 return 0;
300} 300}
301 301
302#ifdef CONFIG_BRIDGE_NETFILTER
303static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb)
304{
305 unsigned seq, hh_alen;
306
307 do {
308 seq = read_seqbegin(&hh->hh_lock);
309 hh_alen = HH_DATA_ALIGN(ETH_HLEN);
310 memcpy(skb->data - hh_alen, hh->hh_data, ETH_ALEN + hh_alen - ETH_HLEN);
311 } while (read_seqretry(&hh->hh_lock, seq));
312 return 0;
313}
314#endif
315
302static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) 316static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
303{ 317{
304 unsigned seq; 318 unsigned seq;