Commit Graph

253 Commits

Author SHA1 Message Date
Martin Mathieson 99bd7cfe44 Add a preference to that when the window scaling options are not
visible, we can still configure a scaling factor and therefore get
better TCP sequence analysis and see better stream graphs.

A single preference is used for any/all streams for which the true value
isn't known.  I tried to make it obvious when showing the calculated
window size that it came fromt he preference setting.  The default value
for this preference is off, i.e. it won't change existing behaviour.

This was discussed a little at Sharkfest and raised on the developers
list last week.

svn path=/trunk/; revision=43686
2012-07-12 23:57:51 +00:00
Pascal Quantin 472f036552 Do not use same name for filters with incompatible types
svn path=/trunk/; revision=43448
2012-06-23 14:36:21 +00:00
Bill Meier 70cc6362fe Don't define value_string arrays in a .h file (included in multiple places).
Also:
 - don't use val_to_str_const() with a "format" default string;
 - rename 'opt_len_type' enumeration  identifiers to be less generic.

svn path=/trunk/; revision=43210
2012-06-11 18:47:42 +00:00
Chris Maynard ebe8ed3a3e Fix the other part of Coverity CID 703086. I thought I got it with r42798, but apparently that was only 1/2 the fix as sometimes they group more than one bug into a single CID.
svn path=/trunk/; revision=43185
2012-06-10 19:02:03 +00:00
Gerald Combs c408151a80 Try to be a bit more clear that "lost" is from Wireshark's perspective,
not necessarily one of the TCP endpoints.

svn path=/trunk/; revision=42990
2012-06-01 20:54:04 +00:00
Anders Broman 0832853fa8 From Robert Bullen:
The Wireshark and tshark TCP conversations stats tables aggregate reused connections into a single line item

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

svn path=/trunk/; revision=42806
2012-05-23 06:36:47 +00:00
Chris Maynard 509917229b Fix Coverity CID 703086: Dereference after null check in decode_tcp_ports().
svn path=/trunk/; revision=42798
2012-05-23 00:56:15 +00:00
Ronnie Sahlberg 2a2dc8c5f3 TCP: Some protocols running ontop of TCP needs the PDUs to be delivered in order. for example decryption of DCERPCoverHTTP.
For such protocols, hte state gets out of sync of for example the same PDU is invoked twice in a row, which sometimes can happen if there is tcp retransmission and we see the same PDU twice. First for hte original segment and a second time for the tcp retransmission.
These protocols might lack an easy way to detect that a PDU is seen twice or out of order.

To handle this a little better, offer a TCP option that defaults to being disabled but when enabled skips invoking any subdissector for retransmitted or out of order packets.
(For some virtualization environments it sometimes becomes VERY common to see false tcp retransmissions due to segments being captured twice making this even worse)


We dont want this option to default to ON because for most cases we do want the current behaviour where the subdissector is called twice, or more, for any PDU that is retrasnmitted on the TPC layer.
For example, assume a SMB response packet is retransmitted on the TCP level.
This may result in a capture file that looks like
1 -> SMB request
2 <- SMB response to 1  
... 1 second ...
3 <- SMB response to 1   TCP retransmission

For this case we definitely want packet 3 to be passed to the SMB layer so that 
the request/respons ematching will detect that the response time for this transaction was > 1.0 second
We want smb.time to indicate the delta betwenn packets 1 and 3
as well as the SMB Service Response Time to indicate that this command took very long.





svn path=/trunk/; revision=42774
2012-05-22 07:51:12 +00:00
Jakub Zawadzki 8fca2eb7e5 Add missing consts.
svn path=/trunk/; revision=42004
2012-04-10 10:20:20 +00:00
Anders Broman d04de670f8 From Michael Mann:
TCP picks wrong sub-dissector if both dissector choices have the same "minimum segment size"

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

svn path=/trunk/; revision=41954
2012-04-05 11:18:49 +00:00
Martin Mathieson 2570bef0c2 When storing sequence analysis results, add (raw) sequence number and
ack number to the lookup key (which was previously just the frame number).

This helps with situations where multiple segments of the same TCP
conversation can be found in the same frame in a capture (e.g. with LTE
user-plane traffic carried in logged MAC or RLC frames).

