diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-11 15:56:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-11 15:56:14 -0400 |
commit | 67da25521066b38911701efa133aaad2238b5530 (patch) | |
tree | 776ad4942ce8294f0ba0013baf9527a1d39b424f /include | |
parent | 7b34ca2ac7063f4ebf07f85fd75253ed84d5c648 (diff) | |
parent | 2597a8344ce051d0afe331706bcb4660bbdb9861 (diff) |
Merge branch 'master' of git://1984.lsi.us.es/net-next
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter.h | 10 | ||||
-rw-r--r-- | include/linux/netfilter/nfnetlink_queue.h | 5 | ||||
-rw-r--r-- | include/linux/netfilter/xt_connlimit.h | 9 | ||||
-rw-r--r-- | include/linux/netfilter/xt_recent.h | 10 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ipt_addrtype.h | 27 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_core.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l3proto.h | 11 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 22 | ||||
-rw-r--r-- | include/net/netns/conntrack.h | 55 |
10 files changed, 101 insertions, 53 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index ff9c84c29b28..4541f33dbfc3 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -94,6 +94,16 @@ static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1, | |||
94 | a1->all[3] == a2->all[3]; | 94 | a1->all[3] == a2->all[3]; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, | ||
98 | union nf_inet_addr *result, | ||
99 | const union nf_inet_addr *mask) | ||
100 | { | ||
101 | result->all[0] = a1->all[0] & mask->all[0]; | ||
102 | result->all[1] = a1->all[1] & mask->all[1]; | ||
103 | result->all[2] = a1->all[2] & mask->all[2]; | ||
104 | result->all[3] = a1->all[3] & mask->all[3]; | ||
105 | } | ||
106 | |||
97 | extern void netfilter_init(void); | 107 | extern void netfilter_init(void); |
98 | 108 | ||
99 | /* Largest hook number + 1 */ | 109 | /* Largest hook number + 1 */ |
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 24b32e6c009e..a6c1ddac05cc 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -84,8 +84,13 @@ enum nfqnl_attr_config { | |||
84 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | 84 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ |
85 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | 85 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ |
86 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ | 86 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ |
87 | NFQA_CFG_MASK, /* identify which flags to change */ | ||
88 | NFQA_CFG_FLAGS, /* value of these flags (__u32) */ | ||
87 | __NFQA_CFG_MAX | 89 | __NFQA_CFG_MAX |
88 | }; | 90 | }; |
89 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | 91 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) |
90 | 92 | ||
93 | /* Flags for NFQA_CFG_FLAGS */ | ||
94 | #define NFQA_CFG_F_FAIL_OPEN (1 << 0) | ||
95 | |||
91 | #endif /* _NFNETLINK_QUEUE_H */ | 96 | #endif /* _NFNETLINK_QUEUE_H */ |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index d1366f05d1b2..f1656096121e 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
@@ -22,13 +22,8 @@ struct xt_connlimit_info { | |||
22 | #endif | 22 | #endif |
23 | }; | 23 | }; |
24 | unsigned int limit; | 24 | unsigned int limit; |
25 | union { | 25 | /* revision 1 */ |
26 | /* revision 0 */ | 26 | __u32 flags; |
27 | unsigned int inverse; | ||
28 | |||
29 | /* revision 1 */ | ||
30 | __u32 flags; | ||
31 | }; | ||
32 | 27 | ||
33 | /* Used internally by the kernel */ | 28 | /* Used internally by the kernel */ |
34 | struct xt_connlimit_data *data __attribute__((aligned(8))); | 29 | struct xt_connlimit_data *data __attribute__((aligned(8))); |
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h index 83318e01425e..6ef36c113e89 100644 --- a/include/linux/netfilter/xt_recent.h +++ b/include/linux/netfilter/xt_recent.h | |||
@@ -32,4 +32,14 @@ struct xt_recent_mtinfo { | |||
32 | __u8 side; | 32 | __u8 side; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct xt_recent_mtinfo_v1 { | ||
36 | __u32 seconds; | ||
37 | __u32 hit_count; | ||
38 | __u8 check_set; | ||
39 | __u8 invert; | ||
40 | char name[XT_RECENT_NAME_LEN]; | ||
41 | __u8 side; | ||
42 | union nf_inet_addr mask; | ||
43 | }; | ||
44 | |||
35 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ | 45 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index c61b8fb1a9ef..8ba0c5b72ea9 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -5,7 +5,6 @@ header-y += ipt_LOG.h | |||
5 | header-y += ipt_REJECT.h | 5 | header-y += ipt_REJECT.h |
6 | header-y += ipt_TTL.h | 6 | header-y += ipt_TTL.h |
7 | header-y += ipt_ULOG.h | 7 | header-y += ipt_ULOG.h |
8 | header-y += ipt_addrtype.h | ||
9 | header-y += ipt_ah.h | 8 | header-y += ipt_ah.h |
10 | header-y += ipt_ecn.h | 9 | header-y += ipt_ecn.h |
11 | header-y += ipt_ttl.h | 10 | header-y += ipt_ttl.h |
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h deleted file mode 100644 index 0da42237c8da..000000000000 --- a/include/linux/netfilter_ipv4/ipt_addrtype.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #ifndef _IPT_ADDRTYPE_H | ||
2 | #define _IPT_ADDRTYPE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | enum { | ||
7 | IPT_ADDRTYPE_INVERT_SOURCE = 0x0001, | ||
8 | IPT_ADDRTYPE_INVERT_DEST = 0x0002, | ||
9 | IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004, | ||
10 | IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008, | ||
11 | }; | ||
12 | |||
13 | struct ipt_addrtype_info_v1 { | ||
14 | __u16 source; /* source-type mask */ | ||
15 | __u16 dest; /* dest-type mask */ | ||
16 | __u32 flags; | ||
17 | }; | ||
18 | |||
19 | /* revision 0 */ | ||
20 | struct ipt_addrtype_info { | ||
21 | __u16 source; /* source-type mask */ | ||
22 | __u16 dest; /* dest-type mask */ | ||
23 | __u32 invert_source; | ||
24 | __u32 invert_dest; | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index aced085132e7..d8f5b9f52169 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -28,8 +28,8 @@ extern unsigned int nf_conntrack_in(struct net *net, | |||
28 | extern int nf_conntrack_init(struct net *net); | 28 | extern int nf_conntrack_init(struct net *net); |
29 | extern void nf_conntrack_cleanup(struct net *net); | 29 | extern void nf_conntrack_cleanup(struct net *net); |
30 | 30 | ||
31 | extern int nf_conntrack_proto_init(void); | 31 | extern int nf_conntrack_proto_init(struct net *net); |
32 | extern void nf_conntrack_proto_fini(void); | 32 | extern void nf_conntrack_proto_fini(struct net *net); |
33 | 33 | ||
34 | extern bool | 34 | extern bool |
35 | nf_ct_get_tuple(const struct sk_buff *skb, | 35 | nf_ct_get_tuple(const struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 9699c028b74b..6f7c13f4ac03 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -64,11 +64,12 @@ struct nf_conntrack_l3proto { | |||
64 | size_t nla_size; | 64 | size_t nla_size; |
65 | 65 | ||
66 | #ifdef CONFIG_SYSCTL | 66 | #ifdef CONFIG_SYSCTL |
67 | struct ctl_table_header *ctl_table_header; | ||
68 | const char *ctl_table_path; | 67 | const char *ctl_table_path; |
69 | struct ctl_table *ctl_table; | ||
70 | #endif /* CONFIG_SYSCTL */ | 68 | #endif /* CONFIG_SYSCTL */ |
71 | 69 | ||
70 | /* Init l3proto pernet data */ | ||
71 | int (*init_net)(struct net *net); | ||
72 | |||
72 | /* Module (if any) which this is connected to. */ | 73 | /* Module (if any) which this is connected to. */ |
73 | struct module *me; | 74 | struct module *me; |
74 | }; | 75 | }; |
@@ -76,8 +77,10 @@ struct nf_conntrack_l3proto { | |||
76 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; | 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; |
77 | 78 | ||
78 | /* Protocol registration. */ | 79 | /* Protocol registration. */ |
79 | extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); | 80 | extern int nf_conntrack_l3proto_register(struct net *net, |
80 | extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 81 | struct nf_conntrack_l3proto *proto); |
82 | extern void nf_conntrack_l3proto_unregister(struct net *net, | ||
83 | struct nf_conntrack_l3proto *proto); | ||
81 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 84 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
82 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 85 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
83 | 86 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 3b572bb20aa2..81c52b5205f2 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/netlink.h> | 12 | #include <linux/netlink.h> |
13 | #include <net/netlink.h> | 13 | #include <net/netlink.h> |
14 | #include <net/netfilter/nf_conntrack.h> | 14 | #include <net/netfilter/nf_conntrack.h> |
15 | #include <net/netns/generic.h> | ||
15 | 16 | ||
16 | struct seq_file; | 17 | struct seq_file; |
17 | 18 | ||
@@ -86,23 +87,18 @@ struct nf_conntrack_l4proto { | |||
86 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) | 87 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) |
87 | struct { | 88 | struct { |
88 | size_t obj_size; | 89 | size_t obj_size; |
89 | int (*nlattr_to_obj)(struct nlattr *tb[], void *data); | 90 | int (*nlattr_to_obj)(struct nlattr *tb[], |
91 | struct net *net, void *data); | ||
90 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); | 92 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); |
91 | 93 | ||
92 | unsigned int nlattr_max; | 94 | unsigned int nlattr_max; |
93 | const struct nla_policy *nla_policy; | 95 | const struct nla_policy *nla_policy; |
94 | } ctnl_timeout; | 96 | } ctnl_timeout; |
95 | #endif | 97 | #endif |
98 | int *net_id; | ||
99 | /* Init l4proto pernet data */ | ||
100 | int (*init_net)(struct net *net); | ||
96 | 101 | ||
97 | #ifdef CONFIG_SYSCTL | ||
98 | struct ctl_table_header **ctl_table_header; | ||
99 | struct ctl_table *ctl_table; | ||
100 | unsigned int *ctl_table_users; | ||
101 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
102 | struct ctl_table_header *ctl_compat_table_header; | ||
103 | struct ctl_table *ctl_compat_table; | ||
104 | #endif | ||
105 | #endif | ||
106 | /* Protocol name */ | 102 | /* Protocol name */ |
107 | const char *name; | 103 | const char *name; |
108 | 104 | ||
@@ -123,8 +119,10 @@ nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); | |||
123 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); | 119 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
124 | 120 | ||
125 | /* Protocol registration. */ | 121 | /* Protocol registration. */ |
126 | extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto); | 122 | extern int nf_conntrack_l4proto_register(struct net *net, |
127 | extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); | 123 | struct nf_conntrack_l4proto *proto); |
124 | extern void nf_conntrack_l4proto_unregister(struct net *net, | ||
125 | struct nf_conntrack_l4proto *proto); | ||
128 | 126 | ||
129 | /* Generic netlink helpers */ | 127 | /* Generic netlink helpers */ |
130 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | 128 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index a053a19870cf..3aecdc7a84fb 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -4,10 +4,64 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/list_nulls.h> | 5 | #include <linux/list_nulls.h> |
6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
7 | #include <linux/netfilter/nf_conntrack_tcp.h> | ||
7 | 8 | ||
8 | struct ctl_table_header; | 9 | struct ctl_table_header; |
9 | struct nf_conntrack_ecache; | 10 | struct nf_conntrack_ecache; |
10 | 11 | ||
12 | struct nf_proto_net { | ||
13 | #ifdef CONFIG_SYSCTL | ||
14 | struct ctl_table_header *ctl_table_header; | ||
15 | struct ctl_table *ctl_table; | ||
16 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
17 | struct ctl_table_header *ctl_compat_header; | ||
18 | struct ctl_table *ctl_compat_table; | ||
19 | #endif | ||
20 | #endif | ||
21 | unsigned int users; | ||
22 | }; | ||
23 | |||
24 | struct nf_generic_net { | ||
25 | struct nf_proto_net pn; | ||
26 | unsigned int timeout; | ||
27 | }; | ||
28 | |||
29 | struct nf_tcp_net { | ||
30 | struct nf_proto_net pn; | ||
31 | unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; | ||
32 | unsigned int tcp_loose; | ||
33 | unsigned int tcp_be_liberal; | ||
34 | unsigned int tcp_max_retrans; | ||
35 | }; | ||
36 | |||
37 | enum udp_conntrack { | ||
38 | UDP_CT_UNREPLIED, | ||
39 | UDP_CT_REPLIED, | ||
40 | UDP_CT_MAX | ||
41 | }; | ||
42 | |||
43 | struct nf_udp_net { | ||
44 | struct nf_proto_net pn; | ||
45 | unsigned int timeouts[UDP_CT_MAX]; | ||
46 | }; | ||
47 | |||
48 | struct nf_icmp_net { | ||
49 | struct nf_proto_net pn; | ||
50 | unsigned int timeout; | ||
51 | }; | ||
52 | |||
53 | struct nf_ip_net { | ||
54 | struct nf_generic_net generic; | ||
55 | struct nf_tcp_net tcp; | ||
56 | struct nf_udp_net udp; | ||
57 | struct nf_icmp_net icmp; | ||
58 | struct nf_icmp_net icmpv6; | ||
59 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) | ||
60 | struct ctl_table_header *ctl_table_header; | ||
61 | struct ctl_table *ctl_table; | ||
62 | #endif | ||
63 | }; | ||
64 | |||
11 | struct netns_ct { | 65 | struct netns_ct { |
12 | atomic_t count; | 66 | atomic_t count; |
13 | unsigned int expect_count; | 67 | unsigned int expect_count; |
@@ -28,6 +82,7 @@ struct netns_ct { | |||
28 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 82 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
29 | int sysctl_auto_assign_helper; | 83 | int sysctl_auto_assign_helper; |
30 | bool auto_assign_helper_warned; | 84 | bool auto_assign_helper_warned; |
85 | struct nf_ip_net nf_ct_proto; | ||
31 | #ifdef CONFIG_SYSCTL | 86 | #ifdef CONFIG_SYSCTL |
32 | struct ctl_table_header *sysctl_header; | 87 | struct ctl_table_header *sysctl_header; |
33 | struct ctl_table_header *acct_sysctl_header; | 88 | struct ctl_table_header *acct_sysctl_header; |