18 #ifndef __CAPTURE_OPTS_H__
19 #define __CAPTURE_OPTS_H__
21 #include <sys/types.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
130 struct remote_host_info {
133 capture_auth auth_type;
134 gchar *auth_username;
135 gchar *auth_password;
137 gboolean nocap_rpcap;
138 gboolean nocap_local;
144 capture_auth auth_type;
145 gchar *auth_username;
146 gchar *auth_password;
149 typedef 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 gboolean monitor_mode_enabled;
176 gboolean monitor_mode_supported;
178 #ifdef HAVE_PCAP_REMOTE
179 remote_options remote_opts;
181 guint32 last_packets;
187 GHashTable *external_cap_args_settings;
188 gchar *timestamp_type;
203 gboolean has_snaplen;
206 gboolean promisc_mode;
207 interface_type if_type;
210 GHashTable *extcap_args;
212 gpointer extcap_pipedata;
213 GString *extcap_stderr;
214 guint extcap_stdout_watch;
215 guint extcap_stderr_watch;
217 HANDLE extcap_pipe_h;
218 HANDLE extcap_control_in_h;
219 HANDLE extcap_control_out_h;
221 gchar *extcap_control_in;
222 gchar *extcap_control_out;
223 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE
226 gboolean monitor_mode;
227 #ifdef HAVE_PCAP_REMOTE
228 capture_source src_type;
231 capture_auth auth_type;
232 gchar *auth_username;
233 gchar *auth_password;
235 gboolean nocap_rpcap;
236 gboolean nocap_local;
238 #ifdef HAVE_PCAP_SETSAMPLING
239 capture_sampling sampling_method;
242 gchar *timestamp_type;
243 int timestamp_type_id;
250 GList *(*get_iface_list)(
int *, gchar **);
350 capture_opts_init(
capture_options *capture_opts, GList *(*get_iface_list)(
int *, gchar **));
358 capture_opts_add_opt(
capture_options *capture_opts,
int opt,
const char *ws_optarg);
362 capture_opts_log(
const char *domain,
enum ws_log_level level,
capture_options *capture_opts);
368 capture_opts_list_file_types(
void);
371 CAPS_QUERY_LINK_TYPES = 0x1,
372 CAPS_QUERY_TIMESTAMP_TYPES = 0x2
383 capture_opts_print_interfaces(GList *if_list);
387 capture_opts_trim_snaplen(
capture_options *capture_opts,
int snaplen_min);
396 const char *capture_device);
411 capture_opts_free_link_row(gpointer elem);
414 capture_opts_free_interface_t(
interface_t *device);
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
gchar * temp_dir
Definition: capture_opts.h:328
gboolean stop_after_extcaps
Definition: capture_opts.h:333
gchar * closed_msg
Definition: capture_opts.h:336
gboolean has_ring_num_files
Definition: capture_opts.h:303
int ifaces_err
Definition: capture_opts.h:257
gboolean has_nametimenum
Definition: capture_opts.h:305
gint32 file_interval
Definition: capture_opts.h:299
gboolean capture_child
Definition: capture_opts.h:332
guint extcap_terminate_id
Definition: capture_opts.h:337
gchar * save_file
Definition: capture_opts.h:282
gboolean has_autostop_duration
Definition: capture_opts.h:321
GArray * ifaces
Definition: capture_opts.h:252
gboolean has_file_packets
Definition: capture_opts.h:300
gboolean wait_for_extcap_cbs
Definition: capture_opts.h:334
gboolean multi_files_on
Definition: capture_opts.h:294
GArray * all_ifaces
Definition: capture_opts.h:255
gboolean use_pcapng
Definition: capture_opts.h:284
gboolean print_file_names
Definition: capture_opts.h:325
gboolean real_time_mode
Definition: capture_opts.h:288
gdouble file_duration
Definition: capture_opts.h:297
int autostop_packets
Definition: capture_opts.h:314
int autostop_files
Definition: capture_opts.h:310
gchar * orig_save_file
Definition: capture_opts.h:291
guint32 ring_num_files
Definition: capture_opts.h:304
gboolean has_file_interval
Definition: capture_opts.h:298
gboolean group_read_access
Definition: capture_opts.h:283
gchar * print_name_to
Definition: capture_opts.h:327
guint32 autostop_filesize
Definition: capture_opts.h:320
gboolean has_autostop_packets
Definition: capture_opts.h:312
gdouble autostop_duration
Definition: capture_opts.h:323
gchar * ifaces_err_info
Definition: capture_opts.h:259
filter_list_t * capture_filters_list
Definition: capture_opts.h:338
gboolean output_to_pipe
Definition: capture_opts.h:331
int file_packets
Definition: capture_opts.h:302
guint update_interval
Definition: capture_opts.h:285
gboolean has_autostop_filesize
Definition: capture_opts.h:318
gboolean restart
Definition: capture_opts.h:290
gboolean show_info
Definition: capture_opts.h:289
gboolean has_autostop_files
Definition: capture_opts.h:308
gboolean has_autostop_written_packets
Definition: capture_opts.h:315
int autostop_written_packets
Definition: capture_opts.h:317
gchar * compress_type
Definition: capture_opts.h:335
gboolean has_file_duration
Definition: capture_opts.h:296
gboolean saving_to_file
Definition: capture_opts.h:281
Definition: filter_files.h:53
Definition: capture_ifinfo.h:43
Definition: capture_ifinfo.h:57
Definition: capture_opts.h:196
Definition: androiddump.c:219
Definition: capture_opts.h:159
Definition: capture_opts.h:191