2019-02-08 08:10:24 +00:00
|
|
|
/*
|
|
|
|
* plugin.c: Wireshark's plugin registration
|
|
|
|
*
|
|
|
|
* The registration routines were generated using wireshark's
|
2019-02-08 09:36:43 +00:00
|
|
|
* make-plugin-reg.py script (found under wirshark.git/tools/):
|
2019-02-08 08:10:24 +00:00
|
|
|
*
|
|
|
|
* libvirt.git/tools/wireshark/src $ \
|
2019-02-08 09:36:43 +00:00
|
|
|
* /path/to/wireshark.git/tools/make-plugin-reg.py \
|
2019-02-08 08:10:24 +00:00
|
|
|
* . plugin packet-libvirt.c
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2020-09-07 15:50:24 +00:00
|
|
|
#ifdef WITH_WS_VERSION
|
|
|
|
# include <wireshark/ws_version.h>
|
|
|
|
#else
|
|
|
|
# include <wireshark/config.h>
|
|
|
|
# define WIRESHARK_VERSION_MAJOR VERSION_MAJOR
|
|
|
|
# define WIRESHARK_VERSION_MINOR VERSION_MINOR
|
|
|
|
# define WIRESHARK_VERSION_MICRO VERSION_MICRO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HAVE_PLUGINS 1
|
2019-02-08 09:36:43 +00:00
|
|
|
#include <wireshark/epan/proto.h>
|
2019-02-08 08:10:24 +00:00
|
|
|
/* plugins are DLLs */
|
|
|
|
#define WS_BUILD_DLL
|
|
|
|
#include <wireshark/ws_symbol_export.h>
|
|
|
|
|
|
|
|
#include "packet-libvirt.h"
|
|
|
|
|
2019-02-08 09:36:43 +00:00
|
|
|
/* Let the plugin version be the version of libvirt */
|
|
|
|
#define PLUGIN_VERSION VERSION
|
|
|
|
|
|
|
|
#define WIRESHARK_VERSION \
|
2020-09-07 15:50:24 +00:00
|
|
|
((WIRESHARK_VERSION_MAJOR * 1000 * 1000) + \
|
|
|
|
(WIRESHARK_VERSION_MINOR * 1000) + \
|
|
|
|
(WIRESHARK_VERSION_MICRO))
|
2019-02-08 09:36:43 +00:00
|
|
|
|
|
|
|
#if WIRESHARK_VERSION < 2005000
|
2019-02-08 08:10:24 +00:00
|
|
|
|
2019-02-08 11:05:23 +00:00
|
|
|
WS_DLL_PUBLIC_DEF const gchar version[] = VERSION;
|
2019-02-08 08:10:24 +00:00
|
|
|
|
|
|
|
/* Start the functions we need for the plugin stuff */
|
|
|
|
|
2019-02-08 11:05:23 +00:00
|
|
|
WS_DLL_PUBLIC_DEF void
|
2019-02-08 08:10:24 +00:00
|
|
|
plugin_register(void)
|
|
|
|
{
|
|
|
|
proto_register_libvirt();
|
|
|
|
}
|
2019-02-08 11:05:23 +00:00
|
|
|
WS_DLL_PUBLIC_DEF void
|
2019-02-08 08:10:24 +00:00
|
|
|
plugin_reg_handoff(void)
|
|
|
|
{
|
|
|
|
proto_reg_handoff_libvirt();
|
|
|
|
}
|
2019-02-08 09:36:43 +00:00
|
|
|
|
|
|
|
#elif WIRESHARK_VERSION < 2009000
|
|
|
|
|
|
|
|
WS_DLL_PUBLIC_DEF const gchar plugin_version[] = PLUGIN_VERSION;
|
|
|
|
WS_DLL_PUBLIC_DEF const gchar plugin_release[] = VERSION_RELEASE;
|
|
|
|
|
|
|
|
WS_DLL_PUBLIC void plugin_register(void);
|
|
|
|
|
|
|
|
void plugin_register(void)
|
|
|
|
{
|
|
|
|
static proto_plugin plug_libvirt;
|
|
|
|
|
|
|
|
plug_libvirt.register_protoinfo = proto_register_libvirt;
|
|
|
|
plug_libvirt.register_handoff = proto_reg_handoff_libvirt;
|
|
|
|
proto_register_plugin(&plug_libvirt);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* WIRESHARK_VERSION >= 2009000 */
|
|
|
|
|
|
|
|
void proto_register_libvirt(void);
|
|
|
|
void proto_reg_handoff_libvirt(void);
|
|
|
|
|
|
|
|
WS_DLL_PUBLIC_DEF const gchar plugin_version[] = PLUGIN_VERSION;
|
2020-09-07 15:50:24 +00:00
|
|
|
WS_DLL_PUBLIC_DEF const int plugin_want_major = WIRESHARK_VERSION_MAJOR;
|
|
|
|
WS_DLL_PUBLIC_DEF const int plugin_want_minor = WIRESHARK_VERSION_MINOR;
|
2019-02-08 09:36:43 +00:00
|
|
|
|
|
|
|
WS_DLL_PUBLIC void plugin_register(void);
|
|
|
|
|
|
|
|
void plugin_register(void)
|
|
|
|
{
|
|
|
|
static proto_plugin plug_libvirt;
|
|
|
|
|
|
|
|
plug_libvirt.register_protoinfo = proto_register_libvirt;
|
|
|
|
plug_libvirt.register_handoff = proto_reg_handoff_libvirt;
|
|
|
|
proto_register_plugin(&plug_libvirt);
|
|
|
|
}
|
|
|
|
|
2019-02-08 08:10:24 +00:00
|
|
|
#endif
|