summaryrefslogtreecommitdiffstats
path: root/iptables/nft-ruleparse.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-03-29 18:26:23 +0200
committerPhil Sutter <phil@nwl.cc>2023-05-03 19:09:29 +0200
commit674e7c0f639f2322dcc7eee67aa9c3d52fa3ee65 (patch)
tree9e9f1c04fa097f015da5a7063905857672b274ea /iptables/nft-ruleparse.h
parent46ed4d264ce44dd0a01723a1e326eedc0da822ba (diff)
nft: Extract rule parsing callbacks from nft_family_ops
Introduce struct nft_ruleparse_ops holding the family-specific expression parsers and integrate it into nft_family_ops for now. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-ruleparse.h')
-rw-r--r--iptables/nft-ruleparse.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/iptables/nft-ruleparse.h b/iptables/nft-ruleparse.h
index 7fac6c79..69e98817 100644
--- a/iptables/nft-ruleparse.h
+++ b/iptables/nft-ruleparse.h
@@ -93,6 +93,22 @@ static inline struct nft_xt_ctx_reg *nft_xt_ctx_get_dreg(struct nft_xt_ctx *ctx,
return r;
}
+struct nft_ruleparse_ops {
+ void (*meta)(struct nft_xt_ctx *ctx,
+ const struct nft_xt_ctx_reg *sreg,
+ struct nftnl_expr *e,
+ struct iptables_command_state *cs);
+ void (*payload)(struct nft_xt_ctx *ctx,
+ const struct nft_xt_ctx_reg *sreg,
+ struct nftnl_expr *e,
+ struct iptables_command_state *cs);
+ void (*lookup)(struct nft_xt_ctx *ctx, struct nftnl_expr *e);
+ void (*match)(struct xtables_match *m,
+ struct iptables_command_state *cs);
+ void (*target)(struct xtables_target *t,
+ struct iptables_command_state *cs);
+};
+
void *nft_create_match(struct nft_xt_ctx *ctx,
struct iptables_command_state *cs,
const char *name, bool reuse);