]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: contrib: Make the wireshark peers dissector compile for more distribs.
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 19 Jan 2021 13:33:24 +0000 (14:33 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 19 Jan 2021 14:22:35 +0000 (15:22 +0100)
With a 2.6.8 wireshark, this module could not compile because of ws_version.h
missing header. This patch offers the possibility to compile this plugin without
having to include this header. Furthermore with my wireshark version a
"plugin_release" object is required to make it be loaded by wireshark. This is
a string which seems to have to match a dotted string made of you wireshark
major and minor versions.

contrib/wireshark-dissectors/peers/Makefile
contrib/wireshark-dissectors/peers/README
contrib/wireshark-dissectors/peers/packet-happp.c

index 9e70802fb860762ed6ab5debd2cf7dfd7d793249..95149e70e74f0c8a20c9df3580131b0d0d8caa08 100644 (file)
@@ -1,4 +1,4 @@
-CFLAGS = `pkg-config --cflags wireshark` -g -fPIC
+CFLAGS  = `pkg-config --cflags wireshark` -g -fPIC $(OPTS)
 LDFLAGS = `pkg-config --libs wireshark`
 
 NAME = packet-happp.so
index 78cafcd5f68f29544c2eb2b6f3839bb216a0e8f6..83b57d298656231c033bb10447942d2725feb95e 100644 (file)
@@ -37,6 +37,16 @@ redhat-based ones.
 
 $ make
 
+It is possible that depending on your distribution the compilation may fail
+with such an error:
+
+  packet-happp.c:40:10: fatal error: ws_version.h: No such file or directory
+                #include <ws_version.h>
+
+In this case try to build this plugins with this OPTS variable:
+
+$ OPTS=-DWITHOUT_WS_VERSION make
+
 To install it in your home directory:
 
 $ make install
index 3490d8b9e786c0f940a1cd211df18d60d23cd460..a5e25640ae6036e546564cd6255a347b0d68b1ef 100644 (file)
 #include <epan/dissectors/packet-tcp.h>
 #include <epan/tvbuff.h>
 
+#ifndef WITHOUT_WS_VERSION
 #include <ws_version.h>
+#endif
+
+#ifndef WIRESHARK_VERSION_MAJOR
+#define WIRESHARK_VERSION_MAJOR VERSION_MAJOR
+#endif
+#ifndef WIRESHARK_VERSION_MINOR
+#define WIRESHARK_VERSION_MINOR VERSION_MINOR
+#endif
+#ifndef WIRESHARK_VERSION_MICRO
+#define WIRESHARK_VERSION_MICRO VERSION_MICRO
+#endif
+
+#define HAPP_STR(str)  #str
+#define HAPP_XSTR(str) HAPP_STR(str)
 
 WS_DLL_PUBLIC_DEF const gchar plugin_version[] = "0.0.1";
+WS_DLL_PUBLIC_DEF const gchar plugin_release[] = HAPP_XSTR(WIRESHARK_VERSION_MAJOR.WIRESHARK_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);