Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions
stats_tree.h File Reference
#include <epan/epan.h>
#include <epan/packet_info.h>
#include <epan/tap.h>
#include <epan/stat_groups.h>
#include "ws_symbol_export.h"

Go to the source code of this file.

Macros

#define STAT_TREE_ROOT   "root"
 
#define STATS_TREE_MENU_SEPARATOR   "//"
 
#define ST_FLG_AVERAGE   0x10000000 /* Calculate averages for nodes, rather than totals */
 
#define ST_FLG_ROOTCHILD   0x20000000 /* This node is a direct child of the root node */
 
#define ST_FLG_DEF_NOEXPAND   0x01000000 /* This node should not be expanded by default */
 
#define ST_FLG_SORT_DESC   0x00800000 /* When sorting, sort ascending instead of descending */
 
#define ST_FLG_SORT_TOP   0x00400000 /* When sorting always keep these lines on of list */
 
#define ST_FLG_SRTCOL_MASK   0x000F0000 /* Mask for sort column ID */
 
#define ST_FLG_SRTCOL_SHIFT   16 /* Number of bits to shift masked result */
 
#define ST_FLG_MASK
 
#define ST_SORT_COL_NAME   1 /* Sort nodes by node names */
 
#define ST_SORT_COL_COUNT   2 /* Sort nodes by node count */
 
#define ST_SORT_COL_AVG   3 /* Sort nodes by node average */
 
#define ST_SORT_COL_MIN   4 /* Sort nodes by minimum node value */
 
#define ST_SORT_COL_MAX   5 /* Sort nodes by maximum node value */
 
#define ST_SORT_COL_BURSTRATE   6 /* Sort nodes by burst rate */
 
#define stats_tree_tick_range_by_pname(st, name, parent_name, value_in_range)    stats_tree_tick_range((st),(name),stats_tree_parent_id_by_name((st),(parent_name),(value_in_range)))
 
#define increase_stat_node(st, name, parent_id, with_children, value)    (stats_tree_manip_node_int(MN_INCREASE,(st),(name),(parent_id),(with_children),(value)))
 
#define tick_stat_node(st, name, parent_id, with_children)    (stats_tree_manip_node_int(MN_INCREASE,(st),(name),(parent_id),(with_children),1))
 
#define set_stat_node(st, name, parent_id, with_children, value)    (stats_tree_manip_node_int(MN_SET,(st),(name),(parent_id),(with_children),value))
 
#define zero_stat_node(st, name, parent_id, with_children)    (stats_tree_manip_node_int(MN_SET,(st),(name),(parent_id),(with_children),0))
 
#define avg_stat_node_add_value_notick(st, name, parent_id, with_children, value)    (stats_tree_manip_node_int(MN_AVERAGE_NOTICK,(st),(name),(parent_id),(with_children),value))
 
#define avg_stat_node_add_value_int(st, name, parent_id, with_children, value)    (stats_tree_manip_node_int(MN_AVERAGE,(st),(name),(parent_id),(with_children),value))
 
#define avg_stat_node_add_value_float(st, name, parent_id, with_children, value)    (stats_tree_manip_node_float(MN_AVERAGE,(st),(name),(parent_id),(with_children),value))
 
#define stat_node_set_flags(st, name, parent_id, with_children, flags)    (stats_tree_manip_node_int(MN_SET_FLAGS,(st),(name),(parent_id),(with_children),flags))
 
#define stat_node_clear_flags(st, name, parent_id, with_children, flags)    (stats_tree_manip_node_int(MN_CLEAR_FLAGS,(st),(name),(parent_id),(with_children),flags))
 

Typedefs

typedef struct _stats_tree stats_tree
 
typedef tap_packet_status(* stat_tree_packet_cb) (stats_tree *, packet_info *, epan_dissect_t *, const void *, tap_flags_t flags)
 
typedef void(* stat_tree_init_cb) (stats_tree *)
 
typedef void(* stat_tree_cleanup_cb) (stats_tree *)
 
typedef enum _stat_node_datatype stat_node_datatype
 
typedef struct _stats_tree_cfg stats_tree_cfg
 
typedef enum _manip_node_mode manip_node_mode
 

Enumerations

enum  _stat_node_datatype { STAT_DT_INT , STAT_DT_FLOAT }
 
