aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ixveriwave.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-14 17:34:56 -0500
committerMichael Mann <mmann78@netscape.net>2016-12-16 01:55:10 +0000
commit8efb7fece1ffefd26dacd79f5ec8722c4e01e827 (patch)
treecafadc9d104e2b163c54834aa62a8b9b1bcfb0d7 /epan/dissectors/packet-ixveriwave.c
parentd706f9c221e85992f7011baed53f5b31b7109493 (diff)
Adjust proto_tree_add_xxx_format_value calls to use unit string
proto_tree_add_uint_format_value had the most use of unit strings, this patch handles all of the other proto_tree_add_xxx_format_value calls that could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. Added more "common" unit string values to unit_strings.[ch] Change-Id: I0fb680be781e10037eb7bd40dd21a9ee20c1fb1c Reviewed-on: https://code.wireshark.org/review/19288 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ixveriwave.c')
-rw-r--r--epan/dissectors/packet-ixveriwave.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index d50f4dd782..d0cd5c1c7e 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -402,9 +402,8 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
if (length_remaining >= 8) {
vw_startt = tvb_get_letoh64(tvb, offset);
- proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_startt,
- tvb, offset, 8, vw_startt,
- "%" G_GINT64_MODIFIER "u usec", vw_startt);
+ proto_tree_add_uint64(vw_times_tree, hf_ixveriwave_vw_startt,
+ tvb, offset, 8, vw_startt);
offset +=8;
length_remaining -=8;
@@ -414,9 +413,8 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
if (length_remaining >= 8) {
vw_endt = tvb_get_letoh64(tvb, offset);
- proto_tree_add_uint64_format_value(vw_times_tree, hf_ixveriwave_vw_endt,
- tvb, offset, 8, vw_endt,
- "%" G_GINT64_MODIFIER "u usec", vw_endt);
+ proto_tree_add_uint64(vw_times_tree, hf_ixveriwave_vw_endt,
+ tvb, offset, 8, vw_endt);
offset +=8;
length_remaining -=8;
@@ -814,35 +812,31 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
phdr.signal_dbm = dbm;
col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", dbm);
if (tap_tree) {
- proto_tree_add_int_format_value(tap_tree,
+ proto_tree_add_int(tap_tree,
hf_radiotap_dbm_antsignal,
- tvb, offset, 1, dbm,
- "%d dBm", dbm);
+ tvb, offset, 1, dbm);
}
offset++;
dbm = (gint8) tvb_get_guint8(tvb, offset);
if (tap_tree && dbm != 100) {
- proto_tree_add_int_format_value(tap_tree,
+ proto_tree_add_int(tap_tree,
hf_radiotap_dbm_antb,
- tvb, offset, 1, dbm,
- "%d dBm", dbm);
+ tvb, offset, 1, dbm);
}
offset++;
dbm = (gint8) tvb_get_guint8(tvb, offset);
if (tap_tree && dbm != 100) {
- proto_tree_add_int_format_value(tap_tree,
+ proto_tree_add_int(tap_tree,
hf_radiotap_dbm_antc,
- tvb, offset, 1, dbm,
- "%d dBm", dbm);
+ tvb, offset, 1, dbm);
}
offset++;
dbm = (gint8) tvb_get_guint8(tvb, offset);
if (tap_tree && dbm != 100) {
- proto_tree_add_int_format_value(tap_tree,
+ proto_tree_add_int(tap_tree,
hf_radiotap_dbm_antd,
- tvb, offset, 1, dbm,
- "%d dBm", dbm);
+ tvb, offset, 1, dbm);
}
offset+=2;
@@ -1274,11 +1268,11 @@ void proto_register_ixveriwave(void)
{ &hf_ixveriwave_vw_startt,
{ "Frame start timestamp", "ixveriwave.startt",
- FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_microseconds, 0x0, NULL, HFILL } },
{ &hf_ixveriwave_vw_endt,
{ "Frame end timestamp", "ixveriwave.endt",
- FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_microseconds, 0x0, NULL, HFILL } },
{ &hf_ixveriwave_vw_pktdur,
{ "Packet duration", "ixveriwave.pktdur",
@@ -1447,22 +1441,22 @@ framing signal deasserted. this is caused by software setting the drain all reg
{ &hf_radiotap_dbm_antsignal,
{ "SSI Signal", "ixveriwave.dbm_antsignal",
- FT_INT32, BASE_DEC, NULL, 0x0,
+ FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0,
"RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } },
{ &hf_radiotap_dbm_antb,
{ "SSI Signal for Antenna B", "ixveriwave.dbm_antb",
- FT_INT32, BASE_DEC, NULL, 0x0,
+ FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0,
"RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } },
{ &hf_radiotap_dbm_antc,
{ "SSI Signal for Antenna C", "ixveriwave.dbm_antc",
- FT_INT32, BASE_DEC, NULL, 0x0,
+ FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0,
"RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } },
{ &hf_radiotap_dbm_antd,
{ "SSI Signal for Antenna D", "ixveriwave.dbm_antd",
- FT_INT32, BASE_DEC, NULL, 0x0,
+ FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0,
"RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } },
/* Boolean 'present' flags */