| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
voip_calls_dialog.h
Go to the documentation of this file.
1
9
10#ifndef VOIP_CALLS_DIALOG_H
11#define VOIP_CALLS_DIALOG_H
12
13#include <config.h>
14
15#include <mutex>
16
17#include <epan/cfile.h>
18
19#include "ui/voip_calls.h"
20#include "ui/rtp_stream.h"
21#include "ui/rtp_stream_id.h"
22
23#include <ui/qt/models/voip_calls_info_model.h>
24#include <ui/qt/models/cache_proxy_model.h>
25#include "ui/rtp_stream_id.h"
26#include "wireshark_dialog.h"
27
28#include <QMenu>
29#include <QAbstractButton>
30#include <QPushButton>
31#include <QToolButton>
32
33 class SequenceInfo;
34
35 namespace Ui {
36 class VoipCallsDialog;
37}
38
39// Singleton by [https://refactoring.guru/design-patterns/singleton/cpp/example#example-1](https://refactoring.guru/design-patterns/singleton/cpp/example#example-1)
40
44 class VoipCallsDialog : public WiresharkDialog
45{
46 Q_OBJECT
47
48 public:
56 static VoipCallsDialog *openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
57
65 static VoipCallsDialog *openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
66
70 VoipCallsDialog(VoipCallsDialog &other) = delete;
71
75 void operator=(const VoipCallsDialog &) = delete;
76
77signals:
83 void updateFilter(QString filter, bool force = false);
84
89 void captureFileChanged(capture_file *cf);
90
95 void goToPacket(int packet_num);
96
101 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
102
107 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
108
113 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
114
119 void rtpStreamsDialogSelectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
120
125 void rtpStreamsDialogDeselectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
126
127 public slots:
131 void rtpPlayerReplace();
132
136 void rtpPlayerAdd();
137
141 void rtpPlayerRemove();
142
143 protected:
150 explicit VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows = false);
151
155 ~VoipCallsDialog();
156
161 void contextMenuEvent(QContextMenuEvent *event) override;
162
166 virtual void removeTapListeners() override;
167
171 void captureFileClosing() override;
172
176 void captureFileClosed() override;
177
184 bool eventFilter(QObject *obj, QEvent *event) override;
185
186 protected slots:
191 void changeEvent(QEvent* event) override;
192
193 private:
194 // We have two singletones - one for all protocols, one for sip protocol
196 static VoipCallsDialog *pinstance_voip_;
197
199 static VoipCallsDialog *pinstance_sip_;
200
202 bool all_flows_;
203
205 static std::mutex init_mutex_;
206
208 Ui::VoipCallsDialog *ui;
209
211 VoipCallsInfoModel *call_infos_model_;
212
214 CacheProxyModel *cache_model_;
215
217 QSortFilterProxyModel *sorted_model_;
218
220 QWidget &parent_;
221
223 voip_calls_tapinfo_t tapinfo_;
224
226 SequenceInfo *sequence_info_;
227
229 QPushButton *prepare_button_;
230
232 QPushButton *sequence_button_;
233
235 QToolButton *player_button_;
236
238 QPushButton *copy_button_;
239
241 bool voip_calls_tap_listeners_removed_;
242
244 GQueue* shown_callsinfos_;
245
246 // Tap callbacks
251 static void tapReset(void *tapinfo_ptr);
252
257 static tap_packet_status tapPacket(void *, packet_info *, epan_dissect_t *, const void *, tap_flags_t);
258
263 static void tapDraw(void *tapinfo_ptr);
264
271 static int compareCallNums(const void *a, const void *b);
272
276 void updateCalls();
277
281 void prepareFilter();
282
286 void showSequence();
287
291 void showPlayer();
292
296 void removeAllCalls();
297
301 void invertSelection();
302
308 QList<QVariant> streamRowData(int row) const;
309
314 QVector<rtpstream_id_t *>getSelectedRtpIds();
315
316 private slots:
320 void selectAll();
321
325 void selectNone();
326
330 void copyAsCSV();
331
335 void copyAsYAML();
336
340 void switchTimeOfDay();
341
346 void on_callTreeView_activated(const QModelIndex &index);
347
352 void on_buttonBox_clicked(QAbstractButton *button);
353
357 void on_buttonBox_helpRequested();
358
362 void updateWidgets() override;
363
368 void captureEvent(CaptureEvent e);
369
374 void displayFilterCheckBoxToggled(bool checked);
375
379 void on_actionSelectAll_triggered();
380
384 void on_actionSelectInvert_triggered();
385
389 void on_actionSelectNone_triggered();
390
394 void on_actionSelectRtpStreams_triggered();
395
399 void on_actionDeselectRtpStreams_triggered();
400};
401
402#endif // VOIP_CALLS_DIALOG_H
cache_proxy_model.h
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
CacheProxyModel
Caches any data read access to the source model, returning an older copy if the source model is inval...
Definition cache_proxy_model.h:26
CaptureEvent
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
CaptureFile
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
SequenceInfo
Reference-counted wrapper for sequence analysis information.
Definition sequence_dialog.h:36
VoipCallsDialog::rtpPlayerDialogAddRtpStreams
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request adding RTP streams to the player dialog.
VoipCallsDialog::changeEvent
void changeEvent(QEvent *event) override
Handles generic state change events.
Definition voip_calls_dialog.cpp:287
VoipCallsDialog::rtpPlayerDialogReplaceRtpStreams
void rtpPlayerDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request replacing RTP streams in the player dialog.
VoipCallsDialog::rtpPlayerReplace
void rtpPlayerReplace()
Slot to trigger replacing streams in the RTP player.
Definition voip_calls_dialog.cpp:645
VoipCallsDialog::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition voip_calls_dialog.cpp:259
VoipCallsDialog::rtpStreamsDialogDeselectRtpStreams
void rtpStreamsDialogDeselectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request deselecting specific RTP streams in the streams dialog.
VoipCallsDialog::updateFilter
void updateFilter(QString filter, bool force=false)
Signal emitted to update the display filter.
VoipCallsDialog::rtpStreamsDialogSelectRtpStreams
void rtpStreamsDialogSelectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request selecting specific RTP streams in the streams dialog.
VoipCallsDialog::captureFileClosing
void captureFileClosing() override
Handles operations required just before the capture file closes.
Definition voip_calls_dialog.cpp:235
VoipCallsDialog::openVoipCallsDialogVoip
static VoipCallsDialog * openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for VoIP calls.
Definition voip_calls_dialog.cpp:50
VoipCallsDialog::operator=
void operator=(const VoipCallsDialog &)=delete
Should not be assignable.
VoipCallsDialog::VoipCallsDialog
VoipCallsDialog(VoipCallsDialog &other)=delete
Should not be cloneable.
VoipCallsDialog::rtpPlayerDialogRemoveRtpStreams
void rtpPlayerDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request removing RTP streams from the player dialog.
VoipCallsDialog::captureFileClosed
void captureFileClosed() override
Handles cleanup after the capture file is fully closed.
Definition voip_calls_dialog.cpp:249
VoipCallsDialog::rtpPlayerRemove
void rtpPlayerRemove()
Slot to trigger removing streams from the RTP player.
Definition voip_calls_dialog.cpp:659
VoipCallsDialog::goToPacket
void goToPacket(int packet_num)
Signal emitted to navigate to a specific packet.
VoipCallsDialog::removeTapListeners
virtual void removeTapListeners() override
Safely removes all tap listeners used by the dialog.
Definition voip_calls_dialog.cpp:226
VoipCallsDialog::~VoipCallsDialog
~VoipCallsDialog()
Destroys the VoipCallsDialog object.
Definition voip_calls_dialog.cpp:199
VoipCallsDialog::rtpPlayerAdd
void rtpPlayerAdd()
Slot to trigger adding streams to the RTP player.
Definition voip_calls_dialog.cpp:652
VoipCallsDialog::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Event filter for capturing specific events.
Definition voip_calls_dialog.cpp:163
VoipCallsDialog::openVoipCallsDialogSip
static VoipCallsDialog * openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for SIP calls.
Definition voip_calls_dialog.cpp:62
VoipCallsDialog::captureFileChanged
void captureFileChanged(capture_file *cf)
Signal emitted when the capture file changes.
VoipCallsInfoModel
Table model that exposes a list of VoIP call records for display in the VoIP Calls dialog,...
Definition voip_calls_info_model.h:27
WiresharkDialog::updateWidgets
virtual void updateWidgets()
Updates the state and contents of the dialog's widgets.
Definition wireshark_dialog.cpp:92
WiresharkDialog::WiresharkDialog
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
rtp_stream.h
rtp_stream_id.h
tap_packet_status
tap_packet_status
Definition tap.h:22
voip_calls.h
voip_calls_tapinfo_t
struct _voip_calls_tapinfo voip_calls_tapinfo_t
Aggregated tap state for the VoIP calls analysis, covering all detected calls and streams.
voip_calls_info_model.h
wireshark_dialog.h