summaryrefslogtreecommitdiffstats
path: root/src/meta.c
diff options
context:
space:
mode:
authorVarsha Rao <rvarsha016@gmail.com>2017-06-30 14:56:19 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2017-06-30 12:44:54 +0200
commit5de112c239ab97ebaba5a935d29504bff0586be7 (patch)
treefa0845522c9e37e8f77fd3a245ab58826f5625e0 /src/meta.c
parent27e4cf73880b7103bffb747cdce8f9eb10e03b39 (diff)
include: Remove datatype_register().
Remove datatype_register() function and its calling __init functions. Add arguments of datatype_register() function to datatype array. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/meta.c')
-rw-r--r--src/meta.c44
1 files changed, 5 insertions, 39 deletions
diff --git a/src/meta.c b/src/meta.c
index a3033185..e9334b86 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -47,29 +47,6 @@ static void __exit realm_table_exit(void)
rt_symbol_table_free(realm_tbl);
}
-static void realm_type_print(const struct expr *expr, struct output_ctx *octx)
-{
- return symbolic_constant_print(realm_tbl, expr, true, octx);
-}
-
-static struct error_record *realm_type_parse(const struct expr *sym,
- struct expr **res)
-{
- return symbolic_constant_parse(sym, realm_tbl, res);
-}
-
-static const struct datatype realm_type = {
- .type = TYPE_REALM,
- .name = "realm",
- .desc = "routing realm",
- .byteorder = BYTEORDER_HOST_ENDIAN,
- .size = 4 * BITS_PER_BYTE,
- .basetype = &integer_type,
- .print = realm_type_print,
- .parse = realm_type_parse,
- .flags = DTYPE_F_PREFIX,
-};
-
static void tchandle_type_print(const struct expr *expr,
struct output_ctx *octx)
{
@@ -139,7 +116,7 @@ err:
return error(&sym->location, "Could not parse %s", sym->dtype->desc);
}
-static const struct datatype tchandle_type = {
+const struct datatype tchandle_type = {
.type = TYPE_CLASSID,
.name = "classid",
.desc = "TC classid",
@@ -264,7 +241,7 @@ static struct error_record *uid_type_parse(const struct expr *sym,
return NULL;
}
-static const struct datatype uid_type = {
+const struct datatype uid_type = {
.type = TYPE_UID,
.name = "uid",
.desc = "user ID",
@@ -316,7 +293,7 @@ static struct error_record *gid_type_parse(const struct expr *sym,
return NULL;
}
-static const struct datatype gid_type = {
+const struct datatype gid_type = {
.type = TYPE_GID,
.name = "gid",
.desc = "group ID",
@@ -344,7 +321,7 @@ static void pkttype_type_print(const struct expr *expr, struct output_ctx *octx)
return symbolic_constant_print(&pkttype_type_tbl, expr, false, octx);
}
-static const struct datatype pkttype_type = {
+const struct datatype pkttype_type = {
.type = TYPE_PKTTYPE,
.name = "pkt_type",
.desc = "packet type",
@@ -378,7 +355,7 @@ static struct error_record *devgroup_type_parse(const struct expr *sym,
return symbolic_constant_parse(sym, devgroup_tbl, res);
}
-static const struct datatype devgroup_type = {
+const struct datatype devgroup_type = {
.type = TYPE_DEVGROUP,
.name = "devgroup",
.desc = "devgroup name",
@@ -621,17 +598,6 @@ struct stmt *meta_stmt_alloc(const struct location *loc, enum nft_meta_keys key,
return stmt;
}
-static void __init meta_init(void)
-{
- datatype_register(&ifindex_type);
- datatype_register(&realm_type);
- datatype_register(&tchandle_type);
- datatype_register(&uid_type);
- datatype_register(&gid_type);
- datatype_register(&devgroup_type);
- datatype_register(&pkttype_type);
-}
-
/*
* @expr: payload expression
* @res: dependency expression