Commit Graph

223 Commits

Author SHA1 Message Date
Ulf Lamping cb24afa0fa fixed various typos
svn path=/trunk/; revision=10220
2004-02-24 17:49:07 +00:00
Ronnie Sahlberg c47f73364b with the cahnges to when to call the heuristic dissector
(and the fact that nbss does not register its conversation)
this caused WANT_PDU_TRACKING to be decremented multiple times between
the dissectors
and thus ethereal could no longer reliably spot SMB PDUs that started in the middle of a tcp segment (unless we do reassembly which we dont do unless we have to since it eats soo many resources)

FIX so that ethereal once again can spot SMB (and other) protocol PDUs that start in the middle of a segment.

svn path=/trunk/; revision=10219
2004-02-24 09:40:38 +00:00
Guy Harris ecac21ab7f Export a "dissect_tcp_payload()" routine from the TCP dissector, for use
by pass-through proxying dissectors such as the SOCKS dissector; it does
the work of processing a TCP segment, including desegmentation.  Export
the "next sequence number" value to subdissectors, so they can use it
when calling "dissect_tcp_payload()".

Use that in the SOCKS dissector.

svn path=/trunk/; revision=9489
2003-12-30 00:03:48 +00:00
Guy Harris 5f003e39db As per Didier Gautheron, dissect TCP options regardless of whether we're
building a protocol tree, so the Info column is set correctly.

svn path=/trunk/; revision=9214
2003-12-09 00:12:38 +00:00
Ronnie Sahlberg a07a627e3f Update to TCP, when we see a SYN|ACK packetm reset base_ack to the current ACK-1 so that it looks right when doing relative sequence numbers.
I.e. SEQ :    seq==0  ack==0
     SEQ|ACK  seq==0  ack==1
     ACK      seq==1  ack==1

This looks much more correct.

This change also fixes the problem reported to ethereal-dev
recently with "Follow TCP Stream" dropping the first character of the stream.

svn path=/trunk/; revision=9034
2003-11-19 09:32:04 +00:00
Guy Harris c3c1e2a7c6 From Lars Roland: the window size passed to
"tcp_analyze_sequence_number()" is a "guint32", as it might be scaled -
make the arugment a "guint32" as well.

svn path=/trunk/; revision=9014
2003-11-18 19:46:41 +00:00
Ronnie Sahlberg f4d65e301e Change the gboolean controlling whether to use TCP Sequence Number Analysis and TCP Relative Sequence Numbers to default to ENABLED
instead of DISABLED.

These features do not consume that much memory or CPU but will greatly enhance the feature set of ethereal.  Make it enabled by default so also those that never venture into the preferences dialog will benefit from it.

svn path=/trunk/; revision=8957
2003-11-13 20:53:44 +00:00
Guy Harris 5808fc130b Make the declaration of "process_tcp_payload()" match the definition.
svn path=/trunk/; revision=8941
2003-11-11 19:24:09 +00:00
Guy Harris 9a4a85aadf Have "decode_tcp_ports()" handle only the handoff to a subdissector -
and have it return TRUE if we succeeded, FALSE otherwise - and have an
internal "process_tcp_payload()" routine handle the (TCP-specific) PDU
tracking and sequence number analysis, with an argument to indicate
whether it should do that or not (i.e., whether it's being handed a TCP
segment or reassembled data).

