18 #ifndef __CAPTURE_OPTS_H__
19 #define __CAPTURE_OPTS_H__
21 #include <sys/types.h>
47 #define LONGOPT_LIST_TSTAMP_TYPES LONGOPT_BASE_CAPTURE+1
48 #define LONGOPT_SET_TSTAMP_TYPE LONGOPT_BASE_CAPTURE+2
49 #define LONGOPT_COMPRESS_TYPE LONGOPT_BASE_CAPTURE+3
50 #define LONGOPT_CAPTURE_TMPDIR LONGOPT_BASE_CAPTURE+4
51 #define LONGOPT_UPDATE_INTERVAL LONGOPT_BASE_CAPTURE+5
56 #ifdef HAVE_PCAP_REMOTE
57 #define OPTSTRING_A "A:"
62 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE
63 #define LONGOPT_BUFFER_SIZE \
64 {"buffer-size", ws_required_argument, NULL, 'B'},
65 #define OPTSTRING_B "B:"
67 #define LONGOPT_BUFFER_SIZE
71 #ifdef HAVE_PCAP_CREATE
72 #define LONGOPT_MONITOR_MODE {"monitor-mode", ws_no_argument, NULL, 'I'},
73 #define OPTSTRING_I "I"
75 #define LONGOPT_MONITOR_MODE
79 #define LONGOPT_CAPTURE_COMMON \
80 {"autostop", ws_required_argument, NULL, 'a'}, \
81 {"ring-buffer", ws_required_argument, NULL, 'b'}, \
83 {"list-interfaces", ws_no_argument, NULL, 'D'}, \
84 {"interface", ws_required_argument, NULL, 'i'}, \
85 LONGOPT_MONITOR_MODE \
86 {"list-data-link-types", ws_no_argument, NULL, 'L'}, \
87 {"no-promiscuous-mode", ws_no_argument, NULL, 'p'}, \
88 {"snapshot-length", ws_required_argument, NULL, 's'}, \
89 {"linktype", ws_required_argument, NULL, 'y'}, \
90 {"list-time-stamp-types", ws_no_argument, NULL, LONGOPT_LIST_TSTAMP_TYPES}, \
91 {"time-stamp-type", ws_required_argument, NULL, LONGOPT_SET_TSTAMP_TYPE}, \
92 {"compress-type", ws_required_argument, NULL, LONGOPT_COMPRESS_TYPE}, \
93 {"temp-dir", ws_required_argument, NULL, LONGOPT_CAPTURE_TMPDIR},\
94 {"update-interval", ws_required_argument, NULL, LONGOPT_UPDATE_INTERVAL},
97 #define OPTSTRING_CAPTURE_COMMON \
98 "a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:i:" OPTSTRING_I "Lps:y:"
100 #ifdef HAVE_PCAP_REMOTE
113 #ifdef HAVE_PCAP_SETSAMPLING
120 CAPTURE_SAMP_BY_COUNT,
122 CAPTURE_SAMP_BY_TIMER
128 #ifdef HAVE_PCAP_REMOTE
129 struct remote_host_info {
132 capture_auth auth_type;
133 gchar *auth_username;
134 gchar *auth_password;
136 gboolean nocap_rpcap;
137 gboolean nocap_local;
143 capture_auth auth_type;
144 gchar *auth_username;
145 gchar *auth_password;
148 typedef struct remote_options_tag {
149 capture_source src_type;
150 struct remote_host_info remote_host_opts;
151 #ifdef HAVE_PCAP_SETSAMPLING
152 capture_sampling sampling_method;
161 gchar *friendly_name;
162 gchar *vendor_description;
170 gboolean has_snaplen;
173 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE
176 #ifdef HAVE_PCAP_CREATE
177 gboolean monitor_mode_enabled;
178 gboolean monitor_mode_supported;
180 #ifdef HAVE_PCAP_REMOTE
181 remote_options remote_opts;
183 guint32 last_packets;
189 GHashTable *external_cap_args_settings;
190 gchar *timestamp_type;
205 gboolean has_snaplen;
208 gboolean promisc_mode;
209 interface_type if_type;
212 GHashTable *extcap_args;
214 gpointer extcap_pipedata;
215 GString *extcap_stderr;
216 guint extcap_stdout_watch;
217 guint extcap_stderr_watch;
219 HANDLE extcap_pipe_h;
220 HANDLE extcap_control_in_h;
221 HANDLE extcap_control_out_h;
223 gchar *extcap_control_in;
224 gchar *extcap_control_out;
225 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE
228 gboolean monitor_mode;
229 #ifdef HAVE_PCAP_REMOTE
230 capture_source src_type;
233 capture_auth auth_type;
234 gchar *auth_username;
235 gchar *auth_password;
237 gboolean nocap_rpcap;
238 gboolean nocap_local;
240 #ifdef HAVE_PCAP_SETSAMPLING
241 capture_sampling sampling_method;
244 gchar *timestamp_type;
245 int timestamp_type_id;
252 GList *(*get_iface_list)(
int *, gchar **);
351 capture_opts_init(
capture_options *capture_opts, GList *(*get_iface_list)(
int *, gchar **));
359 capture_opts_add_opt(
capture_options *capture_opts,
int opt,
const char *ws_optarg);
363 capture_opts_log(
const char *domain,
enum ws_log_level level,
capture_options *capture_opts);
366 CAPS_QUERY_LINK_TYPES = 0x1,
367 CAPS_QUERY_TIMESTAMP_TYPES = 0x2
378 capture_opts_print_interfaces(GList *if_list);
382 capture_opts_trim_snaplen(
capture_options *capture_opts,
int snaplen_min);
391 const char *capture_device);
400 capture_opts_free_interface_t(
interface_t *device);
403 #define DEFAULT_CAPTURE_BUFFER_SIZE 2
406 #define DEFAULT_UPDATE_INTERVAL 100
struct capture_options_tag capture_options
Definition: mcast_stream.h:30
Definition: capture_opts.h:250
gchar * temp_dir
Definition: capture_opts.h:330
gboolean stop_after_extcaps
Definition: capture_opts.h:335
gchar * closed_msg
Definition: capture_opts.h:338
gboolean has_ring_num_files
Definition: capture_opts.h:305
int ifaces_err
Definition: capture_opts.h:259
gboolean has_nametimenum
Definition: capture_opts.h:307
gint32 file_interval
Definition: capture_opts.h:301
gboolean capture_child
Definition: capture_opts.h:334
guint extcap_terminate_id
Definition: capture_opts.h:339
gchar * save_file
Definition: capture_opts.h:284
gboolean has_autostop_duration
Definition: capture_opts.h:323
GArray * ifaces
Definition: capture_opts.h:254
gboolean has_file_packets
Definition: capture_opts.h:302
gboolean wait_for_extcap_cbs
Definition: capture_opts.h:336
gboolean multi_files_on
Definition: capture_opts.h:296
GArray * all_ifaces
Definition: capture_opts.h:257
gboolean use_pcapng
Definition: capture_opts.h:286
gboolean print_file_names
Definition: capture_opts.h:327
gboolean real_time_mode
Definition: capture_opts.h:290
gdouble file_duration
Definition: capture_opts.h:299
int autostop_packets
Definition: capture_opts.h:316
int autostop_files
Definition: capture_opts.h:312
gchar * orig_save_file
Definition: capture_opts.h:293
guint32 ring_num_files
Definition: capture_opts.h:306
gboolean has_file_interval
Definition: capture_opts.h:300
gboolean group_read_access
Definition: capture_opts.h:285
gchar * print_name_to
Definition: capture_opts.h:329
guint32 autostop_filesize
Definition: capture_opts.h:322
gboolean has_autostop_packets
Definition: capture_opts.h:314
gdouble autostop_duration
Definition: capture_opts.h:325
gchar * ifaces_err_info
Definition: capture_opts.h:261
gboolean output_to_pipe
Definition: capture_opts.h:333
int file_packets
Definition: capture_opts.h:304
guint update_interval
Definition: capture_opts.h:287
gboolean has_autostop_filesize
Definition: capture_opts.h:320
gboolean restart
Definition: capture_opts.h:292
gboolean show_info
Definition: capture_opts.h:291
gboolean has_autostop_files
Definition: capture_opts.h:310
gboolean has_autostop_written_packets
Definition: capture_opts.h:317
int autostop_written_packets
Definition: capture_opts.h:319
gchar * compress_type
Definition: capture_opts.h:337
gboolean has_file_duration
Definition: capture_opts.h:298
gboolean saving_to_file
Definition: capture_opts.h:283
Definition: capture_ifinfo.h:102
Definition: capture_ifinfo.h:42
Definition: capture_opts.h:198
Definition: androiddump.c:218
Definition: capture_opts.h:158
Definition: capture_opts.h:193