aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cattp.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-cattp.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-cattp.c')
-rw-r--r--epan/dissectors/packet-cattp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-cattp.c b/epan/dissectors/packet-cattp.c
index 9e293f4002..e79922e3b1 100644
--- a/epan/dissectors/packet-cattp.c
+++ b/epan/dissectors/packet-cattp.c
@@ -116,6 +116,8 @@ static const value_string cattp_reset_reason[] = {
{ 0, NULL }
};
+static const unit_name_string units_pdu = { "PDU", "PDUs" };
+
/* Forward declartion due to use of heuristic dissection preference. */
void proto_reg_handoff_cattp(void);
void proto_register_cattp(void);
@@ -181,8 +183,7 @@ dissect_cattp_eakpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cattp_tree,
guint8 eak_count;
eak_count = (hlen - offset) >> 1;
- eaki = proto_tree_add_uint_format_value(cattp_tree, hf_cattp_eaklen, tvb, offset, eak_count * 2,
- eak_count, "%u PDUs", eak_count);
+ eaki = proto_tree_add_uint(cattp_tree, hf_cattp_eaklen, tvb, offset, eak_count * 2, eak_count);
if (eak_count > 0) {
proto_item *eak_tree;
@@ -528,7 +529,7 @@ proto_register_cattp(void)
{
&hf_cattp_eaklen,
{
- "Extended Acknowledgement Numbers", "cattp.eaks", FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Extended Acknowledgement Numbers", "cattp.eaks", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_pdu, 0x0,
NULL, HFILL
}
}