aboutsummaryrefslogtreecommitdiffstats
path: root/doc/README.plugins
diff options
context:
space:
mode:
authorLars Roland <Lars.Roland@gmx.net>2005-03-05 06:28:10 +0000
committerLars Roland <Lars.Roland@gmx.net>2005-03-05 06:28:10 +0000
commit00273300e721999ac67a4ce66dab80fed6a1314f (patch)
treeac2c8b87fdd4dc989c3ef1d3b646f7700ba7626c /doc/README.plugins
parent1a7b3ec1439203e3bea3381dfb31b4357758b4c3 (diff)
Preparations for dropping the old plugin api.
Introduce a new init routine for plugins, which does not take the plugin api table as an argument and allows etheral to distinguish between plugins using the old and the new api. Update README.plugins accordingly Change all g_warnings() in epan/plugins.c to report_failue(). On windows we do not have a log console open while loading the plugins, because a log console cannot be opened before the prefs have been read. Thus g_warnings() does not work for reporting problems with plugins. svn path=/trunk/; revision=13596
Diffstat (limited to 'doc/README.plugins')
-rw-r--r--doc/README.plugins40
1 files changed, 18 insertions, 22 deletions
diff --git a/doc/README.plugins b/doc/README.plugins
index cbc78078eb..59d7975485 100644
--- a/doc/README.plugins
+++ b/doc/README.plugins
@@ -15,13 +15,6 @@ only a few changes you need to make to "pluginize" your dissector.
1 New headers needed in packet-xxx.c
-#include "plugins/plugin_api.h"
-
-Some OSes (Win32) have DLLs that cannot reference symbols in the parent
-executable. So, the executable needs to provide a table of pointers for the DLL
-plugin to use. The plugin_api.h header provides definitions for this (or empty
-definitions on OSes which don't need this).
-
#include "moduleinfo.h"
This header is optional and is described in greater detail further on.
@@ -35,11 +28,6 @@ you include "gmodule.h"; however, "glib.h" is protected from multiple
inclusion by #ifdefs, so it's safe to include it after including
"gmodule.h".
-#include "plugins/plugin_api_defs.h"
-Only include this in one source file if you have more than one. It defines,
-(as opposed to declares,) the function pointer variables that the plugin uses
-to reference the address table.
-
2 New exported constants in packet-xxx.c
Plugins need to provide the following exported constants:
@@ -59,19 +47,15 @@ The following two functions need to be exported by the plugin:
#ifndef ENABLE_STATIC
G_MODULE_EXPORT void
-plugin_init(plugin_address_table_t *pat)
+new_plugin_init(void)
#endif
This function is called by Ethereal when the plugin is initialized; it's
similar to the "proto_register_XXX()" routine for a non-plugin
-dissector, except for the name and the call to
-"plugin_address_table_init()".
+dissector, except for the name.
Here is a sample code for the function:
- /* initialise the table of pointers needed in Win32 DLLs */
- plugin_address_table_init(pat);
-
/* register the new protocol, protocol fields, and subtrees */
if (proto_xxx == -1) { /* execute protocol initialization only once */
proto_register_xxx();
@@ -150,12 +134,9 @@ CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
-!IFDEF LINK_PLUGINS_WITH_LIBETHEREAL
+!IFDEF ENABLE_LIBETHEREAL
LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
-!ELSE
-LINK_PLUGIN_WITH=..\plugin_api.obj
-!ENDIF
OBJECTS=packet-xxx.obj
@@ -163,11 +144,15 @@ xxx.dll xxx.exp xxx.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
link -dll /out:xxx.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
$(GLIB_LIBS)
+!ENDIF
+
clean:
rm -f $(OBJECTS) xxx.dll xxx.exp xxx.lib *.pdb
distclean: clean
+maintainer-clean: distclean
+
4.3 plugins/xxx/moduleinfo.h
moduleinfo.h is used to set the version information for the plugin.
@@ -238,6 +223,17 @@ distclean: clean
cd ..
+maintainer-clean: clean
+ cd gryphon
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+ cd ../mgcp
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+ cd ..
+ cd xxx
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+ cd ..
+
+
4.6 Changes to the top level Makefile.am
Unfortunately there are quite some several places in the top level