diff options
author | Irene RĂ¼ngeler <I.Ruengeler@fh-muenster.de> | 2013-12-13 07:25:30 +0000 |
---|---|---|
committer | Irene RĂ¼ngeler <I.Ruengeler@fh-muenster.de> | 2013-12-13 07:25:30 +0000 |
commit | 796bf409b0c286dd76e6ecd5c61d0d947d54b479 (patch) | |
tree | 42d21c7d8b1175adf0f155f5c0fb9f53feb795d5 /ui/qt/sctp_graph_dialog.h | |
parent | 28e6aa4e8a06299895d7924508a32a895a5454ab (diff) |
Add dialogs and graphs to analyse SCTP behavior similar to the GTK version.
svn path=/trunk/; revision=54026
Diffstat (limited to 'ui/qt/sctp_graph_dialog.h')
-rw-r--r-- | ui/qt/sctp_graph_dialog.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/ui/qt/sctp_graph_dialog.h b/ui/qt/sctp_graph_dialog.h new file mode 100644 index 0000000000..29f7c0a089 --- /dev/null +++ b/ui/qt/sctp_graph_dialog.h @@ -0,0 +1,114 @@ +#ifndef SCTP_GRAPH_DIALOG_H +#define SCTP_GRAPH_DIALOG_H + +#include "config.h" +#include "qcustomplot.h" +#include <glib.h> + +#include <file.h> +#include <math.h> +#include <epan/dissectors/packet-sctp.h> +#include "epan/packet.h" + +#include "ui/tap-sctp-analysis.h" + +#include <QDialog> +#include <QObject> +#include <QMessageBox> +#include <QDir> +#include <QFileDialog> + +namespace Ui { +class SCTPGraphDialog; +} + +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, sctp_assoc_info_t *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, QMouseEvent* event); + + void on_saveButton_clicked(); + +private: + Ui::SCTPGraphDialog *ui; + sctp_assoc_info_t *selected_assoc; + 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 gIsSackChunkPresent; + bool gIsNRSackChunkPresent; + + void drawGraph(int which); + void drawTSNGraph(); + void drawSACKGraph(); + void drawNRSACKGraph(); +}; + +#endif // SCTP_GRAPH_DIALOG_H |