nat: Switch per BSC counters to the rate ctr.
This is switching the simple statistics to the rate counter
and is updating all users...
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 431e640..0f50a2b 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -411,7 +411,9 @@
counter_inc(nat->stats.sccp.calls);
if (con) {
- counter_inc(con->bsc->cfg->stats.sccp.calls);
+ struct rate_ctr_group *ctrg;
+ ctrg = con->bsc->cfg->stats.ctrg;
+ rate_ctr_inc(&ctrg->ctr[BCFG_CTR_SCCP_CALLS]);
if (bsc_mgcp_assign(con, msg) != 0)
LOGP(DNAT, LOGL_ERROR, "Failed to assign...\n");
} else
@@ -639,7 +641,7 @@
llist_for_each_entry(conf, &bsc->nat->bsc_configs, entry) {
if (strcmp(conf->token, token) == 0) {
- counter_inc(conf->stats.net.reconn);
+ rate_ctr_inc(&conf->stats.ctrg->ctr[BCFG_CTR_NET_RECONN]);
bsc->authenticated = 1;
bsc->cfg = conf;
bsc_del_timer(&bsc->id_timeout);
@@ -1111,6 +1113,8 @@
local_addr.s_addr = INADDR_ANY;
handle_options(argc, argv);
+ rate_ctr_init(tall_bsc_ctx);
+
/* init vty and parse */
telnet_init(tall_bsc_ctx, NULL, 4244);
if (mgcp_parse_config(config_file, nat->mgcp_cfg) < 0) {