Commit graph

158 commits

Author SHA1 Message Date
Jeff Morriss
27059c2804 Fix up some white space.
svn path=/trunk/; revision=50597
2013-07-15 02:05:54 +00:00
Stig Bjørlykke
d9aff2d872 Fixed an indent to avoid a warning: for loop has empty body [-Wempty-body]
svn path=/trunk/; revision=48294
2013-03-14 08:41:11 +00:00
Anders Broman
672a54c156 From beroset:
converted implicit casts to explicit casts, moved nested structure definition outside, and changed se_alloc to se_new.

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

svn path=/trunk/; revision=48287
2013-03-14 06:31:31 +00:00
Guy Harris
6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Bill Meier
96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Jeff Morriss
b320eb3d97 Revert r44559: go back to using g_malloc()'d memory for SCTP reassembly. That
way we don't keep two copies of the fragments in memory until the file is
closed.

wmem is probably a better alternative to this.

svn path=/trunk/; revision=47897
2013-02-26 02:36:05 +00:00
Bill Meier
d3a7f4b817 Use '#if 0 ... #endif' rather than /** ... **/ to comment out
unused hf[] entries (which I should have done in the first place).

svn path=/trunk/; revision=47390
2013-01-31 18:31:28 +00:00
Bill Meier
0960e508e4 Comment out cases of unused hf array entries found by checkhf.
svn path=/trunk/; revision=47302
2013-01-26 18:54:53 +00:00
Jeff Morriss
f8ba6b5a07 Reduce the level of the warning about the padding on the final parameter from
PI_ERROR to PI_NOTE.  (If FreeBSD's been living with the wrong behavior for
years then apparently it doesn't cause interop problems.)

svn path=/trunk/; revision=46401
2012-12-05 15:27:30 +00:00
Jeff Morriss
0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Michael Tüxen
749e52d996 The padding of the last parameter is not included in the length of the chunk
as described in RFC 4960, section 3.2.

svn path=/trunk/; revision=46290
2012-11-29 18:09:51 +00:00
Michael Tüxen
99d406059f Add native SCTP encapsulation.
svn path=/trunk/; revision=46244
2012-11-28 12:16:12 +00:00
Jeff Morriss
4da68e75e0 Warn about non-final parameters that aren't padded correctly. I'm not sure
that final parameters *with* padding is all that important (maybe it should
be there but not PI_ERROR?).

svn path=/trunk/; revision=46239
2012-11-27 23:13:56 +00:00
Michael Tüxen
eb41468008 Fix the expert info dealing with parameter padding. The final parameter
in a chunk is not padded, but the padding bytes are considered padding
of the chunk.

svn path=/trunk/; revision=46143
2012-11-22 16:03:19 +00:00
Jeff Morriss
5d6e03f71b Add expert infos (PI_ERROR) for chunks and parameters that are not padded to
a multiple of 4 bytes.

Move an existing expert info outside if(tree).

svn path=/trunk/; revision=45952
2012-11-06 21:00:40 +00:00
Bill Meier
38f3198b2b Change 'for (i=1; i<=n;...' to 'for (i=0; i<n; ...)'
Done on general principles altho none of the cases
changed would have actually resulted in an infinite
loop because a Bounds error would eventually occur.

svn path=/trunk/; revision=45462
2012-10-11 03:55:33 +00:00
Pascal Quantin
fa9484715c Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7802 :
Avoid an infinite loop when number_of_dup_tsns is equal to 65535

svn path=/trunk/; revision=45355
2012-10-06 21:07:34 +00:00
Jeff Morriss
2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki
dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +00:00
Michael Mann
14a6d40267 Use capture scoped memory for hash table functionality
svn path=/trunk/; revision=44559
2012-08-18 02:55:18 +00:00
Michael Tüxen
e7a645ad9f Update SCTP PPIDs.
This also fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7635

svn path=/trunk/; revision=44500
2012-08-14 20:31:49 +00:00
Bill Meier
638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Jakub Zawadzki
b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Jeff Morriss
96a3da3e05 Use separate filters for the RTT found on a SACK and the RTT found on a
DATA chunk: having them in both places is helpful when looking at the
messages but having them separate is helpful when graphing the RTTs.

svn path=/trunk/; revision=43406
2012-06-20 13:30:07 +00:00
Jeff Morriss
d4fdd6ad52 Only propose decoding PPID 0 if that PPID is in the currently-selected frame.
(I used PPID 0xffffffff as an end-of-list marker so that PPID can no longer
be used in this dialog; if someone starts using that PPID then we'll have
to put a count of PPIDs in pinfo.)

svn path=/trunk/; revision=42991
2012-06-01 21:18:59 +00:00
Michael Tüxen
e62bb03dbc Fix a typo which resulted in displaying the wrong SCTP stream reset response
sequence number.

svn path=/trunk/; revision=42445
2012-05-05 21:06:16 +00:00
Jörg Mayer
40f379ea49 Fix:
trunk/epan/dissectors/packet-sctp.c: In function ‘dissect_add_outgoing_streams_parameter’:
trunk/epan/dissectors/packet-sctp.c:1175:9: error: variable ‘length’ set but not used [-Werror=unused-but-set-variable]
trunk/epan/dissectors/packet-sctp.c: In function ‘dissect_add_incoming_streams_parameter’:
trunk/epan/dissectors/packet-sctp.c:1195:9: error: variable ‘length’ set but not used [-Werror=unused-but-set-variable]


svn path=/trunk/; revision=42025
2012-04-11 19:16:04 +00:00
Michael Tüxen
8421176e01 Add support for RFC 6525.
svn path=/trunk/; revision=41874
2012-03-31 22:01:36 +00:00
Michael Tüxen
34d5241775 Add support for SSH over SCTP.
svn path=/trunk/; revision=41556
2012-03-15 08:23:26 +00:00
Jeff Morriss
89cfdc3559 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -
make Save-As/Displayed/All-Packets save not only the displayed packets but
also any other packets needed (e.g., for reassembly) to fully dissect the
displayed packets.

This works only for the "All packets" case; choosing only the Selected packet,
the Marked packets, or a range of packets would require actually storing which
packets depend on which (too much memory) or going through the packet list many
times (too slow).  Also, this behavior is always the case: you can't save the
displayed packets without their dependencies (I don't see why this would be
desirable).

So far this is done for SCTP and things using the reassembly routines (TCP has
been tested).

The Win32 dialog was modified but hasn't been tested yet.

One confusing aspect of the UI is that the Displayed count in the Save-As
dialog does not match the number of displayed packets.  (I tried renaming the
button "Displayed + Dependencies" but it looked too big.)  The tooltip tries
to explain this and the fact that this works only in the All-Packets case;
suggestions for improvement are welcome.


Implementation details:

Dissectors (or the reassembly code) can list frames which were needed to
build the current frame's tree.  If the current frame passes the display
filter then each listed frame is marked as "depended upon" (this takes up the
last free frame_data flag).

When performing a Save-As/Displayed/All-Packets then choose packets which
passed the dfilter _or_ are depended upon.

svn path=/trunk/; revision=41216
2012-02-28 03:19:49 +00:00
Jaap Keuter
caa30d0c3d From Thomas Dreibholz:
ASCONF and ASCONF_ACK chunks have a "Sequence Number" field (RFC 5061, 4.1.1
and 4.1.2). The dissector wrongly calls it "Serial number". The attached patch
fixes this issue. 

svn path=/trunk/; revision=40140
2011-12-09 22:56:25 +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
cc4fe5789b Add an expert info if we found the checksum to be bad.
Add the checksum info to the tree even when !tree so that the expert_info
summary... "icon"... in the lower-left corner is correct.

svn path=/trunk/; revision=39460
2011-10-18 16:13:12 +00:00
Bill Meier
126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +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
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
Anders Broman
f08f09ecd4 From Michael Mann:
Condense all SCTP CRC routines to wsutil/crc32.[ch]. Also made
crc32_ccitt_table not explicitly accessible (must use crc32_ccitt_table_lookup).

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

svn path=/trunk/; revision=39233
2011-10-03 04:53:17 +00:00
Stig Bjørlykke
5359494b1f Second try to move crc routines to libwsutil.
This time keep the tvb routines in epan.

Now we can use common crc routines outside epan.

svn path=/trunk/; revision=38810
2011-08-31 09:00:54 +00:00
Stig Bjørlykke
71f903b956 Revert r38800, as the crc routines contains some tvb functions.
svn path=/trunk/; revision=38803
2011-08-30 14:17:40 +00:00
Stig Bjørlykke
4132d40e50 Move all crc routines to libwsutil.
This way we can use the crc routines in wiretap.

svn path=/trunk/; revision=38800
2011-08-30 13:46:42 +00:00
Bill Meier
5db6069274 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38085
2011-07-18 15:52:16 +00:00
Bill Meier
01a13cc082 Don't assign to an unused 'proto item *': Coverity 1033 & 906
svn path=/trunk/; revision=37308
2011-05-19 20:21:08 +00:00
Stig Bjørlykke
3c53c25a0c Corrected equality check in frag_equal().
Found by clang.

svn path=/trunk/; revision=36685
2011-04-17 18:49:58 +00:00
Jeff Morriss
e6ce1793e2 Don't pass retransmitted chunks to subdissectors. Instead just mark them as
retranmissions (in COL_INFO).  (Obviously this only works if TSN analysis is
enabled.)

This should make it more obvious to users which chunks are retransmissions and
will help avoid confusing the subdissector(s).

svn path=/trunk/; revision=36159
2011-03-07 19:23:55 +00:00
Michael Tüxen
7154ed5689 Obtained from Thomas Dreibholz: Update SCTP PPIDs.
svn path=/trunk/; revision=35895
2011-02-10 12:54:20 +00:00
Michael Tüxen
df6d8f49f9 Add expert info related to gap ack blocks.
Based on a patch submitted by Thomas Dreibholz.
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5616

svn path=/trunk/; revision=35672
2011-01-26 21:21:16 +00:00
Jeff Morriss
a167206685 Introduce, and start using, tvb_ip_to_str() and tvb_ip6_to_str(). These
do the same as the non-tvb equivalents but take a TVB and an offset instead
of a pointer to an array of bytes.

Their purpose is to prevent (many) dissectors from doing:
ip_to_str(tvb_get_ptr(...)).

(About the names and the location: I like the names as they are but the names
imply that they should live in tvbuff.c.  That would make some sense but
I didn't want to pull to_str.h into tvbuff.c...)

svn path=/trunk/; revision=35519
2011-01-13 15:53:30 +00:00
Jeff Morriss
1c5d75288c Don't attempt to reassemble short (reported_len > len) chunks.
svn path=/trunk/; revision=35486
2011-01-11 22:41:19 +00:00
Jeff Morriss
6e7d85a92c Don't store message fragments whose length is 0: there's no point. (Otherwise
fragment->len was left unitialized.)

Also (unrelated): save a couple of calls to tvb_reported_length() since the
value is already stored in a variable.

svn path=/trunk/; revision=35485
2011-01-11 22:36:31 +00:00
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