Commit Graph

202 Commits

Author SHA1 Message Date
Guy Harris d52569bdb9 From Nick Black: the 0x8000 bit in the flags field is *NOT* a
"congestion" bit for ECN.  Show it as a reserved bit.

Put semicolons, not commas, at the end of the calls to put flags field
bits into the protocol tree.

svn path=/trunk/; revision=10087
2004-02-18 06:43:01 +00:00
Ronnie Sahlberg a2e3a35f06 Change the strings shown for ICMP TTL exceeded to match the wording in the standard
svn path=/trunk/; revision=8955
2003-11-13 08:16:52 +00:00
Guy Harris a4d463d3f8 From Giles Scott: make some items in the ICMP protocol tree named fields.
svn path=/trunk/; revision=8710
2003-10-15 22:00:02 +00:00
Guy Harris c8ea407526 Set "addr" before using it, regardless of whether "ip_summary_in_tree"
is set or not.  Copy the destination address, not the source address,
when processing the destination address.

svn path=/trunk/; revision=8314
2003-08-29 22:15:19 +00:00
Gerald Combs 9685960b40 Copy the source and destination addresses into a guint32, so that we don't
bus error on RISC systems.

svn path=/trunk/; revision=8304
2003-08-29 01:57:37 +00:00
Guy Harris a224698042 Make "process_reassembled_data()" do the check for fragmentation not
being complete and for fragmentation being trivial (i.e., the packet in
question is both the first and last fragment).  Have its callers *not*
do that check - this lets "process_reassembled_data()" put in the
"Reassembled in" item for fragments other than the last fragment.

Add a "Reassembled in" field to TDS.

svn path=/trunk/; revision=8295
2003-08-28 04:19:29 +00:00
Guy Harris e766fc1c2c Pass the pointer in the "data" field of the destination address, not a
pointer to that pointer, to "ip_to_str()".

svn path=/trunk/; revision=8273
2003-08-26 19:41:09 +00:00
Ronnie Sahlberg ba74395cbe New feature. Statistics/EndpointTalkjers can now present a sortable table with a list of all seen conversations of a certain type.
Supported types are Ethernet/TokenRing/IP/UDP and TCP.
Will add FibreChannel soon.

The framework for this feature needs to be enhanced in the future so that by selecting one entry and click the right mousebutton, this will bring up a menu with  Prepare/Match options  with suboptions for AnyDirection, ForwardOnly or ReverseOnly   which updates the display filter accordingly.

Had to update some of the taps as well to change them to use a proper address structure for the address fields.
We should now be able to to these stats correctly even for ip tunneled over ip tunnelled over ip ...

svn path=/trunk/; revision=8222
2003-08-23 09:09:35 +00:00
Guy Harris 0c88f96ca0 Add a routine "dissect_ipv6_options()" that works like
"dissect_ip_tcp_options()" but for options that are like IPv6 options
(i.e., the length byte has a value that doesn't include the option code
or length byte).

Add an "ip_opts.h" header to declare it, and move the declaration of
stuff used by it and "dissect_ip_tcp_options()", and the declaration of
"dissect_ip_tcp_options()", to that header.

Use "dissect_ipv6_options()" for Mobile IPv6 options.

Get rid of the unused "mip6_opt_types[]" array in "packet-mip6.h".

svn path=/trunk/; revision=8015
2003-07-11 09:30:49 +00:00
Tim Potter 0e2d9b4341 Removed duplicate definitions of flags_set_truth.
svn path=/trunk/; revision=8001
2003-07-09 05:37:47 +00:00
Guy Harris ea0065c234 Frame numbers are unsigned.
svn path=/trunk/; revision=7794
2003-06-05 22:23:57 +00:00
Guy Harris 74e3d695fc Don't export "ip_dissector_table" explicitly; now that we have
"find_dissector_table()", have the IPv6 and IPSEC dissectors fetch the
IP dissector table by name.

