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
11#pragma once
12#include "stats_tree.h"
13#include "ws_symbol_export.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif /* __cplusplus */
18
19#define INDENT_MAX 32
20#define NUM_BUF_SIZE 32
21
25
28typedef struct _tree_pres tree_pres;
29
33
34
35typedef struct _stat_node stat_node;
36typedef struct _stats_tree_cfg stats_tree_cfg;
37
38typedef struct _range_pair {
39 int floor;
40 int ceil;
42
43typedef struct _burst_bucket burst_bucket;
45 burst_bucket *next;
46 burst_bucket *prev;
47 int count;
48 double bucket_no;
49 double start_time;
50};
51
59struct _stat_node {
60 char* name;
61 int id;
62 stat_node_datatype datatype;
66
68 union {
69 int64_t int_total;
70 double float_total;
72
74 union {
75 int int_min;
76 float float_min;
78
80 union {
81 int int_max;
82 float float_max;
84
88 int bcount;
92 double burst_time;
94 GHashTable *hash;
106};
107
111
112 char *filter;
113
114 /* times */
115 double start;
116 double elapsed;
117 double now;
118
119 int st_flags;
120 int num_columns;
121 char *display_name;
122
127 GHashTable *names;
128
130 GPtrArray *parents;
131
137
140};
141
143 char *abbr;
144 char *path;
145 char *title;
146 char *tapname;
147 char *first_column_name;
148 register_stat_group_t stat_group;
149
150 bool plugin;
151
153 stat_tree_packet_cb packet;
154 stat_tree_init_cb init;
155 stat_tree_cleanup_cb cleanup;
156
158 unsigned flags;
159
160 /*
161 * node presentation callbacks
162 */
163
166
171
172
173 tree_pres *(*new_tree_pr)(stats_tree*);
174 void (*free_tree_pr)(stats_tree*);
175
177 unsigned st_flags;
178};
179
180/* guess what, this is it! */
189WS_DLL_PUBLIC void stats_tree_presentation(void (*registry_iterator)(void *,void *,void *),
190 void (*setup_node_pr)(stat_node*),
191 void (*free_tree_pr)(stats_tree*),
192 void *data);
193
204WS_DLL_PUBLIC stats_tree *stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter);
205
207WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void*, packet_info*, epan_dissect_t*, const void *, tap_flags_t flags);
208
210WS_DLL_PUBLIC void stats_tree_reset(void *p_st);
211
213WS_DLL_PUBLIC void stats_tree_reinit(void *p_st);
214
215/* callback for destroy */
221WS_DLL_PUBLIC void stats_tree_free(stats_tree *st);
222
225WS_DLL_PUBLIC char *stats_tree_get_abbr(const char *ws_optarg);
226
228WS_DLL_PUBLIC stats_tree_cfg *stats_tree_get_cfg_by_abbr(const char *abbr);
229
232WS_DLL_PUBLIC GList *stats_tree_get_cfg_list(void);
233
235WS_DLL_PUBLIC unsigned stats_tree_branch_max_namelen(const stat_node *node, unsigned indent);
236
239WS_DLL_PUBLIC char *stats_tree_node_to_str(const stat_node *node,
240 char *buffer, unsigned len);
241
245WS_DLL_PUBLIC char* stats_tree_get_displayname (const char* fullname);
246
248WS_DLL_PUBLIC int stats_tree_get_default_sort_col (stats_tree *st);
249
251WS_DLL_PUBLIC bool stats_tree_is_default_sort_DESC (stats_tree *st);
252
254WS_DLL_PUBLIC const char* stats_tree_get_column_name (stats_tree_cfg *st_config, int col_index);
255
257WS_DLL_PUBLIC int stats_tree_get_column_size (int col_index);
258
261WS_DLL_PUBLIC char** stats_tree_get_values_from_node (const stat_node* node);
262
264WS_DLL_PUBLIC int stats_tree_sort_compare (const stat_node *a,
265 const stat_node *b,
266 int sort_column,
267 bool sort_descending);
268
270WS_DLL_PUBLIC int stat_node_array_sortcmp (const void *a,
271 const void *b,
272 void *user_data);
273
275WS_DLL_PUBLIC GString* stats_tree_format_as_str(const stats_tree* st,
276 st_format_type format_type,
277 int sort_column,
278 bool sort_descending);
279
281WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node,
282 GString *s,
283 st_format_type format_type,
284 unsigned indent,
285 const char *path,
286 int maxnamelen,
287 int sort_column,
288 bool sort_descending);
289
290#ifdef __cplusplus
291}
292#endif /* __cplusplus */
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 stats_tree * stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter)
Creates a new statistics tree.
Definition stats_tree.c:359
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_presentation(void(*registry_iterator)(void *, void *, void *), void(*setup_node_pr)(stat_node *), void(*free_tree_pr)(stats_tree *), void *data)
Registers callback functions for presenting statistics tree.
Definition stats_tree.c:469
WS_DLL_PUBLIC void stats_tree_reset(void *p_st)
Definition stats_tree.c:206
WS_DLL_PUBLIC void stats_tree_free(stats_tree *st)
Frees a stats_tree structure.
Definition stats_tree.c:128
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:44
Definition packet_info.h:40
Definition plugins.c:33
Definition stats_tree_priv.h:38
Definition tap-stats_tree.c:27
Represents a node in a hierarchical statistics tree.
Definition stats_tree_priv.h:59
int counter
Definition stats_tree_priv.h:65
GHashTable * hash
Definition stats_tree_priv.h:94
stat_node * children
Definition stats_tree_priv.h:100
int id
Definition stats_tree_priv.h:61
burst_bucket * bt
Definition stats_tree_priv.h:90
int max_burst
Definition stats_tree_priv.h:91
union _stat_node::@495 maxvalue
stats_tree * st
Definition stats_tree_priv.h:96
int64_t int_total
Definition stats_tree_priv.h:69
char * name
Definition stats_tree_priv.h:60
int int_max
Definition stats_tree_priv.h:81
stat_node_datatype datatype
Definition stats_tree_priv.h:62
union _stat_node::@494 minvalue
int bcount
Definition stats_tree_priv.h:88
float float_min
Definition stats_tree_priv.h:76
union _stat_node::@493 total
double burst_time
Definition stats_tree_priv.h:92
int int_min
Definition stats_tree_priv.h:75
st_node_pres * pr
Definition stats_tree_priv.h:105
double float_total
Definition stats_tree_priv.h:70
float float_max
Definition stats_tree_priv.h:82
stat_node * parent
Definition stats_tree_priv.h:99
stat_node * next
Definition stats_tree_priv.h:101
range_pair_t * rng
Definition stats_tree_priv.h:103
int st_flags
Definition stats_tree_priv.h:85
burst_bucket * bh
Definition stats_tree_priv.h:89
Definition stats_tree_priv.h:142
unsigned flags
Definition stats_tree_priv.h:158
tree_cfg_pres * pr
Definition stats_tree_priv.h:170
stat_tree_packet_cb packet
Definition stats_tree_priv.h:153
void(* setup_node_pr)(stat_node *)
Definition stats_tree_priv.h:165
unsigned st_flags
Definition stats_tree_priv.h:177
Definition stats_tree_priv.h:108
GHashTable * names
Definition stats_tree_priv.h:127
stat_node root
Definition stats_tree_priv.h:139
GPtrArray * parents
Definition stats_tree_priv.h:130
tree_pres * pr
Definition stats_tree_priv.h:136
stats_tree_cfg * cfg
Definition stats_tree_priv.h:110
Definition tap-stats_tree.c:35
Definition tap-stats_tree.c:31
Definition mcast_stream.h:30
Definition epan_dissect.h:25
tap_packet_status
Definition tap.h:22