Commit Graph

43 Commits

Author SHA1 Message Date
Jörg Mayer 7c4176d868 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=6117
2002-08-28 21:04:11 +00:00
Guy Harris 3fbb450361 From Motonori Shindo: support for
o draft-lasserre-tls-mpls-00.txt
 o draft-lasserre-vkompella-ppvpn-vpls-02.txt

svn path=/trunk/; revision=6100
2002-08-27 19:21:02 +00:00
Guy Harris 346fbdbc39 LDP VC FEC dissection fix, from Motonori Shindo.
svn path=/trunk/; revision=5999
2002-08-15 19:04:16 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris f106336624 #if out an unused argument, using the same #if as the references to the
argument.

svn path=/trunk/; revision=5335
2002-05-01 08:26:57 +00:00
Guy Harris 9a80f0a521 Removal (or, at least, #ifdeffing out) of unused variables and
functions, from David Frascone.

svn path=/trunk/; revision=5288
2002-04-29 08:20:18 +00:00
Guy Harris f643982382 Make the LDP dissectors new-style dissectors, so they can reject packets
if the version number isn't 1; the LDP port number appears to be
popular for ONC RPC protocols, and this lets them be dissected as such,
at least if they don't begin with a 2-byte big-endian 1.

Do a standard TCP loop, which:

	handles LDP headers split across TCP segments;

	gives each LDP PDU in a TCP stream a tvbuff of its own, so we
	don't run past the end of the PDU;

	gives each LDP PDU its own tree.

svn path=/trunk/; revision=5261
2002-04-28 00:18:50 +00:00
Guy Harris 3af29ce7bf Use "%.10g", rather than "%f", for floating-point numbers. That will
display values that would fit in a 32-bit integer as integers, leaving
out all trailing zeroes after the decimal point (and leaving out the
decimal point if there are no digits left after the decimal point once
trailing zeroes are removed), and will use scientific notation for small
fractions or large numbers.

svn path=/trunk/; revision=5248
2002-04-25 06:34:42 +00:00
Guy Harris e4076d8efd Show the "negotiable/non-negotiable" flags as such.
svn path=/trunk/; revision=5239
2002-04-24 19:35:52 +00:00
Guy Harris 15c69a7e3d Use "tvb_get_ntohieee_float()" to fetch floating-point numbers from the
packet.

svn path=/trunk/; revision=5238
2002-04-24 19:26:18 +00:00
Guy Harris 5bc3cc445d CRLDP support, and assorted byg fixes, from Michael Rozhavsky.
Clean up the "Error processing TLV" error messages to

	1) indicate the type of TLV

and

	2) indicate the type of error.

Clean up white space.

Make routines static if they're not used outside this file.

svn path=/trunk/; revision=5237
2002-04-24 19:16:49 +00:00
Gilbert Ramirez 5c10ad55a8 More static-ization.
svn path=/trunk/; revision=5131
2002-04-08 20:30:56 +00:00
Guy Harris 15fc29c820 Fix a bunch of bits of code that used "tvb_get_ntohl()" to fetch IP
addresses and then tried to compensate for that error using "htonl()"
(or didn't bother compensating, in some cases).

svn path=/trunk/; revision=5082
2002-04-02 01:32:46 +00:00
Guy Harris 13e6565ff4 From Aamer Akhter: LDP support for draft-martini-l2circuit-trans-mpls,
LDP status code updates, and small LDP cleanups.

svn path=/trunk/; revision=4959
2002-03-16 23:15:45 +00:00
Guy Harris 54034c6ecc Fix a couple of incorrect calls to "proto_tree_add_boolean()" to call
"proto_tree_add_item()" instead.

svn path=/trunk/; revision=4950
2002-03-16 02:09:28 +00:00
Guy Harris f953bd7415 From Ricardo Barroetave�a: don't give a PDU ordinal number for
LDP-over-UDP, as there's only one LDP PDU per UDP PDU.

svn path=/trunk/; revision=4598
2002-01-22 20:21:39 +00:00
Guy Harris 6deb504cff From Ricardo Barroetave�a: support for all TLVs and messages in RFC
3036.

svn path=/trunk/; revision=4590
2002-01-21 22:15:18 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris a45d3d3bfe Fix some problems in protocol preferences blurbs.
svn path=/trunk/; revision=4582
2002-01-20 23:25:55 +00:00
Guy Harris 92915713d3 Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff".  This can be used if

	1) the item covers the entire packet or the remaining payload in
	   the packet

