| 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
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
40 class VoipCallsDialog : public WiresharkDialog
41{
42 Q_OBJECT
43
44 public:
48 static VoipCallsDialog *openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
49 static VoipCallsDialog *openVoipCallsDialogSip(QWidget &parent, CaptureFile &cf, QObject *packet_list);
50
54 VoipCallsDialog(VoipCallsDialog &other) = delete;
55 void operator=(const VoipCallsDialog &) = delete;
56
57signals:
58 void updateFilter(QString filter, bool force = false);
59 void captureFileChanged(capture_file *cf);
60 void goToPacket(int packet_num);
61 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
62 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
63 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
64 void rtpStreamsDialogSelectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
65 void rtpStreamsDialogDeselectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
66
67 public slots:
68 void rtpPlayerReplace();
69 void rtpPlayerAdd();
70 void rtpPlayerRemove();
71
72 protected:
73 explicit VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows = false);
74 ~VoipCallsDialog();
75
76 void contextMenuEvent(QContextMenuEvent *event);
77 virtual void removeTapListeners();
78 void captureFileClosing();
79 void captureFileClosed();
80 bool eventFilter(QObject *obj, QEvent *event);
81
82 protected slots:
83 void changeEvent(QEvent* event);
84
85 private:
86 // We have two singletones - one for all protocols, one for sip protocol
87 static VoipCallsDialog *pinstance_voip_;
88 static VoipCallsDialog *pinstance_sip_;
89 bool all_flows_;
90 static std::mutex init_mutex_;
91
92 Ui::VoipCallsDialog *ui;
93 VoipCallsInfoModel *call_infos_model_;
94 CacheProxyModel *cache_model_;
95 QSortFilterProxyModel *sorted_model_;
96
97 QWidget &parent_;
98 voip_calls_tapinfo_t tapinfo_;
99 SequenceInfo *sequence_info_;
100 QPushButton *prepare_button_;
101 QPushButton *sequence_button_;
102 QToolButton *player_button_;
103 QPushButton *copy_button_;
104 bool voip_calls_tap_listeners_removed_;
105 GQueue* shown_callsinfos_; /* queue with all shown calls (voip_calls_info_t) */
106
107 // Tap callbacks
108 static void tapReset(void *tapinfo_ptr);
109 static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data, tap_flags_t flags);
110 static void tapDraw(void *tapinfo_ptr);
111 static int compareCallNums(const void *a, const void *b);
112
113 void updateCalls();
114 void prepareFilter();
115 void showSequence();
116 void showPlayer();
117 void removeAllCalls();
118 void invertSelection();
119
120 QList<QVariant> streamRowData(int row) const;
121 QVector<rtpstream_id_t *>getSelectedRtpIds();
122
123 private slots:
124 void selectAll();
125 void selectNone();
126 void copyAsCSV();
127 void copyAsYAML();
128 void switchTimeOfDay();
129 void on_callTreeView_activated(const QModelIndex &index);
130 void on_buttonBox_clicked(QAbstractButton *button);
131 void on_buttonBox_helpRequested();
132 void updateWidgets();
133 void captureEvent(CaptureEvent e);
134 void displayFilterCheckBoxToggled(bool checked);
135 void on_actionSelectAll_triggered();
136 void on_actionSelectInvert_triggered();
137 void on_actionSelectNone_triggered();
138 void on_actionSelectRtpStreams_triggered();
139 void on_actionDeselectRtpStreams_triggered();
140};
141
142#endif // VOIP_CALLS_DIALOG_H
cache_proxy_model.h
cfile.h
CacheProxyModel
Definition cache_proxy_model.h:26
CaptureEvent
Definition capture_event.h:21
CaptureFile
Definition capture_file.h:21
SequenceInfo
Definition sequence_dialog.h:33
VoipCallsDialog
Definition voip_calls_dialog.h:41
VoipCallsDialog::openVoipCallsDialogVoip
static VoipCallsDialog * openVoipCallsDialogVoip(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Definition voip_calls_dialog.cpp:50
VoipCallsDialog::captureFileClosing
void captureFileClosing()
Called when the capture file is about to close. This can be used to disconnect taps and similar actio...
Definition voip_calls_dialog.cpp:235
VoipCallsDialog::VoipCallsDialog
VoipCallsDialog(VoipCallsDialog &other)=delete
VoipCallsDialog::captureFileClosed
void captureFileClosed()
Called when the capture file was closed. This can be used to enable or disable widgets according to t...
Definition voip_calls_dialog.cpp:249
VoipCallsDialog::removeTapListeners
virtual void removeTapListeners()
Remove all tap listeners registered via registerTapListener.
Definition voip_calls_dialog.cpp:226
VoipCallsInfoModel
Definition voip_calls_info_model.h:22
WiresharkDialog
Definition wireshark_dialog.h:35
rtp_stream.h
rtp_stream_id.h
_capture_file
Definition cfile.h:71
_packet_info
Definition packet_info.h:43
_voip_calls_tapinfo
Definition voip_calls.h:173
epan_dissect
Definition epan_dissect.h:28
tap_packet_status
tap_packet_status
Definition tap.h:25
voip_calls.h
voip_calls_info_model.h
wireshark_dialog.h