Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tcp_stream_dialog.h
Go to the documentation of this file.
1
10#ifndef TCP_STREAM_DIALOG_H
11#define TCP_STREAM_DIALOG_H
12
13#include <config.h>
14
15#include <file.h>
16
17#include <epan/dissectors/packet-tcp.h>
18#include <wsutil/str_util.h>
19
20#include "ui/tap-tcp-stream.h"
21
22#include "capture_file.h"
24
25#include <ui/qt/widgets/qcustomplot.h>
26#include <QMenu>
27#include <QRubberBand>
28#include <QTimer>
29
30namespace Ui {
31class TCPStreamDialog;
33class DupAckGraph;
34}
35
36class QCPErrorBarsNotSelectable : public QCPErrorBars
37{
38 Q_OBJECT
39
40public:
41 explicit QCPErrorBarsNotSelectable(QCPAxis *keyAxis, QCPAxis *valueAxis);
43
44 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details = 0) const Q_DECL_OVERRIDE;
45 virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const override;
46};
47
48class DupAckGraph : public QCPGraph
49{
50 Q_OBJECT
51
52public:
53 explicit DupAckGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
54 virtual ~DupAckGraph();
55
56 virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const override;
57};
58
60{
61 Q_OBJECT
62
63public:
64 explicit TCPStreamDialog(QWidget *parent, const CaptureFile &cf, tcp_graph_type graph_type = GRAPH_TSEQ_TCPTRACE);
66
67signals:
68 void goToPacket(int packet_num);
69
70public slots:
71 void updateGraph();
72
73protected:
74 void showEvent(QShowEvent *event);
75 void keyPressEvent(QKeyEvent *event);
76 void mousePressEvent(QMouseEvent *event);
77 void mouseReleaseEvent(QMouseEvent *event);
78
79private:
80 Ui::TCPStreamDialog *ui;
81 const CaptureFile &cap_file_;
82 bool file_closed_;
83 bool tapping_;
84 QMultiMap<double, struct segment *> time_stamp_map_;
85 double ts_offset_;
86 bool ts_origin_conn_;
87 QMap<double, struct segment *> sequence_num_map_;
88 uint32_t seq_offset_;
89 bool seq_origin_zero_;
90 bool si_units_;
91 bool legend_visible_;
92 struct tcp_graph graph_;
93 QCPTextElement *title_;
94 QString stream_desc_;
95 QCPGraph *base_graph_; // Clickable packets
96 QCPGraph *tput_graph_;
97 QCPGraph *goodput_graph_;
98 QCPGraph *seg_graph_;
99 QCPErrorBars *seg_eb_;
100 QCPGraph *ack_graph_;
101 QCPGraph *sack_graph_;
102 QCPErrorBars *sack_eb_;
103 QCPGraph *sack2_graph_;
104 QCPErrorBars *sack2_eb_;
105 QCPGraph *rwin_graph_;
106 QCPGraph *dup_ack_graph_;
107 QCPGraph *zero_win_graph_;
108 QCPItemTracer *tracer_;
109 QRectF axis_bounds_;
110 uint32_t packet_num_;
111 QTransform y_axis_xfrm_;
112 bool mouse_drags_;
113 QRubberBand *rubber_band_;
114 QPoint rb_origin_;
115 QMenu ctx_menu_;
116
117 class GraphUpdater {
118 public:
119 GraphUpdater(TCPStreamDialog *dialog) :
120 dialog_(dialog),
121 graph_update_timer_(NULL),
122 reset_axes_(false) {}
123 void triggerUpdate(int timeout, bool reset_axes = false);
124 void clearPendingUpdate();
125 void doUpdate();
126 bool hasPendingUpdate() { return graph_update_timer_ != NULL; }
127 private:
128 TCPStreamDialog *dialog_;
129 QTimer *graph_update_timer_;
130 bool reset_axes_;
131 };
132 friend class GraphUpdater;
133 GraphUpdater graph_updater_;
134
135 int num_dsegs_;
136 int num_acks_;
137 int num_sack_ranges_;
138
139 double ma_window_size_;
140
141 void findStream();
142 void fillGraph(bool reset_axes = true, bool set_focus = true);
143 void showWidgetsForGraphType();
144 void zoomAxes(bool in);
145 void zoomXAxis(bool in);
146 void zoomYAxis(bool in);
147 void setAxisUnits(QCPAxis *axis, format_size_units_e units);
148 void panAxes(int x_pixels, int y_pixels);
149 void resetAxes();
150 void fillLegend();
151 void moveLegend();
152 void toggleLegend();
153 void fillStevens();
154 void fillTcptrace();
155 void fillThroughput();
156 void fillRoundTripTime();
157 void fillWindowScale();
158 QString streamDescription();
159 bool compareHeaders(struct segment *seg);
160 void toggleTracerStyle(bool force_default = false);
161 QRectF getZoomRanges(QRect zoom_rect);
162
163private slots:
164 void showContextMenu(const QPoint &pos);
165 void graphClicked(QMouseEvent *event);
166 void axisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
167 void mouseMoved(QMouseEvent *event);
168 void mouseReleased(QMouseEvent *event);
169 void captureEvent(CaptureEvent e);
170 void transformYRange(const QCPRange &y_range1);
171 void toggleUnits();
172 void on_buttonBox_accepted();
173 void on_graphTypeComboBox_currentIndexChanged(int index);
174 void on_resetButton_clicked();
175 void on_streamNumberSpinBox_valueChanged(int new_stream);
176 void on_streamNumberSpinBox_editingFinished();
177 void on_maWindowSizeSpinBox_valueChanged(double new_ma_size);
178 void on_maWindowSizeSpinBox_editingFinished();
179 void on_selectSACKsCheckBox_stateChanged(int state);
180 void on_otherDirectionButton_clicked();
181 void on_dragRadioButton_toggled(bool checked);
182 void on_zoomRadioButton_toggled(bool checked);
183 void on_bySeqNumberCheckBox_stateChanged(int state);
184 void on_samplingMethodComboBox_currentIndexChanged(int index);
185 void on_showSegLengthCheckBox_stateChanged(int state);
186 void on_showThroughputCheckBox_stateChanged(int state);
187 void on_showGoodputCheckBox_stateChanged(int state);
188 void on_showRcvWinCheckBox_stateChanged(int state);
189 void on_showBytesOutCheckBox_stateChanged(int state);
190 void on_actionZoomIn_triggered();
191 void on_actionZoomInX_triggered();
192 void on_actionZoomInY_triggered();
193 void on_actionZoomOut_triggered();
194 void on_actionZoomOutX_triggered();
195 void on_actionZoomOutY_triggered();
196 void on_actionReset_triggered();
197 void on_actionMoveRight10_triggered();
198 void on_actionMoveLeft10_triggered();
199 void on_actionMoveUp10_triggered();
200 void on_actionMoveDown10_triggered();
201 void on_actionMoveRight1_triggered();
202 void on_actionMoveLeft1_triggered();
203 void on_actionMoveUp1_triggered();
204 void on_actionMoveDown1_triggered();
205 void on_actionNextStream_triggered();
206 void on_actionPreviousStream_triggered();
207 void on_actionSwitchDirection_triggered();
208 void on_actionGoToPacket_triggered();
209 void on_actionDragZoom_triggered();
210 void on_actionToggleSequenceNumbers_triggered();
211 void on_actionToggleTimeOrigin_triggered();
212 void on_actionRoundTripTime_triggered();
213 void on_actionThroughput_triggered();
214 void on_actionStevens_triggered();
215 void on_actionTcptrace_triggered();
216 void on_actionWindowScaling_triggered();
217 void on_buttonBox_helpRequested();
218};
219
220#endif // TCP_STREAM_DIALOG_H
221
Definition capture_event.h:21
Definition capture_file.h:21
Definition tcp_stream_dialog.h:49
Definition geometry_state_dialog.h:17
Definition tcp_stream_dialog.h:37
Definition tcp_stream_dialog.h:60
format_size_units_e
Definition str_util.h:231
Definition tap-tcp-stream.h:43
Definition tap-tcp-stream.h:72