Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
srt_table.h
1 /* srt_table.h
2  * GUI independent helper routines common to all service response time (SRT) taps.
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __SRT_TABLE_H__
12 #define __SRT_TABLE_H__
13 
14 #include "tap.h"
15 #include "timestats.h"
16 #include "wmem/wmem.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
23 typedef struct _srt_procedure_t {
24  int proc_index;
26  char *procedure;
28 
30 typedef struct _srt_stat_table {
31  const char *name;
32  const char *short_name;
33  char *filter_string;
35  int num_procs;
36  const char *proc_column_name;
38  void* table_specific_data;
40 
41 struct register_srt;
42 struct _srt_data_t;
43 typedef void (*srt_gui_init_cb)(srt_stat_table* rst, void* gui_data); /* GTK+ only? */
44 typedef void (*srt_gui_reset_cb)(srt_stat_table* rst, void* gui_data); /* GTK+ only? */
45 typedef void (*srt_gui_free_cb)(srt_stat_table* rst, void* gui_data); /* GTK+ only? */
46 typedef void (*srt_proc_table_cb)(srt_stat_table* rst, int indx, struct _srt_data_t* gui_data);
47 typedef void (*srt_init_cb)(struct register_srt* srt, GArray* srt_array, srt_gui_init_cb gui_callback, void* gui_data);
48 typedef guint (*srt_param_handler_cb)(struct register_srt* srt, const char* opt_arg, char** err);
49 
52 typedef struct _srt_data_t {
53  GArray *srt_array;
54  void *user_data;
55 } srt_data_t;
56 
58 typedef struct register_srt register_srt_t;
59 
69 WS_DLL_PUBLIC void register_srt_table(const int proto_id, const char* tap_listener, int max_tables,
70  tap_packet_cb srt_packet_func, srt_init_cb init_cb, srt_param_handler_cb param_cb);
71 
77 WS_DLL_PUBLIC int get_srt_proto_id(register_srt_t* srt);
78 
84 WS_DLL_PUBLIC const char* get_srt_tap_listener_name(register_srt_t* srt);
85 
91 WS_DLL_PUBLIC int get_srt_max_tables(register_srt_t* srt);
92 
98 WS_DLL_PUBLIC tap_packet_cb get_srt_packet_func(register_srt_t* srt);
99 
106 WS_DLL_PUBLIC void set_srt_table_param_data(register_srt_t* srt, void* data);
107 
113 WS_DLL_PUBLIC void* get_srt_table_param_data(register_srt_t* srt);
114 
120 WS_DLL_PUBLIC register_srt_t* get_srt_table_by_name(const char* name);
121 
126 WS_DLL_PUBLIC void free_srt_table_data(srt_stat_table *rst);
127 
135 WS_DLL_PUBLIC void free_srt_table(register_srt_t *srt, GArray* srt_array, srt_gui_free_cb gui_callback, void *callback_data);
136 
143 WS_DLL_PUBLIC void reset_srt_table(GArray* srt_array, srt_gui_reset_cb gui_callback, void *callback_data);
144 
151 WS_DLL_PUBLIC void srt_table_iterate_tables(wmem_foreach_func func, gpointer user_data);
152 
160 WS_DLL_PUBLIC void srt_table_get_filter(register_srt_t* srt, const char *opt_arg, const char **filter, char** err);
161 
169 WS_DLL_PUBLIC void srt_table_dissector_init(register_srt_t* srt, GArray* srt_array, srt_gui_init_cb gui_callback, void *callback_data);
170 
177 WS_DLL_PUBLIC gchar* srt_table_get_tap_string(register_srt_t* srt);
178 
192 WS_DLL_PUBLIC srt_stat_table* init_srt_table(const char *name, const char *short_name, GArray *srt_array, int num_procs, const char* proc_column_name,
193  const char *filter_string, srt_gui_init_cb gui_callback, void* gui_data, void* table_specific_data);
194 
201 WS_DLL_PUBLIC void init_srt_table_row(srt_stat_table *rst, int proc_index, const char *procedure);
202 
210 WS_DLL_PUBLIC void add_srt_table_data(srt_stat_table *rst, int proc_index, const nstime_t *req_time, packet_info *pinfo);
211 
212 #ifdef __cplusplus
213 }
214 #endif /* __cplusplus */
215 
216 #endif /* __SRT_TABLE_H__ */
217 
218 /*
219  * Editor modelines
220  *
221  * Local Variables:
222  * c-basic-offset: 4
223  * tab-width: 8
224  * indent-tabs-mode: nil
225  * End:
226  *
227  * ex: set shiftwidth=4 tabstop=8 expandtab:
228  * :indentSize=4:tabSize=8:noTabs=true:
229  */
const char * short_name
Definition: srt_table.h:32
Definition: srt_table.h:30
Definition: packet_info.h:44
Definition: srt_table.h:52
Definition: srt_table.c:19
gboolean(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Definition: wmem_tree.h:213
Definition: srt_table.h:23
srt_procedure_t * procedures
Definition: srt_table.h:37
Definition: nstime.h:27
char * filter_string
Definition: srt_table.h:33
timestat_t stats
Definition: srt_table.h:25
const char * proc_column_name
Definition: srt_table.h:36
GArray * srt_array
Definition: srt_table.h:53
void * user_data
Definition: srt_table.h:54
Definition: timestats.h:24
int num_procs
Definition: srt_table.h:35
char * procedure
Definition: srt_table.h:26
const char * name
Definition: srt_table.h:31