Commit Graph

176 Commits

Author SHA1 Message Date
Guy Harris daa0dd9f1a Count ICMPv6 packets as ICMP when capturing.
Check the next header type - properly handling extension headers - in
"capture_ipv6()".

Get rid of the count of IPv6 packets - we break that down in
"capture_ipv6()" now.

Fix a typo.

svn path=/trunk/; revision=6510
2002-10-25 23:23:28 +00:00
Guy Harris 07d0032f1c Add a "fragment_add_seq_next()" to reassemble fragments that don't have
sequence numbers or offsets and are thus assumed to be received in order
with no duplicates or dropped fragments (e.g., for NetBIOS Frame, where
802.2 LLC guarantees in-order delivery to NetBIOS with no duplicates or
dropped fragments).

"show_fragment_tree()' and "show_fragment_seq_tree()" don't modify the
"fragment_items" to which the "fit" argument points, so make that
argument a "const fragment_items *".

Make all the "fragment_items" tables "static" (as they're not used
outside the modules defining them) and "const" (as they're not
modified).

Add support for reassembly of NetBIOS fragmented requests and responses.

Get rid of an unnecessary include of "packet-tr.c" in the NetBIOS
dissector, and make its table of dissection function pointers static.

Fix some typos in the AppleTalk and NetBIOS dissectors.

svn path=/trunk/; revision=6491
2002-10-24 06:17:36 +00:00
Guy Harris 27df774d0b From Peter Fales: ARCNET support.
Sort the lists of dissectors in the DISSECTOR_SRC macros in
"Makefile.am" and "Makefile.nmake".

svn path=/trunk/; revision=6450
2002-10-18 21:00:01 +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 4c86bb6b38 From Joerg Mayer:
Change struct addr to guint32 which is the way it is used
	anyway.

	Use the GLib macros to convert from network to host byte order.

svn path=/trunk/; revision=5878
2002-07-15 20:54:45 +00:00
Gerald Combs c5f400ed77 From John Wells: Fix the default offset adjustment in dissect_mip_extentions.
svn path=/trunk/; revision=5657
2002-06-09 01:03:19 +00:00
Guy Harris 4f9508837a Add "show_fragment_seq_tree()", which is like "show_fragment_tree()",
but for stuff reassembled with "fragment_add_seq()" or
"fragment_add_seq_check()".

Add a "fragment tag" string to the "fragment_items", so that packets
with fragmentation errors can be properly flagged as having "Illegal
fragments" or "Illegal segments" depending on the term used with the
protocol in question.

Make all the dissectors that can use "show_fragment_tree()" or
"show_fragment_seq_tree()", and don't already use them, do so.

svn path=/trunk/; revision=5644
2002-06-07 10:11:41 +00:00
Ronnie Sahlberg 31823cb851 Added show_fragment_tree() to reassemble. This function will do the common
task of creating a fregment tree for the fragmented packets.
Having this identical code to create this tree in every dissector that does
PDU reassembly is a huge waste and duplication of code.

Updated IP, SMB and DCERPC to use the new function.

svn path=/trunk/; revision=5626
2002-06-05 11:21:49 +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
Guy Harris 4401f1433f Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourth
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to
run to the end of the parent tvbuff.

svn path=/trunk/; revision=5597
2002-05-30 01:56:55 +00:00
Guy Harris e4cd1b156c Get rid of an unused argument.
Use the reported length, not the captured length, of a tvbuff when
scanning through it.

Mark unused arguments that can't be eliminated as unused.

svn path=/trunk/; revision=5058
2002-03-31 21:43:51 +00:00
Guy Harris 588c50944d In the protocol tree entries for lists of fragments/segments, make the
top-level item correspond to the reassembled data, and make the item for
each fragment/segment correspond to the part of that reassembled data
that came from that fragment/segment.

svn path=/trunk/; revision=5025
2002-03-27 04:27:05 +00:00
Guy Harris 03e5890761 Label the data source for various forms of reassembled data with the
protocol that fragmented them, rather than just calling them
"Reassembled".  Do the same with uncompressed WCP data.

svn path=/trunk/; revision=4822
2002-02-27 05:45:48 +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 d92a1cd8e1 With the tvbuffication of all dissectors, the "packet_info" structure no
longer contains length fields, so there's no need to pass a "packet_info
*" argument to "set_actual_length()".

