26RCSIDH(stats_h,
"$Id: c1e479c383495da6bd4f59009d93c09298a87de0 $")
28#include <freeradius-devel/util/pair.h>
59#define STATS_HEADER_COMMON \
60 fr_stats_link_t const *def
91#define FR_STATS_TYPEDEF(_name) \
93 STATS_HEADER_COMMON; \
94 fr_stats_ ## _name ## _t stats; \
95 } fr_stats_ ## _name ## _instance_t
103#define FR_STATS_LINK_NAME(_name) fr_stats_link_ ## _name ## _t
112#define FR_STATS_ENTRY_DECL(_name, _var) fr_stats_ ## _name ## _instance_t _var
121#define FR_STATS_ENTRY_INIT(_name, _var, _mib) \
122 _var = (fr_stats_ ## _name ## _instance_t) { \
123 .def = fr_stats_link_ ## _name ## _t, \
125 fr_stats_ ## _name ## _t stats = {}, \
134#define FR_STATS_INC(_var, _field) ((_var)->stats.(_field))++
140#define FR_STATS_FIELD(_var, _field) (_var)->stats.(_field)
fr_dict_attr_t const ** root_p
point to the autoload definition of the DA for this structure
size_t size
size of this field
int fr_stats_index_to_value_box(TALLOC_CTX *ctx, fr_value_box_t **out, fr_stats_instance_t const *in, unsigned int index)
Convert the statistic at an index to a value-box.
size_t size
overall size of the structure
int fr_stats_to_pairs(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_stats_instance_t const *in)
Convert a statistics structure to fr_pair_t.
fr_type_t type
cached for locality and simplicity
size_t offset
from the start of the struct
STATS_HEADER_COMMON
common header
int fr_stats_iter_to_value_box(TALLOC_CTX *ctx, fr_value_box_t **out, fr_stats_iter_t *iter)
Convert the statistic at the current iterator to a value-box.
bool fr_stats_iter_next(fr_stats_iter_t *iter)
Go to the next entry in a structure.
char const * name
name of the stats structure
void fr_stats_iter_init(fr_stats_instance_t const *in, fr_stats_iter_t *iter)
Initialize an iterator over a structure.
size_t num_elements
number of elements in the table. Note no "NULL" terminator
int fr_stats_from_pairs(TALLOC_CTX *ctx, fr_stats_instance_t *out, fr_pair_list_t const *list)
Convert a statistics structure to fr_pair_t.
int fr_stats_merge_instance(fr_stats_instance_t *out, fr_stats_instance_t const *in)
Public API for merging two statistics structures.
char const * mib
MIB root.
int fr_stats_merge_value_box(fr_value_box_t *dst, fr_value_box_t const *src)
Public API for merging two value-boxes based on their enums.
fr_dict_attr_t const ** da_p
point to the autoload definition of the DA for this field
int fr_stats_name_to_value_box(TALLOC_CTX *ctx, fr_value_box_t **out, fr_stats_instance_t const *inst, char const *name)
Convert the statistic of a given name to a value-box.
fr_stats_instance_t const * inst
Generic statistics structure.
Iterator for a statistics structure.
Link a struct entry to an autoloaded fr_dict_attr_t.
eap_aka_sim_process_conf_t * inst
static size_t char ** out