aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-22 19:07:32 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-22 20:42:40 +0100
commitffa55a4e8783419f60932ef2f9e872293cf932b9 (patch)
treec615771fe04a89807a012d8e100de53847b70d0f /openbsc/src/gsm_04_08.c
parent4983921af1a84ea20c6be7944bf0ff4928578a69 (diff)
statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code very easily, while having only one routine that stores all of the current counter values to the database. The counters are synced every 60 seconds, providing relatively fine grained statistics about the network usage as time passes by.
Diffstat (limited to 'openbsc/src/gsm_04_08.c')
-rw-r--r--openbsc/src/gsm_04_08.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index f89d8c5a2..2b22122fb 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -831,7 +831,7 @@ int gsm0408_loc_upd_rej(struct gsm_lchan *lchan, u_int8_t cause)
DEBUGP(DMM, "-> LOCATION UPDATING REJECT on channel: %d\n", lchan->nr);
- bts->network->stats.loc_upd_resp.reject++;
+ counter_inc(bts->network->stats.loc_upd_resp.reject);
return gsm48_sendmsg(msg, NULL);
}
@@ -860,7 +860,7 @@ int gsm0408_loc_upd_acc(struct gsm_lchan *lchan, u_int32_t tmsi)
DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
- bts->network->stats.loc_upd_resp.accept++;
+ counter_inc(bts->network->stats.loc_upd_resp.accept);
return gsm48_sendmsg(msg, NULL);
}
@@ -982,13 +982,13 @@ static int mm_rx_loc_upd_req(struct msgb *msg)
switch (lu->type) {
case GSM48_LUPD_NORMAL:
- bts->network->stats.loc_upd_type.normal++;
+ counter_inc(bts->network->stats.loc_upd_type.normal);
break;
case GSM48_LUPD_IMSI_ATT:
- bts->network->stats.loc_upd_type.attach++;
+ counter_inc(bts->network->stats.loc_upd_type.attach);
break;
case GSM48_LUPD_PERIODIC:
- bts->network->stats.loc_upd_type.periodic++;
+ counter_inc(bts->network->stats.loc_upd_type.periodic);
break;
}
@@ -1318,7 +1318,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct msgb *msg)
DEBUGP(DMM, "IMSI DETACH INDICATION: mi_type=0x%02x MI(%s): ",
mi_type, mi_string);
- bts->network->stats.loc_upd_type.detach++;
+ counter_inc(bts->network->stats.loc_upd_type.detach);
switch (mi_type) {
case GSM_MI_TYPE_TMSI: