From 463dc62ae47a803a2df331b1be6f5bc7988f71ba Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 3 Oct 2010 19:41:42 +0800 Subject: nat: Provide statistics about amount of different messages. Provide simple statistics on how many LUs, Paging Responses etc. we are seeing in the network. --- openbsc/src/nat/bsc_nat.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'openbsc/src/nat/bsc_nat.c') diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 4df77589a..da85456a8 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -758,6 +758,21 @@ static void ipaccess_auth_bsc(struct tlv_parsed *tvp, struct bsc_connection *bsc bsc->write_queue.bfd.fd); } +static void handle_con_stats(struct sccp_connections *con) +{ + struct rate_ctr_group *ctrg; + int id = bsc_conn_type_to_ctr(con); + + if (id == -1) + return; + + if (!con->bsc || !con->bsc->cfg) + return; + + ctrg = con->bsc->cfg->stats.ctrg; + rate_ctr_inc(&ctrg->ctr[id]); +} + static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) { int con_filter = 0; @@ -809,6 +824,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) con->con_type = con_type; con->imsi_checked = filter; con_bsc = con->bsc; + handle_con_stats(con); break; case SCCP_MSG_TYPE_RLSD: case SCCP_MSG_TYPE_CREF: -- cgit v1.2.3