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/nft-bridge.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/nft-bridge.h')
-rw-r--r-- | iptables/nft-bridge.h | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/iptables/nft-bridge.h b/iptables/nft-bridge.h index 9217d633..3ee04640 100644 --- a/iptables/nft-bridge.h +++ b/iptables/nft-bridge.h @@ -70,57 +70,7 @@ int ebt_get_mac_and_mask(const char *from, unsigned char *to, unsigned char *mas */ #define EBT_VERDICT_BITS 0x0000000F -/* 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[ETH_ALEN]; - unsigned char sourcemsk[ETH_ALEN]; - unsigned char destmac[ETH_ALEN]; - unsigned char destmsk[ETH_ALEN]; - - unsigned char in_mask[IFNAMSIZ]; - unsigned char out_mask[IFNAMSIZ]; -}; - -/* 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; -}; - -struct ebtables_command_state { - struct ebt_entry fw; - struct xtables_target *target; - struct xtables_rule_match *matches; - struct ebt_match *match_list; - const char *jumpto; - struct xt_counters counters; - int invert; - int c; - char **argv; - int proto_used; - char *protocol; - unsigned int options; -}; - struct nftnl_rule; -void nft_rule_to_ebtables_command_state(struct nftnl_rule *r, - struct ebtables_command_state *cs); static const char *ebt_standard_targets[NUM_STANDARD_TARGETS] = { "ACCEPT", @@ -167,11 +117,11 @@ static inline const char *ebt_target_name(unsigned int verdict) *flags |= mask; \ }) \ -void ebt_cs_clean(struct ebtables_command_state *cs); +void ebt_cs_clean(struct iptables_command_state *cs); void ebt_load_match_extensions(void); void ebt_add_match(struct xtables_match *m, - struct ebtables_command_state *cs); + struct iptables_command_state *cs); void ebt_add_watcher(struct xtables_target *watcher, - struct ebtables_command_state *cs); + struct iptables_command_state *cs); #endif |