From 0ae81d09c93a6c27573ae561f2af09153a5f3e51 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 8 May 2018 09:41:47 +0200 Subject: 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 --- iptables/nft-bridge.h | 56 +++------------------------------------------------ 1 file changed, 3 insertions(+), 53 deletions(-) (limited to 'iptables/nft-bridge.h') 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 -- cgit v1.2.3