There are two ways to add your plugin dissector to the build: as a custom extension or as a permanent addition. The custom extension is easy to configure, but won’t be used for inclusion in the distribution if that’s your goal. Setting up the permanent addition is somewhat more involved.
To integrate your plugin with CMake, either pass the custom plugin dir on the CMake generation step command line:
cmake ... -DCUSTOM_PLUGIN_SRC_DIR="plugins/epan/foo"
or copy the top-level file CMakeListsCustom.txt.example to CMakeListsCustom.txt
(also in the top-level source dir) and edit so that CUSTOM_PLUGIN_SRC_DIR
is
set() to the relative path of your plugin, e.g.
set(CUSTOM_PLUGIN_SRC_DIR plugins/epan/foo)
and re-run the CMake generation step.
To build the plugin, run your normal Wireshark build step.
If you want to add the plugin to your own Windows installer add a text file named custom_plugins.txt to the packaging/nsis directory, with a "File" statement for NSIS:
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\foo.dll"
In order to be able to permanently add a plugin take the following steps. You will need to change the following files:
You might also want to search your Wireshark development directory for occurrences of an existing plugin name, in case this document is out of date with the current directory structure. For example,
grep -rl gryphon .
could be used from a shell prompt.
Add your plugin (in alphabetical order) to the PLUGIN_SRC_DIRS:
if(ENABLE_PLUGINS) ... set(PLUGIN_SRC_DIRS ... plugins/epan/ethercat plugins/epan/foo plugins/epan/gryphon plugins/epan/irda ...
If you want to include your plugin in an installer you have to add lines in the NSIS installer wireshark.nsi file.
Add the relative path of your plugin DLL (in alphabetical order) to the list of "File" statements in the "Dissector Plugins" section:
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ethercat.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\foo.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\gryphon.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\irda.dll"