Commit graph

238 commits

Author SHA1 Message Date
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
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