diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-28 05:19:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-28 05:19:15 -0500 |
commit | ed77a89c30fa03dcb234a84ddea710b3fb7b62da (patch) | |
tree | 69f3e2c2bbf2fdd4f742e891441f01307d1d1f49 /include | |
parent | 475ad8e2172d7f8b73af5532a8dad265b51339c2 (diff) | |
parent | d6e8cc6cc7ac77b0f9118f78c453a2e834e62709 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Conflicts:
net/netfilter/nf_conntrack_netlink.c
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter_bridge/ebtables.h | 3 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ipt_policy.h | 2 | ||||
-rw-r--r-- | include/linux/netfilter_ipv6/ip6t_policy.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 5 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_ecache.h | 57 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_expect.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_helper.h | 5 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nfnetlink_log.h | 14 | ||||
-rw-r--r-- | include/net/netns/x_tables.h | 5 |
10 files changed, 87 insertions, 10 deletions
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index d45e29cd1cfb..e40ddb94b1af 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -300,7 +300,8 @@ struct ebt_table | |||
300 | 300 | ||
301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ | 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ |
302 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
303 | extern int ebt_register_table(struct ebt_table *table); | 303 | extern struct ebt_table *ebt_register_table(struct net *net, |
304 | struct ebt_table *table); | ||
304 | extern void ebt_unregister_table(struct ebt_table *table); | 305 | extern void ebt_unregister_table(struct ebt_table *table); |
305 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
306 | const struct net_device *in, const struct net_device *out, | 307 | const struct net_device *in, const struct net_device *out, |
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h index b9478a255301..1037fb2cd206 100644 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ b/include/linux/netfilter_ipv4/ipt_policy.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IPT_POLICY_H | 1 | #ifndef _IPT_POLICY_H |
2 | #define _IPT_POLICY_H | 2 | #define _IPT_POLICY_H |
3 | 3 | ||
4 | #include <linux/netfilter/xt_policy.h> | ||
5 | |||
4 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | 6 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 7 | ||
6 | /* ipt_policy_flags */ | 8 | /* ipt_policy_flags */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h index 6bab3163d2fb..b1c449d7ec89 100644 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ b/include/linux/netfilter_ipv6/ip6t_policy.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IP6T_POLICY_H | 1 | #ifndef _IP6T_POLICY_H |
2 | #define _IP6T_POLICY_H | 2 | #define _IP6T_POLICY_H |
3 | 3 | ||
4 | #include <linux/netfilter/xt_policy.h> | ||
5 | |||
4 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | 6 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 7 | ||
6 | /* ip6t_policy_flags */ | 8 | /* ip6t_policy_flags */ |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index b76a8685b5b5..2e0c53641cbe 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -199,7 +199,7 @@ __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); | |||
199 | 199 | ||
200 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 200 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
201 | 201 | ||
202 | extern void nf_conntrack_flush(struct net *net); | 202 | extern void nf_conntrack_flush(struct net *net, u32 pid, int report); |
203 | 203 | ||
204 | extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, | 204 | extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, |
205 | unsigned int nhoff, u_int16_t l3num, | 205 | unsigned int nhoff, u_int16_t l3num, |
@@ -298,5 +298,8 @@ do { \ | |||
298 | local_bh_enable(); \ | 298 | local_bh_enable(); \ |
299 | } while (0) | 299 | } while (0) |
300 | 300 | ||
301 | #define MODULE_ALIAS_NFCT_HELPER(helper) \ | ||
302 | MODULE_ALIAS("nfct-helper-" helper) | ||
303 | |||
301 | #endif /* __KERNEL__ */ | 304 | #endif /* __KERNEL__ */ |
302 | #endif /* _NF_CONNTRACK_H */ | 305 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 1285ff26a014..0ff0dc69ca4a 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -17,6 +17,13 @@ struct nf_conntrack_ecache { | |||
17 | unsigned int events; | 17 | unsigned int events; |
18 | }; | 18 | }; |
19 | 19 | ||
20 | /* This structure is passed to event handler */ | ||
21 | struct nf_ct_event { | ||
22 | struct nf_conn *ct; | ||
23 | u32 pid; | ||
24 | int report; | ||
25 | }; | ||
26 | |||
20 | extern struct atomic_notifier_head nf_conntrack_chain; | 27 | extern struct atomic_notifier_head nf_conntrack_chain; |
21 | extern int nf_conntrack_register_notifier(struct notifier_block *nb); | 28 | extern int nf_conntrack_register_notifier(struct notifier_block *nb); |
22 | extern int nf_conntrack_unregister_notifier(struct notifier_block *nb); | 29 | extern int nf_conntrack_unregister_notifier(struct notifier_block *nb); |
@@ -39,22 +46,56 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
39 | local_bh_enable(); | 46 | local_bh_enable(); |
40 | } | 47 | } |
41 | 48 | ||
42 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | 49 | static inline void |
43 | struct nf_conn *ct) | 50 | nf_conntrack_event_report(enum ip_conntrack_events event, |
51 | struct nf_conn *ct, | ||
52 | u32 pid, | ||
53 | int report) | ||
44 | { | 54 | { |
55 | struct nf_ct_event item = { | ||
56 | .ct = ct, | ||
57 | .pid = pid, | ||
58 | .report = report | ||
59 | }; | ||
45 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) | 60 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) |
46 | atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); | 61 | atomic_notifier_call_chain(&nf_conntrack_chain, event, &item); |
47 | } | 62 | } |
48 | 63 | ||
64 | static inline void | ||
65 | nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct) | ||
66 | { | ||
67 | nf_conntrack_event_report(event, ct, 0, 0); | ||
68 | } | ||
69 | |||
70 | struct nf_exp_event { | ||
71 | struct nf_conntrack_expect *exp; | ||
72 | u32 pid; | ||
73 | int report; | ||
74 | }; | ||
75 | |||
49 | extern struct atomic_notifier_head nf_ct_expect_chain; | 76 | extern struct atomic_notifier_head nf_ct_expect_chain; |
50 | extern int nf_ct_expect_register_notifier(struct notifier_block *nb); | 77 | extern int nf_ct_expect_register_notifier(struct notifier_block *nb); |
51 | extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb); | 78 | extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb); |
52 | 79 | ||
53 | static inline void | 80 | static inline void |
81 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | ||
82 | struct nf_conntrack_expect *exp, | ||
83 | u32 pid, | ||
84 | int report) | ||
85 | { | ||
86 | struct nf_exp_event item = { | ||
87 | .exp = exp, | ||
88 | .pid = pid, | ||
89 | .report = report | ||
90 | }; | ||
91 | atomic_notifier_call_chain(&nf_ct_expect_chain, event, &item); | ||
92 | } | ||
93 | |||
94 | static inline void | ||
54 | nf_ct_expect_event(enum ip_conntrack_expect_events event, | 95 | nf_ct_expect_event(enum ip_conntrack_expect_events event, |
55 | struct nf_conntrack_expect *exp) | 96 | struct nf_conntrack_expect *exp) |
56 | { | 97 | { |
57 | atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp); | 98 | nf_ct_expect_event_report(event, exp, 0, 0); |
58 | } | 99 | } |
59 | 100 | ||
60 | extern int nf_conntrack_ecache_init(struct net *net); | 101 | extern int nf_conntrack_ecache_init(struct net *net); |
@@ -66,9 +107,17 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | |||
66 | struct nf_conn *ct) {} | 107 | struct nf_conn *ct) {} |
67 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | 108 | static inline void nf_conntrack_event(enum ip_conntrack_events event, |
68 | struct nf_conn *ct) {} | 109 | struct nf_conn *ct) {} |
110 | static inline void nf_conntrack_event_report(enum ip_conntrack_events event, | ||
111 | struct nf_conn *ct, | ||
112 | u32 pid, | ||
113 | int report) {} | ||
69 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | 114 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} |
70 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, | 115 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, |
71 | struct nf_conntrack_expect *exp) {} | 116 | struct nf_conntrack_expect *exp) {} |
117 | static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e, | ||
118 | struct nf_conntrack_expect *exp, | ||
119 | u32 pid, | ||
120 | int report) {} | ||
72 | static inline void nf_ct_event_cache_flush(struct net *net) {} | 121 | static inline void nf_ct_event_cache_flush(struct net *net) {} |
73 | 122 | ||
74 | static inline int nf_conntrack_ecache_init(struct net *net) | 123 | static inline int nf_conntrack_ecache_init(struct net *net) |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 37a7fc1164b0..ab17a159ac66 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -100,6 +100,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t, | |||
100 | u_int8_t, const __be16 *, const __be16 *); | 100 | u_int8_t, const __be16 *, const __be16 *); |
101 | void nf_ct_expect_put(struct nf_conntrack_expect *exp); | 101 | void nf_ct_expect_put(struct nf_conntrack_expect *exp); |
102 | int nf_ct_expect_related(struct nf_conntrack_expect *expect); | 102 | int nf_ct_expect_related(struct nf_conntrack_expect *expect); |
103 | int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, | ||
104 | u32 pid, int report); | ||
103 | 105 | ||
104 | #endif /*_NF_CONNTRACK_EXPECT_H*/ | 106 | #endif /*_NF_CONNTRACK_EXPECT_H*/ |
105 | 107 | ||
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index f8060ab5a083..66d65a7caa39 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -39,9 +39,6 @@ struct nf_conntrack_helper | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | extern struct nf_conntrack_helper * | 41 | extern struct nf_conntrack_helper * |
42 | __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple); | ||
43 | |||
44 | extern struct nf_conntrack_helper * | ||
45 | __nf_conntrack_helper_find_byname(const char *name); | 42 | __nf_conntrack_helper_find_byname(const char *name); |
46 | 43 | ||
47 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 44 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
@@ -49,6 +46,8 @@ extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | |||
49 | 46 | ||
50 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | 47 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); |
51 | 48 | ||
49 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags); | ||
50 | |||
52 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | 51 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) |
53 | { | 52 | { |
54 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | 53 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); |
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 7f2f43c77284..debdaf75cecf 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -129,7 +129,7 @@ extern const struct nla_policy nf_ct_port_nla_policy[]; | |||
129 | && net_ratelimit()) | 129 | && net_ratelimit()) |
130 | #endif | 130 | #endif |
131 | #else | 131 | #else |
132 | #define LOG_INVALID(net, proto) 0 | 132 | static inline int LOG_INVALID(struct net *net, int proto) { return 0; } |
133 | #endif /* CONFIG_SYSCTL */ | 133 | #endif /* CONFIG_SYSCTL */ |
134 | 134 | ||
135 | #endif /*_NF_CONNTRACK_PROTOCOL_H*/ | 135 | #endif /*_NF_CONNTRACK_PROTOCOL_H*/ |
diff --git a/include/net/netfilter/nfnetlink_log.h b/include/net/netfilter/nfnetlink_log.h new file mode 100644 index 000000000000..b0569ff0775e --- /dev/null +++ b/include/net/netfilter/nfnetlink_log.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _KER_NFNETLINK_LOG_H | ||
2 | #define _KER_NFNETLINK_LOG_H | ||
3 | |||
4 | void | ||
5 | nfulnl_log_packet(u_int8_t pf, | ||
6 | unsigned int hooknum, | ||
7 | const struct sk_buff *skb, | ||
8 | const struct net_device *in, | ||
9 | const struct net_device *out, | ||
10 | const struct nf_loginfo *li_user, | ||
11 | const char *prefix); | ||
12 | |||
13 | #endif /* _KER_NFNETLINK_LOG_H */ | ||
14 | |||
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h index b8093971ccb4..9554a644a8f8 100644 --- a/include/net/netns/x_tables.h +++ b/include/net/netns/x_tables.h | |||
@@ -4,7 +4,12 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/netfilter.h> | 5 | #include <linux/netfilter.h> |
6 | 6 | ||
7 | struct ebt_table; | ||
8 | |||
7 | struct netns_xt { | 9 | struct netns_xt { |
8 | struct list_head tables[NFPROTO_NUMPROTO]; | 10 | struct list_head tables[NFPROTO_NUMPROTO]; |
11 | struct ebt_table *broute_table; | ||
12 | struct ebt_table *frame_filter; | ||
13 | struct ebt_table *frame_nat; | ||
9 | }; | 14 | }; |
10 | #endif | 15 | #endif |