Commit Graph

37 Commits

Author SHA1 Message Date
Roland Knall 2cf938cfa8 tap: Adding flags for tap_packet
This allows flags to be passed by the registering listener
to the collection of information
2022-06-10 05:46:15 +00:00
Jirka Novak 411b3c1d78 Fix: Fixed issue with deadlock when same RTP dialog opened twice
RTP dialogs can stay opened, therefore calls of its functions are
protected by locks. There was issue that same mutex was used during
construction of the dialog and calling functions. It created possible
deadlock.
Change separates lock used for dialog creation and lock for function calls.
When function call lock is locked, new calls are ignored and warning is
printed to STDERR. Showing a dialog with warning looks too intrusive to me.

Fixes #18025
2022-04-06 07:16:59 +00:00
Moshe Kaplan 3953ddcf57 Add UI header files to Doxygen
Add @file markers for UI
header files so that Doxygen will
generate documentation for them.
2021-11-30 08:01:36 -05:00
Jirka Novak af059913b3 RTP Analysis: CSV export has header line
Export to CSV from RTP Analysis has header now. Header is on top of the
export so for export of multiple tabs it is just once in the export.
2021-08-18 19:27:10 +00:00
Jirka Novak c01456b77e VoIP Dialogs: Refactoring of singleton windows to factory methods
Singletons moved from main_window to each class's static open<NameOfClass>
method:
- RtpPlayerDialog
- RtpStreamDialog
- VoipCallsDialog
- RtpAnalysisDialog

Fixed issue with selecting RTP stream in sequence dialog. When user
selected a stream and moved mouse to Rtp Player button and pressed it,
incorrect RTP stream was sent to it.
2021-05-22 03:08:46 +00:00
Jirka Novak 6d6b376b43 VoIP dialogs: Default actions for buttons works as before
When button is pressed or triggered by shortcut, it opens same
window as before.
User can click small arrow next to button and it open menu with all
new actions e.g. Set/Add/Remove for RTP Player.
Documentation updated.
2021-05-04 20:45:35 +00:00
j.novak@netsystem.cz 0048142ea1 RTP Player: Added button 'Refresh streams' for live capture 2021-04-22 19:33:11 +00:00
Jirka Novak a8ccb67921 VoIP Calls: Streams related to calls can be selected in RTP Streams
When user press S(elect)/D(eselect) key, all RTP streams related to
selected call/calls are selected/deselected in RTP Streams window. If
window is not shown, it is opened.
Documentation updated.
2021-04-19 20:04:05 +00:00
Gerald Combs f7e5fb6952 Qt: Fix various missing prototype warnings.
Fix some noisy documentation bugs while we're here.
2021-04-16 22:25:22 +00:00
Jirka Novak c8479e41ae VoIP dialogs: Improvements and new functions
Changes:
- RTP Player added to Telephony/RTP menu.
- When openning RTP Analysis or RTP Player from RTP menu, just selected
  stream is added. When Ctrl is hold during opening, reverse stream is
searched and added too.
- RTP Player: Added tool to select/deselect all inaudible streams
- RTP Player: Added Prepare Filter button
- RTP Player: Added Analyze button
- RTP Analysis: Added Prepare Filter button
- documentation updated

Code changes:
- RTP Player::rescanPacket() is not fired multiple times during rate change and during dialog creation
- Error shown in RTP player is cleared after every new decode of streams
- RTP Player handles case when Qt do not emit stop stream event
- "Select" menu code unified between dialogs>
- RTP Player: Audio routing menu unified
- buttons are connected to actions by signals()
- Analyze dialog is called by list of rtpstream_id, not rtpstream_info
2021-04-15 21:19:51 +00:00
Jirka Novak c7f5646249 VoIP dialogs: Performance improvements
Retap and UI response are much faster when many RTP streams are
processed. RTP Streams/Analyse 1000+, RTP Player 500+.

Changes:
- RTP streams are searched with hash, not by iterating over list.
- UI operations do not redraw screen after every change, just after all
  changes. UI is locked when rereading packets.
- Sample list during RTP decoding is stored in memory so wireshark uses
  just half of opened files for audio decoding than before.
- Analysis window checkbox area is limited in height
- Dialogs shows shows count of streams, count of selected streams and
  count of unmuted streams
- Documentation extended with chapter about RTP decoding parameters
- Documentation extended with performance estimates
2021-04-14 14:02:58 +00:00
j.novak@netsystem.cz 8c6a7c13f9 RTP Player: Fix of opening of multiple dialogs 2021-04-10 08:48:40 +00:00
j.novak@netsystem.cz 2b072b8e76 RTP Stream Analysis: Process more streams than two, audio save removed 2021-04-07 05:40:09 +00:00
Jirka Novak 47862d8fce RTP Player: Dialog is nonmodal now and can be called multiple ways
Changes:
- refactored main_dialog handling of telephony dialogs
- RTP Player dialog is nonmodal now and can be left open
- it is possible to issue three actions on RTP Player dialog from other
  dialogs (other dialog have selected set of RTP streams before action)
  - replace - removes existing streams from RTP dialog and shows new set
  - add - adds new set to existing list in RTP dialog
  - remove - remove streams in set from list in RTP dialog
