Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
stats_tree_priv.h
Go to the documentation of this file.
1
12#ifndef __STATS_TREE_PRIV_H
13#define __STATS_TREE_PRIV_H
14
15#include "stats_tree.h"
16#include "ws_symbol_export.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22#define INDENT_MAX 32
23#define NUM_BUF_SIZE 32
24
28
31typedef struct _tree_pres tree_pres;
32
36
37
38typedef struct _stat_node stat_node;
39typedef struct _stats_tree_cfg stats_tree_cfg;
40
41typedef struct _range_pair {
42 int floor;
43 int ceil;
45
46typedef struct _burst_bucket burst_bucket;
48 burst_bucket *next;
49 burst_bucket *prev;
50 int count;
51 double bucket_no;
52 double start_time;
53};
54
62struct _stat_node {
63 char* name;
64 int id;
65 stat_node_datatype datatype;
69
71 union {
72 int64_t int_total;
73 double float_total;
75
77 union {
78 int int_min;
79 float float_min;
81
83 union {
84 int int_max;
85 float float_max;
87
91 int bcount;
95 double burst_time;
97 GHashTable *hash;
109};
110
114
115 char *filter;
116
117 /* times */
118 double start;
119 double elapsed;
120 double now;
121
122 int st_flags;
123 int num_columns;
124 char *display_name;
125
130 GHashTable *names;
131
133 GPtrArray *parents;
134
140
143};
144
146 char *abbr;
147 char *path;
148 char *title;
149 char *tapname;
150 char *first_column_name;
151 register_stat_group_t stat_group;
152
153 bool plugin;
154
156 stat_tree_packet_cb packet;
157 stat_tree_init_cb init;
158 stat_tree_cleanup_cb cleanup;
159
161 unsigned flags;
162
163 /*
164 * node presentation callbacks
165 */
166
169
174
175
176 tree_pres *(*new_tree_pr)(stats_tree*);
177 void (*free_tree_pr)(stats_tree*);
178
180 unsigned st_flags;
181};
182
183/* guess what, this is it! */
184WS_DLL_PUBLIC void stats_tree_presentation(void (*registry_iterator)(void *,void *,void *),
185 void (*setup_node_pr)(stat_node*),
186 void (*free_tree_pr)(stats_tree*),
187 void *data);
188
189WS_DLL_PUBLIC stats_tree *stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter);
190
192WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void*, packet_info*, epan_dissect_t*, const void *, tap_flags_t flags);
193
195WS_DLL_PUBLIC void stats_tree_reset(void *p_st);
196
198WS_DLL_PUBLIC void stats_tree_reinit(void *p_st);
199
200/* callback for destroy */
201WS_DLL_PUBLIC void stats_tree_free(stats_tree *st);
202
205WS_DLL_PUBLIC char *stats_tree_get_abbr(const char *ws_optarg);
206
208WS_DLL_PUBLIC stats_tree_cfg *stats_tree_get_cfg_by_abbr(const char *abbr);
209
212WS_DLL_PUBLIC GList *stats_tree_get_cfg_list(void);
213
215WS_DLL_PUBLIC unsigned stats_tree_branch_max_namelen(const stat_node *node, unsigned indent);
216
219WS_DLL_PUBLIC char *stats_tree_node_to_str(const stat_node *node,
220 char *buffer, unsigned len);
221
225WS_DLL_PUBLIC char* stats_tree_get_displayname (const char* fullname);
226
228WS_DLL_PUBLIC int stats_tree_get_default_sort_col (stats_tree *st);
229
231WS_DLL_PUBLIC bool stats_tree_is_default_sort_DESC (stats_tree *st);
232
234WS_DLL_PUBLIC const char* stats_tree_get_column_name (stats_tree_cfg *st_config, int col_index);
235
237WS_DLL_PUBLIC int stats_tree_get_column_size (int col_index);
238
241WS_DLL_PUBLIC char** stats_tree_get_values_from_node (const stat_node* node);
242
244WS_DLL_PUBLIC int stats_tree_sort_compare (const stat_node *a,
245 const stat_node *b,
246 int sort_column,
247 bool sort_descending);
248
250WS_DLL_PUBLIC int stat_node_array_sortcmp (const void *a,
251 const void *b,
252 void *user_data);
253
255WS_DLL_PUBLIC GString* stats_tree_format_as_str(const stats_tree* st,
256 st_format_type format_type,
257 int sort_column,
258 bool sort_descending);
259
261WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node,
262 GString *s,
263 st_format_type format_type,
264 unsigned indent,
265 const char *path,
266 int maxnamelen,
267 int sort_column,
268 bool sort_descending);
269
270#ifdef __cplusplus
271}
272#endif /* __cplusplus */
273
274#endif /* __STATS_TREE_PRIV_H */
enum _st_format_type st_format_type
enum register_stat_group_e register_stat_group_t
WS_DLL_PUBLIC char * stats_tree_node_to_str(const stat_node *node, char *buffer, unsigned len)
Definition stats_tree.c:54
WS_DLL_PUBLIC char * stats_tree_get_displayname(const char *fullname)
Definition stats_tree.c:1041
WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void *, packet_info *, epan_dissect_t *, const void *, tap_flags_t flags)
Definition stats_tree.c:411
WS_DLL_PUBLIC stats_tree_cfg * stats_tree_get_cfg_by_abbr(const char *abbr)
Definition stats_tree.c:427
WS_DLL_PUBLIC int stats_tree_get_default_sort_col(stats_tree *st)
Definition stats_tree.c:1066
WS_DLL_PUBLIC int stats_tree_sort_compare(const stat_node *a, const stat_node *b, int sort_column, bool sort_descending)
Definition stats_tree.c:1215
WS_DLL_PUBLIC GList * stats_tree_get_cfg_list(void)
Definition stats_tree.c:443
WS_DLL_PUBLIC GString * stats_tree_format_as_str(const stats_tree *st, st_format_type format_type, int sort_column, bool sort_descending)
Definition stats_tree.c:1332
WS_DLL_PUBLIC char ** stats_tree_get_values_from_node(const stat_node *node)
Definition stats_tree.c:1134
WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node, GString *s, st_format_type format_type, unsigned indent, const char *path, int maxnamelen, int sort_column, bool sort_descending)
Definition stats_tree.c:1425
WS_DLL_PUBLIC void stats_tree_reinit(void *p_st)
Definition stats_tree.c:218
WS_DLL_PUBLIC unsigned stats_tree_branch_max_namelen(const stat_node *node, unsigned indent)
Definition stats_tree.c:66
WS_DLL_PUBLIC bool stats_tree_is_default_sort_DESC(stats_tree *st)
Definition stats_tree.c:1086
WS_DLL_PUBLIC const char * stats_tree_get_column_name(stats_tree_cfg *st_config, int col_index)
Definition stats_tree.c:1092
WS_DLL_PUBLIC int stats_tree_get_column_size(int col_index)
Definition stats_tree.c:1122
WS_DLL_PUBLIC void stats_tree_reset(void *p_st)
Definition stats_tree.c:206
WS_DLL_PUBLIC char * stats_tree_get_abbr(const char *ws_optarg)
Definition stats_tree.c:793
WS_DLL_PUBLIC int stat_node_array_sortcmp(const void *a, const void *b, void *user_data)
Definition stats_tree.c:1406
Definition stats_tree_priv.h:47
Definition packet_info.h:43
Definition plugins.c:29
Definition stats_tree_priv.h:41
Definition tap-stats_tree.c:27
Represents a node in a hierarchical statistics tree.
Definition stats_tree_priv.h:62
int counter
Definition stats_tree_priv.h:68
GHashTable * hash
Definition stats_tree_priv.h:97
stat_node * children
Definition stats_tree_priv.h:103
int id
Definition stats_tree_priv.h:64
burst_bucket * bt
Definition stats_tree_priv.h:93
int max_burst
Definition stats_tree_priv.h:94
union _stat_node::@495 maxvalue
stats_tree * st
Definition stats_tree_priv.h:99
int64_t int_total
Definition stats_tree_priv.h:72
char * name
Definition stats_tree_priv.h:63
int int_max
Definition stats_tree_priv.h:84
stat_node_datatype datatype
Definition stats_tree_priv.h:65
union _stat_node::@494 minvalue
int bcount
Definition stats_tree_priv.h:91
float float_min
Definition stats_tree_priv.h:79
union _stat_node::@493 total
double burst_time
Definition stats_tree_priv.h:95
int int_min
Definition stats_tree_priv.h:78
st_node_pres * pr
Definition stats_tree_priv.h:108
double float_total
Definition stats_tree_priv.h:73
float float_max
Definition stats_tree_priv.h:85
stat_node * parent
Definition stats_tree_priv.h:102
stat_node * next
Definition stats_tree_priv.h:104
range_pair_t * rng
Definition stats_tree_priv.h:106
int st_flags
Definition stats_tree_priv.h:88
burst_bucket * bh
Definition stats_tree_priv.h:92
Definition stats_tree_priv.h:145
unsigned flags
Definition stats_tree_priv.h:161
tree_cfg_pres * pr
Definition stats_tree_priv.h:173
stat_tree_packet_cb packet
Definition stats_tree_priv.h:156
void(* setup_node_pr)(stat_node *)
Definition stats_tree_priv.h:168
unsigned st_flags
Definition stats_tree_priv.h:180
Definition stats_tree_priv.h:111
GHashTable * names
Definition stats_tree_priv.h:130
stat_node root
Definition stats_tree_priv.h:142
GPtrArray * parents
Definition stats_tree_priv.h:133
tree_pres * pr
Definition stats_tree_priv.h:139
stats_tree_cfg * cfg
Definition stats_tree_priv.h:113
Definition tap-stats_tree.c:35
Definition tap-stats_tree.c:31
Definition mcast_stream.h:30
Definition epan_dissect.h:28
tap_packet_status
Definition tap.h:25