Commit Graph

128 Commits

Author SHA1 Message Date
Ulf Lamping b6a0525091 Bugfix from Lars Roland: included missing xdlc.h
svn path=/trunk/; revision=9553
2004-01-05 15:03:38 +00:00
Guy Harris 342fa7a1b5 From Tomas Kukosa:
Remove the internal packet-per.c functions
	"dissect_per_length_determinant()" and
	"dissect_per_normally_small_nonnegative_whole_number()" from the
	plugin API, as they shouldn't be used outside the PER dissector.

	Remove the H.225/H.245 functions
	"dissect_h225_TransportAddress()" and
	"dissect_h245_NonStandardParameter()" from the plugin API until
	we really need them in plugins.

	Add the string dissector table functions to the plugin API.

svn path=/trunk/; revision=8532
2003-09-24 18:35:58 +00:00
Guy Harris 0333b96fbf Include the header files required by new APIs in the plugin API table.
svn path=/trunk/; revision=8252
2003-08-25 21:35:36 +00:00
Guy Harris e7c8d1f5a0 From Matthijs Melchior:
move the initialization of the addresses in the plugin interface
	structure from run-time to link time;

	don't attempt to rebuild the X* files automatically, just warn
	that they're out of date and show the command used to rebuild
	them (not everybody has GCC installed, but it's required in
	order to rebuild them).

Get rid of the checked-in Xepan_plugins.c, as it's no longer generated
or used.

Fix Makefile.am now that Xepan_plugins.c has been replaced by Xass-list.

Give plugin_gen.py an RCS ID.

svn path=/trunk/; revision=8186
2003-08-18 20:17:55 +00:00
Guy Harris bef8e395a8 From Matthijs Melchior: generate all declarations and definitions for
plugin ABI from a single file.

svn path=/trunk/; revision=8038
2003-07-18 03:02:12 +00:00
Guy Harris feadec85eb Export "tvb_get_string()" and "tvb_get_stringz()" to plugins.
svn path=/trunk/; revision=7862
2003-06-12 10:10:39 +00:00
Guy Harris 4875604484 Fix up some comments, and move some common GLib 1.2[.x]/2.x code outside
#ifdefs.

svn path=/trunk/; revision=7775
2003-06-04 00:11:02 +00:00
Gerald Combs bdec82ce59 From Lars Roland: Update the plugin API for Glib/GTK+ 2.2 and have NSIS
remove the Start menu entries and desktop icon.

svn path=/trunk/; revision=7772
2003-06-03 02:32:56 +00:00
Guy Harris f9037afd44 From Matthijs Melchior: don't export functions also implemented as
macros, and do export "except_pop()" and "except_setup_try()".

svn path=/trunk/; revision=7628
2003-05-01 21:10:43 +00:00
Guy Harris 933fd3b12c From Lars Roland: set "patable.p_asn1_string_decode" to point to
"asn1_string_decode()", not to "asn1_octet_string_decode()".

svn path=/trunk/; revision=7624
2003-05-01 18:05:27 +00:00
Guy Harris 0242a26c59 The typedefs in plugins/plugin_table.h must have "addr_" in front of the
function name; make it so.

Eliminate the duplicate entry for "except_throw" and the duplicate code
for it.

svn path=/trunk/; revision=7618
2003-04-30 23:40:43 +00:00
Guy Harris dcae08c20b From Matthijs Melchior: export the exception mechanism routines to
plugins on platforms on which plugins need to use the table of functions
exported to plugins.

svn path=/trunk/; revision=7611
2003-04-30 19:19:15 +00:00
Guy Harris 1025817e84 Add a "proto_item_set_end()" routine that sets the length of an item
given a tvbuff/offset pair referring to the byte past the end of the
item.  Use it in one place in the SMB dissector (there are plenty of
other places where it could be used as well).

svn path=/trunk/; revision=7603
2003-04-29 21:27:19 +00:00
Guy Harris 090a5aa24b From Matthijs Melchior: add the ASN.1 routines to the table of routines
exported to dissectors.

svn path=/trunk/; revision=7552
2003-04-24 21:15:13 +00:00
Guy Harris d3daad1bec Add "proto_tree_add_none_format()" to the set of functions exported to
plugins.

