From f9c2bdc413e01e70ac66494f012feb87c9ae8f6b Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Sat, 11 Jan 2020 00:03:39 +0100 Subject: Implement all mapping macros for the new proto tree API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new proto tree API uses mapping macros to map calls to the proto_tree_add_* functions. These were defined for the up til then in use functions. In the mean time functions have been added and workarounds for non mapped functions were used. This change adds the missing mapping macros so that now all proto_tree_add_* functions taking a hfi address are mapped properly. Also fix two dissectors that failed the mapping. Change-Id: I91d800439fe2c4487ca53c00c44d7aa46ce70e1d Reviewed-on: https://code.wireshark.org/review/35743 Petri-Dish: Jaap Keuter Tested-by: Petri Dish Buildbot Reviewed-by: Jörg Mayer Reviewed-by: Jaap Keuter --- epan/dissectors/packet-gadu-gadu.c | 4 ++-- epan/dissectors/packet-netlink-net_dm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-gadu-gadu.c b/epan/dissectors/packet-gadu-gadu.c index 2f6cb78b0d..e462d53be3 100644 --- a/epan/dissectors/packet-gadu-gadu.c +++ b/epan/dissectors/packet-gadu-gadu.c @@ -1428,14 +1428,14 @@ dissect_gadu_gadu_userlist_xml_compressed(tvbuff_t *tvb, packet_info *pinfo, pro return offset; if ((uncomp_tvb = tvb_child_uncompress(tvb, tvb, offset, remain))) { - proto_tree_add_bytes_format_value(tree, &hfi_gadu_gadu_userlist, tvb, offset, remain, NULL, "[Decompression succeeded]"); + proto_tree_add_bytes_format_value(tree, &hfi_gadu_gadu_userlist, tvb, offset, remain, NULL, "%s", "[Decompression succeeded]"); add_new_data_source(pinfo, uncomp_tvb, "Uncompressed userlist"); /* XXX add DTD (pinfo->match_string) */ call_dissector_only(xml_handle, uncomp_tvb, pinfo, tree, NULL); } else - proto_tree_add_bytes_format_value(tree, &hfi_gadu_gadu_userlist, tvb, offset, remain, NULL, "[Error: Decompression failed] (or no zlib)"); + proto_tree_add_bytes_format_value(tree, &hfi_gadu_gadu_userlist, tvb, offset, remain, NULL, "%s", "[Error: Decompression failed] (or no zlib)"); offset += remain; diff --git a/epan/dissectors/packet-netlink-net_dm.c b/epan/dissectors/packet-netlink-net_dm.c index 3b463b3350..6d9392e5b2 100644 --- a/epan/dissectors/packet-netlink-net_dm.c +++ b/epan/dissectors/packet-netlink-net_dm.c @@ -312,7 +312,7 @@ dissect_net_dm_attrs(tvbuff_t *tvb, void *data, struct packet_netlink_data *nl_d proto_tree_add_item(tree, &hfi_net_dm_alert_mode, tvb, offset, len, nl_data->encoding); return 1; case WS_NET_DM_ATTR_PC: - proto_tree_add_item_ret_uint64(tree, hfi_net_dm_pc.id, tvb, + proto_tree_add_item_ret_uint64(tree, &hfi_net_dm_pc, tvb, offset, 8, nl_data->encoding, &pc); proto_item_append_text(tree, ": 0x%" G_GINT64_MODIFIER "x", pc); return 1; -- cgit v1.2.3