writing a modular dissector plugin [closed]
Hello
After having spent a few hours in prototyping my custom protocol dissector with LUA, I decided to switch to C implementation as we already have a code base in C/C++ parsing the frames.
I have now a basic dissector written in C. (on Win10 x64 / VS2015 / 2.9.0rc of WS)
I wanted to split my packet-foo.c file into several .h/.c/(*.cpp) files. (I didn't write any C code for a long time, but I think I may not be too far). I get something like that:
#include "config.h"
#include <epan/packet.h>
#include "fooheader.h" //HERE IS MY PROBLEM
//I'm getting the following:
//Error C1083 Cannot open include file: 'fooheader.h': No such file or directory
static int proto_foo = -1;
static int
dissect_foo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
//...
extractHeader();
//...
}
I tried different things in the CMakeList.txt, but didn't find out how to remedy. What did I miss?
I had already extracted some code in that fooheader.cpp/fooheader.h file for the header extraction. Including "fooheader.h" from fooheader.c doesn't seem to be a problem. Why is it the case from the base file (packet-foo.c)?
Thanks
Christophe
Not sure what problem you try to point to, I can only suggest looking at the other plugin dissectors in the source tree (e.g. wimax) to see how multiple files are being included in the build.
Thanks @Jaap. I've updated the code part indicating the error at compilation