match_strval > try_val_to_str
[wireshark-wip.git] / epan / follow.h
blobb1e02dbcad85724712c6244a0517204533bd5046
1 /* follow.h
3 * $Id$
5 * Copyright 1998 Mike Hall <mlh@io.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef __FOLLOW_H__
28 #define __FOLLOW_H__
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
34 #include <epan/packet.h>
35 #include "ws_symbol_export.h"
37 #define MAX_IPADDR_LEN 16
39 /* With MSVC and a libwireshark.dll, we need a special declaration. */
40 WS_DLL_PUBLIC gboolean empty_tcp_stream;
41 WS_DLL_PUBLIC gboolean incomplete_tcp_stream;
43 typedef struct _tcp_stream_chunk {
44 guint8 src_addr[MAX_IPADDR_LEN];
45 guint16 src_port;
46 guint32 dlen;
47 } tcp_stream_chunk;
49 /** Build a follow filter based on the current packet's conversation.
51 * @param packet_info[in] The current packet.
52 * @return A filter that specifies the conversation. Must be g_free()d
53 * the caller.
55 WS_DLL_PUBLIC
56 gchar* build_follow_conv_filter( packet_info * );
58 /** Build a follow filter based on the current TCP stream index.
59 * follow_tcp_index() must be called prior to calling this.
61 * @return A filter that specifies the current stream. Must be g_free()d
62 * the caller.
64 WS_DLL_PUBLIC
65 gchar* build_follow_index_filter(void);
67 WS_DLL_PUBLIC
68 gboolean follow_tcp_addr( const address *, guint, const address *, guint );
70 /** Select a TCP stream to follow via its index.
72 * @param addr[in] The stream index to follow.
73 * @return TRUE on success, FALSE on failure.
75 WS_DLL_PUBLIC
76 gboolean follow_tcp_index( guint32 );
78 /** Get the current TCP index being followed.
80 * @return The current TCP index. The behavior is undefined
81 * if no TCP stream is being followed.
83 WS_DLL_PUBLIC
84 guint32 get_follow_tcp_index(void);
86 void reassemble_tcp( guint32, guint32, guint32, guint32, const char*, guint32,
87 int, address *, address *, guint, guint );
88 WS_DLL_PUBLIC
89 void reset_tcp_reassembly( void );
91 typedef struct {
92 guint8 ip_address[2][MAX_IPADDR_LEN];
93 guint32 port[2];
94 unsigned int bytes_written[2];
95 gboolean is_ipv6;
96 } follow_stats_t;
98 WS_DLL_PUBLIC
99 void follow_stats(follow_stats_t* stats);
101 #ifdef __cplusplus
103 #endif /* __cplusplus */
105 #endif