Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
rtd_table.h
1 /* rtd_table.h
2  * GUI independent helper routines common to all Response Time Delay (RTD) taps.
3  * Based on srt_table.h
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __RTD_TABLE_H__
13 #define __RTD_TABLE_H__
14 
15 #include "tap.h"
16 #include "timestats.h"
17 #include "value_string.h"
18 #include "wmem/wmem.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
24 typedef struct _rtd_timestat {
25  guint num_timestat;
26  timestat_t* rtd;
27  guint32 open_req_num;
28  guint32 disc_rsp_num;
29  guint32 req_dup_num;
30  guint32 rsp_dup_num;
31 } rtd_timestat;
32 
34 typedef struct _rtd_stat_table {
35  char *filter;
36  guint num_rtds;
37  rtd_timestat* time_stats;
39 
42 typedef struct _rtd_data_t {
44  void *user_data;
45 } rtd_data_t;
46 
48 struct register_rtd;
49 typedef struct register_rtd register_rtd_t;
50 
51 typedef void (*rtd_gui_init_cb)(rtd_stat_table* rtd, void* gui_data);
52 typedef void (*rtd_gui_reset_cb)(rtd_stat_table* rtd, void* gui_data); /* GTK+ only. */
53 typedef void (*rtd_gui_free_cb)(rtd_stat_table* rtd, void* gui_data); /* GTK+ only. */
54 typedef void (*rtd_init_cb)(struct register_rtd* rtd, rtd_gui_init_cb gui_callback, void* gui_data); /* GTK+ only. */
55 typedef void (*rtd_filter_check_cb)(const char *opt_arg, const char **filter, char** err);
56 
67 WS_DLL_PUBLIC void register_rtd_table(const int proto_id, const char* tap_listener, guint num_tables, guint num_timestats, const value_string* vs_type,
68  tap_packet_cb rtd_packet_func, rtd_filter_check_cb filter_check_cb);
69 
75 WS_DLL_PUBLIC int get_rtd_proto_id(register_rtd_t* rtd);
76 
82 WS_DLL_PUBLIC const char* get_rtd_tap_listener_name(register_rtd_t* rtd);
83 
89 WS_DLL_PUBLIC tap_packet_cb get_rtd_packet_func(register_rtd_t* rtd);
90 
96 WS_DLL_PUBLIC guint get_rtd_num_tables(register_rtd_t* rtd);
97 
103 WS_DLL_PUBLIC const value_string* get_rtd_value_string(register_rtd_t* rtd);
104 
110 WS_DLL_PUBLIC register_rtd_t* get_rtd_table_by_name(const char* name);
111 
118 WS_DLL_PUBLIC void free_rtd_table(rtd_stat_table* table, rtd_gui_free_cb gui_callback, void *callback_data);
119 
126 WS_DLL_PUBLIC void reset_rtd_table(rtd_stat_table* table, rtd_gui_reset_cb gui_callback, void *callback_data);
127 
134 WS_DLL_PUBLIC void rtd_table_iterate_tables(wmem_foreach_func func, gpointer user_data);
135 
143 WS_DLL_PUBLIC void rtd_table_get_filter(register_rtd_t* rtd, const char *opt_arg, const char **filter, char** err);
144 
152 WS_DLL_PUBLIC void rtd_table_dissector_init(register_rtd_t* rtd, rtd_stat_table* table, rtd_gui_init_cb gui_callback, void *callback_data);
153 
160 WS_DLL_PUBLIC gchar* rtd_table_get_tap_string(register_rtd_t* rtd);
161 
162 #ifdef __cplusplus
163 }
164 #endif /* __cplusplus */
165 
166 #endif /* __RTD_TABLE_H__ */
167 
168 /*
169  * Editor modelines
170  *
171  * Local Variables:
172  * c-basic-offset: 4
173  * tab-width: 8
174  * indent-tabs-mode: nil
175  * End:
176  *
177  * ex: set shiftwidth=4 tabstop=8 expandtab:
178  * :indentSize=4:tabSize=8:noTabs=true:
179  */
guint num_rtds
Definition: rtd_table.h:36
gboolean(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Definition: wmem_tree.h:213
Definition: rtd_table.h:34
Definition: rtd_table.h:42
void * user_data
Definition: rtd_table.h:44
Definition: rtd_table.c:20
guint num_timestat
Definition: rtd_table.h:25
Definition: value_string.h:24
rtd_stat_table stat_table
Definition: rtd_table.h:43
Definition: rtd_table.h:24
Definition: timestats.h:24