| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
/builds/wireshark/wireshark/extcap.h
Go to the documentation of this file.
1
12
13#ifndef __EXTCAP_H__
14#define __EXTCAP_H__
15
16
17#include <glib.h>
18
19#ifdef _WIN32
20#include <wsutil/unicode-utils.h>
21#endif
22
23#include <wsutil/plugins.h>
24#include "epan/register.h"
25
26#include "capture/capture_session.h"
27#include <ui/capture_ui_utils.h>
28
29/* As boolean flags will be allowed any form of yes, true or any number != 0 (or starting with 0)
30 * The regex will be matched case-insensitive, so only the lower-case is defined here. */
31#define EXTCAP_BOOLEAN_REGEX "^.*([yt1-9])"
32
33/* Prefix for the pipe interfaces */
34#define EXTCAP_PIPE_PREFIX "wireshark_extcap"
35#define EXTCAP_CONTROL_IN_PREFIX "wireshark_control_ext_to_ws"
36#define EXTCAP_CONTROL_OUT_PREFIX "wireshark_control_ws_to_ext"
37
38#define EXTCAP_ARGUMENT_CONFIG "--extcap-config"
39#define EXTCAP_ARGUMENT_CONFIG_OPTION_NAME "--extcap-config-option-name"
40#define EXTCAP_ARGUMENT_CONFIG_OPTION_VALUE "--extcap-config-option-value"
41#define EXTCAP_ARGUMENT_RELOAD_OPTION "--extcap-reload-option"
42#define EXTCAP_ARGUMENT_LIST_INTERFACES "--extcap-interfaces"
43#define EXTCAP_ARGUMENT_INTERFACE "--extcap-interface"
44#define EXTCAP_ARGUMENT_LIST_DLTS "--extcap-dlts"
45#define EXTCAP_ARGUMENT_VERSION "--extcap-version"
46
47#define EXTCAP_ARGUMENT_RUN_CAPTURE "--capture"
48#define EXTCAP_ARGUMENT_CAPTURE_FILTER "--extcap-capture-filter"
49#define EXTCAP_ARGUMENT_RUN_PIPE "--fifo"
50#define EXTCAP_ARGUMENT_CLEANUP_POSTKILL "--extcap-cleanup-postkill"
51#define EXTCAP_ARGUMENT_CONTROL_IN "--extcap-control-in"
52#define EXTCAP_ARGUMENT_CONTROL_OUT "--extcap-control-out"
53
57 typedef struct _extcap_info {
58 char *basename;
59 char *full_path;
60 char *version;
61 char *help;
62 unsigned control;
63 GList *interfaces;
64} extcap_info;
65
69 typedef enum {
70 EXTCAP_FILTER_UNKNOWN,
71 EXTCAP_FILTER_VALID,
72 EXTCAP_FILTER_INVALID
73} extcap_filter_status;
74
78 typedef enum {
79 EXTCAP_ARGUMENT_SUFFICIENT_NOTSET,
80 EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED,
81 EXTCAP_ARGUMENT_SUFFICIENT_OK
82} extcap_argument_sufficient;
83
84 typedef void (*extcap_plugin_description_callback)(const char *, const char *,
85 const char *, const char *,
86 void *);
87
88 struct _extcap_arg;
89
90#ifdef __cplusplus
91 extern "C" {
92#endif /* __cplusplus */
93
101 void
102 extcap_register_preferences(register_cb cb, void *client_data);
103
111 if_capabilities_t *
112 extcap_get_if_dlts(const char * ifname, char ** err_str);
113
120GList *
121 append_extcap_interface_list(GList *list);
122
129 extcap_info *
130 extcap_get_tool_info(const char * toolname);
131
138 extcap_info *
139 extcap_get_tool_by_ifname(const char *ifname);
140
147 char *
148 extcap_get_help_for_ifname(const char *ifname);
149
153 void
154 extcap_clear_interfaces(void);
155
162 void
163 extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
164
169 void
170 extcap_dump_all(void);
171
179GList *
180 extcap_get_if_configuration(const char * ifname);
181
191GList*
192 extcap_get_if_configuration_option(const char* ifname, const char* argname, const char* argvalue);
193
203GList *
204 extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
205
214 extcap_filter_status
215 extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
216
223 void
224 extcap_free_if_configuration(GList *list, bool free_args);
225
231 bool
232 extcap_has_configuration(const char * ifname);
233
246 bool
247 extcap_requires_configuration(const char * ifname);
248
255 bool
256 extcap_has_toolbar(const char *ifname);
257
258#ifdef HAVE_LIBPCAP
264 bool
265extcap_session_stop(capture_session *cap_session);
266
275 bool
276extcap_init_interfaces(capture_session *cap_session);
277#endif /* HAVE_LIBPCAP */
278
284 void
285 extcap_request_stop(capture_session *cap_session);
286
294pref_t *
295 extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
296
300 void extcap_cleanup(void);
301
302#ifdef __cplusplus
303}
304#endif /* __cplusplus */
305
306#endif
307
308/*
309 * Editor modelines - https://www.wireshark.org/tools/modelines.html
310 *
311 * Local variables:
312 * c-basic-offset: 4
313 * tab-width: 8
314 * indent-tabs-mode: nil
315 * End:
316 *
317 * vi: set shiftwidth=4 tabstop=8 expandtab:
318 * :indentSize=4:tabSize=8:noTabs=true:
319 */
capture_session.h
capture_session
struct _capture_session capture_session
Opaque handle representing an active or pending capture session.
capture_ui_utils.h
extcap_has_toolbar
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1257
extcap_verify_capture_filter
extcap_filter_status extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str)
Verifies a capture filter for an interface using extcap.
Definition extcap.c:1232
extcap_request_stop
void extcap_request_stop(capture_session *cap_session)
extcap_free_if_configuration
void extcap_free_if_configuration(GList *list, bool free_args)
Definition extcap.c:835
extcap_cleanup
void extcap_cleanup(void)
Clean up global extcap stuff on program exit.
Definition extcap.c:793
extcap_get_if_configuration_option
GList * extcap_get_if_configuration_option(const char *ifname, const char *argname, const char *argvalue)
Returns the sub-configuration for a given argument name, or an empty list, if no configuration has be...
Definition extcap.c:1024
extcap_get_descriptions
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:192
extcap_requires_configuration
bool extcap_requires_configuration(const char *ifname)
Checks if the specified interface requires configuration for extcap usage.
Definition extcap.c:1204
extcap_clear_interfaces
void extcap_clear_interfaces(void)
Definition extcap.c:174
extcap_get_if_dlts
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:627
extcap_has_configuration
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1198
extcap_get_tool_by_ifname
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:2517
extcap_argument_sufficient
extcap_argument_sufficient
Indicates whether all required extcap arguments have been provided.
Definition extcap.h:78
EXTCAP_ARGUMENT_SUFFICIENT_OK
@ EXTCAP_ARGUMENT_SUFFICIENT_OK
Definition extcap.h:81
EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED
@ EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED
Definition extcap.h:80
EXTCAP_ARGUMENT_SUFFICIENT_NOTSET
@ EXTCAP_ARGUMENT_SUFFICIENT_NOTSET
Definition extcap.h:79
extcap_filter_status
extcap_filter_status
Result of validating a capture filter string against an extcap interface.
Definition extcap.h:69
EXTCAP_FILTER_UNKNOWN
@ EXTCAP_FILTER_UNKNOWN
Definition extcap.h:70
EXTCAP_FILTER_INVALID
@ EXTCAP_FILTER_INVALID
Definition extcap.h:72
EXTCAP_FILTER_VALID
@ EXTCAP_FILTER_VALID
Definition extcap.h:71
extcap_register_preferences
void extcap_register_preferences(register_cb cb, void *client_data)
Definition extcap.c:761
append_extcap_interface_list
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:708
extcap_dump_all
void extcap_dump_all(void)
Definition extcap.c:231
extcap_get_if_configuration
GList * extcap_get_if_configuration(const char *ifname)
Returns the configuration for the given interface name, or an empty list, if no configuration has bee...
Definition extcap.c:999
extcap_get_if_configuration_values
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1071
extcap_get_help_for_ifname
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:699
extcap_info
struct _extcap_info extcap_info
Metadata describing a registered extcap plugin binary.
extcap_pref_for_argument
pref_t * extcap_pref_for_argument(const char *ifname, struct _extcap_arg *arg)
Definition extcap.c:858
extcap_get_tool_info
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:2532
plugins.h
register.h
_extcap_arg
A fully parsed extcap argument sentence with all its associated options.
Definition extcap_parser.h:118
_extcap_info
Metadata describing a registered extcap plugin binary.
Definition extcap.h:57
_extcap_info::full_path
char * full_path
Definition extcap.h:59
_extcap_info::control
unsigned control
Definition extcap.h:62
_extcap_info::basename
char * basename
Definition extcap.h:58
_extcap_info::help
char * help
Definition extcap.h:61
_extcap_info::interfaces
GList * interfaces
Definition extcap.h:63
_extcap_info::version
char * version
Definition extcap.h:60
client_data
Definition packet-bt-dht.c:97
if_capabilities_t
Describes the capabilities of a single capture interface.
Definition capture_ifinfo.h:46
unicode-utils.h