Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
/builds/wireshark/wireshark/extcap.h
Go to the documentation of this file.
1
13#ifndef __EXTCAP_H__
14#define __EXTCAP_H__
15
16
17#include <glib.h>
18
19#ifdef _WIN32
21#endif
22
23#include <wsutil/plugins.h>
24#include "epan/register.h"
25
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
57typedef struct _extcap_info {
58 char *basename;
59 char *full_path;
60 char *version;
61 char *help;
62 GList *interfaces;
64
73
82
83typedef void (*extcap_plugin_description_callback)(const char *, const char *,
84 const char *, const char *,
85 void *);
86
87struct _extcap_arg;
88
89#ifdef __cplusplus
90extern "C" {
91#endif /* __cplusplus */
92
100void
101extcap_register_preferences(register_cb cb, void *client_data);
102
111extcap_get_if_dlts(const char * ifname, char ** err_str);
112
119GList *
121
129extcap_get_tool_info(const char * toolname);
130
138extcap_get_tool_by_ifname(const char *ifname);
139
146char *
147extcap_get_help_for_ifname(const char *ifname);
148
152void
154
161void
162extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
163
168void
169extcap_dump_all(void);
170
178GList *
179extcap_get_if_configuration(const char * ifname);
180
190GList*
191extcap_get_if_configuration_option(const char* ifname, const char* argname, const char* argvalue);
192
202GList *
203extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
204
214extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
215
222void
223extcap_free_if_configuration(GList *list, bool free_args);
224
230bool
231extcap_has_configuration(const char * ifname);
232
245bool
246extcap_requires_configuration(const char * ifname);
247
254bool
255extcap_has_toolbar(const char *ifname);
256
257#ifdef HAVE_LIBPCAP
263bool
264extcap_session_stop(capture_session *cap_session);
265
274bool
275extcap_init_interfaces(capture_session *cap_session);
276#endif /* HAVE_LIBPCAP */
277
283void
285
293pref_t *
294extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
295
299void extcap_cleanup(void);
300
301#ifdef __cplusplus
302}
303#endif /* __cplusplus */
304
305#endif
306
307/*
308 * Editor modelines - https://www.wireshark.org/tools/modelines.html
309 *
310 * Local variables:
311 * c-basic-offset: 4
312 * tab-width: 8
313 * indent-tabs-mode: nil
314 * End:
315 *
316 * vi: set shiftwidth=4 tabstop=8 expandtab:
317 * :indentSize=4:tabSize=8:noTabs=true:
318 */
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1259
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:1234
void extcap_request_stop(capture_session *cap_session)
void extcap_free_if_configuration(GList *list, bool free_args)
Definition extcap.c:837
void extcap_cleanup(void)
Clean up global extcap stuff on program exit.
Definition extcap.c:795
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:1026
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:194
bool extcap_requires_configuration(const char *ifname)
Checks if the specified interface requires configuration for extcap usage.
Definition extcap.c:1206
void extcap_clear_interfaces(void)
Definition extcap.c:176
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:629
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1200
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:2012
extcap_argument_sufficient
Indicates whether all required extcap arguments have been provided.
Definition extcap.h:77
@ EXTCAP_ARGUMENT_SUFFICIENT_OK
Definition extcap.h:80
@ EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED
Definition extcap.h:79
@ EXTCAP_ARGUMENT_SUFFICIENT_NOTSET
Definition extcap.h:78
extcap_filter_status
Result of validating a capture filter string against an extcap interface.
Definition extcap.h:68
@ EXTCAP_FILTER_UNKNOWN
Definition extcap.h:69
@ EXTCAP_FILTER_INVALID
Definition extcap.h:71
@ EXTCAP_FILTER_VALID
Definition extcap.h:70
void extcap_register_preferences(register_cb cb, void *client_data)
Definition extcap.c:763
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:710
void extcap_dump_all(void)
Definition extcap.c:233
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:1001
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1073
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:701
struct _extcap_info extcap_info
Metadata describing a registered extcap plugin binary.
pref_t * extcap_pref_for_argument(const char *ifname, struct _extcap_arg *arg)
Definition extcap.c:860
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:2027
Opaque handle representing an active or pending capture session.
Definition capture_session.h:142
A fully parsed extcap argument sentence with all its associated options.
Definition extcap_parser.h:118
Metadata describing a registered extcap plugin binary.
Definition extcap.h:57
char * full_path
Definition extcap.h:59
char * basename
Definition extcap.h:58
char * help
Definition extcap.h:61
GList * interfaces
Definition extcap.h:62
char * version
Definition extcap.h:60
Definition packet-bt-dht.c:97
Describes the capabilities of a single capture interface.
Definition capture_ifinfo.h:46
Definition prefs.c:207