Commit Graph

48 Commits

Author SHA1 Message Date
Binh Trinh f41e1d22f0 [SCTP] ui: fix Analyse Association with correct number of endpoint streams
Bug: 15747
Change-Id: I2776f0efe5381ab6d94514ced29c3d9683315fe9
Reviewed-on: https://code.wireshark.org/review/33054
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-13 18:01:43 +00:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Vasil Velichkov b7a6a11376 Qt: fix several crashes in the SCTP Dialogs
Store the association id instead of a pointer to the volatile
"sctp_assoc_info_t" structure because it gets freed after a rescan.

Bug: 14970
Change-Id: Id8fe2dfe3549bd711fc8ddef0770b217e83c2088
Fixes: v1.11.3-rc1-604-g796bf409b0 ("Add dialogs and graphs to analyse SCTP behavior similar to the GTK version.")
Reviewed-on: https://code.wireshark.org/review/28711
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-20 05:01:11 +00:00
Guy Harris 9b731e2b32 Add a tap "finish" callback, called when a listener is removed.
Change-Id: Ic6c23dbd39d1adf8f730f1c866e409f731947475
Reviewed-on: https://code.wireshark.org/review/28786
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-21 00:51:13 +00:00
ruengeler 1f6eb7d7a8 SCTP: Adjust minTSN
Change-Id: If2ccbd983a2a31441d1e882da65971860f5bec94
Reviewed-on: https://code.wireshark.org/review/28013
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2018-06-04 20:49:36 +00:00
Anders 07454464a4 sctp-analysis: Use g_list_free_full() in a couple of places.
Change-Id: Ifd9517c562660ddee59feac1a7c234b9cdbbdf98
Reviewed-on: https://code.wireshark.org/review/27867
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-28 11:57:14 +00:00
Pascal Quantin e299b4098b SCTP: plug the remaining memleaks in the tap
Change-Id: I50da5f8c54c7be49ad8339d22639605daf2c5616
Reviewed-on: https://code.wireshark.org/review/27821
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-26 14:20:49 +00:00
Pascal Quantin 06879e89c0 SCTP: fix crash when filtering an association
Do not free a tsn_t element if it has already been inserted in a GList.
The code structure is complex enough to add an explicit check before
calling g_free().
Fixes a regression introduced in gb19ca06fcc.

While we are at it, let's call the correct free function and plug some
memory leaks.

Bug: 14733
Change-Id: I071da96982da569083fd98b790e0d37ac0826ff1
Reviewed-on: https://code.wireshark.org/review/27808
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-26 11:23:51 +00:00
ruengeler ac7e609b9f SCTP: INIT collision
Change-Id: I283ce92048af39ff4cf54e5e401e714bf6ec308b
Reviewed-on: https://code.wireshark.org/review/27023
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-20 08:23:05 +00:00
Dario Lombardo 31425eac72 tap-sctp: replace g_malloc with g_new.
When allocating structs this increases a lot the code readability.

Change-Id: I86b26ea3debb400d6e1e8012206008740e528b23
Reviewed-on: https://code.wireshark.org/review/26523
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-17 21:23:48 +00:00
Dario Lombardo ecda3d0901 tap-sctp: remove guint32 unneeded allocations.
They've been replaced by direct cast.

