Commit Graph

223 Commits

Author SHA1 Message Date
Chris Maynard b4ce593083 Don't call expert_add_info_format() from within an "if (tree)" block. Fixes bug 6198. Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6198
svn path=/trunk/; revision=38339
2011-08-04 17:49:57 +00:00
Stig Bjørlykke 3cead1e9df Removed a debug printf.
svn path=/trunk/; revision=38331
2011-08-04 10:02:37 +00:00
Gerald Combs 6d8c52e6a5 From Dirk Jagdmann via bug 6194:
The attachted patch fixes and enhances the SCPS TCP option dissection. Changes
are:

- fix order of reserved Bit 1,2,3
- fix minimum TCP option length
- fix proto items
- add proto item for Connection ID
- removed the verify_scps() function. It's logic was broken, because it did
reset the scps_capable flag on both flows if one of them did not have it.
However sometimes that flag is only enabled in one flow direction and that flow
direction could see TCP options later on, which would get dissected as invalid.
See the attachted capture file for an example.

svn path=/trunk/; revision=38326
2011-08-03 19:11:07 +00:00
Anders Broman 3e2aa69b02 From Edwin Groothuis:
Add preference to Mute noise of TCP Timestamp Option in the summary line.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6162

svn path=/trunk/; revision=38232
2011-07-28 05:42:25 +00:00
Bill Meier dfb996beb4 Fix a benign bug in the patch from Bug #5795.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5795

svn path=/trunk/; revision=38192
2011-07-24 21:03:01 +00:00
Bill Meier 8ec1ed9fea Commit missing parts of Bug #5795 patch (those not committed in SVN 38175 & 38176).
(See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5795)


svn path=/trunk/; revision=38190
2011-07-24 20:48:57 +00:00
Alexis La Goutte 20aefe36c7 Wrong patch commit in Rev38175...
Fix :
packet-tcp.c:3337: error: ‘dissect_tcpopt_maxseg’ undeclared here (not in a function)
packet-tcp.c:2264: error: ‘dissec_tcpopt_exp’ defined but not used

svn path=/trunk/; revision=38176
2011-07-23 16:31:10 +00:00
Alexis La Goutte a880ea378d From Edwin Groothuis via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5795
Add TCP Options support for #253, #254 (experimental), expand MSS / SACKPERM view, add hidden TCP Option Kind/Length to all

svn path=/trunk/; revision=38175
2011-07-23 16:13:05 +00:00
Sake Blok 796564ed90 Repair "Follow TCP Stream" which got broken by my change in SVN 38056
Mental note: Try to not do half work ;-)


