Commit Graph

193 Commits

Author SHA1 Message Date
Jeff Morriss 6328f6eb12 Add a couple more in_error_pkt checks.
Don't attempt reassembly and squash an expert info when we're in an error
packet.

Change-Id: I7d19e4ab7add78829bf1e28ad92dce3a7431c37d
Reviewed-on: https://code.wireshark.org/review/964
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-04-06 17:34:04 +00:00
Jeff Morriss e2ded09289 Don't do TSN analysis on data chunks embedded in PKTDROP chunks; set in_error_pkt too.
Add a comment indicating what we should be doing when the PKTDROP chunk contains
a truncated data chunk.

Change-Id: Icbba4c6dafc5c2656fc337734a1a570ef4a055d2
Reviewed-on: https://code.wireshark.org/review/950
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-04 04:09:36 +00:00
AndersBroman ffe7134b18 Get the NEXT protocol not the previous top one.
Change-Id: I261a740cbc369d905c89236b5173944e2780af59
Reviewed-on: https://code.wireshark.org/review/751
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 14:44:25 +00:00
ruengeler 27ad4c0331 Add a new case to find existing assocs when only the information of an INIT chunk is provided.
Change-Id: I88c5367652fb59a3da2cfd8895a1c0cc5176b859
Reviewed-on: https://code.wireshark.org/review/740
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
Tested-by: Michael Tüxen <tuexen@wireshark.org>
2014-03-19 16:38:11 +00:00
Pascal Quantin 488f2a0974 Exported PDU: add support for data length on the wire
Change-Id: Iff14ec4d0297ec85f3597b33871fb0ab5256a597
Reviewed-on: https://code.wireshark.org/review/728
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19 05:13:30 +00:00
Pascal Quantin d832cb18db Fix OS-X compilation broken by gc354675
Change-Id: Ie32a2c256055059d1eade29af69eaad9011ca78b
Reviewed-on: https://code.wireshark.org/review/727
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-18 17:28:07 +00:00
AndersBroman c354675c41 Dechunk/export sctp payloads trough export PDU.
Change-Id: I86d21cadcbd3e85b7a91d509ffd3c317d76a2ce2
Reviewed-on: https://code.wireshark.org/review/726
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-18 17:08:50 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Evan Huus 9afdd44eec Improve SCTP association lookup.
It's still O(n) in the worst case since the comparison function doesn't appear
to be suitable for use in a tree or hash-table, but at least we no longer spend
O(n) by default just finding the end of the list so we can iterate backwards.

Discovered while investigating bug #9823, but probably not the cause of that
bug.

Change-Id: Ib6c3691cff8e7fa49703df7c75635ef797c8fbe8
Reviewed-on: https://code.wireshark.org/review/443
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-02 21:52:09 +00:00
Jeff Morriss 7e94ee9942 Enable SCTP reassembly by default.
This was suggested in:
http://ask.wireshark.org/questions/29660/sctp-protocols-in-frame-problem

Since desegmentation is enabled by default in TCP, it makes sense to me to do
the same in SCTP as well.

Change-Id: I3cb4c7900c600d21668d95003149f87b9a006f66
Reviewed-on: https://code.wireshark.org/review/200
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-13 22:21:10 +00:00
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Jeff Morriss b20e6a20eb Make the SCTP Decode-As dialog more consistent with the TCP one.
Rename the 2nd SCTP Transport tab to "SCTP(PPID)" to make it obvious what it
is.

Fix up casing and code formatting in both SCTP and TCP Decode-As code.

svn path=/trunk/; revision=54391
2013-12-23 16:50:25 +00:00
Bill Meier 026fae3855 Don't use 'L' as a constant modifier.
svn path=/trunk/; revision=54343
2013-12-21 21:42:18 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Irene Rüngeler 796bf409b0 Add dialogs and graphs to analyse SCTP behavior similar to the GTK version.
svn path=/trunk/; revision=54026
2013-12-13 07:25:30 +00:00
Anders Broman 2939977a4b - Make local functions static.
- Forward declaration of register functions.

svn path=/trunk/; revision=53942
2013-12-11 20:04:37 +00:00
Irene Rüngeler 706c629ae0 Add uat preferences to SCTP (QT only).
svn path=/trunk/; revision=53907
2013-12-10 15:39:16 +00:00
Irene Rüngeler 2f79fbda38 Fix clang warning.
svn path=/trunk/; revision=53878
2013-12-09 07:34:52 +00:00
Alexis La Goutte 4ed05f22b8 Remove trailing whitespace
svn path=/trunk/; revision=53847
2013-12-08 11:09:43 +00:00
Irene Rüngeler ae37302c39 Add assoc_index to the properties that can be filtered.
Find the association for each packet.

svn path=/trunk/; revision=53810
2013-12-06 14:45:06 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Michael Mann eabaddaca9 Remove ethertype, mpls_label and ppids from packet_info structure.
The information was converted to "proto" data within their respective dissectors strictly for use in "Decode As".

svn path=/trunk/; revision=53489
2013-11-21 20:08:20 +00:00
Michael Mann 76ab93ea94 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.

This patch includes just the dissector portion of the functionality (minus packet-dcerpc.[ch] because it has hooks to the current GUI)

svn path=/trunk/; revision=53445
2013-11-20 19:17:08 +00:00
Michael Mann bfcc63972e Remove ppid member from packet_info structure and just pass it to SCTP subdissectors. There are no subdissectors currently in Wireshark source that use the ppid member so any third party dissectors need to update accordingly.
svn path=/trunk/; revision=53424
2013-11-19 01:07:28 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Jakub Zawadzki ca42cb3e40 Move adler32 from epan/ to wsutil/
The same like done for crc*

svn path=/trunk/; revision=53190
2013-11-09 14:03:53 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Michael Tüxen 9175c79ac1 Update SCTP PPIDs and use newly assigned value.
svn path=/trunk/; revision=52175
2013-09-22 17:16:02 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Michael Tüxen 90ac3f129f Improve the display of AUTH related parameters.
Only use IANA registered values for HMAC ids.

svn path=/trunk/; revision=51755
2013-09-04 21:07:09 +00:00
Evan Huus 83a7fedb55 A few more dissectors to wmem.
svn path=/trunk/; revision=51616
2013-08-31 15:47:04 +00:00
Michael Mann e5e4d357e3 Batch of filterable expert infos.
svn path=/trunk/; revision=51518
2013-08-25 21:01:11 +00:00
Jeff Morriss b05d5554ed As suggested in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8816 :
Enable TSN analysis by default.

svn path=/trunk/; revision=51098
2013-08-01 21:46:38 +00:00
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