Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
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
72typedef struct {
73 void (*register_tap_listener)(void); /* routine to call to register tap listener */
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 */
82typedef 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 * XXX - should probably be handled by epan_init(), as the tap mechanism
93 * is part of libwireshark.
94 */
95WS_DLL_PUBLIC void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners);
96
97extern void tap_init(void);
98
111WS_DLL_PUBLIC int register_tap(const char *name);
112
113/* Gets a GList of the tap names */
114WS_DLL_PUBLIC GList* get_tap_names(void);
115
119WS_DLL_PUBLIC int find_tap_id(const char *name);
120
141WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
142
144WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt);
145
150extern void tap_queue_init(epan_dissect_t *edt);
151
156extern void tap_push_tapped_queue(epan_dissect_t *edt);
157
162WS_DLL_PUBLIC void reset_tap_listeners(void);
163
171WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all);
172
249WS_DLL_PUBLIC GString *register_tap_listener(const char *tapname, void *tapdata,
250 const char *fstring, unsigned flags, tap_reset_cb tap_reset,
251 tap_packet_cb tap_packet, tap_draw_cb tap_draw,
252 tap_finish_cb tap_finish) G_GNUC_WARN_UNUSED_RESULT;
253
255WS_DLL_PUBLIC GString *set_tap_dfilter(void *tapdata, const char *fstring);
256
258WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void);
259
261WS_DLL_PUBLIC void remove_tap_listener(void *tapdata);
262
264WS_DLL_PUBLIC GString *set_tap_flags(void *tapdata, unsigned flags);
265
270WS_DLL_PUBLIC bool tap_listeners_require_dissection(void);
271
276WS_DLL_PUBLIC bool tap_listeners_require_columns(void);
277
279WS_DLL_PUBLIC bool have_tap_listener(int tap_id);
280
282WS_DLL_PUBLIC bool have_filtering_tap_listeners(void);
283
288
294WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void);
295
310WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
311
314extern void tap_cleanup(void);
315
320WS_DLL_PUBLIC void tap_load_main_filter(struct epan_dfilter *dfcode);
321
322#ifdef __cplusplus
323}
324#endif /* __cplusplus */
325
326#endif /* __TAP_H__ */
Definition packet_info.h:43
Definition tap.h:82
Definition dfilter-int.h:35
Definition epan_dissect.h:28
Definition tap.h:72
WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void)
Definition tap.c:705
WS_DLL_PUBLIC void reset_tap_listeners(void)
Definition tap.c:461
void tap_queue_init(epan_dissect_t *edt)
Definition tap.c:301
WS_DLL_PUBLIC const void * fetch_tapped_data(int tap_id, int idx)
Definition tap.c:429
WS_DLL_PUBLIC bool tap_listeners_require_columns(void)
Definition tap.c:783
WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void)
Definition tap.c:851
WS_DLL_PUBLIC int register_tap(const char *name)
Definition tap.c:178
WS_DLL_PUBLIC bool tap_listeners_require_dissection(void)
Definition tap.c:763
WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt)
Definition tap.c:264
WS_DLL_PUBLIC GString * set_tap_dfilter(void *tapdata, const char *fstring)
Definition tap.c:619
WS_DLL_PUBLIC bool have_filtering_tap_listeners(void)
Definition tap.c:821
WS_DLL_PUBLIC bool have_tap_listener(int tap_id)
Definition tap.c:803
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:562
WS_DLL_PUBLIC GString * set_tap_flags(void *tapdata, unsigned flags)
Definition tap.c:668
WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug)
WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all)
Definition tap.c:484
WS_DLL_PUBLIC void remove_tap_listener(void *tapdata)
Definition tap.c:730
void tap_cleanup(void)
Definition tap.c:862
void tap_push_tapped_queue(epan_dissect_t *edt)
Definition tap.c:319
WS_DLL_PUBLIC void tap_load_main_filter(struct epan_dfilter *dfcode)
Definition tap.c:888
WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data)
Definition tap.c:230
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:525
WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt)
Definition tap.c:835