Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
voip_calls_dialog.h
Go to the documentation of this file.
1
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#include <QToolButton>
32
33class SequenceInfo;
34
35namespace Ui {
36class 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
45{
46 Q_OBJECT
47
48public:
56 static VoipCallsDialog *openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
57
65 static VoipCallsDialog *openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
66
71
75 void operator=(const VoipCallsDialog &) = delete;
76
77signals:
83 void updateFilter(QString filter, bool force = false);
84
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
127public slots:
131 void rtpPlayerReplace();
132
136 void rtpPlayerAdd();
137
141 void rtpPlayerRemove();
142
143protected:
150 explicit VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows = false);
151
156
161 void contextMenuEvent(QContextMenuEvent *event);
162
166 virtual void removeTapListeners();
167
171 void captureFileClosing();
172
176 void captureFileClosed();
177
184 bool eventFilter(QObject *obj, QEvent *event);
185
186protected slots:
191 void changeEvent(QEvent* event);
192
193private:
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
316private 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();
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
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
Dialog for displaying and managing VoIP and SIP calls.
Definition voip_calls_dialog.h:45
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to request adding RTP streams to the player dialog.
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:645
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.
static VoipCallsDialog * openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for VoIP calls.
Definition voip_calls_dialog.cpp:50
void captureFileClosing()
Handles operations required just before the capture file closes.
Definition voip_calls_dialog.cpp:235
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 contextMenuEvent(QContextMenuEvent *event)
Handles context menu events.
Definition voip_calls_dialog.cpp:259
void rtpPlayerRemove()
Slot to trigger removing streams from the RTP player.
Definition voip_calls_dialog.cpp:659
void goToPacket(int packet_num)
Signal emitted to navigate to a specific packet.
~VoipCallsDialog()
Destroys the VoipCallsDialog object.
Definition voip_calls_dialog.cpp:199
void captureFileClosed()
Handles cleanup after the capture file is fully closed.
Definition voip_calls_dialog.cpp:249
virtual void removeTapListeners()
Safely removes all tap listeners used by the dialog.
Definition voip_calls_dialog.cpp:226
bool eventFilter(QObject *obj, QEvent *event)
Event filter for capturing specific events.
Definition voip_calls_dialog.cpp:163
void rtpPlayerAdd()
Slot to trigger adding streams to the RTP player.
Definition voip_calls_dialog.cpp:652
void changeEvent(QEvent *event)
Handles generic state change events.
Definition voip_calls_dialog.cpp:287
static VoipCallsDialog * openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Returns singleton instance for SIP calls.
Definition voip_calls_dialog.cpp:62
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
Base class for Wireshark specific dialogs that require interaction with a CaptureFile.
Definition wireshark_dialog.h:38
Represents a capture file and its associated metadata.
Definition cfile.h:84
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Aggregated tap state for the VoIP calls analysis, covering all detected calls and streams.
Definition voip_calls.h:218
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
tap_packet_status
Definition tap.h:22