summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/meta.c b/src/meta.c
index 5c0c4e29..5901c991 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -37,17 +37,6 @@
#include <iface.h>
#include <json.h>
-static struct symbol_table *realm_tbl;
-void realm_table_meta_init(void)
-{
- realm_tbl = rt_symbol_table_init("/etc/iproute2/rt_realms");
-}
-
-void realm_table_meta_exit(void)
-{
- rt_symbol_table_free(realm_tbl);
-}
-
static void tchandle_type_print(const struct expr *expr,
struct output_ctx *octx)
{
@@ -341,29 +330,27 @@ const struct datatype pkttype_type = {
.sym_tbl = &pkttype_type_tbl,
};
-struct symbol_table *devgroup_tbl = NULL;
-
-void devgroup_table_init(void)
+void devgroup_table_init(struct nft_ctx *ctx)
{
- devgroup_tbl = rt_symbol_table_init("/etc/iproute2/group");
+ ctx->output.tbl.devgroup = rt_symbol_table_init("/etc/iproute2/group");
}
-void devgroup_table_exit(void)
+void devgroup_table_exit(struct nft_ctx *ctx)
{
- rt_symbol_table_free(devgroup_tbl);
+ rt_symbol_table_free(ctx->output.tbl.devgroup);
}
static void devgroup_type_print(const struct expr *expr,
- struct output_ctx *octx)
+ struct output_ctx *octx)
{
- return symbolic_constant_print(devgroup_tbl, expr, true, octx);
+ return symbolic_constant_print(octx->tbl.devgroup, expr, true, octx);
}
static struct error_record *devgroup_type_parse(struct parse_ctx *ctx,
const struct expr *sym,
struct expr **res)
{
- return symbolic_constant_parse(ctx, sym, devgroup_tbl, res);
+ return symbolic_constant_parse(ctx, sym, ctx->tbl->devgroup, res);
}
const struct datatype devgroup_type = {