Commit Graph

398 Commits

Author SHA1 Message Date
Jörg Mayer 48aa93c9ee Undo my last change: These files are used by systems only that need sys/types.h
anyway (see Guys remark on inet_pton.c).

svn path=/trunk/; revision=5947
2002-08-04 00:45:59 +00:00
Guy Harris c62e5fd81a <netinet/in.h> is needed for <arpa/inet.h>, at least on some platforms,
and <sys/types.h> is needed for <netinet/in.h>.

On systems with "inet_pton()", the API is defined using "u_char", and
we're including <sys/types.h> on platforms that have it (which should be
most if not all UNIX platforms) and including <winsock2.h> on platforms
that have it (Windows), so we might as well use "u_char" and "u_int", as
the BSD version of "inet_pton.c" does.  (Besides, we weren't including
any GLib include files, so "guchar" and "guint" weren't getting defined
in any case.)

svn path=/trunk/; revision=5937
2002-08-03 19:37:48 +00:00
Guy Harris 38d08c8883 <netinet/in.h> is needed for <arpa/inet.h>, at least on some platforms,
and <sys/types.h> is needed for <netinet/in.h>.

svn path=/trunk/; revision=5936
2002-08-03 19:35:16 +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
Ronnie Sahlberg c56dc7ea38 Fix small typo
svn path=/trunk/; revision=5920
2002-07-31 11:16:19 +00:00
Ronnie Sahlberg e930dd4a31 Adding a new macro CMP_ADDRESS similar to ADDRESS_EQUAL but this one will return
-1,0,1 as the xxxcmp() functions will instead of just true/false.
Useful if you not only want to check for equality but also if you want to have a way to order the elements.

svn path=/trunk/; revision=5917
2002-07-31 06:15:26 +00:00
Guy Harris 47b147ffd1 Add an extra argument to "tvb_find_line_end()", which specifies what it
should do if it doesn't find an EOL; if FALSE, it behaves as before,
returning values that treat the line as ending at the end of the tvbuff,
and if TRUE, it returns -1, so its caller can do segment reassembly
until it gets the EOL.

Add an option to the SMTP dissector to do segment reassembly, and do
segment reassembly of the first line.

svn path=/trunk/; revision=5891
2002-07-17 06:55:29 +00:00
Guy Harris 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +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 96033b671b From Didier Gautheron:
Add Zone Information Protocol support.

	Rename "ddp.dst.socket" and "ddp.src.socket" to "ddp.dst_socket"
	and "ddp.src_socket", as the socket number is no longer
	considered part of the DDP address.

svn path=/trunk/; revision=5800
2002-06-29 21:27:39 +00:00
Guy Harris 431cae49a1 There are no "ipx.src" or "ipx.dst" filterable fields.
svn path=/trunk/; revision=5787
2002-06-28 22:58:39 +00:00
Guy Harris 96fad4b20a From Hannes Gredler: fix display of OSI system IDs to use a dot rather
than a dash before the PSN byte; the dash is typically
only used to demarcate the fragment.

svn path=/trunk/; revision=5785
2002-06-28 22:43:49 +00:00
Gerald Combs 1d91164b2a Bump the version up to 0.9.5.
svn path=/trunk/; revision=5779
2002-06-28 20:15:31 +00:00
Guy Harris 6ecde9ff17 From Didier Gautheron: move port number from AppleTalk addresses to
separate column, and put in hidden fields for AppleTalk source and
destination addresses.

svn path=/trunk/; revision=5778
2002-06-28 20:13:03 +00:00
Guy Harris 38b530a8b8 Add a routine to "epan/filesystem.c" to test whether a file is a FIFO.
Use that in Tethereal rather than duplicating a pile of macros.

Get rid of the remaining uses of "stat()" in Tethereal - none of them
are necessary (they were just cut-and-pasted from Ethereal).

svn path=/trunk/; revision=5746
2002-06-23 21:33:09 +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 5adb2d031d From Joerg Mayer: fix a typo in a comment.
svn path=/trunk/; revision=5707
2002-06-19 19:21:15 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Gerald Combs 024306cdcf Increment versions to 0.9.4, get NEWS current to April 25 (more NEWS to
come).

svn path=/trunk/; revision=5500
2002-05-18 04:00:35 +00:00
Guy Harris 84f9e6b068 Get rid of an assigned-to-but-not-used variable, and eliminate another
variable that's used only once.

svn path=/trunk/; revision=5479
2002-05-15 21:18:19 +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 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 b6e941027f Add a "tvb_ensure_bytes_exist()", which is like "tvb_bytes_exist()" only
it throws the appropriate exception if the bytes don't exist.  Use it in
the GIOP and ASN.1 code to check whether the bytes to be copied to a
buffer exist before allocating the buffer.

Make "check_offset_length_no_exception()" check for an overflow, so that
it can be used in "tvb_ensure_bytes_exist()" and do all the checking
that the code "tvb_ensure_bytes_exist()" replaces did.

Make "get_CDR_wchar()" return a "gint", so that if the length octet it
fetched has a value between 128 and 255, the length can be returned
correctly.

Fix some comments not to specify the exception thrown by various
routines that can throw various exceptions.

svn path=/trunk/; revision=5453
2002-05-13 01:24:47 +00:00
Guy Harris 58324cf3b3 Mark an unused argument as such.
Fix a couple of typos in comments.

