[libvirt] [PATCH 1/2] wireshark: Include more of libvirt internals

Martin Kletzander mkletzan at redhat.com
Fri Jul 4 09:42:56 UTC 2014


On Fri, Jul 04, 2014 at 10:52:19AM +0200, Michal Privoznik wrote:
>The rationale is to not duplicate code which is done in
>packet-libvirt.h for instance. Moreover, this way we can drop
>__attribute_((unused)) used int packet-libvirt.c in favor of
>ATTRIBUTE_UNUSED.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tools/wireshark/src/Makefile.am      |  2 +-
> tools/wireshark/src/packet-libvirt.c |  3 ++-
> tools/wireshark/src/packet-libvirt.h | 18 ++----------------
> 3 files changed, 5 insertions(+), 18 deletions(-)
>
>diff --git a/tools/wireshark/src/Makefile.am b/tools/wireshark/src/Makefile.am
>index 44f22be..40fe368 100644
>--- a/tools/wireshark/src/Makefile.am
>+++ b/tools/wireshark/src/Makefile.am
>@@ -18,7 +18,7 @@
> #
> # Author: Yuto KAWAMURA(kawamuray)
>
>-INCLUDES = -I$(top_srcdir)
>+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/gnulib/lib
>

you need to add includes/ as well if you want to do ...

> ws_plugin_LTLIBRARIES     = libvirt.la
> libvirt_la_SOURCES        = packet-libvirt.h packet-libvirt.c plugin.c
>diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c
>index 07098bf..5138453 100644
>--- a/tools/wireshark/src/packet-libvirt.c
>+++ b/tools/wireshark/src/packet-libvirt.c
>@@ -34,6 +34,7 @@
> #endif
> #include <rpc/xdr.h>
> #include "packet-libvirt.h"
>+#include "internal.h"
>
> static int proto_libvirt = -1;
> static int hf_libvirt_length = -1;
>@@ -413,7 +414,7 @@ dissect_libvirt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
> }
>
> static guint32
>-get_message_len(packet_info *pinfo __attribute__((unused)), tvbuff_t *tvb, int offset)
>+get_message_len(packet_info *pinfo ATTRIBUTE_UNUSED, tvbuff_t *tvb, int offset)
> {
>     return tvb_get_ntohl(tvb, offset);
> }
>diff --git a/tools/wireshark/src/packet-libvirt.h b/tools/wireshark/src/packet-libvirt.h
>index 0cab637..af54407 100644
>--- a/tools/wireshark/src/packet-libvirt.h
>+++ b/tools/wireshark/src/packet-libvirt.h
>@@ -21,6 +21,8 @@
> #ifndef _PACKET_LIBVIRT_H_
> # define _PACKET_LIBVIRT_H_
>
>+# include "libvirt/libvirt.h"
>+

... this :)

> # ifndef LIBVIRT_PORT
> #  define LIBVIRT_PORT 16509
> # endif
>@@ -84,22 +86,6 @@ static const value_string status_strings[] = {
>     { -1, NULL }
> };
>
>-/* TODO: These symbols will automatically included in generated headers in the feature */
>-# define VIR_SECURITY_MODEL_BUFLEN (256 + 1)
>-# define VIR_SECURITY_LABEL_BUFLEN (4096 + 1)
>-# define VIR_SECURITY_DOI_BUFLEN (256 + 1)
>-# define VIR_UUID_BUFLEN (16)
>-enum {
>-    VIR_TYPED_PARAM_INT     = 1, /* integer case */
>-    VIR_TYPED_PARAM_UINT    = 2, /* unsigned integer case */
>-    VIR_TYPED_PARAM_LLONG   = 3, /* long long case */
>-    VIR_TYPED_PARAM_ULLONG  = 4, /* unsigned long long case */
>-    VIR_TYPED_PARAM_DOUBLE  = 5, /* double case */
>-    VIR_TYPED_PARAM_BOOLEAN = 6, /* boolean(character) case */
>-    VIR_TYPED_PARAM_STRING  = 7, /* string case */
>-};
>-/* / */
>-
> # define VIR_ERROR_MESSAGE_DISSECTOR dissect_xdr_remote_error
>
> static gboolean dissect_xdr_int(tvbuff_t *tvb, proto_tree *tree, XDR *xdrs, int hf);
>--
>1.8.5.5
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140704/0665e812/attachment-0001.sig>


More information about the libvir-list mailing list