Commit Graph

183 Commits

Author SHA1 Message Date
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
Guy Harris d8629a2747 Protect against wraparound when scanning through a bunch of TCP data in
"tcp_dissect_pdus()".

svn path=/trunk/; revision=7179
2003-02-21 00:22:45 +00:00
Guy Harris 63bd8087e5 From Didier Gautheron: fix desegmentation code to handle sequence number
overflow.

svn path=/trunk/; revision=7169
2003-02-18 21:37:53 +00:00
Guy Harris 231f28ce08 Panic if a preference starts with the name of the module to which it
belongs, as that's redundant.

Fix a bunch of cases where that was done, and map the old name to the
new name.

Instead of marking "mtp3.mtp3_standard" as obsolete, map it to
"mtp3.standard".

svn path=/trunk/; revision=7030
2003-01-28 23:56:40 +00:00
Ronnie Sahlberg e4633bc783 Update reassemble.c/show_item and all callers to use FT_FRAMENUM for the list of packets corresponding to a reassembled pdu
svn path=/trunk/; revision=6807
2002-12-19 11:22:38 +00:00
Ronnie Sahlberg 1027314b99 From Jason House, support for TAPping from TCP protocol
svn path=/trunk/; revision=6792
2002-12-17 11:49:32 +00:00
Guy Harris 59932f2722 Don't cast away constness, and fix variable and structure member
qualifiers as necessary to ensure that we don't have to.

"strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't
test their results as if they did.

Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes.

Update Michael Tuexen's e-mail address.

svn path=/trunk/; revision=6726
2002-12-02 23:43:30 +00:00
Guy Harris 5620a882ec Check whether we got an overflow for the PDU length *before* we check
whether we have that much data.

svn path=/trunk/; revision=6675
2002-11-27 04:55:23 +00:00
Ronnie Sahlberg 926433a151 Must use the proper proto_tree_add_... call for FT_NONE
svn path=/trunk/; revision=6577
2002-11-07 09:10:06 +00:00
Ronnie Sahlberg 2378b2a893 hf_index update for TCP
svn path=/trunk/; revision=6576
2002-11-07 08:51:07 +00:00
Ronnie Sahlberg ee9c00c024 Fixed small bug in TCP seq/ack analysis. Forgot to check a pointer for NULL which caused crashes sometimes.
svn path=/trunk/; revision=6546
2002-11-02 22:00:17 +00:00
Ronnie Sahlberg 707f06ccc2 Three more things for TCP seq/ack analysis to check for and flag:
ZeroWindow:   ZeroWindow segments are detected and flagged
  ZeroWindowProbe: detected and flagged
  ZeroWindowViolation:  attempts to write >1 byte of data to a zerowindow is detected and flagged.

svn path=/trunk/; revision=6543
2002-11-01 11:05:37 +00:00
Ronnie Sahlberg f4ecf268aa Update to TCP seq/ack analysis: tcp seq/ack analysis should now be able to
detect suspected duplicate ACKs.

svn path=/trunk/; revision=6542
2002-11-01 10:25:35 +00:00
Guy Harris 5b77ebc32d From Ronnie Sahlberg: use the frame number of a TCP segment, rather than
its starting sequence number, as the "fragment ID" when reassembling,
and include the source and destination port numbers in a
"tcp_segment_key" structure and use that as part of the key in the hash
table for segments, so that we don't get spoofed by segments in two
directions in the same conversation, or by segments in two separate
conversations between the same hosts, having the same starting sequence
number (which is not unlikely to happen if relative sequence numbers are
being used).

svn path=/trunk/; revision=6443
2002-10-17 02:19:29 +00:00
Ronnie Sahlberg 3832f2a8c2 From Didier: bugfix for sequence number wrapping
svn path=/trunk/; revision=6303
2002-09-18 12:08:28 +00:00
Ronnie Sahlberg eef506e467 fix for the fix
svn path=/trunk/; revision=6274
2002-09-11 09:52:36 +00:00
Ronnie Sahlberg b8769cdfa9 Tiny change to the tcp seq/ack analysis.
If the addresses are equal, compare the ports with '>' instead of '-'
since '>' will work regardless of whether the values are unsigned or not.

svn path=/trunk/; revision=6268
2002-09-11 09:08:07 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 4047c3caeb Properly display the window scale option.
svn path=/trunk/; revision=6065
2002-08-22 19:47:15 +00:00
Guy Harris 23029e96e0 "CMP_ADDRESS()" is not guaranteed to return 0, 1, or -1, it's just
guaranteed to return 0, a positive number, or a negative number, based
on the result of the comparison.  Furthermore, if it returns 0, meaning
the source and destination addresses are the same, we have to look at
the port numbers to decide which side of the conversation the frame is
from.

svn path=/trunk/; revision=6064
2002-08-22 19:40:03 +00:00
Ronnie Sahlberg e09e2a2754 Create a subtree with an item "tcp.analysis.flags" to keep all
tcp sequence number analysis flags, such as retransmission , lost-segment, etc
to make it easier to search for all these conditions.

svn path=/trunk/; revision=6056
2002-08-21 23:57:38 +00:00
Tim Potter 60e4ca9c4f Moved the generic true_false_string saying "Set", "Not set" into
epan/packet.c

It was cut and pasted into seven other dissectors!

