_Pragma ("GCC diagnostic push")
#endif
+#define VIR_WARNINGS_NO_UNUSED_FUNCTION \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wunused-function\"")
+
/* Workaround bogus GCC 6.0 for logical 'or' equal expression warnings.
* (GCC bz 69602) */
#if BROKEN_GCC_WLOGICALOP_EQUAL_EXPR
ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la
wireshark_src_libvirt_la_CFLAGS = \
- -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS) $(XDR_CFLAGS)
+ -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS) $(XDR_CFLAGS) $(AM_CFLAGS)
wireshark_src_libvirt_la_LDFLAGS = -avoid-version -module
wireshark_src_libvirt_la_SOURCES = \
wireshark/src/packet-libvirt.h \
} \
}
+VIR_WARNINGS_NO_UNUSED_FUNCTION
+
XDR_PRIMITIVE_DISSECTOR(int, gint32, int)
XDR_PRIMITIVE_DISSECTOR(u_int, guint32, uint)
XDR_PRIMITIVE_DISSECTOR(short, gint16, int)
XDR_PRIMITIVE_DISSECTOR(double, gdouble, double)
XDR_PRIMITIVE_DISSECTOR(bool, bool_t, boolean)
+VIR_WARNINGS_RESET
+
typedef gboolean (*vir_xdr_dissector_t)(tvbuff_t *tvb, proto_tree *tree, XDR *xdrs, int hf);
typedef struct vir_dissector_index vir_dissector_index_t;
}
static void
-dissect_libvirt_fds(tvbuff_t *tvb, gint start, gint32 nfds)
+dissect_libvirt_fds(tvbuff_t *tvb G_GNUC_UNUSED,
+ gint start G_GNUC_UNUSED,
+ gint32 nfds G_GNUC_UNUSED)
{
/* TODO: NOP for now */
}
return; /* No payload */
if (status == VIR_NET_OK) {
- vir_xdr_dissector_t xd = find_payload_dissector(proc, type, get_program_data(prog, VIR_PROGRAM_DISSECTORS),
- *(gsize *)get_program_data(prog, VIR_PROGRAM_DISSECTORS_LEN));
+ const vir_dissector_index_t *pds = get_program_data(prog, VIR_PROGRAM_DISSECTORS);
+ const gsize *len = get_program_data(prog, VIR_PROGRAM_DISSECTORS_LEN);
+
+ if (!len)
+ goto unknown;
+
+ vir_xdr_dissector_t xd = find_payload_dissector(proc, type, pds, *len);
if (xd == NULL)
goto unknown;
dissect_libvirt_payload_xdr_data(tvb, tree, payload_length, status, xd);