diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-02-24 18:32:59 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-02-24 18:32:59 +0100 |
commit | 72b2b1dd77e8feb0b7c0b26dee58f2a1e2c9828c (patch) | |
tree | 4289fef5441a1664f60a17cb473d657f77cf1112 /include/linux/netfilter | |
parent | 8ccb92ad41cb311e52ad1b1fe77992c7f47a3b63 (diff) | |
download | kernel_samsung_espresso10-72b2b1dd77e8feb0b7c0b26dee58f2a1e2c9828c.zip kernel_samsung_espresso10-72b2b1dd77e8feb0b7c0b26dee58f2a1e2c9828c.tar.gz kernel_samsung_espresso10-72b2b1dd77e8feb0b7c0b26dee58f2a1e2c9828c.tar.bz2 |
netfilter: xtables: replace XT_ENTRY_ITERATE macro
The macro is replaced by a list.h-like foreach loop. This makes
the code much more inspectable.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux/netfilter')
-rw-r--r-- | include/linux/netfilter/x_tables.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index a18119f..9df3f5a 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -139,6 +139,7 @@ struct xt_counters_info { __ret; \ }) +#ifndef __KERNEL__ /* fn returns 0 to continue iteration */ #define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \ ({ \ @@ -163,6 +164,14 @@ struct xt_counters_info { #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) +#endif /* !__KERNEL__ */ + +/* pos is normally a struct ipt_entry/ip6t_entry/etc. */ +#define xt_entry_foreach(pos, ehead, esize) \ + for ((pos) = (typeof(pos))(ehead); \ + (pos) < (typeof(pos))((char *)(ehead) + (esize)); \ + (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset)) + #ifdef __KERNEL__ #include <linux/netdevice.h> |