13#ifndef __EXTCAP_BASE_H__
14#define __EXTCAP_BASE_H__
17#include <glib/gprintf.h>
34#define EXTCAP_BASE_OPTIONS_ENUM \
35 EXTCAP_OPT_LIST_INTERFACES, \
37 EXTCAP_OPT_LIST_DLTS, \
38 EXTCAP_OPT_INTERFACE, \
40 EXTCAP_OPT_CONFIG_OPTION_NAME, \
41 EXTCAP_OPT_CONFIG_OPTION_VALUE, \
42 EXTCAP_OPT_CLEANUP_POSTKILL, \
44 EXTCAP_OPT_CAPTURE_FILTER, \
46 EXTCAP_OPT_LOG_LEVEL, \
50#define EXTCAP_BASE_OPTIONS \
51 { "extcap-interfaces", ws_no_argument, NULL, EXTCAP_OPT_LIST_INTERFACES}, \
52 { "extcap-version", ws_optional_argument, NULL, EXTCAP_OPT_VERSION}, \
53 { "extcap-dlts", ws_no_argument, NULL, EXTCAP_OPT_LIST_DLTS}, \
54 { "extcap-interface", ws_required_argument, NULL, EXTCAP_OPT_INTERFACE}, \
55 { "extcap-config", ws_no_argument, NULL, EXTCAP_OPT_CONFIG}, \
56 { "extcap-config-option-name", ws_required_argument, NULL, EXTCAP_OPT_CONFIG_OPTION_NAME}, \
57 { "extcap-config-option-value", ws_required_argument, NULL, EXTCAP_OPT_CONFIG_OPTION_VALUE }, \
58 { "extcap-cleanup-postkill", ws_no_argument, NULL, EXTCAP_OPT_CLEANUP_POSTKILL }, \
59 { "capture", ws_no_argument, NULL, EXTCAP_OPT_CAPTURE}, \
60 { "extcap-capture-filter", ws_required_argument, NULL, EXTCAP_OPT_CAPTURE_FILTER}, \
61 { "fifo", ws_required_argument, NULL, EXTCAP_OPT_FIFO}, \
62 { "log-level", ws_required_argument, NULL, EXTCAP_OPT_LOG_LEVEL}, \
63 { "log-file", ws_required_argument, NULL, EXTCAP_OPT_LOG_FILE}
70 char * capture_filter;
78 uint8_t show_config_option;
79 char * config_option_name;
80 char * config_option_value;
88 uint8_t do_list_interfaces;
89 uint8_t do_cleanup_postkill;
94 enum ws_log_level debug;
96 void (*cleanup_postkill_cb)(void);
100extern bool extcap_end_application;
102void extcap_base_register_interface(
extcap_parameters * extcap,
const char * interface,
const char * ifdescription, uint16_t dlt,
const char * dltdescription );
103void extcap_base_register_interface_ext(
extcap_parameters * extcap,
const char * interface,
const char * ifdescription, uint16_t dlt,
const char * dltname,
const char * dltdescription );
107bool extcap_base_register_graceful_shutdown_cb(
extcap_parameters * extcap,
void (*callback)(
void));
111bool extcap_base_register_cleanup_postkill_cb(
extcap_parameters* extcap,
void (*callback)(
void));
113void extcap_base_set_util_info(
extcap_parameters * extcap,
const char * exename,
const char * major,
const char * minor,
const char * release,
const char * helppage);
114void extcap_base_set_compiled_with(
extcap_parameters * extcap,
const char *fmt, ...);
115void extcap_base_set_running_with(
extcap_parameters * extcap,
const char *fmt, ...);
116uint8_t extcap_base_parse_options(
extcap_parameters * extcap,
int result,
char * optargument);
120void extcap_help_add_option(
extcap_parameters * extcap,
const char * help_option_name,
const char * help_optionn_desc);
123void extcap_cmdline_debug(
char** ar,
const unsigned n);
124void extcap_config_debug(
unsigned* count);
125void extcap_base_help(
void);
126void extcap_log_init(
void);
134void extcap_log_cmdarg_err(
const char *msg_format, va_list ap);
Definition extcap-base.h:66