libosmocore  0.6.3
Osmocom core library
rate_ctr.c File Reference
#include <stdint.h>
#include <string.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>

Functions

static LLIST_HEAD (rate_ctr_groups)
struct rate_ctr_grouprate_ctr_group_alloc (void *ctx, const struct rate_ctr_group_desc *desc, unsigned int idx)
 Allocate a new group of counters according to description.
void rate_ctr_group_free (struct rate_ctr_group *grp)
 Free the memory for the specified group of counters.
void rate_ctr_add (struct rate_ctr *ctr, int inc)
 Add a number to the counter.
static void interval_expired (struct rate_ctr *ctr, enum rate_ctr_intv intv)
static void rate_ctr_group_intv (struct rate_ctr_group *grp)
static void rate_ctr_timer_cb (void *data)
int rate_ctr_init (void *tall_ctx)
 Initialize the counter module.
struct rate_ctr_grouprate_ctr_get_group_by_name_idx (const char *name, const unsigned int idx)
 Search for counter group based on group name and index.
struct rate_ctrrate_ctr_get_by_name (const struct rate_ctr_group *ctrg, const char *name)
 Search for counter group based on group name.

Variables

static void * tall_rate_ctr_ctx
static struct osmo_timer_list rate_ctr_timer
static uint64_t timer_ticks

Detailed Description