dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33638 )
Change subject: S1AP_Emulation: delete UE association on S1AP_UeContextReleaseCmd ......................................................................
S1AP_Emulation: delete UE association on S1AP_UeContextReleaseCmd
When a S1AP_UeContextReleaseCmd is received, the UE association should be deleted.
Related: OS#5760 Change-Id: I8c6f7a780945ce34dabdc794aabab5d16a3a73aa --- M library/S1AP_Emulation.ttcn 1 file changed, 37 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/33638/1
diff --git a/library/S1AP_Emulation.ttcn b/library/S1AP_Emulation.ttcn index 433ad8b..2ecd7c1 100644 --- a/library/S1AP_Emulation.ttcn +++ b/library/S1AP_Emulation.ttcn @@ -340,6 +340,29 @@ } */
+function handle_S1AP_UeContextReleaseCmd(template (present) S1AP_PDU rel_cmd) runs on S1AP_Emulation_CT { + if (ispresent(rel_cmd.initiatingMessage.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_S1AP_IDs.uE_S1AP_ID_pair)) { + var template MME_UE_S1AP_ID mme_ue_id; + var template ENB_UE_S1AP_ID enb_ue_id; + var integer assoc_id; + var S1AP_ConnHdlr vc_conn + + mme_ue_id := rel_cmd.initiatingMessage.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_S1AP_IDs.uE_S1AP_ID_pair.mME_UE_S1AP_ID; + enb_ue_id := rel_cmd.initiatingMessage.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_S1AP_IDs.uE_S1AP_ID_pair.eNB_UE_S1AP_ID; + + assoc_id := f_assoc_id_by_s1ap_ids(mme_ue_id, enb_ue_id); + vc_conn := S1apAssociationTable[assoc_id].comp_ref; + + f_s1ap_id_table_del(vc_conn, valueof(enb_ue_id)); + } else { + /* TODO: The UE CONTEXT RELEASE COMMAND (see also: 3GPP TS 36.413, section 9.1.4.6), may identify the + * context by either an uE_S1AP_ID_pair (MME_UE_S1AP_ID and ENB_UE_S1AP_ID) or an MME_UE_S1AP_ID alone. + * The latter case is not implemented here yet. */ + setverdict(fail, "complete implementation of UeContextReleaseCmd handling"); + mtc.stop; + } +} + function main(S1APOps ops, S1AP_conn_parameters p, charstring id) runs on S1AP_Emulation_CT { var Result res; g_pars := p; @@ -425,9 +448,7 @@ S1AP.send(t_S1AP_Send(g_s1ap_conn_id, valueof(resp))); } } else if (match(mrf.msg, tr_S1AP_UeContextReleaseCmd)) { - /* TODO: special handling, as it contains multiple eNB or MME IDs */ - setverdict(fail, "implement UeContextReleaseCmd handling"); - mtc.stop; + handle_S1AP_UeContextReleaseCmd(mrf.msg); } else { /* Ue-related S1AP message */ /* obtain MME + ENB UE S1AP ID */