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
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 unsigned control;
63 GList *interfaces;
65
74
83
84typedef void (*extcap_plugin_description_callback)(const char *, const char *,
85 const char *, const char *,
86 void *);
87
88struct _extcap_arg;
89
90#ifdef __cplusplus
91extern "C" {
92#endif /* __cplusplus */
93
101void
102extcap_register_preferences(register_cb cb, void *client_data);
103
112extcap_get_if_dlts(const char * ifname, char ** err_str);
113
120GList *
122
130extcap_get_tool_info(const char * toolname);
131
139extcap_get_tool_by_ifname(const char *ifname);
140
147char *
148extcap_get_help_for_ifname(const char *ifname);
149
153void
155
162void
163extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
164
169void
170extcap_dump_all(void);
171
179GList *
180extcap_get_if_configuration(const char * ifname);
181
191GList*
192extcap_get_if_configuration_option(const char* ifname, const char* argname, const char* argvalue);
193
203GList *
204extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
205
215extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
216
223void
224extcap_free_if_configuration(GList *list, bool free_args);
225
231bool
232extcap_has_configuration(const char * ifname);
233
246bool
247extcap_requires_configuration(const char * ifname);
248
255bool
256extcap_has_toolbar(const char *ifname);
257
258#ifdef HAVE_LIBPCAP
264bool
265extcap_session_stop(capture_session *cap_session);
266
275bool
276extcap_init_interfaces(capture_session *cap_session);
277#endif /* HAVE_LIBPCAP */
278
284void
286
294pref_t *
295extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
296
300void 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 */
struct _capture_session capture_session
Opaque handle representing an active or pending capture session.
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1257
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
void extcap_request_stop(capture_session *cap_session)
void extcap_free_if_configuration(GList *list, bool free_args)
Definition extcap.c:835
void extcap_cleanup(void)
Clean up global extcap stuff on program exit.
Definition extcap.c:793
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
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:192
bool extcap_requires_configuration(const char *ifname)
Checks if the specified interface requires configuration for extcap usage.
Definition extcap.c:1204
void extcap_clear_interfaces(void)
Definition extcap.c:174
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:627
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1198
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:2517
extcap_argument_sufficient
Indicates whether all required extcap arguments have been provided.
Definition extcap.h:78
@ EXTCAP_ARGUMENT_SUFFICIENT_OK
Definition extcap.h:81
@ EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED
Definition extcap.h:80
@ EXTCAP_ARGUMENT_SUFFICIENT_NOTSET
Definition extcap.h:79
extcap_filter_status
Result of validating a capture filter string against an extcap interface.
Definition extcap.h:69
@ EXTCAP_FILTER_UNKNOWN
Definition extcap.h:70
@ EXTCAP_FILTER_INVALID
Definition extcap.h:72
@ EXTCAP_FILTER_VALID
Definition extcap.h:71
void extcap_register_preferences(register_cb cb, void *client_data)
Definition extcap.c:761
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:708
void extcap_dump_all(void)
Definition extcap.c:231
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
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1071
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:699
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:858
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:2532
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
unsigned control
Definition extcap.h:62
char * basename
Definition extcap.h:58
char * help
Definition extcap.h:61
GList * interfaces
Definition extcap.h:63
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