From 98aefa813d04bebf9e5c33da3422e3ba1ef94403 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 28 Jul 2016 10:21:45 +0200 Subject: [PATCH] wireshark: Adapt to dissector function header change In wireshark commit bbdd89b9 (contained in 2.1.0 release) they have changed prototype of dissector function. Now it returns number of bytes consumed by the dissector, and can get a pointer to user specified data (which we don't use). Signed-off-by: Michal Privoznik --- tools/wireshark/src/packet-libvirt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c index aa1c3237f4..569a0a1729 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -442,8 +442,14 @@ get_message_len(packet_info *pinfo ATTRIBUTE_UNUSED, tvbuff_t *tvb, int offset) return tvb_get_ntohl(tvb, offset); } +#if WIRESHARK_VERSION >= 2000001 +static int +dissect_libvirt(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree, void *data ATTRIBUTE_UNUSED) +#else static void dissect_libvirt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +#endif { /* Another magic const - 4; simply, how much bytes * is needed to tell the length of libvirt packet. */ @@ -454,6 +460,10 @@ dissect_libvirt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_message_len, dissect_libvirt_message, NULL); #endif + +#if WIRESHARK_VERSION >= 2000001 + return tvb_captured_length(tvb); +#endif } void -- 2.39.5