Commit Graph

75 Commits

Author SHA1 Message Date
Jörg Mayer e68ca30d10 Fix warnings found by -Wstrict-prototypes
svn path=/trunk/; revision=9722
2004-01-18 16:21:12 +00:00
Guy Harris 58c3106a92 From David Fort: support for decoding MLD v2 report messages.
svn path=/trunk/; revision=9364
2003-12-19 23:20:53 +00:00
Guy Harris 2573a5527a From Laurent Rabret: use "g_free()", not "free()", to free stuff
allocated with "g_malloc()" and related GLib routines.

svn path=/trunk/; revision=7758
2003-05-28 22:40:19 +00:00
Guy Harris 22ad95955e From Yaniv Kaul: check a reserved field against 0 (the RFC specifies it
must be zero), and displays an indication of whether it's zero or not.

svn path=/trunk/; revision=7593
2003-04-28 19:24:48 +00:00
Laurent Deniel 4e9e699536 Replace some unchecked malloc calls by g_malloc.
svn path=/trunk/; revision=7584
2003-04-27 20:57:58 +00:00
Guy Harris 625d0088d4 From Teemu Rinta-aho: draft 20 MIPv6 support (now in a file of its own).
svn path=/trunk/; revision=7071
2003-02-04 20:17:01 +00:00
Guy Harris 6c4a845613 Move into "call_dissector_work()" the stuff to handle dissecting, in
error packets, the copy of the packet that got the error, rather than
doing it in the CLNP dissector and the ICMP dissector and the ICMPv6
dissector and the PPP dissector for various control protocols; have it
do that work iff "pinfo->in_error_pkt" is set.

svn path=/trunk/; revision=6942
2003-01-20 05:42:37 +00:00
Guy Harris 59932f2722 Don't cast away constness, and fix variable and structure member
qualifiers as necessary to ensure that we don't have to.

"strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't
test their results as if they did.

Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes.

Update Michael Tuexen's e-mail address.

svn path=/trunk/; revision=6726
2002-12-02 23:43:30 +00:00
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
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 7f2e644e84 Make some variables volatile because GCC on Digital UNIX complained
about them being trashed by setjmp/longjmp (does GCC there stuff them
into registers?  They're bigger than 64 bits, so they don't even fit
into a single register on Alpha).

svn path=/trunk/; revision=4636
2002-01-30 22:58:54 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +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 f4c930c8e2 From Martti Kuparinen: update the HMIPv6 support to match the latest
draft (draft-ietf-mobileip-hmipv6-05.txt).

svn path=/trunk/; revision=4546
2002-01-15 20:11:10 +00:00
Guy Harris 4b6951cd89 Put in a comment giving various Internet Draft names for ICMPv6 stuff we
handle.

svn path=/trunk/; revision=4526
2002-01-11 09:19:54 +00:00
Guy Harris 13b58598b3 Fix some more signed vs. unsigned issues.
svn path=/trunk/; revision=4525
2002-01-11 09:12:26 +00:00
Guy Harris 65b96f652d Fix more unsigned items to be displayed with "%u" rather than "%d", as
per Martti Kuparinen's comments.

svn path=/trunk/; revision=4515
2002-01-10 11:21:21 +00:00
Guy Harris 60c8a87e44 The filetime is an unsigned quantity, so display it with %u, as per
Martti Kuparinen's comment.

svn path=/trunk/; revision=4512
2002-01-10 09:49:35 +00:00
Guy Harris bd42a598db HMIPv6 fix, from Martti Kuparinen.
svn path=/trunk/; revision=4506
2002-01-09 19:13:03 +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
Ed Warnicke 34dbc86e65 Moved from using dissect_data to using call_dissector()
svn path=/trunk/; revision=4264
2001-11-25 22:51:14 +00:00
Guy Harris d627904aba Have a flag in the "packet_info" structure, which indicates whether the
stuff currently being dissected is part of a packet included in an error
packet (e.g., an ICMP Unreachable packet).  Have the TCP dissector not
bother doing reassembly if the TCP segment is part of an error packet,
rather than an actual TCP transmission; other dissectors might want to
treat those packets specially as well.

