2013-08-27 18:13:20 +00:00
|
|
|
/* tcp_stream_dialog.h
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TCP_STREAM_DIALOG_H
|
|
|
|
#define TCP_STREAM_DIALOG_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <file.h>
|
|
|
|
|
|
|
|
#include <epan/dissectors/packet-tcp.h>
|
|
|
|
|
|
|
|
#include "ui/tap-tcp-stream.h"
|
|
|
|
|
2013-08-30 21:28:51 +00:00
|
|
|
#include "qcustomplot.h"
|
2013-08-27 18:13:20 +00:00
|
|
|
#include <QDialog>
|
2013-09-12 23:46:56 +00:00
|
|
|
#include <QMenu>
|
2013-09-09 01:40:06 +00:00
|
|
|
#include <QRubberBand>
|
2013-08-27 18:13:20 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TCPStreamDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class TCPStreamDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TCPStreamDialog(QWidget *parent = 0, capture_file *cf = NULL, tcp_graph_type graph_type = GRAPH_TSEQ_STEVENS);
|
|
|
|
~TCPStreamDialog();
|
|
|
|
|
2013-08-30 21:15:24 +00:00
|
|
|
signals:
|
|
|
|
void goToPacket(int packet_num);
|
|
|
|
|
2013-09-04 23:15:59 +00:00
|
|
|
public slots:
|
|
|
|
void setCaptureFile(capture_file *cf);
|
|
|
|
|
2013-08-27 23:28:35 +00:00
|
|
|
protected:
|
2013-09-06 00:41:07 +00:00
|
|
|
void showEvent(QShowEvent *event);
|
2013-08-27 23:28:35 +00:00
|
|
|
void keyPressEvent(QKeyEvent *event);
|
2013-09-09 01:40:06 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
2013-08-27 23:28:35 +00:00
|
|
|
|
2013-08-27 18:13:20 +00:00
|
|
|
private:
|
|
|
|
Ui::TCPStreamDialog *ui;
|
|
|
|
capture_file *cap_file_;
|
2013-09-09 01:40:06 +00:00
|
|
|
QMap<double, struct segment *> time_stamp_map_;
|
|
|
|
double ts_offset_;
|
|
|
|
bool ts_origin_conn_;
|
2013-09-08 01:25:27 +00:00
|
|
|
QMap<double, struct segment *> sequence_num_map_;
|
2013-09-09 01:40:06 +00:00
|
|
|
double seq_offset_;
|
|
|
|
bool seq_origin_zero_;
|
2013-08-27 18:13:20 +00:00
|
|
|
struct tcp_graph graph_;
|
2013-09-04 23:15:59 +00:00
|
|
|
QCPPlotTitle *title_;
|
2013-09-16 17:28:42 +00:00
|
|
|
QString stream_desc_;
|
2013-09-13 22:29:05 +00:00
|
|
|
QCPGraph *base_graph_; // Clickable packets
|
|
|
|
QCPGraph *tput_graph_;
|
2013-09-13 23:34:34 +00:00
|
|
|
QCPGraph *seg_graph_;
|
2013-09-13 22:29:05 +00:00
|
|
|
QCPGraph *ack_graph_;
|
|
|
|
QCPGraph *rwin_graph_;
|
2013-08-30 21:15:24 +00:00
|
|
|
QCPItemTracer *tracer_;
|
2013-09-09 01:40:06 +00:00
|
|
|
QRectF axis_bounds_;
|
2013-08-30 21:15:24 +00:00
|
|
|
guint32 packet_num_;
|
2013-09-06 00:41:07 +00:00
|
|
|
QTransform y_axis_xfrm_;
|
2013-09-09 01:40:06 +00:00
|
|
|
bool mouse_drags_;
|
|
|
|
QRubberBand *rubber_band_;
|
|
|
|
QPoint rb_origin_;
|
2013-09-12 23:46:56 +00:00
|
|
|
QMenu ctx_menu_;
|
2013-08-30 21:15:24 +00:00
|
|
|
|
2013-09-04 23:15:59 +00:00
|
|
|
int num_dsegs_;
|
|
|
|
int num_acks_;
|
|
|
|
int num_sack_ranges_;
|
2013-08-30 21:15:24 +00:00
|
|
|
|
2013-09-13 22:29:05 +00:00
|
|
|
void findStream();
|
2013-09-04 23:15:59 +00:00
|
|
|
void fillGraph();
|
2013-09-12 23:46:56 +00:00
|
|
|
void zoomAxes(bool in);
|
|
|
|
void panAxes(int x_pixels, int y_pixels);
|
2013-09-04 23:15:59 +00:00
|
|
|
void resetAxes();
|
2013-09-09 01:40:06 +00:00
|
|
|
void fillStevens();
|
2013-09-13 22:29:05 +00:00
|
|
|
void fillTcptrace();
|
2013-09-09 01:40:06 +00:00
|
|
|
void fillThroughput();
|
|
|
|
void fillRoundTripTime();
|
|
|
|
void fillWindowScale();
|
2013-09-04 23:15:59 +00:00
|
|
|
QString streamDescription();
|
2013-08-30 21:15:24 +00:00
|
|
|
bool compareHeaders(struct segment *seg);
|
|
|
|
void toggleTracerStyle(bool force_default = false);
|
2013-09-09 01:40:06 +00:00
|
|
|
QRectF getZoomRanges(QRect zoom_rect);
|
2013-08-30 21:15:24 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void graphClicked(QMouseEvent *event);
|
2013-09-09 01:40:06 +00:00
|
|
|
void axisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
|
2013-08-30 21:15:24 +00:00
|
|
|
void mouseMoved(QMouseEvent *event);
|
2013-09-09 01:40:06 +00:00
|
|
|
void mouseReleased(QMouseEvent *event);
|
2013-09-06 00:41:07 +00:00
|
|
|
void transformYRange(const QCPRange &y_range1);
|
2013-08-30 23:01:03 +00:00
|
|
|
void on_buttonBox_accepted();
|
2013-09-04 23:15:59 +00:00
|
|
|
void on_graphTypeComboBox_currentIndexChanged(int index);
|
2013-09-07 03:51:27 +00:00
|
|
|
void on_resetButton_clicked();
|
2013-09-13 22:29:05 +00:00
|
|
|
void on_streamNumberSpinBox_valueChanged(int new_stream);
|
2013-09-08 01:25:27 +00:00
|
|
|
void on_otherDirectionButton_clicked();
|
2013-09-12 21:37:47 +00:00
|
|
|
void on_dragRadioButton_toggled(bool checked);
|
2013-11-12 01:08:08 +00:00
|
|
|
void on_zoomRadioButton_toggled(bool checked);
|
2013-09-12 23:46:56 +00:00
|
|
|
void on_actionZoomIn_triggered();
|
|
|
|
void on_actionZoomOut_triggered();
|
|
|
|
void on_actionReset_triggered();
|
|
|
|
void on_actionMoveRight10_triggered();
|
|
|
|
void on_actionMoveLeft10_triggered();
|
|
|
|
void on_actionMoveUp10_triggered();
|
|
|
|
void on_actionMoveDown10_triggered();
|
|
|
|
void on_actionMoveRight1_triggered();
|
|
|
|
void on_actionMoveLeft1_triggered();
|
|
|
|
void on_actionMoveUp1_triggered();
|
|
|
|
void on_actionMoveDown1_triggered();
|
|
|
|
void on_actionNextStream_triggered();
|
|
|
|
void on_actionPreviousStream_triggered();
|
|
|
|
void on_actionSwitchDirection_triggered();
|
|
|
|
void on_actionGoToPacket_triggered();
|
|
|
|
void on_actionDragZoom_triggered();
|
|
|
|
void on_actionToggleSequenceNumbers_triggered();
|
|
|
|
void on_actionToggleTimeOrigin_triggered();
|
2013-09-13 22:29:05 +00:00
|
|
|
void on_actionRoundTripTime_triggered();
|
|
|
|
void on_actionThroughput_triggered();
|
|
|
|
void on_actionStevens_triggered();
|
|
|
|
void on_actionTcptrace_triggered();
|
|
|
|
void on_actionWindowScaling_triggered();
|
2013-08-27 18:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TCP_STREAM_DIALOG_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|