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