svn path=/trunk/; revision=7600
2003-04-29 17:24:35 +00:00
Guy Harris d359286841 Add a pointer to an hf_ value for a "reassembled_in" field (which can be
null) to the "fragment_items" structure, and don't pass that value into
"process_reassembled_data()", just have it use the value in the
"fragment_items" structure passed to it.

Make "process_reassembled_data()" capable of handling reassembly done by
"fragment_add_seq_check()", and use it in the ATP and 802.11 dissectors;
give them "reassembled_in" fields.  Make "process_reassembled_data()"
handle only the case of a completed reassembly (fd_head != NULL) so that
we can use it in those dissectors without gunking the code up too much.

svn path=/trunk/; revision=7513
2003-04-20 11:36:16 +00:00
Guy Harris 87dfb09b12 Pull much of the processing done after a call to "fragment_add_check()"
into a subroutine, for use in other dissectors.

Use it in the IPv6 and CLNP dissectors.

svn path=/trunk/; revision=7510
2003-04-20 08:06:01 +00:00
Guy Harris 0def9a0b52 We can't use the frame_data structure as a key structure when looking
for reassembled frames - in Tethereal, there's only one frame_data
structure used for all frames.  Instead, use the frame number itself as
the key.

Add a "fragment_add_check()" routine, for fragments where there's a
fragment offset rather than a fragment sequence number, which does the
same sort of thing as "fragment_add_seq_check()" - i.e., once reassembly
is done, it puts the reassembled fragment into a separate hash table, so
that there're only incomplete reassemblies in the fragment hash table.
That's necessary in order to handle cases where the packet ID field can
be reused.

Use that routine for IPv4 fragment reassembly - IP IDs can be reused (in
fact, RFC 791 suggests that doing so might be a feature:

    It is appropriate for some higher level protocols to choose the
    identifier. For example, TCP protocol modules may retransmit an
    identical TCP segment, and the probability for correct reception
    would be enhanced if the retransmission carried the same identifier
    as the original transmission since fragments of either datagram
    could be used to construct a correct TCP segment.

and RFC 1122 says that it's permitted to do so, although it also says
"we believe that retransmitting the same Identification field is not
useful":

         3.2.1.5  Identification: RFC-791 Section 3.2

            When sending an identical copy of an earlier datagram, a
            host MAY optionally retain the same Identification field in
            the copy.

            DISCUSSION:
                 Some Internet protocol experts have maintained that
                 when a host sends an identical copy of an earlier
                 datagram, the new copy should contain the same
                 Identification value as the original.  There are two
                 suggested advantages:  (1) if the datagrams are
                 fragmented and some of the fragments are lost, the
                 receiver may be able to reconstruct a complete datagram
                 from fragments of the original and the copies; (2) a
                 congested gateway might use the IP Identification field
                 (and Fragment Offset) to discard duplicate datagrams
                 from the queue.

                 However, the observed patterns of datagram loss in the
                 Internet do not favor the probability of retransmitted
                 fragments filling reassembly gaps, while other
                 mechanisms (e.g., TCP repacketizing upon
                 retransmission) tend to prevent retransmission of an
                 identical datagram [IP:9].  Therefore, we believe that
                 retransmitting the same Identification field is not
                 useful.  Also, a connectionless transport protocol like
                 UDP would require the cooperation of the application
                 programs to retain the same Identification value in
                 identical datagrams.

and, in any case, I've seen that in at least one capture, and it
confuses the current reassembly code).

Unfortunately, that means that fragments other than the last fragment
can't be tagged with the frame number in which the reassembly was done;
see the comment in packet-ip.c for a discussion of that problem.

svn path=/trunk/; revision=7506
2003-04-20 00:11:28 +00:00
Ronnie Sahlberg 37e401385c Update the ip fragment reassembly so that the subdissector is only
called from the frame where the ip packet was reassembled instead of from each fragment.

