From d6a2ba07c31b0497fc82a8c175400ea8747da2ef Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Mon, 17 Dec 2007 22:26:54 -0800 Subject: [NETFILTER]: arp_tables: add compat support Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_arp/arp_tables.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include/linux') diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 7ade26b025a4..53dd4df27aa1 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h @@ -281,5 +281,36 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, struct arpt_table *table); #define ARPT_ALIGN(s) XT_ALIGN(s) + +#ifdef CONFIG_COMPAT +#include + +struct compat_arpt_entry +{ + struct arpt_arp arp; + u_int16_t target_offset; + u_int16_t next_offset; + compat_uint_t comefrom; + struct compat_xt_counters counters; + unsigned char elems[0]; +}; + +static inline struct arpt_entry_target * +compat_arpt_get_target(struct compat_arpt_entry *e) +{ + return (void *)e + e->target_offset; +} + +#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) + +/* fn returns 0 to continue iteration */ +#define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ + XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args) + +#define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ + XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \ + fn, ## args) + +#endif /* CONFIG_COMPAT */ #endif /*__KERNEL__*/ #endif /* _ARPTABLES_H */ -- cgit v1.2.3