提交 4c22fd71 编写于 作者: M Michal Privoznik

wireshark: Provide registration code for newer wireshark

As advertised in previous commits, wireshark has changed the way
that plugins register. In fact, it has done so two times since
the last time we've touched our code (wireshark v2.5.0 and
v2.9.0). Use the wireshark script from respective releases to
generate newer registration callbacks and put them into our code.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 a87a75e5
......@@ -2,10 +2,10 @@
* plugin.c: Wireshark's plugin registration
*
* The registration routines were generated using wireshark's
* make-dissector-reg script (found under wirshark.git/tools/):
* make-plugin-reg.py script (found under wirshark.git/tools/):
*
* libvirt.git/tools/wireshark/src $ \
* /path/to/wireshark.git/tools/make-dissector-reg \
* /path/to/wireshark.git/tools/make-plugin-reg.py \
* . plugin packet-libvirt.c
*
*/
......@@ -14,20 +14,31 @@
#include <gmodule.h>
#include <wireshark/config.h>
#include <wireshark/epan/proto.h>
/* plugins are DLLs */
#define WS_BUILD_DLL
#include <wireshark/ws_symbol_export.h>
#include "packet-libvirt.h"
/* Let the plugin version be the version of libvirt */
#define PLUGIN_VERSION VERSION
#define WIRESHARK_VERSION \
((VERSION_MAJOR * 1000 * 1000) + \
(VERSION_MINOR * 1000) + \
(VERSION_MICRO))
#if WIRESHARK_VERSION < 2005000
/* In 1.12 wireshark WS_DLL_PUBLIC_NOEXTERN was substitued with
* WS_DLL_PUBLIC_DEF. See wireshark's commit
* 5d87a8c46171f572568db5a47c093423482e342f for more info. */
#ifndef WS_DLL_PUBLIC_NOEXTERN
# define WS_DLL_PUBLIC_NOEXTERN WS_DLL_PUBLIC_DEF
#endif
# ifndef WS_DLL_PUBLIC_NOEXTERN
# define WS_DLL_PUBLIC_NOEXTERN WS_DLL_PUBLIC_DEF
# endif
#ifndef ENABLE_STATIC
# ifndef ENABLE_STATIC
WS_DLL_PUBLIC_NOEXTERN const gchar version[] = VERSION;
/* Start the functions we need for the plugin stuff */
......@@ -42,4 +53,42 @@ plugin_reg_handoff(void)
{
proto_reg_handoff_libvirt();
}
# endif
#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;
WS_DLL_PUBLIC_DEF const int plugin_want_major = VERSION_MAJOR;
WS_DLL_PUBLIC_DEF const int plugin_want_minor = VERSION_MINOR;
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);
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册