svn path=/trunk/; revision=4748
2002-02-17 00:51:21 +00:00
Guy Harris 0322b68e1e Properly add the Boolean "checksum is bad" flag.
svn path=/trunk/; revision=4666
2002-02-01 12:04:54 +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 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 ce6db7ff97 If reassembly is enabled, don't try to do any reassembly work at all on
a fragment unless we've captured all the data in the fragment and (in
IPv4 and CLNP) it has a valid checksum, so that if the first fragment is
a short frame or a frame with an invalid checksum, we'll treat it as if
reassembly weren't enabled, and will dissect what data we have in it,
rather than not dissecting *any* of the fragments above the IP/CLNP
layer.

svn path=/trunk/; revision=4575
2002-01-20 01:04:18 +00:00
Guy Harris fb1e26fe6a Use the "fragmented" field of the "packet_info" structure in
"dissect_frame()" to indicate whether a ReportedBoundsError was due to
the packet being malformed (i.e., the packet was shorter than it's
supposed to be, so the dissector went past the end trying to extract
fields that were supposed to be there) or due to it not being
reassembled (i.e., the packet was fragmented, and we didn't reassemble
it, but just treated the first fragment as the entire packet, so the
dissector went past the end trying to extract fields that were partially
or completely in fragments after that).  Mark the latter as being
unreasembled rather than malformed.

Properly initialize, save, and restore that field, and properly set it,
so that works.

svn path=/trunk/; revision=4555
2002-01-17 06:29:20 +00:00
Guy Harris 381c21783e As per a comment from Ronnie Sahlberg, display TCP sequence numbers in
the list of segments in a desegmented PDU as unsigned, rather than
signed.

Fix some other displays of unsigned quantities with "%d" while we're at
it.

svn path=/trunk/; revision=4516
2002-01-10 11:27:57 +00:00
Guy Harris 8053f4839a Make "dscp_vals[]" a "const" array again.
svn path=/trunk/; revision=4460
2001-12-29 22:01:11 +00:00
Ashok Narayanan b18512d444 Changes to RSVP:
- Cleaned up TSpec and Flowspec support to handle multiple parameters
- Added support for Compression Hint (RFC3006)
- Added support for DCLASS (RFC2996)
- Corrected some bugs in support for Null Service (RFC2997)

svn path=/trunk/; revision=4459
2001-12-29 00:43:55 +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 75cc056222 Attach a descriptive name field type and base to dissector tables; that
specifies how the selector values used as keys in those tables are to be
displayed, and the title to use when displaying the table.

Use that information in the code to display the initial and current
entries of various dissector tables.

Have the dissector for BACnet APDUs register itself by name, and have
the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set,
rather than doing it with a dissector table.

svn path=/trunk/; revision=4358
2001-12-08 06:41:48 +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 8eba148155 An NLPID of 1 means T.70 when used as an X.263/ISO 9577 initial protocol
identifier, but means X.29 when used as an X.263/ISO 9577 secondary
protocol identifier.

Add support for the IPv6 NLPID, and Ethernet type, in more places.

Fix up the handling of the user data of a CALL REQUEST packet to more
correctly distinguish between user data containing an NLPID and user
data containing an X.264/ISO 11570 UN TPDU.  If it's an NLPID, use
"nlpid_vals" to show its value.

Put that user data in a subtree.

Create a new "x.25.spi" dissector table, for protocols running atop
X.25, rather than having a built-in switch statement, so that other
protocols can register themselves by NLPID.

svn path=/trunk/; revision=4300
2001-12-02 00:07:46 +00:00
Ed Warnicke fcd5b352af Moved from using dissect_data() to using call_dissector()
svn path=/trunk/; revision=4269
2001-11-26 04:52:51 +00:00
Guy Harris bd90493d46 If we have to worry about subdissectors changing the "packet_info"
structure, we may have to worry about it in more places than the places
that *used* to set "pi.len" and "pi.captured_len", so there's no point
in just saving and restoring it there.  We'll remove those
saves/restores, and worry about saves and restores when we find a
problem.

svn path=/trunk/; revision=4245
2001-11-21 21:37:26 +00:00
Guy Harris 2f10c7f630 Get rid of the "len" and "captured_len" members of the "packet_info"
structure; they're no longer used.

