From ab23a1e05bf1a50a46c4e6636a3af0b6a503241d Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 4 Mar 2017 00:05:49 +0100 Subject: vlr on utran: transmit CommonID Change-Id: Ice3c71f048b097f2c2de8bd4f4508a7ca2cb1cf5 --- openbsc/include/openbsc/vlr.h | 7 ++++--- openbsc/src/libmsc/gsm_04_08.c | 7 +++++++ openbsc/src/libmsc/msc_ifaces.c | 9 ++++++++- openbsc/src/libvlr/vlr.c | 1 + openbsc/src/libvlr/vlr_access_req_fsm.c | 8 ++++++++ openbsc/src/libvlr/vlr_lu_fsm.c | 8 ++++++++ openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err | 4 ++++ openbsc/tests/msc_vlr/msc_vlr_tests.c | 5 +++++ 8 files changed, 45 insertions(+), 4 deletions(-) diff --git a/openbsc/include/openbsc/vlr.h b/openbsc/include/openbsc/vlr.h index b7f5ff9c2..e44425854 100644 --- a/openbsc/include/openbsc/vlr.h +++ b/openbsc/include/openbsc/vlr.h @@ -188,12 +188,13 @@ struct vlr_ops { int (*tx_cm_serv_acc)(void *msc_conn_ref); int (*tx_cm_serv_rej)(void *msc_conn_ref, enum vlr_proc_arq_result result); - /* FIXME: add tx_common_id() for when auth is complete on UTRAN, see - * msc_tx_common_id(conn) */ - int (*set_ciph_mode)(void *msc_conn_ref, enum vlr_ciph ciph_mode, bool retrieve_imeisv); + /* Common Id is transmitted when auth+ciph is complete on UTRAN */ + int (*tx_common_id)(void *msc_conn_ref); + + /* notify MSC/SGSN that the subscriber data in VLR has been updated */ void (*subscr_update)(struct vlr_subscr *vsub); /* notify MSC/SGSN that the given subscriber has been associated diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 8ab68478e..1ddbf2a33 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -3721,6 +3721,12 @@ static int msc_vlr_tx_cm_serv_acc(void *msc_conn_ref) return msc_gsm48_tx_mm_serv_ack(conn); } +static int msc_vlr_tx_common_id(void *msc_conn_ref) +{ + struct gsm_subscriber_connection *conn = msc_conn_ref; + return msc_tx_common_id(conn); +} + /* VLR asks us to transmit a CM Service Reject */ static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum vlr_proc_arq_result result) { @@ -3809,6 +3815,7 @@ static const struct vlr_ops msc_vlr_ops = { .tx_cm_serv_acc = msc_vlr_tx_cm_serv_acc, .tx_cm_serv_rej = msc_vlr_tx_cm_serv_rej, .set_ciph_mode = msc_vlr_set_ciph_mode, + .tx_common_id = msc_vlr_tx_common_id, .subscr_update = msc_vlr_subscr_update, .subscr_assoc = msc_vlr_subscr_assoc, }; diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c index 8cc91c614..d3390fcb2 100644 --- a/openbsc/src/libmsc/msc_ifaces.c +++ b/openbsc/src/libmsc/msc_ifaces.c @@ -101,10 +101,17 @@ int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, int msc_tx_common_id(struct gsm_subscriber_connection *conn) { /* Common ID is only sent over IuCS */ - if (conn->via_ran != RAN_UTRAN_IU) + if (conn->via_ran != RAN_UTRAN_IU) { + LOGP(DMM, LOGL_INFO, + "%s: Asked to transmit Common ID, but skipping" + " because this is not on UTRAN\n", + vlr_subscr_name(conn->vsub)); return 0; + } #ifdef BUILD_IU + DEBUGP(DIUCS, "%s: tx CommonID %s\n", + vlr_subscr_name(conn->vsub), conn->vsub->imsi); return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); #else LOGP(DMM, LOGL_ERROR, diff --git a/openbsc/src/libvlr/vlr.c b/openbsc/src/libvlr/vlr.c index a8404b246..65d43f4d0 100644 --- a/openbsc/src/libvlr/vlr.c +++ b/openbsc/src/libvlr/vlr.c @@ -945,6 +945,7 @@ struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops) OSMO_ASSERT(ops->tx_cm_serv_acc); OSMO_ASSERT(ops->tx_cm_serv_rej); OSMO_ASSERT(ops->set_ciph_mode); + OSMO_ASSERT(ops->tx_common_id); OSMO_ASSERT(ops->subscr_update); OSMO_ASSERT(ops->subscr_assoc); diff --git a/openbsc/src/libvlr/vlr_access_req_fsm.c b/openbsc/src/libvlr/vlr_access_req_fsm.c index 96ded2aca..5c0822e60 100644 --- a/openbsc/src/libvlr/vlr_access_req_fsm.c +++ b/openbsc/src/libvlr/vlr_access_req_fsm.c @@ -250,6 +250,14 @@ static void _proc_arq_vlr_node2_post_ciph(struct osmo_fsm_inst *fi) LOGPFSM(fi, "%s()\n", __func__); + if (par->is_utran) { + int rc; + rc = par->vlr->ops.tx_common_id(par->msc_conn_ref); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Error while sending Common ID (%d)\n", rc); + } + vsub->conf_by_radio_contact_ind = true; if (vsub->loc_conf_in_hlr_ind == false) { /* start Update_Location_Child_VLR. WE use diff --git a/openbsc/src/libvlr/vlr_lu_fsm.c b/openbsc/src/libvlr/vlr_lu_fsm.c index d034f4b0f..c7fa8dca3 100644 --- a/openbsc/src/libvlr/vlr_lu_fsm.c +++ b/openbsc/src/libvlr/vlr_lu_fsm.c @@ -776,6 +776,14 @@ static void vlr_loc_upd_post_ciph(struct osmo_fsm_inst *fi) OSMO_ASSERT(vsub); + if (lfp->is_utran) { + int rc; + rc = lfp->vlr->ops.tx_common_id(lfp->msc_conn_ref); + if (rc) + LOGPFSML(fi, LOGL_ERROR, + "Error while sending Common ID (%d)\n", rc); + } + vsub->conf_by_radio_contact_ind = true; /* Update LAI */ vsub->cgi.lai = lfp->new_lai; diff --git a/openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err b/openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err index 712f222e5..d6896023c 100644 --- a/openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -439,6 +439,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated @@ -570,6 +571,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received E DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() @@ -683,6 +685,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received E DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() @@ -1014,6 +1017,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated diff --git a/openbsc/tests/msc_vlr/msc_vlr_tests.c b/openbsc/tests/msc_vlr/msc_vlr_tests.c index 7a9e2d8bb..feef3a0a7 100644 --- a/openbsc/tests/msc_vlr/msc_vlr_tests.c +++ b/openbsc/tests/msc_vlr/msc_vlr_tests.c @@ -357,6 +357,11 @@ static struct log_info_cat test_categories[] = { .description = "Paging Subsystem", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DIUCS] = { + .name = "DIUCS", + .description = "Iu-CS Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static struct log_info info = { -- cgit v1.2.3