- Sequence Dialog:
  - was modified to hold rtpstream_info_t for RTP streams
  - added Play button
  - VoIP features (RTP Play button, select/deselect RTP stream) are
    disabled after creation and must be enabled. It handles that RTP
Play button is not shown e.g. in TCP sequence show
2021-03-30 07:57:22 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
Jirka Novak 8dd8491713 Qt framework: Dialogs are correctly notified when capture file was closed
The patch reintroduces WiresharkDialog::captureFileClosed() method and
calls captureFileClosing() and captureFileClosed() in right order.
Both methods call updateWidgets() at its end.

All dialogs were reviewed and captureFileClosing/Closed methods updated
when appropriate.
captureEvent() method in multiple dialogs changed to captureFileClosing/Closed
as it does same actions - looks like old style of detecting of capture
file closing.
2021-01-11 13:30:18 +00:00
Jirka Novak c1f5b4d2d9 rtp_analysis_dialog: Improved codec recognition during saving of audio to .au
I found that when codec is negotiated to nonstandard payload id, it was
reported as unsupported even was supported. Patch fixes it.

Change-Id: I4eb14fc22f83eb42300fc67baee8456dff65d191
Reviewed-on: https://code.wireshark.org/review/35575
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 09:18:59 +00:00
Jirka Novak 37f3c65ca5 rtp_analysis_dialog.cpp: save any supported codec as .au
Change improves Wireshark ability to save rtp streams. It allows a user
to save any supported codec with 8 kHz rate. In real, it means G.711 and
G.729 for now.
There is no hardcoded codec limitation during save anymore. If code detects
unsupported codec or rate during save, it replaces samples with silence and
reports it. Therefore any added codec in future will be supported.

Note to RTP saving:
RTP streams (there can be up to two of them for save) can contain multiple
codecs in each direction - some of it can be supported and some
unsupported. What should be exported then?
Till my patch save do not run and a user received nothing even part of stream
was OK/encoded with supported codec.
Therefore I managed the code to start with export and do its best.
Unknown codec/part is replaced with silence and user is warned after
export. Therefore a user will get:
a) audio - when all codecs are supported (no warning)
b) mix audio/silence - when some codecs are supported (warning)
c) only silence - when no codec is supported (warning)

BTW same output user sees/gets in RTP player for years.

Change-Id: Id938d419f5841af46d2d2d3ddfaf1ec9a0235bcc
Reviewed-on: https://code.wireshark.org/review/35105
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 16:06:49 +00:00
Uli Heilmeier 061ebbda56 Fixing some implicit coversations (-Wshorten-64-to-32)
Fixing some "implicit conversion loses integer precision" warnings
reported by clang with -Wshorten-64-to-32 option

Change-Id: Icd641d5f4fd8ff129f03f1b9e1da0fc86329f096
Reviewed-on: https://code.wireshark.org/review/31901
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-08 12:12:18 +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
Guy Harris c87a6d364d Make arrays of 4 octets arrays of 4 guint8.
That makes it clearer that it's not a string, and avoids some type
complaints from change Ida7b98af8c44a52ddac2c4ab0702db2519a0c4af.

Update a comment while we're at it.

Change-Id: I6737bb2a7ff3b4d461700c641cb580194f7809e7
Reviewed-on: https://code.wireshark.org/review/28572
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02 21:42:37 +00:00
Jiri Novak 1b4b5e59e9 RTP: Encapsulation of comparsion of two rtpstreams
Changes:
- rtpstream_id_t is introduced and its related functions. It encapsulates comparsion of two rtpstreams.
- dest_* renamed to dst_*
- src_port and dst_port are 16bits only.
- sharkd_session.c use common id functions
- IAX2 part related to RTP updated to common *id* function

Change-Id: Id38728a4e5d80363480c7ce42ff9c6eaad069686
Reviewed-on: https://code.wireshark.org/review/28340
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-20 08:26:31 +00:00
Jiri Novak 27a1906c58 RTP: Code clean up
Changes:
- rtpstream_packet renamed to rtpstream_packet_cb to follow *_cb pattern
- variables/types used in iax2_analysis_dialog were created as copy of *rtp* ones, but names were left as *rtp* -> *iax2*
- struct _rtp_stream_info replaced with rtp_stream_info_t
- there was tap-rtp-analysis.h, but no tap-rtp-analysis.c - related content was moved from tap-rtp-common.c
- *rtp_stream* functions renamed to *rtpstream*
- renamed rtp_stream_info_t to rtpstream_info_t to follow *rtpstream* pattern.
- renamed ui/rtp_stream.c rtpstream_draw -> rtpstream_draw_cb

