Wireshark 4.7.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;
42class RtpBaseDialog;
43
47typedef struct {
50
52 QVector<double> *time_vals;
53
55 QVector<double> *jitter_vals;
56
58 QVector<double> *diff_vals;
59
61 QVector<double> *delta_vals;
62
64 QTreeWidget *tree_widget;
65
68
70 QString *tab_name;
71
73 QCPGraph *jitter_graph;
74
76 QCPGraph *diff_graph;
77
79 QCPGraph *delta_graph;
80
83
85 QCheckBox *stream_checkbox;
86
88 QCheckBox *jitter_checkbox;
89
91 QCheckBox *diff_checkbox;
92
94 QCheckBox *delta_checkbox;
96
100// Singleton by https://refactoring.guru/design-patterns/singleton/cpp/example#example-1
102{
103 Q_OBJECT
104
105public:
113 static RtpAnalysisDialog *openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list);
114
120
124 void operator=(const RtpAnalysisDialog &) = delete;
125
132 static QToolButton *addAnalyzeButton(QDialogButtonBox *button_box, RtpBaseDialog *dialog);
133
140 void replaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
141
148 void addRtpStreams(QVector<rtpstream_id_t *> stream_ids);
149
156 void removeRtpStreams(QVector<rtpstream_id_t *> stream_ids);
157
158signals:
163 void goToPacket(int packet_num);
164
169 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
170
175 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
176
181 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
182
188 void updateFilter(QString filter, bool force = false);
189
190public slots:
194 void rtpPlayerReplace();
195
199 void rtpPlayerAdd();
200
204 void rtpPlayerRemove();
205
206protected slots:
210 virtual void updateWidgets();
211
212protected:
218 explicit RtpAnalysisDialog(QWidget &parent, CaptureFile &cf);
219
224
225private slots:
229 void on_actionGoToPacket_triggered();
230
234 void on_actionNextProblem_triggered();
235
239 void on_actionSaveOneCsv_triggered();
240
244 void on_actionSaveAllCsv_triggered();
245
249 void on_actionSaveGraph_triggered();
250
254 void on_buttonBox_helpRequested();
255
260 void showStreamMenu(QPoint pos);
261
266 void showGraphMenu(const QPoint &pos);
267
272 void graphClicked(QMouseEvent *event);
273
278 void closeTab(int index);
279
284 void rowCheckboxChanged(int checked);
285
290 void singleCheckboxChanged(int checked);
291
295 void on_actionPrepareFilterOne_triggered();
296
300 void on_actionPrepareFilterAll_triggered();
301
302private:
304 static RtpAnalysisDialog *pinstance_;
305
307 static std::mutex init_mutex_;
308
310 static std::mutex run_mutex_;
311
313 Ui::RtpAnalysisDialog *ui;
314
318 enum StreamDirection {
319 dir_all_,
320 dir_one_
321 };
322
324 int tab_seq;
325
327 QVector<tab_info_t *> tabs_;
328
330 QMultiHash<unsigned, tab_info_t *> tab_hash_;
331
333 QToolButton *player_button_;
334
336 QList<QCPGraph *>graphs_;
337
339 QString err_str_;
340
342 QMenu stream_ctx_menu_;
343
345 QMenu graph_ctx_menu_;
346
351 static void tapReset(void *tapinfo_ptr);
352
361 static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr, tap_flags_t flags);
362
367 static void tapDraw(void *tapinfo_ptr);
368
372 void resetStatistics();
373
380 void addPacket(tab_info_t *tab, packet_info *pinfo, const struct _rtp_info *rtpinfo);
381
385 void updateStatistics();
386
390 void updateGraph();
391
397 void saveCsvHeader(QFile *save_file, QTreeWidget *tree);
398
404 void saveCsvData(QFile *save_file, QTreeWidget *tree);
405
410 void saveCsv(StreamDirection direction);
411
417 bool eventFilter(QObject*, QEvent* event);
418
423 QVector<rtpstream_id_t *>getSelectedRtpIds();
424
430 int addTabUI(tab_info_t *new_tab);
431
436 tab_info_t *getTabInfoForCurrentTab();
437
442 void deleteTabInfo(tab_info_t *tab_info);
443
448 void clearLayout(QLayout *layout);
449
454 void addRtpStreamsPrivate(QVector<rtpstream_id_t *> stream_ids);
455};
456
457#endif // RTP_ANALYSIS_DIALOG_H
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
The main packet list view for displaying captured packets.
Definition packet_list.h:45
Singleton dialog for analyzing RTP streams.
Definition rtp_analysis_dialog.h:102
~RtpAnalysisDialog()
Destroys the RtpAnalysisDialog.
Definition rtp_analysis_dialog.cpp:310
void rtpPlayerRemove()
Slot to handle removing streams from the RTP player.
Definition rtp_analysis_dialog.cpp:850
void rtpPlayerDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to remove RTP streams in the RTP player dialog.
static RtpAnalysisDialog * openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list)
Returns singleton instance of the RTP analysis dialog.
Definition rtp_analysis_dialog.cpp:242
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to add RTP streams in the RTP player dialog.
void rtpPlayerDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to replace RTP streams in the RTP player dialog.
void rtpPlayerAdd()
Slot to handle adding streams to the RTP player.
Definition rtp_analysis_dialog.cpp:843
void addRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Add RTP streams to analyse. Requires array of rtpstream_id_t.
Definition rtp_analysis_dialog.cpp:1059
RtpAnalysisDialog(RtpAnalysisDialog &other)=delete
Should not be cloneable.
void rtpPlayerReplace()
Slot to handle replacing streams in the RTP player.
Definition rtp_analysis_dialog.cpp:836
void goToPacket(int packet_num)
Signal emitted to go to a specific packet number.
void operator=(const RtpAnalysisDialog &)=delete
Should not be assignable.
void updateFilter(QString filter, bool force=false)
Signal emitted to update the display filter.
void replaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Replace an RTP streams to analyse. Requires array of rtpstream_id_t.
Definition rtp_analysis_dialog.cpp:1043
static QToolButton * addAnalyzeButton(QDialogButtonBox *button_box, RtpBaseDialog *dialog)
Common routine to add a "Analyze" button to a QDialogButtonBox.
Definition rtp_analysis_dialog.cpp:1150
virtual void updateWidgets()
Updates the UI widgets.
Definition rtp_analysis_dialog.cpp:523
void removeRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Remove RTP streams to analyse. Requires array of rtpstream_id_t.
Definition rtp_analysis_dialog.cpp:1115
Base class for RTP related dialogs providing common functionality.
Definition rtp_player_dialog.h:78
Base class for Wireshark specific dialogs that require interaction with a CaptureFile.
Definition wireshark_dialog.h:38
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition packet-rtp.h:29
Holds all state and statistics accumulated for a single RTP stream.
Definition rtp_stream.h:42
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Structure to hold information and UI elements for an RTP stream analysis tab.
Definition rtp_analysis_dialog.h:47
QCheckBox * diff_checkbox
Definition rtp_analysis_dialog.h:91
QTreeWidget * tree_widget
Definition rtp_analysis_dialog.h:64
QVector< double > * diff_vals
Definition rtp_analysis_dialog.h:58
QCPGraph * delta_graph
Definition rtp_analysis_dialog.h:79
QLabel * statistics_label
Definition rtp_analysis_dialog.h:67
QCheckBox * jitter_checkbox
Definition rtp_analysis_dialog.h:88
rtpstream_info_t stream
Definition rtp_analysis_dialog.h:49
QHBoxLayout * graphHorizontalLayout
Definition rtp_analysis_dialog.h:82
QCheckBox * delta_checkbox
Definition rtp_analysis_dialog.h:94
QCheckBox * stream_checkbox
Definition rtp_analysis_dialog.h:85
QCPGraph * diff_graph
Definition rtp_analysis_dialog.h:76
QVector< double > * delta_vals
Definition rtp_analysis_dialog.h:61
QString * tab_name
Definition rtp_analysis_dialog.h:70
QVector< double > * jitter_vals
Definition rtp_analysis_dialog.h:55
QCPGraph * jitter_graph
Definition rtp_analysis_dialog.h:73
QVector< double > * time_vals
Definition rtp_analysis_dialog.h:52
tap_packet_status
Definition tap.h:22