diff options
author | Florian Westphal <fw@strlen.de> | 2018-05-08 09:41:47 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-05-10 02:31:05 +0200 |
commit | 0ae81d09c93a6c27573ae561f2af09153a5f3e51 (patch) | |
tree | d737e5deb49aa62cde09959f5b726db5f8d20fe0 /iptables/xshared.h | |
parent | 651cfee91a8f42336b9d794c838b9f4f480308c9 (diff) |
xtables-compat: ebtables: kill ebtables_command_state
Use iptables_command_state instead.
This allows to re-use code from the ip(6)tables layer and
reduces cop&pasted code.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xshared.h')
-rw-r--r-- | iptables/xshared.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h index 7e6d0859..cec5a08a 100644 --- a/iptables/xshared.h +++ b/iptables/xshared.h @@ -48,8 +48,42 @@ struct xtables_afinfo { int so_rev_target; }; +/* trick for ebtables-compat, since watchers are targets */ +struct ebt_match { + struct ebt_match *next; + union { + struct xtables_match *match; + struct xtables_target *watcher; + } u; + bool ismatch; +}; + +/* Fake ebt_entry */ +struct ebt_entry { + /* this needs to be the first field */ + unsigned int bitmask; + unsigned int invflags; + uint16_t ethproto; + /* the physical in-dev */ + char in[IFNAMSIZ]; + /* the logical in-dev */ + char logical_in[IFNAMSIZ]; + /* the physical out-dev */ + char out[IFNAMSIZ]; + /* the logical out-dev */ + char logical_out[IFNAMSIZ]; + unsigned char sourcemac[6]; + unsigned char sourcemsk[6]; + unsigned char destmac[6]; + unsigned char destmsk[6]; + + unsigned char in_mask[IFNAMSIZ]; + unsigned char out_mask[IFNAMSIZ]; +}; + struct iptables_command_state { union { + struct ebt_entry eb; struct ipt_entry fw; struct ip6t_entry fw6; }; @@ -57,6 +91,7 @@ struct iptables_command_state { int c; unsigned int options; struct xtables_rule_match *matches; + struct ebt_match *match_list; struct xtables_target *target; struct xt_counters counters; char *protocol; |