From 4ffa6882a5eafa50625d0e4d49cdaafe69d7877c Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 31 Mar 2009 04:57:48 +0200 Subject: datatype: add/move size and byte order information into data types Add size and type information to non-basetype types and remove the now redundant information from the symbol tables. This will be used to determine size and byteorder of set members without analyzing the ruleset for incremental update operations. Signed-off-by: Patrick McHardy --- src/ct.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ct.c') diff --git a/src/ct.c b/src/ct.c index b077a5f9..1baefed8 100644 --- a/src/ct.c +++ b/src/ct.c @@ -26,8 +26,6 @@ #include static const struct symbol_table ct_state_tbl = { - .byteorder = BYTEORDER_HOST_ENDIAN, - .size = 4 * BITS_PER_BYTE, .symbols = { SYMBOL("invalid", NF_CT_STATE_INVALID_BIT), SYMBOL("new", NF_CT_STATE_BIT(IP_CT_NEW)), @@ -42,13 +40,13 @@ static const struct datatype ct_state_type = { .type = TYPE_CT_STATE, .name = "ct_state", .desc = "conntrack state", + .byteorder = BYTEORDER_HOST_ENDIAN, + .size = 4 * BITS_PER_BYTE, .basetype = &bitmask_type, .sym_tbl = &ct_state_tbl, }; static const struct symbol_table ct_dir_tbl = { - .byteorder = BYTEORDER_INVALID, - .size = BITS_PER_BYTE, .symbols = { SYMBOL("original", IP_CT_DIR_ORIGINAL), SYMBOL("reply", IP_CT_DIR_REPLY), @@ -60,13 +58,13 @@ static const struct datatype ct_dir_type = { .type = TYPE_CT_DIR, .name = "ct_dir", .desc = "conntrack direction", + .byteorder = BYTEORDER_INVALID, + .size = BITS_PER_BYTE, .basetype = &bitmask_type, .sym_tbl = &ct_dir_tbl, }; static const struct symbol_table ct_status_tbl = { - .byteorder = BYTEORDER_HOST_ENDIAN, - .size = 4 * BITS_PER_BYTE, /* * There are more, but most of them don't make sense for filtering. */ @@ -86,6 +84,8 @@ static const struct datatype ct_status_type = { .type = TYPE_CT_STATUS, .name = "ct_status", .desc = "conntrack status", + .byteorder = BYTEORDER_HOST_ENDIAN, + .size = 4 * BITS_PER_BYTE, .basetype = &bitmask_type, .sym_tbl = &ct_status_tbl, }; -- cgit v1.2.3