From 1866625f0befbc04673017692813f48d084004ff Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 19 Jul 2018 18:31:57 +0200 Subject: xtables: introduce rule_to_cs/clear_cs callbacks This introduces callbacks in nft_family_ops for parsing an nftnl rule into iptables_command_state and clearing it afterwards. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal --- iptables/nft-shared.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'iptables/nft-shared.c') diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index 12c22a40..87d48bf6 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -626,6 +626,11 @@ void nft_rule_to_iptables_command_state(const struct nftnl_rule *r, cs->jumpto = ""; } +void nft_clear_iptables_command_state(struct iptables_command_state *cs) +{ + xtables_rule_matches_free(&cs->matches); +} + void print_header(unsigned int format, const char *chain, const char *pol, const struct xt_counters *counters, bool basechain, uint32_t refs) -- cgit v1.2.3