svn path=/trunk/; revision=8914
2003-11-08 05:47:12 +00:00
Guy Harris b304a75c66 "decode_tcp_ports()" is for use by protocols that proxy transport-layer
packets/sessions, e.g. MSProxy and SOCKS.  It should not cause any of
the TCP-specific stuff such as sequence number analysis or PDU tracking
to be done.  (Actually, MSProxy and SOCKS should offer desegmentation
services *themselves* and do their *own* PDU tracking, rather than just
passing stuff on to "decode_tcp_ports()", but that's another matter.)

Make "tcp_tree" once again be a local variable to "dissect_tcp()", and
pass it as an argument to those functions that use it.

svn path=/trunk/; revision=8912
2003-11-08 00:02:56 +00:00
Ronnie Sahlberg 3a88f0ceba Update to LDAP and TCP
LDAP messages that span multiple segments will throw an exception unless we have reassembly enabled.

Update TCP so that IF an exception was thrown that we still pick up any hints
provided by the subdissector about where the next PDU starts.

Update LDAP so that it will rpovide hints to TCP about where the next LDAP PDU starts in the sequence number space.

Thus now ethereal can find and dissect LDAP PDUs that starts somewhere in the middle of a TCP segment.

svn path=/trunk/; revision=8895
2003-11-06 09:18:46 +00:00
Ronnie Sahlberg 95c969adb8 Fix for TCP.
If we have short or malformed PDUs in protocols above TCP this will generate
an exception and thus some of the stateful things such as keeping track of
and printing the tcp analysis data will be shourcutted and not called.

Add a wrapper around the call to the subdissectors above TCP so that
if an exception is generated we will still catch it and explicitely
call tcp_print_sequence_number_analysis() so that also short packets are
handled well.

svn path=/trunk/; revision=8891
2003-11-06 08:51:21 +00:00
Ronnie Sahlberg a185c70b18 Full duplex analyzers that capture each direction of a link with a separate NIC will lose the time integrity between the two NICs more often than one might expect.
It is thus relatively common that a data segment and its ACK being swapped in the capture file.

Therefore, drop the condition that a segment must not have been acked yet in the detection of OutOfOrder segments.

Second, fix a bug where we didnt keep track of the ack numbers properly for relative sequence number analysis.

svn path=/trunk/; revision=8800
2003-10-28 08:50:39 +00:00
Guy Harris 99331c2fa8 Squelch some signed vs. unsigned comparison warnings.
Get rid of an unused variable.

svn path=/trunk/; revision=8788
2003-10-27 19:34:03 +00:00
Ronnie Sahlberg dde909b9b0 Update / cleanup to tcp sequence number analysis and new features
moved some variables to the structure where they belonged instead of where they
currently were and reduced the complexity of the code

Fast Retransmission:
Ethereal not tries to detect and flag FastRetransmissions:
The heuristics for this check is:
  >=3 dupacks in other direction
  this semgent is what the dupacks are asking for
  it arrived within 10ms of the last dupack (10ms should be short enough to not confuse with real RTOs)

OutOfOrder segments
Previously all segments that did not advance the right edge of the window was flagged as retransmission   now ethereal will try to flag segments that are merely reordered as OutOfOrder segments insteaD

tHE HEURISTICS ARE:
   it has not been ACKed yet
   we have not seen it before
   it arrived within 4ms of the segment immediately to the right in the window

svn path=/trunk/; revision=8775
2003-10-25 00:25:38 +00:00
Ronnie Sahlberg ac5c40390e From Matthijs Melchior
Small change to the TCP sequence number analysis and relative sequence number code
so that it plays a bit nicer with captures generated by text2pcap.

Change the criterion used to initialize the base sequence and ack numbers
to set these base offsets where it detects that the bookkeeping structures are NULL (as in no previous packet seen for this session) instead of using a hardcoded magic number 0, which might actually occur in normal captures.

svn path=/trunk/; revision=8674
2003-10-10 22:52:38 +00:00
Guy Harris 3177fb0722 Don't store the setting of the window scale option unless the "Relative
sequence numbers and window scaling" option is set, as that option says
it controls whether we attempt to display the real post-scaling window
size.

Also, don't store it unless the "Analyze TCP sequence numbers" option is
set, as "Relative sequence numbers and window scaling" requires it,
because, unless "Analyze TCP sequence numbers" is set, we don't set up
conversations for TCP connections and don't have a pool of data
structures for per-connection information into which to store the window
scale option value.

svn path=/trunk/; revision=8490
2003-09-18 19:19:51 +00:00
Ronnie Sahlberg b48de22d5b Enhancement to the TCP dissector:
Track window scaling and display the window field after it has been scaled to its real value

If we have seen a SYN packet with a WindowScalingOption
then if the option to use RelativeSequence numbers has been enabled,
then ethereal will change the presented window field to be the window after it has been scaled to the real value.

This obviously only works if we have seen the SYN packet and if the SYN packet contained a window scaling option

svn path=/trunk/; revision=8461
2003-09-12 05:52:38 +00:00
Ronnie Sahlberg 17eca9b0f2 Cosmetic change to TCP
An ACK to a KeepAlive is not a DupACK.

Detect these ACKs and mark them as KeepAliveACK instead of as DupACK
(or maybe dont mark them at all?   )

At least they shouldnt be marked as DupACKs

svn path=/trunk/; revision=8411
2003-09-08 10:19:06 +00:00
Ronnie Sahlberg 2475b0ed97 If something is a KeepAlive it is just a keepalive and not also a dup ack
svn path=/trunk/; revision=8312
2003-08-29 11:40:24 +00:00
Ronnie Sahlberg 431a30d061 If the FIN flag is set it is NOT a keepalive
fix small typo

svn path=/trunk/; revision=8311
2003-08-29 11:15:13 +00:00
Guy Harris f3d64a2c38 Add a "reassembled in" field.
svn path=/trunk/; revision=8294
2003-08-28 03:35:23 +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 c2150d9d77 From Lars Roland: add a preference to control whether, in the TCP
dissector, heuristic dissectors should be checked before, or after,
dissectors for specific port numbers.

Add a similar preference for UDP.

Clean up white space.

svn path=/trunk/; revision=8082
2003-07-24 21:11:20 +00:00
Guy Harris 836b7ccb6b Clean out the correct hash table.
svn path=/trunk/; revision=8024
2003-07-16 00:04:21 +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
Guy Harris 833b1d2d0d Put in a comment noting that we might not want to process the payload of
a TCP segment, and probably don't want to hand the segment to a TCP tap,
if the TCP segment is included in an error packet.

svn path=/trunk/; revision=7780
2003-06-04 08:45:10 +00:00
Guy Harris 524a84b5e9 If the reported length of the TCP packet is less than the TCP header
length, we can't get the segment length (although we can at least try to
dissect the header).  If that's the case, put in Ronnie's "short
segment" note.

