MINOR: contrib: make the peers wireshark dissector a plugin
The wireshark dissector could only be build within wireshark, which
means maintaining a wireshark binary just for this dissector. It was not
really convenient to update wireshark because of this.
This patch converts the dissector into a .so plugin which is built with
the .h found in distributions instead of the whole wireshark sources.
diff --git a/contrib/wireshark-dissectors/peers/packet-happp.c b/contrib/wireshark-dissectors/peers/packet-happp.c
index 33263b4..3490d8b 100644
--- a/contrib/wireshark-dissectors/peers/packet-happp.c
+++ b/contrib/wireshark-dissectors/peers/packet-happp.c
@@ -27,12 +27,22 @@
#include <arpa/inet.h>
#include <config.h>
+
#include <epan/to_str.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/conversation.h>
-#include "strutil.h"
-#include "packet-tcp.h"
+#include <epan/strutil.h>
+#include <epan/dissectors/packet-tcp.h>
+#include <epan/tvbuff.h>
+
+#include <ws_version.h>
+
+WS_DLL_PUBLIC_DEF const gchar plugin_version[] = "0.0.1";
+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);
+
#define HAPPP_PROTOCOL "HAProxyS"
#define HAPPP_MSG_MIN_LEN 2
@@ -49,7 +59,6 @@
#include <ctype.h>
#include <stdarg.h>
-#include "tvbuff.h"
#ifdef DEBUG
static unsigned char dbg_buf[16 << 10];
@@ -1630,3 +1639,13 @@
proto_happp, HEURISTIC_ENABLE);
}
+
+void
+plugin_register(void)
+{
+ static proto_plugin plug;
+
+ plug.register_protoinfo = proto_register_happp;
+ plug.register_handoff = proto_reg_handoff_happp;
+ proto_register_plugin(&plug);
+}