Wireshark 5.1.0
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
25#include "ui/rtp_stream_id.h"
26#include "wireshark_dialog.h"
27
28#include <QMenu>
29#include <QAbstractButton>
30#include <QPushButton>
31
32class SequenceInfo;
33
34namespace Ui {
35class VoipCallsDialog;
36}
37
38// Singleton by [https://refactoring.guru/design-patterns/singleton/cpp/example#example-1](https://refactoring.guru/design-patterns/singleton/cpp/example#example-1)
39
44{
45 Q_OBJECT
46
47public:
55 static VoipCallsDialog *openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
56
64 static VoipCallsDialog *openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
65
70
74 void operator=(const VoipCallsDialog &) = delete;
75
76signals:
82 void updateFilter(QString filter, bool force = false);
83
89
94 void goToPacket(int packet_num);
95
100 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
101
106 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
107
112 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
113
118 void rtpStreamsDialogSelectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
119
124 void rtpStreamsDialogDeselectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
125
126public slots:
130 void rtpPlayerReplace();
131
135 void rtpPlayerAdd();
136
140 void rtpPlayerRemove();
141
142protected:
149 explicit VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows = false);
150
155
160 void contextMenuEvent(QContextMenuEvent *event) override;
161
165 virtual void removeTapListeners() override;
166
170 void captureFileClosing() override;
171
175 void captureFileClosed() override;
176
183 bool eventFilter(QObject *obj, QEvent *event) override;
184
185protected slots:
190 void changeEvent(QEvent* event) override;
191
192private:
193 // We have two singletones - one for all protocols, one for sip protocol
195 static VoipCallsDialog *pinstance_voip_;
196
198 static VoipCallsDialog *pinstance_sip_;
199
201 bool all_flows_;
202
204 static std::mutex init_mutex_;
205
207 Ui::VoipCallsDialog *ui;
208
210 VoipCallsInfoModel *call_infos_model_;
211
213 CacheProxyModel *cache_model_;
214
216 QSortFilterProxyModel *sorted_model_;
217
219 QWidget &parent_;
220
222 voip_calls_tapinfo_t tapinfo_;
223
225 SequenceInfo *sequence_info_;
226
228 QPushButton *prepare_button_;
229
231 QPushButton *sequence_button_;
232
234 QPushButton *player_button_;
235
237 QPushButton *copy_button_;
238
240 bool voip_calls_tap_listeners_removed_;
241
243 GQueue* shown_callsinfos_;
244
245 // Tap callbacks
250 static void tapReset(void *tapinfo_ptr);
251
256 static tap_packet_status tapPacket(void *, packet_info *, epan_dissect_t *, const void *, tap_flags_t);
257
262 static void tapDraw(void *tapinfo_ptr);
263
270 static int compareCallNums(const void *a, const void *b);
271
275 void updateCalls();
276
280 void prepareFilter();
281
285 void showSequence();
286
290 void showPlayer();
291
295 void removeAllCalls();
296
300 void invertSelection();
301
307 QList<QVariant> streamRowData(int row) const;
308
313 QVector<rtpstream_id_t *>getSelectedRtpIds();
314
315private slots:
319 void selectAll();
320
324 void selectNone();
325
329 void copyAsCSV();
330
334 void copyAsYAML();
335
339 void switchTimeOfDay();
340
345 void on_callTreeView_activated(const QModelIndex &index);
346
351 void on_buttonBox_clicked(QAbstractButton *button);
352
356 void on_buttonBox_helpRequested();
357
361 void updateWidgets() override;
362
367 void captureEvent(CaptureEvent e);
368
373 void displayFilterCheckBoxToggled(bool checked);
374
378 void on_actionSelectAll_triggered();
379
383 void on_actionSelectInvert_triggered();
384
388 void on_actionSelectNone_triggered();
389
393 void on_actionSelectRtpStreams_triggered();
394
398 void on_actionDeselectRtpStreams_triggered();
399};
400
401#endif // VOIP_CALLS_DIALOG_H
struct _capture_file capture_file
Represents a capture file and its associated metadata.
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
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
Reference-counted wrapper for sequence analysis information.
Definition sequence_dialog.h:36
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request adding RTP streams to the player dialog.
void changeEvent(QEvent *event) override
Handles generic state change events.
Definition voip_calls_dialog.cpp:286
void rtpPlayerDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request replacing RTP streams in the player dialog.
void rtpPlayerReplace()
Slot to trigger replacing streams in the RTP player.
Definition voip_calls_dialog.cpp:644
void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition voip_calls_dialog.cpp:258
void rtpStreamsDialogDeselectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request deselecting specific RTP streams in the streams dialog.
void updateFilter(QString filter, bool force=false)
Signal emitted to update the display filter.
void rtpStreamsDialogSelectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request selecting specific RTP streams in the streams dialog.
void captureFileClosing() override
Handles operations required just before the capture file closes.
Definition voip_calls_dialog.cpp:234
static VoipCallsDialog * openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for VoIP calls.
Definition voip_calls_dialog.cpp:48
void operator=(const VoipCallsDialog &)=delete
Should not be assignable.
VoipCallsDialog(VoipCallsDialog &other)=delete
Should not be cloneable.
void rtpPlayerDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request removing RTP streams from the player dialog.
void captureFileClosed() override
Handles cleanup after the capture file is fully closed.
Definition voip_calls_dialog.cpp:248
void rtpPlayerRemove()
Slot to trigger removing streams from the RTP player.
Definition voip_calls_dialog.cpp:658
void goToPacket(int packet_num)
Signal emitted to navigate to a specific packet.
virtual void removeTapListeners() override
Safely removes all tap listeners used by the dialog.
Definition voip_calls_dialog.cpp:225
~VoipCallsDialog()
Destroys the VoipCallsDialog object.
Definition voip_calls_dialog.cpp:198
void rtpPlayerAdd()
Slot to trigger adding streams to the RTP player.
Definition voip_calls_dialog.cpp:651
bool eventFilter(QObject *obj, QEvent *event) override
Event filter for capturing specific events.
Definition voip_calls_dialog.cpp:162
static VoipCallsDialog * openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for SIP calls.
Definition voip_calls_dialog.cpp:60
void captureFileChanged(capture_file *cf)
Signal emitted when the capture file changes.
Table model that exposes a list of VoIP call records for display in the VoIP Calls dialog,...
Definition voip_calls_info_model.h:27
virtual void updateWidgets()
Updates the state and contents of the dialog's widgets.
Definition wireshark_dialog.cpp:92
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
tap_packet_status
Definition tap.h:22
struct _voip_calls_tapinfo voip_calls_tapinfo_t
Aggregated tap state for the VoIP calls analysis, covering all detected calls and streams.