aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_11.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-22 00:41:05 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-22 00:41:05 +0100
commit24ff6ee0a343d46823771b9a86e867780eb2099b (patch)
tree2c8bd4dd014f9a851cbe1de9da39b4389ae6ccca /openbsc/src/gsm_04_11.c
parenta992a36d5f9e7a2d1bb7948784c69ea2e342b7d3 (diff)
keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and performance.
Diffstat (limited to 'openbsc/src/gsm_04_11.c')
-rw-r--r--openbsc/src/gsm_04_11.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 17a58311..579bb55d 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -517,6 +517,8 @@ static int gsm340_rx_tpdu(struct msgb *msg)
u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0;
+ bts->network->stats.sms.submitted++;
+
gsms = sms_alloc();
if (!gsms)
return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
@@ -605,6 +607,7 @@ static int gsm340_rx_tpdu(struct msgb *msg)
gsms->receiver = subscr_get_by_extension(bts->network, gsms->dest_addr);
if (!gsms->receiver) {
rc = 1; /* cause 1: unknown subscriber */
+ bts->network->stats.sms.no_receiver++;
goto out;
}
@@ -791,7 +794,9 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
* to store this in our database and wati for a SMMA message */
/* FIXME */
dispatch_signal(SS_SMS, S_SMS_MEM_EXCEEDED, trans->subscr);
- }
+ trans->lchan->ts->trx->bts->network->stats.sms.rp_err_mem++;
+ } else
+ trans->lchan->ts->trx->bts->network->stats.sms.rp_err_other++;
sms_free(sms);
trans->sms.sms = NULL;
@@ -1064,6 +1069,8 @@ int gsm411_send_sms_lchan(struct gsm_lchan *lchan, struct gsm_sms *sms)
DEBUGP(DSMS, "TX: SMS DELIVER\n");
+ lchan->ts->trx->bts->network->stats.sms.delivered++;
+
return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_DATA_MT, msg_ref);
/* FIXME: enter 'wait for RP-ACK' state, start TR1N */
}