svn path=/trunk/; revision=41788
2012-03-27 02:08:48 +00:00
Alexis La Goutte fa68273f40 Add Quick Start IPv6 Option ( And shared Quick Start option between IPv4/IPv6/TCP )
svn path=/trunk/; revision=41681
2012-03-20 08:51:05 +00:00
Chris Maynard e3fdb92a67 Since the nonce and reserved bits were added in r34084, tcp.flags is now 12 bits, so its type needs to be changed from an FT_UINT8 to an FT_UINT16. This should avoid the crash experienced by Lanell Allen as reported on -dev: http://article.gmane.org/gmane.network.wireshark.devel/24846 (although in my testing on Windows XP SP3 (32-bit), Wireshark did not crash).
svn path=/trunk/; revision=40949
2012-02-10 03:37:28 +00:00
Graham Bloice 6a33236a0d Fixed bug with calculation of bytes in flight.
A corner case was posted to the Q&A site showing incorrect calculation of bytes in flight (http://ask.wireshark.org/questions/8843/bytes-in-flight-problems-with-retransmissions)

The capture in question has a tcp segment (frame 12) that is a retransmission of unacked earlier data (frames 4, 9, 10) and also contains some new data.  Eventually an ACK is received for the earlier segments (frame 16) but the code doesn't remove frame 12 from the linked list of unacked segments because it extends past the received ACK.  When more data is received in frame 17, the bytes in flight is calculated from the start of frame 12 rather than from the unacked portion of it, leading to a larger incorrect value.

The change simply updates the starting sequence number in the unacked segment list for any partially acked segment to be the start of unacked data.

The capture in question now shows correct information for bytes in flight, and hopefully the nature of the change won't cause issues elsewhere.

svn path=/trunk/; revision=40929
2012-02-08 11:52:35 +00:00
Chris Maynard f88e871171 Fix some typos.
svn path=/trunk/; revision=40786
2012-02-01 01:41:11 +00:00
Alexis La Goutte dbe733fcfc Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40375
2012-01-04 17:44:50 +00:00
Alexis La Goutte c3c5e75678 From Andrei Maruseac via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6705
Multipath TCP Option

Extensions for Multipath Operation with Multiple Addresses, as defined in http://tools.ietf.org/html/draft-ietf-mptcp-multiaddressed-04. I implemented this as a TCP option.

From me :
Remove a subtree
Add Subtype in top of multiPath subtree


svn path=/trunk/; revision=40370
2012-01-04 13:01:53 +00:00
Chris Maynard fe290f10f6 Appease the buildbots.
svn path=/trunk/; revision=40281
2011-12-22 19:41:13 +00:00
Chris Maynard a856a7ec53 Revert some of the changes made as part of the patch from bug 6194 committed in r38326. Also, change the 3 separate reserved bit fields to a single 3-bit reserved field to more closely match the spec. Lastly, in accordance with NOTE 2 of Table 3-1 of the spec, display the connection id, whatever it is, rather than assuming it's zero just because the Com bit isn't set.
svn path=/trunk/; revision=40280
2011-12-22 19:22:43 +00:00
Guy Harris bd0e6c50cb The TCP Packet Mood Option was a cute April 1 RFC, but TCP option 25 is
officially listed as "Unassigned", and people might use it for their own
purposes (and, in fact, one bug-submitter was doing so; they probably
should have used 253 or 254, but...).  Get rid of the code to dissect
it.

svn path=/trunk/; revision=40075
2011-12-03 03:01:08 +00:00
Chris Maynard 647c5c0b27 packet_info's in_error_pkt is now a bitfield like in_gre_pkt.
svn path=/trunk/; revision=39764
2011-11-08 18:39:11 +00:00
Jeff Morriss f5e838b602 Remove comma at the end of several enumerator lists.
svn path=/trunk/; revision=39700
2011-11-01 01:23:10 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 293049dfba Do some conversions of proto_tree_add_item() 'encoding' arg.
(previously missed).

    57   FT_BOOLEAN:       FALSE-->ENC_BIG_ENDIAN
    31   FT_BOOLEAN:       TRUE-->ENC_LITTLE_ENDIAN

    10   FT_BYTES:         ENC_BIG_ENDIAN-->ENC_NA
     1   FT_BYTES:         ENC_LITTLE_ENDIAN-->ENC_NA
    21   FT_BYTES:         FALSE-->ENC_NA
     2   FT_BYTES:         TRUE-->ENC_NA

     2   FT_IPXNET:        ENC_BIG_ENDIAN-->ENC_NA

     6   FT_IPv6:          ENC_BIG_ENDIAN-->ENC_NA
     1   FT_IPv6:          FALSE-->ENC_NA

     6   FT_NONE:          ENC_BIG_ENDIAN-->ENC_NA
    19   FT_NONE:          FALSE-->ENC_NA
     3   FT_NONE:          TRUE-->ENC_NA

     1   FT_STRING:        ENC_BIG_ENDIAN-->ENC_ASCII|ENC_NA
     1   FT_STRING:        ENC_LITTLE_ENDIAN-->ENC_ASCII|ENC_NA
     5   FT_STRING:        FALSE-->ENC_ASCII|ENC_NA
     1   FT_STRING:        TRUE-->ENC_ASCII|ENC_NA

     4   FT_STRINGZ:       ENC_NA-->ENC_ASCII|ENC_NA
     8   FT_STRINGZ:       FALSE-->ENC_ASCII|ENC_NA

     1   FT_INT32:         FALSE-->ENC_BIG_ENDIAN
     1   FT_INT32:         TRUE-->ENC_LITTLE_ENDIAN

    11   FT_UINT8:         0-->ENC_BIG_ENDIAN
   111   FT_UINT8:         FALSE-->ENC_BIG_ENDIAN
    17   FT_UINT8:         TRUE-->ENC_LITTLE_ENDIAN
     1   FT_UINT16:        0-->ENC_BIG_ENDIAN
    68   FT_UINT16:        FALSE-->ENC_BIG_ENDIAN
    18   FT_UINT16:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT24:        FALSE-->ENC_BIG_ENDIAN
    70   FT_UINT32:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT32:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT64:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT64:        TRUE-->ENC_LITTLE_ENDIAN

     1   FT_UINT_STRING:   FALSE-->ENC_ASCII|ENC_BIG_ENDIAN


svn path=/trunk/; revision=39442
2011-10-16 23:38:49 +00:00
Bill Meier 67ee5049d4 Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
  the encoding parameter for proto_tree_add_item() calls which directly reference
  an item in hf[] which has a type of:
     FT_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Bill Meier e6bd9d1a8c Whitespace cleanup:
Use consistent indentation;
 Convert "4 space tabs" to spaces;
 Remove trailing whitespace.

svn path=/trunk/; revision=39082
2011-09-21 18:55:03 +00:00
Bill Meier 781129806f Fix ex "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39081
2011-09-21 17:49:11 +00:00
Stig Bjørlykke 027bfdf5f3 Check for valid tcpd, as it may be NULL.
svn path=/trunk/; revision=38894
2011-09-06 09:18:09 +00:00
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