Wireshark 4.5.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
19extern "C" {
20#endif /* __cplusplus */
21
30
31typedef unsigned tap_flags_t;
32
33typedef void (*tap_reset_cb)(void *tapdata);
34typedef tap_packet_status (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
35typedef void (*tap_draw_cb)(void *tapdata);
36typedef 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
67#define TL_IP_AGGREGATION_NULL 0x00000100
68#define TL_IP_AGGREGATION_ORI 0x00000200
69#define TL_IP_AGGREGATION_RESERVED 0x00000400
71typedef struct {
72 void (*register_tap_listener)(void); /* routine to call to register tap listener */
74
76WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug);
77
78/*
79 * Entry in the table of built-in taps to register.
80 */
81typedef struct _tap_reg {
82 const char *cb_name;
83 void (*cb_func)(void);
84} tap_reg_t;
85
86/*
87 * For all taps, call their register routines.
88 * Must be called after plugins_init(), if plugins are supported,
89 * and must be called only once in a program.
90 *
91 * XXX - should probably be handled by epan_init(), as the tap mechanism
92 * is part of libwireshark.
93 */
94WS_DLL_PUBLIC void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners);
95
96extern void tap_init(void);
97
110WS_DLL_PUBLIC int register_tap(const char *name);
111
112/* Gets a GList of the tap names */
113WS_DLL_PUBLIC GList* get_tap_names(void);
114
118WS_DLL_PUBLIC int find_tap_id(const char *name);
119
140WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
141
143WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt);
144
149extern void tap_queue_init(epan_dissect_t *edt);
150
155extern void tap_push_tapped_queue(epan_dissect_t *edt);
156
161WS_DLL_PUBLIC void reset_tap_listeners(void);
162
170WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all);
171
248WS_DLL_PUBLIC GString *register_tap_listener(const char *tapname, void *tapdata,
249 const char *fstring, unsigned flags, tap_reset_cb tap_reset,
250 tap_packet_cb tap_packet, tap_draw_cb tap_draw,
251 tap_finish_cb tap_finish) G_GNUC_WARN_UNUSED_RESULT;
252
254WS_DLL_PUBLIC GString *set_tap_dfilter(void *tapdata, const char *fstring);
255
257WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void);
258
260WS_DLL_PUBLIC void remove_tap_listener(void *tapdata);
261
263WS_DLL_PUBLIC GString *set_tap_flags(void *tapdata, unsigned flags);
264
269WS_DLL_PUBLIC bool tap_listeners_require_dissection(void);
270
275WS_DLL_PUBLIC bool tap_listeners_require_columns(void);
276
278WS_DLL_PUBLIC bool have_tap_listener(int tap_id);
279
281WS_DLL_PUBLIC bool have_filtering_tap_listeners(void);
282
287
293WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void);
294
309WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
310
313extern void tap_cleanup(void);
314
315#ifdef __cplusplus
316}
317#endif /* __cplusplus */
318
319#endif /* __TAP_H__ */
Definition packet_info.h:43
Definition tap.h:81
Definition epan_dissect.h:28
Definition tap.h:71
WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void)
Definition tap.c:680
WS_DLL_PUBLIC void reset_tap_listeners(void)
Definition tap.c:442
void tap_queue_init(epan_dissect_t *edt)
Definition tap.c:293
WS_DLL_PUBLIC const void * fetch_tapped_data(int tap_id, int idx)
Definition tap.c:410
WS_DLL_PUBLIC bool tap_listeners_require_columns(void)
Definition tap.c:758
WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void)
Definition tap.c:824
WS_DLL_PUBLIC int register_tap(const char *name)
Definition tap.c:177
WS_DLL_PUBLIC bool tap_listeners_require_dissection(void)
Definition tap.c:738
WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt)
Definition tap.c:263
WS_DLL_PUBLIC GString * set_tap_dfilter(void *tapdata, const char *fstring)
Definition tap.c:600
WS_DLL_PUBLIC bool have_filtering_tap_listeners(void)
Definition tap.c:796
WS_DLL_PUBLIC bool have_tap_listener(int tap_id)
Definition tap.c:778
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:543
WS_DLL_PUBLIC GString * set_tap_flags(void *tapdata, unsigned flags)
Definition tap.c:649
WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug)
WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all)
Definition tap.c:465
WS_DLL_PUBLIC void remove_tap_listener(void *tapdata)
Definition tap.c:705
void tap_cleanup(void)
Definition tap.c:835
void tap_push_tapped_queue(epan_dissect_t *edt)
Definition tap.c:311
WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data)
Definition tap.c:229
tap_packet_status
Definition tap.h:25
@ TAP_PACKET_REDRAW
Definition tap.h:27
@ TAP_PACKET_FAILED
Definition tap.h:28
@ TAP_PACKET_DONT_REDRAW
Definition tap.h:26
WS_DLL_PUBLIC int find_tap_id(const char *name)
Definition tap.c:506
WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt)
Definition tap.c:808