diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-08-27 18:13:20 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-08-27 18:13:20 +0000 |
commit | 6d731a3e79e2feb9abefe2c1238a1c159f34586b (patch) | |
tree | 1d09de0370a4f0efd6c6c7dd8572dfaa1394d36f /ui/tap-tcp-stream.h | |
parent | 77f1ed0f9364adb75ad60c53618a3ccb9f4a6db0 (diff) |
Add TCP sequence number (Stevens-style) graphs.
Add the QCustomPlot widget. Thanks to Emanuel Eichhammer for granting a
license change. Move some common code from ui/gtk/tcp_graph.c to
ui/tap-tcp-stream.[ch]. Get rid of tcp_graph_selected_packet_enabled().
It was only used in the menu code and didn't match what we were doing
elsewhere.
Still quite a bit of work to do but it's a promising start.
svn path=/trunk/; revision=51538
Diffstat (limited to 'ui/tap-tcp-stream.h')
-rw-r--r-- | ui/tap-tcp-stream.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/ui/tap-tcp-stream.h b/ui/tap-tcp-stream.h new file mode 100644 index 0000000000..a502354daa --- /dev/null +++ b/ui/tap-tcp-stream.h @@ -0,0 +1,105 @@ +/* tap-tcp-stream.h + * TCP stream statistics + * Originally from tcp_graph.c by Pavel Mores <pvl@uh.cz> + * Win32 port: rwh@unifiedtech.com + * + * $Id$ + * + * 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 __TAP_TCP_STREAM_H__ +#define __TAP_TCP_STREAM_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef enum tcp_graph_type_ { + GRAPH_TSEQ_STEVENS, + GRAPH_TSEQ_TCPTRACE, + GRAPH_THROUGHPUT, + GRAPH_RTT, + GRAPH_WSCALE +} tcp_graph_type; + +struct segment { + struct segment *next; + guint32 num; + guint32 rel_secs; + guint32 rel_usecs; + guint32 abs_secs; + guint32 abs_usecs; + + guint32 th_seq; + guint32 th_ack; + guint16 th_flags; + guint32 th_win; /* make it 32 bits so we can handle some scaling */ + guint32 th_seglen; + guint16 th_sport; + guint16 th_dport; + address ip_src; + address ip_dst; + + guint8 num_sack_ranges; + guint32 sack_left_edge[MAX_TCP_SACK_RANGES]; + guint32 sack_right_edge[MAX_TCP_SACK_RANGES]; +}; + +struct tcp_graph { + tcp_graph_type type; + + /* The stream this graph will show */ + address src_address; + guint16 src_port; + address dst_address; + guint16 dst_port; + struct segment *segments; +}; + +void graph_segment_list_get(capture_file *, struct tcp_graph *, gboolean stream_known ); +void graph_segment_list_free(struct tcp_graph * ); + +/* for compare_headers() */ +/* segment went the same direction as the currently selected one */ +#define COMPARE_CURR_DIR 0 +#define COMPARE_ANY_DIR 1 + +int compare_headers(address *saddr1, address *daddr1, guint16 sport1, guint16 dport1, const address *saddr2, const address *daddr2, guint16 sport2, guint16 dport2, int dir); + +struct tcpheader *select_tcpip_session(capture_file *, struct segment * ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __TAP_TCP_STREAM_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: + */ |