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