enum  _manip_node_mode {
  MN_INCREASE , MN_SET , MN_AVERAGE , MN_AVERAGE_NOTICK ,
  MN_SET_FLAGS , MN_CLEAR_FLAGS
}
 

Functions

WS_DLL_PUBLIC stats_tree_cfgstats_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)
 
WS_DLL_PUBLIC stats_tree_cfgstats_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)
 
WS_DLL_PUBLIC void stats_tree_set_group (stats_tree_cfg *st_config, register_stat_group_t stat_group)
 
WS_DLL_PUBLIC void stats_tree_set_first_column_name (stats_tree_cfg *st_config, const char *column_name)
 
WS_DLL_PUBLIC int stats_tree_parent_id_by_name (stats_tree *st, const char *parent_name)
 
WS_DLL_PUBLIC int stats_tree_create_node (stats_tree *st, const char *name, int parent_id, stat_node_datatype datatype, bool with_children)
 
WS_DLL_PUBLIC int stats_tree_create_node_by_pname (stats_tree *st, const char *name, const char *parent_name, stat_node_datatype datatype, bool with_children)
 
WS_DLL_PUBLIC int stats_tree_create_range_node (stats_tree *st, const char *name, int parent_id,...)
 
WS_DLL_PUBLIC int stats_tree_create_range_node_string (stats_tree *st, const char *name, int parent_id, int num_str_ranges, char **str_ranges)
 
WS_DLL_PUBLIC int stats_tree_range_node_with_pname (stats_tree *st, const char *name, const char *parent_name,...)
 
WS_DLL_PUBLIC int stats_tree_tick_range (stats_tree *st, const char *name, int parent_id, int value_in_range)
 
WS_DLL_PUBLIC int stats_tree_create_pivot (stats_tree *st, const char *name, int parent_id)
 
WS_DLL_PUBLIC int stats_tree_create_pivot_by_pname (stats_tree *st, const char *name, const char *parent_name)
 
WS_DLL_PUBLIC int stats_tree_tick_pivot (stats_tree *st, int pivot_id, const char *pivot_value)
 
void stats_tree_cleanup (void)
 
WS_DLL_PUBLIC int stats_tree_manip_node_int (manip_node_mode mode, stats_tree *st, const char *name, int parent_id, bool with_children, int value)
 
WS_DLL_PUBLIC int stats_tree_manip_node_float (manip_node_mode mode, stats_tree *st, const char *name, int parent_id, bool with_children, float value)
 

Detailed Description

A counter tree API for Wireshark dissectors 2005, Luis E. G. Ontanon

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Macro Definition Documentation

◆ ST_FLG_MASK

#define ST_FLG_MASK
Value:
(ST_FLG_AVERAGE|ST_FLG_ROOTCHILD|ST_FLG_DEF_NOEXPAND| \
ST_FLG_SORT_TOP|ST_FLG_SORT_DESC|ST_FLG_SRTCOL_MASK)

Function Documentation

◆ stats_tree_register()

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 
)

Registers a new stats tree with default group REGISTER_STAT_GROUP_UNSORTED.

Parameters
abbrtree abbr (used for tshark -z option)
pathtree display name in GUI menu and window (use "//" for submenus)
flagstap listener flags for per-packet callback
packetper packet callback
inittree initialization callback
cleanupcleanup callback
Returns
A stats tree configuration pointer.

◆ stats_tree_register_plugin()

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 
)

Registers a new stats tree with default group REGISTER_STAT_GROUP_UNSORTED from a plugin.

Parameters
abbrtree abbr (used for tshark -z option)
pathtree display name in GUI menu and window (use "//" for submenus)
flagstap listener flags for per-packet callback
packetper packet callback
inittree initialization callback
cleanupcleanup callback
Returns
A stats tree configuration pointer.

◆ stats_tree_set_first_column_name()

WS_DLL_PUBLIC void stats_tree_set_first_column_name ( stats_tree_cfg st_config,
const char *  column_name 
)

Set the name a stats tree's first column. Default is "Topic / Item".

Parameters
column_nameThe new column name.

◆ stats_tree_set_group()

WS_DLL_PUBLIC void stats_tree_set_group ( stats_tree_cfg st_config,
register_stat_group_t  stat_group 
)

Set the menu statistics group for a stats tree.

Parameters
stat_groupA menu group.