summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-04 00:05:49 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 18:34:17 +0100
commit3dbdf8178311a838f9a8d8eec36a674bd92db30c (patch)
tree082ced98bcadff8a2652808f5aeb110185675a6e
parentbea516cc91f3cd5dfe20dce46eb8213750b26186 (diff)
vlr on utran: transmit CommonID
-rw-r--r--openbsc/include/openbsc/vlr.h7
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c7
-rw-r--r--openbsc/src/libmsc/msc_ifaces.c9
-rw-r--r--openbsc/src/libvlr/vlr.c1
-rw-r--r--openbsc/src/libvlr/vlr_access_req_fsm.c8
-rw-r--r--openbsc/src/libvlr/vlr_lu_fsm.c8
-rw-r--r--openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err4
-rw-r--r--openbsc/tests/msc_vlr/msc_vlr_tests.c5
8 files changed, 45 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/vlr.h b/openbsc/include/openbsc/vlr.h
index b7f5ff9..e444258 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 8ab6847..1ddbf2a 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 8cc91c6..d3390fc 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 a8404b2..65d43f4 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 96ded2a..5c0822e 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 d034f4b..c7fa8dc 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 712f222..d689602 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 7a9e2d8..feef3a0 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 = {