Add to the "tcpinfo" structure a flag indicating whether the URG flag
was set, rather than having the zero or non-zero value of the urgent
pointer indicate that.  (Yes, at least as I read RFC 793, a zero urgent
pointer value isn't useful, as it means "the stuff before this segment
is urgent", but it's certainly possible to put onto the wire a TCP
segment with URG set and a zero urgent pointer.)

Don't dissect the TCP header by grabbing the entire header with
"tvb_memcpy()" and then pulling stuff out of it - extract stuff with
individual tvbuff calls, and put stuff into the protocol tree and the
Info column as we extract it, so that we can dissect a partial header.
This lets us, for example, get the source and destination ports from the
TCP header of the part of a TCP segment included in a minimum-length
ICMPv4 error packet.

svn path=/trunk/; revision=3986
2001-10-01 08:29:37 +00:00
Guy Harris 6395ce3749 When dissecting an ICMP datagram that contains part of an IP datagram,
hand the (possibly-partial) IP datagram to the IP dissector, as we do
for IPv6 datagrams inside ICMPv6 and CLNP datagrams inside CLNP ER PDUs.

When dissecting IPv6 datagrams inside ICMPv6 and CLNP datagrams inside
CLNP ER PDUs, catch the ReportedLengthError exception and ignore it, as
they don't guarantee that all of the original PDU is present.

svn path=/trunk/; revision=3960
2001-09-27 10:35:40 +00:00
Guy Harris a86490d2a7 If "snprintf()" can't print all the data because there's not enough
room, it might return -1 in some versions of glibc; check for that, and
quit if that happens.

It might also return the number of characters that would've been printed
had there been enough room; this means that a loop that does

	n += snprintf (buf + n, BUF_LENGTH - n, ...);

may end up making "n" bigger than BUF_LENGTH, and "snprintf()" might not
sanely handle being passed a negative length, so if "n" isn't less than
the total length of the string buffer, don't add stuff to it.

The "capabilitiesStart" variable in "add_capabilities()" in the WSP
dissector is an offset into the PDU data; there's no guarantee that said
offet is < 256, and, even if there were, there's no point in making it
an 8-bit variable.

Add some additional buffer overflow checks to the WSP dissector.

svn path=/trunk/; revision=3953
2001-09-25 18:27:35 +00:00
Guy Harris 2cdb896f85 Typo fix, from Martti Kuparinen.
svn path=/trunk/; revision=3910
2001-09-05 19:48:53 +00:00
Guy Harris 4ad369eca1 HMIPv6 support, from Martti Kuparinen.
svn path=/trunk/; revision=3907
2001-09-04 21:04:52 +00:00
Guy Harris db5e1b8c85 Tvbuffify the DNS, NBNS, NBDS, and NBSS dissectors.
Add a "tvb_memeql()" routine, for doing "memcmp()"-style equality
comparisons.

