diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-06-27 10:44:46 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-22 17:02:43 +0200 |
commit | 25049b93b1363246b4099f2dca748b191ae1742d (patch) | |
tree | fa42a307072324d0e8311f7ffe16b849d81cd6a1 /openbsc | |
parent | 7dd498de6423e2a7668b75730ae9daeac50da389 (diff) |
gprs: Add counters related to LLC layer patching
This commit adds the following counters:
- attach-reqs: Number of Attach Request messages
- attach-rejs: Number of Attach Reject messages
- tlli-cache: Size of the TLLI cache
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 15 | ||||
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.ok | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 89ed84e12..88f727ed2 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -109,6 +109,9 @@ enum gbprox_peer_ctr { GBPROX_PEER_CTR_APN_PATCHED, GBPROX_PEER_CTR_PATCH_CRYPT_ERR, GBPROX_PEER_CTR_PATCH_ERR, + GBPROX_PEER_CTR_ATTACH_REQS, + GBPROX_PEER_CTR_ATTACH_REJS, + GBPROX_PEER_CTR_TLLI_CACHE_SIZE, }; static const struct rate_ctr_desc peer_ctr_description[] = { @@ -122,6 +125,9 @@ static const struct rate_ctr_desc peer_ctr_description[] = { { "apn-mod.sgsn", "APN patched " }, { "mod-crypt-err", "Patch error: encrypted " }, { "mod-err", "Patch error: other " }, + { "attach-reqs", "Attach Request count " }, + { "attach-rejs", "Attach Reject count " }, + { "tlli-cache", "TLLI cache size " }, }; static const struct rate_ctr_group_desc peer_ctrg_desc = { @@ -639,6 +645,10 @@ static void gbprox_register_tlli(struct gbprox_peer *peer, uint32_t tlli, OSMO_ASSERT(tlli_info->mi_data != NULL); memcpy(tlli_info->mi_data, imsi, imsi_len); } + + /* TODO: Hack??? */ + peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current = + state->enabled_tllis_count; } static void gbprox_unregister_tlli(struct gbprox_peer *peer, uint32_t tlli) @@ -1023,6 +1033,7 @@ static int gbprox_patch_dtap(struct msgb *msg, uint8_t *data, size_t data_len, switch (g48h->msg_type) { case GSM48_MT_GMM_ATTACH_REQ: + rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_REQS]); return gbprox_patch_gmm_attach_req(msg, data, data_len, peer, to_bss, len_change); @@ -1032,6 +1043,10 @@ static int gbprox_patch_dtap(struct msgb *msg, uint8_t *data, size_t data_len, return gbprox_patch_gmm_attach_ack(msg, data, data_len, peer, to_bss, len_change); + case GSM48_MT_GMM_ATTACH_REJ: + rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_REJS]); + break; + case GSM48_MT_GMM_RA_UPD_REQ: if (!patching_is_enabled(GBPROX_PATCH_LLC_GMM)) break; diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index fb8991c2d..58f49517f 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -1678,6 +1678,8 @@ Peers: RAID patched (BSS ): 9 RAID patched (SGSN): 3 APN patched : 2 + Attach Request count : 1 + TLLI cache size : 2 --- Bad cases --- TLLI is already detached, shouldn't patch @@ -1714,5 +1716,7 @@ Peers: RAID patched (BSS ): 10 RAID patched (SGSN): 3 APN patched : 2 + Attach Request count : 1 + TLLI cache size : 2 ===== GbProxy test END |