5 Writing a "plugin" dissector is not very different from writing a
6 standard one. In fact all of the functions described in
7 README.developer can be used in the plugins exactly as the are used in
10 (Note, however, that not all OSes on which Wireshark runs can support
13 If you've chosen "xxx" as the name of your plugin (typically, that would
14 be a short name for your protocol, in all lower case), the following
15 instructions tell you how to implement it as a plugin. All occurrences
16 of "xxx" below should be replaced by the name of your plugin.
18 2. The directory for the plugin, and its files
20 The plugin should be placed in a new plugins/xxx directory which should
21 contain minimally the following files:
30 The source files and header files for your dissector
32 2.1 AUTHORS, COPYING, and ChangeLog
34 The AUTHORS, COPYING, and ChangeLog are the standard sort of GPL project
35 files; see plugins/docsis for examples.
37 2.2 Makefile.am and Makefile.nmake
39 For your plugins/xxx/Makefile.am and plugins/xxx/Makefile.nmake files,
40 see the corresponding files in plugins/docsis. Replace all occurrences
41 of "docsis" in those files with "xxx".
45 Your plugins/xxx/Makefile.common should list the source files for your
46 dissector, in the DISSECTOR_SRC variable, and the header files for your
47 dissector, if any, in the DISSECTOR_INCLUDES variable. (The
48 DISSECTOR_INCLUDES variable should not include moduleinfo.h.)
52 Your plugins/xxx/moduleinfo.h file is used to set the version
53 information for the plugin. An example follows:
55 /* Included *after* config.h, in order to re-define these macros */
68 /* Version number of package */
69 #define VERSION "0.0.8"
71 3. Changes to existing Wireshark files
73 You will also need to change the plugins/Makefile.am toplevel
74 Makefile.am, the plugins/Makefile.nmake toplevel Makefile.nmake, the
75 toplevel Makefile.am file, and the toplevel configure.in file.
77 3.1 Changes to plugins/Makefile.am
79 The plugins directory contains a Makefile.am.
80 You need to change the SUBDIRS directive to reflect the addition of
89 3.2 Changes to plugins/Makefile.nmake
91 To the Makefile.nmake you need to add your plugin to the all: rule
98 then add a rule for your plugin:
102 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
105 and finally add to the clean rule support for cleaning up after your
110 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
112 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
115 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
121 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
123 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
126 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
130 maintainer-clean: clean
132 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
134 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
137 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
141 3.3 Changes to the top level Makefile.am
143 Unfortunately there are quite some several places in the top level
144 Makefile.am that need to be altered for adding a plugin.
146 Add your plugin to the plugin_libs and plugin_ldadd (two times):
149 plugins/gryphon/gryphon.la \
150 plugins/mgcp/mgcp.la \
155 plugins/gryphon/gryphon.o \
156 plugins/mgcp/mgcp.o \
162 "-dlopen" plugins/gryphon/gryphon.la \
163 "-dlopen" plugins/mgcp/mgcp.la \
164 "-dlopen" plugins/xxx/xxx.la
166 3.4 Changes to top level configure.in
168 You need to add your plugins Makefile to the AC_OUTPUT rule in the
176 packaging/nsis/Makefile
177 packaging/rpm/Makefile
178 packaging/rpm/wireshark.spec
179 packaging/svr4/Makefile
180 packaging/svr4/checkinstall
181 packaging/svr4/pkginfo
183 plugins/gryphon/Makefile
184 plugins/mgcp/Makefile
191 4. Development and plugins
193 Plugins make some aspects of development easier and some harder.
195 The good news is that if you are working on a single plugin
196 then you will find recompiling the plugin MUCH faster than
197 recompiling a dissector and then linking it back into wireshark.
199 The bad news is that wireshark will not use the plugin unless the
200 plugin is installed in one of the places it expects to look.
202 One way to deal with this problem is to set up a working root for
203 wireshark, say in $HOME/build/root and build wireshark to install
206 ./configure --prefix=${HOME}/build/root;make install
208 then subsequent rebuilds/installs of your plugin can be accomplished
209 by going to the plugins/xxx directory and running
213 5. How to update an "old style" plugin (using plugin_init function)
215 The plugin registering has changed between 0.10.9 and 0.10.10; everyone
216 is encouraged to update their plugins as outlined below:
218 o Remove following include statements from all plugin sources:
220 #include "plugins/plugin_api.h"
221 #include "plugins/plugin_api_defs.h"
223 o Remove the init function.
225 o Add a new Makefile.common file with the lists of source files and
228 o Change the Makefile.am and Makefile.nmake files to match those of
233 Ed Warnicke <hagbard@physics.rutgers.edu>
234 Guy Harris <guy@alum.mit.edu>
236 Derived and expanded from the plugin section of README.developers
237 which was originally written by
239 James Coe <jammer@cin.net>
240 Gilbert Ramirez <gram@alumni.rice.edu>
241 Jeff Foster <jfoste@woodward.com>
242 Olivier Abad <oabad@cybercable.fr>
243 Laurent Deniel <laurent.deniel@free.fr>