svn path=/trunk/; revision=38065
2011-07-17 11:08:02 +00:00
Sake Blok d00167886f Stop using the conversation index for tcp stream values as the gaps in the numbering is causing to many questions. Also, numbering could be different for the same file when viewed on different Wireshark versions, which could lead to confusion too.
(see also: http://ask.wireshark.org/questions/5056/how-does-wireshark-calculate-the-tcp-stream-index)

svn path=/trunk/; revision=38056
2011-07-15 23:40:16 +00:00
Anders Broman 0c812dbe61 From György Szaniszló:
Introduced a new tcp state variable: maxseqtobeacked, this is the
maximum seq number that can be acked by the rev party in normal case.
This new state variable only serves the proper detection of
tcp.analysis.ack_lost_segment indicator, and decouples it from the detection of
tcp.analysis.lost_segment indicator.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6081

svn path=/trunk/; revision=37922
2011-07-06 15:45:56 +00:00
Chris Maynard 5f2f261f52 Since the TCP Flags tree encompasses 12 bits including the 3 reserved bits and
the nonce bit, we should display 3 nibbles on the Flags summary line in order
to represent all flag bits.  While arguably we need not worry about reserved
bits, the nonce bit is not currently represented, so that bit alone pushes us
into the next nibble.


svn path=/trunk/; revision=37856
2011-07-01 19:40:35 +00:00
Chris Maynard 220341f369 I decode_tcp_ports(), don't abort processing zero window probe packets, even if the payload is only a single byte. Also, for the keep-alives, display any payload that might be present.
svn path=/trunk/; revision=37854
2011-07-01 19:17:02 +00:00
Chris Maynard d927b60f21 Initialize the TCP windows to the maximum value instead of 0 to avoid false zero window conditions, especially at the beginning of a capture or if only one side of a conversation is captured. This resolves bug 4716: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4716.
svn path=/trunk/; revision=37853
2011-07-01 19:00:14 +00:00
Chris Maynard e27a75ac39 Indicate TCP fast retransmissions as an expert info note, rather than a warning,just as TCP retransmissions are. This was a user request from Sharkfest '11.
svn path=/trunk/; revision=37834
2011-06-29 16:59:37 +00:00
Sake Blok de4354d05d Show and and a filter to non-zero ACK numbers and URG pointers whenever their respective flags are not set. As discussed at Sharkfest with Laura Chappell (OK Laura, go ahead and create some more butt-ugly filters now!).
svn path=/trunk/; revision=37721
2011-06-19 20:39:08 +00:00
Jakub Zawadzki 38c2f2a151 Cleanup: replace sizeof(arr)/sizeof(arr[0]) with shorter array_length(arr)
svn path=/trunk/; revision=36986
2011-05-04 19:32:35 +00:00
Guy Harris 71b31d92fc Store the frame_data structures in a tree, rather than a linked list.
This lets us get rid of the per-frame_data-structure prev and next
pointers, saving memory (at least according to Activity Monitor's report
of the virtual address space size on my Snow Leopard machine, it's a
noticeable saving), and lets us look up frame_data structures by frame
number in O(log2(number of frames)) time rather than O(number of frames)
time.  It seems to take more CPU time when reading in the file, but
seems to go from "finished reading in all the packets" to "displaying
the packets" faster and seems to free up the frame_data structures
faster when closing the file.

It *is* doing more copying, currently, as we now don't allocate the
frame_data structure until after the packet has passed the read filter,
so that might account for the additional CPU time.

(Oh, and, for what it's worth, on an LP64 platform, a frame_data
structure is exactly 128 bytes long.  However, there's more stuff to
remove, so the power-of-2 size is not guaranteed to remain, and it's not
a power-of-2 size on an ILP32 platform.)

It also means we don't need GLib 2.10 or later for the two-pass mode in
TShark.

It also means some code in the TCP dissector that was checking
pinfo->fd->next to see if it's NULL, in order to see if this is the last
packet in the file, no longer works, but that wasn't guaranteed to work
anyway:

	we might be doing a one-pass read through the capture in TShark;

	we might be dissecting the frame while we're reading in the
	packets for the first time in Wireshark;

	we might be doing a live capture in Wireshark;

in which case packets might be prematurely considered "the last packet".
#if 0 the no-longer-working tests, pending figuring out a better way of
doing it.

svn path=/trunk/; revision=36849
2011-04-25 19:01:05 +00:00
Stephen Fisher 6ad633b043 Fix various warnings found by clang 3.0 (trunk 129935) complier:
- Extraneous parentheses

- Use _U_ for unused function parameters instead of assigning the variable
  to itself 


svn path=/trunk/; revision=36826
2011-04-22 18:04:26 +00:00
Gerald Combs 033366bda6 From Edwin Groothuis via bug 5813:
In the explanation of TCP Option 78 (Riverbed Transparency), the labels
are "CSH IP Addr/Port" and "SSH IP Addr/Port". This should be "Src SH IP
Addr/Port" and "Dst SH IP Addr/Port".
The filter keys for these labels are correct.

svn path=/trunk/; revision=36667
2011-04-16 16:45:38 +00:00
Bill Meier 9b36f03fc9 Don't assign to a proto_item * if the value won't be used: Coverity 1054-1056.
svn path=/trunk/; revision=36631
2011-04-13 21:27:08 +00:00
Chris Maynard 39013df13f Allow TCP segment data to be filterable via "tcp.data".
svn path=/trunk/; revision=36629
2011-04-13 18:15:41 +00:00
Stig Bjørlykke 8d62b393a4 Register tcp by name.
To be used in User DLT's and Lua scripts.

svn path=/trunk/; revision=36414
2011-03-31 12:18:14 +00:00
Jeff Morriss 5e1b6cf408 Reword the comments from rev 36304.
Replace the tabs in the file (mostly added by me) with spaces (for consistency).

svn path=/trunk/; revision=36338
2011-03-25 22:20:27 +00:00
Jeff Morriss cc6fc23812 From Didier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :
Apply rev 25869 to most of the rest of the TCP-desegmenting dissectors.
(The SSL dissector was already updated in one of two spots with bug 4535/rev
32456.)

A couple of the patches had to be manually applied.

From me: Fix the comments to match the change (including in the TCP and SSL
dissectors.)

svn path=/trunk/; revision=36332
2011-03-25 19:02:18 +00:00
Jeff Morriss 2c8e2564f6 Fix the problem reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3785#c14 :
If we thought we finished reassembly (and called the subdissector) only to find
out that the subdissector asked for more data, handle the case where the
subdissector asked for DESEGMENT_UNTIL_FIN.  Previously we only handled the
possibility that the subdissector would ask for a specific number of bytes or
DESEGMENT_ONE_MORE_SEGMENT.

svn path=/trunk/; revision=36330
2011-03-25 15:45:37 +00:00
Gerald Combs 2ea9b63ee7 If a segment looks like a retransmission, don't mark it out-of-order.
svn path=/trunk/; revision=36323
2011-03-25 00:28:47 +00:00
Jeff Morriss 8c73d0c6f4 If we've already seen a segment which starts a multi-segment pdu (i.e., it's
a retransmission), don't add it to the list (tree) of multi-segment pdus.

