From e01c75d54359422b6072e94eadb3af1fe73baf2e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 2 Jan 2023 15:36:20 +0100 Subject: src: add eval_proto_ctx() Add eval_proto_ctx() to access protocol context (struct proto_ctx). Rename struct proto_ctx field to _pctx to highlight that this field is internal and the helper function should be used. This patch comes in preparation for supporting outer and inner protocol context. Signed-off-by: Pablo Neira Ayuso --- include/proto.h | 3 +++ include/rule.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/proto.h b/include/proto.h index 35e760c7..6a9289b1 100644 --- a/include/proto.h +++ b/include/proto.h @@ -413,4 +413,7 @@ extern const struct datatype icmp6_type_type; extern const struct datatype dscp_type; extern const struct datatype ecn_type; +struct eval_ctx; +struct proto_ctx *eval_proto_ctx(struct eval_ctx *ctx); + #endif /* NFTABLES_PROTO_H */ diff --git a/include/rule.h b/include/rule.h index 00a1bac5..c1b46414 100644 --- a/include/rule.h +++ b/include/rule.h @@ -769,7 +769,7 @@ struct eval_ctx { struct set *set; struct stmt *stmt; struct expr_ctx ectx; - struct proto_ctx pctx; + struct proto_ctx _pctx; }; extern int cmd_evaluate(struct eval_ctx *ctx, struct cmd *cmd); -- cgit v1.2.3