aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bat.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-13 14:26:27 -0500
committerMichael Mann <mmann78@netscape.net>2016-12-13 22:56:50 +0000
commitb7f4e250599d7ea0452711d388c161fd4ef61c60 (patch)
tree0eb636cef1c72912cef640148b680d8ddabbed2d /epan/dissectors/packet-bat.c
parenta869ec6f55160622a90bc437517dee91d57f85d5 (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-bat.c')
-rw-r--r--epan/dissectors/packet-bat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c
index 02b424355b..d6d67f7eae 100644
--- a/epan/dissectors/packet-bat.c
+++ b/epan/dissectors/packet-bat.c
@@ -213,8 +213,8 @@ static void dissect_bat_gwflags(tvbuff_t *tvb, guint8 gwflags, int offset, proto
up = ((upbits + 1) * down) / 8;
gwflags_tree = proto_item_add_subtree(tgw, ett_bat_batman_gwflags);
- proto_tree_add_uint_format_value(gwflags_tree, hf_bat_batman_gwflags_dl_speed, tvb, offset, 1, down, "%dkbit", down);
- proto_tree_add_uint_format_value(gwflags_tree, hf_bat_batman_gwflags_ul_speed, tvb, offset, 1, up, "%dkbit", up);
+ proto_tree_add_uint(gwflags_tree, hf_bat_batman_gwflags_dl_speed, tvb, offset, 1, down);
+ proto_tree_add_uint(gwflags_tree, hf_bat_batman_gwflags_ul_speed, tvb, offset, 1, up);
}
@@ -704,12 +704,12 @@ void proto_register_bat(void)
},
{ &hf_bat_batman_gwflags_dl_speed,
{ "Download Speed", "bat.batman.gwflags.dl_speed",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_kbit, 0x0,
NULL, HFILL }
},
{ &hf_bat_batman_gwflags_ul_speed,
{ "Upload Speed", "bat.batman.gwflags.ul_speed",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_kbit, 0x0,
NULL, HFILL }
},
{ &hf_bat_batman_seqno,