Wireshark 4.5.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
26#include <ui/capture_ui_utils.h>
27
28/* As boolean flags will be allowed any form of yes, true or any number != 0 (or starting with 0)
29 * The regex will be matched case-insensitive, so only the lower-case is defined here. */
30#define EXTCAP_BOOLEAN_REGEX "^.*([yt1-9])"
31
32/* Prefix for the pipe interfaces */
33#define EXTCAP_PIPE_PREFIX "wireshark_extcap"
34#define EXTCAP_CONTROL_IN_PREFIX "wireshark_control_ext_to_ws"
35#define EXTCAP_CONTROL_OUT_PREFIX "wireshark_control_ws_to_ext"
36
37#define EXTCAP_ARGUMENT_CONFIG "--extcap-config"
38#define EXTCAP_ARGUMENT_RELOAD_OPTION "--extcap-reload-option"
39#define EXTCAP_ARGUMENT_LIST_INTERFACES "--extcap-interfaces"
40#define EXTCAP_ARGUMENT_INTERFACE "--extcap-interface"
41#define EXTCAP_ARGUMENT_LIST_DLTS "--extcap-dlts"
42#define EXTCAP_ARGUMENT_VERSION "--extcap-version"
43
44#define EXTCAP_ARGUMENT_RUN_CAPTURE "--capture"
45#define EXTCAP_ARGUMENT_CAPTURE_FILTER "--extcap-capture-filter"
46#define EXTCAP_ARGUMENT_RUN_PIPE "--fifo"
47#define EXTCAP_ARGUMENT_CONTROL_IN "--extcap-control-in"
48#define EXTCAP_ARGUMENT_CONTROL_OUT "--extcap-control-out"
49
50typedef struct _extcap_info {
51 char * basename;
52 char * full_path;
53 char * version;
54 char * help;
55
56 GList * interfaces;
58
59typedef enum {
60 EXTCAP_FILTER_UNKNOWN,
61 EXTCAP_FILTER_VALID,
62 EXTCAP_FILTER_INVALID
63} extcap_filter_status;
64
65typedef void (*extcap_plugin_description_callback)(const char *, const char *,
66 const char *, const char *,
67 void *);
68
69struct _extcap_arg;
70
71#ifdef __cplusplus
72extern "C" {
73#endif /* __cplusplus */
74
79void
81
90extcap_get_if_dlts(const char * ifname, char ** err_str);
91
98GList *
100
108extcap_get_tool_info(const char * toolname);
109
117extcap_get_tool_by_ifname(const char *ifname);
118
125char *
126extcap_get_help_for_ifname(const char *ifname);
127
131void
133
140void
141extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
142
147void
148extcap_dump_all(void);
149
156GList *
157extcap_get_if_configuration(const char * ifname);
158
166GList *
167extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
168
177extcap_filter_status
178extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
179
186void
187extcap_free_if_configuration(GList *list, bool free_args);
188
194bool
195extcap_has_configuration(const char * ifname);
196
205bool
206extcap_requires_configuration(const char * ifname);
207
214bool
215extcap_has_toolbar(const char *ifname);
216
217#ifdef HAVE_LIBPCAP
223bool
224extcap_session_stop(capture_session *cap_session);
225
232bool
233extcap_init_interfaces(capture_session *cap_session);
234#endif /* HAVE_LIBPCAP */
235
241void
243
251pref_t *
252extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
253
257void extcap_cleanup(void);
258
259#ifdef __cplusplus
260}
261#endif /* __cplusplus */
262
263#endif
264
265/*
266 * Editor modelines - https://www.wireshark.org/tools/modelines.html
267 *
268 * Local variables:
269 * c-basic-offset: 4
270 * tab-width: 8
271 * indent-tabs-mode: nil
272 * End:
273 *
274 * vi: set shiftwidth=4 tabstop=8 expandtab:
275 * :indentSize=4:tabSize=8:noTabs=true:
276 */
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1173
extcap_filter_status extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str)
Definition extcap.c:1148
void extcap_request_stop(capture_session *cap_session)
void extcap_free_if_configuration(GList *list, bool free_args)
Definition extcap.c:810
void extcap_cleanup(void)
Definition extcap.c:768
void extcap_register_preferences(void)
Definition extcap.c:742
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:196
bool extcap_requires_configuration(const char *ifname)
Definition extcap.c:1120
void extcap_clear_interfaces(void)
Definition extcap.c:178
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:608
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1114
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:1894
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:689
void extcap_dump_all(void)
Definition extcap.c:235
GList * extcap_get_if_configuration(const char *ifname)
Definition extcap.c:961
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1005
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:680
pref_t * extcap_pref_for_argument(const char *ifname, struct _extcap_arg *arg)
Definition extcap.c:833
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:1909
Definition capture_session.h:137
Definition extcap_parser.h:100
Definition extcap.h:50
Definition capture_ifinfo.h:43
Definition prefs.c:249