| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
tap.h
Go to the documentation of this file.
1
11#ifndef __TAP_H__
12#define __TAP_H__
13
14#include <epan/epan.h>
15#include <epan/packet_info.h>
16#include "ws_symbol_export.h"
17
18#ifdef __cplusplus
19 extern "C" {
20#endif /* __cplusplus */
21
25 typedef enum {
26 TAP_PACKET_DONT_REDRAW,
27 TAP_PACKET_REDRAW,
28 TAP_PACKET_FAILED
29} tap_packet_status;
30
31 typedef unsigned tap_flags_t;
32
33 typedef void (*tap_reset_cb)(void *tapdata);
34 typedef tap_packet_status (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
35 typedef void (*tap_draw_cb)(void *tapdata);
36 typedef void (*tap_finish_cb)(void *tapdata);
37
41#define TL_REQUIRES_NOTHING 0x00000000
42#define TL_REQUIRES_PROTO_TREE 0x00000001
43#define TL_REQUIRES_COLUMNS 0x00000002
44#define TL_REQUIRES_ERROR_PACKETS 0x00000004
45#define TL_REQUIRES_PROTOCOLS 0x00000020
59#define TL_IS_DISSECTOR_HELPER 0x00000008
63#define TL_IGNORE_DISPLAY_FILTER 0x00000010
64#define TL_DISPLAY_FILTER_IGNORED 0x00100000
65#define TL_LIMIT_TO_DISPLAY_FILTER 0x00000040
68#define TL_IP_AGGREGATION_NULL 0x00000100
69#define TL_IP_AGGREGATION_ORI 0x00000200
70#define TL_IP_AGGREGATION_RESERVED 0x00000400
72 typedef struct {
73 void (*register_tap_listener)(void); /* routine to call to register tap listener */
74} tap_plugin;
75
77WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug);
78
79/*
80 * Entry in the table of built-in taps to register.
81 */
82 typedef struct _tap_reg {
83 const char *cb_name;
84 void (*cb_func)(void);
85} tap_reg_t;
86
87/*
88 * For all taps, call their register routines.
89 * Must be called after plugins_init(), if plugins are supported,
90 * and must be called only once in a program.
91 */
92 extern void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners);
93
94 extern void tap_init(void);
95
108WS_DLL_PUBLIC int register_tap(const char *name);
109
110/* Gets a GList of the tap names */
111WS_DLL_PUBLIC GList* get_tap_names(void);
112
116WS_DLL_PUBLIC int find_tap_id(const char *name);
117
138WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
139
141WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt);
142
147 extern void tap_queue_init(epan_dissect_t *edt);
148
153 extern void tap_push_tapped_queue(epan_dissect_t *edt);
154
159WS_DLL_PUBLIC void reset_tap_listeners(void);
160
168WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all);
169
246WS_DLL_PUBLIC GString *register_tap_listener(const char *tapname, void *tapdata,
247 const char *fstring, unsigned flags, tap_reset_cb tap_reset,
248 tap_packet_cb tap_packet, tap_draw_cb tap_draw,
249 tap_finish_cb tap_finish) G_GNUC_WARN_UNUSED_RESULT;
250
252WS_DLL_PUBLIC GString *set_tap_dfilter(void *tapdata, const char *fstring);
253
255WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void);
256
258WS_DLL_PUBLIC void remove_tap_listener(void *tapdata);
259
261WS_DLL_PUBLIC GString *set_tap_flags(void *tapdata, unsigned flags);
262
267WS_DLL_PUBLIC bool tap_listeners_require_dissection(void);
268
273WS_DLL_PUBLIC bool tap_listeners_require_columns(void);
274
276WS_DLL_PUBLIC bool have_tap_listener(int tap_id);
277
279WS_DLL_PUBLIC bool have_filtering_tap_listeners(void);
280
284WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt);
285
291WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void);
292
307WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
308
311 extern void tap_cleanup(void);
312
317WS_DLL_PUBLIC void tap_load_main_filter(struct epan_dfilter *dfcode);
318
319#ifdef __cplusplus
320}
321#endif /* __cplusplus */
322
323#endif /* __TAP_H__ */
epan.h
packet_info.h
_packet_info
Definition packet_info.h:43
_tap_reg
Definition tap.h:82
epan_dfilter
Definition dfilter-int.h:35
epan_dissect
Definition epan_dissect.h:28
tap_plugin
Definition tap.h:72
tap_listeners_dfilter_recompile
WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void)
Definition tap.c:702
reset_tap_listeners
WS_DLL_PUBLIC void reset_tap_listeners(void)
Definition tap.c:464
tap_queue_init
void tap_queue_init(epan_dissect_t *edt)
Definition tap.c:304
fetch_tapped_data
WS_DLL_PUBLIC const void * fetch_tapped_data(int tap_id, int idx)
Definition tap.c:432
tap_listeners_require_columns
WS_DLL_PUBLIC bool tap_listeners_require_columns(void)
Definition tap.c:780
union_of_tap_listener_flags
WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void)
Definition tap.c:848
register_tap
WS_DLL_PUBLIC int register_tap(const char *name)
Definition tap.c:181
tap_listeners_require_dissection
WS_DLL_PUBLIC bool tap_listeners_require_dissection(void)
Definition tap.c:760
tap_build_interesting
WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt)
Definition tap.c:267
set_tap_dfilter
WS_DLL_PUBLIC GString * set_tap_dfilter(void *tapdata, const char *fstring)
Definition tap.c:616
have_filtering_tap_listeners
WS_DLL_PUBLIC bool have_filtering_tap_listeners(void)
Definition tap.c:818
have_tap_listener
WS_DLL_PUBLIC bool have_tap_listener(int tap_id)
Definition tap.c:800
register_tap_listener
WS_DLL_PUBLIC GString * register_tap_listener(const char *tapname, void *tapdata, const char *fstring, unsigned flags, tap_reset_cb tap_reset, tap_packet_cb tap_packet, tap_draw_cb tap_draw, tap_finish_cb tap_finish) G_GNUC_WARN_UNUSED_RESULT
Definition tap.c:559
set_tap_flags
WS_DLL_PUBLIC GString * set_tap_flags(void *tapdata, unsigned flags)
Definition tap.c:665
tap_register_plugin
WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug)
draw_tap_listeners
WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all)
Definition tap.c:487
remove_tap_listener
WS_DLL_PUBLIC void remove_tap_listener(void *tapdata)
Definition tap.c:727
tap_cleanup
void tap_cleanup(void)
Definition tap.c:859
tap_push_tapped_queue
void tap_push_tapped_queue(epan_dissect_t *edt)
Definition tap.c:322
tap_load_main_filter
WS_DLL_PUBLIC void tap_load_main_filter(struct epan_dfilter *dfcode)
Definition tap.c:885
tap_queue_packet
WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data)
Definition tap.c:233
tap_packet_status
tap_packet_status
Definition tap.h:25
TAP_PACKET_REDRAW
@ TAP_PACKET_REDRAW
Definition tap.h:27
TAP_PACKET_FAILED
@ TAP_PACKET_FAILED
Definition tap.h:28
TAP_PACKET_DONT_REDRAW
@ TAP_PACKET_DONT_REDRAW
Definition tap.h:26
find_tap_id
WS_DLL_PUBLIC int find_tap_id(const char *name)
Definition tap.c:528
tap_listeners_load_field_references
WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt)
Definition tap.c:832