aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/follow_stream.h
blob: cb5252b6123badec1cef0c637629cb6e00ecc992 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* follow_stream.h
 * Common routines for following data streams
 *
 * 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 __FOLLOW_STREAM_H__
#define __FOLLOW_STREAM_H__

#include <gtk/gtk.h>
#include <ui/follow.h>

struct _follow_info;

typedef gboolean (*follow_print_line_func)(char *, size_t, gboolean, void *);
typedef frs_return_t (*follow_read_stream_func)(struct _follow_info *follow_info, follow_print_line_func follow_print, void *arg);

typedef struct _follow_info {
    follow_type_t   follow_type;
    show_stream_t   show_stream;
    show_type_t     show_type;
    char            *data_out_filename;
    GtkWidget       *text;
    GtkWidget       *ascii_bt;
    GtkWidget       *ebcdic_bt;
    GtkWidget       *hexdump_bt;
    GtkWidget       *carray_bt;
    GtkWidget       *raw_bt;
    GtkWidget       *find_dlg_w;
    gboolean        is_ipv6;
    char            *filter_out_filter;
    GtkWidget       *filter_te;
    GtkWidget       *streamwindow;
    GList           *payload;
    guint           bytes_written[2]; /* Index with FROM_CLIENT or FROM_SERVER for readability. */
    guint           client_port;
    address         client_ip;
    follow_read_stream_func read_stream;
} follow_info_t;

#define E_FOLLOW_INFO_KEY "follow_info_key"

/* List of "follow_info_t" structures for all "Follow TCP Stream" windows,
   so we can redraw them all if the colors or font changes. */
extern GList *follow_infos;

void follow_load_text(follow_info_t *follow_info);
void follow_filter_out_stream(GtkWidget * w, gpointer parent_w);
void follow_stream(const gchar *title, follow_info_t *follow_info,
                   gchar *both_directions_string,
                   gchar *server_to_client_string,
                   gchar *client_to_server_string);
frs_return_t follow_show(follow_info_t *follow_info,
                         follow_print_line_func follow_print,
                         char *buffer, size_t nchars, gboolean is_server,
                         void *arg, guint32 *global_pos,
                         guint32 *server_packet_count,
                         guint32 *client_packet_count);
gboolean follow_add_to_gtk_text(char *buffer, size_t nchars, gboolean is_server,
                                 void *arg);

#endif /* __FOLLOW_STREAM_H__ */

/*
 * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 4
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * vi: set shiftwidth=4 tabstop=8 expandtab:
 * :indentSize=4:tabSize=8:noTabs=true:
 */