We need a 3rd try. (After learning how to run the testuite on Windows locally).
[metze/wireshark/wip.git] / ui / gtk / capture_dlg.h
1 /* capture_dlg.h
2  * Definitions for packet capture windows
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __CAPTURE_DLG_H__
26 #define __CAPTURE_DLG_H__
27
28 /* extern GtkWidget* airpcap_tb; */
29
30 /** @file
31  *  "Capture Options" dialog box.
32  *  @ingroup dialog_group
33  */
34 #include "capture_opts.h"
35
36 #ifdef HAVE_PCAP_REMOTE
37 struct remote_host {
38     gchar *remote_host;          /**< Host name or network address for remote capturing */
39     gchar *remote_port;          /**< TCP port of remote RPCAP server */
40     gint auth_type;              /**< Authentication type */
41     gchar *auth_username;        /**< Remote authentication parameters */
42     gchar *auth_password;        /**< Remote authentication parameters */
43     gboolean datatx_udp;
44     gboolean nocap_rpcap;
45     gboolean nocap_local;
46 };
47
48 typedef struct remote_options_tag {
49     capture_source src_type;
50     struct remote_host remote_host_opts;
51 #ifdef HAVE_PCAP_SETSAMPLING
52     capture_sampling sampling_method;
53     int sampling_param;
54 #endif
55 } remote_options;
56 #endif /* HAVE_PCAP_REMOTE */
57
58 typedef struct row_options_tag {
59     gchar *name;
60     gchar *display_name;
61     gchar *addresses;
62     gint no_addresses;
63     gchar *cfilter;
64     GList *links;
65     gint active_dlt;
66     gboolean pmode;
67 #ifdef HAVE_PCAP_CREATE
68     gboolean monitor_mode_enabled;
69     gboolean monitor_mode_supported;
70 #endif
71     gboolean has_snaplen;
72     guint snaplen;
73 #if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
74     gint buffer;
75 #endif
76 #ifdef HAVE_PCAP_REMOTE
77     remote_options remote_opts;
78 #endif
79 } interface_row;
80
81 typedef struct link_row_tag {
82     gchar *name;
83     gint dlt;
84 } link_row;
85
86 enum
87 {
88     CAPTURE = 0,
89     INTERFACE,
90     LINK,
91     PMODE,
92     SNAPLEN,
93 #if defined(HAVE_PCAP_CREATE)
94     BUFFER,
95     MONITOR,
96 #elif defined(_WIN32) && !defined(HAVE_PCAP_CREATE)
97     BUFFER,
98 #endif
99     FILTER,
100     NUM_COLUMNS
101 };
102
103 /** Initialize background capture filter syntax checking
104  */
105 void capture_filter_init(void);
106
107 /** User requested the "Capture Options" dialog box by menu or toolbar.
108  *
109  * @param widget parent widget (unused)
110  * @param data unused
111  */
112 void capture_prep_cb(GtkWidget *widget, gpointer data);
113
114 /** User requested capture start by menu or toolbar.
115  *
116  * @param widget parent widget (unused)
117  * @param data unused
118  */
119 void capture_start_cb(GtkWidget *widget, gpointer data);
120
121 /** User requested capture stop by menu or toolbar.
122  *
123  * @param widget parent widget (unused)
124  * @param data unused
125  */
126 void capture_stop_cb(GtkWidget *widget, gpointer data);
127
128 /** User requested capture restart by menu or toolbar.
129  *
130  * @param widget parent widget (unused)
131  * @param data unused
132  */
133 void capture_restart_cb(GtkWidget *widget, gpointer data);
134
135 /* capture start confirmed by "Save unsaved capture", so do it now */
136 void capture_start_confirmed(void);
137
138 /** User requested the "Capture Airpcap" dialog box by menu or toolbar.
139  *
140  * @param widget parent widget (unused)
141  * @param data unused
142  */
143 void
144 capture_air_cb(GtkWidget *widget, gpointer data);
145
146 /*
147  * We remember the capture settings for each interface when a capture
148  * is started on it; the next time we select that interface we start
149  * out with those settings.
150  *
151  * XXX - we currently only do that for monitor mode and the link-layer
152  * type; arguably we should do it for the snapshot length, and perhaps
153  * promiscuous mode.
154  */
155 typedef struct {
156     gboolean monitor_mode;
157     int linktype;
158 } cap_settings_t;
159
160 /** Get capture settings for interface
161  *
162  * @param if_name interface name
163  */
164 cap_settings_t
165 capture_get_cap_settings (gchar *if_name);
166
167 GtkTreeModel*
168 create_and_fill_model (GtkTreeView *view);
169
170 gboolean
171 query_tooltip_tree_view_cb (GtkWidget  *widget,
172                             gint        x,
173                             gint        y,
174                             gboolean    keyboard_tip,
175                             GtkTooltip *tooltip,
176                             gpointer    data);
177
178 void
179 activate_monitor (GtkTreeViewColumn *tree_column, GtkCellRenderer *renderer,
180                   GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
181
182 gboolean
183 dlg_window_present(void);
184
185 void
186 enable_selected_interface(gchar *name, gboolean enable);
187
188 void
189 options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column _U_, gpointer userdata);
190
191 #endif /* capture_dlg.h */