aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugin_api.c
AgeCommit message (Collapse)AuthorFilesLines
2000-11-15Add a mechanism by which a dissector can be registered by name, anotherGuy Harris1-1/+5
dissector can get a "handle" for that dissector by name and then call that dissector through the handle. This allows dissectors that can't be called through a port table or a heuristic table to be called from other dissectors without directly referring to the dissector function - dynamically-loaded modules, under Windows, cannot directly call functions in the main program, and non-plugin dissectors are in the main program and thus cannot be called from plugin dissectors unless either 1) a pointer to the dissector is put in the Big Transfer Vector or 2) some other mechanism for getting a pointer to the dissector is provided. This mechanism could also support registering old-style dissectors and calling them from new-style dissectors without the new-style dissector having to do the argument translation itself (I didn't add support for registering old-style dissectors because I'd prefer to have people tvbuffify their code if they have to register a dissector...). It could also, in the future, perhaps support disabling of protocols; setting "pinfo->current_proto"; inside "call_dissector()" - and inside "{old_}dissector_try_port()" and "{old_"dissector_try_heuristic()" - allowing a pile of stuff that currently has to be done in every dissector be done by common code. (I have some ideas about how to do this, by having "proto_register_protocol()" take an abbreviation - of the sort that would be put in, for example, "pinfo->current_proto" - as an argument; having the calls to register dissectors take an index returned by "proto_register_protocol()" as an argument. The abbreviation could be used elsewhere as well, e.g. in the "Decoding" tab of the "Edit->Protocols" dialog box, and in a GUI for constructing protocol filters. Watch this space.) Make "dissect_sdp()" the first client of this mechanism; it's now static to "packet-sdp.c", and all dissectors that call it - including the MGCP plugin - now call it through a dissector handle fetched by "find_dissector()". (Next step - see if Ethereal can now compile on Windows as a result of this.) svn path=/trunk/; revision=2647
2000-11-14"plugin_api.c" needs to include <glib.h>, to define G_HAVE_GINT64 onGuy Harris1-2/+4
platforms that have "gint64". Fix plugin-table lines for "dissector_delete()", "dissect_data()", "prefs_register_module()", and "prefs_register_uint_preference()". The MGCP dissector uses routines from GLib, so when building it as a DLL for Windows, it has to be linked with "glib-XXX.lib". svn path=/trunk/; revision=2643
2000-11-13Add "dissector_delete()", "proto_item_get_len()",Guy Harris1-1/+10
"proto_item_set_len()", "proto_item_set_text()", and the preference routines expected to be used by dissectors to the table of function pointers handed to dissectors on platforms where dynamically-loaded modules can't access symbols from the main program. svn path=/trunk/; revision=2638
2000-11-13Add the tvbuff routines expected to be used by dissectors to the tableGuy Harris1-1/+34
of function pointers handed to dissectors on platforms where dynamically-loaded modules can't access symbols from the main program. svn path=/trunk/; revision=2635
2000-11-12Add a Makefile.nmake for the MGCP plugin, and updateGuy Harris1-1/+4
"plugins/Makefile.nmake" to build that plugin. Add to the table of routines callable from plugins "old_dissector_add()", "old_dissect_data()", and "proto_is_protocol_enabled()", so that the Gryphon dissector can build on Windows. Move the includes of "plugins/plugin_api.h" and "moduleinfo.h" before all the other includes, except for "config.h", in "plugin-mgcp.c", to match what the Gryphon dissector does; "plugins_api.h" must be included before any of the routines whose names it #defines in order for the plugin to build on Windows. (It still doesn't build on Windows, as still more routines need to be added to the table of routines callable from plugins, but tomorrow is another day. Making libethereal a DLL may obviate the need for that table, *if* all the routines called from a plugin are in libethereal, as I think routines in a DLL, even a run-time-loaded DLL, can call routines from another DLL as long as those routines are exported from the other DLL.) svn path=/trunk/; revision=2622
2000-05-31Fix plugin function table so that plugins work on Win32.Gilbert Ramirez1-29/+53
svn path=/trunk/; revision=2034
2000-05-05Add routines to:Guy Harris1-1/+2
register lists of "heuristic" dissectors, which are handed a frame that may or may contain a payload for the protocol they dissect, and that return FALSE if it's not or dissect the packet and return TRUE if it is; add a dissector to such a list; go through such a list, calling each dissector until either a dissector returns TRUE, in which case the routine returns TRUE, or it runs out of entries in the list, in which case the routine returns FALSE. Have lists of heuristic dissectors for TCP and for COTP when used with the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger dissectors to the first list and the Sinec H1 dissector to the second list. Make the dissector name argument to "dissector_add()" and "dissector_delete()" a "const char *" rarther than just a "char *". Add "heur_dissector_add()", the routine to add a heuristic dissector to a list of heuristic dissectors, to the set of routines we can export to plugins through a table on platforms where dynamically-loaded code can't call stuff in the main program, and initialize the element in the table in question for "dissector_add()" (which we'd forgotten to do). svn path=/trunk/; revision=1909
2000-04-04Add "dissector_add()" to the list of routines exported to plugins viaGuy Harris1-1/+2
the Big Function Pointer Table. svn path=/trunk/; revision=1797
2000-03-15Give all the Ethereal APIs available to plugins their own functionGuy Harris1-131/+27
pointers, and call the APIs by calling through the function pointers - the old technique of using wrappers didn't work, as the underlying function they all called no longer exists. svn path=/trunk/; revision=1724
2000-02-12"proto_add_item_subtree()" returns a value; its wrapper should returnGuy Harris1-3/+3
the value that the real function returns. svn path=/trunk/; revision=1627
2000-02-09Initialize *p_pi solely to get rid of compiler warning.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=1613
2000-02-07Change "unsigned gint64" to "guint64", and add GPL header to plugin_api.[ch]Gilbert Ramirez1-0/+22
svn path=/trunk/; revision=1606
2000-02-07Code changes, but not Makefile changes, for enabling plugins for Win32.Gilbert Ramirez1-0/+147
svn path=/trunk/; revision=1605