update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / ui / qt / tcp_stream_dialog.h
blob4281538b6bb2a475eb888e241bbe205fe2f6cee3
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef TCP_STREAM_DIALOG_H
11 #define TCP_STREAM_DIALOG_H
13 #include <config.h>
15 #include <file.h>
17 #include <epan/dissectors/packet-tcp.h>
19 #include "ui/tap-tcp-stream.h"
21 #include "geometry_state_dialog.h"
23 #include <ui/qt/widgets/qcustomplot.h>
24 #include <QMenu>
25 #include <QRubberBand>
26 #include <QTimer>
28 namespace Ui {
29 class TCPStreamDialog;
30 class QCPErrorBarsNotSelectable;
33 class QCPErrorBarsNotSelectable : public QCPErrorBars
35 Q_OBJECT
37 public:
38 explicit QCPErrorBarsNotSelectable(QCPAxis *keyAxis, QCPAxis *valueAxis);
39 virtual ~QCPErrorBarsNotSelectable();
41 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details = 0) const Q_DECL_OVERRIDE;
44 class TCPStreamDialog : public GeometryStateDialog
46 Q_OBJECT
48 public:
49 explicit TCPStreamDialog(QWidget *parent = 0, capture_file *cf = NULL, tcp_graph_type graph_type = GRAPH_TSEQ_TCPTRACE);
50 ~TCPStreamDialog();
52 signals:
53 void goToPacket(int packet_num);
55 public slots:
56 void setCaptureFile(capture_file *cf);
57 void updateGraph();
59 protected:
60 void showEvent(QShowEvent *event);
61 void keyPressEvent(QKeyEvent *event);
62 void mousePressEvent(QMouseEvent *event);
63 void mouseReleaseEvent(QMouseEvent *event);
65 private:
66 Ui::TCPStreamDialog *ui;
67 capture_file *cap_file_;
68 QMultiMap<double, struct segment *> time_stamp_map_;
69 double ts_offset_;
70 bool ts_origin_conn_;
71 QMap<double, struct segment *> sequence_num_map_;
72 uint32_t seq_offset_;
73 bool seq_origin_zero_;
74 struct tcp_graph graph_;
75 QCPTextElement *title_;
76 QString stream_desc_;
77 QCPGraph *base_graph_; // Clickable packets
78 QCPGraph *tput_graph_;
79 QCPGraph *goodput_graph_;
80 QCPGraph *seg_graph_;
81 QCPErrorBars *seg_eb_;
82 QCPGraph *ack_graph_;
83 QCPGraph *sack_graph_;
84 QCPErrorBars *sack_eb_;
85 QCPGraph *sack2_graph_;
86 QCPErrorBars *sack2_eb_;
87 QCPGraph *rwin_graph_;
88 QCPGraph *dup_ack_graph_;
89 QCPGraph *zero_win_graph_;
90 QCPItemTracer *tracer_;
91 QRectF axis_bounds_;
92 uint32_t packet_num_;
93 QTransform y_axis_xfrm_;
94 bool mouse_drags_;
95 QRubberBand *rubber_band_;
96 QPoint rb_origin_;
97 QMenu ctx_menu_;
99 class GraphUpdater {
100 public:
101 GraphUpdater(TCPStreamDialog *dialog) :
102 dialog_(dialog),
103 graph_update_timer_(NULL),
104 reset_axes_(false) {}
105 void triggerUpdate(int timeout, bool reset_axes = false);
106 void clearPendingUpdate();
107 void doUpdate();
108 bool hasPendingUpdate() { return graph_update_timer_ != NULL; }
109 private:
110 TCPStreamDialog *dialog_;
111 QTimer *graph_update_timer_;
112 bool reset_axes_;
114 friend class GraphUpdater;
115 GraphUpdater graph_updater_;
117 int num_dsegs_;
118 int num_acks_;
119 int num_sack_ranges_;
121 double ma_window_size_;
123 void findStream();
124 void fillGraph(bool reset_axes = true, bool set_focus = true);
125 void showWidgetsForGraphType();
126 void zoomAxes(bool in);
127 void zoomXAxis(bool in);
128 void zoomYAxis(bool in);
129 void panAxes(int x_pixels, int y_pixels);
130 void resetAxes();
131 void fillStevens();
132 void fillTcptrace();
133 void fillThroughput();
134 void fillRoundTripTime();
135 void fillWindowScale();
136 QString streamDescription();
137 bool compareHeaders(struct segment *seg);
138 void toggleTracerStyle(bool force_default = false);
139 QRectF getZoomRanges(QRect zoom_rect);
141 private slots:
142 void showContextMenu(const QPoint &pos);
143 void graphClicked(QMouseEvent *event);
144 void axisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
145 void mouseMoved(QMouseEvent *event);
146 void mouseReleased(QMouseEvent *event);
147 void transformYRange(const QCPRange &y_range1);
148 void on_buttonBox_accepted();
149 void on_graphTypeComboBox_currentIndexChanged(int index);
150 void on_resetButton_clicked();
151 void on_streamNumberSpinBox_valueChanged(int new_stream);
152 void on_streamNumberSpinBox_editingFinished();
153 void on_maWindowSizeSpinBox_valueChanged(double new_ma_size);
154 void on_maWindowSizeSpinBox_editingFinished();
155 void on_selectSACKsCheckBox_stateChanged(int state);
156 void on_otherDirectionButton_clicked();
157 void on_dragRadioButton_toggled(bool checked);
158 void on_zoomRadioButton_toggled(bool checked);
159 void on_bySeqNumberCheckBox_stateChanged(int state);
160 void on_showSegLengthCheckBox_stateChanged(int state);
161 void on_showThroughputCheckBox_stateChanged(int state);
162 void on_showGoodputCheckBox_stateChanged(int state);
163 void on_showRcvWinCheckBox_stateChanged(int state);
164 void on_showBytesOutCheckBox_stateChanged(int state);
165 void on_actionZoomIn_triggered();
166 void on_actionZoomInX_triggered();
167 void on_actionZoomInY_triggered();
168 void on_actionZoomOut_triggered();
169 void on_actionZoomOutX_triggered();
170 void on_actionZoomOutY_triggered();
171 void on_actionReset_triggered();
172 void on_actionMoveRight10_triggered();
173 void on_actionMoveLeft10_triggered();
174 void on_actionMoveUp10_triggered();
175 void on_actionMoveDown10_triggered();
176 void on_actionMoveRight1_triggered();
177 void on_actionMoveLeft1_triggered();
178 void on_actionMoveUp1_triggered();
179 void on_actionMoveDown1_triggered();
180 void on_actionNextStream_triggered();
181 void on_actionPreviousStream_triggered();
182 void on_actionSwitchDirection_triggered();
183 void on_actionGoToPacket_triggered();
184 void on_actionDragZoom_triggered();
185 void on_actionToggleSequenceNumbers_triggered();
186 void on_actionToggleTimeOrigin_triggered();
187 void on_actionRoundTripTime_triggered();
188 void on_actionThroughput_triggered();
189 void on_actionStevens_triggered();
190 void on_actionTcptrace_triggered();
191 void on_actionWindowScaling_triggered();
192 void on_buttonBox_helpRequested();
195 #endif // TCP_STREAM_DIALOG_H