diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn index 4414dd11b..21fff9e82 100644 --- a/library/SGsAP_Templates.ttcn +++ b/library/SGsAP_Templates.ttcn @@ -13,6 +13,7 @@ module SGsAP_Templates { import from SGsAP_Types all; import from GSM_Types all; import from General_Types all; +import from Osmocom_Types all; import from MobileL3_CommonIE_Types all; /* 9.4.2 */ @@ -162,6 +163,29 @@ function tr_SGsAP_IE_Lai_omit(template LocationAreaIdValue lai) return template } } +/* 9.4.21a */ +template (value) TrackingAreaIdentityValue ts_SGsAP_TAI(GsmMcc mcc, GsmMnc mnc, uint16_t tac) := { + mccDigit1 := mcc[0], + mccDigit2 := mcc[1], + mccDigit3 := mcc[2], + mncDigit3 := f_enc_mnc_digit3(mnc), + mncDigit1 := mnc[0], + mncDigit2 := mnc[1], + tAC := int2oct(tac, 2) +} +template (value) TrackingAreaIdentity ts_SGsAP_IE_TAI(template (value) TrackingAreaIdentityValue tai) := { + iEI := '00100011'B, + lengthIndicator := 5, + iD := tai +} +function ts_SGsAP_IE_TAI_omit(template (omit) TrackingAreaIdentityValue tai) +return template (omit) TrackingAreaIdentity { + if (istemplatekind(tai, "omit")) { + return omit; + } else { + return ts_SGsAP_IE_TAI(tai); + } +} /* 9.4.12 */ @@ -505,7 +529,8 @@ template PDU_SGsAP tr_SGsAP_LU_REJECT(template hexstring imsi, template (value) PDU_SGsAP ts_SGsAP_LU_REQ(hexstring imsi, template (value) octetstring mme_name, template (value) EPS_location_update_type eps_lu_type, - template (value) LocationAreaIdValue new_lai) := { + template (value) LocationAreaIdValue new_lai, + template (omit) TrackingAreaIdentityValue tAI := omit) := { sGsAP_LOCATION_UPDATE_REQUEST := { messageType := '00001001'B, iMSI := ts_SGsAP_IMSI(imsi), @@ -515,7 +540,7 @@ template (value) PDU_SGsAP ts_SGsAP_LU_REQ(hexstring imsi, oldLocationAreaId := omit, tMSI_Status := omit, iMEI_SV := omit, - tAI := omit, + tAI := ts_SGsAP_IE_TAI_omit(tAI), eCGI := omit, tMSI_NRI := omit, cS_DomainOperator := omit diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 48ed7bdec..832562591 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -4541,7 +4541,8 @@ function f_sgs_perform_lu() runs on BSC_ConnHdlr { f_create_gsup_expect(hex2str(g_pars.imsi)); lur := valueof(ts_SGsAP_LU_REQ(g_pars.imsi, mme_name, IMSI_attach, - ts_SGsAP_LAI('901'H, '70'H, 2342))); + ts_SGsAP_LAI('901'H, '70'H, 2342), + ts_SGsAP_TAI('901'H, '70'H, 555))); /* Old LAI, if MS sends it */ /* TMSI status, if MS has no valid TMSI */ /* IMEISV, if it supports "automatic device detection" */