| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
tap.h
Go to the documentation of this file.
1
10#pragma once
11#include <epan/epan.h>
12#include <epan/packet_info.h>
13#include "ws_symbol_export.h"
14
15#ifdef __cplusplus
16 extern "C" {
17#endif /* __cplusplus */
18
22 typedef enum {
23 TAP_PACKET_DONT_REDRAW,
24 TAP_PACKET_REDRAW,
25 TAP_PACKET_FAILED
26} tap_packet_status;
27
28 typedef unsigned tap_flags_t;
29
30 typedef void (*tap_reset_cb)(void *tapdata);
31 typedef tap_packet_status (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
32 typedef void (*tap_draw_cb)(void *tapdata);
33 typedef void (*tap_finish_cb)(void *tapdata);
34
38#define TL_REQUIRES_NOTHING 0x00000000
39#define TL_REQUIRES_PROTO_TREE 0x00000001
40#define TL_REQUIRES_COLUMNS 0x00000002
41#define TL_REQUIRES_ERROR_PACKETS 0x00000004
42#define TL_REQUIRES_PROTOCOLS 0x00000020
43
54
56#define TL_IS_DISSECTOR_HELPER 0x00000008
58
60#define TL_IGNORE_DISPLAY_FILTER 0x00000010
61#define TL_DISPLAY_FILTER_IGNORED 0x00100000
62#define TL_LIMIT_TO_DISPLAY_FILTER 0x00000040
63
65#define TL_IP_AGGREGATION_NULL 0x00000100
66#define TL_IP_AGGREGATION_ORI 0x00000200
67#define TL_IP_AGGREGATION_RESERVED 0x00000400
68
72 typedef struct {
73 void (*register_tap_listener)(void);
74} tap_plugin;
75
77
85WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug);
86
90 typedef struct _tap_reg {
91 const char* cb_name;
92 void (*cb_func)(void);
93} tap_reg_t;
94
101 extern void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners);
102
108 extern void tap_init(void);
109
127WS_DLL_PUBLIC int register_tap(const char *name);
128
136WS_DLL_PUBLIC GList* get_tap_names(void);
137
147WS_DLL_PUBLIC int find_tap_id(const char *name);
148
173WS_DLL_PUBLIC void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
174
176
184WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt);
185
192 extern void tap_queue_init(epan_dissect_t *edt);
193
198 extern void tap_push_tapped_queue(epan_dissect_t *edt);
199
206WS_DLL_PUBLIC void reset_tap_listeners(void);
207
220WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all);
221
297WS_DLL_PUBLIC GString *register_tap_listener(const char *tapname, void *tapdata,
298 const char *fstring, unsigned flags, tap_reset_cb tap_reset,
299 tap_packet_cb tap_packet, tap_draw_cb tap_draw,
300 tap_finish_cb tap_finish) G_GNUC_WARN_UNUSED_RESULT;
301
311WS_DLL_PUBLIC GString *set_tap_dfilter(void *tapdata, const char *fstring);
312
319WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void);
320
326WS_DLL_PUBLIC void remove_tap_listener(void *tapdata);
327
338WS_DLL_PUBLIC GString *set_tap_flags(void *tapdata, unsigned flags);
339
345WS_DLL_PUBLIC bool tap_listeners_require_dissection(void);
346
352WS_DLL_PUBLIC bool tap_listeners_require_columns(void);
353
360WS_DLL_PUBLIC bool have_tap_listener(int tap_id);
361
367WS_DLL_PUBLIC bool have_filtering_tap_listeners(void);
368
375WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt);
376
384WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void);
385
407WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
408
412 extern void tap_cleanup(void);
413
421WS_DLL_PUBLIC void tap_load_main_filter(struct epan_dfilter *dfcode);
422
423#ifdef __cplusplus
424}
425#endif /* __cplusplus */
epan.h
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
packet_info.h
_tap_reg
Describes a single built-in tap registration entry, pairing a tap name with its registration callback...
Definition tap.h:90
_tap_reg::cb_func
void(* cb_func)(void)
Definition tap.h:92
_tap_reg::cb_name
const char * cb_name
Definition tap.h:91
epan_dfilter
The compiled display filter object passed back to the user.
Definition dfilter-int.h:46
tap_plugin
Describes a tap plugin, providing a callback to register its tap listener with the tap framework.
Definition tap.h:72
tap_plugin::register_tap_listener
void(* register_tap_listener)(void)
Definition tap.h:73
tap_listeners_dfilter_recompile
WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void)
Recompiles dfilter for all registered tap listeners.
Definition tap.c:702
reset_tap_listeners
WS_DLL_PUBLIC void reset_tap_listeners(void)
Resets all tap listeners.
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)
Fetch tapped data before returning.
Definition tap.c:432
get_tap_names
WS_DLL_PUBLIC GList * get_tap_names(void)
Returns a list of tap names.
Definition tap.c:505
tap_listeners_require_columns
WS_DLL_PUBLIC bool tap_listeners_require_columns(void)
Check if any tap listeners require column information.
Definition tap.c:780
union_of_tap_listener_flags
WS_DLL_PUBLIC unsigned union_of_tap_listener_flags(void)
Get the union of all the flags for all the tap listeners; that gives an indication of whether the pro...
Definition tap.c:848
register_tap
WS_DLL_PUBLIC int register_tap(const char *name)
Registers a tap with the given name.
Definition tap.c:181
tap_listeners_require_dissection
WS_DLL_PUBLIC bool tap_listeners_require_dissection(void)
Check if any tap listeners require dissection.
Definition tap.c:760
tap_build_interesting
WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt)
Build a list of all interesting hf_fields for tap listeners.
Definition tap.c:267
set_tap_dfilter
WS_DLL_PUBLIC GString * set_tap_dfilter(void *tapdata, const char *fstring)
Set a display filter for a tap listener.
Definition tap.c:616
have_filtering_tap_listeners
WS_DLL_PUBLIC bool have_filtering_tap_listeners(void)
Check if there are any tap listeners that require filtering.
Definition tap.c:818
have_tap_listener
WS_DLL_PUBLIC bool have_tap_listener(int tap_id)
Check if there is a tap listener with the given 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)
Set flags for a tap listener.
Definition tap.c:665
tap_register_plugin
WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug)
Registers a packet tap plugin.
draw_tap_listeners
WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all)
Draws all tap listeners.
Definition tap.c:487
remove_tap_listener
WS_DLL_PUBLIC void remove_tap_listener(void *tapdata)
Removes a tap listener from the queue.
Definition tap.c:727
tap_cleanup
void tap_cleanup(void)
Clean internal structures.
Definition tap.c:859
register_all_tap_listeners
void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners)
For all taps, call their register routines. Must be called after plugins_init(), if plugins are suppo...
Definition tap.c:132
tap_init
void tap_init(void)
Initializes the tap system.
Definition tap.c:155
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)
Loads the main filter in the tapping system for taps that limit their results to the main display fil...
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:22
TAP_PACKET_REDRAW
@ TAP_PACKET_REDRAW
Definition tap.h:24
TAP_PACKET_FAILED
@ TAP_PACKET_FAILED
Definition tap.h:25
TAP_PACKET_DONT_REDRAW
@ TAP_PACKET_DONT_REDRAW
Definition tap.h:23
find_tap_id
WS_DLL_PUBLIC int find_tap_id(const char *name)
Finds the ID of a tap by its name.
Definition tap.c:528
tap_listeners_load_field_references
WS_DLL_PUBLIC void tap_listeners_load_field_references(epan_dissect_t *edt)
If any tap listeners have a filter with references to the currently selected frame in the GUI (edt->t...
Definition tap.c:832
tap_reg_t
struct _tap_reg tap_reg_t
Describes a single built-in tap registration entry, pairing a tap name with its registration callback...