| 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#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
54 typedef struct _extcap_info {
55 char * basename;
56 char * full_path;
57 char * version;
58 char * help;
59
60 GList * interfaces;
61} extcap_info;
62
63 typedef enum {
64 EXTCAP_FILTER_UNKNOWN,
65 EXTCAP_FILTER_VALID,
66 EXTCAP_FILTER_INVALID
67} extcap_filter_status;
68
69 typedef enum {
70 EXTCAP_ARGUMENT_SUFFICIENT_NOTSET,
71 EXTCAP_ARGUMENT_SUFFICIENT_REQUIRED,
72 EXTCAP_ARGUMENT_SUFFICIENT_OK
73} extcap_argument_sufficient;
74
75 typedef void (*extcap_plugin_description_callback)(const char *, const char *,
76 const char *, const char *,
77 void *);
78
79 struct _extcap_arg;
80
81#ifdef __cplusplus
82 extern "C" {
83#endif /* __cplusplus */
84
92 void
93 extcap_register_preferences(register_cb cb, void *client_data);
94
102 if_capabilities_t *
103 extcap_get_if_dlts(const char * ifname, char ** err_str);
104
111GList *
112 append_extcap_interface_list(GList *list);
113
120 extcap_info *
121 extcap_get_tool_info(const char * toolname);
122
129 extcap_info *
130 extcap_get_tool_by_ifname(const char *ifname);
131
138 char *
139 extcap_get_help_for_ifname(const char *ifname);
140
144 void
145 extcap_clear_interfaces(void);
146
153 void
154 extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data);
155
160 void
161 extcap_dump_all(void);
162
169GList *
170 extcap_get_if_configuration(const char * ifname);
171
178GList*
179 extcap_get_if_configuration_option(const char* ifname, const char* argname, const char* argvalue);
180
188GList *
189 extcap_get_if_configuration_values(const char * ifname, const char * argname, GHashTable * arguments);
190
199extcap_filter_status
200 extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str);
201
208 void
209 extcap_free_if_configuration(GList *list, bool free_args);
210
216 bool
217 extcap_has_configuration(const char * ifname);
218
227 bool
228 extcap_requires_configuration(const char * ifname);
229
236 bool
237 extcap_has_toolbar(const char *ifname);
238
239#ifdef HAVE_LIBPCAP
245 bool
246extcap_session_stop(capture_session *cap_session);
247
254 bool
255extcap_init_interfaces(capture_session *cap_session);
256#endif /* HAVE_LIBPCAP */
257
263 void
264 extcap_request_stop(capture_session *cap_session);
265
273 pref_t *
274 extcap_pref_for_argument(const char *ifname, struct _extcap_arg * arg);
275
279 void extcap_cleanup(void);
280
281#ifdef __cplusplus
282}
283#endif /* __cplusplus */
284
285#endif
286
287/*
288 * Editor modelines - https://www.wireshark.org/tools/modelines.html
289 *
290 * Local variables:
291 * c-basic-offset: 4
292 * tab-width: 8
293 * indent-tabs-mode: nil
294 * End:
295 *
296 * vi: set shiftwidth=4 tabstop=8 expandtab:
297 * :indentSize=4:tabSize=8:noTabs=true:
298 */
capture_session.h
capture_ui_utils.h
extcap_has_toolbar
bool extcap_has_toolbar(const char *ifname)
Definition extcap.c:1259
extcap_verify_capture_filter
extcap_filter_status extcap_verify_capture_filter(const char *ifname, const char *filter, char **err_str)
Definition extcap.c:1234
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:837
extcap_cleanup
void extcap_cleanup(void)
Definition extcap.c:795
extcap_get_if_configuration_option
GList * extcap_get_if_configuration_option(const char *ifname, const char *argname, const char *argvalue)
Definition extcap.c:1026
extcap_get_descriptions
void extcap_get_descriptions(extcap_plugin_description_callback callback, void *callback_data)
Definition extcap.c:194
extcap_requires_configuration
bool extcap_requires_configuration(const char *ifname)
Definition extcap.c:1206
extcap_clear_interfaces
void extcap_clear_interfaces(void)
Definition extcap.c:176
extcap_get_if_dlts
if_capabilities_t * extcap_get_if_dlts(const char *ifname, char **err_str)
Definition extcap.c:629
extcap_has_configuration
bool extcap_has_configuration(const char *ifname)
Definition extcap.c:1200
extcap_get_tool_by_ifname
extcap_info * extcap_get_tool_by_ifname(const char *ifname)
Definition extcap.c:2012
extcap_register_preferences
void extcap_register_preferences(register_cb cb, void *client_data)
Definition extcap.c:763
append_extcap_interface_list
GList * append_extcap_interface_list(GList *list)
Definition extcap.c:710
extcap_dump_all
void extcap_dump_all(void)
Definition extcap.c:233
extcap_get_if_configuration
GList * extcap_get_if_configuration(const char *ifname)
Definition extcap.c:1001
extcap_get_if_configuration_values
GList * extcap_get_if_configuration_values(const char *ifname, const char *argname, GHashTable *arguments)
Definition extcap.c:1073
extcap_get_help_for_ifname
char * extcap_get_help_for_ifname(const char *ifname)
Definition extcap.c:701
extcap_pref_for_argument
pref_t * extcap_pref_for_argument(const char *ifname, struct _extcap_arg *arg)
Definition extcap.c:860
extcap_get_tool_info
extcap_info * extcap_get_tool_info(const char *toolname)
Definition extcap.c:2027
plugins.h
register.h
_capture_session
Definition capture_session.h:136
_extcap_arg
Definition extcap_parser.h:106
_extcap_info
Definition extcap.h:54
client_data
Definition packet-bt-dht.c:99
if_capabilities_t
Definition capture_ifinfo.h:43
preference
Definition prefs.c:216
unicode-utils.h