diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/datatype.h | 14 | ||||
-rw-r--r-- | include/nftables.h | 8 |
2 files changed, 19 insertions, 3 deletions
diff --git a/include/datatype.h b/include/datatype.h index 63617ebd..018f013a 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -123,6 +123,7 @@ enum datatype_flags { DTYPE_F_PREFIX = (1 << 1), }; +struct parse_ctx; /** * struct datatype * @@ -154,7 +155,8 @@ struct datatype { struct output_ctx *octx); json_t *(*json)(const struct expr *expr, struct output_ctx *octx); - struct error_record *(*parse)(const struct expr *sym, + struct error_record *(*parse)(struct parse_ctx *ctx, + const struct expr *sym, struct expr **res); const struct symbol_table *sym_tbl; unsigned int refcnt; @@ -166,7 +168,12 @@ extern struct datatype *datatype_get(const struct datatype *dtype); extern void datatype_set(struct expr *expr, const struct datatype *dtype); extern void datatype_free(const struct datatype *dtype); -extern struct error_record *symbol_parse(const struct expr *sym, +struct parse_ctx { + struct symbol_tables *tbl; +}; + +extern struct error_record *symbol_parse(struct parse_ctx *ctx, + const struct expr *sym, struct expr **res); extern void datatype_print(const struct expr *expr, struct output_ctx *octx); @@ -218,7 +225,8 @@ struct symbol_table { struct symbolic_constant symbols[]; }; -extern struct error_record *symbolic_constant_parse(const struct expr *sym, +extern struct error_record *symbolic_constant_parse(struct parse_ctx *ctx, + const struct expr *sym, const struct symbol_table *tbl, struct expr **res); extern void symbolic_constant_print(const struct symbol_table *tbl, diff --git a/include/nftables.h b/include/nftables.h index ed446e2d..407d7613 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -15,6 +15,13 @@ struct cookie { size_t pos; }; +struct symbol_tables { + const struct symbol_table *mark; + const struct symbol_table *devgroup; + const struct symbol_table *ct_label; + const struct symbol_table *realm; +}; + struct output_ctx { unsigned int flags; union { @@ -25,6 +32,7 @@ struct output_ctx { FILE *error_fp; struct cookie error_cookie; }; + struct symbol_tables tbl; }; static inline bool nft_output_reversedns(const struct output_ctx *octx) |