Commit graph

7422 commits

Author SHA1 Message Date
Guy Harris
9dd8bbe38e Put entries for a reassembled packet into the appropriate hash table for
all of the frames that make it up, so Ethereal can show, for all but the
final frame, the frame in which it was reassembled.  (Tethereal can't,
as it's a one-pass program.)

svn path=/trunk/; revision=7511
2003-04-20 08:40:45 +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
Gerald Combs
56cd2c741b Under Solaris, strlen() segfaults if you pass it a NULL. Replace all of the
NULL blurbs in the hf_register_info definition with empty strings.

svn path=/trunk/; revision=7509
2003-04-20 01:14:42 +00:00
Guy Harris
8140efea8e Add a "fragment_add_multiple_ok()" routine that skips the check for a
fragment having been added already.  In protocols using the ONC
RPC-over-TCP record-marking mechanism (RPC-over-TCP and NDMP), there can
be more than one record-marking-layer fragment in a single TCP segment,
and thus can be more than one fragment in a frame being added to a given
higher-level packet.

svn path=/trunk/; revision=7508
2003-04-20 00:27:29 +00:00
Guy Harris
ea29d0768a Use "fragment_add_check()" for IPv6 and CLNP reassembly. (Possibly an
issue for CLNP, with its 16-bit IDs, which could be duplicated in a
sufficiently large capture even if CLNP implementations don't
deliberately reuse IDs; less of an issue for IPv6, with its 32-bit IDs
and with its prohibition on reuse:

   For every packet that is to be fragmented, the source node generates
   an Identification value. The Identification must be different than
   that of any other fragmented packet sent recently* with the same
   Source Address and Destination Address.  If a Routing header is
   present, the Destination Address of concern is that of the final
   destination.

      * "recently" means within the maximum likely lifetime of a packet,
        including transit time from source to destination and time spent
        awaiting reassembly with other fragments of the same packet.
        However, it is not required that a source node know the maximum
        packet lifetime.  Rather, it is assumed that the requirement can
        be met by maintaining the Identification value as a simple, 32-
        bit, "wrap-around" counter, incremented each time a packet must
        be fragmented.  It is an implementation choice whether to
        maintain a single counter for the node or multiple counters,
        e.g., one for each of the node's possible source addresses, or
        one for each active (source address, destination address)
        combination.

but perhaps we'll ultimately be able to get rid of the old
"fragment_add()" entirely and rename "fragment_add_check()" to
"fragment_add()").

svn path=/trunk/; revision=7507
2003-04-20 00:21:17 +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
Michael Tüxen
d067b0e361 change my e-mail address.
svn path=/trunk/; revision=7505
2003-04-19 20:21:49 +00:00
Michael Tüxen
f9dcb193a1 - a 'quick hack' for col_set_fence support for better INOF column handling (a new version
of the SCTP dissector is in development...)
- change of my e-mail address.

svn path=/trunk/; revision=7504
2003-04-19 20:16:18 +00:00
Michael Tüxen
7535bb2016 - added better handling of the INFO column using col_set_fence.
- changed my e-mail.

svn path=/trunk/; revision=7503
2003-04-19 20:14:35 +00:00
Michael Tüxen
d8b05d1729 - add better INFO column handling using col_set_fence.
- change my e-mail.

svn path=/trunk/; revision=7502
2003-04-19 20:13:23 +00:00
Michael Tüxen
2f420ebf71 - add a col_set_fence call
svn path=/trunk/; revision=7501
2003-04-19 20:10:49 +00:00
Michael Tüxen
58c20781a0 - add INFO column stuff using fence.
- change my e-mail address

svn path=/trunk/; revision=7500
2003-04-19 20:09:00 +00:00
Guy Harris
9cd871da88 Run strings through "format_text()" before putting them into items in
the protocol tree.

Give SMUX filterable fields for the version and PDU type.

svn path=/trunk/; revision=7499
2003-04-19 09:45:25 +00:00
Guy Harris
d735ac10cc The first element in a fragment list isn't a fragment, it's a special
entry for the reassembled packet; don't look at it when checking to see
if we've already seen a fragment (its "frame" field isn't initialized,
so we shouldn't check it in any case).

svn path=/trunk/; revision=7498
2003-04-19 09:42:53 +00:00
Guy Harris
e0e6edf0e8 Squelch a compiler warning.
svn path=/trunk/; revision=7497
2003-04-19 06:04:58 +00:00
Guy Harris
d2afac6513 Fix a typo.
svn path=/trunk/; revision=7496
2003-04-19 06:04:20 +00:00
Guy Harris
02f45277ed From Thierry Andry: more filterable fields in SNMP.
svn path=/trunk/; revision=7495
2003-04-18 21:05:52 +00:00
Guy Harris
d09e8e93a7 Show metrics in ARP and RTP as ticks and seconds.
An RTP information type of 0 is an update.

The compatibility flags are a bunch of flag bits; show them as such.

Fix some bitfield strings.

Sequence numbers in RTP are 4 bytes, not 2 bytes.

svn path=/trunk/; revision=7494
2003-04-18 19:57:30 +00:00
Richard Sharpe
15a665d461 Add some comments about the 0x10 bit in the Flags field of an NTcreate&X.
svn path=/trunk/; revision=7493
2003-04-18 18:07:50 +00:00
Guy Harris
fdabc787ad 0x06 appears to be an opcode for VRTP redirects.
SRTP requests don't look the way the stuff I found appears to say they
look.

Fix some incorrect uses of "tvb_get_ntohl()" to fetch 16-bit values to
use "tvb_get_ntohs()" instead.

Fix some strings for flag bits.

svn path=/trunk/; revision=7492
2003-04-18 17:34:37 +00:00
Guy Harris
e8a340e46b Dissect non-sequenced RTP and ARP, and dissect more of sequenced RTP.
Add Vines Echo.

Add some additional class values.

Use the length field in the Vines IP header to set the length of the
packet.

Adjust the byte order of all multi-byte integer fields in the IPC and
SPP headers.

svn path=/trunk/; revision=7491
2003-04-18 09:31:00 +00:00
Ronnie Sahlberg
4014f31bb7 Fix a problem where the RPC tap would not be called
if the PDU was short.

This was most noticeable in NFS Read Replies not generating tap events and
thus NFS RTT statistics did not count the Read procedure.

svn path=/trunk/; revision=7490
2003-04-18 06:34:42 +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
Guy Harris
28af7d2f8f From Stephen Shelley: in the NSIS installer build, use the NET_SNMP_DIR
definition in config.nmake, rather than force the builder to update the
NSIS config file by hand.

svn path=/trunk/; revision=7488
2003-04-18 04:46:38 +00:00
Guy Harris
a5e8c99294 From Stephen Shelley: remove a TODO comment that describes stuff that's
been done.

svn path=/trunk/; revision=7487
2003-04-18 04:45:00 +00:00
Guy Harris
9274527286 In Vines ARP Assignment Response packets, put the address being assigned
in the Info column.

svn path=/trunk/; revision=7486
2003-04-18 04:28:07 +00:00
Guy Harris
31db598238 Handle non-SNAP LLC Vines packets as such when capturing.
svn path=/trunk/; revision=7485
2003-04-18 03:41:39 +00:00
Guy Harris
d717e90748 Add support for Vines ICP.
svn path=/trunk/; revision=7484
2003-04-18 03:40:49 +00:00
Guy Harris
6c5f3ed9c2 Add support for VINES SRTP (and a stub dissector for RTP).
svn path=/trunk/; revision=7483
2003-04-18 03:00:28 +00:00
Guy Harris
a52b79ca98 Add VINES ARP support.
Shuffle the routines for subprotocols of VINES ARP into numerical order
by protocol number.

The 32-bit net/16-bit subnet fields in the VINES IP header structure
doesn't work, as the net has to be aligned on a 32-bit boundary; replace
it with a 6-byte address field.

svn path=/trunk/; revision=7482
2003-04-18 01:47:52 +00:00
Guy Harris
2020b91759 Add support for Vines IPC.
Dissect the transport control field differently for broadcast packets.

svn path=/trunk/; revision=7481
2003-04-18 00:32:47 +00:00
Guy Harris
197b9b228b Add a heuristic dissector table to Vines SPP, use it for dissecting SPP
data packets, and register the SMB dissector with it.

Dissect the Control field of SPP packets.

svn path=/trunk/; revision=7480
2003-04-17 20:30:43 +00:00
Guy Harris
044d4ae7e0 Add support for VINES-over-802.2 LLC.
Show the meaning of most of the bits in the transport control field.

Show lengths, windows, sequence numbers, and the like in decimal (that's
how Sniffer Pro shows them).

svn path=/trunk/; revision=7479
2003-04-17 19:10:17 +00:00
Ronnie Sahlberg
379298f77f Add a small extra check in fragment_add() to make it idempotent.
This solves a problem introduced by the recent rewrite of dcerpc-over-smb
reassembly which caused the last fragment for each dcerpc pdu to be duplicated and flagged as overlapping fragment.

This

svn path=/trunk/; revision=7478
2003-04-17 10:31:35 +00:00
Guy Harris
4eae58408c Regularize the Protocol column setting and protocol names, and put the
SPP packet type in the Info column rather than the Protocol column.

Give the Vines protocol number field a value_string table.

Nobody asks for the Vines IP dissector by name, so it doesn't have to be
registered by name.

svn path=/trunk/; revision=7477
2003-04-17 08:25:11 +00:00
Guy Harris
8c06187052 Update a URL, and note that the Open Group publications are now
available for free download.

svn path=/trunk/; revision=7476
2003-04-17 07:55:42 +00:00
Guy Harris
911f43b874 Use "tvb_ensure_length_remaining()" when checking how much data there is
in the packet when doing reassembly checks, as is done in other places
where we do TCP segment reassembly.

The return value of "tvb_reported_length_remaining()" can be negative -
it's a "gint"; assign it to a "gint", so that if we go past the end of
the packet in the main loop, we break out of that loop (and do so
elsewhere, just for cleanliness' sake).

Get rid the check in the loop to make sure we make no more than 20
iterations - all the routines that parse packets should either advance
the offset by at least one byte or return a "desegmentation required"
indication; the former means we make progress and eventually exit the
loop, the latter means we immediately exit the loop.

Use "int" variables, not "guint" variables, for packet offsets.

svn path=/trunk/; revision=7475
2003-04-17 07:39:18 +00:00
Guy Harris
9dcf00fe5c Support SMB as one of the protocols that can run over OSI COTP.
svn path=/trunk/; revision=7474
2003-04-17 00:13:26 +00:00
Guy Harris
f57545cca6 When processing the device identification page of vital product data,
check, for each item, when it's past the end of the page before putting
it into the protocol tree, and advance the offset through the page as we
do so.

If the identifier codeset is ASCII, display the item as text rather than
as binary data.

svn path=/trunk/; revision=7473
2003-04-16 19:43:11 +00:00
Guy Harris
9137608763 From Olivier Biot: add more (WB)XML DTDs from WINA.
svn path=/trunk/; revision=7472
2003-04-16 18:29:38 +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
Ronnie Sahlberg
b7931e40fd Register RPC as dissector for both TCP and UDP port 111 which is used by ONC-RPC/PORTMAPPER
The reason for doing this is to allow a user to pick RPC as a protocol offered
by DecodeAs...

Why:
If ethereal has tcp-reseembly enabled, the heuristic dissector for rpc will not even attempt to find RPC packets.
If no PORTMAPPER/GETPORT are available either in the capture there is
currently no way for ethereal to know/learn that the conversation is ONC-RPC.
This at least will allow users to manually tell ethereal that such a conversation is ONC-RPC.

svn path=/trunk/; revision=7470
2003-04-16 12:15:06 +00:00
Guy Harris
7ddca7ecaf From Lars Roland:
Add Response-Time statistics for each known mgcp message-type.

	Fix a few bugs and remove trailing whitespace.

	Use "gdouble" for printing time-values and calculating the
	average.  It is easier to use and shouldn't overflow on big
	trace files like "guint32".

	Move some functions for time statistics into the new file
	timestats.c in the main directory.  This code may be useful in
	the rpc and smb rtt-taps as well.

svn path=/trunk/; revision=7469
2003-04-16 07:25:12 +00:00
Guy Harris
f17519118c From Stephen Shelley: full payload dissection of compliance levels 0, 1
and 2 function codes for Modbus/TCP, plus some bug fixes.

Use value_string tables to map function codes and exception codes to
strings.

svn path=/trunk/; revision=7468
2003-04-16 06:57:38 +00:00
Guy Harris
2678786425 Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".

svn path=/trunk/; revision=7467
2003-04-16 05:55:41 +00:00
Guy Harris
24ec2110d1 Add the notion of a "fence" to columns. A dissector can set the fence
to "protect" what's currently in the column, so that attempts to clear
the column will only clear stuff after the fence and attempts to
overwrite the column will append stuff after the fence.  This, for
example, allows a dissector to arrange that the Info column contain
information for its protocol and for protocols running atop it.

svn path=/trunk/; revision=7466
2003-04-16 04:52:55 +00:00
Guy Harris
77923868c9 Don't format a string into a buffer with "snprintf()" and then use
"col_add_str()" to put it in the Info column, do the formatting with
"col_add_fstr()".

svn path=/trunk/; revision=7465
2003-04-15 22:07:21 +00:00
Guy Harris
e884881f24 Have separate fields for the COTP and CLTP PDU types.
Don't use "proto_tree_add_uint_format()" for the source and destination
reference fields, use "proto_tree_add_uint()".  Rename the field to make
that work.

Shuffle some stuff around to clean it up.

svn path=/trunk/; revision=7464
2003-04-15 21:33:26 +00:00
Guy Harris
8b1339c7fc From Laurent Meyer: add filterable fields to COTP.
svn path=/trunk/; revision=7463
2003-04-15 10:25:55 +00:00
Guy Harris
e04f6f760a Put in a comment noting that the reassembly code assumes subdissectors
are idempotent, which isn't necessarily the case.

svn path=/trunk/; revision=7462
2003-04-15 09:23:42 +00:00