diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-18 01:26:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:49 -0500 |
commit | d6a2ba07c31b0497fc82a8c175400ea8747da2ef (patch) | |
tree | 57e82c63adafdcf1bd80ed57290624a7d1a4ea5f /include | |
parent | 11f6dff8af95d8d1d14bef70d384029c5acf6e04 (diff) |
[NETFILTER]: arp_tables: add compat support
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_arp/arp_tables.h | 31 |
1 files changed, 31 insertions, 0 deletions
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, | |||
281 | struct arpt_table *table); | 281 | struct arpt_table *table); |
282 | 282 | ||
283 | #define ARPT_ALIGN(s) XT_ALIGN(s) | 283 | #define ARPT_ALIGN(s) XT_ALIGN(s) |
284 | |||
285 | #ifdef CONFIG_COMPAT | ||
286 | #include <net/compat.h> | ||
287 | |||
288 | struct compat_arpt_entry | ||
289 | { | ||
290 | struct arpt_arp arp; | ||
291 | u_int16_t target_offset; | ||
292 | u_int16_t next_offset; | ||
293 | compat_uint_t comefrom; | ||
294 | struct compat_xt_counters counters; | ||
295 | unsigned char elems[0]; | ||
296 | }; | ||
297 | |||
298 | static inline struct arpt_entry_target * | ||
299 | compat_arpt_get_target(struct compat_arpt_entry *e) | ||
300 | { | ||
301 | return (void *)e + e->target_offset; | ||
302 | } | ||
303 | |||
304 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
305 | |||
306 | /* fn returns 0 to continue iteration */ | ||
307 | #define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
308 | XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args) | ||
309 | |||
310 | #define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
311 | XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \ | ||
312 | fn, ## args) | ||
313 | |||
314 | #endif /* CONFIG_COMPAT */ | ||
284 | #endif /*__KERNEL__*/ | 315 | #endif /*__KERNEL__*/ |
285 | #endif /* _ARPTABLES_H */ | 316 | #endif /* _ARPTABLES_H */ |