IPtablestng/Kernel - some changes for 'x'
Subsystems (3)
PATCH 1/9 IPtablestng/Kernel - some changes for 'x'
export 'xt' and 'xt_prefix' symbols.
export 'xt' and 'xt_prefix' symbols. this symbols are used by other part of IPtablestng.
also declaring 'classifier' linklist to store the list of clasifiers beside of other linklists(targets/matches).
include/linux/netfilter/x_tables.h +15 -0
@@ -124,6 +124,21 @@ struct xt_counters_infostruct xt_counters counters[0 ]; }; +#ifdef __KERNEL__ +#define SMP_ALIGN (x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) + +struct xt_af { +struct mutex mutex; +struct list_head match; +struct list_head target; +struct list_head classifier; +#ifdef CONFIG_COMPAT +struct mutex compat_mutex; +struct compat_delta *compat_offsets; +#endif +}; +#endif +#define XT_INV_PROTO 0x40/* Invert the sense of PROTO. */ /* fn returns 0 to continue iteration */
net/netfilter/x_tables.c +9 -5
@@ -32,14 +32,14 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR ("Harald Welte <[email protected]>" );MODULE_DESCRIPTION ("[ip,ip6,arp]_tables backend module" ); -#define SMP_ALIGN (x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) +//#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) struct compat_delta {struct compat_delta *next;unsigned int offset;short delta; }; - +/* struct xt_af { struct mutex mutex; struct list_head match;
@@ -49,8 +49,9 @@ struct xt_af {struct compat_delta *compat_offsets; #endif }; - -static struct xt_af *xt; +*/ +struct xt_af *xt; +EXPORT_SYMBOL (xt);#ifdef DEBUG_IP_FIREWALL_USER #define duprintf(format, args...) printk(format , ## args)
@@ -58,11 +59,12 @@ static struct xt_af *xt; #define duprintf(format, args...)#endif -static const char *xt_prefix[NPROTO ] = { +const char *xt_prefix[NPROTO ] = { [AF_INET ] ="ip" , [AF_INET6 ] ="ip6" , [NF_ARP ] ="arp" , }; +EXPORT_SYMBOL (xt_prefix);/* Registration hooks for targets. */ int
@@ -955,6 +957,7 @@ int xt_proto_init(struct net *net, int af)if (!proc) goto out_remove_matches; proc->data = (void *)(unsigned long )af; +#endif return 0 ;
@@ -1024,6 +1027,7 @@ static int __init xt_init(void)#endif INIT_LIST_HEAD (&xt[i].target);INIT_LIST_HEAD (&xt[i].match); +INIT_LIST_HEAD (&xt[i].classifier); } rv =register_pernet_subsys (&xt_net_ops);if (rv <0 )