Ethereal-dev: [Ethereal-dev] some plugin problems
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Ed Warnicke <hagbard@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 5 Nov 2000 20:38:20 -0500 (EST)
I decided to go the new-style plugin route as the mgcp dissector is a new style dissector. As a normal dissector the module worked (mostly, there are still lots of small things I'd like to fix or enhance). I think I figured out all of the appropriate places in the Makefile.am files and the configure.in to alter to add the mgcp plugin ( note, this is not nearly as easy as adding a dissector). But when I make (or attempt to run the result of make;make install) I get the complaint: ** WARNING **: The plugin mgcp.so has no protocol symbol and no plugin_reg_handoff symbol And naturally, the plugin doesn't show up while ethereal is running (no presence on the Edit->Protocols list). Now my understanding of the world was such that a new style dissector did not need the protocol symbol and that having a void plugin_reg_handoff function defined ( with no static modifier) was sufficient to insure the presence of appropriate symbols. Clearly there is something basic that I'm not understanding. I've attached the output of running cvs diff in the ethereal/ directory and a tarball of the ethereal/plugin/mgcp directory which contains the meat of things (if someone could tell me how to incorporate this into the patch I would very appreciative). To make it simpler to understand how I came to go from a working dissector to a not-quite working plugin I've included the diff between the two below. I feel strongly that my mistake is something really stupid and obvious that I just don't see for lack of experience and so am requesting assistance. Ed --- ../../packet-mgcp.c Sun Nov 5 03:14:04 2000 +++ ethereal/plugins/mgcp/packet-mgcp.c Sun Nov 5 20:01:44 2000 @@ -47,6 +47,11 @@ #include "prefs.h" #include "strutil.h" +/* Includes for the plugin stuff */ +#include "plugins/plugin_api.h" +#include "moduleinfo.h" + +DLLEXPORT const gchar version[] = VERSION; #define TCP_PORT_MGCP_GATEWAY 2427 #define UDP_PORT_MGCP_GATEWAY 2427 @@ -981,3 +986,20 @@ return (tvb_linebegin); } +void plugin_reg_handoff(void){ + proto_reg_handoff_mgcp(); +} + +DLLEXPORT void plugin_init(plugin_address_table_t *pat){ + /* initialise the table of pointers needed in Win32 DLLs */ + plugin_address_table_init(pat); + /* destroy the dfilter tree */ + dfilter_cleanup(); + /* register the new protocol, protocol fields, and subtrees */ + if (proto_mgcp == -1) { /* execute protocol initialization only once */ + proto_register_mgcp(); + } + /* initialize the dfilter tree with all the header field and protocol + * abbrevs defined, including xxx */ + dfilter_init(); +}
? ethereal-0.8.13 ? cscope.out ? make.log ? plugins/mgcp Index: Makefile.am =================================================================== RCS file: /cvsroot/ethereal/Makefile.am,v retrieving revision 1.241 diff -u -r1.241 Makefile.am --- Makefile.am 2000/11/04 07:50:47 1.241 +++ Makefile.am 2000/11/06 01:08:38 @@ -344,7 +344,8 @@ ethereal_DEPENDENCIES = \ $(ethereal_optional_objects) \ $(ethereal_additional_libs) \ - plugins/gryphon/gryphon.la + plugins/gryphon/gryphon.la \ + plugins/mgcp/mgcp.la ethereal_static_DEPENDENCIES = \ $(ethereal_optional_objects) \ @@ -362,7 +363,8 @@ $(ethereal_additional_libs) \ @SNMP_LIBS@ \ "-dlopen" self \ - "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ + "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \ + "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@ ethereal_static_LDADD = \ $(ethereal_optional_objects) \ @@ -386,7 +388,8 @@ tethereal_DEPENDENCIES = \ $(ethereal_optional_objects) \ $(tethereal_additional_libs) \ - plugins/gryphon/gryphon.la + plugins/gryphon/gryphon.la \ + plugins/mgcp/mgcp.la # This automake variable adds to the link-line for the executable tethereal_LDADD = wiretap/libwiretap.a \ @@ -395,6 +398,8 @@ @SNMP_LIBS@ \ "-dlopen" self \ "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \ + @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ \ + "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \ @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ tethereal_LDFLAGS = -export-dynamic Index: configure.in =================================================================== RCS file: /cvsroot/ethereal/configure.in,v retrieving revision 1.107 diff -u -r1.107 configure.in --- configure.in 2000/10/27 02:22:04 1.107 +++ configure.in 2000/11/06 01:08:39 @@ -414,4 +414,5 @@ packaging/svr4/checkinstall packaging/svr4/pkginfo plugins/Makefile - plugins/gryphon/Makefile) + plugins/gryphon/Makefile + plugins/mgcp/Makefile) Index: plugins/Makefile.am =================================================================== RCS file: /cvsroot/ethereal/plugins/Makefile.am,v retrieving revision 1.5 diff -u -r1.5 Makefile.am --- Makefile.am 2000/03/15 19:09:16 1.5 +++ Makefile.am 2000/11/06 01:08:41 @@ -22,7 +22,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -SUBDIRS = gryphon +SUBDIRS = gryphon mgcp plugindir = @PLUGIN_DIR@ @@ -31,3 +31,6 @@ plugin_api.h \ plugin_table.h \ Makefile.nmake + + +
Attachment:
mgcp-plugin.tar.gz
Description: tarball of the new ethereal/plugin/mgcp directory
- Follow-Ups:
- Re: [Ethereal-dev] some plugin problems
- From: Guy Harris
- Re: [Ethereal-dev] some plugin problems
- Prev by Date: Re: [Ethereal-dev] AIM / OSCAR dissector, Part 2
- Next by Date: Re: [Ethereal-dev] some plugin problems
- Previous by thread: Re: [ethereal-dev] Library plans
- Next by thread: Re: [Ethereal-dev] some plugin problems
- Index(es):