Wireshark 4.7.0
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
16extern "C" {
17#endif /* __cplusplus */
18
27
28typedef unsigned tap_flags_t;
29
30typedef void (*tap_reset_cb)(void *tapdata);
31typedef tap_packet_status (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
32typedef void (*tap_draw_cb)(void *tapdata);
33typedef 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
56#define TL_IS_DISSECTOR_HELPER 0x00000008
60#define TL_IGNORE_DISPLAY_FILTER 0x00000010
61#define TL_DISPLAY_FILTER_IGNORED 0x00100000
62#define TL_LIMIT_TO_DISPLAY_FILTER 0x00000040
65#define TL_IP_AGGREGATION_NULL 0x00000100
66#define TL_IP_AGGREGATION_ORI 0x00000200
67#define TL_IP_AGGREGATION_RESERVED 0x00000400
72typedef struct {
73 void (*register_tap_listener)(void);
75
85WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug);
86
90typedef struct _tap_reg {
91 const char* cb_name;
92 void (*cb_func)(void);
94
101extern void register_all_tap_listeners(tap_reg_t const *tap_reg_listeners);
102
108extern 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
184WS_DLL_PUBLIC void tap_build_interesting(epan_dissect_t *edt);
185
192extern void tap_queue_init(epan_dissect_t *edt);
193
198extern 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
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
412extern 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 */
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Describes a single built-in tap registration entry, pairing a tap name with its registration callback...
Definition tap.h:90
void(* cb_func)(void)
Definition tap.h:92
const char * cb_name
Definition tap.h:91
The compiled display filter object passed back to the user.
Definition dfilter-int.h:46
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Describes a tap plugin, providing a callback to register its tap listener with the tap framework.
Definition tap.h:72
WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void)
Recompiles dfilter for all registered tap listeners.
Definition tap.c:702
WS_DLL_PUBLIC void reset_tap_listeners(void)
Resets all tap listeners.
Definition tap.c:464
void tap_queue_init(epan_dissect_t *edt)
Definition tap.c:304
WS_DLL_PUBLIC const void * fetch_tapped_data(int tap_id, int idx)
Fetch tapped data before returning.
Definition tap.c:432
WS_DLL_PUBLIC GList * get_tap_names(void)
Returns a list of tap names.
Definition tap.c:505
WS_DLL_PUBLIC bool tap_listeners_require_columns(void)
Check if any tap listeners require column information.
Definition tap.c:780
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
WS_DLL_PUBLIC int register_tap(const char *name)
Registers a tap with the given name.
Definition tap.c:181
WS_DLL_PUBLIC bool tap_listeners_require_dissection(void)
Check if any tap listeners require dissection.
Definition tap.c:760
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
WS_DLL_PUBLIC GString * set_tap_dfilter(void *tapdata, const char *fstring)
Set a display filter for a tap listener.
Definition tap.c:616
WS_DLL_PUBLIC bool have_filtering_tap_listeners(void)
Check if there are any tap listeners that require filtering.
Definition tap.c:818
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
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
WS_DLL_PUBLIC GString * set_tap_flags(void *tapdata, unsigned flags)
Set flags for a tap listener.
Definition tap.c:665
WS_DLL_PUBLIC void tap_register_plugin(const tap_plugin *plug)
Registers a packet tap plugin.
WS_DLL_PUBLIC void draw_tap_listeners(bool draw_all)
Draws all tap listeners.
Definition tap.c:487
WS_DLL_PUBLIC void remove_tap_listener(void *tapdata)
Removes a tap listener from the queue.
Definition tap.c:727
void tap_cleanup(void)
Clean internal structures.
Definition tap.c:859
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
void tap_init(void)
Initializes the tap system.
Definition tap.c:155
void tap_push_tapped_queue(epan_dissect_t *edt)
Definition tap.c:322
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
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
Definition tap.h:22
@ TAP_PACKET_REDRAW
Definition tap.h:24
@ TAP_PACKET_FAILED
Definition tap.h:25
@ TAP_PACKET_DONT_REDRAW
Definition tap.h:23
WS_DLL_PUBLIC int find_tap_id(const char *name)
Finds the ID of a tap by its name.
Definition tap.c:528
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
struct _tap_reg tap_reg_t
Describes a single built-in tap registration entry, pairing a tap name with its registration callback...