svn path=/trunk/; revision=3631
2001-07-02 07:11:40 +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 261c18fcd7 Not all platforms have u_int32_t (for example, Windows+MSVC doesn't), so
use "guint32" instead.

svn path=/trunk/; revision=3503
2001-06-02 08:10:02 +00:00
Guy Harris 89a74629b2 Create the tree for an ICMPv6 optionn before putting something in it.
svn path=/trunk/; revision=3499
2001-06-02 06:10:08 +00:00
Jun-ichiro itojun Hagino 78d7c0ca28 draft-draves-ipngwg-router-selection-01 support.
fix icmp6 homeagent info option decoding (convert to tvb framework).
plug a memory leak.
sync some of mobile-ip6 #define symbol names with draft-ietf-ipngwg-2292bis-02.

svn path=/trunk/; revision=3497
2001-06-01 23:53:49 +00:00
Guy Harris 6f80d501ef In the ICMPv6 and OSI CLNP dissectors, when calling the IPv6 or CLNP
dissector to dissect the datagram inside an error report datagram, save
the current values of the source and destination addresses, and restore
them after the subdissector returns, so that all address columns in the
summary pane will reflect the error datagram, not the datagram that
provoked the error.

Set the Protocol and Info columns upon entry to the ICMPv6 dissector, so
that if we throw an exception they don't reflect the protocol above
ICMPv6.

svn path=/trunk/; revision=3456
2001-05-27 04:14:53 +00:00
Guy Harris c3271d0a76 More signed-vs-unsigned changes from Joerg Mayer.
svn path=/trunk/; revision=3386
2001-04-27 01:27:37 +00:00
Guy Harris c75f555d8c Move the declarations of IP protocol numbers to "ipproto.h" from
"packet-ip.h".

Fix Gerald's address in some files while we're at it.

svn path=/trunk/; revision=3366
2001-04-23 17:51:37 +00:00
Guy Harris 16a58c04d5 Now that the IPv6 dissector has been tvbuffified, we can register it; do
so, make it static, and call it only through a handle.

In the ICMPv6 dissector, when we dissect the invoking packet in an
ICMPv6 error or in a redirected header option, make the columns
non-writable, so the summary line for the packet shows it as an ICMPv6
packet, not as the packet included in the ICMPv6 packet.

svn path=/trunk/; revision=3361
2001-04-23 03:56:57 +00:00
Guy Harris 2bc2974c6e Tvbuffification of the IPv6 and ICMPv6 dissectors, and some bug fixes
and an update to draft 7 of ICMPv6 name lookups, from Heikki Vatiainen.

Fix some formats in the ICMPv6 dissector to use %u, rather than %d, for
unsigned quantities.

Show various type and code values in ICMPv6 as decimal, not hexadecimal
(they're decimal in the RFCs).

svn path=/trunk/; revision=3360
2001-04-23 03:37:31 +00:00
Olivier Abad fe0e0fef21 Replace proto_tree_add_item_hidden with proto_tree_add_boolean_hidden to
fix a crash found by Heikki Vatiainen when adding the hf_icmpv6_checksum_bad
field.

svn path=/trunk/; revision=3201
2001-03-28 21:24:15 +00:00
Guy Harris 1658a51f79 Add hidden fields for bad checksums to various IP-family protocols.
Initialize the "hf_" value for "icmp.checksum_bad" to -1, the way all
other "hf_" values are initialized, and declare it and "ip.checksum_bad"
to have base BASE_NONE, not 4.

svn path=/trunk/; revision=3087
2001-02-28 19:33:49 +00:00
Gerald Combs 306f303c0d Mobile IPv6 updates from Borosa Tomislav <tomislav.borosa@SIEMENS.HR>.
svn path=/trunk/; revision=2935
2001-01-23 02:49:55 +00:00
Guy Harris a4e137f630 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.

svn path=/trunk/; revision=2932
2001-01-22 08:54:08 +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 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
Guy Harris 4f140107f9 Check the checksum on ICMPv6 packets, if possible.
svn path=/trunk/; revision=2759
2000-12-14 21:45:12 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 00e5867b10 Get rid of the definitions of LITTLE_ENDIAN and BIG_ENDIAN in
"epan/pint.h" - they caused GCC to whine about them being redefined when
I compiled on FreeBSD 3.4.

Get rid of the stuff in "packet-ipv6.h" that defines various bit vectors
differently depending on the byte order of the machine; instead, define
them so that they work with items in host byte order.  This lets us use
a number of them rather than using hardwired hex values.

Put "frag.ip6f_offlg" in host byte order before using it; this means
that IP6F_MORE_FRAG can still be used even though it now works only on
items in host byte order.

svn path=/trunk/; revision=2610
2000-11-11 10:23:43 +00:00
Guy Harris d4f633378a Fix a "proto_tree_add_text()" call.
svn path=/trunk/; revision=2593
2000-11-09 21:57:35 +00:00
Jun-ichiro itojun Hagino a3863a1dfe support match-prefix and use-prefix decoding for router renumbering protocol
svn path=/trunk/; revision=2592
2000-11-09 16:39:59 +00:00
Jun-ichiro itojun Hagino 28fbec1fcd correct IPv6 router renumbering dissector.
svn path=/trunk/; revision=2591
2000-11-09 14:09:41 +00:00
Gilbert Ramirez 8ff757bcac Don't loop infinitely on options with zero length.
From Santeri Paavolainen.

svn path=/trunk/; revision=2489
2000-10-12 14:58:02 +00:00