aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_utils.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-12 12:17:09 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:13 +0800
commitd4702862d37659c56c9095bc975a67a5e1bc5495 (patch)
tree32d5d9b407727cea7a1369e39ca6c0022f099593 /openbsc/src/nat/bsc_nat_utils.c
parent57f874ad8d5412c7fbb489dca6972a200354c7bf (diff)
[statistics] Provide basic statistics for the NAT
Count number of SCCP connections, number of BSC reconnects, number of calls. For most of them we have a per BSC and a global count. Right now all structs using the counters survive until the end of the application so we do not need to free them.
Diffstat (limited to 'openbsc/src/nat/bsc_nat_utils.c')
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 3307e68f4..36a64b70c 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -45,6 +45,11 @@ struct bsc_nat *bsc_nat_alloc(void)
INIT_LLIST_HEAD(&nat->sccp_connections);
INIT_LLIST_HEAD(&nat->bsc_connections);
INIT_LLIST_HEAD(&nat->bsc_configs);
+ nat->stats.sccp.conn = counter_alloc("nat.sccp.conn");
+ nat->stats.sccp.calls = counter_alloc("nat.sccp.calls");
+ nat->stats.bsc.reconn = counter_alloc("nat.bsc.conn");
+ nat->stats.bsc.auth_fail = counter_alloc("nat.bsc.auth_fail");
+ nat->stats.msc.reconn = counter_alloc("nat.msc.conn");
return nat;
}
@@ -72,6 +77,10 @@ struct bsc_config *bsc_config_alloc(struct bsc_nat *nat, const char *token, unsi
llist_add(&conf->entry, &nat->bsc_configs);
++nat->num_bsc;
+ conf->stats.sccp.conn = counter_alloc("nat.bsc.sccp.conn");
+ conf->stats.sccp.calls = counter_alloc("nat.bsc.sccp.calls");
+ conf->stats.net.reconn = counter_alloc("nat.bsc.net.reconnects");
+
return conf;
}