or

	2) the item's length won't be known until it's dissected, and
	   will be then set with "proto_item_set_len()" - if an
	   exception is thrown in the dissection, it means the item ran
	   *past* the end of the tvbuff, so saying it runs to the end of
	   the tvbuff is reasonable.

Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).

In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).

Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.

Fix some indentation.

svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +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
Guy Harris 0fb9bbe02e Note that LDP is documented in RFC 3036.
svn path=/trunk/; revision=4277
2001-11-27 05:01:14 +00:00
Guy Harris a18d29bede Handle the case of multiple LDP PDUs per TCP segment. (Still needs to
handle the case of more than one TCP segment per LDP PDU....)

Fix the handling of some of the length fields.

svn path=/trunk/; revision=4276
2001-11-27 04:59:01 +00:00
Guy Harris 681f73adb7 There is really no need to have the BGP dissector and the LDP dissector
have two independent "value_string" tables mapping RFC 1700 address
family numbers to names, nor is there any need to have the BGP dissector
and the PIM dissector have two independent sets of #defines for RFC 1700
address family numbers; put a single "value_string" table in "afn.c" and
put a declaration of it, and #defines for the address family numbers,
into "afn.h", and have the dissectors use that.

Move the #define for PGM into "ipproto.h", and add an entry for it in
the "value_string" table in "ipproto.c".

Have the PGM dissector use the standard Ethereal mechanisms for
resolving addresses, and have it use "value_string" tables for mapping
option types, the OPX bits, and packet types to strings.  Use
"bytes_to_str()" to turn byte arrays into strings of hex digits.  Pass
the packet type string to "dissect_pgmopts()" as an argument, rather
than making it a global.  Don't use "proto_tree_add_XXX_format" routines
if you can possibly just use "proto_tree_add_XXX"; give various fields
the correct radix and type, and VALS() strings if necessary, to make
that happen (and to make filtering on them more pleasant).  Put the
type, length, and total length of the options into the protocol tree as
separate fields.  Don't have separate type, length, and OPX fields for
every type of option; one field will suffice.  Don't format a string
with "sprintf()" and then pass that string to "col_add_fstr()" with a
format of "%s" and the string as an argument - "col_add_fstr()" can
format strings itself (that's what the "f" stands for).  Don't byte-swap
and then un-byte-swap IPv4 address fields in the header, just leave them
network byte order to start with.  Use the correct fields for
"proto_tree_add_XXX", rather than using the same field multiple times.
Quit early if an address family identifier isn't AFNUM_INET, as that
means the structure we use to dissect the header doesn't match the
actual header.

svn path=/trunk/; revision=3761
2001-07-21 10:27:13 +00:00
Guy Harris 3c91e2e203 Convert a bunch of "proto_tree_add_bytes(tree, hf, tvb, offset, length,
tvb_get_ptr(tvb, offset, length))" calls to "proto_tree_add_item()"
calls.

Do the same, in "packet-iscsi.c" and "packet-mrdisc.c", for
"proto_tree_add_uint()" and "proto_tree_add_boolean()" calls.

svn path=/trunk/; revision=3726
2001-07-16 05:16:58 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris b92e322537 Compensate better for invalid (at least for IPv4) prefix lengths in
FECs.

svn path=/trunk/; revision=3515
2001-06-05 21:00:17 +00:00
Guy Harris 46e1be8671 Fix to LDP prefix FEC dissection for IPv4, from Eran Mann.
svn path=/trunk/; revision=3431
2001-05-21 10:14:37 +00:00
Guy Harris 32d63ecb30 Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="
statements.

Move the setting of the Protocol column in various dissectors before
anything is fetched from the packet, and also clear the Info column at
that point in those and some other dissectors, so that if an exception
is thrown, the columns don't reflect the previous protocol.

"Tvbuffify" the Mobile IP dissector (it took old-style arguments, and
then converted them into tvbuff arguments, so there wasn't much to do,
other than to fix references to "fd" to refer to "pinfo->fd").

In the SCTP dissector, refer to the port type and source and destination
ports through "pinfo" rather than through the global "pi", as it's a
tvbuffified dissector.

In the SMTP and Time Protocol dissectors, use "pinfo->match_port" rather
than "TCP_PORT_SMTP" when checking whether the packet is a request or
reply, just in case somebody makes a non-standard port be dissected as
SMTP or Time.  (Also, remove a bogus comment from the Time dissector; it
was probably cut-and-pasted from the TFTP dissector.)