Also, put into the information we pass to TCP taps an indication of
whether the segment length is valid or not.

svn path=/trunk/; revision=7705
2003-05-21 06:28:03 +00:00
Guy Harris 3847052a87 If we're inside an error packet, don't assume we know the length of the
TCP segment, as we might not have the entire segment.

svn path=/trunk/; revision=7704
2003-05-21 05:57:24 +00:00
Guy Harris 5bd844f8b4 If we were handed a fragmented packet, don't do anything that depends on
knowing the actual length of the packet, as we don't know that length
(IP fragments don't contain the length of the full packet - you don't
know how big the reassembled packet is until you reassemble it).

We don't have to worry about dissecting the TCP header in them, though.

svn path=/trunk/; revision=7703
2003-05-21 05:43:27 +00:00
Ronnie Sahlberg 49b51db7f2 Do not decode the full tcp header if the reported length is less than 20
or the reported tcp header length.
This is probably caused either by a very very short capture length or by
nmap or someone playing firewall fragment games to the tcp flags field.

svn path=/trunk/; revision=7698
2003-05-20 10:14:20 +00:00
Ronnie Sahlberg 926c61b11c Update the tcp sequence analysis to understand and decode properly
the rather brilliant keep-alive packets solaris use.

Solaris does not do RFC793 keepalives at all, instead they do a quite
brilliant workalike that gies them reliable keepalives.

svn path=/trunk/; revision=7685
2003-05-16 10:35:19 +00:00
Ronnie Sahlberg cb5e97d49a Update to TCP to handle hints from dissectors where the next PDU may start.
ONCRPC dissector updated to provide hint to TCP where the next RPCoverTCP
PDU starts as example.
Trivial updates to the other TCP based protocols required to amke them handle
this as well.  See the updates to packet-rpc.c as an example.

This is enabled by activating tcp analysis and provides hints to TCP to know where PDUs starts when not aligned to the start of the segment.

