From ceef7eba755cbecf670653360f72d864949dac49 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Fri, 5 Sep 2014 08:48:37 -0400 Subject: Eliminate proto_tree_add_text from some of the dissectors. Other minor cleanups while in the area. Change-Id: I8ea59205cfe6fab643d8fe01b75ce91532004fd9 Reviewed-on: https://code.wireshark.org/review/4004 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- epan/dissectors/packet-ptp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'epan/dissectors/packet-ptp.c') diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c index 2c0d9d4bb9..a1c79558dd 100644 --- a/epan/dissectors/packet-ptp.c +++ b/epan/dissectors/packet-ptp.c @@ -1533,6 +1533,7 @@ static int hf_ptp_v2_mm_displayName_length = -1; static int hf_ptp_v2_mm_maxKey = -1; static int hf_ptp_v2_mm_currentOffset = -1; static int hf_ptp_v2_mm_jumpSeconds = -1; +static int hf_ptp_v2_mm_nextjumpSeconds = -1; static int hf_ptp_v2_mm_logAlternateMulticastSyncInterval = -1; static int hf_ptp_v2_mm_numberOfAlternateMasters = -1; static int hf_ptp_v2_mm_transmitAlternateMulticastSync = -1; @@ -3812,8 +3813,8 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) timeStamp = timeStamp << 16; timeStamp = timeStamp | tvb_get_ntohs(tvb, Offset+4); - proto_tree_add_text(ptp_managementData_tree, tvb, Offset, 6, - "Time of next jump (seconds): %" G_GINT64_MODIFIER "u", timeStamp); + proto_tree_add_uint64(ptp_managementData_tree, hf_ptp_v2_mm_nextjumpSeconds, tvb, + Offset, 6, timeStamp); Offset +=6; proto_tree_add_item(ptp_managementData_tree, hf_ptp_v2_mm_reserved, tvb, @@ -5883,6 +5884,11 @@ proto_register_ptp(void) FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + { &hf_ptp_v2_mm_nextjumpSeconds, + { "Time of next jump (seconds)", "ptp.v2.mm.nextjumpSeconds", + FT_UINT64, BASE_DEC, NULL, 0x00, + NULL, HFILL } + }, { &hf_ptp_v2_mm_numberOfAlternateMasters, { "Number of alternate masters", "ptp.v2.mm.numberOfAlternateMasters", FT_UINT8, BASE_DEC, NULL, 0x00, -- cgit v1.2.3