rate_ctr: Store the numeric index as part of 'rate_ctr_group'
authorHarald Welte <laforge@gnumonks.org>
Thu, 13 May 2010 10:16:17 +0000 (12:16 +0200)
committerHarald Welte <laforge@gnumonks.org>
Thu, 13 May 2010 10:16:17 +0000 (12:16 +0200)
include/osmocore/rate_ctr.h
src/rate_ctr.c

index c6a1ace..47fd5a3 100644 (file)
@@ -49,6 +49,7 @@ struct rate_ctr_group {
        struct llist_head list;
        /* Pointer to the counter group class */
        const struct rate_ctr_group_desc *desc;
+       unsigned int idx;
        /* The name prefix generated from desc->group_prefix_fmt and index */
        char *name_prefix;
        /* Actual counter structures below */
index 9b2459e..bde090a 100644 (file)
@@ -51,6 +51,7 @@ struct rate_ctr_group *rate_ctr_group_alloc(void *ctx,
                return NULL;
 
        group->desc = desc;
+       group->idx = idx;
        /* Generate the Group prefix from the user-specified index */
        group->name_prefix = talloc_size(group, strlen(desc->group_prefix_fmt) + 20);
        sprintf(group->name_prefix, desc->group_prefix_fmt, idx);