X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fnetfilter_ipv6%2Fip6_tables.h;fp=include%2Flinux%2Fnetfilter_ipv6%2Fip6_tables.h;h=f249b574f0fa0e5ef8cb7fb2ff4cc1fcd7c2278b;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=d0d5d1ee4be31c64e9b64df889c68d68d73db46a;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index d0d5d1ee4..f249b574f 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h @@ -56,9 +56,60 @@ struct ip6t_ip6 { u_int8_t invflags; }; -#define ip6t_entry_match xt_entry_match -#define ip6t_entry_target xt_entry_target -#define ip6t_standard_target xt_standard_target +/* FIXME: If alignment in kernel different from userspace? --RR */ +struct ip6t_entry_match +{ + union { + struct { + u_int16_t match_size; + + /* Used by userspace */ + char name[IP6T_FUNCTION_MAXNAMELEN-1]; + u_int8_t revision; + } user; + struct { + u_int16_t match_size; + + /* Used inside the kernel */ + struct ip6t_match *match; + } kernel; + + /* Total length */ + u_int16_t match_size; + } u; + + unsigned char data[0]; +}; + +struct ip6t_entry_target +{ + union { + struct { + u_int16_t target_size; + + /* Used by userspace */ + char name[IP6T_FUNCTION_MAXNAMELEN-1]; + u_int8_t revision; + } user; + struct { + u_int16_t target_size; + + /* Used inside the kernel */ + struct ip6t_target *target; + } kernel; + + /* Total length */ + u_int16_t target_size; + } u; + + unsigned char data[0]; +}; + +struct ip6t_standard_target +{ + struct ip6t_entry_target target; + int verdict; +}; #define ip6t_counters xt_counters @@ -283,15 +334,11 @@ ip6t_get_target(struct ip6t_entry *e) #include extern void ip6t_init(void) __init; -#define ip6t_register_target(tgt) \ -({ (tgt)->family = AF_INET6; \ - xt_register_target(tgt); }) -#define ip6t_unregister_target(tgt) xt_unregister_target(tgt) +#define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) +#define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) -#define ip6t_register_match(match) \ -({ (match)->family = AF_INET6; \ - xt_register_match(match); }) -#define ip6t_unregister_match(match) xt_unregister_match(match) +#define ip6t_register_match(match) xt_register_match(AF_INET6, match) +#define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) extern int ip6t_register_table(struct ip6t_table *table, const struct ip6t_replace *repl);