svn path=/trunk/; revision=7543
2003-04-23 10:20:29 +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 15fdb273f7 Use FT_FRAMENUM for the "Duplicate to the ACK in frame" and "This is an
ACK to the segment in frame" fields, so you can use the "Go To
Corresponding Frame" menu item.

svn path=/trunk/; revision=7379
2003-03-27 19:55:59 +00:00
Ronnie Sahlberg eb5be58c63 Enhancement to TCP Sequence Analysis
Duplicate ACKs that are detected/suspected are now also flagged
with which frame the original ACK was seen in and the dup ack number.

This is displayed both in the summary pane as well as in the tree pane.

svn path=/trunk/; revision=7375
2003-03-27 09:40:27 +00:00
Ronnie Sahlberg 886cbe2321 Fixed a small bug in tcp sequence number analysis.
FIN flag would previously only add one to the sequence number if the
FIN packet was empty, i.e. did not carry any payload data.

This caused ethereal to incorrectly flag the ACK to such packets
(FIN+payload data) to be incorrectly flagged as
ACK to previously lost segment.

Change the algorithm to always add 1 to the segment length, and thus the sequence number for all packets with teh FIN bit set.

svn path=/trunk/; revision=7371
2003-03-26 08:00:24 +00:00
Guy Harris 05c41a279f Use the reported length, not the captured length, as the fragment length
when doing reassembly.

In some additional places, use "tvb_bytes_exist()" to check whether we
have enough data to do reassembly, rather than checking to see if the
frame is short (it might be short but we might still have enough data to
do reassembly).

In DCE RPC, use the fragment length from the header as the number of
bytes of fragment data.

There's no need to check "pinfo->fragmented" before doing reassembly in
the DCERPC-over-SMB-pipes code - either we have all the data or we
don't.

In SNA and WTP reassembly, add a check to make sure we have all the data
to be reassembled.

svn path=/trunk/; revision=7282
2003-03-05 07:17:50 +00:00
Richard Sharpe 9a57223add Pretty up the handling of SACK. Have tested now, looks OK.
svn path=/trunk/; revision=7273
2003-03-04 04:36:44 +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
Richard Sharpe 8cc3f3f791 Add SACK leftedge and rightedge filtering ... Added them as decimal
values which seemed appropriate, but had the split them into two items
in the option tree.

svn path=/trunk/; revision=7260
2003-03-03 03:16:36 +00:00
Richard Sharpe 49a425956b As suggested by Guy, rather than add_uint_hidden, and then add_text,
do an add_uint_format(...). It was all too easy.

svn path=/trunk/; revision=7259
2003-03-03 02:59:23 +00:00
Richard Sharpe 7195b02fdf Allow filtering on the window scale value ...
svn path=/trunk/; revision=7236
2003-03-01 08:57:36 +00:00
Richard Sharpe 6efccea066 Adding more options support
svn path=/trunk/; revision=7235
2003-03-01 08:51:12 +00:00
Richard Sharpe 2af80f5309 Add tcp.options.mss_val to allow filtering on the value of the MSS option
svn path=/trunk/; revision=7233
2003-03-01 08:28:59 +00:00
Richard Sharpe 40e7a4f08f Some more options, cc and time stamp.
svn path=/trunk/; revision=7232
2003-03-01 07:15:04 +00:00
Richard Sharpe 41f3a9df0c More tcp options stuff ...
svn path=/trunk/; revision=7231
2003-03-01 07:07:07 +00:00
Richard Sharpe e8b4840c75 More TCP Options support
svn path=/trunk/; revision=7230
2003-03-01 05:02:53 +00:00
Richard Sharpe 6470c4a962 Start adding support for options as hidden fields in the dissect tree.
svn path=/trunk/; revision=7228
2003-03-01 04:24:40 +00:00
Guy Harris 4156806b8b From Didier Gautheron: provide a mechanism to indicate why reassembly
wasn't done, and, for TCP, use that mechanism if reassembly isn't done
is an incorrect TCP checksum.

svn path=/trunk/; revision=7212
2003-02-27 03:56:48 +00:00