svn path=/trunk/; revision=6052
2002-08-21 21:25:23 +00:00
Ronnie Sahlberg a1c846ba48 Reverted part of the previous patch. It seemed we found a few too many
packets to display the ACK data for.

svn path=/trunk/; revision=6008
2002-08-17 22:26:00 +00:00
Ronnie Sahlberg 12a0b53183 Fixed bug not handling FIN pakcets properly.
Fixed another tiny bug where it would forget to check ACKs outside the window
sometimes.

svn path=/trunk/; revision=6001
2002-08-16 20:59:18 +00:00
Jörg Mayer 6a1666b35d Add sequence number wrap to tcp window checking.
svn path=/trunk/; revision=5945
2002-08-03 23:20:06 +00:00
Guy Harris 6ed12f6993 Create the TCP protocol tree, and put the source and destination ports
into it, as soon as we've extracted the source and destination ports
from the packet, so that if we throw an exception fetching something
else from the packet, we still have the protocol tree and ports.

svn path=/trunk/; revision=5943
2002-08-03 22:28:16 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Ronnie Sahlberg ff72b97ee0 Two new options added to TCP.
1, Analyze TCP sequence numbers.
   This option will keep track of sequence numbers for all tcp sessions
   and flag the following:
   a, If a new segment is seen which is beyong the right edge this is
      an indication that the previous segment was lost and this will be
      flagged as previous segment lost.
   b, If a segment is seen which lies left of the right edge this is flagged
      as retransmission.
   c, if a keep-alive is seen (empty segment, seq==expected seq-1)
      this is flagged as a retransmission.
   d, if an ACK is seen which is beyond the right edge this is an indication
      that a segment has been lost and it will be flagged as segment lost.

   All ACKs which advance the left edge get the RTT displayed between the ACKed
   segment and the ACK itself. The ACK also gets an indication of WHICH segment
   it is an ACK for.

2, Relative sequence numbers. This option needs the first option to be selected
as well. This option will as best as it can try to get ethereal to use
relative sequence numbers instead of absolute ones.

The patch does not handle sequence number wrapping and unexpected results
can probably happen for such.

svn path=/trunk/; revision=5931
2002-08-02 22:41:56 +00:00
Guy Harris 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +00:00
Guy Harris 9cde3af195 Set pinfo->ptype, pinfo->srcport, and pinfo->dstport as soon as we've
fetched the source and destination port numbers, so that they're
available to the "Follow TCP Stream" code even if we throw an exception
dissecting the rest of the TCP header.

svn path=/trunk/; revision=5811
2002-07-02 08:18:45 +00:00
Guy Harris 2be8f3e875 When looking for dissectors for the source and destination port numbers
in TCP, UDP, and SCTP, try the lower port number first, and then the
higher port number; this means that, for packets where a dissector is
registered for *both* port numbers:

	1) we pick the same dissector for traffic going in both directions;

	2) we prefer the port number that's more likely to be the right
	   one (as that prefers well-known ports to reserved ports);

although there is, of course, no guarantee that any such strategy will
always pick the right port number.

Ignore port numbers of 0, as some dissectors use a port number of 0 to
disable the port, and as RFC 768 says that the source port in UDP
datagrams is optional and is 0 if not used.

svn path=/trunk/; revision=5656
2002-06-08 21:54:52 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris ded6d3e2f4 Improve a comment.
svn path=/trunk/; revision=5399
2002-05-05 22:25:14 +00:00
Guy Harris d612dab6df Make "tvb_ensure_length_remaining()" return a "guint" - it can't return
a negative value.

Use "tvb_ensure_length_remaining()" in "tcp_dissect_pdus()", rather than
checking the return value of "tvb_length_remaining()" ourselves, and
make various variables and parameters in it "guint" as appropriate.

svn path=/trunk/; revision=5396
2002-05-05 00:57:59 +00:00
Guy Harris eb70c97a9b Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly.  Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.

Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.

Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.

Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.

Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.

svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
Richard Sharpe e626714c31 Add the packet len to the protocol tree as well, since it is often not visible in the summary display.
svn path=/trunk/; revision=5379
2002-05-04 02:54:48 +00:00
Richard Sharpe 60d5c327e9 Add a hidden length fild for TCP, tcp.len. Also fixed a small type.
svn path=/trunk/; revision=5210
2002-04-21 02:57:01 +00:00
Guy Harris 08cf4d245f Do the "follow TCP stream" stuff before calling the subdissector, so
that it gets done even if the subdissector throws an exception (and so
that, if the subdissector modifies the addresses or ports, we still hand
the right values to "reassemble_tcp()").

svn path=/trunk/; revision=5140
2002-04-11 08:59:43 +00:00
Guy Harris 7212bcc1e9 Mark unused arguments as such.
svn path=/trunk/; revision=5062
2002-03-31 22:43:03 +00:00
Guy Harris 588c50944d In the protocol tree entries for lists of fragments/segments, make the
top-level item correspond to the reassembled data, and make the item for
each fragment/segment correspond to the part of that reassembled data
that came from that fragment/segment.

svn path=/trunk/; revision=5025
2002-03-27 04:27:05 +00:00
Guy Harris f12ef91219 Free all the stuff pointed to by elements in the "tcp_segment_table"
hash table before freeing the memory chunks for those elements.

Destroy that hash table when we're done, and set the pointer to it to
null so that we'll reallocate it.

svn path=/trunk/; revision=4794
2002-02-24 02:59:30 +00:00