]> xenbits.xensource.com Git - libvirt.git/commitdiff
wireshark: Adapt to dissector function header change
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 28 Jul 2016 08:21:45 +0000 (10:21 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 28 Jul 2016 15:39:03 +0000 (17:39 +0200)
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@redhat.com>
tools/wireshark/src/packet-libvirt.c

index aa1c3237f449cbb1b0f5c9c29ed4304b1700f401..569a0a17293a42c74746b0dad4d81c337a16310e 100644 (file)
@@ -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