diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-08-08 00:30:28 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-08-08 12:03:57 +0200 |
commit | 45cb29a2ada4edfc2b547fe023d923ce0299a61d (patch) | |
tree | f47fb5792e1d6cfaad2ef7efe83fc37c2833b927 /src/json.c | |
parent | a805eab34e34aaf2f08c607e770ec0b8df992f4a (diff) |
src: remove global symbol_table
Store symbol tables in context object instead. Use the nft_ctx object to
store the dynamic symbol table. Pass it on to the parse_ctx object so
this can be accessed from the parse routines. This dynamic symbol table
is also accesible from the output_ctx object for print routines.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1006,18 +1006,18 @@ json_t *inet_service_type_json(const struct expr *expr, struct output_ctx *octx) json_t *mark_type_json(const struct expr *expr, struct output_ctx *octx) { - return symbolic_constant_json(mark_tbl, expr, octx); + return symbolic_constant_json(octx->tbl.mark, expr, octx); } json_t *devgroup_type_json(const struct expr *expr, struct output_ctx *octx) { - return symbolic_constant_json(devgroup_tbl, expr, octx); + return symbolic_constant_json(octx->tbl.devgroup, expr, octx); } json_t *ct_label_type_json(const struct expr *expr, struct output_ctx *octx) { unsigned long bit = mpz_scan1(expr->value, 0); - const char *labelstr = ct_label2str(bit); + const char *labelstr = ct_label2str(octx->tbl.ct_label, bit); if (labelstr) return json_string(labelstr); |