Commit Graph

109 Commits

Author SHA1 Message Date
Jeff Morriss d74bd3ce42 Don't pass the result of tvb_get_ptr() into a %s format string: the string may
not be NULL terminated.  Use tvb_get_ephemeral_string() instead.

svn path=/trunk/; revision=35375
2011-01-05 15:11:32 +00:00
Jeff Morriss d298b79628 Use reported length (instead of the captured length) when dissecting error
causes (should have been in rev 35366).

When generating TVB subsets, limit the subset's backing and reported lengths to
the (captured) TVB length and the reported TVB length, respectively.

This allows us to dissect most of the packet in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5546
before asserting out.

It also yields similar better behavior when the capture is limited by a
snapshot length.

svn path=/trunk/; revision=35368
2011-01-05 03:40:02 +00:00
Jeff Morriss 25485e9b3e When generating a tvb subset for chunks, parameters, and error causes, set the:
- "reported length" to be minimum of the entity's length (taken from the
   packet) or the reported length of the TVB.
 - "backing length" to be the minimum of the reported length (above) or the
   (captured) length of the TVB.

This prevents tvb_new_subset() from generating an exception if the entity's
length (in the packet) is bogus (bigger than what's in the TVB) which allows
dissection to continue to a point where we can show the user what the problem
is.

When dissecting chunks, add an expert info if the item's length is bigger than
what was on the wire (the reported length).  (The same could also be done for
parameters and error causes.)

This makes captures like that in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5546
easier to understand.

It also starts getting this dissector using the reported length instead of the
(captured) TVB length (there's more to be done with other tvb subsets).

svn path=/trunk/; revision=35366
2011-01-04 23:07:32 +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 62067368a0 Separate out/update comment block.
Update IANA assignments.
Use available checksum routines.
Some cleanup and use of convenience macros.

svn path=/trunk/; revision=34922
2010-11-17 07:42:32 +00:00
Jeff Morriss a179cfb90a Catch exceptions from subdissectors, even when we're not handing the
subdissector the first fragment of a fragmented message so that an exception
in the first chunk doesn't abort dissection of subsquent chunks in the frame.

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).

svn path=/trunk/; revision=34420
2010-10-08 01:05:33 +00:00
Bill Meier dac0bf77ed Fix cases where the type of a for loop variable is smaller than the type of the "end" variable.
In some cases the usage may have been benign since it can be seen by code inspection that the maximum value of the end variable can't exceed the maximum value of the loop variable.
However, on general principles, all the usages have been fixed.

svn path=/trunk/; revision=33692
2010-08-02 13:09:01 +00:00
Michael Tüxen 690097963e Update SCTP PPIDs.
svn path=/trunk/; revision=33225
2010-06-14 21:49:23 +00:00
Guy Harris 1b444c55fd Refer to the endianness arguments as "encoding" rather than
"representation" - we already use "representation" to refer to the text
representation of fields.

Change some routines with an endianness argument to make it a
representation argument instead; 

svn path=/trunk/; revision=32929
2010-05-24 06:06:17 +00:00
Guy Harris 998677339e Create a new REP_NA value for fields where there are no representations
from which to choose; use that for protocol fields in some protocols
(modify the CORBA generator to use it, and manually update the generated
CORBA dissectors accordingly).

svn path=/trunk/; revision=32777
2010-05-13 00:20:40 +00:00
Guy Harris 308bb550da Instead of using private #defines for the last argument to
proto_tree_add_item(), use the new REP_BIG_ENDIAN and REP_LITTLE_ENDIAN
values.

Use those #defines in variables that represent the byte order, as well.

svn path=/trunk/; revision=32776
2010-05-12 23:45:16 +00:00
Bill Meier 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00
Anders Broman fd887ba442 Add PPID 28 IRCP
svn path=/trunk/; revision=32686
2010-05-06 12:54:43 +00:00
Michael Tüxen c273169cbd Display correct chunk type for unknown chunks.
svn path=/trunk/; revision=31522
2010-01-13 21:31:24 +00:00
Anders Broman d5cfd0edc9 - Remove check_col.
- Make x2ap work.

svn path=/trunk/; revision=30746
2009-10-28 06:18:05 +00:00
Anders Broman cd8924f759 Update SCTP ppids, fix a faulty #define.
svn path=/trunk/; revision=30744
2009-10-28 05:09:32 +00:00
Bill Meier 92307f0dda (Trivial) Fix a typo in a comment.
svn path=/trunk/; revision=30574
2009-10-16 15:28:21 +00:00
Kovarththanan Rajaratnam 00810ff199 * Prefer col_append_str instead of col_append_fstr for constant strings
* Remove check_col guards

svn path=/trunk/; revision=30127
2009-09-24 20:21:23 +00:00
Michael Tüxen 375f355046 Update list of PPIDs.
This fixes bug 3928.

svn path=/trunk/; revision=29520
2009-08-23 11:30:54 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Guy Harris c3aaf166c6 Those items are 32 bits or longer, so the cast should be safe; add an
additional cast in the hopes that they squelch "dereferencing
type-punned pointer" warnings.

svn path=/trunk/; revision=29318
2009-08-06 23:26:24 +00:00
Bill Meier 9c4a21d9d3 Fix a typo
svn path=/trunk/; revision=29068
2009-07-12 14:13:01 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Michael Tüxen 2f5d2bb8a3 * Fix name of Irene in AUTHORS.
* Add Varun Notibala to AUTHORS.
* Add support for NR-SACK and fix stability problems.

svn path=/trunk/; revision=28642
2009-06-05 13:33:18 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Anders Broman 5d8ce54e34 Use the SCTP ppid for S1AP.
svn path=/trunk/; revision=27585
2009-03-03 18:25:25 +00:00
Bill Meier a8f30cbca1 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27037
2008-12-17 17:23:37 +00:00
Tomas Kukosa 99295ee0d2 put the SCTP PPI for current DATA chunk into packet_info (and ppid array renamed to ppids)
svn path=/trunk/; revision=26958
2008-12-10 11:04:36 +00:00
Guy Harris 1944c530dc Fix a warning.
svn path=/trunk/; revision=26771
2008-11-13 17:49:37 +00:00
Bill Meier 249e0fa95a Fix a trivial typo
svn path=/trunk/; revision=26702
2008-11-05 21:34:26 +00:00
Jeff Morriss 1882e64736 If we're dissecting for a read filter in the GUI [tshark assigns
frame numbers before running the read filter], don't do the TSN
analysis.  (We can't anyway because we don't have a valid frame
number...)

