# Since wireshark 2.5.0 plugins can't live in top level plugindir but have
# to be under one of ["epan", "wiretap", "codecs"] subdir. The first one looks okay.
wireshark_plugindir = wireshark_plugindir / 'epan'
+
+ # Wireshark is installing ws_version.h since v2.9.0, but some distributions
+ # are not shipping it.
+ if cc.has_header('wireshark/ws_version.h')
+ conf.set('WITH_WS_VERSION', 1)
+ endif
endif
# On MinGW portablexdr provides XDR functions, on linux they are
#include <gmodule.h>
-#include <wireshark/config.h>
+#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
#include <wireshark/epan/proto.h>
/* plugins are DLLs */
#define WS_BUILD_DLL
#define PLUGIN_VERSION VERSION
#define WIRESHARK_VERSION \
- ((VERSION_MAJOR * 1000 * 1000) + \
- (VERSION_MINOR * 1000) + \
- (VERSION_MICRO))
+ ((WIRESHARK_VERSION_MAJOR * 1000 * 1000) + \
+ (WIRESHARK_VERSION_MINOR * 1000) + \
+ (WIRESHARK_VERSION_MICRO))
#if WIRESHARK_VERSION < 2005000
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_DEF const int plugin_want_major = WIRESHARK_VERSION_MAJOR;
+WS_DLL_PUBLIC_DEF const int plugin_want_minor = WIRESHARK_VERSION_MINOR;
WS_DLL_PUBLIC void plugin_register(void);