I have just built Wireshark, without modifying it, and now I'm trying to add a custom dissector as a plugin (64bit with Windows 7). I have followed the instruction provided by README.plugins, but there are some steps that are not so clear to me, so I hope someone could help me here!
Firstly I have created a folder for my files: plugins\MyProtocol (where MyProtocol is the short name of the protocol I'm trying to implement). I've added there all the files listed on README.plugins, by copying (and modifying, when needed) them from the Development\wireshark\plugins\gryphon but:
Makefile.common= I should list here some files (e.g. the source file) in some variables, but in the copied makefile there isn't any of the variables described by README.plugins (e.g.DISSECTOR___SRC or DISSECTOR_SUPPORT_SRC). I post here the content of Makefile.common
Did I take the wrong file? If yes, what one should I have taken? If not, do I have to add these variables myself? Can you give me some sample code performing this task? I'm not able to write this kind of code...
Compiling= once I have the plugins\MyProtocol folder ready, what do I have to do in order to compile my plugin as a dll? I can't find a real description on README.plugin: point 3 is just a description of the differences between custom and permanent addition; point 3.1 should explain my task, but apart from copying those Custom.*.example, and modifying the installer (which, for now, is not interesting to me), there is no explanation about the building itself. Do I have to use the same procedure to compile Wireshark? Or something different? Do I have to copy my MyProtocol folder to Development\wireshark\plugins, and recompile Wireshark? Maybe before doing that, I need to modify something in order to "tell" WS that I have added something; how can I achieve that?
Thanks in avance
asked 05 Aug '14, 02:40
The instructions appear to be a little off-mark. DISSECTOR_SRC is used in CMakeLists.txt for CMake builds and isn't used for nmake builds.
AFAICT you need to modify Makefile.common, changing "gryphon" to "MyProtocol", and also modify moduleinfo.h and moduleinfo.nmake with names and version numbers.
To build your plugin you have the two options shown in Sect 3. A custom plugin, which is used if you aren't going to contribute your dissector back to the Wireshark community (why not?), requires you to copy
Whichever method you use, just start the build again from the top-level source directory as you did for the plain vanilla build.
answered 05 Aug '14, 03:11