Wireshark  4.3.0
The Wireshark network protocol analyzer
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
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 #define INDENT_MAX 32
23 #define NUM_BUF_SIZE 32
24 
27 typedef struct _st_node_pres st_node_pres;
28 
31 typedef struct _tree_pres tree_pres;
32 
35 typedef struct _tree_cfg_pres tree_cfg_pres;
36 
37 
38 typedef struct _stat_node stat_node;
39 typedef struct _stats_tree_cfg stats_tree_cfg;
40 
41 typedef struct _range_pair {
42  gint floor;
43  gint ceil;
44 } range_pair_t;
45 
46 typedef struct _burst_bucket burst_bucket;
47 struct _burst_bucket {
48  burst_bucket *next;
49  burst_bucket *prev;
50  gint count;
51  double bucket_no;
52  double start_time;
53 };
54 
55 struct _stat_node {
56  gchar* name;
57  int id;
58  stat_node_datatype datatype;
59 
61  gint counter;
63  union {
64  gint64 int_total;
65  gdouble float_total;
66  } total;
67  union {
68  gint int_min;
69  gfloat float_min;
70  } minvalue;
71  union {
72  gint int_max;
73  gfloat float_max;
74  } maxvalue;
75 
76  gint st_flags;
77 
79  gint bcount;
80  burst_bucket *bh, *bt;
81  gint max_burst;
82  double burst_time;
83 
85  GHashTable *hash;
86 
89 
92  stat_node *children;
93  stat_node *next;
94 
97 
100 };
101 
102 struct _stats_tree {
105 
106  char *filter;
107 
108  /* times */
109  double start;
110  double elapsed;
111  double now;
112 
113  int st_flags;
114  gint num_columns;
115  gchar *display_name;
116 
121  GHashTable *names;
122 
124  GPtrArray *parents;
125 
131 
134 };
135 
137  gchar* abbr;
138  gchar* name;
139  gchar* tapname;
140  register_stat_group_t stat_group;
141 
142  gboolean plugin;
143 
145  stat_tree_packet_cb packet;
146  stat_tree_init_cb init;
147  stat_tree_cleanup_cb cleanup;
148 
150  guint flags;
151 
152  /*
153  * node presentation callbacks
154  */
155 
158 
163 
164 
165  tree_pres *(*new_tree_pr)(stats_tree*);
166  void (*free_tree_pr)(stats_tree*);
167 
169  guint st_flags;
170 };
171 
172 /* guess what, this is it! */
173 WS_DLL_PUBLIC void stats_tree_presentation(void (*registry_iterator)(gpointer,gpointer,gpointer),
174  void (*setup_node_pr)(stat_node*),
175  void (*free_tree_pr)(stats_tree*),
176  void *data);
177 
178 WS_DLL_PUBLIC stats_tree *stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter);
179 
181 WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void*, packet_info*, epan_dissect_t*, const void *, tap_flags_t flags);
182 
184 WS_DLL_PUBLIC void stats_tree_reset(void *p_st);
185 
187 WS_DLL_PUBLIC void stats_tree_reinit(void *p_st);
188 
189 /* callback for destoy */
190 WS_DLL_PUBLIC void stats_tree_free(stats_tree *st);
191 
194 WS_DLL_PUBLIC gchar *stats_tree_get_abbr(const gchar *ws_optarg);
195 
197 WS_DLL_PUBLIC stats_tree_cfg *stats_tree_get_cfg_by_abbr(const char *abbr);
198 
201 WS_DLL_PUBLIC GList *stats_tree_get_cfg_list(void);
202 
204 WS_DLL_PUBLIC guint stats_tree_branch_max_namelen(const stat_node *node, guint indent);
205 
208 WS_DLL_PUBLIC gchar *stats_tree_node_to_str(const stat_node *node,
209  gchar *buffer, guint len);
210 
214 WS_DLL_PUBLIC gchar* stats_tree_get_displayname (gchar* fullname);
215 
217 WS_DLL_PUBLIC gint stats_tree_get_default_sort_col (stats_tree *st);
218 
220 WS_DLL_PUBLIC gboolean stats_tree_is_default_sort_DESC (stats_tree *st);
221 
223 WS_DLL_PUBLIC const gchar* stats_tree_get_column_name (gint col_index);
224 
226 WS_DLL_PUBLIC gint stats_tree_get_column_size (gint col_index);
227 
230 WS_DLL_PUBLIC gchar** stats_tree_get_values_from_node (const stat_node* node);
231 
233 WS_DLL_PUBLIC gint stats_tree_sort_compare (const stat_node *a,
234  const stat_node *b,
235  gint sort_column,
236  gboolean sort_descending);
237 
239 WS_DLL_PUBLIC gint stat_node_array_sortcmp (gconstpointer a,
240  gconstpointer b,
241  gpointer user_data);
242 
244 WS_DLL_PUBLIC GString* stats_tree_format_as_str(const stats_tree* st,
245  st_format_type format_type,
246  gint sort_column,
247  gboolean sort_descending);
248 
250 WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node,
251  GString *s,
252  st_format_type format_type,
253  guint indent,
254  const gchar *path,
255  gint maxnamelen,
256  gint sort_column,
257  gboolean sort_descending);
258 
259 #ifdef __cplusplus
260 }
261 #endif /* __cplusplus */
262 
263 #endif /* __STATS_TREE_PRIV_H */
enum _st_format_type st_format_type
enum register_stat_group_e register_stat_group_t
WS_DLL_PUBLIC stats_tree_cfg * stats_tree_get_cfg_by_abbr(const char *abbr)
Definition: stats_tree.c:395
WS_DLL_PUBLIC gint stats_tree_get_column_size(gint col_index)
Definition: stats_tree.c:1087
WS_DLL_PUBLIC GString * stats_tree_format_as_str(const stats_tree *st, st_format_type format_type, gint sort_column, gboolean sort_descending)
Definition: stats_tree.c:1297
WS_DLL_PUBLIC gint stats_tree_sort_compare(const stat_node *a, const stat_node *b, gint sort_column, gboolean sort_descending)
Definition: stats_tree.c:1180
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:379
WS_DLL_PUBLIC gchar * stats_tree_get_abbr(const gchar *ws_optarg)
WS_DLL_PUBLIC gint stats_tree_get_default_sort_col(stats_tree *st)
Definition: stats_tree.c:1034
WS_DLL_PUBLIC void stats_tree_reinit(void *p_st)
Definition: stats_tree.c:206
WS_DLL_PUBLIC const gchar * stats_tree_get_column_name(gint col_index)
Definition: stats_tree.c:1060
WS_DLL_PUBLIC gint stat_node_array_sortcmp(gconstpointer a, gconstpointer b, gpointer user_data)
Definition: stats_tree.c:1371
WS_DLL_PUBLIC gchar * stats_tree_get_displayname(gchar *fullname)
Definition: stats_tree.c:1009
WS_DLL_PUBLIC gboolean stats_tree_is_default_sort_DESC(stats_tree *st)
Definition: stats_tree.c:1054
WS_DLL_PUBLIC GList * stats_tree_get_cfg_list(void)
Definition: stats_tree.c:411
WS_DLL_PUBLIC void stats_tree_reset(void *p_st)
Definition: stats_tree.c:194
WS_DLL_PUBLIC gchar * stats_tree_node_to_str(const stat_node *node, gchar *buffer, guint len)
Definition: stats_tree.c:54
WS_DLL_PUBLIC guint stats_tree_branch_max_namelen(const stat_node *node, guint indent)
Definition: stats_tree.c:65
WS_DLL_PUBLIC void stats_tree_format_node_as_str(const stat_node *node, GString *s, st_format_type format_type, guint indent, const gchar *path, gint maxnamelen, gint sort_column, gboolean sort_descending)
Definition: stats_tree.c:1389
WS_DLL_PUBLIC gchar ** stats_tree_get_values_from_node(const stat_node *node)
Definition: stats_tree.c:1099
Definition: stats_tree_priv.h:47
Definition: packet_info.h:44
Definition: plugins.c:29
Definition: stats_tree_priv.h:41
Definition: tap-stats_tree.c:26
Definition: stats_tree_priv.h:55
gint counter
Definition: stats_tree_priv.h:61
GHashTable * hash
Definition: stats_tree_priv.h:85
stats_tree * st
Definition: stats_tree_priv.h:88
union _stat_node::@466 total
st_node_pres * pr
Definition: stats_tree_priv.h:99
stat_node * parent
Definition: stats_tree_priv.h:91
range_pair_t * rng
Definition: stats_tree_priv.h:96
gint bcount
Definition: stats_tree_priv.h:79
Definition: stats_tree_priv.h:136
guint flags
Definition: stats_tree_priv.h:150
tree_cfg_pres * pr
Definition: stats_tree_priv.h:162
stat_tree_packet_cb packet
Definition: stats_tree_priv.h:145
guint st_flags
Definition: stats_tree_priv.h:169
void(* setup_node_pr)(stat_node *)
Definition: stats_tree_priv.h:157
Definition: stats_tree_priv.h:102
GHashTable * names
Definition: stats_tree_priv.h:121
stat_node root
Definition: stats_tree_priv.h:133
GPtrArray * parents
Definition: stats_tree_priv.h:124
tree_pres * pr
Definition: stats_tree_priv.h:130
stats_tree_cfg * cfg
Definition: stats_tree_priv.h:104
Definition: tap-stats_tree.c:34
Definition: tap-stats_tree.c:30
Definition: mcast_stream.h:30
Definition: packet-epl-profile-parser.c:83
Definition: epan_dissect.h:28
tap_packet_status
Definition: tap.h:25