summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-08-07 23:51:18 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-08-08 12:03:26 +0200
commita805eab34e34aaf2f08c607e770ec0b8df992f4a (patch)
tree20cbd71040e52ee4d4fe3dc450e5d9d6eeb71d1d /src/meta.c
parente8417f7bcbfe20524307557f8687bdd3a665f73e (diff)
src: add parse_ctx object
This object stores the dynamic symbol tables that are loaded from files. Pass this object to datatype parse functions, although this new parameter is not used yet, this is just a preparation patch. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/meta.c b/src/meta.c
index 1e8964eb..5c0c4e29 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -68,7 +68,8 @@ static void tchandle_type_print(const struct expr *expr,
}
}
-static struct error_record *tchandle_type_parse(const struct expr *sym,
+static struct error_record *tchandle_type_parse(struct parse_ctx *ctx,
+ const struct expr *sym,
struct expr **res)
{
uint32_t handle;
@@ -142,7 +143,8 @@ static void ifindex_type_print(const struct expr *expr, struct output_ctx *octx)
nft_print(octx, "%d", ifindex);
}
-static struct error_record *ifindex_type_parse(const struct expr *sym,
+static struct error_record *ifindex_type_parse(struct parse_ctx *ctx,
+ const struct expr *sym,
struct expr **res)
{
int ifindex;
@@ -220,7 +222,8 @@ static void uid_type_print(const struct expr *expr, struct output_ctx *octx)
expr_basetype(expr)->print(expr, octx);
}
-static struct error_record *uid_type_parse(const struct expr *sym,
+static struct error_record *uid_type_parse(struct parse_ctx *ctx,
+ const struct expr *sym,
struct expr **res)
{
struct passwd *pw;
@@ -273,7 +276,8 @@ static void gid_type_print(const struct expr *expr, struct output_ctx *octx)
expr_basetype(expr)->print(expr, octx);
}
-static struct error_record *gid_type_parse(const struct expr *sym,
+static struct error_record *gid_type_parse(struct parse_ctx *ctx,
+ const struct expr *sym,
struct expr **res)
{
struct group *gr;
@@ -355,10 +359,11 @@ static void devgroup_type_print(const struct expr *expr,
return symbolic_constant_print(devgroup_tbl, expr, true, octx);
}
-static struct error_record *devgroup_type_parse(const struct expr *sym,
+static struct error_record *devgroup_type_parse(struct parse_ctx *ctx,
+ const struct expr *sym,
struct expr **res)
{
- return symbolic_constant_parse(sym, devgroup_tbl, res);
+ return symbolic_constant_parse(ctx, sym, devgroup_tbl, res);
}
const struct datatype devgroup_type = {