Commit Graph

70 Commits

Author SHA1 Message Date
Olivier Biot a11651260b From Lars Roland: With this patch print.(c/h) and ps.(c/h) don't belong to
the DISSECTOR_SUPPORT_xy files any longer and as a consequence they 
won't be linked into libethereal.

svn path=/trunk/; revision=11559
2004-07-29 00:11:14 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Ulf Lamping 8da8e54fa6 remove FI_LINK again,
as this info can be derived from the presence of the FT_FRAMENUM field

svn path=/trunk/; revision=10901
2004-05-15 00:52:02 +00:00
Ulf Lamping 1314808bd5 add support to link from specially marked fields to related packets,
a doubleclick will follow the link

svn path=/trunk/; revision=10892
2004-05-14 15:55:37 +00:00
Ulf Lamping 8228cd1b79 prepared for generate documentation using doxygen,
added lot's of new (hopefully correct) comments

svn path=/trunk/; revision=10841
2004-05-10 23:13:55 +00:00
Ulf Lamping b3dc21eb5f use GNUC_FORMAT_CHECK in every appropriate function
svn path=/trunk/; revision=10838
2004-05-10 14:02:17 +00:00
Ulf Lamping 685195c073 first try to get rid of annoying double definition of the proto_tree_add_xy_fromat functions,
because of GNUC printf format checks

svn path=/trunk/; revision=10837
2004-05-10 08:29:18 +00:00
Guy Harris 15af0f656f From Lars Roland: add support for building a libethereal.dll with MSVC:
add a config.nmake option to control whether to build
	libethereal.dll or not;

	remove "./wiretap" from PATH to prevent problems due to
	wrongly-loaded files;

	build dissector.lib with MSVC;

	move "print.c" and "ps.c" to the dissector helpers, as "print.c"
	imports variables from packet-frame.c and packet-data.c, which
	are in libethereal;

	move "g711.c" out of the dissector helpers, as they're used only
	by Ethereal in a tap, not in Tethereal or in any dissector;

	add a .def file for libethereal;

	arrange to declare global variables exported from libethereal
	with "__declspec(dllimport)" when building programs that import
	those variables;

	update the NSIS installer.

Make the "configure" script define ETH_VAR_IMPORT as "extern".

svn path=/trunk/; revision=10834
2004-05-09 10:03:41 +00:00
Ulf Lamping b964421aec added changed some comments to better reflect current "behaviour"
svn path=/trunk/; revision=10833
2004-05-09 09:26:31 +00:00
Olivier Biot 8d29376f42 Squelch a compiler warning (extraneous extern on struct).
Fix the PROTO_ITEM_IS_XXX and PROTO_ITEM_SET_XXX macros by replacing
the if(x) with trigraphs so the macros can still be used in subsequent
conditional tests.

svn path=/trunk/; revision=10758
2004-05-01 20:15:56 +00:00
Ulf Lamping 6faeb75881 prevent null pointer exception
svn path=/trunk/; revision=10755
2004-05-01 18:39:07 +00:00
Ulf Lamping d9118dc089 add PROTO_ITEM_SET_HIDDEN() and PROTO_ITEM_SET_GENERATED(),
this sets flags for later rendering of the field data

svn path=/trunk/; revision=10752
2004-05-01 15:15:08 +00:00
Ulf Lamping 37fc156dc6 removed unused things
svn path=/trunk/; revision=10740
2004-04-30 06:56:15 +00:00
Guy Harris 044f075c66 From Tomas Kukosa: add APIs to get the parent of a protocol tree item
and the item N levels up from a protocol tree item.

svn path=/trunk/; revision=10486
2004-03-25 23:55:21 +00:00
Guy Harris a6ed2d499a From Tomas Kukosa: BER dissector enhancements and proto.c updates to
support them.

From Ronnie Sahlberg: Kerberos updates with new constants from the
current draft, decryption and dissection of Kerberos blobs, and changes
to work with the changed BER dissector.

svn path=/trunk/; revision=10479
2004-03-25 09:18:03 +00:00
Richard Sharpe fa9874ef73 Apply the patches from Tadaaki Nagao for a global version of disabled
protocols ...

svn path=/trunk/; revision=9538
2004-01-03 18:40:08 +00:00
Gilbert Ramirez 058ef64db8 Add the ability to print packet dissections in PDML (an XML-based format)
to tethereal. It could be added to Ethereal, but the GUI changes to
allow the user to select PDML as a print format have not been added.

Provide a python module (EtherealXML.py) to help parse PDML.

Provide a sample app (msnchat) which uses tethereal and EtherealXML.py
to reconstruct MSN Chat sessions from packet capture files. It produces
a nice HTML report of the chat sessions.

Document tethereal's PDML and EtherealXML.py usage in doc/README.xml-output

