Add an item tracer to the TCP stream graph. Enable packet selection.
[metze/wireshark/wip.git] / ui / tap-tcp-stream.h
1 /* tap-tcp-stream.h
2  * TCP stream statistics
3  * Originally from tcp_graph.c by Pavel Mores <pvl@uh.cz>
4  * Win32 port:  rwh@unifiedtech.com
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  */
26
27 #ifndef __TAP_TCP_STREAM_H__
28 #define __TAP_TCP_STREAM_H__
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 typedef enum tcp_graph_type_ {
35     GRAPH_TSEQ_STEVENS,
36     GRAPH_TSEQ_TCPTRACE,
37     GRAPH_THROUGHPUT,
38     GRAPH_RTT,
39     GRAPH_WSCALE
40 } tcp_graph_type;
41
42 struct segment {
43     struct segment *next;
44     guint32 num;
45     guint32 rel_secs;
46     guint32 rel_usecs;
47     guint32 abs_secs;
48     guint32 abs_usecs;
49
50     guint32 th_seq;
51     guint32 th_ack;
52     guint16 th_flags;
53     guint32 th_win;   /* make it 32 bits so we can handle some scaling */
54     guint32 th_seglen;
55     guint16 th_sport;
56     guint16 th_dport;
57     address ip_src;
58     address ip_dst;
59
60     guint8  num_sack_ranges;
61     guint32 sack_left_edge[MAX_TCP_SACK_RANGES];
62     guint32 sack_right_edge[MAX_TCP_SACK_RANGES];
63 };
64
65 struct tcp_graph {
66     tcp_graph_type   type;
67
68     /* The stream this graph will show */
69     address          src_address;
70     guint16          src_port;
71     address          dst_address;
72     guint16          dst_port;
73     /* Should this be a map or tree instead? */
74     struct segment  *segments;
75 };
76
77 void graph_segment_list_get(capture_file *, struct tcp_graph *, gboolean stream_known );
78 void graph_segment_list_free(struct tcp_graph * );
79
80 /* for compare_headers() */
81 /* segment went the same direction as the currently selected one */
82 #define COMPARE_CURR_DIR    0
83 #define COMPARE_ANY_DIR     1
84
85 int compare_headers(address *saddr1, address *daddr1, guint16 sport1, guint16 dport1, const address *saddr2, const address *daddr2, guint16 sport2, guint16 dport2, int dir);
86
87 struct tcpheader *select_tcpip_session(capture_file *, struct segment * );
88
89 #ifdef __cplusplus
90 }
91 #endif /* __cplusplus */
92
93 #endif /* __TAP_TCP_STREAM_H__ */
94
95 /*
96  * Editor modelines
97  *
98  * Local Variables:
99  * c-basic-offset: 4
100  * tab-width: 8
101  * indent-tabs-mode: nil
102  * End:
103  *
104  * ex: set shiftwidth=4 tabstop=8 expandtab:
105  * :indentSize=4:tabSize=8:noTabs=true:
106  */