aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-13 12:16:17 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-13 12:16:17 +0200
commit087fcff9a5342f7a10c9f378bd4130f409657001 (patch)
tree35ec23d57187fe940262be48ca6924f0c66f1d42
parent7b45d608872f17ab8b71d53a2d87e5f8d621b007 (diff)
rate_ctr: Store the numeric index as part of 'rate_ctr_group'
-rw-r--r--include/osmocore/rate_ctr.h1
-rw-r--r--src/rate_ctr.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocore/rate_ctr.h b/include/osmocore/rate_ctr.h
index c6a1ace..47fd5a3 100644
--- a/include/osmocore/rate_ctr.h
+++ b/include/osmocore/rate_ctr.h
@@ -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 */
diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 9b2459e..bde090a 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -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);