For fragments, put [Reassembled in #xx] in the summary pane so it is easy
to see which fragments are successfully reassembled and which are not.

For fragments, add a "This fragment is reassembled in:xx" to the tree
pane so and make it FT_FRAMENUM so it is easy to jump top the reassembled ip packet.

svn path=/trunk/; revision=7489
2003-04-18 05:11:44 +00:00
Ronnie Sahlberg 18594809fe Update packet-ip.c to print the identification number in decimal as well as hexadecimal to make it easier to crossreference packets between output from other sniffers that display it in DEC instead of HEX.
Since this value has no human readable meaning it should be displayed in HEX only but make ethereal also display the "wrong" base to enhance human compatibility.

svn path=/trunk/; revision=7471
2003-04-16 12:17:55 +00:00
Guy Harris 9db95664d1 When deciding whether we have enough data in a lower-level packet to
attempt reassembly of a higher-level packet that includes the
lower-level packet, use "tvb_bytes_exist()" to check whether all the
data that's to be included in the reassembly is available, rather than
by checking whether the packet is short.

Add some checks of that sort that were missing.

Use the reported length of the packet when doing reassembly.

Make the "iphdrlen" field of a "packet_info" structure be the length of
the IP header in bytes, not in 4-byte words.

svn path=/trunk/; revision=7274
2003-03-04 06:47:10 +00:00
Ronnie Sahlberg 192d29fa4d Update for tethereal -z io,users, top talkers :
"tcpip" added.

-z io,users,tcpip will create a top talkers list of individual tcpip connections

svn path=/trunk/; revision=7264
2003-03-03 23:20:59 +00:00
Guy Harris 231f28ce08 Panic if a preference starts with the name of the module to which it
belongs, as that's redundant.

Fix a bunch of cases where that was done, and map the old name to the
new name.

Instead of marking "mtp3.mtp3_standard" as obsolete, map it to
"mtp3.standard".

svn path=/trunk/; revision=7030
2003-01-28 23:56:40 +00:00
Guy Harris 8e6518ea60 In the BSDs, ARCNET packets don't have an offset field between the
addresses and the protocol type, as supplied by BPF; on Linux, they *do*
have an offset field, as supplied by PF_PACKET sockets.  Add a new
WTAP_ENCAP_ARCNET_LINUX, with packets that include the offset field, and
don't dissect an offset in WTAP_ENCAP_ARCNET packets.

Map a libpcap link-layer type of 129 to WTAP_ENCAP_ARCNET_LINUX; that
value was recently assigned to Linux-style ARCNET.

Add some more ARCNET protocol IDs.

For most protocol IDs, dissect an ATA 878.2 fragmentation header; don't
do it for RFC 1051 IP and ARP, and Diagnose packets.  Set the length of
the ARCNET protocol tree item appropriately.

Dissect both the RFC 1051 and RFC 1201 styles of IP and ARP over ARCNET,
and dissect the RFC 1201 style of RARP as well.

svn path=/trunk/; revision=6981
2003-01-23 04:04:01 +00:00
Ronnie Sahlberg beab3b6c90 Patch for packet-ip to make it TAPable
svn path=/trunk/; revision=6969
2003-01-22 01:16:33 +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 fa62e3b4d4 When dissecting the packet that gave an ICMP error, save the writability
state of the columns and the current protocol, and restore them when
done.  Also, cache BoundsError and, if we get a BoundsError, restore
them and then re-throw the BoundsError, so we see a "Short Frame"
indication if the frame was cut off by the snapshot length.

svn path=/trunk/; revision=6941
2003-01-19 22:21:01 +00:00
Guy Harris 1372d1c5e0 Don't copy the entire IP header into a structure, extract stuff from it
as you dissect it, so we can dissect packets that are cut short before
the end of an IP header.

Check for an IP total length less than the header length.

svn path=/trunk/; revision=6921
2003-01-14 18:54:29 +00:00
Ronnie Sahlberg e4633bc783 Update reassemble.c/show_item and all callers to use FT_FRAMENUM for the list of packets corresponding to a reassembled pdu
svn path=/trunk/; revision=6807
2002-12-19 11:22:38 +00:00
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