.save_firewall = NULL,
.save_counters = NULL,
.post_parse = NULL,
+ .rule_to_cs = nft_rule_to_arptables_command_state,
+ .clear_cs = NULL,
.rule_find = nft_arp_rule_find,
.parse_target = nft_arp_parse_target,
};
cs->target = t;
}
-static void nft_rule_to_ebtables_command_state(struct nftnl_rule *r,
+static void nft_rule_to_ebtables_command_state(const struct nftnl_rule *r,
struct iptables_command_state *cs)
{
cs->eb.bitmask = EBT_NOPROTO;
.save_firewall = NULL,
.save_counters = NULL,
.post_parse = NULL,
+ .rule_to_cs = nft_rule_to_ebtables_command_state,
+ .clear_cs = ebt_cs_clean,
.rule_find = nft_bridge_rule_find,
.xlate = nft_bridge_xlate,
};
.proto_parse = nft_ipv4_proto_parse,
.post_parse = nft_ipv4_post_parse,
.parse_target = nft_ipv4_parse_target,
+ .rule_to_cs = nft_rule_to_iptables_command_state,
+ .clear_cs = nft_clear_iptables_command_state,
.rule_find = nft_ipv4_rule_find,
.xlate = nft_ipv4_xlate,
};
.proto_parse = nft_ipv6_proto_parse,
.post_parse = nft_ipv6_post_parse,
.parse_target = nft_ipv6_parse_target,
+ .rule_to_cs = nft_rule_to_iptables_command_state,
+ .clear_cs = nft_clear_iptables_command_state,
.rule_find = nft_ipv6_rule_find,
.xlate = nft_ipv6_xlate,
};
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)
struct xtables_args *args);
void (*parse_match)(struct xtables_match *m, void *data);
void (*parse_target)(struct xtables_target *t, void *data);
+ void (*rule_to_cs)(const struct nftnl_rule *r,
+ struct iptables_command_state *cs);
+ void (*clear_cs)(struct iptables_command_state *cs);
bool (*rule_find)(struct nft_family_ops *ops, struct nftnl_rule *r,
void *data);
int (*xlate)(const void *data, struct xt_xlate *xl);
void nft_parse_immediate(struct nft_xt_ctx *ctx, struct nftnl_expr *e);
void nft_rule_to_iptables_command_state(const struct nftnl_rule *r,
struct iptables_command_state *cs);
+void nft_clear_iptables_command_state(struct iptables_command_state *cs);
void print_header(unsigned int format, const char *chain, const char *pol,
const struct xt_counters *counters, bool basechain,
uint32_t refs);