diff options
author | Patrick McHardy <kaber@trash.net> | 2009-03-31 04:57:48 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-03-31 04:57:48 +0200 |
commit | 4ffa6882a5eafa50625d0e4d49cdaafe69d7877c (patch) | |
tree | 6f6e5c33a3d7774120b315b6da0a07bffe19126f /src/meta.c | |
parent | 4fee12b4b0a837b4d34d21be99cda8185563f784 (diff) |
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 <kaber@trash.net>
Diffstat (limited to 'src/meta.c')
-rw-r--r-- | src/meta.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -55,6 +55,8 @@ 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, @@ -87,6 +89,8 @@ static const struct datatype tchandle_type = { .type = TYPE_TC_HANDLE, .name = "tc_handle", .desc = "TC handle", + .byteorder = BYTEORDER_BIG_ENDIAN, + .size = 4 * BITS_PER_BYTE, .basetype = &integer_type, .print = tchandle_type_print, .parse = tchandle_type_parse, @@ -164,14 +168,14 @@ static const struct datatype ifindex_type = { .type = TYPE_IFINDEX, .name = "ifindex", .desc = "interface index", + .byteorder = BYTEORDER_HOST_ENDIAN, + .size = 4 * BITS_PER_BYTE, .basetype = &integer_type, .print = ifindex_type_print, .parse = ifindex_type_parse, }; static const struct symbol_table arphrd_tbl = { - .byteorder = BYTEORDER_HOST_ENDIAN, - .size = 2 * BITS_PER_BYTE, .symbols = { SYMBOL("ether", ARPHRD_ETHER), SYMBOL("ppp", ARPHRD_PPP), @@ -189,6 +193,8 @@ const struct datatype arphrd_type = { .type = TYPE_ARPHRD, .name = "arphrd", .desc = "hardware type", + .byteorder = BYTEORDER_HOST_ENDIAN, + .size = 2 * BITS_PER_BYTE, .basetype = &integer_type, .sym_tbl = &arphrd_tbl, }; @@ -227,6 +233,8 @@ static const struct datatype uid_type = { .type = TYPE_UID, .name = "uid", .desc = "user ID", + .byteorder = BYTEORDER_BIG_ENDIAN, + .size = sizeof(uid_t) * BITS_PER_BYTE, .basetype = &integer_type, .print = uid_type_print, .parse = uid_type_parse, @@ -266,6 +274,8 @@ static const struct datatype gid_type = { .type = TYPE_GID, .name = "gid", .desc = "group ID", + .byteorder = BYTEORDER_BIG_ENDIAN, + .size = sizeof(gid_t) * BITS_PER_BYTE, .basetype = &integer_type, .print = gid_type_print, .parse = gid_type_parse, |