svn path=/trunk/; revision=7423
2003-04-08 17:20:05 +00:00
Ronnie Sahlberg e00fb8c413 From Lars Ronald :
MGCP request/response matching and
MGCPSTAT RTT calculation.

For those with MGCP captures, try
-z mgcp,rtd[,filter]

svn path=/trunk/; revision=7294
2003-03-06 09:01:47 +00:00
Guy Harris 854b819fab On UNIX, search for plugins only in the directory in which plugins will
be installed - don't explicitly search
"/usr/lib/ethereal/plugins/{version}" or
"/usr/local/lib/ethereal/plugins/{version}", so that if there's more
than one version of Ethereal installed, we don't end up picking up
plugins from the wrong version.

svn path=/trunk/; revision=6766
2002-12-08 22:22:03 +00:00
Guy Harris bb928b0c93 There's no need to include "prefs.h" unless we're actually exporting the
big table of functions - we don't use the preferences code, we just
export routines from it.

There is, however, a need to include "reassemble.h" if we're doing so,
as some of the functions we export take a "fragment_data *" as an
argument, and "fragment_data" is defined in "reassemble.h".

The members of "patable" should be set to point to functions, and
"p_prefs_register_obsolete_preference" isn't a function -
"prefs_register_obsolete_preference" is.

Get rid of extra white space at the ends of lines.

svn path=/trunk/; revision=6648
2002-11-16 21:32:06 +00:00
Guy Harris 71f6ebae44 From Tomas Kukosa: export more routines to plugins.
svn path=/trunk/; revision=6630
2002-11-14 18:54:53 +00:00
Jörg Mayer 48be4e530d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6116
2002-08-28 20:41:00 +00:00
Guy Harris d939032a24 From Tomas Kukosa: add some more routines to the plugin API.
While we're at it, add "extern" to a bunch of function declaration the
preceding change *didn't* require to have the "extern" added.

svn path=/trunk/; revision=5995
2002-08-14 19:18:20 +00:00
Jörg Mayer 3105ee542f Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928
2002-08-02 21:29:45 +00:00
Guy Harris ff49944dcd From Joerg Mayer: add #includes of "snprintf.h" in modules that used
"snprintf()" but weren't including "snprintf.h".

svn path=/trunk/; revision=5887
2002-07-16 22:50:48 +00:00
Guy Harris 8a9b35cb5e From Anand V. Narwani:
DOCSIS support, including support for "Ethernet" captures where
	    the raw frame is a DOCSIS frame rather than an Ethernet
	    frame (some Cisco cable-modem head-end gear can send out a
	    trace of all traffic on an Ethernet, but what it sends are
	    the raw bytes of DOCSIS frames, not Ethernet frames)

Get rid of second AUTHORS entry for Devin Heitmueller, merging its item
into the older entry.

Clean up the order of some lists of plugin items.

svn path=/trunk/; revision=5861
2002-07-12 22:52:43 +00:00
Guy Harris 93370c8672 Fix a compiler warning.
svn path=/trunk/; revision=5464
2002-05-14 10:39:29 +00:00
Guy Harris 088398741d From Ruud Linders: report errors from "g_module_open()".
svn path=/trunk/; revision=5463
2002-05-14 10:32:12 +00:00
Guy Harris a6e169fc27 Put the pointer to "tcp_dissect_pdus()" in the function pointer table
where the pointer to "dissect_data()" was in 0.9.3; the pointer to
"dissect_data()" wasn't initialized in 0.9.3 (as the function wasn't
exported - you call it through a handle), so no plugin should have been
using it, and putting the pointer to "tcp_dissect_pdus()" in its place
means the structure offsets of all function pointers after it will be
the same in 0.9.3 and the next release, preserving binary compatibility
for plugins.

svn path=/trunk/; revision=5395
2002-05-05 00:34:12 +00:00
Guy Harris eb70c97a9b Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly.  Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.

Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.

Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.

Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.

Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.

svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
Guy Harris 5d5d507a29 From John Mackenzie: put missing initializations of table entries in
"plugins.c".

svn path=/trunk/; revision=4790
2002-02-23 02:16:12 +00:00
Guy Harris e9bc3da370 Handle TPKT packets split across segment boundaries, and multiple TPKT
packets per segment.