svn path=/trunk/; revision=2938
2001-01-25 06:14:14 +00:00
Guy Harris 43ccfd8054 Add an additional "protocol index" argument to "{old_}dissector_add()",
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and
"register_dissector()", so that an entry in those tables has associated
with it the protocol index of the protocol the dissector handles (or -1,
if there is no protocol index for it).

This is for future use in a number of places.

(Arguably, "proto_register_protocol()" should take a dissector pointer
as an argument, but

	1) it'd have to handle both regular and heuristic dissectors;

	2) making it take either a "dissector_t" or a union of that and
	   a "heur_dissector_t" introduces some painful header-file
	   interdependencies

so I'm punting on that for now.  As with other Ethereal internal APIs,
these APIs are subject to change in the future, at least until Ethereal
1.0 comes out....)

svn path=/trunk/; revision=2849
2001-01-09 06:32:10 +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 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
protocols, in addition to adding structures to the list of filterable
fields.  Give it an extra argument that specifies a "short name" for the
protocol, for use in such places as

	pinfo->current_proto;

	the dialog box for constructing filters;

	the preferences tab for the protocol;

and so on (although we're not yet using it in all those places).

Make the preference name that appears in the preferences file and the
command line for the DIAMETER protocol "diameter", not "Diameter"; the
convention is that the name in question be all-lower-case.

Make some routines and variables that aren't exported static.

Update a comment in the ICP dissector to make it clear that the
dissector won't see fragments other than the first fragment of a
fragmented datagram.

svn path=/trunk/; revision=2810
2001-01-03 06:56:03 +00:00
Richard Sharpe f8aed7c659 Fix egregious error with AF_ types. I relied on a Linux header file rather
than checking RFC1700.

svn path=/trunk/; revision=2745
2000-12-04 13:40:11 +00:00
Guy Harris 35bf0b2abc Don't loop infinitely if we see a Host Address or unknown Forwarding
Equivalence Class.

Set "pinfo->current_proto", so that if we run past the end of the data
the problem is noted as being with LDP.

svn path=/trunk/; revision=2743
2000-12-04 06:05:49 +00:00
Richard Sharpe 6d30ba2b97 Stealing time again to compulsively code this beast.
Still more TLVs to code ...

svn path=/trunk/; revision=2734
2000-12-03 02:37:56 +00:00
Richard Sharpe 8482bcd0ab Dissect Common Hello Params TLV ...
Still more work to do though ...

svn path=/trunk/; revision=2733
2000-12-02 14:23:04 +00:00
Guy Harris 0ab8e159b9 Some tvbuffified dissectors weren't setting "pinfo->current_proto", so
that if they threw an exception, the wrong protocol would be blamed.
Add the missing assignments.

Clean up the extraction of the null-encapsulation header.

svn path=/trunk/; revision=2730
2000-12-02 08:41:08 +00:00
Richard Sharpe 7c5911a9c6 Fix one small type WRT Forwarding Equivalence Classes and handle the
illegal padding by trying to skip it.

svn path=/trunk/; revision=2727
2000-12-01 09:40:12 +00:00
Richard Sharpe 1aa04e3836 A much more complete LDP dissector.
Still more work to do though, as I want to dissect the various message
types correctly, and to dissect TLVs much more as well.

The dissector currently handles multiple messages in a PDU, as the trace
file I have has some of those.

I think that the equipment that generated the LDP trace I have has a bug.

It seems to think that TLVs must be alligned on 4-byte boundaries, while the
spec (draft) says that there are no alignment requirements :-)

Don't know what generated the trace :-)

svn path=/trunk/; revision=2726
2000-12-01 09:05:46 +00:00
Richard Sharpe 749e87cb6f Step-wise improvement on this thing ... next to dissect each message type
more fully.

Apparently, LDP allows multiple messages per PDU. Has anyone seen such an
implementation?

svn path=/trunk/; revision=2724
2000-11-30 20:27:40 +00:00
Richard Sharpe 8af1fc6550 More work in progress on the Label Distribution Protocol dissector ...
Bit more work to do, and a list of TLV values, and I am away :-)

svn path=/trunk/; revision=2720
2000-11-30 06:24:53 +00:00
Richard Sharpe 88f954cfa2 Initial coding of the dissector for the Label Distribution Protocol.
It registers the same dissector for the LDP port for both TCP and UDP.

Still a lot of work to do, but we can see the header now.

svn path=/trunk/; revision=2714
2000-11-29 13:15:01 +00:00