Wireshark-dev: Re: [Wireshark-dev] what are the steps needed to add a plugin

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Wed, 14 Nov 2007 21:48:16 +0100
Hi,

See it as a tradeoff.

Option 1 is to add your dissector build in.
This means that you'll have to rebuild register.c and relink libwireshark every time you change your dissector. With a ton of dissectors this takes a while.

Option 2 is to add your dissector as a plugin.
This takes some work to setup, as you've seen, but build cycles are much faster. You only handle files that most likely are actually changed.

So usually you start of with the plugin style and once things start to calm down (Win32: or you need stuff not exported yet) you consider moving the dissector build in. That is what we would like if you decide to submit the code for inclusion.

Other considerations may be expected release cycles of your dissector vs Wireshark. If you release faster, it's easier to simply distribute a new plugin than a complete installer.

So you see, enough stuff to think about.

Thanx,
Jaap

jaydeep chokshi wrote:
Greeting folks,

I am a newbie to the wireshark development. I created a plugin *foo *(in Linux) that comes into action after Ethernet header has been dissected.

In order to compile wireshark with the plugin, I had to make following additions/changes,

1. In the *foo* directory,
  1.1 Edit Makefile.common to add entries of sources and headers.
1.2 Edit the Makefile.in <http://Makefile.in> to add entries of *.lo in "am_objects_x"
  1.3 Add plugin entry in Makefile.am <http://Makefile.am>

2. In *plugin (../foo) *directory,
   2.1 Edit Makefile to add an entry of foo
   2.2 Edit the Makefile.in <http://Makefile.in> to add an entry of foo
   2.3 Edit the Makefile.am <http://Makefile.am> to add an entry of foo

3. In *wireshark (../plugin)* directory,
3.1 Edit Makefile to add an entry of foo in "am_DEPENDENCIES_2" variable. 3.2 Edit Makefile.in <http://Makefile.in> to add an entry of foo in "am_DEPENDENCIES_1" variable. 3.3 Edit configure script to add entry of foo in "ac_config_files" variable. 3.4 Edit configure.in <http://configure.in> script to add entry of foo in "AC_OUTPUT(" variable.


Having done all the above changes, I managed to attach the plugin to wireshark binary.

My question cum confusion is, do we have to go through all the pain in order to make a plugin work? I mean, do we need to edit these many Makefiles every single time we add a new plugin?

Let me know if I am doing something wrong here. I greatly appreciate it.


Thanks,

JD