summaryrefslogtreecommitdiffstats
path: root/src/exthdr.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-03-31 04:14:26 +0200
committerPatrick McHardy <kaber@trash.net>2009-03-31 04:14:26 +0200
commit4fee12b4b0a837b4d34d21be99cda8185563f784 (patch)
tree129d65c66938c3851be3a3a35eb6523e5fef8791 /src/exthdr.c
parent53fc2c7a799877c5859298bd16b578711af9cca2 (diff)
datatype: maintain table of all datatypes and add registration/lookup function
Add a table containing all available datatypes and registration/lookup functions. This will be used to associate a stand-alone set in the kernel with the correct type without parsing the entire ruleset. Additionally it would now be possible to remove the global declarations for the core types. Not done yet though. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/exthdr.c')
-rw-r--r--src/exthdr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/exthdr.c b/src/exthdr.c
index 718979a5..ee02cd53 100644
--- a/src/exthdr.c
+++ b/src/exthdr.c
@@ -227,7 +227,8 @@ static const struct symbol_table mh_type_tbl = {
static const struct datatype mh_type_type = {
.type = TYPE_MH_TYPE,
- .name = "Mobility Header Type",
+ .name = "mh_type",
+ .desc = "Mobility Header Type",
.basetype = &integer_type,
.sym_tbl = &mh_type_tbl,
};
@@ -243,3 +244,8 @@ const struct exthdr_desc exthdr_mh = {
[MHHDR_CHECKSUM] = MH_FIELD("checksum", ip6mh_cksum, &integer_type),
},
};
+
+static void __init exthdr_init(void)
+{
+ datatype_register(&mh_type_type);
+}