diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-13 14:26:27 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-13 22:56:50 +0000 |
commit | b7f4e250599d7ea0452711d388c161fd4ef61c60 (patch) | |
tree | 0eb636cef1c72912cef640148b680d8ddabbed2d /epan/dissectors/packet-idp.c | |
parent | a869ec6f55160622a90bc437517dee91d57f85d5 (diff) |
Adjust proto_tree_add_uint_format_value calls to use unit string
Several calls to proto_tree_add_uint_format_value could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field. There also
a few cases where proto_tree_add_uint_format_value could just be
proto_tree_add_uint.
Added a few more "common" unit string values to unit_strings.[ch]
Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d
Reviewed-on: https://code.wireshark.org/review/19242
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-idp.c')
-rw-r--r-- | epan/dissectors/packet-idp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-idp.c b/epan/dissectors/packet-idp.c index 3e4a44d227..fa0945671f 100644 --- a/epan/dissectors/packet-idp.c +++ b/epan/dissectors/packet-idp.c @@ -90,8 +90,7 @@ dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree_add_checksum(idp_tree, tvb, 0, hf_idp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); length = tvb_get_ntohs(tvb, 2); - proto_tree_add_uint_format_value(idp_tree, hf_idp_len, tvb, 2, 2, length, - "%u bytes", length); + proto_tree_add_uint(idp_tree, hf_idp_len, tvb, 2, 2, length); /* Adjust the tvbuff length to include only the IDP datagram. */ set_actual_length(tvb, length); proto_tree_add_item(idp_tree, hf_idp_hops, tvb, 4, 1, ENC_BIG_ENDIAN); @@ -149,8 +148,8 @@ proto_register_idp(void) #endif { &hf_idp_len, - { "Length", "idp.len", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, + { "Length", "idp.len", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, + &units_byte_bytes, 0x0, NULL, HFILL }}, /* XXX - does this have separate hop count and time subfields? */ { &hf_idp_hops, |