18 #ifndef __CAPTURE_OPTS_H__ 19 #define __CAPTURE_OPTS_H__ 21 #ifdef HAVE_SYS_TYPES_H 22 # include <sys/types.h> 25 #include <caputils/capture_ifinfo.h> 55 #define LONGOPT_NUM_CAP_COMMENT 128 56 #define LONGOPT_LIST_TSTAMP_TYPES 129 57 #define LONGOPT_SET_TSTAMP_TYPE 130 62 #ifdef HAVE_PCAP_REMOTE 63 #define OPTSTRING_A "A:" 65 #define OPTSTRING_A "" 68 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE 69 #define LONGOPT_BUFFER_SIZE \ 70 {"buffer-size", required_argument, NULL, 'B'}, 71 #define OPTSTRING_B "B:" 73 #define LONGOPT_BUFFER_SIZE 74 #define OPTSTRING_B "" 77 #ifdef HAVE_PCAP_CREATE 78 #define LONGOPT_MONITOR_MODE {"monitor-mode", no_argument, NULL, 'I'}, 79 #define OPTSTRING_I "I" 81 #define LONGOPT_MONITOR_MODE 82 #define OPTSTRING_I "" 85 #define LONGOPT_CAPTURE_COMMON \ 86 {"capture-comment", required_argument, NULL, LONGOPT_NUM_CAP_COMMENT}, \ 87 {"autostop", required_argument, NULL, 'a'}, \ 88 {"ring-buffer", required_argument, NULL, 'b'}, \ 90 {"list-interfaces", no_argument, NULL, 'D'}, \ 91 {"interface", required_argument, NULL, 'i'}, \ 92 LONGOPT_MONITOR_MODE \ 93 {"list-data-link-types", no_argument, NULL, 'L'}, \ 94 {"no-promiscuous-mode", no_argument, NULL, 'p'}, \ 95 {"snapshot-length", required_argument, NULL, 's'}, \ 96 {"linktype", required_argument, NULL, 'y'}, \ 97 {"list-time-stamp-types", no_argument, NULL, LONGOPT_LIST_TSTAMP_TYPES}, \ 98 {"time-stamp-type", required_argument, NULL, LONGOPT_SET_TSTAMP_TYPE}, 101 #define OPTSTRING_CAPTURE_COMMON \ 102 "a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:i:" OPTSTRING_I "Lps:y:" 104 #ifdef HAVE_PCAP_REMOTE 117 #ifdef HAVE_PCAP_SETSAMPLING 124 CAPTURE_SAMP_BY_COUNT,
126 CAPTURE_SAMP_BY_TIMER
132 #ifdef HAVE_PCAP_REMOTE 133 struct remote_host_info {
136 capture_auth auth_type;
137 gchar *auth_username;
138 gchar *auth_password;
140 gboolean nocap_rpcap;
141 gboolean nocap_local;
147 capture_auth auth_type;
148 gchar *auth_username;
149 gchar *auth_password;
152 typedef struct remote_options_tag {
153 capture_source src_type;
154 struct remote_host_info remote_host_opts;
155 #ifdef HAVE_PCAP_SETSAMPLING 156 capture_sampling sampling_method;
165 gchar *friendly_name;
173 gboolean has_snaplen;
176 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE 179 #ifdef HAVE_PCAP_CREATE 180 gboolean monitor_mode_enabled;
181 gboolean monitor_mode_supported;
183 #ifdef HAVE_PCAP_REMOTE 184 remote_options remote_opts;
186 guint32 last_packets;
192 GHashTable *external_cap_args_settings;
193 gchar *timestamp_type;
204 gchar *console_display_name;
206 gboolean has_snaplen;
209 gboolean promisc_mode;
210 interface_type if_type;
213 GHashTable *extcap_args;
215 gpointer extcap_pipedata;
216 guint extcap_child_watch;
218 HANDLE extcap_pipe_h;
219 HANDLE extcap_control_in_h;
220 HANDLE extcap_control_out_h;
222 gchar *extcap_control_in;
223 gchar *extcap_control_out;
224 #ifdef CAN_SET_CAPTURE_BUFFER_SIZE 227 gboolean monitor_mode;
228 #ifdef HAVE_PCAP_REMOTE 229 capture_source src_type;
232 capture_auth auth_type;
233 gchar *auth_username;
234 gchar *auth_password;
236 gboolean nocap_rpcap;
237 gboolean nocap_local;
239 #ifdef HAVE_PCAP_SETSAMPLING 240 capture_sampling sampling_method;
243 gchar *timestamp_type;
244 int timestamp_type_id;
316 gchar *capture_comment;
334 capture_opts_add_opt(
capture_options *capture_opts,
int opt,
const char *optarg, gboolean *start_capture);
338 capture_opts_log(
const char *log_domain, GLogLevelFlags log_level,
capture_options *capture_opts);
341 CAPS_MONITOR_MODE = 0x1,
342 CAPS_QUERY_LINK_TYPES = 0x2,
343 CAPS_QUERY_TIMESTAMP_TYPES = 0x4
348 capture_opts_print_if_capabilities(
if_capabilities_t *caps,
char *name,
int queries);
352 capture_opts_print_interfaces(GList *if_list);
356 capture_opts_trim_snaplen(
capture_options *capture_opts,
int snaplen_min);
365 const char *capture_device);
374 capture_opts_free_interface_t(
interface_t *device);
377 #define DEFAULT_CAPTURE_BUFFER_SIZE 2 gchar * ifaces_err_info
Definition: capture_opts.h:258
gint32 file_interval
Definition: capture_opts.h:297
gboolean saving_to_file
Definition: capture_opts.h:280
gboolean has_file_interval
Definition: capture_opts.h:296
Definition: capture_ifinfo.h:83
int ifaces_err
Definition: capture_opts.h:256
gboolean has_ring_num_files
Definition: capture_opts.h:298
gboolean has_autostop_files
Definition: capture_opts.h:302
guint32 autostop_filesize
Definition: capture_opts.h:311
GArray * all_ifaces
Definition: capture_opts.h:254
struct capture_options_tag capture_options
gint32 autostop_duration
Definition: capture_opts.h:314
gboolean capture_child
Definition: capture_opts.h:321
gboolean group_read_access
Definition: capture_opts.h:282
gchar * save_file
Definition: capture_opts.h:281
int autostop_packets
Definition: capture_opts.h:308
gboolean real_time_mode
Definition: capture_opts.h:286
gboolean has_file_duration
Definition: capture_opts.h:294
gint32 autostop_files
Definition: capture_opts.h:304
gchar * orig_save_file
Definition: capture_opts.h:289
Definition: capture_opts.h:196
gint32 file_duration
Definition: capture_opts.h:295
gboolean output_to_pipe
Definition: capture_opts.h:320
gboolean has_autostop_duration
Definition: capture_opts.h:312
Definition: androiddump.c:211
Definition: mcast_stream.h:30
guint32 ring_num_files
Definition: capture_opts.h:299
gboolean multi_files_on
Definition: capture_opts.h:292
Definition: capture_opts.h:201
Definition: capture_opts.h:162
GArray * ifaces
Definition: capture_opts.h:251
gboolean has_autostop_filesize
Definition: capture_opts.h:309
gboolean show_info
Definition: capture_opts.h:287
gboolean use_pcapng
Definition: capture_opts.h:283
gboolean has_autostop_packets
Definition: capture_opts.h:306
Definition: capture_ifinfo.h:37
gboolean restart
Definition: capture_opts.h:288
Definition: capture_opts.h:249