Instead of having a routine for dissectors such as the Q.931 dissector
to call to dissect the TPKT header, have a routine that does all the
reassembly and multiple-packets-per-segment work, and have the Q.931
dissector call it.  Export "is_tpkt()", and the new routine, to plugins.

Add preferences for TPKT and Q.931 reassembly.

svn path=/trunk/; revision=4778
2002-02-22 08:56:48 +00:00
Guy Harris 2c0ceea42f Export "conversation_set_dissector()" in the plugin API table.
svn path=/trunk/; revision=4760
2002-02-20 08:24:52 +00:00
Guy Harris 0afa2b5aeb Routines added to the plugin table, and include-once #ifndef/#define
wrappers added to plugin header files, by Charlie Duke.

svn path=/trunk/; revision=4676
2002-02-02 03:42:18 +00:00
Guy Harris c873f79156 Support for capturing on, and reading captures from, OpenBSD firewall
logging virtual interface, from Mike Frantzen.

svn path=/trunk/; revision=4616
2002-01-29 08:44:53 +00:00
Gilbert Ramirez 0b9b02c6ea Long NCP traces can easily have many packets whose "uniqueness"
variables wrap-around. Since the request/reply packets are related via
a hash based on these uniqueness variables, long NCP traces can
have mis-matches reqeust/reply records.

Thus, only do the hash-lookup for the reply packet during the first
sequential scan of the trace file. Once the pertinent info is found,
store it in the packet's private data area.

Since the memory allocated for the hash and for the structures that make
up the keys are no longer needed after the first sequential run through
the trace file, arrange to free that memory after the first sequential
run. Similar to the register_init_routine() that allows dissectors
to register callbacks for calling *before* a capture file is loaded,
set up a register_postseq_cleanup_routine() function that allows
dissectors to register callbacks for calling *after* the first
sequential run-through of the trace file is made. This is not
a *final* cleanup callback, since Ethereal will still have that trace file
open for random-access reading.

I didn't have tethereal call postseq_cleanup_all_protocols() since
tethereal doesn't keep the trace file open for random-access reading.
I could easily be swayed to make tethereal call that function, however.

svn path=/trunk/; revision=4484
2002-01-05 04:12:17 +00:00
Guy Harris 7c0dc64096 Remove the no-longer-extant "conv_dissector_add()" from the list of
plugin APIs, and add the new "dissector_add_handle()".

Add an entry in the dissector table structure for
"create_dissector_handle".

svn path=/trunk/; revision=4314
2001-12-03 10:00:23 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a
dissector function and a protocol ID.  Associate dissector handles with
dissector table entries.

svn path=/trunk/; revision=4308
2001-12-03 04:00:26 +00:00
Ed Warnicke 89babba223 This should be the final bit of removing the dissect_data symbol
from being required by anyone other than packet-data.c.
It can now be accessed with call_dissector() with the name "data".
dissect_data is now also of dissect_t.

svn path=/trunk/; revision=4271
2001-11-26 05:41:15 +00:00
Gilbert Ramirez a07ec65cce Remove the pointer to the global packet_info from the table of
pointers used for plugins on win32.

svn path=/trunk/; revision=4247
2001-11-21 23:34:09 +00:00
Guy Harris f0c86f5537 Include "conversation.h", as the plugin API now includes the routines to
create and find conversations.

svn path=/trunk/; revision=4155
2001-11-04 22:14:43 +00:00
Guy Harris d859325753 Additional routines made available to plugins, from Tomas Kukosa.
svn path=/trunk/; revision=4150
2001-11-04 03:37:29 +00:00
Guy Harris 62d224011d Stop using "tvb_get_ntohll()" and "%llX" in the BOOTP dissector, as the
former depends on having "guint64" and the latter depends on
"%ll[douxX]" being what's used to print 64-bit integers, and there are
platforms on which Etheeal runs that don't have "guint64" or that don't
use "%ll[douxX]" to print 64-bit integers.

Get rid of the routines to extract 64-bit integers into "gint64"s and
"guint64"s, as per Ronnie Sahlberg's suggestion, to discourage people
from writing code that won't work on all platforms; they should be using
FT_UINT64, or the routines in "int-64bit.c", instead.

