18#ifndef __CAPTURE_OPTS_H__
19#define __CAPTURE_OPTS_H__
48#define LONGOPT_LIST_TSTAMP_TYPES LONGOPT_BASE_CAPTURE+1
49#define LONGOPT_SET_TSTAMP_TYPE LONGOPT_BASE_CAPTURE+2
50#define LONGOPT_COMPRESS_TYPE LONGOPT_BASE_CAPTURE+3
51#define LONGOPT_CAPTURE_TMPDIR LONGOPT_BASE_CAPTURE+4
52#define LONGOPT_UPDATE_INTERVAL LONGOPT_BASE_CAPTURE+5
57#ifdef HAVE_PCAP_REMOTE
58#define OPTSTRING_A "A:"
63#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
64#define LONGOPT_BUFFER_SIZE \
65 {"buffer-size", ws_required_argument, NULL, 'B'},
66#define OPTSTRING_B "B:"
68#define LONGOPT_BUFFER_SIZE
72#ifdef HAVE_PCAP_CREATE
73#define LONGOPT_MONITOR_MODE {"monitor-mode", ws_no_argument, NULL, 'I'},
74#define OPTSTRING_I "I"
76#define LONGOPT_MONITOR_MODE
80#define LONGOPT_CAPTURE_COMMON \
81 {"autostop", ws_required_argument, NULL, 'a'}, \
82 {"ring-buffer", ws_required_argument, NULL, 'b'}, \
84 {"list-interfaces", ws_no_argument, NULL, 'D'}, \
85 {"interface", ws_required_argument, NULL, 'i'}, \
86 LONGOPT_MONITOR_MODE \
87 {"list-data-link-types", ws_no_argument, NULL, 'L'}, \
88 {"no-promiscuous-mode", ws_no_argument, NULL, 'p'}, \
89 {"snapshot-length", ws_required_argument, NULL, 's'}, \
90 {"linktype", ws_required_argument, NULL, 'y'}, \
91 {"list-time-stamp-types", ws_no_argument, NULL, LONGOPT_LIST_TSTAMP_TYPES}, \
92 {"time-stamp-type", ws_required_argument, NULL, LONGOPT_SET_TSTAMP_TYPE}, \
93 {"compress-type", ws_required_argument, NULL, LONGOPT_COMPRESS_TYPE}, \
94 {"temp-dir", ws_required_argument, NULL, LONGOPT_CAPTURE_TMPDIR},\
95 {"update-interval", ws_required_argument, NULL, LONGOPT_UPDATE_INTERVAL},
98#define OPTSTRING_CAPTURE_COMMON \
99 "a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:F:i:" OPTSTRING_I "Lps:y:"
101#ifdef HAVE_PCAP_REMOTE
114#ifdef HAVE_PCAP_SETSAMPLING
121 CAPTURE_SAMP_BY_COUNT,
123 CAPTURE_SAMP_BY_TIMER
129#ifdef HAVE_PCAP_REMOTE
130struct remote_host_info {
133 capture_auth auth_type;
144 capture_auth auth_type;
149typedef struct remote_options_tag {
150 capture_source src_type;
151 struct remote_host_info remote_host_opts;
152#ifdef HAVE_PCAP_SETSAMPLING
153 capture_sampling sampling_method;
171#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
174#ifdef HAVE_PCAP_CREATE
175 bool monitor_mode_enabled;
176 bool monitor_mode_supported;
178#ifdef HAVE_PCAP_REMOTE
179 remote_options remote_opts;
181 uint32_t last_packets;
182 uint32_t packet_diff;
187 GHashTable *external_cap_args_settings;
188 char *timestamp_type;
207 interface_type if_type;
210 GHashTable *extcap_args;
212 void * extcap_pipedata;
213 GString *extcap_stderr;
214 unsigned extcap_stdout_watch;
215 unsigned extcap_stderr_watch;
217 HANDLE extcap_pipe_h;
218 HANDLE extcap_control_in_h;
219 HANDLE extcap_control_out_h;
221 char *extcap_control_in;
222 char *extcap_control_out;
223#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
227#ifdef HAVE_PCAP_REMOTE
228 capture_source src_type;
231 capture_auth auth_type;
238#ifdef HAVE_PCAP_SETSAMPLING
239 capture_sampling sampling_method;
242 char *timestamp_type;
243 int timestamp_type_id;
250 GList *(*get_iface_list)(
int *,
char **);
260 unsigned num_selected;
350capture_opts_init(
capture_options *capture_opts, GList *(*get_iface_list)(
int *,
char **));
358capture_opts_add_opt(
capture_options *capture_opts,
int opt,
const char *ws_optarg);
362capture_opts_log(
const char *domain,
enum ws_log_level level,
capture_options *capture_opts);
368capture_opts_list_file_types(
void);
371 CAPS_QUERY_LINK_TYPES = 0x1,
372 CAPS_QUERY_TIMESTAMP_TYPES = 0x2
383capture_opts_print_interfaces(GList *if_list);
387capture_opts_trim_snaplen(
capture_options *capture_opts,
int snaplen_min);
396 const char *capture_device);
399capture_opts_del_iface(
capture_options *capture_opts,
unsigned if_index);
411capture_opts_free_link_row(
void *elem);
417#define DEFAULT_CAPTURE_BUFFER_SIZE 2
420#define DEFAULT_UPDATE_INTERVAL 100
struct capture_options_tag capture_options
Definition mcast_stream.h:30
Definition capture_opts.h:248
bool saving_to_file
Definition capture_opts.h:281
bool stop_after_extcaps
Definition capture_opts.h:333
bool group_read_access
Definition capture_opts.h:283
int32_t file_interval
Definition capture_opts.h:299
bool has_file_interval
Definition capture_opts.h:298
bool multi_files_on
Definition capture_opts.h:294
bool real_time_mode
Definition capture_opts.h:288
bool restart
Definition capture_opts.h:290
double autostop_duration
Definition capture_opts.h:323
int ifaces_err
Definition capture_opts.h:257
bool has_file_duration
Definition capture_opts.h:296
bool has_autostop_files
Definition capture_opts.h:308
bool show_info
Definition capture_opts.h:289
bool has_autostop_filesize
Definition capture_opts.h:318
char * orig_save_file
Definition capture_opts.h:291
char * print_name_to
Definition capture_opts.h:327
GArray * ifaces
Definition capture_opts.h:252
bool has_autostop_duration
Definition capture_opts.h:321
bool use_pcapng
Definition capture_opts.h:284
GArray * all_ifaces
Definition capture_opts.h:255
bool wait_for_extcap_cbs
Definition capture_opts.h:334
int autostop_packets
Definition capture_opts.h:314
int autostop_files
Definition capture_opts.h:310
char * closed_msg
Definition capture_opts.h:336
bool has_autostop_packets
Definition capture_opts.h:312
bool capture_child
Definition capture_opts.h:332
bool has_nametimenum
Definition capture_opts.h:305
bool has_autostop_written_packets
Definition capture_opts.h:315
bool print_file_names
Definition capture_opts.h:325
bool has_file_packets
Definition capture_opts.h:300
unsigned update_interval
Definition capture_opts.h:285
unsigned extcap_terminate_id
Definition capture_opts.h:337
char * temp_dir
Definition capture_opts.h:328
bool output_to_pipe
Definition capture_opts.h:331
filter_list_t * capture_filters_list
Definition capture_opts.h:338
uint32_t ring_num_files
Definition capture_opts.h:304
int file_packets
Definition capture_opts.h:302
char * compress_type
Definition capture_opts.h:335
int autostop_written_packets
Definition capture_opts.h:317
uint32_t autostop_filesize
Definition capture_opts.h:320
bool has_ring_num_files
Definition capture_opts.h:303
char * ifaces_err_info
Definition capture_opts.h:259
char * save_file
Definition capture_opts.h:282
double file_duration
Definition capture_opts.h:297
Definition filter_files.h:53
Definition capture_ifinfo.h:43
Definition capture_ifinfo.h:57
Definition capture_opts.h:196
Definition androiddump.c:218
Definition capture_opts.h:159
Definition capture_opts.h:191