Change-Id: Ib11ff5367cc464ea1b0c73432bc50b0eb9cd203e
Reviewed-on: https://code.wireshark.org/review/28299
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-19 15:05:12 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +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 e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Michael Mann 777acc73da Apply new CaptureEvents to statistics dialogs.
Refactoring from If366d42b07dc822636404ac44ba2306ec4418b4e ignored
dialogs outside of the main window.  Searched for removed signals
from CaptureFile class and applied new CaptureEvent handling.

Change-Id: I9e0aaa0dc1c702ce04810d27c8f9273997f7ca30
Reviewed-on: https://code.wireshark.org/review/25007
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-27 08:08:10 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Pascal Quantin 541beaad6e Qt: use references on tap_rtp_stat_t private members (CID 1397703 and 1397704)
This should solve the "passing parameter statinfo of type "tap_rtp_stat_t"
(size 5040 bytes) by value" warnings reported by Coverity.

Change-Id: I327906f7925ab21a914b8a98ff8481a0af9f7a2f
Reviewed-on: https://code.wireshark.org/review/19380
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-22 12:54:48 +00:00
Jiri Novak 9090afbfe9 Save RTP audio to file: RTP Stream Analysis dialog allows save audio for non G.711 codecs and mixed codecs
- spaghetti code for save was split into separate functions
- code saves G.711 only, all other codecs are saved as silence with correct duration
  - code is ready to include other codecs
  - code supports 8000 Hz sampling rate only, other rates are rejected with warning
  - bidirectional stream (forward and reverse) creates stereo .au file
- output is based on timestamps in RTP streams
  - save operation is slower than before because it is set of seek() - one per each codec sample
- code allows align of save audio:
  - as it is - each stream is saved from its beginning, no aling
  - to start of each other - later stream is prepended with silence
  - align saved audio to beginning of capture file - each stream is prepended with silence
- save to raw works correctly now - only payload is saved
  - old code was inserting G.711 silence time to time to raw data

Bug: 13242
Change-Id: I74d02a1cc1c75acf9ffe930d078c00a0555cbfb6
Reviewed-on: https://code.wireshark.org/review/19245
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-15 05:16:29 +00:00
Pascal Quantin bd030c166f Qt: activate RTP/IAX2 analysis widget when analyzing packets with a snaplen
Only the payload save should be deactivated

Bug: 12406
Change-Id: I8dd53c0b0c1ea4568f0ff292806656bfb65a6566
Reviewed-on: https://code.wireshark.org/review/15322
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-05-10 11:53:52 +00:00
Gerald Combs 18bec424fb Qt: Wire up the RTP Streams "Analyze" button.
Change-Id: I0ad5d689b6c05fd3f98ba3304a5d99297db2bd6c
Reviewed-on: https://code.wireshark.org/review/11198
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-10-21 21:18:59 +00:00
Gerald Combs f274902be5 Qt: Add a play button to the RTP Stream Analysis dialog.
Rename the "Play Call" button to "Play Streams". Move the button
creation code to a common routine. Use it to add a "Play Streams" button
to the RTP Stream Analysis, similar to the GTK+ UI.

Don't restrict RTP to IPv[46] as suggested by Michal. I don't have any
RTP-over-Bluetooth captures so I can't test this directly.

Change-Id: I4703cac1d5bf5b3ff0255d36da2c5164feb0547d
Reviewed-on: https://code.wireshark.org/review/10888
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-10-08 20:14:35 +00:00
Gerald Combs e4d9ce18d8 Move IAX2 analysis to the ui directory.
Rename ui/gtk/iax2_analysis.h to ui/tap-iax2-analysis.h. Move
iax2_packet_analyse to ui/tap-iax2-analysis.c.

Rename rtp_analysis.h to tap-rtp-analysis.h to match IAX2.

Change-Id: Ice7e9ad0d7bf62d631850089c880ec09a3e101dd
Reviewed-on: https://code.wireshark.org/review/10375
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-03 21:48:48 +00:00
Gerald Combs 7be155ee1e Try deleting WiresharkDialog when we close it.
QDialog::accept and ::reject hide the dialog but don't delete it. In the
case of WiresharkDialog and its subclasses we might leak memory or leave
files open. Call deleteLater when we close the dialog.

Change-Id: Ie0b848a7deeeee4667925b0d886e498f13a86bfc
Reviewed-on: https://code.wireshark.org/review/9781
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-07-24 20:03:28 +00:00
Gerald Combs d2acb04b4c Add the RTP Stream Analysis dialog.
Combine the GTK+ RTP Stream Analysis and RTP Graph Analysis dialogs into
one. Yell at the user less. Disable the Analyze RTP Stream menu item if
we don't have an RTP stream selected.

There are a *lot* of moving parts in this dialog. I've tested with the
few RTP captures I have but it's by no means complete.

"To do" items are listed at the top of rtp_analysis.cpp.

Change-Id: Id503977f069bebc46cc68bc749f0c9cbf4d37bf6
Reviewed-on: https://code.wireshark.org/review/9650
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-07-16 00:30:14 +00:00