svn path=/trunk/; revision=4102
2001-10-29 21:56:50 +00:00
Guy Harris 509f30374e Have a routine that takes a file name for a personal configuration file
and generates the path name; have it, if the file is to be opened for
reading on Win32, check whether it exists and, if not, check for it in
the old home directory-based configuration directory and, if so, return
that path instead, so that files saved with earlier versions of Ethereal
will be seen.

svn path=/trunk/; revision=4072
2001-10-24 07:18:39 +00:00
Guy Harris e4db9c4b64 Add a routine to get the directory in which personal configuration files
reside.  Use it, rather than concatenating the user's home directory and
".ethereal" in a number of files.

Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname
separator.

svn path=/trunk/; revision=4061
2001-10-22 22:59:26 +00:00
Guy Harris e980dd9d3b Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in format
strings used to generate pathnames.

Move the definition of PF_DIR from <epan/epan.h> to <epan/filesystem.h>,
so that files requiring only the definition of PF_DIR don't have to
include <epan/epan.h>, and get rid of no-longer-necessary includes of
<epan/epan.h>.

Add a routine to get the directory for "system files" such as
"/etc/ethers" - it's "/etc" on UNIX, and the datafile directory on
Windows (as there's no "/etc" on Windows).  Use that to construct the
pathname of the ethers and ipxnet files.

svn path=/trunk/; revision=4056
2001-10-21 21:48:00 +00:00
Guy Harris bcc16a58c9 To check whether something is a directory, call "test_for_directory()"
on it and check whether it returned EISDIR, not whether it returns 0 -
EISDIR means it's a directory, 0 means it isn't.

svn path=/trunk/; revision=3939
2001-09-14 09:27:35 +00:00
Guy Harris 0e68611e41 From Thomas Wittwer: add "prefs_register_string_preference()" to the
list of functions available to plugins.

svn path=/trunk/; revision=3906
2001-09-04 01:05:41 +00:00
Guy Harris fbe8da33f5 Add a "proto_item_append_text()" routine, which is like
"proto_item_set_text()" except that it appends the result of the
formatting to the item's current text, rather than replacing the item's
current text.  Use it in the DNS dissector.

svn path=/trunk/; revision=3880
2001-08-29 00:51:10 +00:00
Guy Harris aa4cd01b9b Get rid of "proto_tree_add_notext()" - if you create a subtree using it,
but, before you set the text, you throw an exception while putting stuff
under the subtree, you end up with an absolutely blank protocol tree
item, which is really gross.  Instead of calling
"proto_tree_add_notext()", call "proto_tree_add_text()" with at least a
minimal label - yes, it does mean you do some work that will probably be
unnecessary, but, absent a scheme to arrange to do that work if it *is*
necessary (e.g., catching exceptions), the alternative is an ugly
protocol tree display.

svn path=/trunk/; revision=3879
2001-08-28 08:28:19 +00:00
Guy Harris 4dd604972b Plug a memory leak.
svn path=/trunk/; revision=3862
2001-08-21 09:11:59 +00:00
Guy Harris 973552df3e Fix some Win32 compilation warnings and errors.
svn path=/trunk/; revision=3861
2001-08-21 08:16:54 +00:00
Guy Harris 9d601c6799 On Windows, use the directory in which the binary resides as the
directory in which global data files are stored.  If an installed binary
is being run, that's the correct directory for them; if a build-tree
binary is being run, the "manuf" file will be there, and you can put
other data files there as well, if necessary.

Do the same with plugins, except that, if there's no
"plugins\\{version}" subdirectory of that directory, fall back on the
default installation directory, so you at least have a place where you
can put plugins for use by build-tree binaries.  (Should we, instead,
have the Windows build procedure create a subdirectory of the "plugins"
source directory, with the plugin version number as its name, and copy
the plugins there, so you'd use the build-tree plugin binaries?)

Move "test_for_directory()" out of "util.c" and into
"epan/filesystem.c", with the other file system access portability
wrappers and convenience routines.  Fix "util.h" not to declare it - or
other routines moved to "epan/filesystem.c" a while ago.

svn path=/trunk/; revision=3858
2001-08-21 06:39:18 +00:00
Guy Harris d5fbc4d780 Fix some compile problems on Windows.
svn path=/trunk/; revision=3851
2001-08-19 00:42:36 +00:00
Guy Harris 01d5c10b07 On Win32, use the default installation directory for Ethereal as the
"standard" plugin directory, and, instead of getting PLUGIN_DIR (the
*real* installation directory) from the configure script, as can be done
in UNIX, attempt to get it by getting the full pathname of the currently
running program and assuming it's in the installation directory.

svn path=/trunk/; revision=3850
2001-08-18 23:21:31 +00:00
Guy Harris 6287e86539 Add a bunch of routines used by GIOP plugins to the plugin address
table.

svn path=/trunk/; revision=3764
2001-07-22 10:12:11 +00:00
Guy Harris 1ac49ed4ce Get rid of support for non-tvbuffified plugin dissectors.
svn path=/trunk/; revision=3385
2001-04-25 08:41:22 +00:00
Guy Harris 8e9c5eb645 Make "col_set_str()" and "tvb_reported_length_remaining()" available in
plugins.

svn path=/trunk/; revision=3384
2001-04-25 08:31:32 +00:00
Guy Harris 0a6b7f6f39 The plugins code has an API that uses a type from "prefs.h"; include
"prefs.h", as otherwise MSVC++ 6.0 won't compile "plugins.c".

svn path=/trunk/; revision=3243
2001-04-02 09:58:15 +00:00
Guy Harris cc74cc0a5f Get rid of support for old-style plugins (support for old-style plugins
requires that the dfilter code be initialized before the plugins are
added; this required us to *re*-initialize the dfilter code after
reading in all the plugins, as the plugins may themselves have added new
filterable fields - that was a bit of a mess), and make the
"Tools->Plugins" dialog box show the new-style plugins.

svn path=/trunk/; revision=2950
2001-01-28 21:17:29 +00:00
Guy Harris 7eaadf4048 Add "col_clear()" to the list of functions in the transfer vector for
plugins, as the MGCP dissector uses it.

Don't set pointers to "dfilter_init()" and "dfilter_cleanup()" in that
transfer vector, as there *aren't* any pointers to them in the transfer
vector.

svn path=/trunk/; revision=2949
2001-01-28 20:26:20 +00:00
Guy Harris e7ea7a34e9 Clean up the dissector registration up a bit - arrange that all plugins
be loaded and their initialization routines called in right after we
call the initialization routines for built-in dissectors, but don't call
their handoff registration routines yet, and then call the handoff
registration routines right after calling the handoff registration
routines for built-in dissectors.

Do all that in "proto_init()", rather than "epan_init()".

That way, we call all dissector registration routines together, and then
call all dissector handoff registration routines together; all the
registration routines are called before any handoff registration
routines, as is required, and, as "proto_init()" is called by
"epan_init()" before "dfilter_init()" is called, all filterable fields
have been registered before "dfilter_init()" is called, and no plugins
have to call "dfilter_init()" themselves to get their fields registered.

Remove pointers to "dfilter_init()" and "dfilter_cleanup()" from the
plugin address table, as plugins shouldn't be calling them any more, and
remove calls to them from plugins.

svn path=/trunk/; revision=2940
2001-01-26 06:14:53 +00:00
Guy Harris 2072d03e78 Tvbuffify the PIM dissector.
It was the last dissector that used "old_call_dissector()", and
tvbuffifying it got rid of that, so get rid of "old_call_dissector()".

svn path=/trunk/; revision=2892
2001-01-13 06:34:35 +00:00
Gilbert Ramirez 180a726414 Move the libethereal version to 0.8.15, and use the C preprocessor
macro "VERSION" to create the version-specific directory name for plugins
in plugins.c

svn path=/trunk/; revision=2883
2001-01-12 04:18:49 +00:00
Gilbert Ramirez 512d0d1c23 Change version numbers to 0.8.15
svn path=/trunk/; revision=2882
2001-01-12 04:06:25 +00:00
Guy Harris 3613c121fe Add a new "prefs_register_protocol()" routine, which is like
"prefs_register_module()" except that it takes a protocol index as
returned by "proto_register_protocol()" as its first argument, rather
than taking two character strings as arguments as its first two
arguments, and uses the protocol's abbreviation as the name to use for
preferences in the preferences file and the "-o" flag and uses the
protocol's short name as the name to use in the tabs in the
"Edit->Preferences" window.

svn path=/trunk/; revision=2812
2001-01-03 07:53:48 +00:00
Guy Harris 458a156913 Get the suffix for dynamically-loaded modules by means of a hack
involving "g_module_build_path()", rather than by checking the platform
- this should let us handle non-Windows platforms that don't use ".so"
(e.g., HP-UX).

Use G_DIR_SEPARATOR_S as the pathname separator character when
generating the pathname of the module.

svn path=/trunk/; revision=2712
2000-11-29 09:10:03 +00:00
Gilbert Ramirez f69e977a76 Move Win32 version to 0.8.14.1
svn path=/trunk/; revision=2705
2000-11-28 15:54:20 +00:00
Gilbert Ramirez 5a0e2a658a Move to version 0.8.14
svn path=/trunk/; revision=2682
2000-11-20 17:10:26 +00:00
Guy Harris 74777083d3 Fix a number of problems that caused compiles to fail if
PLUGINS_NEED_ADDRESS_TABLE was defined.

svn path=/trunk/; revision=2662
2000-11-18 21:41:40 +00:00
Guy Harris 2fa39ce7d3 Move the table of bit-swapped byte values to "epan/bitswap.c", and
declare it, and define a "BIT_SWAP" macro that uses it, in
"epan/bitswap.h".

Use that macro to bit-swap bytes in the IEEE 802.11 dissector, rather
than the macro that was used (said macro used GCCisms and didn't compile
on Windows).

Make an "init_plugin()" routine to enable a plugin and call its init
routine, and call it from "check_plugin_status()" and
"plugins_enable_cb()", rather than having very similar code in two
places; "patable" is now part of libethereal, and, at least on Windows,
attempts to refer to it from "libui" failed.  Make "patable" static to
"epan/plugins.c".  (This may still not work, as now "libui" is calling a
routine in "libethereal"; if that fails, perhaps it's time to get rid of
the "enable/disable plugins" stuff completely, as new-style plugins, at
least, register themselves as protocols and should be controllable from
the "Edit->Protocols" window just as built-in dissectors are.)

svn path=/trunk/; revision=2649
2000-11-15 09:37:53 +00:00
Guy Harris 77ad89b12d Add a mechanism by which a dissector can be registered by name, another
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-15 07:07:52 +00:00
Guy Harris b830fb6a5f Add "dissector_delete()", "proto_item_get_len()",
"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-13 10:13:26 +00:00
Guy Harris ead1cadaf3 Add the tvbuff 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=2635
2000-11-13 08:00:12 +00:00
Guy Harris e8c75b74bf Add a Makefile.nmake for the MGCP plugin, and update
"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=2623
2000-11-12 21:20:50 +00:00
Guy Harris 1964cfddf6 Allow plugins to have, instead of "protocol" and "filter_string"
variables and a "dissector" routine, a "plugin_reg_handoff()" routine,
which will act just like the "reg_handoff()" routine of a non-plugin
dissector, registering the dissector with handoff tables.

This lets them plug into both TCP and UDP, or plug into protocols other
than TCP or UDP.

Those new-style plugin are enabled and disabled using the standard
"Edit->Protocols" mechanism (and thus should use
"OLD_CHECK_DISPLAY_AS_DATA()" or "CHECK_DISPLAY_AS_DATA()"); they don't
show up in the list of plugins, aren't enabled or disabled from that
list, and, as they don't have a filter, can't have the filter changed
from that list - instead, they should register preferences for port
numbers and the like if they should be configurable to use different
ports.

Make the Gryphon protocol a new-style plugin.

svn path=/trunk/; revision=2565
2000-11-05 09:05:00 +00:00
Gilbert Ramirez 4386002cc3 Move to version 0.8.13.
Mention IGRP dissector in NEWS.

svn path=/trunk/; revision=2539
2000-10-27 02:22:08 +00:00
Guy Harris cba377df3c Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()".  Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.

That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files.  Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).

Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.

Remove from the top-level configure script checks for things used only
in libethereal.

svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +00:00
Gilbert Ramirez 9d9850f209 More EPAN-related code movements. Get rid of usage of #include "globals.h"
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c
as it's used by plugins.c.

svn path=/trunk/; revision=2461
2000-09-28 03:16:29 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00