~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to doc/README.plugins

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
$Id: README.plugins 18271 2006-05-31 19:12:15Z gerald $
 
1
$Id: README.plugins 20180 2006-12-20 16:24:19Z jake $
2
2
 
3
3
1. Plugins
4
4
 
27
27
Makefile.common
28
28
Makefile.nmake
29
29
moduleinfo.h
 
30
moduleinfo.nmake
 
31
plugin.rc.in
30
32
The source files and header files for your dissector
31
33
 
 
34
Examples of these files can be found in plugins/h223.
 
35
 
32
36
2.1 AUTHORS, COPYING, and ChangeLog
33
37
 
34
38
The AUTHORS, COPYING, and ChangeLog are the standard sort of GPL project 
35
 
files; see plugins/docsis for examples.
36
 
 
37
 
2.2 Makefile.am and Makefile.nmake
38
 
 
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".
 
39
files.
 
40
 
 
41
2.2 Makefile.am 
 
42
 
 
43
For your plugins/xxx/Makefile.am file, see the corresponding file in 
 
44
plugins/h223. Replace all occurrences of "h223" in those files with "xxx".
42
45
 
43
46
2.3 Makefile.common
44
47
 
45
48
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.)
49
 
 
50
 
2.4 moduleinfo.h
51
 
 
52
 
Your plugins/xxx/moduleinfo.h file is used to set the version
53
 
information for the plugin.  An example follows:
54
 
 
55
 
/* Included *after* config.h, in order to re-define these macros */
56
 
 
57
 
#ifdef PACKAGE
58
 
#undef PACKAGE
59
 
#endif
60
 
 
61
 
/* Name of package */
62
 
#define PACKAGE "xxx"
63
 
 
64
 
#ifdef VERSION
65
 
#undef VERSION
66
 
#endif
67
 
 
68
 
/* Version number of package */
69
 
#define VERSION "0.0.8"
 
49
dissector in the DISSECTOR_SRC variable, and all supporting source files
 
50
in the DISSECTOR_SUPPORT_SRC variable.
 
51
The header files for your dissector, if any, must be listed in the 
 
52
DISSECTOR_INCLUDES variable. The DISSECTOR_INCLUDES variable should not 
 
53
include moduleinfo.h. 
 
54
 
 
55
2.4 Makefile.nmake
 
56
 
 
57
For your plugins/xxx/Makefile.nmake file, see the corresponding file in 
 
58
plugins/h223. No modifications are needed here.
 
59
 
 
60
2.5 moduleinfo.h
 
61
 
 
62
Your plugins/xxx/moduleinfo.h file is used to set the version information 
 
63
for the plugin. 
 
64
 
 
65
2.6 moduleinfo.nmake
 
66
 
 
67
Your plugins/xxx/moduleinfo.nmake is used to set the version information
 
68
for building the plugin. Its contents should match that in moduleinfo.h
 
69
 
 
70
2.7 plugin.rc.in
 
71
 
 
72
Your plugins/xxx/plugin.rc.in is the Windows resource template file
 
73
used to add the plugin specific information as resources to the DLL.
 
74
No modifications are needed here.
70
75
 
71
76
3. Changes to existing Wireshark files
72
77
 
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.
 
78
You will also need to change the plugins/Makefile.am, the 
 
79
plugins/Makefile.nmake, the toplevel Makefile.am file, and the 
 
80
toplevel configure.in file.
76
81
 
77
82
3.1  Changes to plugins/Makefile.am
78
83
 
143
148
Unfortunately there are quite some several places in the top level
144
149
Makefile.am that need to be altered for adding a plugin.
145
150
 
146
 
Add your plugin to the plugin_libs and plugin_ldadd (two times):
 
151
Add your plugin to the plugin_libs and plugin_ldadd:
147
152
 
148
153
plugin_libs = \
149
154
        plugins/gryphon/gryphon.la \
151
156
        plugins/xxx/xxx.la
152
157
 
153
158
if ENABLE_STATIC
154
 
plugin_ldadd = \
155
 
        plugins/gryphon/gryphon.o \
156
 
        plugins/mgcp/mgcp.o \
157
 
        plugins/xxx/xxx.o 
 
159
plugin_ldadd = (plugin_libs)
158
160
 
159
161
else          # ENABLE_STATIC
160
162
plugin_ldadd = \
187
189
  tools/lemon/Makefile
188
190
  ,)
189
191
 
 
192
3.5  Changes to the installers
 
193
 
 
194
If you want to include your plugin in an installer you have to add lines 
 
195
in the NSIS installer wireshark.nsi file, and U3 installer makefile.nmake 
 
196
file.
190
197
 
191
198
4. Development and plugins
192
199
 
210
217
 
211
218
make install
212
219
 
213
 
5. How to update an "old style" plugin (using plugin_init function)
 
220
5. Update "old style" plugins
 
221
 
 
222
5.1 How to update an "old style" plugin (using plugin_register and 
 
223
    plugin_reg_handoff functions).
 
224
 
 
225
The plugin registration has changed with the extension of the build
 
226
scripts. These now generate the additional code needed for plugin 
 
227
encapsulation in plugin.c. When using the new style build scripts,
 
228
stips the parts outlined below:
 
229
 
 
230
    o Remove the following include statments:
 
231
 
 
232
        #include <gmodule.h>
 
233
        #include "moduleinfo.h"
 
234
 
 
235
    o Removed the definition:
 
236
 
 
237
        #ifndef ENABLE_STATIC
 
238
        G_MODULE_EXPORT gchar version[] = VERSION;
 
239
        #endif
 
240
 
 
241
    o Move relevant code from the blocks and delete these functions:
 
242
 
 
243
        #ifndef ENABLE_STATIC
 
244
        plugin_reg_handoff()
 
245
        ....
 
246
        #endif
 
247
 
 
248
        #ifndef ENABLE_STATIC
 
249
        plugin_register()
 
250
        ....
 
251
        #endif
 
252
 
 
253
This will leave a clean dissector source file without plugin specifics.
 
254
 
 
255
5.2 How to update an "old style" plugin (using plugin_init function)
214
256
 
215
257
The plugin registering has changed between 0.10.9 and 0.10.10; everyone
216
258
is encouraged to update their plugins as outlined below:
241
283
Jeff Foster <jfoste@woodward.com>
242
284
Olivier Abad <oabad@cybercable.fr>
243
285
Laurent Deniel <laurent.deniel@free.fr>
 
286
Jaap Keuter <jaap.keuter@xs4all.nl>