This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to add a GIOP dissector to 2.0

0

I am trying to add a dissector to the new 2.0 build for Windows and need a bit of help as this is my first time using the new cmake structure.

The dissector is a CORBA dissector generated from our IDL using the wireshark_be.py script for omniorb.

I have put the .c file in epan/dissectors and added it to epan/CMakeListsCustom.txt

I've run cmake and can see it including the custom list.

I then run msbuild /m /p:Configuration=RelWithDebInfo wireshark.sln. This appears to compile my dissector with no errors and the.obj file exists with all the other packet-*.obj files.

But when I run Wireshark my dissector isn't in the list. So what is the step I'm missing to get the dissector linked in.

Thanks for any help

asked 04 Nov '15, 08:05

Andy%20Ling's gravatar image

Andy Ling
1333
accept rate: 0%


One Answer:

0

The documentation on this is somewhat lacking, all contributions accepted.

If this is really a plugin, then epan\CMakeListsCustom.txt is not the place for this as that's for built in dissectors.

For a plugin, you need to add the plugin directory to the list of plugin directories, I'm not entirely sure how you do this. In the main CMakeLists.txt there is a variable PLUGIN_SRC_DIRS, that is set to all the "standard" plugins and is also has the value CUSTOM_PLUGIN_SRC_DIR appended to it, so I think you need to arrange that that variable contains the source directory of your plugin, probably via a -D CUSTOM_PLUGIN_SRC_DIR=plugins/xxx on the CMake command line. For multiple directories you'll need to experiment.

You'll also need an appropriate CMakeLists.txt in your plugin source directory.

answered 04 Nov '15, 08:46

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks for the input.

I have got it working. It looks like the problem was actually a warning I'd ignored on some other plugins I've added that I thought were working. Fixing that warning has made the GIOP disector work.

As to your comments about what is & isn't a plugin, I'm not sure, but what I am doing roughly maps what I was told for version 1 Wireshark.

I have some "real" plugins which dissect their own protocol and these are in plugins/xxx directories. This required creating a CMakeListsCustom.txt in the root directory of Wireshark. There is an example file to show you what to do.

The GIOP plugin/dissector is an "add on" to GIOP. These all seem to live in epan/dissectors and there is a CMakeListsCustom.txt file in epan to let you add new ones. Which is what I have done.

If this isn't the right way, then can someone tell me what is.

Thanks

(04 Nov '15, 09:11) Andy Ling

Simple rule is if it's in epan\dissectors, then its classed as a built-in dissector, even if it does "plug-in" to giop. After all tcp "plugs-in" to ip.

In the Wireshark world, a plugin lives outside of epan\dissectors, is a separate loadable module (a dll on Windows) and shows up in the plugins tab of the About dialog.

I'd missed the CMakeListCustom.txt.example in the root of the sources, I looked for it in the plugins directory where the additional plugins were listed for nmake builds and a grep for .txt files including CUSTOM_PLUGIN_SRC_DIR obviously missed the example file.

Anyway, your issue is solved, and I'm now a bit wiser.

(04 Nov '15, 09:53) grahamb ♦