diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2006-03-22 16:55:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-22 16:55:40 -0500 |
commit | a45049c51ce6a3fecf2a909b591b28164c927112 (patch) | |
tree | 582c35205f9c1c12825447a009518eb2116beacd /include | |
parent | 4e3882f77376e036a52b022909d7e910714bd27b (diff) |
[NETFILTER]: x_tables: set the protocol family in x_tables targets/matches
Set the family field in xt_[matches|targets] registered.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/x_tables.h | 8 | ||||
-rw-r--r-- | include/linux/netfilter_arp/arp_tables.h | 6 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_tables.h | 14 | ||||
-rw-r--r-- | include/linux/netfilter_ipv6/ip6_tables.h | 14 |
4 files changed, 26 insertions, 16 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 46a0f974f87c..bf71efb63007 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -220,10 +220,10 @@ struct xt_table_info | |||
220 | char *entries[NR_CPUS]; | 220 | char *entries[NR_CPUS]; |
221 | }; | 221 | }; |
222 | 222 | ||
223 | extern int xt_register_target(int af, struct xt_target *target); | 223 | extern int xt_register_target(struct xt_target *target); |
224 | extern void xt_unregister_target(int af, struct xt_target *target); | 224 | extern void xt_unregister_target(struct xt_target *target); |
225 | extern int xt_register_match(int af, struct xt_match *target); | 225 | extern int xt_register_match(struct xt_match *target); |
226 | extern void xt_unregister_match(int af, struct xt_match *target); | 226 | extern void xt_unregister_match(struct xt_match *target); |
227 | 227 | ||
228 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 228 | extern int xt_check_match(const struct xt_match *match, unsigned short family, |
229 | unsigned int size, const char *table, unsigned int hook, | 229 | unsigned int size, const char *table, unsigned int hook, |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index fd21796e5131..a27be05f67f0 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -263,8 +263,10 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
263 | */ | 263 | */ |
264 | #ifdef __KERNEL__ | 264 | #ifdef __KERNEL__ |
265 | 265 | ||
266 | #define arpt_register_target(tgt) xt_register_target(NF_ARP, tgt) | 266 | #define arpt_register_target(tgt) \ |
267 | #define arpt_unregister_target(tgt) xt_unregister_target(NF_ARP, tgt) | 267 | ({ (tgt)->family = NF_ARP; \ |
268 | xt_register_target(tgt); }) | ||
269 | #define arpt_unregister_target(tgt) xt_unregister_target(tgt) | ||
268 | 270 | ||
269 | extern int arpt_register_table(struct arpt_table *table, | 271 | extern int arpt_register_table(struct arpt_table *table, |
270 | const struct arpt_replace *repl); | 272 | const struct arpt_replace *repl); |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 76ba24b68515..ee262b5344e1 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -321,11 +321,15 @@ ipt_get_target(struct ipt_entry *e) | |||
321 | #include <linux/init.h> | 321 | #include <linux/init.h> |
322 | extern void ipt_init(void) __init; | 322 | extern void ipt_init(void) __init; |
323 | 323 | ||
324 | #define ipt_register_target(tgt) xt_register_target(AF_INET, tgt) | 324 | #define ipt_register_target(tgt) \ |
325 | #define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt) | 325 | ({ (tgt)->family = AF_INET; \ |
326 | 326 | xt_register_target(tgt); }) | |
327 | #define ipt_register_match(mtch) xt_register_match(AF_INET, mtch) | 327 | #define ipt_unregister_target(tgt) xt_unregister_target(tgt) |
328 | #define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch) | 328 | |
329 | #define ipt_register_match(mtch) \ | ||
330 | ({ (mtch)->family = AF_INET; \ | ||
331 | xt_register_match(mtch); }) | ||
332 | #define ipt_unregister_match(mtch) xt_unregister_match(mtch) | ||
329 | 333 | ||
330 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) | 334 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) |
331 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) | 335 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f249b574f0fa..7107f942eb05 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -334,11 +334,15 @@ ip6t_get_target(struct ip6t_entry *e) | |||
334 | #include <linux/init.h> | 334 | #include <linux/init.h> |
335 | extern void ip6t_init(void) __init; | 335 | extern void ip6t_init(void) __init; |
336 | 336 | ||
337 | #define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) | 337 | #define ip6t_register_target(tgt) \ |
338 | #define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) | 338 | ({ (tgt)->family = AF_INET6; \ |
339 | 339 | xt_register_target(tgt); }) | |
340 | #define ip6t_register_match(match) xt_register_match(AF_INET6, match) | 340 | #define ip6t_unregister_target(tgt) xt_unregister_target(tgt) |
341 | #define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) | 341 | |
342 | #define ip6t_register_match(match) \ | ||
343 | ({ (match)->family = AF_INET6; \ | ||
344 | xt_register_match(match); }) | ||
345 | #define ip6t_unregister_match(match) xt_unregister_match(match) | ||
342 | 346 | ||
343 | extern int ip6t_register_table(struct ip6t_table *table, | 347 | extern int ip6t_register_table(struct ip6t_table *table, |
344 | const struct ip6t_replace *repl); | 348 | const struct ip6t_replace *repl); |