diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2015-09-30 14:34:39 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-06-15 17:34:34 +0000 |
commit | 9ba9a05ef06a6869c2ad2970cffa0d9177c04fdd (patch) | |
tree | 27f256d85223df6598b00d8de5e66032eb90d1fa /epan | |
parent | babb9e32e9f5ac57dac0132ee8e2977b93e00675 (diff) |
Display "IP DSCP" column as short text
Ping-Bug: 12429
Change-Id: I618b2017e161d89f0efa25ce2fb82a1808e8d315
Reviewed-on: https://code.wireshark.org/review/10701
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/column.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ipv6.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/epan/column.c b/epan/column.c index f6f97a746f..709ab6bc64 100644 --- a/epan/column.c +++ b/epan/column.c @@ -520,7 +520,7 @@ get_column_longest_string(const gint format) return "0000"; break; case COL_DSCP_VALUE: - return "00"; + return "AAA BBB"; /* not the longest, but the longest is too long */ break; case COL_TEI: return "127"; diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 09f74ce48c..373e4beedc 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2062,8 +2062,8 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* iph->ip_tos = tvb_get_guint8(tvb, offset + 1); if (g_ip_dscp_actif) { - col_add_fstr(pinfo->cinfo, COL_DSCP_VALUE, "%u", - IPDSFIELD_DSCP(iph->ip_tos)); + col_add_str(pinfo->cinfo, COL_DSCP_VALUE, + val_to_str_ext(IPDSFIELD_DSCP(iph->ip_tos), &dscp_short_vals_ext, "%u")); } if (tree) { diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 444c6c1b18..236e4dcd26 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -2160,7 +2160,8 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } tfc = IPv6_HDR_TCLS(ipv6); - col_add_fstr(pinfo->cinfo, COL_DSCP_VALUE, "%u", IPDSFIELD_DSCP(tfc)); + col_add_str(pinfo->cinfo, COL_DSCP_VALUE, + val_to_str_ext(IPDSFIELD_DSCP(tfc), &dscp_short_vals_ext, "%u")); /* Get extension header and payload length */ plen = g_ntohs(ipv6->ip6_plen); |