From fda5bb5e51a60ad168be5ba86db6b1fe15f7a6c9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 7 Sep 2016 17:52:32 +0200 Subject: IuCS: send RANAP CommonID Add libiu function to send a CommonID message down a UE connection, iu_tx_common_id(); add also a corresponding stub to libiudummy for linking with tests. Add libmsc function msc_tx_common_id() to call the above. Add this mostly to clearly indicate in msc_ifaces.h that libmsc is calling out of the MSC; also to do conn->via_iface checking. Call msc_tx_common_id() after ciphering is established, in _gsm48_rx_mm_serv_req_sec_cb()'s GSM_SECURITY_SUCCEEDED case. Change-Id: I576ddd5bbabfc989149debd2f8a9743db6d26043 --- openbsc/src/libiu/iu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbsc/src/libiu/iu.c') diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c index 87a02d8e3..0ce17e4e0 100644 --- a/openbsc/src/libiu/iu.c +++ b/openbsc/src/libiu/iu.c @@ -256,6 +256,25 @@ int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, return 0; } +int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SUA link %p conn_id %u)\n", + uectx->link, uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + return 0; +} + static int iu_grnc_id_parse(struct iu_grnc_id *dst, struct RANAP_GlobalRNC_ID *src) { -- cgit v1.2.3