Otherwise, if we'd already seen the rest of the pdu and the other segments
were not retransmitted, the retransmission would break dissection of the pdu
because lookups for the segment would find the retransmission (to which the
other segments were not attached).

Since we know this segment is a retransmission, don't bother handing it off
to the subdissector either.

Use PINFO_FD_VISITED().
Add some white space in the desegmentation routine to improve readability.

Apply the same changes to the SSL dissector.

svn path=/trunk/; revision=36304
2011-03-24 02:10:04 +00:00
Sake Blok f28084f772 Fix for bug 5743 : tshark incorrectly calculates tcp stream for SYN packets when port numbers are re-used
svn path=/trunk/; revision=36162
2011-03-08 11:26:34 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +00:00
Sake Blok ea4ac173d0 Add "tcp.window_size_value" and "tcp.window_size_scalefactor" conform
the discussion in bug 5541. Since we now have the window size value as
well as the scaled window size, there is no need anymore for the
tcp preference "tcp_window_scaling".


svn path=/trunk/; revision=35425
2011-01-08 15:51:38 +00:00
Guy Harris 4b057e1071 It's not a good idea to use tcph->th_seglen if you haven't set it.
Fixes bug 4211.

svn path=/trunk/; revision=35313
2010-12-31 00:02:54 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Jaap Keuter 9da77c4716 Riverbed published patch for dissection of Riverbed TCP Probe/Transparency TCP options.
svn path=/trunk/; revision=35184
2010-12-14 07:43:17 +00:00
Bill Meier 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Anders Broman 2c042dcd15 Use value_string_ext.
svn path=/trunk/; revision=34845
2010-11-11 21:18:15 +00:00
Anders Broman 0d246c79a9 display the the PDU length as "cut short"if it crosses the boundary of the
* packet and no more packets are available.
Based on the patch from Alexander Koeppe in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5285

svn path=/trunk/; revision=34799
2010-11-06 21:05:45 +00:00
Jeff Morriss 33f116a46d Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).

Remove check_col().

svn path=/trunk/; revision=34436
2010-10-08 17:48:22 +00:00
Stephen Fisher 0e0641f079 Put the ": %u (multiply by %u)" back on the TCP window scaling option, so
users don't have to expand the tree to see the details that were there 
before rev 34094.


svn path=/trunk/; revision=34096
2010-09-10 16:33:46 +00:00
Stephen Fisher f2e2be709a Expand description for "NOP" and "EOL" options to "No-Operation (NOP)" and
"End of Options List (EOL)" respectively.


svn path=/trunk/; revision=34095
2010-09-10 16:23:58 +00:00
Stephen Fisher 8d3e472866 Enhance the TCP option display for window scaling.
svn path=/trunk/; revision=34094
2010-09-10 16:12:17 +00:00
Stephen Fisher ff5cfee491 Turn the TCP timestamp option into a subtree to also show the option kind,
option length and values with proto_tree_add_item() intead of _add_text().
The options tree still shows the same information as before until the sub-
tree is expanded.

The goal is to do this with all TCP and IP options.


svn path=/trunk/; revision=34088
2010-09-08 23:10:52 +00:00
Stig Bjørlykke d968bc8b61 Mask out the header length from th_flags.
svn path=/trunk/; revision=34087
2010-09-08 21:25:14 +00:00
Stephen Fisher b17b2eb187 Make the Windows buildbot happy: guint8 -> guint16 for flags variable in
definition of tcp_analyze_sequence_number(). 


svn path=/trunk/; revision=34086
2010-09-08 21:11:45 +00:00
Stephen Fisher e12fc91a33 Minor correction to SVN revision 34084: we better only try up to the 9
available values in flags[], so we don't run past the end of the array
if one of the reserved flags is set. 


svn path=/trunk/; revision=34085
2010-09-08 20:52:00 +00:00
Stephen Fisher dfacac4421 Expand the TCP flags to include the low nibble of the byte that has
the header length in the high nibble.  The only new flag is nonce (NS);
the remaining three bits are still reserved.


svn path=/trunk/; revision=34084
2010-09-08 20:43:19 +00:00
Stephen Fisher de23882f07 Fix typo in comment: datat -> data
svn path=/trunk/; revision=34044
2010-09-02 17:11:48 +00:00
Sake Blok 93cfe5571b From Cal Turney (bug 5132):
TCP bytes_in flight becomes inflated with lost packets 

This patch suspends Bytes-in-Flight calculation when missing packets are detected.


svn path=/trunk/; revision=33994
2010-08-29 15:27:20 +00:00
Stig Bjørlykke e3aab56e64 Added support for RFC5482: User Timeout Option.
svn path=/trunk/; revision=33784
2010-08-12 14:09:08 +00:00
Gerald Combs 7e0e3b696b Revert r30979, which removed the window size in SYN packets. People were
asking where it went.

svn path=/trunk/; revision=33694
2010-08-03 00:09:41 +00:00