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-ieee80211-netmon.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-ieee80211-netmon.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211-netmon.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ieee80211-netmon.c b/epan/dissectors/packet-ieee80211-netmon.c index b2d9bddc2a..b27483c48d 100644 --- a/epan/dissectors/packet-ieee80211-netmon.c +++ b/epan/dissectors/packet-ieee80211-netmon.c @@ -252,9 +252,8 @@ dissect_netmon_802_11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void } else { phdr->has_frequency = TRUE; phdr->frequency = channel; - proto_tree_add_uint_format_value(wlan_tree, hf_netmon_802_11_frequency, - tvb, offset, 4, channel, - "%u Mhz", channel); + proto_tree_add_uint(wlan_tree, hf_netmon_802_11_frequency, + tvb, offset, 4, channel); calc_channel = ieee80211_mhz_to_chan(channel); if (calc_channel != -1) { phdr->has_channel = TRUE; @@ -363,7 +362,7 @@ proto_register_netmon_802_11(void) { &hf_netmon_802_11_channel, { "Channel", "netmon_802_11.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_frequency, { "Center frequency", "netmon_802_11.frequency", FT_UINT32, - BASE_DEC, NULL, 0x0, NULL, HFILL } }, + BASE_DEC|BASE_UNIT_STRING, &units_mhz, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_rssi, { "RSSI", "netmon_802_11.rssi", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_datarate, { "Data rate", "netmon_802_11.datarate", FT_UINT32, |