[libvirt] [PATCH] wireshark: Adapt to dissector function header change

Michal Privoznik mprivozn at redhat.com
Thu Jul 28 11:19:43 UTC 2016


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 <mprivozn at redhat.com>
---
 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 aa1c323..569a0a1 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.8.4




More information about the libvir-list mailing list