11 #ifndef __STATS_TREE_H
12 #define __STATS_TREE_H
19 #include "ws_symbol_export.h"
25 #define STAT_TREE_ROOT "root"
26 #define STATS_TREE_MENU_SEPARATOR "//"
28 #define ST_FLG_AVERAGE 0x10000000
29 #define ST_FLG_ROOTCHILD 0x20000000
30 #define ST_FLG_DEF_NOEXPAND 0x01000000
31 #define ST_FLG_SORT_DESC 0x00800000
32 #define ST_FLG_SORT_TOP 0x00400000
33 #define ST_FLG_SRTCOL_MASK 0x000F0000
34 #define ST_FLG_SRTCOL_SHIFT 16
36 #define ST_FLG_MASK (ST_FLG_AVERAGE|ST_FLG_ROOTCHILD|ST_FLG_DEF_NOEXPAND| \
37 ST_FLG_SORT_TOP|ST_FLG_SORT_DESC|ST_FLG_SRTCOL_MASK)
39 #define ST_SORT_COL_NAME 1
40 #define ST_SORT_COL_COUNT 2
41 #define ST_SORT_COL_AVG 3
42 #define ST_SORT_COL_MIN 4
43 #define ST_SORT_COL_MAX 5
44 #define ST_SORT_COL_BURSTRATE 6
57 typedef void (*stat_tree_init_cb)(
stats_tree *);
60 typedef void (*stat_tree_cleanup_cb)(
stats_tree *);
62 typedef enum _stat_node_datatype {
83 stat_tree_packet_cb
packet,
84 stat_tree_init_cb init,
85 stat_tree_cleanup_cb cleanup);
101 stat_tree_packet_cb
packet,
102 stat_tree_init_cb init,
103 stat_tree_cleanup_cb cleanup);
119 WS_DLL_PUBLIC
int stats_tree_parent_id_by_name(
stats_tree *st,
const char *parent_name);
128 WS_DLL_PUBLIC
int stats_tree_create_node(
stats_tree *st,
135 WS_DLL_PUBLIC
int stats_tree_create_node_by_pname(
stats_tree *st,
137 const char *parent_name,
146 WS_DLL_PUBLIC
int stats_tree_create_range_node(
stats_tree *st,
151 WS_DLL_PUBLIC
int stats_tree_create_range_node_string(
stats_tree *st,
157 WS_DLL_PUBLIC
int stats_tree_range_node_with_pname(
stats_tree *st,
159 const char *parent_name,
163 WS_DLL_PUBLIC
int stats_tree_tick_range(
stats_tree *st,
168 #define stats_tree_tick_range_by_pname(st,name,parent_name,value_in_range) \
169 stats_tree_tick_range((st),(name),stats_tree_parent_id_by_name((st),(parent_name),(value_in_range)))
172 WS_DLL_PUBLIC
int stats_tree_create_pivot(
stats_tree *st,
176 WS_DLL_PUBLIC
int stats_tree_create_pivot_by_pname(
stats_tree *st,
178 const char *parent_name);
180 WS_DLL_PUBLIC
int stats_tree_tick_pivot(
stats_tree *st,
182 const char *pivot_value);
184 extern void stats_tree_cleanup(
void);
193 typedef enum _manip_node_mode {
201 WS_DLL_PUBLIC
int stats_tree_manip_node_int(manip_node_mode mode,
208 WS_DLL_PUBLIC
int stats_tree_manip_node_float(manip_node_mode mode,
215 #define increase_stat_node(st,name,parent_id,with_children,value) \
216 (stats_tree_manip_node_int(MN_INCREASE,(st),(name),(parent_id),(with_children),(value)))
218 #define tick_stat_node(st,name,parent_id,with_children) \
219 (stats_tree_manip_node_int(MN_INCREASE,(st),(name),(parent_id),(with_children),1))
221 #define set_stat_node(st,name,parent_id,with_children,value) \
222 (stats_tree_manip_node_int(MN_SET,(st),(name),(parent_id),(with_children),value))
224 #define zero_stat_node(st,name,parent_id,with_children) \
225 (stats_tree_manip_node_int(MN_SET,(st),(name),(parent_id),(with_children),0))
234 #define avg_stat_node_add_value_notick(st,name,parent_id,with_children,value) \
235 (stats_tree_manip_node_int(MN_AVERAGE_NOTICK,(st),(name),(parent_id),(with_children),value))
238 #define avg_stat_node_add_value_int(st,name,parent_id,with_children,value) \
239 (stats_tree_manip_node_int(MN_AVERAGE,(st),(name),(parent_id),(with_children),value))
241 #define avg_stat_node_add_value_float(st,name,parent_id,with_children,value) \
242 (stats_tree_manip_node_float(MN_AVERAGE,(st),(name),(parent_id),(with_children),value))
245 #define stat_node_set_flags(st,name,parent_id,with_children,flags) \
246 (stats_tree_manip_node_int(MN_SET_FLAGS,(st),(name),(parent_id),(with_children),flags))
249 #define stat_node_clear_flags(st,name,parent_id,with_children,flags) \
250 (stats_tree_manip_node_int(MN_CLEAR_FLAGS,(st),(name),(parent_id),(with_children),flags))
enum register_stat_group_e register_stat_group_t
WS_DLL_PUBLIC void stats_tree_set_first_column_name(stats_tree_cfg *st_config, const char *column_name)
Definition: stats_tree.c:338
WS_DLL_PUBLIC void stats_tree_set_group(stats_tree_cfg *st_config, register_stat_group_t stat_group)
Definition: stats_tree.c:331
WS_DLL_PUBLIC stats_tree_cfg * stats_tree_register_plugin(const char *tapname, const char *abbr, const char *path, unsigned flags, stat_tree_packet_cb packet, stat_tree_init_cb init, stat_tree_cleanup_cb cleanup)
Definition: stats_tree.c:318
WS_DLL_PUBLIC stats_tree_cfg * stats_tree_register(const char *tapname, const char *abbr, const char *path, unsigned flags, stat_tree_packet_cb packet, stat_tree_init_cb init, stat_tree_cleanup_cb cleanup)
Definition: stats_tree.c:277
Definition: packet_info.h:44
Definition: stats_tree_priv.h:136
unsigned flags
Definition: stats_tree_priv.h:152
stat_tree_packet_cb packet
Definition: stats_tree_priv.h:147
Definition: stats_tree_priv.h:102
Definition: packet-epl-profile-parser.c:83
Definition: epan_dissect.h:28
tap_packet_status
Definition: tap.h:25