summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-dsi.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-dsi.c
parenta869ec6f55160622a90bc437517dee91d57f85d5 (diff)
downloadwireshark-b7f4e250599d7ea0452711d388c161fd4ef61c60.tar.gz
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-dsi.c')
-rw-r--r--epan/dissectors/packet-dsi.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index d760125bbb..432fbe68bd 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -228,7 +228,6 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
guint16 dsi_requestid;
gint32 dsi_code;
guint32 dsi_length;
- guint32 dsi_reserved;
struct aspinfo aspinfo;
@@ -240,7 +239,6 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
dsi_requestid = tvb_get_ntohs(tvb, 2);
dsi_code = tvb_get_ntohl(tvb, 4);
dsi_length = tvb_get_ntohl(tvb, 8);
- dsi_reserved = tvb_get_ntohl(tvb, 12);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s (%u)",
val_to_str(dsi_flags, flag_vals,
@@ -271,11 +269,10 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
4, 4, dsi_code);
break;
}
- proto_tree_add_uint_format_value(dsi_tree, hf_dsi_length, tvb,
- 8, 4, dsi_length,
- "%u bytes", dsi_length);
- proto_tree_add_uint(dsi_tree, hf_dsi_reserved, tvb,
- 12, 4, dsi_reserved);
+ proto_tree_add_item(dsi_tree, hf_dsi_length, tvb,
+ 8, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(dsi_tree, hf_dsi_reserved, tvb,
+ 12, 4, ENC_BIG_ENDIAN);
}
switch (dsi_command) {
@@ -389,7 +386,7 @@ proto_register_dsi(void)
{ &hf_dsi_length,
{ "Length", "dsi.length",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0,
"Total length of the data that follows the DSI header.", HFILL }},
{ &hf_dsi_reserved,