diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-18 22:20:46 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-08 01:01:43 +0100 |
commit | 6d804b1a7e375213cb4b3e437c2b9b8c68872164 (patch) | |
tree | 226c66c67e1d2181e545cb21f83234b90b051a99 /openbsc/src/libbsc/gsm_04_08_utils.c | |
parent | abf53d87b6648f2d42562c5699e9035afd92e608 (diff) |
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
Diffstat (limited to 'openbsc/src/libbsc/gsm_04_08_utils.c')
-rw-r--r-- | openbsc/src/libbsc/gsm_04_08_utils.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c index 98f079078..4a53b31e5 100644 --- a/openbsc/src/libbsc/gsm_04_08_utils.c +++ b/openbsc/src/libbsc/gsm_04_08_utils.c @@ -283,7 +283,7 @@ int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, } int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct gsm_subscriber *subscr) + struct msgb *msg, struct bsc_subscr *bsub) { struct gsm_bts *bts = msg->lchan->ts->trx->bts; struct gsm48_hdr *gh = msgb_l3(msg); @@ -292,22 +292,24 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, if (is_siemens_bts(bts)) send_siemens_mrpci(msg->lchan, classmark2_lv); - if (!conn->subscr) { - conn->subscr = subscr; - } else if (conn->subscr != subscr) { - LOGP(DRR, LOGL_ERROR, "<- Channel already owned by someone else?\n"); - subscr_put(subscr); + if (!conn->bsub) { + conn->bsub = bsub; + } else if (conn->bsub != bsub) { + LOGP(DRR, LOGL_ERROR, + "<- Channel already owned by someone else?\n"); + bsc_subscr_put(bsub); return -EINVAL; } else { DEBUGP(DRR, "<- Channel already owned by us\n"); - subscr_put(subscr); - subscr = conn->subscr; + bsc_subscr_put(bsub); + bsub = conn->bsub; } rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED]); /* Stop paging on the bts we received the paging response */ - paging_request_stop(conn->bts, subscr, conn, msg); + paging_request_stop(&bts->network->bts_list, conn->bts, bsub, conn, + msg); return 0; } |