Without this change if you load a capture file in the
GUI while using a read filter, every SCTP TSN is marked as a
retransmission of that in frame 0.

svn path=/trunk/; revision=26226
2008-09-17 21:59:15 +00:00
Michael Tüxen 296be40635 Add support for
http://www.ietf.org/internet-drafts/draft-tuexen-tsvwg-sctp-sack-immediately-00.txt

svn path=/trunk/; revision=26184
2008-09-12 16:23:18 +00:00
Jeff Morriss 2acffab343 Add an expert info noting an a_rwnd of 0.
svn path=/trunk/; revision=26055
2008-08-21 20:29:27 +00:00
Jeff Morriss 88abfa7bba Add expert info warning to TSNs that are retransmitted more than 2 times.
svn path=/trunk/; revision=26013
2008-08-14 14:40:16 +00:00
Bill Meier ceebccced4 Fix some warnings reported by gcc -Wshadow ...
svn path=/trunk/; revision=25607
2008-06-26 00:16:58 +00:00
Jeff Morriss cb5cae1eed Correct math for counting how many TSNs were GAP acknowledged
svn path=/trunk/; revision=25429
2008-06-05 01:29:58 +00:00
Anders Broman e623809550 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25264
2008-05-09 13:59:10 +00:00
Stig Bjørlykke 1dbe6e584a From Philip Frey (bug 2420):
Merge of the CRC32C calculation out of packet-iscsi.c and packet-sctp.c
into the already existing crc32.c and crc32.h files.

svn path=/trunk/; revision=24930
2008-04-12 12:31:53 +00:00
Michael Tüxen 5916e54d06 - Disable checksum verification by default.
- Add to Edit/Preferences/Protocols/SCTP a
  flag to disable upper layer dissection.

svn path=/trunk/; revision=24761
2008-04-01 02:53:01 +00:00
Jeff Morriss 6aed8c4c60 Initialize a 'next' pointer so we don't crash if/when we try to follow it.
svn path=/trunk/; revision=24471
2008-02-26 17:05:37 +00:00
Bill Meier bad9f18d33 Fix (Sun) compiler warnings as reported by David Kirkby: Part 1
svn path=/trunk/; revision=24295
2008-02-09 23:35:28 +00:00
Jeff Morriss 407007d14a From Kaul: s/SERIAL_NUMBER_LENGTH/SCTP_SERIAL_NUMBER_LENGTH to fix a duplicate definition on Windows (not sure why Kaul is seeing that but oh well).
svn path=/trunk/; revision=23899
2007-12-17 19:25:16 +00:00
Guy Harris a3d7a2c66f Squelch a warning about a variable getting clobbered by a longjmp.
svn path=/trunk/; revision=23780
2007-12-06 08:22:16 +00:00
Michael Tüxen d00e6fe59e Fix from Stephen Fisher for bug 2028.
svn path=/trunk/; revision=23621
2007-11-27 17:46:55 +00:00
Jeff Morriss c5ab162b37 gcc-4.1.1 thinks 'retval' might not get set inside the TRY(). Initialize it.
svn path=/trunk/; revision=23603
2007-11-26 17:28:12 +00:00
Jeff Morriss 330c9d0b4b Fix crash reported in http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2014 : when adding fragments to the linked list of end fragments, don't check the TSN of the begin fragment--it may not be there. Looks like a cut-n-pasteo.
svn path=/trunk/; revision=23567
2007-11-24 17:56:46 +00:00
Jeff Morriss 53faa469bd Detect reneged acks or at least retransmissions after an ack was seen. Mark
them with an expert info (PI_WARN).

Change "Duplicate TSN" expert info to "Retransmitted TSN" and make it PI_NOTE
instead of PI_WARN.

Change "More than 100 TSNs gap-acked" expert info to PI_WARN (from PI_NOTE).

Frame numbers (and count of retransmissions) are unsigned, display them that way.

svn path=/trunk/; revision=23502
2007-11-19 20:34:57 +00:00
Jeff Morriss 3fa633d626 When reassembly is off, catch ReportedBoundsError when calling a subdissector
on the first fragment of a fragmented message.  This allows us to continue
dissecting chunks even if one of the first chunks in the frame was fragmented.
(It's useful to keep doing this partial dissection just so we have some idea
what's in that chunk.)

(One could rightfully argue that you should only see a fragmented chunk
bundled with another chunk when retransmitting but, well, I'm staring at
traces of an implementation--to remain nameless to protect the guilty--which
is sometimes fragmenting and then bundling the fragments into one packet.)

svn path=/trunk/; revision=23471
2007-11-16 22:04:27 +00:00
Jeff Morriss 03b581e921 When reassembly is turned off don't pass non-first fragments to subdissectors: they will have no idea what they're getting and will exception out anyway.
svn path=/trunk/; revision=23469
2007-11-16 19:32:59 +00:00