diff options
Diffstat (limited to 'include/expression.h')
-rw-r--r-- | include/expression.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/expression.h b/include/expression.h index a167cf59..0633102e 100644 --- a/include/expression.h +++ b/include/expression.h @@ -118,7 +118,9 @@ static inline void expr_set_context(struct expr_ctx *ctx, * @destroy: destructor, must release inner expressions * @set_type: function to promote type and byteorder of inner types * @print: function to print the expression + * @pctx_update:update protocol context */ +struct proto_ctx; struct expr_ops { enum expr_types type; const char *name; @@ -128,6 +130,8 @@ struct expr_ops { const struct datatype *dtype, enum byteorder byteorder); void (*print)(const struct expr *expr); + void (*pctx_update)(struct proto_ctx *ctx, + const struct expr *expr); }; /** @@ -135,12 +139,14 @@ struct expr_ops { * * @EXPR_F_CONSTANT: constant expression * @EXPR_F_SINGLETON: singleton (implies primary and constant) + * @EXPR_F_PROTOCOL: expressions describes upper layer protocol * @EXPR_F_INTERVAL_END: set member ends an open interval */ enum expr_flags { EXPR_F_CONSTANT = 0x1, EXPR_F_SINGLETON = 0x2, - EXPR_F_INTERVAL_END = 0x4, + EXPR_F_PROTOCOL = 0x4, + EXPR_F_INTERVAL_END = 0x8, }; #include <payload.h> @@ -223,20 +229,20 @@ struct expr { struct { /* EXPR_PAYLOAD */ - const struct payload_desc *desc; - const struct payload_template *tmpl; - enum payload_bases base; + const struct proto_desc *desc; + const struct proto_hdr_template *tmpl; + enum proto_bases base; unsigned int offset; - unsigned int flags; } payload; struct { /* EXPR_EXTHDR */ const struct exthdr_desc *desc; - const struct payload_template *tmpl; + const struct proto_hdr_template *tmpl; } exthdr; struct { /* EXPR_META */ enum nft_meta_keys key; + enum proto_bases base; } meta; struct { /* EXPR_CT */ |