aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sctp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-11-26SCTP: add another NULL dereference checkPascal Quantin1-6/+8
This is a follow-up of g2259bf8 Change-Id: I4dfb839fcd016a8d7a7210e6358d230025eb96a3 Reviewed-on: https://code.wireshark.org/review/12171 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-25SCTP: verify frame pointer before dereferencing itPascal Quantin1-6/+8
Bug: 11767 Change-Id: Icd01550e0aaa4cd0cc33ae3acc0ef702c38f4db4 Reviewed-on: https://code.wireshark.org/review/12146 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-14register_dissector -> new_register_dissectorMichael Mann1-3/+5
Picking off "easy" dissectors that only have one or two exit points at most. This concludes a "first pass" over the dissector directory. Change-Id: If5ce5484214be50fe541cba478da1de62e354297 Reviewed-on: https://code.wireshark.org/review/11830 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-2/+2
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-0/+1
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-2/+2
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-06SCTP: fix dissection of DATA chunksPascal Quantin1-1/+1
Regression introduced in gd52322e Change-Id: I57baf53d81c7e95ea8ad15e4799033d341e4ee61 Reviewed-on: https://code.wireshark.org/review/10845 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-05Add BASE_PT_ field display typesJoão Valverde1-4/+4
Avoid displaying duplicate port numbers with transport name resolution disabled and make some dissector code simpler. Introduces port_with_resolution_to_str_buf() function and amends UDP/TCP/DCCP/SCTP to use the new field display type. Change-Id: Ifb97810b9c669ccbb1a310a2c0ffd6e2b63af210 Reviewed-on: https://code.wireshark.org/review/10625 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05SCTP I-DATA supportruengeler1-60/+172
Change-Id: I459942b9e3287d500dda517568252d4cb56d3216 Reviewed-on: https://code.wireshark.org/review/10802 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Michael Tüxen <tuexen@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2015-10-05Move utf8_entities.h to wsutilJoão Valverde1-5/+1
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0 Reviewed-on: https://code.wireshark.org/review/10786 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-01Revert "SCTP: Add I_DATA support"Michael Tüxen1-142/+55
This reverts commit 4e9361dc88eefef27d031e29e2f8ca9891cc03eb. Change-Id: Ia7aee9ffbe5bc5d3ae88e957c234cbee7b65f457 Reviewed-on: https://code.wireshark.org/review/10723 Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2015-10-01SCTP: Add I_DATA supportruengeler1-55/+142
Change-Id: Ib8566b7d94fdafdb9735b356d129f378c94af3cf Reviewed-on: https://code.wireshark.org/review/10716 Reviewed-by: Michael Tüxen <tuexen@wireshark.org> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-03Split init of misc dissectors into init/cleanup functionsPeter Wu1-24/+8
Convert remaining dissectors to use cleanup routines when possible. (Single-)linked lists require NULL, so do reset their pointers to NULL. Generated with https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=69af86e6c2cf965ba3d7f9636b647b195f0b7d57 (with AUDIT = ALWAYS_EMIT_CLEANUP_CODE = True) Remaining dissectors which did not need further changes: epan/dissectors/packet-aeron.c epan/dissectors/packet-bootp.c epan/dissectors/packet-brdwlk.c epan/dissectors/packet-drda.c epan/dissectors/packet-etch.c epan/dissectors/packet-fix.c epan/dissectors/packet-fw1.c epan/dissectors/packet-lbm.c epan/dissectors/packet-ldss.c epan/dissectors/packet-simulcrypt.c epan/dissectors/packet-spdy.c epan/dissectors/packet-starteam.c epan/dissectors/packet-udp.c Change-Id: Idcacfea6a5de38d40e67db4cdcd0452ad9f9a6a9 Reviewed-on: https://code.wireshark.org/review/9228 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25Add ability to export PDUs for heuristic dissectors alsoPascal Quantin1-1/+1
Change-Id: I1bf1aa9794f9b4f106edffd4986fc0b1014522fa Reviewed-on: https://code.wireshark.org/review/9099 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-23Remove more deprecated tvb_length callsEvan Huus1-26/+26
Change-Id: Ie40a195db622ebfb096fa5088c5467a1385e69bf Reviewed-on: https://code.wireshark.org/review/9062 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-03-12Use FT_FRAMENUM_ACK in SCTP too.Jeff Morriss1-1/+1
Also fix up the hf description to make it clearer (to me) that this frame number is pointing *to* the ACK, not *from* it. Change-Id: Ic60e949e65f3988f9ac34fff39d4addc28a1fdbc Reviewed-on: https://code.wireshark.org/review/7658 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-18Make UAT record update callbacks return a success/failure indication.Guy Harris1-4/+5
Have them return TRUE on success and FALSE on failure. Check the return value rather than whether the error string pointer is null or not. Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c Reviewed-on: https://code.wireshark.org/review/7222 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-17Don't send an effectively empty message (no TVBs) to the SCTP tap.Jeff Morriss1-1/+1
This prevents the tap from crashing (asserting out) because there's no (initialized) TVB to look at. Bug: 9849 Change-Id: I370a49ef32a67e504c30cf1762a2180bf13c56ca Reviewed-on: https://code.wireshark.org/review/7190 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-13UAT error string pointers should not be const pointers.Guy Harris1-1/+1
UAT error strings are usually allocated by g_strdup() or g_strdup_printf(), and must ultimately be freed by the caller. Make the pointer-to-error-string-pointer arguments to various functions be "char **", not "const char **". Fix cases that finds where a raw string was being used, as that won't work if you try to free it; g_strdup() it instead. Add a missing free of an error string. Remove some no-longer-necessary casts. Remove some unnecessary g_strdup()s (the string being handed to it was already g_malloc()ated). Change some variable declarations to match. Put in XXX comments for some cases where the error string is just freed, without being shown to the user. Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0 Reviewed-on: https://code.wireshark.org/review/6525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-08Eliminate proto_tree_add_text from some dissectors.Michael Mann1-1/+1
Change-Id: Ief4c377d56748e1a8ed0ef7fe5ba03b9be00cd8d Reviewed-on: https://code.wireshark.org/review/6267 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08ep_<protocol>_port_to_display -> <protocol>_port_to_displayMichael Mann1-2/+2
Adjust any other ep_ related APIs related to the transition. Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c Reviewed-on: https://code.wireshark.org/review/6388 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-02tshark: Add endpoints statisticsMichael Mann1-1/+1
"stat name" has been official changed to "endpoints" for all dissectors, rather than a mixture of "host"/"endpoints" based on dissector. Change-Id: If34bcb5165b493948e784ba038ab202803a59843 Reviewed-on: https://code.wireshark.org/review/6154 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-31SCTP: fix Nesting level does not match indendation (CID 1159213 & 1159215 )Alexis La Goutte1-2/+0
Change-Id: Icd04c5f1f09b9cf704828e4b6a598cd2c1f6dd15 Reviewed-on: https://code.wireshark.org/review/6172 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+1
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21Have a heur_dissector_list_t be an opaque handle.Guy Harris1-1/+1
This allows dissector lists to be looked up by name, so they can be shared by multiple dissectors. (This means that there's no "udplite" heuristic dissector list, but there shouldn't be one - protocols can run atop UDP or UDPLite equally well, and they share a port namespace and uint dissector table, so they should share a heuristic dissector table as well.) Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7 Reviewed-on: https://code.wireshark.org/review/5936 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-09SCTP: Missing break in switch (CID 1135556)Alexis La Goutte1-0/+2
Change-Id: I00939bb9699493fe7af21497d9e9c013cc3d2e62 Reviewed-on: https://code.wireshark.org/review/5650 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-07Endpoint: wrong filter when select a SCTP endpoint (INVALID == a.x.y.z ...)Alexis La Goutte1-2/+23
Change-Id: I396e9af7971ee8be6fc9548162ff37fe704f0289 Reviewed-on: https://code.wireshark.org/review/5651 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-05Strengthen association matching when we haven't seen the INIT/INIT-ACK.Jeff Morriss1-17/+26
The fact that the vtag matches the initiate tag doesn't mean much if both are 0 (uninitialized). Also leave in some (commented-out) debug to make debugging this stuff easier in the future. Change-Id: Id007de8bf9d2d4e0bb18309ed3e2572fedda45f1 Reviewed-on: https://code.wireshark.org/review/5571 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-11-26Remove the use of pinfo->private_data from dissectors that just save it to ↵Michael Mann1-7/+0
restore it. Change-Id: I13197cc48068bb35ee12a7023cfe5f76bbc4e264 Reviewed-on: https://code.wireshark.org/review/5486 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-19Add support for PAD chunks.Michael Tüxen1-0/+18
Add support for PAD chunks as defined in RFC 4820. Change-Id: I66a83d5d133429154fe40ccef26687c8350463cf Reviewed-on: https://code.wireshark.org/review/5393 Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-11-19Fix the length reported as value length.Michael Tüxen1-3/+6
The length reported as value length for unknown chunks was actually the chunk length. Therefore it was off by 4. Change-Id: Ieea79d2c51b4729fc139395174625d1f362d1ee5 Reviewed-on: https://code.wireshark.org/review/5392 Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-09-11Show the sctp.checksum_bad filter rather than hiding it.Jeff Morriss1-23/+25
Follow TCP's lead by putting the filter in a subtree under the checksum. Change-Id: I9351ee865011cd04bc3d3e88c51e8dbb3dc23f07 Reviewed-on: https://code.wireshark.org/review/4082 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-09-11Don't use tvb_bytes_exist() to check if we captured the whole frame, justJeff Morriss1-11/+11
compare captured_length to reported_length (which we've already retrieved anyway). Replace calls to tvb_length() with non-deprecated versions. Change-Id: I9f6f3461915573fb21716a87cb6af416a3656097 Reviewed-on: https://code.wireshark.org/review/4080 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-31conv is always used, remove _U_ (unused) flagAlexis La Goutte1-1/+1
Change-Id: I648b365b662bd902e26e0c61f6d3499e8543e504 Reviewed-on: https://code.wireshark.org/review/3935 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-27TCP/UDP/SCTP: fix Dereference of null pointer found by Clang AnalyzerAlexis La Goutte1-0/+4
The warning coming after change in g018b84de8 Change-Id: Ia96cdb2993a6283d8de2647c6723ec6b2b0977eb Reviewed-on: https://code.wireshark.org/review/3752 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-23Update the SCTP PPIDs.Michael Tüxen1-5/+8
Change-Id: I0b34e544d4332f2b5d8dcc287861636db86ac1b9 Reviewed-on: https://code.wireshark.org/review/3801 Petri-Dish: Michael Tüxen <tuexen@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-08-18Refactor "common" hostlist/endpoint table functionality.Michael Mann1-1/+23
This is very similar in architecture to the changes made to the Conversation table functionality. Since all conversations have endpoints/hostlists, the "registered" list is shared for both. Change-Id: Ie8c6910a68a1b3f27c5b18c4494f49b9404a7b31 Reviewed-on: https://code.wireshark.org/review/3214 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-08Wrap tvb_get_ptr() calls in the CRC routines.Guy Harris1-6/+8
That doesn't eliminate them, but at least it encapsulates them. Change-Id: I78f0202cb7d2eb86e2dce220b2b97acc256d1e42 Reviewed-on: https://code.wireshark.org/review/3489 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-05Do various minor dissector changes:Bill Meier1-11/+11
- remove unneeded initializers; - replace tabs in files with editor mode line 'expandtabs'; - col_set_str() --> col_add_str() (in one case); - tvb_length() -- > tvb_reported_length() (in one case); - do some whitespace & indentation fixes/changes. Change-Id: Ib8ffbbcdb6e4a74c0df6021a75430ae1ef9ae089 Reviewed-on: https://code.wireshark.org/review/3435 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-03Fix TCP/UDP/SCTP conversations broken by g59ef97d and g31ecdf5Pascal Quantin1-0/+21
Bug: 10336 Change-Id: Ia0dbe3abfade59a1c9714eacd8a854eafa6cf879 Reviewed-on: https://code.wireshark.org/review/3379 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-30Apply refactored "conversation" (tap) data to TShark.Michael Mann1-1/+1
I intentionally left the fields displayed alone (so they don't exactly match Wireshark GUI), because as Guy points out in bug 6310, not sure its A Bug or A Feature. But at least all types of conversations allowed are in sync with Wireshark GUI. Bug:6310 Change-Id: I722837df510a39dadc1f9a07a99275509516698c Reviewed-on: https://code.wireshark.org/review/3212 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-26Refactor "common" Conversation table functionality.Michael Mann1-0/+31
Refactor (non-GUI) conversation table functionality from gtk/Qt to epan. Also refactor "common GUI" conversation table functionality. The idea is to not have to modify the GUI when a dissector adds a new "conversation type" Change-Id: I11f08d0d7edd631218663ba4b902c4a4c849acda Reviewed-on: https://code.wireshark.org/review/3113 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-17Escape some characters like \n when appending textMichael Tüxen1-1/+1
This patch escapes some characters like \n when showing text contained in a packet by appending it to a protocol item. Change-Id: Ice0040040ec7ab573dd9a412f8c0c197a566a031 Reviewed-on: https://code.wireshark.org/review/3095 Petri-Dish: Michael Tüxen <tuexen@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-09convert to proto_tree_add_subtree[_format]Michael Mann1-14/+14
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44 Reviewed-on: https://code.wireshark.org/review/2946 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22Fix a leak in the SCTP dissectorEvan Huus1-29/+44
use wmem instead of glib Change-Id: I326d2dd71b13ae45b4434c86fdacf9f3cec6c069 Reviewed-on: https://code.wireshark.org/review/2557 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-20Cleanup display filters reported by checkfiltername.plMichael Mann1-1/+1
Also ensured some files have their correct names at the top so they are more easily grepped Change-Id: Ib0f5ddf14eb1616a93dee496107dc0eb09048825 Reviewed-on: https://code.wireshark.org/review/2452 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-30/+30
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-30/+30
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-1/+1
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>