From 0e1824475e2e7aee09dd2d5c38fc4ebd4b7ab8bb Mon Sep 17 00:00:00 2001 From: Elise Lennion Date: Mon, 19 Dec 2016 19:11:04 -0300 Subject: expression: Show the base which pre-defined constants are displayed so the user know how we express it. The base was added to all symbol tables, which are associated with datatype->sym_tbl, so they are displayed in the right base. Signed-off-by: Elise Lennion Signed-off-by: Pablo Neira Ayuso --- src/proto.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/proto.c') diff --git a/src/proto.c b/src/proto.c index 8930bed6..fb965304 100644 --- a/src/proto.c +++ b/src/proto.c @@ -303,6 +303,7 @@ const struct proto_desc proto_comp = { #include static const struct symbol_table icmp_type_tbl = { + .base = BASE_DECIMAL, .symbols = { SYMBOL("echo-reply", ICMP_ECHOREPLY), SYMBOL("destination-unreachable", ICMP_DEST_UNREACH), @@ -391,6 +392,7 @@ const struct proto_desc proto_udplite = { #include static const struct symbol_table tcp_flag_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("fin", TCP_FLAG_FIN), SYMBOL("syn", TCP_FLAG_SYN), @@ -449,6 +451,7 @@ const struct proto_desc proto_tcp = { */ static const struct symbol_table dccp_pkttype_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("request", DCCP_PKT_REQUEST), SYMBOL("response", DCCP_PKT_RESPONSE), @@ -514,6 +517,7 @@ const struct proto_desc proto_sctp = { #include static const struct symbol_table dscp_type_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("cs0", 0x00), SYMBOL("cs1", 0x08), @@ -553,6 +557,7 @@ static const struct datatype dscp_type = { }; static const struct symbol_table ecn_type_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("not-ect", 0x00), SYMBOL("ect1", 0x01), @@ -628,6 +633,7 @@ const struct proto_desc proto_ip = { #include static const struct symbol_table icmp6_type_tbl = { + .base = BASE_DECIMAL, .symbols = { SYMBOL("destination-unreachable", ICMP6_DST_UNREACH), SYMBOL("packet-too-big", ICMP6_PACKET_TOO_BIG), @@ -778,6 +784,7 @@ const struct proto_desc proto_inet_service = { #include static const struct symbol_table arpop_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("request", __constant_htons(ARPOP_REQUEST)), SYMBOL("reply", __constant_htons(ARPOP_REPLY)), @@ -866,6 +873,7 @@ const struct datatype etheraddr_type = { }; static const struct symbol_table ethertype_tbl = { + .base = BASE_HEXADECIMAL, .symbols = { SYMBOL("ip", __constant_htons(ETH_P_IP)), SYMBOL("arp", __constant_htons(ETH_P_ARP)), -- cgit v1.2.3