Update tethereal's manpage to reflect the new [-T pdml|ps|text] option

svn path=/trunk/; revision=9180
2003-12-06 06:09:13 +00:00
Guy Harris fa1de9d824 It turns out the protocol tree parent link was used, so we need it in
our new scheme.

svn path=/trunk/; revision=9172
2003-12-04 19:53:54 +00:00
Guy Harris f0b9d12b6a Don't use GNodes for the protocol tree, put the sibling pointer, and
pointers to the first *and* last child, in the "proto_node" structure
itself.  That saves us one level of indirection and memory allocation,
and lets us append to a tree by appending to the last child directly,
rather than having to scan through the list of siblings of the first
child to find the end of that list.

svn path=/trunk/; revision=9171
2003-12-04 10:59:34 +00:00
Guy Harris dcd98ae8d3 The "ptr_u" unions no longer have a "next" pointer - they now just have
one member - or have one that's not used, so get rid of those unions.

svn path=/trunk/; revision=9151
2003-12-03 09:28:26 +00:00
Guy Harris ed2ae2d8d3 Instead of requiring slab-allocated structures to have a "next" pointer,
when adding them to the free list, cast the pointer to the structure to
a pointer to a "freed_item_t" which contains the "next" pointer.

This reduces the memory requirement for some of those structures, and
leaves us free to slab-allocate structures that have a "next" pointer
for other reasons.

svn path=/trunk/; revision=9150
2003-12-03 08:53:37 +00:00
Guy Harris bd9f96738c From Didier Gautheron: put an "fvalue_t" structure into a "field_info"
structure, rather than separately allocating "fvalue_t"s and having the
"field_info" structure point to them - this appears to speed up protocol
tree construction a bit.

svn path=/trunk/; revision=9146
2003-12-02 21:15:49 +00:00
Ronnie Sahlberg eb39a99b2c Speed updates
create generic macros for allocating/freeing structures.

remove one more slow GMemChunk and replace it with a simple linked list

~4% speed improvement in my tests.

the allocated data is never freed.   this may be a problem if ethereal is
ever supported on a platform lacking resource tracking but makes the
implementation faster and simpler.

svn path=/trunk/; revision=9095
2003-11-26 12:22:22 +00:00
Ronnie Sahlberg 9d88e58e51 remove another slow GMemChunk from ethereal making ethereal a little bit faster
svn path=/trunk/; revision=9085
2003-11-25 14:07:45 +00:00
Guy Harris 122dd3959c Make the recent epan/proto.{c,h} change compile.
svn path=/trunk/; revision=9075
2003-11-24 22:11:55 +00:00
Ronnie Sahlberg fa1ee7667b performance enhancement to proto.c
Removed the GMemChunk used to allocate/free field_info structures
and used a free list to store the freed structs until they are allocated again.

Ethereal will allocate more field_info structs as it needs to but never free them. Instead the are just placed in a cheap and fast free list so that if we
want to use the struct again, this will be fast.

This affects the speed of the two functions
alloc_field_info() that should be slightly faster now
free_field_info() that was replaced with a 2 line macro.

All in all  my testing suggests that ethereal is 2-3% faster with this patch.

svn path=/trunk/; revision=9073
2003-11-24 21:12:10 +00:00
Ronnie Sahlberg 7eef1914e0 Performance fix
In the GPROF logs proto_registrar_get_nth() used to take anything between 2.5 and 5.5% of the time.

Replace the GLIB array with a handroleld one for one of the private structures.

the function should now be virtually zero cost
and thus ethereal should be 2.5-5.5% faster on those traces.

anyone that wants to, please rerun GPROF with this fix and see what has changed.

svn path=/trunk/; revision=9058
2003-11-21 14:58:49 +00:00
Guy Harris 7bd2e232a9 Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.

Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).

Change some direct dissector calls to go through handles.

svn path=/trunk/; revision=8979
2003-11-16 23:17:27 +00:00
Guy Harris 0c0ef44095 Make the "fvalue_set" methods for types whose value is allocated free
any previously-allocated version first, so that they don't leak memory.

From Olivier Biot: add a "proto_item_append_string()" routine, to append
to the string value a protocol tree item has.

