18#ifndef __CAPTURE_OPTS_H__
19#define __CAPTURE_OPTS_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#define OPTSTRING_B "B:"
64#define OPTSTRING_I "I"
68#define LONGOPT_CAPTURE_COMMON \
69 {"autostop", ws_required_argument, NULL, 'a'}, \
70 {"ring-buffer", ws_required_argument, NULL, 'b'}, \
71 {"buffer-size", ws_required_argument, NULL, 'B'}, \
72 {"list-interfaces", ws_no_argument, NULL, 'D'}, \
73 {"list-sources", ws_no_argument, NULL, 'D'}, \
74 {"interface", ws_required_argument, NULL, 'i'}, \
75 {"source", ws_required_argument, NULL, 'i'}, \
76 {"monitor-mode", ws_no_argument, NULL, 'I'}, \
77 {"list-data-link-types", ws_no_argument, NULL, 'L'}, \
78 {"no-promiscuous-mode", ws_no_argument, NULL, 'p'}, \
79 {"snapshot-length", ws_required_argument, NULL, 's'}, \
80 {"linktype", ws_required_argument, NULL, 'y'}, \
81 {"list-time-stamp-types", ws_no_argument, NULL, LONGOPT_LIST_TSTAMP_TYPES}, \
82 {"time-stamp-type", ws_required_argument, NULL, LONGOPT_SET_TSTAMP_TYPE}, \
83 {"compress-type", ws_required_argument, NULL, LONGOPT_COMPRESS_TYPE}, \
84 {"temp-dir", ws_required_argument, NULL, LONGOPT_CAPTURE_TMPDIR},\
85 {"update-interval", ws_required_argument, NULL, LONGOPT_UPDATE_INTERVAL},
88#define OPTSTRING_CAPTURE_COMMON \
89 "a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:F:i:" OPTSTRING_I "Lps:y:"
91#ifdef HAVE_PCAP_REMOTE
104#ifdef HAVE_PCAP_SETSAMPLING
111 CAPTURE_SAMP_BY_COUNT,
113 CAPTURE_SAMP_BY_TIMER
119#ifdef HAVE_PCAP_REMOTE
120struct remote_host_info {
123 capture_auth auth_type;
134 capture_auth auth_type;
139typedef struct remote_options_tag {
140 capture_source src_type;
141 struct remote_host_info remote_host_opts;
142#ifdef HAVE_PCAP_SETSAMPLING
143 capture_sampling sampling_method;
162 bool monitor_mode_enabled;
163 bool monitor_mode_supported;
164#ifdef HAVE_PCAP_REMOTE
165 remote_options remote_opts;
167 uint32_t last_packets;
168 uint32_t packet_diff;
173 GHashTable *external_cap_args_settings;
174 char *timestamp_type;
193 interface_type if_type;
196 GHashTable *extcap_args;
198 void * extcap_pipedata;
199 GString *extcap_stderr;
200 unsigned extcap_stdout_watch;
201 unsigned extcap_stderr_watch;
203 HANDLE extcap_pipe_h;
204 HANDLE extcap_control_in_h;
205 HANDLE extcap_control_out_h;
207 char *extcap_control_in;
208 char *extcap_control_out;
211#ifdef HAVE_PCAP_REMOTE
212 capture_source src_type;
215 capture_auth auth_type;
222#ifdef HAVE_PCAP_SETSAMPLING
223 capture_sampling sampling_method;
226 char *timestamp_type;
227 int timestamp_type_id;
234 GList *(*get_iface_list)(
int *,
char **);
244 unsigned num_selected;
334capture_opts_init(
capture_options *capture_opts, GList *(*get_iface_list)(
int *,
char **));
342capture_opts_add_opt(
capture_options *capture_opts,
int opt,
const char *ws_optarg);
346capture_opts_log(
const char *domain,
enum ws_log_level level,
capture_options *capture_opts);
352capture_opts_list_file_types(
void);
355 CAPS_QUERY_LINK_TYPES = 0x1,
356 CAPS_QUERY_TIMESTAMP_TYPES = 0x2
367capture_opts_print_interfaces(GList *if_list);
371capture_opts_trim_snaplen(
capture_options *capture_opts,
int snaplen_min);
380 const char *capture_device);
383capture_opts_del_iface(
capture_options *capture_opts,
unsigned if_index);
395capture_opts_free_link_row(
void *elem);
401#define DEFAULT_CAPTURE_BUFFER_SIZE 2
404#define DEFAULT_UPDATE_INTERVAL 100
struct capture_options_tag capture_options
Definition mcast_stream.h:30
Definition capture_opts.h:232
bool saving_to_file
Definition capture_opts.h:265
bool stop_after_extcaps
Definition capture_opts.h:317
bool group_read_access
Definition capture_opts.h:267
int32_t file_interval
Definition capture_opts.h:283
bool has_file_interval
Definition capture_opts.h:282
bool multi_files_on
Definition capture_opts.h:278
bool real_time_mode
Definition capture_opts.h:272
bool restart
Definition capture_opts.h:274
double autostop_duration
Definition capture_opts.h:307
int ifaces_err
Definition capture_opts.h:241
bool has_file_duration
Definition capture_opts.h:280
bool has_autostop_files
Definition capture_opts.h:292
bool show_info
Definition capture_opts.h:273
bool has_autostop_filesize
Definition capture_opts.h:302
char * orig_save_file
Definition capture_opts.h:275
char * print_name_to
Definition capture_opts.h:311
GArray * ifaces
Definition capture_opts.h:236
bool has_autostop_duration
Definition capture_opts.h:305
bool use_pcapng
Definition capture_opts.h:268
GArray * all_ifaces
Definition capture_opts.h:239
bool wait_for_extcap_cbs
Definition capture_opts.h:318
int autostop_packets
Definition capture_opts.h:298
int autostop_files
Definition capture_opts.h:294
char * closed_msg
Definition capture_opts.h:320
bool has_autostop_packets
Definition capture_opts.h:296
bool capture_child
Definition capture_opts.h:316
bool has_nametimenum
Definition capture_opts.h:289
bool has_autostop_written_packets
Definition capture_opts.h:299
bool print_file_names
Definition capture_opts.h:309
bool has_file_packets
Definition capture_opts.h:284
unsigned update_interval
Definition capture_opts.h:269
unsigned extcap_terminate_id
Definition capture_opts.h:321
char * temp_dir
Definition capture_opts.h:312
bool output_to_pipe
Definition capture_opts.h:315
filter_list_t * capture_filters_list
Definition capture_opts.h:322
uint32_t ring_num_files
Definition capture_opts.h:288
int file_packets
Definition capture_opts.h:286
char * compress_type
Definition capture_opts.h:319
int autostop_written_packets
Definition capture_opts.h:301
uint32_t autostop_filesize
Definition capture_opts.h:304
bool has_ring_num_files
Definition capture_opts.h:287
char * ifaces_err_info
Definition capture_opts.h:243
char * save_file
Definition capture_opts.h:266
double file_duration
Definition capture_opts.h:281
Definition filter_files.h:53
Definition capture_ifinfo.h:43
Definition capture_ifinfo.h:57
Definition capture_opts.h:182
Definition androiddump.c:218
Definition capture_opts.h:149
Definition capture_opts.h:177