Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
rtp_analysis_dialog.h
Go to the documentation of this file.
1
10#ifndef RTP_ANALYSIS_DIALOG_H
11#define RTP_ANALYSIS_DIALOG_H
12
13#include <config.h>
14
15#include <mutex>
16
17#include "epan/address.h"
18
19#include "ui/rtp_stream.h"
20#include "ui/tap-rtp-common.h"
21#include "ui/tap-rtp-analysis.h"
22
23#include <QMenu>
24#include <QTreeWidget>
25#include <QLabel>
26#include <QFile>
27#include <QCheckBox>
28#include <QHBoxLayout>
29#include <QToolButton>
30
31#include "wireshark_dialog.h"
32
33namespace Ui {
35}
36
37class QCPGraph;
38class QTemporaryFile;
39class QDialogButtonBox;
40
41class PacketList;
42
43typedef struct {
45 QVector<double> *time_vals;
46 QVector<double> *jitter_vals;
47 QVector<double> *diff_vals;
48 QVector<double> *delta_vals;
49 QTreeWidget *tree_widget;
50 QLabel *statistics_label;
51 QString *tab_name;
52 QCPGraph *jitter_graph;
53 QCPGraph *diff_graph;
54 QCPGraph *delta_graph;
55 QHBoxLayout *graphHorizontalLayout;
56 QCheckBox *stream_checkbox;
57 QCheckBox *jitter_checkbox;
58 QCheckBox *diff_checkbox;
59 QCheckBox *delta_checkbox;
61
62// Singleton by https://refactoring.guru/design-patterns/singleton/cpp/example#example-1
64{
65 Q_OBJECT
66
67public:
71 static RtpAnalysisDialog *openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list);
72
77 void operator=(const RtpAnalysisDialog &) = delete;
78
84 static QToolButton *addAnalyzeButton(QDialogButtonBox *button_box, QDialog *dialog);
85
91 void replaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
92 void addRtpStreams(QVector<rtpstream_id_t *> stream_ids);
93 void removeRtpStreams(QVector<rtpstream_id_t *> stream_ids);
94
95signals:
96 void goToPacket(int packet_num);
97 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
98 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
99 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
100 void updateFilter(QString filter, bool force = false);
101
102public slots:
103 void rtpPlayerReplace();
104 void rtpPlayerAdd();
105 void rtpPlayerRemove();
106
107protected slots:
108 virtual void updateWidgets();
109
110protected:
111 explicit RtpAnalysisDialog(QWidget &parent, CaptureFile &cf);
113
114private slots:
115 void on_actionGoToPacket_triggered();
116 void on_actionNextProblem_triggered();
117 void on_actionSaveOneCsv_triggered();
118 void on_actionSaveAllCsv_triggered();
119 void on_actionSaveGraph_triggered();
120 void on_buttonBox_helpRequested();
121 void showStreamMenu(QPoint pos);
122 void showGraphMenu(const QPoint &pos);
123 void graphClicked(QMouseEvent *event);
124 void closeTab(int index);
125 void rowCheckboxChanged(int checked);
126 void singleCheckboxChanged(int checked);
127 void on_actionPrepareFilterOne_triggered();
128 void on_actionPrepareFilterAll_triggered();
129
130private:
131 static RtpAnalysisDialog *pinstance_;
132 static std::mutex init_mutex_;
133 static std::mutex run_mutex_;
134
135 Ui::RtpAnalysisDialog *ui;
136 enum StreamDirection { dir_all_, dir_one_ };
137 int tab_seq;
138
139 QVector<tab_info_t *> tabs_;
140 QMultiHash<unsigned, tab_info_t *> tab_hash_;
141
142 QToolButton *player_button_;
143
144 // Graph data for QCustomPlot
145 QList<QCPGraph *>graphs_;
146
147 QString err_str_;
148
149 QMenu stream_ctx_menu_;
150 QMenu graph_ctx_menu_;
151
152 // Tap callbacks
153 static void tapReset(void *tapinfo_ptr);
154 static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr, tap_flags_t flags);
155 static void tapDraw(void *tapinfo_ptr);
156
157 void resetStatistics();
158 void addPacket(tab_info_t *tab, packet_info *pinfo, const struct _rtp_info *rtpinfo);
159 void updateStatistics();
160 void updateGraph();
161
162 void saveCsvHeader(QFile *save_file, QTreeWidget *tree);
163 void saveCsvData(QFile *save_file, QTreeWidget *tree);
164 void saveCsv(StreamDirection direction);
165
166 bool eventFilter(QObject*, QEvent* event);
167
168 QVector<rtpstream_id_t *>getSelectedRtpIds();
169 int addTabUI(tab_info_t *new_tab);
170 tab_info_t *getTabInfoForCurrentTab();
171 void deleteTabInfo(tab_info_t *tab_info);
172 void clearLayout(QLayout *layout);
173 void addRtpStreamsPrivate(QVector<rtpstream_id_t *> stream_ids);
174};
175
176#endif // RTP_ANALYSIS_DIALOG_H
Definition capture_file.h:21
Definition packet_list.h:40
Definition rtp_analysis_dialog.h:64
static RtpAnalysisDialog * openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list)
Definition rtp_analysis_dialog.cpp:242
static QToolButton * addAnalyzeButton(QDialogButtonBox *button_box, QDialog *dialog)
Common routine to add a "Analyze" button to a QDialogButtonBox.
Definition rtp_analysis_dialog.cpp:1141
RtpAnalysisDialog(RtpAnalysisDialog &other)=delete
void replaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Definition rtp_analysis_dialog.cpp:1035
Definition wireshark_dialog.h:35
Definition packet_info.h:43
Definition packet-rtp.h:29
Definition rtp_stream.h:40
Definition epan_dissect.h:28
Definition stream.c:41
Definition rtp_analysis_dialog.h:43
tap_packet_status
Definition tap.h:25