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
41typedef struct _range_pair {
42 int floor;
43 int ceil;
45
57
113
120 char* filter;
122 /* times */
123 double start;
124 double elapsed;
125 double now;
131 GHashTable* names;
132 GPtrArray* parents;
137};
138
143 char* abbr;
144 char* path;
145 char* title;
146 char* tapname;
150 bool plugin;
153 stat_tree_packet_cb packet;
154 stat_tree_init_cb init;
155 stat_tree_cleanup_cb cleanup;
157 unsigned flags;
159 /*
160 * node presentation callbacks
161 */
164 /*
165 * tree presentation callbacks
166 */
169 tree_pres* (*new_tree_pr)(stats_tree*);
172 unsigned st_flags;
173};
174
175/* 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
199WS_DLL_PUBLIC stats_tree *stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter);
200
213WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void *p, packet_info *pinfo, epan_dissect_t *edt, const void *pri, tap_flags_t flags);
214
222WS_DLL_PUBLIC void stats_tree_reset(void *p_st);
223
231WS_DLL_PUBLIC void stats_tree_reinit(void *p_st);
232
233/* callback for destroy */
239WS_DLL_PUBLIC void stats_tree_free(stats_tree *st);
240
250WS_DLL_PUBLIC char *stats_tree_get_abbr(const char *ws_optarg);
251
260WS_DLL_PUBLIC stats_tree_cfg *stats_tree_get_cfg_by_abbr(const char *abbr);
261
270WS_DLL_PUBLIC GList *stats_tree_get_cfg_list(void);
271
281WS_DLL_PUBLIC unsigned stats_tree_branch_max_namelen(const stat_node *node, unsigned indent);
282
294WS_DLL_PUBLIC char *stats_tree_node_to_str(const stat_node *node,
295 char *buffer, unsigned len);
296
306WS_DLL_PUBLIC char* stats_tree_get_displayname (const char* fullname);
307
316WS_DLL_PUBLIC int stats_tree_get_default_sort_col (stats_tree *st);
317
326WS_DLL_PUBLIC bool stats_tree_is_default_sort_DESC (stats_tree *st);
327
337WS_DLL_PUBLIC const char* stats_tree_get_column_name (stats_tree_cfg *st_config, int col_index);
338
347WS_DLL_PUBLIC int stats_tree_get_column_size (int col_index);
348
358WS_DLL_PUBLIC char** stats_tree_get_values_from_node (const stat_node* node);
359
372WS_DLL_PUBLIC int stats_tree_sort_compare (const stat_node *a,
373 const stat_node *b,
374 int sort_column,
375 bool sort_descending);
376
389WS_DLL_PUBLIC int stat_node_array_sortcmp (const void *a,
390 const void *b,
391 void *user_data);
392
404WS_DLL_PUBLIC GString* stats_tree_format_as_str(const stats_tree* st,
405 st_format_type format_type,
406 int sort_column,
407 bool sort_descending);
408
423WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node,
424 GString *s,
425 st_format_type format_type,
426 unsigned indent,
427 const char *path,
428 int maxnamelen,
429 int sort_column,
430 bool sort_descending);
431
432#ifdef __cplusplus
433}
434#endif /* __cplusplus */
enum _st_format_type st_format_type
Output format used when saving statistics tree data via "Save As...".
enum register_stat_group_e register_stat_group_t
enum _stat_node_datatype stat_node_datatype
Numeric data type stored in a statistics tree node's accumulator.
struct _range_pair range_pair_t
Represents an inclusive integer range with a lower and upper bound.
WS_DLL_PUBLIC char * stats_tree_node_to_str(const stat_node *node, char *buffer, unsigned len)
Convert a statistics tree node to a string.
Definition stats_tree.c:54
WS_DLL_PUBLIC char * stats_tree_get_displayname(const char *fullname)
Get the display name for a statistics tree node.
Definition stats_tree.c:1041
WS_DLL_PUBLIC stats_tree_cfg * stats_tree_get_cfg_by_abbr(const char *abbr)
Retrieves configuration for a statistics tree by its abbreviation.
Definition stats_tree.c:427
WS_DLL_PUBLIC int stats_tree_get_default_sort_col(stats_tree *st)
Get the default sort column for a statistics tree.
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)
Compare two stat_node elements for sorting.
Definition stats_tree.c:1215
WS_DLL_PUBLIC GList * stats_tree_get_cfg_list(void)
Retrieves a list of configuration items for statistics trees.
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)
Formats a stats tree as a string based on the specified format type.
Definition stats_tree.c:1332
WS_DLL_PUBLIC char ** stats_tree_get_values_from_node(const stat_node *node)
Retrieves values from a statistics tree 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)
Formats a node in the statistics tree as a string.
Definition stats_tree.c:1425
WS_DLL_PUBLIC void stats_tree_reinit(void *p_st)
Reinitializes a statistics tree.
Definition stats_tree.c:218
WS_DLL_PUBLIC unsigned stats_tree_branch_max_namelen(const stat_node *node, unsigned indent)
Calculate the maximum name length of a branch in the statistics tree.
Definition stats_tree.c:66
WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void *p, packet_info *pinfo, epan_dissect_t *edt, const void *pri, tap_flags_t flags)
Process a packet for statistics tree.
Definition stats_tree.c:411
WS_DLL_PUBLIC bool stats_tree_is_default_sort_DESC(stats_tree *st)
Check if the default sort order for a stats tree is descending.
Definition stats_tree.c:1086
WS_DLL_PUBLIC const char * stats_tree_get_column_name(stats_tree_cfg *st_config, int col_index)
Get the column name for a given index in the stats tree configuration.
Definition stats_tree.c:1092
WS_DLL_PUBLIC int stats_tree_get_column_size(int col_index)
Get the size of a column in the statistics tree.
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)
Resets a statistics tree.
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)
Retrieves an abbreviation from a given option argument.
Definition stats_tree.c:793
WS_DLL_PUBLIC int stat_node_array_sortcmp(const void *a, const void *b, void *user_data)
Compare two stat_node pointers for sorting purposes.
Definition stats_tree.c:1406
Definition stats_tree_priv.h:50
int count
Definition stats_tree_priv.h:53
burst_bucket * next
Definition stats_tree_priv.h:51
double bucket_no
Definition stats_tree_priv.h:54
burst_bucket * prev
Definition stats_tree_priv.h:52
double start_time
Definition stats_tree_priv.h:55
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Represents an inclusive integer range with a lower and upper bound.
Definition stats_tree_priv.h:41
int floor
Definition stats_tree_priv.h:42
int ceil
Definition stats_tree_priv.h:43
Definition tap-stats_tree.c:27
Represents a node in a hierarchical statistics tree.
Definition stats_tree_priv.h:65
union _stat_node::@495 minvalue
int counter
Definition stats_tree_priv.h:71
union _stat_node::@494 total
GHashTable * hash
Definition stats_tree_priv.h:100
stat_node * children
Definition stats_tree_priv.h:106
int id
Definition stats_tree_priv.h:67
burst_bucket * bt
Definition stats_tree_priv.h:96
int max_burst
Definition stats_tree_priv.h:97
stats_tree * st
Definition stats_tree_priv.h:102
int64_t int_total
Definition stats_tree_priv.h:75
char * name
Definition stats_tree_priv.h:66
int int_max
Definition stats_tree_priv.h:87
stat_node_datatype datatype
Definition stats_tree_priv.h:68
int bcount
Definition stats_tree_priv.h:94
float float_min
Definition stats_tree_priv.h:82
double burst_time
Definition stats_tree_priv.h:98
int int_min
Definition stats_tree_priv.h:81
st_node_pres * pr
Definition stats_tree_priv.h:111
double float_total
Definition stats_tree_priv.h:76
float float_max
Definition stats_tree_priv.h:88
union _stat_node::@496 maxvalue
stat_node * parent
Definition stats_tree_priv.h:105
stat_node * next
Definition stats_tree_priv.h:107
range_pair_t * rng
Definition stats_tree_priv.h:109
int st_flags
Definition stats_tree_priv.h:91
burst_bucket * bh
Definition stats_tree_priv.h:95
Defines the static configuration and callbacks for a statistics tree type, shared across all instance...
Definition stats_tree_priv.h:142
void(* free_tree_pr)(stats_tree *)
Definition stats_tree_priv.h:170
unsigned flags
Definition stats_tree_priv.h:157
tree_cfg_pres * pr
Definition stats_tree_priv.h:167
stat_tree_init_cb init
Definition stats_tree_priv.h:154
char * tapname
Definition stats_tree_priv.h:146
char * title
Definition stats_tree_priv.h:145
stat_tree_packet_cb packet
Definition stats_tree_priv.h:153
char * first_column_name
Definition stats_tree_priv.h:147
char * path
Definition stats_tree_priv.h:144
register_stat_group_t stat_group
Definition stats_tree_priv.h:148
stat_tree_cleanup_cb cleanup
Definition stats_tree_priv.h:155
void(* setup_node_pr)(stat_node *)
Definition stats_tree_priv.h:162
char * abbr
Definition stats_tree_priv.h:143
bool plugin
Definition stats_tree_priv.h:150
unsigned st_flags
Definition stats_tree_priv.h:172
Represents a live statistics tree instance, holding runtime state for accumulating and displaying tap...
Definition stats_tree_priv.h:117
double start
Definition stats_tree_priv.h:123
GHashTable * names
Definition stats_tree_priv.h:131
char * display_name
Definition stats_tree_priv.h:129
double now
Definition stats_tree_priv.h:125
char * filter
Definition stats_tree_priv.h:120
double elapsed
Definition stats_tree_priv.h:124
int st_flags
Definition stats_tree_priv.h:127
stat_node root
Definition stats_tree_priv.h:136
GPtrArray * parents
Definition stats_tree_priv.h:132
tree_pres * pr
Definition stats_tree_priv.h:134
stats_tree_cfg * cfg
Definition stats_tree_priv.h:118
int num_columns
Definition stats_tree_priv.h:128
Definition tap-stats_tree.c:35
Definition tap-stats_tree.c:31
Definition mcast_stream.h:30
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
tap_packet_status
Definition tap.h:22