svn path=/trunk/; revision=8821
2003-10-29 23:48:14 +00:00
Guy Harris e4e0150ffa From Matthijs Melchior:
support for registering fields after all the protocol
	    registration routines are called (i.e., adding fields to the
	    named field tree as they're registered);

	fix the GTK 2.x version of the field list dialog to show the
	    correct name.

svn path=/trunk/; revision=8248
2003-08-25 00:15:02 +00:00
Guy Harris ca318813a4 Rename "proto_alloc_dfilter_string()" to
"proto_construct_dfilter_string()", to more accurately reflect what it
does.

Give it, and "proto_can_match_selected()", an "epan_dissect_t *"
argument, which replaces the raw data pointer argument to
"proto_construct_dfilter_string()".

For fields that don't have a type we can directly filter on, we don't
support filtering on the field as raw data if:

	the "epan_dissect_t *" argument is null;

	the data source tvbuff for the field isn't the tvbuff for the
	"epan_dissect_t" in question (i.e., it's in the result of a
	reassembly, and "frame[N:M]" can't get at it).

Trim the length the raw data in the case of such a field to the length
of the tvbuff for the "epan_dissect_t" in question, so we don't go past
it.  Fetch the raw data bytes to match from that tvbuff.

Have "proto_construct_dfilter_string()" return a null pointer if it
can't construct the filter string, and have "protocolinfo_packet()" in
the tap-protocolinfo tap ignore a field if
"proto_construct_dfilter_string()" can't construct a filter string for
it - and have it pass NULL as the "epan_dissect_t *", for now.  If
somebody decides it makes sense to dump out a "frame[N:M] =" value for
non-registered fields, it can be changed to pass "edt".

svn path=/trunk/; revision=7635
2003-05-03 00:48:37 +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 ab552d3746 Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemed
to be using it for stuff that should be hex, and for stuff that should
be Boolean.  Use BASE_DEC if it should be decimal, BASE_HEX if it should
be hex, and make it Boolean if it should be Boolean.

svn path=/trunk/; revision=7053
2003-01-31 03:17:56 +00:00
Guy Harris 7b743f7d7d Make the "strings" pointer in a "header_field_info" structure a const
pointer, and put "const" into the casts in "VALS()" and "TFS()" macros,
so we don't un-constify pointers to "value_string" arrays and
"true_false_string" structures.

Make some things "const" to keep the compiler happy with the previous
change.

svn path=/trunk/; revision=6684
2002-11-28 01:46:14 +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 6e56c25c9d From Ulf Lamping: add a new FT_FLOAT type, for single-precision
floating-point numbers, and display all the significant digits for both
single-precision and double-precision floating-point numbers in the
protocol tree, not just what "%g" does (6 digits).

Put in comments explaining how the length of filter strings is computed,
and fix some of the computations.

svn path=/trunk/; revision=6081
2002-08-24 19:45:28 +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 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris e390d7e0cc Make the "-G" flag take an argument. If no arugment is specified, or if
the argument is "fields", dump out a table of the fields, as we
currently do; if the argument is "protocols", dump out a table of the
protocols.

svn path=/trunk/; revision=5462
2002-05-14 10:15:12 +00:00
Guy Harris 30f02bc99c Move the code to build the balanced tree of fields into "proto_init()",
move the code from "dfilter_lookup_token()" into
"proto_registrar_get_byname()", and get rid of "dfilter_lookup_token()"
and have its callers call "proto_registrar_get_byname()" instead.

svn path=/trunk/; revision=5287
2002-04-29 07:55:32 +00:00
Guy Harris 50155a975d From Phil Williams: support for looking up fields by name.
Clean up some white space, and one non-extern declaration in
"epan/proto.h".

svn path=/trunk/; revision=5201
2002-04-18 20:19:10 +00:00
Guy Harris 5de2533f2d Start assigning ett_ values at 0, rather than 1; get rid of the reserved
ETT_NONE entry.

Initialize the "tree_type" field of a "field_info" structure to -1,
meaning "this has not been given a subtree".  Add checks before using
that field that it's in range.  That way, you have to create a subtree
before putting protocol tree items under another item.

We allocate the "tree_is_expanded" array when we've registered all
dissectors; there's no need to allocate it while we're registering
dissectors and, in fact, doing so means we leak memory (the memory for
the version we allocated while registering dissectors).

svn path=/trunk/; revision=5068
2002-04-01 02:00:53 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris e0828c513d The typedef in "epan/value_string.h" declares "value_string" to be a
typedef for "struct _value_string"; as such, the incomplete structure
declaration in "epan/proto.h" should declare "struct _value_string", not
"struct value_string", and casts and declarations in that header should
also use "struct _value_string", not "struct value_string".

svn path=/trunk/; revision=4699
2002-02-05 22:10:20 +00:00
Guy Harris 7494218b47 "proto_tree_is_visible" no longer exists as a global variable, so remove
its declaration.

svn path=/trunk/; revision=4477
2002-01-04 08:56:11 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Gilbert Ramirez f1b64de80e Dfilter code finds field under *any* parent's subtree, not just
the parent under which the field was registered.

This is the *unoptimized* version, to give developers something
to use while the optimized version is being created.

svn path=/trunk/; revision=4351
2001-12-07 03:39:26 +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
Ed Warnicke 4877553530 Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_X
which also takes a handle as an argument and thus doesn't call
dissect_data directly.

svn path=/trunk/; revision=4270
2001-11-26 05:13:14 +00:00