summaryrefslogtreecommitdiffstats
path: root/ui/qt/sctp_graph_dialog.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /ui/qt/sctp_graph_dialog.h
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/sctp_graph_dialog.h')
-rw-r--r--ui/qt/sctp_graph_dialog.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/ui/qt/sctp_graph_dialog.h b/ui/qt/sctp_graph_dialog.h
new file mode 100644
index 0000000..28aeccb
--- /dev/null
+++ b/ui/qt/sctp_graph_dialog.h
@@ -0,0 +1,121 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef SCTP_GRAPH_DIALOG_H
+#define SCTP_GRAPH_DIALOG_H
+
+#include <config.h>
+#include <glib.h>
+
+#include "cfile.h"
+
+#include <QDialog>
+
+namespace Ui {
+class SCTPGraphDialog;
+}
+
+class QCPAbstractPlottable;
+class QCustomPlot;
+
+struct _sctp_assoc_info;
+
+struct chunk_header {
+ guint8 type;
+ guint8 flags;
+ guint16 length;
+};
+
+struct data_chunk_header {
+ guint8 type;
+ guint8 flags;
+ guint16 length;
+ guint32 tsn;
+ guint16 sid;
+ guint16 ssn;
+ guint32 ppi;
+};
+
+struct gaps {
+ guint16 start;
+ guint16 end;
+};
+
+struct sack_chunk_header {
+ guint8 type;
+ guint8 flags;
+ guint16 length;
+ guint32 cum_tsn_ack;
+ guint32 a_rwnd;
+ guint16 nr_of_gaps;
+ guint16 nr_of_dups;
+ struct gaps gaps[1];
+};
+
+struct nr_sack_chunk_header {
+ guint8 type;
+ guint8 flags;
+ guint16 length;
+ guint32 cum_tsn_ack;
+ guint32 a_rwnd;
+ guint16 nr_of_gaps;
+ guint16 nr_of_nr_gaps;
+ guint16 nr_of_dups;
+ guint16 reserved;
+ struct gaps gaps[1];
+};
+
+
+class SCTPGraphDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit SCTPGraphDialog(QWidget *parent = 0, const _sctp_assoc_info *assoc = NULL,
+ capture_file *cf = NULL, int dir = 0);
+ ~SCTPGraphDialog();
+ static void save_graph(QDialog *dlg, QCustomPlot *plot);
+
+public slots:
+ void setCaptureFile(capture_file *cf) { cap_file_ = cf; }
+
+private slots:
+ void on_pushButton_clicked();
+
+ void on_pushButton_2_clicked();
+
+ void on_pushButton_3_clicked();
+
+ void on_pushButton_4_clicked();
+
+ void graphClicked(QCPAbstractPlottable* plottable, int, QMouseEvent* event);
+
+ void on_saveButton_clicked();
+
+ void on_relativeTsn_stateChanged(int arg1);
+
+private:
+ Ui::SCTPGraphDialog *ui;
+ guint16 selected_assoc_id;
+ capture_file *cap_file_;
+ int frame_num;
+ int direction;
+ QVector<double> xt, yt, xs, ys, xg, yg, xd, yd, xn, yn;
+ QVector<guint32> ft, fs, fg, fd, fn;
+ QVector<QString> typeStrings;
+ bool relative;
+ int type;
+
+ void drawGraph(const _sctp_assoc_info* selected_assoc = NULL);
+ void drawTSNGraph(const _sctp_assoc_info* selected_assoc);
+ void drawSACKGraph(const _sctp_assoc_info* selected_assoc);
+ void drawNRSACKGraph(const _sctp_assoc_info* selected_assoc);
+};
+
+#endif // SCTP_GRAPH_DIALOG_H