svn path=/trunk/; revision=4236
2001-11-20 22:29:07 +00:00
Guy Harris e8d4f4f0ac Make the capture routines take an additional argument giving the amount
of packet data captured.

Make the "BYTES_ARE_IN_FRAME()" macro take a "captured length of the
packet" argument.

Add some length checks to capture routines.

svn path=/trunk/; revision=4235
2001-11-20 21:59:18 +00:00
Guy Harris 4a5538085f Get rid of NullTVB, the "compat_top_tvb" member of the "packet_info"
structure, the check for a null tvbuff pointer in "alloc_field_info()",
and the "tvb_create_from_top()" macro; they're no longer needed, as
there's no non-tvbuffified dissector code remaining.

svn path=/trunk/; revision=4205
2001-11-15 10:58:51 +00:00
Guy Harris bb113a607b Support for Mobile IP's use of ICMP Router Advertisements, from David
Frascone.

Small white-space fix.

Display the preference level in router advertisements as signed, not
unsigned, as per RFC 1256, which says it's a "signed, twos-complement
value".

svn path=/trunk/; revision=4118
2001-10-31 22:03:53 +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 c10166c5d0 Get rid of some unused variables.
svn path=/trunk/; revision=3744
2001-07-20 07:11:57 +00:00
Guy Harris 556a11ad45 Create a routine to do the tvbuff-length-adjusting and
"pinfo->{len,captured_len}"-adjusting currently done by the IP
dissector, make the IP dissector call that rather than doing the work
itself, make the IPv6 dissector call that rather than just adjusting the
tvbuff length itself, and make the IPX dissector call that rather than
just adjusting "pi.{len,captured_len}" itself.

This cleans things up a bit, and causes trailers to be properly reported
in IPX-over-Ethernet frames.

svn path=/trunk/; revision=3621
2001-06-29 09:46:54 +00:00
Guy Harris 8c52d3db75 More signed vs. unsigned cleanups, and initialization cleanups, from
Joerg Mayer.

svn path=/trunk/; revision=3578
2001-06-19 23:08:57 +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 c904473c8e Don't display the data portion of an ER NPDU - we dissect it as a CLNP
PDU.

svn path=/trunk/; revision=3527
2001-06-08 08:29:15 +00:00
Guy Harris c9da803a08 Move the fragment reassembly code into "reassemble.c" and
"reassemble.h", and remove IPv4 dependencies from it.

Use it for OSI CLNP segment reassembly as well.

svn path=/trunk/; revision=3525
2001-06-08 06:27:16 +00:00
Guy Harris 36efcd0364 There is no string value assigned to the "ip.fragment.error",
"ip.fragment", and "ip.fragments" fields, so make them FT_NONE, not
FT_STRING.  (Otherwise, if you try to do a "Match Selected" on them, we
dump core because the value is a null pointer and we try to dereference
it.)

svn path=/trunk/; revision=3512
2001-06-05 05:54:14 +00:00
Gerald Combs 5500c09923 Add tree summary information similar to what's in packet-tcp.c.
svn path=/trunk/; revision=3436
2001-05-23 03:33:59 +00:00
Guy Harris 724c494b70 Rewritten IGMP dissector, from Ronnie Sahlberg.
svn path=/trunk/; revision=3426
2001-05-20 22:20:33 +00:00
Guy Harris d93fa98b6e IP fragment reassembly, from Ronnie Sahlberg.
svn path=/trunk/; revision=3324
2001-04-18 04:53:51 +00:00
Guy Harris c5aaac7823 Move the declaration of "ipprotostr()" out of "epan/packet.h" into a new
"ipproto.h" header file.

svn path=/trunk/; revision=3313
2001-04-17 06:29:14 +00:00
Guy Harris d8f688ea26 Use "proto_tree_add_boolean_hidden()", not
"proto_tree_add_item_hidden()", to add the "checksum bad" flags to
packets; the value should be "TRUE", not the numerical value of the
checksum field.

svn path=/trunk/; revision=3202
2001-03-28 21:33:31 +00:00
Guy Harris 28531d2efd If the IP header length is < 20, don't try to dissect the header (other
than, well, dissecting the header length field), just show the packet
has having a bogus IP header length.

svn path=/trunk/; revision=3198
2001-03-28 06:20:22 +00:00
Guy Harris 7ecac8fbd0 Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.

Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP.  Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address.  Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.

Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".

Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors.  Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names.  Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.

svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00