| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
rtp_analysis_dialog.h
Go to the documentation of this file.
1
9
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
33 namespace Ui {
34 class RtpAnalysisDialog;
35}
36
37 class QCPGraph;
38 class QTemporaryFile;
39 class QDialogButtonBox;
40
41 class PacketList;
42 class RtpBaseDialog;
43
47 typedef struct {
49 rtpstream_info_t stream;
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
67 QLabel *statistics_label;
68
70 QString *tab_name;
71
73 QCPGraph *jitter_graph;
74
76 QCPGraph *diff_graph;
77
79 QCPGraph *delta_graph;
80
82 QHBoxLayout *graphHorizontalLayout;
83
85 QCheckBox *stream_checkbox;
86
88 QCheckBox *jitter_checkbox;
89
91 QCheckBox *diff_checkbox;
92
94 QCheckBox *delta_checkbox;
95} tab_info_t;
96
100// Singleton by https://refactoring.guru/design-patterns/singleton/cpp/example#example-1
101 class RtpAnalysisDialog : public WiresharkDialog
102{
103 Q_OBJECT
104
105 public:
113 static RtpAnalysisDialog *openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list);
114
119 RtpAnalysisDialog(RtpAnalysisDialog &other) = delete;
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
190 public slots:
194 void rtpPlayerReplace();
195
199 void rtpPlayerAdd();
200
204 void rtpPlayerRemove();
205
206 protected slots:
210 virtual void updateWidgets() override;
211
212 protected:
218 explicit RtpAnalysisDialog(QWidget &parent, CaptureFile &cf);
219
223 ~RtpAnalysisDialog();
224
225 private 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
302 private:
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) override;
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
address.h
CaptureFile
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
PacketList
The main packet list view for displaying captured packets.
Definition packet_list.h:45
RtpAnalysisDialog::~RtpAnalysisDialog
~RtpAnalysisDialog()
Destroys the RtpAnalysisDialog.
Definition rtp_analysis_dialog.cpp:310
RtpAnalysisDialog::rtpPlayerRemove
void rtpPlayerRemove()
Slot to handle removing streams from the RTP player.
Definition rtp_analysis_dialog.cpp:850
RtpAnalysisDialog::rtpPlayerDialogRemoveRtpStreams
void rtpPlayerDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to remove RTP streams in the RTP player dialog.
RtpAnalysisDialog::openRtpAnalysisDialog
static RtpAnalysisDialog * openRtpAnalysisDialog(QWidget &parent, CaptureFile &cf, PacketList *packet_list)
Returns singleton instance of the RTP analysis dialog.
Definition rtp_analysis_dialog.cpp:242
RtpAnalysisDialog::rtpPlayerDialogAddRtpStreams
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to add RTP streams in the RTP player dialog.
RtpAnalysisDialog::rtpPlayerDialogReplaceRtpStreams
void rtpPlayerDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Signal emitted to replace RTP streams in the RTP player dialog.
RtpAnalysisDialog::rtpPlayerAdd
void rtpPlayerAdd()
Slot to handle adding streams to the RTP player.
Definition rtp_analysis_dialog.cpp:843
RtpAnalysisDialog::addRtpStreams
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
RtpAnalysisDialog(RtpAnalysisDialog &other)=delete
Should not be cloneable.
RtpAnalysisDialog::rtpPlayerReplace
void rtpPlayerReplace()
Slot to handle replacing streams in the RTP player.
Definition rtp_analysis_dialog.cpp:836
RtpAnalysisDialog::goToPacket
void goToPacket(int packet_num)
Signal emitted to go to a specific packet number.
RtpAnalysisDialog::operator=
void operator=(const RtpAnalysisDialog &)=delete
Should not be assignable.
RtpAnalysisDialog::updateFilter
void updateFilter(QString filter, bool force=false)
Signal emitted to update the display filter.
RtpAnalysisDialog::replaceRtpStreams
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
RtpAnalysisDialog::addAnalyzeButton
static QToolButton * addAnalyzeButton(QDialogButtonBox *button_box, RtpBaseDialog *dialog)
Common routine to add a "Analyze" button to a QDialogButtonBox.
Definition rtp_analysis_dialog.cpp:1150
RtpAnalysisDialog::updateWidgets
virtual void updateWidgets() override
Updates the UI widgets.
Definition rtp_analysis_dialog.cpp:523
RtpAnalysisDialog::removeRtpStreams
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
RtpBaseDialog
Base class for RTP related dialogs providing common functionality.
Definition rtp_player_dialog.h:74
WiresharkDialog::WiresharkDialog
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
rtp_stream.h
rtpstream_info_t
struct _rtpstream_info rtpstream_info_t
Holds all state and statistics accumulated for a single RTP stream.
_rtp_info
Definition packet-rtp.h:29
tab_info_t
Structure to hold information and UI elements for an RTP stream analysis tab.
Definition rtp_analysis_dialog.h:47
tab_info_t::diff_checkbox
QCheckBox * diff_checkbox
Definition rtp_analysis_dialog.h:91
tab_info_t::tree_widget
QTreeWidget * tree_widget
Definition rtp_analysis_dialog.h:64
tab_info_t::diff_vals
QVector< double > * diff_vals
Definition rtp_analysis_dialog.h:58
tab_info_t::delta_graph
QCPGraph * delta_graph
Definition rtp_analysis_dialog.h:79
tab_info_t::statistics_label
QLabel * statistics_label
Definition rtp_analysis_dialog.h:67
tab_info_t::jitter_checkbox
QCheckBox * jitter_checkbox
Definition rtp_analysis_dialog.h:88
tab_info_t::stream
rtpstream_info_t stream
Definition rtp_analysis_dialog.h:49
tab_info_t::graphHorizontalLayout
QHBoxLayout * graphHorizontalLayout
Definition rtp_analysis_dialog.h:82
tab_info_t::delta_checkbox
QCheckBox * delta_checkbox
Definition rtp_analysis_dialog.h:94
tab_info_t::stream_checkbox
QCheckBox * stream_checkbox
Definition rtp_analysis_dialog.h:85
tab_info_t::diff_graph
QCPGraph * diff_graph
Definition rtp_analysis_dialog.h:76
tab_info_t::delta_vals
QVector< double > * delta_vals
Definition rtp_analysis_dialog.h:61
tab_info_t::tab_name
QString * tab_name
Definition rtp_analysis_dialog.h:70
tab_info_t::jitter_vals
QVector< double > * jitter_vals
Definition rtp_analysis_dialog.h:55
tab_info_t::jitter_graph
QCPGraph * jitter_graph
Definition rtp_analysis_dialog.h:73
tab_info_t::time_vals
QVector< double > * time_vals
Definition rtp_analysis_dialog.h:52
tap-rtp-analysis.h
tap-rtp-common.h
tap_packet_status
tap_packet_status
Definition tap.h:22
wireshark_dialog.h