--- /dev/null
+CFLAGS = `pkg-config --cflags wireshark` -g -fPIC
+LDFLAGS = `pkg-config --libs wireshark`
+
+NAME = packet-happp.so
+OBJS = packet-happp.o
+
+plugins=$(HOME)/.wireshark/plugins/
+
+$(NAME): $(OBJS)
+ $(CC) -shared $(LDFLAGS) $(OBJS) -o $@
+
+install: $(NAME)
+ install -d $(DESTDIR)$(plugins)
+ install -m 0755 $(NAME) $(DESTDIR)$(plugins)
+
+clean:
+ rm $(NAME) $(OBJS)
packet-happp.c file DISSECTOR_SRC variable which list all wireshark
- README: this file.
-2) To build wireshark with HAPPP dissection support
+2a) To build wireshark with HAPPP dissection support
---------------------------------------------------
- Download wireshark sources:
$ git clone https://code.wireshark.org/review/wireshark
$ ./autogen.sh
$ ./configure
$ make
+
+2b) Alternative: build the HAPPP dissector as a wireshark plugin
+-----------------------------------------------------------------
+If you don't want to build completely wireshark, you can build the dissector as
+a plugin.
+
+You will need the development package of your distribution, which is
+"libwireshark-dev" for debian based distribution and "wireshark-dev" for
+redhat-based ones.
+
+$ make
+
+To install it in your home directory:
+
+$ make install
+
+The plugin will be installed in ~/.wireshark/plugins/ by default, but you can
+change this path by setting the "plugins" variable. If it didn't work, check
+the paths in "Help > About Wireshark > Folders > Personal Plugins" which should
+give you the right path to use.
+
+In some distribution it will be in ~/.local/lib/wireshark/ so you will need to
+install it this way:
+
+$ make install plugins=~/.local/lib/wireshark/plugins/3.2/epan/
+
+If you want to install it in the system directory you can do it this way, the
+righ path is also in the Folder window. Change the plugins variable this way:
+
+$ sudo make install plugins=/usr/lib64/wireshark/plugins/3.2/epan/
+
+Be careful to use the right version number in the path.
+
+3) Check if you have the dissector in wireshark
+-----------------------------------------------
+To verify if the protocol was well loaded by your wireshark, open the Supported
+Protocols window in "View > Internals > Supported Protocols" and look for
+"HAPPP".
+
+In the case of a plugin, you should see your plugin loaded in "Help > About
+Wireshark > Plugins".
#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
#include <ctype.h>
#include <stdarg.h>
-#include "tvbuff.h"
#ifdef DEBUG
static unsigned char dbg_buf[16 << 10];
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);
+}