| 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
20#include <wsutil/unicode-utils.h>
21#endif
22
23#include <wsutil/plugins.h>
24
25#include "capture/capture_session.h"
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_CONFIG_OPTION_NAME "--extcap-config-option-name"
39#define EXTCAP_ARGUMENT_CONFIG_OPTION_VALUE "--extcap-config-option-value"
40#define EXTCAP_ARGUMENT_RELOAD_OPTION "--extcap-reload-option"
41#define EXTCAP_ARGUMENT_LIST_INTERFACES "--extcap-interfaces"
42#define EXTCAP_ARGUMENT_INTERFACE "--extcap-interface"
43#define EXTCAP_ARGUMENT_LIST_DLTS "--extcap-dlts"
44#define EXTCAP_ARGUMENT_VERSION "--extcap-version"
45
46#define EXTCAP_ARGUMENT_RUN_CAPTURE "--capture"
47#define EXTCAP_ARGUMENT_CAPTURE_FILTER "--extcap-capture-filter"
48#define EXTCAP_ARGUMENT_RUN_PIPE "--fifo"
49#define EXTCAP_ARGUMENT_CLEANUP_POSTKILL "--extcap-cleanup-postkill"
50#define EXTCAP_ARGUMENT_CONTROL_IN "--extcap-control-in"
51#define EXTCAP_ARGUMENT_CONTROL_OUT "--extcap-control-out"
52
53 typedef struct _extcap_info {
54 char * basename;
55 char * full_path;
56 char * version;
57 char * help;
58
59 GList * interfaces;
60} extcap_info;
61
62typedef enum {
63 EXTCAP_FILTER_UNKNOWN,
64 EXTCAP_FILTER_VALID,
65 EXTCAP_FILTER_INVALID
66} extcap_filter_status;
67
68typedef enum {
69 EXTCAP_ARGUMENT_SUFFICIENT_NOTSET,
70 EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED,
71 EXTCAP_ARGUMENT_SUFFICIENT_OK
72} extcap_argument_sufficient;
73
74typedef void (*extcap_plugin_description_callback)(const char *, const char *,
75 const char *, const char *,
76 void *);
77
78struct _extcap_arg;
79
80#ifdef __cplusplus
81extern "C" {
82#endif /* __cplusplus */
83
88void
89 extcap_register_preferences(void);
90
98 if_capabilities_t *
99 extcap_get_if_dlts(const char * ifname, char ** err_str);
100
107GList *
108 append_extcap_interface_list(GList *list);
109
116 extcap_info *
117 extcap_get_tool_info(const char * toolname);
118
125 extcap_info *
126 extcap_get_tool_by_ifname(const char *ifname);
127
134char *
135 extcap_get_help_for_ifname(const char *ifname);
136
140void
141 extcap_clear_interfaces(void);
142
149void
150 extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
151
156void
157 extcap_dump_all(void);
158
165GList *
166 extcap_get_if_configuration(const char * ifname);
167
174GList*
175 extcap_get_if_configuration_option(const char* ifname, const char* argname, const char* argvalue);
176
184GList *
185 extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
186
195extcap_filter_status
196 extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
197
204void
205 extcap_free_if_configuration(GList *list, bool free_args);
206
212bool
213 extcap_has_configuration(const char * ifname);
214
223bool
224 extcap_requires_configuration(const char * ifname);
225
232bool
233 extcap_has_toolbar(const char *ifname);
234
235#ifdef HAVE_LIBPCAP
241bool
242extcap_session_stop(capture_session *cap_session);
243
250bool
251extcap_init_interfaces(capture_session *cap_session);
252#endif /* HAVE_LIBPCAP */
253
259void
260extcap_request_stop(capture_session *cap_session);
261
269 pref_t *
270 extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
271
275void extcap_cleanup(void);
276
277#ifdef __cplusplus
278}
279#endif /* __cplusplus */
280
281#endif
282
283/*
284 * Editor modelines - https://www.wireshark.org/tools/modelines.html
285 *
286 * Local variables:
287 * c-basic-offset: 4
288 * tab-width: 8
289 * indent-tabs-mode: nil
290 * End:
291 *
292 * vi: set shiftwidth=4 tabstop=8 expandtab:
293 * :indentSize=4:tabSize=8:noTabs=true:
294 */
capture_session.h
capture_ui_utils.h
extcap_has_toolbar
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1244
extcap_verify_capture_filter
extcap_filter_status extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str)
Definition extcap.c:1219
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:822
extcap_cleanup
void extcap_cleanup(void)
Definition extcap.c:780
extcap_register_preferences
void extcap_register_preferences(void)
Definition extcap.c:754
extcap_get_if_configuration_option
GList * extcap_get_if_configuration_option(const char *ifname, const char *argname, const char *argvalue)
Definition extcap.c:1011
extcap_get_descriptions
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:200
extcap_requires_configuration
bool extcap_requires_configuration(const char *ifname)
Definition extcap.c:1191
extcap_clear_interfaces
void extcap_clear_interfaces(void)
Definition extcap.c:182
extcap_get_if_dlts
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:620
extcap_has_configuration
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1185
extcap_get_tool_by_ifname
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:1997
append_extcap_interface_list
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:701
extcap_dump_all
void extcap_dump_all(void)
Definition extcap.c:239
extcap_get_if_configuration
GList * extcap_get_if_configuration(const char *ifname)
Definition extcap.c:986
extcap_get_if_configuration_values
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1058
extcap_get_help_for_ifname
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:692
extcap_pref_for_argument
pref_t * extcap_pref_for_argument(const char *ifname, struct _extcap_arg *arg)
Definition extcap.c:845
extcap_get_tool_info
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:2012
plugins.h
_capture_session
Definition capture_session.h:136
_extcap_arg
Definition extcap_parser.h:106
_extcap_info
Definition extcap.h:53
if_capabilities_t
Definition capture_ifinfo.h:43
preference
Definition prefs.c:216
unicode-utils.h