svn path=/trunk/; revision=5439
2002-05-10 20:02:40 +00:00
Gilbert Ramirez 38dafc2bfa Register FT_UINT_BYTES with correct structure.
svn path=/trunk/; revision=5436
2002-05-10 02:44:08 +00:00
Gilbert Ramirez 41cc7f0707 Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make
some of the COL_INFO texts more useful, handle a Unicode issue, and
modify some of the cases that use "request conditions".
But the NCP dissector as it stands is very usable now.

Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted
to think about the various possible macros and review an email conversation
I had with Guy on the subject.

svn path=/trunk/; revision=5432
2002-05-09 23:50:34 +00:00
Ronnie Sahlberg 9625720a39 Added parsing of PORTMAP GETPORT functions.
When we see PRTOMAP GETPORT calls for UDP, make sure all further UDP packets to  or from
this port goes to the ONC-RPC dissector regardless of the port on the other side.

We need this because if there is ONC-RPC traffic going between the ONC-RPC Program port to a port which has a normal ethereal dissector, ethereal would dissect the traffic as the protocol associated with the other port instead.

svn path=/trunk/; revision=5430
2002-05-09 12:10:06 +00:00
Guy Harris 4f82062233 From Joerg Mayer:
autoconf 2.53 creates directories named autom4te.cache
        Add them to .cvsignore

svn path=/trunk/; revision=5419
2002-05-08 22:24:03 +00:00
Guy Harris 33e80cec64 Have "tvb_ensure_length_remaining()" directly call
"compute_offset_length()", and throw the exception it returns, rather
than calling "tvb_length_remaining()" and throw BoundsError if it
returns -1; this allows us to add additional exceptions without having
to change "tvb_ensure_length_remaining()".

Make "_tvb_get_nstringz()" static, as it's not used outside "tvbuff.c".

svn path=/trunk/; revision=5397
2002-05-05 21:07:52 +00:00
Guy Harris d612dab6df Make "tvb_ensure_length_remaining()" return a "guint" - it can't return
a negative value.

Use "tvb_ensure_length_remaining()" in "tcp_dissect_pdus()", rather than
checking the return value of "tvb_length_remaining()" ourselves, and
make various variables and parameters in it "guint" as appropriate.

svn path=/trunk/; revision=5396
2002-05-05 00:57:59 +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 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 dd9f02255d Note in a comment that the display filter code has its own mechanism for
looking up filter fields by name.

svn path=/trunk/; revision=5281
2002-04-28 23:39:58 +00:00
Guy Harris 4fb36a6b1d Use "format_text()" when setting the display representation of string
values, so that non-printable characters are shown as escapes.

svn path=/trunk/; revision=5280
2002-04-28 22:21:09 +00:00
Guy Harris db119f15d4 Add routines to create anonymous handles for new-style dissectors (ones
that return an "int", giving either an indication of how much data was
dissected, an indication of how much more data is needed from TCP to
dissect, or 0, meaning "this isn't one of my packets").

svn path=/trunk/; revision=5260
2002-04-28 00:13:05 +00:00
Guy Harris ed02576048 Use "gfloat" and "gdouble", rather than "float" and "double", as the
return types of the tvbuff accessors for floating-point types, to more
closely match the tvbuff accessors for integral types.

Fix an error in the code for fetching doubles on VAXes, and get rid of
unused union members on VAXes.

svn path=/trunk/; revision=5245
2002-04-24 21:53:05 +00:00
Guy Harris 7d96eec76b Use Ashok's IEEE-float-to-long code as the basis for
IEEE-float-to-native-float code, and use that as the basis for
IEEE-double-to-native-double code.  Use that code on VAXes.

Eliminate "ieee-float.h", as we no longer use it; instead, we use the
tvbuff routines for extracting IEEE floating-point numbers.

svn path=/trunk/; revision=5243
2002-04-24 21:19:38 +00:00
Guy Harris 5fbabf3844 Add "stamp-h1", for automake 1.6.1, as per Joerg Mayer's suggestion.
svn path=/trunk/; revision=5236
2002-04-24 07:40:37 +00:00
Guy Harris 5984e4ba95 Clean up white space.
Fix the display filter expression generated for protocol tree items
without named fields attached to them; the length defaults to 1 if not
specified in a range expression, so the length should be specified.

svn path=/trunk/; revision=5208
2002-04-20 08:07:56 +00:00
Guy Harris a056c5052d proto_registrar_get_nth(hfinfo->id) == hfinfo, so use the latter rather
than the former.

svn path=/trunk/; revision=5203
2002-04-19 10:03:52 +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 ec005ccd0b Catch attempts to register ett_ values after the array of "tree is
expanded" flags has been allocated.

svn path=/trunk/; revision=5197
2002-04-18 00:50:45 +00:00
Guy Harris 661056aac4 Add (untested) routines to fetch IEEE single-precision and
double-precision floating-point numbers, in big-endian and little-endian
format (hopefully there aren't any middle-endian formats; if there are,
we'll have to add them), from a tvbuff, and to return floats (for
single-precision) and doubles (for double-precision).

svn path=/trunk/; revision=5147
2002-04-12 23:25:24 +00:00
Gilbert Ramirez 5c75eb2df7 Add "-" (hyphen) to the pattern for field-name/non-quoted string.
svn path=/trunk/; revision=5139
2002-04-11 03:26:26 +00:00
Gilbert Ramirez bf43b509f0 Make some variables and functions static.
svn path=/trunk/; revision=5129
2002-04-08 20:11:31 +00:00
Guy Harris 3cf1b5ffa5 Before putting an item into a protocol tree, make sure the item above
it, if it's going to be displayed (i.e., if it's not the root node), has
had an ett_ value associated with it.

svn path=/trunk/; revision=5098
2002-04-04 20:23:50 +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