From d03de764e498954a08251dee9e820347ad177970 Mon Sep 17 00:00:00 2001 From: Elise Lennion Date: Sat, 10 Dec 2016 21:59:36 -0200 Subject: datatype: Display pre-defined inet_service values in decimal base because the convention is to represent ports in base 10. gcc-workaround is no longer needed and was removed. Signed-off-by: Elise Lennion Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 7 +++++-- src/services.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/datatype.c b/src/datatype.c index 5600efcc..ec0b1201 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -204,8 +204,11 @@ void symbol_table_print(const struct symbol_table *tbl, if (byteorder == BYTEORDER_BIG_ENDIAN) switch_byteorder(&value, len); - printf("\t%-30s\t0x%.*" PRIx64 "\n", - s->identifier, 2 * len, value); + if (tbl->base == BASE_DECIMAL) + printf("\t%-30s\t%20lu\n", s->identifier, value); + else + printf("\t%-30s\t0x%.*" PRIx64 "\n", + s->identifier, 2 * len, value); } } diff --git a/src/services.c b/src/services.c index 0ba195e9..83c26723 100644 --- a/src/services.c +++ b/src/services.c @@ -2,7 +2,8 @@ #include const struct symbol_table inet_service_tbl = { - .symbols = { + .base = BASE_DECIMAL, + .symbols = { SYMBOL("tcpmux", __constant_htons(1)), SYMBOL("echo", __constant_htons(7)), SYMBOL("discard", __constant_htons(9)), -- cgit v1.2.3