Change-Id: I99fbc0463af724dc2592fbfe24a63c645902c703
Reviewed-on: https://code.wireshark.org/review/26522
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-17 21:23:35 +00:00
Dario Lombardo b19ca06fcc tap-sctp: remove leak of sack and tsn (found by clang).
Change-Id: I829f117f8e19f60d34104730fbb0bc4504f231dd
Reviewed-on: https://code.wireshark.org/review/26434
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-15 06:31:13 +00:00
Dario Lombardo f96abc7fc0 tap-sctp: remove leak of tmp_info (found by clang).
Change-Id: If2eff49d5cf2ec4c0df5e9cafc1c69383502d8ae
Reviewed-on: https://code.wireshark.org/review/26433
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-15 06:30:03 +00:00
Dario Lombardo d6161a656b tap-sctp: rework the memory allocations.
Change-Id: Iafab07cd5f83e94e92ef31d0183c42c6ec0c797c
Reviewed-on: https://code.wireshark.org/review/26419
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-15 06:29:13 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Dario Lombardo 4444561ef8 tap-sctp: change if to switch for a default case (found by clang).
Change-Id: I5158c1db63258e194cdad987529019069e537ab3
Reviewed-on: https://code.wireshark.org/review/25387
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-19 12:24:27 +00:00
Gerald Combs 3ed5b4fb67 Reformat some top-level ui files.
Make sure each ui/*.[ch] file uses identical (4-space) indentation.
Remove ui/.editorconfig. Fix up other formatting where needed.
SPDX-abbreviate the license blurb in the files we modify.

Change-Id: I5faa1c1eae9a4b6220422ad8e4ba7a341c7deb1f
Reviewed-on: https://code.wireshark.org/review/24632
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-30 00:14:16 +00:00
ruengeler c63f895159 SCTP: find right assoc id
Change-Id: I107b7f4c585ef5e080d6473a37b3db9a97f12365
Reviewed-on: https://code.wireshark.org/review/18325
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-10-25 16:24:51 +00:00
Pascal Quantin a383e692c8 Revert "tap: change glib functions to wmem."
This reverts commit 2e9f3c5d36.

It breaks the registration of codec, dissector and libwiretap plugins.

Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-19 10:47:10 +00:00
Dario Lombardo 2e9f3c5d36 tap: change glib functions to wmem.
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf
Reviewed-on: https://code.wireshark.org/review/15270
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-17 15:38:03 +00:00
Irene Ruengeler 4000386fdf Fix SCTP analysis broken
Bug: 12513
Change-Id: I3fdf79106ed007aadf528f0b373fb7a487f3d9a9
Reviewed-on: https://code.wireshark.org/review/15870
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>
2016-06-14 15:41:19 +00:00
João Valverde e4c059f67f Add free_address_wmem(), fix warnings [-Wcast-qual]
Try to improve address API and also fix some constness warnings
by not overloading the 'data' pointer to store malloc'ed buffers
(use private pointer for that instead).

Second try, now passing test suite.

Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f
Reviewed-on: https://code.wireshark.org/review/13946
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-26 23:09:43 +00:00
João Valverde ef929dc8eb Revert "Add free_address_wmem() and other extensions to address API"
This reverts commit 13ec77a9fc.

This commit introduces a segmentation fault for Lua code (uncovered by the test suite).

Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e
Reviewed-on: https://code.wireshark.org/review/13813
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-08 00:44:22 +00:00
João Valverde 13ec77a9fc Add free_address_wmem() and other extensions to address API
Try to improve 'address' API (to be easier/safer) and also avoid
some constness warnings by not overloading the 'data' pointer to
store malloc'ed buffers (use private pointer for that instead).

Change-Id: I7456516b12c67620ceadac447907c12f5905bd49
Reviewed-on: https://code.wireshark.org/review/13463
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07 23:22:30 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Guy Harris 8a5b29c8f3 Fix indentation.
Change-Id: I5b01865b33b65ee55718be680b6d17cdeee1a809
Reviewed-on: https://code.wireshark.org/review/13208
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12 05:20:42 +00:00
ruengeler d8bbd232cd SCTP: Fix warning found by PVS Studio
Change-Id: I713eb6eff3681573baf77274847a32a4cc6b9ee0
Reviewed-on: https://code.wireshark.org/review/12408
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:14:57 +00:00
Gerald Combs d9e530bc17 Use address functions instead of ADDRESS macros in ui.
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the ui directory.

Change-Id: I10e95e66c8da5b880133452ebc484c53046e87ba
Reviewed-on: https://code.wireshark.org/review/11199
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:46:12 +00:00
ruengeler d52322efb3 SCTP I-DATA support
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-05 17:38:08 +00:00
Michael Tüxen c53d2f0d0e Revert "SCTP: Add I_DATA support"
This reverts commit 4e9361dc88.

Change-Id: Ia7aee9ffbe5bc5d3ae88e957c234cbee7b65f457
Reviewed-on: https://code.wireshark.org/review/10723
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2015-10-01 14:22:12 +00:00
ruengeler 4e9361dc88 SCTP: Add I_DATA support
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-10-01 11:47:04 +00:00
Gerald Combs 9557c73f81 Make sure per-packet tap callbacks return gbooleans.
The tap API changed the return type of per-packet listener callbacks
from int to gboolean back in 2009. Update a bunch of functions and some
documentation accordingly.

Change-Id: I79affe65db975caed3cc296a7e2985b7b9cdf4cc
Reviewed-on: https://code.wireshark.org/review/9853
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-03 03:06:00 +00:00
Jeff Morriss 1478db03d5 Fix up formatting and indentation a bit.
Change-Id: Ifdc6b8b2525efdc9e0f73519e73afbd4adbf65f4
Reviewed-on: https://code.wireshark.org/review/7191
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-02-17 03:41:20 +00:00
Michael Mann 90a76e0d51 Convert val_to_str -> val_to_str_wmem.
This is mostly for GUI usage, but a few dissectors needed some "non-packet scope" conversions.

val_to_str officially now uses wmem_packet_scope()

Change-Id: Ic9413eeb3406d7a7683222b86709f3675d628d81
Reviewed-on: https://code.wireshark.org/review/6933
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-04 06:58:49 +00:00
Martin Mathieson 43f09e67b4 Remove unneeded includes from ui folder
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a
Reviewed-on: https://code.wireshark.org/review/6128
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-01 23:11:10 +00:00
Bill Meier 1b8b2a8aa8 Add editor modelines; Adjust whitespace as needed.
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad
Reviewed-on: https://code.wireshark.org/review/4626
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12 18:58:32 +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
Gerald Combs 0f2014bf21 Scan-build didn't like the fixes in g79ef36a5f.
Change-Id: I1083136f9e4fb38b55e9b9c2fec74ddec35f198e
Reviewed-on: https://code.wireshark.org/review/452
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-02 20:12:33 +00:00
Gerald Combs 79ef36a5f0 Fix some scan-build warnings.
Fix a modeline while we're at it.

Change-Id: Ief6d5edbe33456170059cfab4f436f0844de32a1
Reviewed-on: https://code.wireshark.org/review/440
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-01 19:15:38 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Irene Rüngeler 4729c083ac Add 'Filter Association' to context menu in packet list.
svn path=/trunk/; revision=54219
2013-12-18 13:49:10 +00:00
Jakub Zawadzki 2c015bb386 Fix some const/ not const warnings.
svn path=/trunk/; revision=54114
2013-12-15 12:35:00 +00:00
Irene Rüngeler 7cfa3d05a3 Address Windows warning
svn path=/trunk/; revision=54031
2013-12-13 09:14:20 +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
Irene Rüngeler 15a7add3ce Add licence information.
svn path=/trunk/; revision=52999
2013-10-31 07:54:06 +00:00
Jeff Morriss aa452c378f Set SVN properties.
svn path=/trunk/; revision=52976
2013-10-30 00:43:46 +00:00
Irene Rüngeler 6d3988ffd3 Make the packet analysis for SCTP independent from GTK and QT.
svn path=/trunk/; revision=52945
2013-10-29 12:11:23 +00:00