aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-udp.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-udp.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-udp.c')
-rw-r--r--epan/dissectors/packet-udp.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c
index c559488390..c1dedf0553 100644
--- a/epan/dissectors/packet-udp.c
+++ b/epan/dissectors/packet-udp.c
@@ -1082,24 +1082,16 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
process_tree = proto_tree_add_subtree(udp_tree, tvb, offset, 0, ett_udp_process_info, &ti, "Process Information");
PROTO_ITEM_SET_GENERATED(ti);
if (udpd->fwd && udpd->fwd->command) {
- proto_tree_add_uint_format_value(process_tree, hfi_udp_proc_dst_uid.id, tvb, 0, 0,
- udpd->fwd->process_uid, "%u", udpd->fwd->process_uid);
- proto_tree_add_uint_format_value(process_tree, hfi_udp_proc_dst_pid.id, tvb, 0, 0,
- udpd->fwd->process_pid, "%u", udpd->fwd->process_pid);
- proto_tree_add_string_format_value(process_tree, hfi_udp_proc_dst_uname.id, tvb, 0, 0,
- udpd->fwd->username, "%s", udpd->fwd->username);
- proto_tree_add_string_format_value(process_tree, hfi_udp_proc_dst_cmd.id, tvb, 0, 0,
- udpd->fwd->command, "%s", udpd->fwd->command);
+ proto_tree_add_uint(process_tree, &hfi_udp_proc_dst_uid, tvb, 0, 0, udpd->fwd->process_uid);
+ proto_tree_add_uint(process_tree, &hfi_udp_proc_dst_pid, tvb, 0, 0, udpd->fwd->process_pid);
+ proto_tree_add_string(process_tree, &hfi_udp_proc_dst_uname, tvb, 0, 0, udpd->fwd->username);
+ proto_tree_add_string(process_tree, &hfi_udp_proc_dst_cmd, tvb, 0, 0, udpd->fwd->command);
}
if (udpd->rev->command) {
- proto_tree_add_uint_format_value(process_tree, hfi_udp_proc_src_uid.id, tvb, 0, 0,
- udpd->rev->process_uid, "%u", udpd->rev->process_uid);
- proto_tree_add_uint_format_value(process_tree, hfi_udp_proc_src_pid.id, tvb, 0, 0,
- udpd->rev->process_pid, "%u", udpd->rev->process_pid);
- proto_tree_add_string_format_value(process_tree, hfi_udp_proc_src_uname.id, tvb, 0, 0,
- udpd->rev->username, "%s", udpd->rev->username);
- proto_tree_add_string_format_value(process_tree, hfi_udp_proc_src_cmd.id, tvb, 0, 0,
- udpd->rev->command, "%s", udpd->rev->command);
+ proto_tree_add_uint(process_tree, &hfi_udp_proc_src_uid, tvb, 0, 0, udpd->rev->process_uid);
+ proto_tree_add_uint(process_tree, &hfi_udp_proc_src_pid, tvb, 0, 0, udpd->rev->process_pid);
+ proto_tree_add_string(process_tree, &hfi_udp_proc_src_uname, tvb, 0, 0, udpd->rev->username);
+ proto_tree_add_string(process_tree, &hfi_udp_proc_src_cmd, tvb, 0, 0, udpd->rev->command);
}
}