diff --git a/ttcn/Lib3GPP/Common/CommonDefs.ttcn b/ttcn/Lib3GPP/Common/CommonDefs.ttcn index 4e8a2260e50bc256561632020b4ff175512e4ed9..2a54ee4000f8b70e3031ca7cedf0c81699158224 100644 --- a/ttcn/Lib3GPP/Common/CommonDefs.ttcn +++ b/ttcn/Lib3GPP/Common/CommonDefs.ttcn @@ -233,7 +233,7 @@ module CommonDefs { utran34_CellG (2006), utran34_CellH (2007) }; // @sic R5-133563: added utran34_CellA/B/C... for 34.123-1 NAS tc sic@ - + type record of UTRAN_CellId_Type UTRAN_CellIdList_Type; type enumerated WLAN_CellId_Type { @@ -242,13 +242,13 @@ module CommonDefs { wlan_Cell27b (272), /* WLAN AP in EUTRA environment */ wlan_Cell39 (39) /* WLAN AP in UTRA environment */ }; - + //Common delta types type record UE_NR_DeltaValues_Type { DeltaValues_Type DeltaPrimaryBand, DeltaValues_Type DeltaSecondaryBand }; - + type union AnyCellId_Type { EUTRA_CellId_Type Eutra, NR_CellId_Type Nr @@ -262,7 +262,7 @@ module CommonDefs { integer DeltaNRf3, integer DeltaNRf4 }; - + //---------------------------------------------------------------------------- type integer IP_DrbId_Type; /* DRB identity type common for all RATs: @@ -288,7 +288,7 @@ module CommonDefs { type record IP_ePDG_IPsecTunnelInfo_Type { PDN_Index_Type PdnId /* 'index name' of PDN associated to the IPsec tunnel, e.g. for SS to distinguish routing of IP packets in case of more than one IPsec tunnel * NOTE: In general only 'ePDG_XXX' values shall be used */ - + }; type record QosFlow_Identification_Type { @@ -330,7 +330,7 @@ module CommonDefs { gea3(3), gea4(4) }; - + type O4_Type MessageAuthenticationCode; /* 24.301 cl. 9.5 */ type O4_Type NasCount_Type; @@ -393,7 +393,7 @@ module CommonDefs { // **** C-RNTI: 16 bit for all EUTRA/NBIOT/NR; same constants to be used for NR unless there is a need for NR-specifc values in which case the constants shall have an NR prefix **** type UInt16_Type RNTI_Value_Type; /* corresponds to NR ASN.1: RNTI-Value ::= INTEGER (0..65535) */ type B16_Type RNTI_B16_Type; - + const RNTI_Value_Type tsc_C_RNTI_Value1 := hex2int('1001'H); /* '1001'H acc. to TS 36.523-3 table 7.1.1-1 */ const RNTI_Value_Type tsc_C_RNTI_Value2 := hex2int('1034'H); /* '1034'H acc. to TS 36.523-3 table 7.1.1-1 */ const RNTI_Value_Type tsc_C_RNTI_Value3 := hex2int('1111'H); /* '1111'H acc. to TS 36.523-3 table 7.1.1-1 */ @@ -405,7 +405,7 @@ module CommonDefs { const RNTI_Value_Type tsc_C_RNTI_Value9 := hex2int('162E'H); /* '162E'H acc. to TS 36.523-3 table 7.1.1-1 */ const RNTI_Value_Type tsc_C_RNTI_Value10 := hex2int('1A85'H); /* '1A85'H acc. to TS 36.523-3 table 7.1.1-1 */ - + const RNTI_B16_Type tsc_C_RNTI_Def := int2bit(tsc_C_RNTI_Value1, 16); const RNTI_B16_Type tsc_C_RNTI_Def2 := int2bit(tsc_C_RNTI_Value2, 16); const RNTI_B16_Type tsc_C_RNTI_Def3 := int2bit(tsc_C_RNTI_Value3, 16); @@ -416,7 +416,7 @@ module CommonDefs { const RNTI_B16_Type tsc_C_RNTI_Def8 := int2bit(tsc_C_RNTI_Value8, 16); const RNTI_B16_Type tsc_C_RNTI_Def9 := int2bit(tsc_C_RNTI_Value9, 16); const RNTI_B16_Type tsc_C_RNTI_Def10 := int2bit(tsc_C_RNTI_Value10, 16); - + template (present) octetstring cr_Octet10_Any := ? length(10); /* @status APPROVED (LTE) */ //---------------------------------------------------------------------------- @@ -500,7 +500,7 @@ module CommonDefs { const octetstring tsc_Oct1000_0 := int2oct(0, 1000); /* @sic R5s230084 sic@ @status APPROVED (NR5GC) */ - + //---------------------------------------------------------------------------- @@ -509,7 +509,7 @@ module CommonDefs { normal, /* verdict assignments as for normal L3 signalling test */ layer2 /* verdict assignments for layer2 test: FAIL for unexpected events on DRB ports */ }; - + type enumerated HarqErrorHandling_Type { ignore, /* ignore HARQ error indications */ raiseInconc, /* assign INCONC when there is a HARQ error indication */ @@ -636,7 +636,7 @@ module CommonDefs { } return -1; /* @sic R5s190465 sic@ */ } - + //---------------------------------------------------------------------------- /* * @desc return log2 rounded up to the next integer @@ -694,7 +694,7 @@ module CommonDefs { function f_Round(float p_Float) return integer { var integer v_Result; - + if (p_Float >= 0.0) { v_Result := float2int(p_Float + 0.5); } else { // @sic R5s200469: negative values sic@ @@ -844,7 +844,7 @@ module CommonDefs { var charstring v_Expression := "(*)(" & p_Delimitor & ")(*)"; var integer i := 0; var integer N; - + while (regexp(v_Text, v_Expression, 1) != "") { v_CharStringList1[i] := regexp(v_Text, v_Expression, 2); v_Text := regexp(v_Text, v_Expression, 0); @@ -886,7 +886,7 @@ module CommonDefs { { var integer v_Length := lengthof(p_StringList); var CharStringList_Type v_StringList := p_StringList; - + v_StringList[v_Length] := p_NewString; return v_StringList; } @@ -906,7 +906,7 @@ module CommonDefs { } return v_NewList; } - + //---------------------------------------------------------------------------- function f_ConvertBoolToBit(boolean p_Bool) return B1_Type @@ -984,10 +984,10 @@ module CommonDefs { v_Bitstring := v_Bitstring & '0'B; } } - + return v_Bitstring; } - + //---------------------------------------------------------------------------- /* * @desc function to extract output string from random test pattern of a certain length and at a starting point @@ -1013,7 +1013,7 @@ module CommonDefs { //---------------------------------------------------------------------------- type enumerated Gsm7BitPacking_Type { SMS_Packing, CBS_Packing, USSD_Packing }; - + const integer tsc_Gsm7BitLookup[32..126][2] := { /* ASCII to GSM 7 bit char conversion table Self indexing lookup table per ASCII integer value 1st field - status @@ -1127,9 +1127,9 @@ module CommonDefs { var integer v_AsciiIndex; var integer i; var integer j := 0; - + for (i:=0; i= v_Length) { @@ -1295,7 +1295,7 @@ module CommonDefs { v_Substring1 := substr(p_Bitstring, 0, p_Position); v_Substring2 := substr(p_Bitstring, p_Position + 1, v_Length - p_Position - 1); - return v_Substring1 & p_Bit & v_Substring2; + return v_Substring1 & valueof(p_Bit) & v_Substring2; } //---------------------------------------------------------------------------- @@ -1310,7 +1310,7 @@ module CommonDefs { /* External function to hashing function with algorithm as defined in 33.401; SHA-256 encoding algorithm used as KEY Description Function @status APPROVED (LTE) */ - + external function fx_CalculateFCS32 (bitstring p_TMSI) return B32_Type; /* Cyclic Redundancy Check calculation according to ITU-T Recommendation V.42 of CRC-32 Algorithm @sic R5-172046 sic@ */ //---------------------------------------------------------------------------- @@ -1384,7 +1384,7 @@ module CommonDefs { var charstring v_TimezoneSign; var charstring v_TimezoneHours; var charstring v_TimezoneMinutes; - + if (p_LocalTime.tm_isdst > 0) { // see f_BCD_TimestampWithTimezone v_TimezoneSeconds := v_TimezoneSeconds + 3600; } @@ -1458,7 +1458,7 @@ module CommonDefs { { var integer v_LowNibble := p_Val mod 10; var integer v_HighNibble := (p_Val / 10) mod 10; - + return int2hex(v_LowNibble, 1) & int2hex(v_HighNibble, 1); } @@ -1483,23 +1483,23 @@ module CommonDefs { var H2_Type v_Minute; var H2_Type v_Second; var H2_Type v_Timezone; - + fx_GetSystemTime(v_LocalTime, v_TimezoneSeconds); - + v_Year := f_SwappedNibbles(v_LocalTime.tm_year + 1900); /* acc. to definition of struct tm */ v_Month := f_SwappedNibbles(v_LocalTime.tm_mon + 1); /* acc. to definition of struct tm */ v_Day := f_SwappedNibbles(v_LocalTime.tm_mday); v_Hour := f_SwappedNibbles(v_LocalTime.tm_hour); v_Minute := f_SwappedNibbles(v_LocalTime.tm_min mod 60); /* v_LocalTime.tm_min can be 0..61 on some systems */ v_Second := f_SwappedNibbles(v_LocalTime.tm_sec); - + /* Calculation of the timezone (-> 23.040): */ if (v_LocalTime.tm_isdst > 0) { /* The value contained in the Time Zone field must take into account daylight saving time, such that when the sending entity changes from regular (winter) time to daylight saving (summer) time, there is a change to the value in the Time Zone field, for example in the UK the winter setting is 00000000 and the summer setting is 01000000. */ v_TimezoneSeconds := v_TimezoneSeconds + 3600; } - + if (v_TimezoneSeconds < 0) { v_TimezoneSeconds := -v_TimezoneSeconds; v_SignVal := 128; /* In the first of the two semi octets, the first bit (bit 3 of the seventh octet of the TP Service Centre Time Stamp field) @@ -1508,9 +1508,9 @@ module CommonDefs { v_TimezoneVal := v_TimezoneSeconds / (60 * 15); /* The Time Zone indicates the difference, expressed in quarters of an hour, between the local time and GMT. */ v_TimezoneVal := v_TimezoneVal mod 128; /* ... just to be sure */ v_TimezoneVal := v_TimezoneVal + v_SignVal; /* set the upper bit */ - + v_Timezone := f_SwappedNibbles(v_TimezoneVal); - + return v_Year & v_Month & v_Day & v_Hour & v_Minute & v_Second & v_Timezone; } @@ -1530,12 +1530,12 @@ module CommonDefs { * @return B48_Type * @status */ - + function f_MDT_GetAbsolute_TimeStamp() return B48_Type { return hex2bit(f_BCD_TimestampWithoutTimezone()); } - + //---------------------------------------------------------------------------- /* * @desc similar to mktime but considering the "TimezoneInfo" as e.g. returned by fx_GetSystemTime @@ -1595,10 +1595,10 @@ module CommonDefs { var integer v_TimezoneDelta; fx_GetSystemTime(v_TM, v_TimezoneDelta); - + return f_UTC_MKTime(v_TM, v_TimezoneDelta); } - + /* * @desc seconds since 00:00:00 UTC on 1 January 1970 UTC (GMT) * @return integer @@ -1619,7 +1619,7 @@ module CommonDefs { function f_UtranCellId2Int(UTRAN_CellId_Type p_CellId) return integer { // @sic R5s130195 Baseline moving to rel-11: UTRAN cellID enhanced sic@ var integer v_CellId := enum2int(p_CellId); - + // @sic R5-133563: added utran34_CellA/B/C... for 34.123-1 NAS tc sic@ if (v_CellId >= 2000) { v_CellId := v_CellId - 2000; @@ -1628,7 +1628,7 @@ module CommonDefs { } return v_CellId; } - + //---------------------------------------------------------------------------- /* * @desc check that the result string starts with specific sub-string @@ -1643,7 +1643,7 @@ module CommonDefs { var integer v_Length := lengthof(p_StartString); var charstring v_SubStr; var boolean v_Result := false; - + if (v_Length <= lengthof(p_SourceString)) { v_SubStr := substr(p_SourceString, 0, v_Length); v_Result := (v_SubStr == p_StartString); @@ -1663,7 +1663,7 @@ module CommonDefs { { //@sic R5s160134 sic@ return (p_FrequencyBand < 33 or p_FrequencyBand >= 64); //@sic R5-162796, R5-193997 sic@ } - + //---------------------------------------------------------------------------- /* * @desc calculation of DRB_Identity associated to EpsBearerId @@ -1675,7 +1675,7 @@ module CommonDefs { { /* @sic R5s141351 change 5: returns integer instead of DRB_Identity sic@ */ return (hex2int(p_EpsBearerId) - 4); } - + //---------------------------------------------------------------------------- /* * @desc return value for given name from Name-Value list or omit if there is no entry for the given name diff --git a/ttcn/Lib3GPP/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn b/ttcn/Lib3GPP/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn index c58fe4d40b8a72702200b2a1390ec810d57acb7c..e09caa3711625594105a5f952a4f10363062326d 100644 --- a/ttcn/Lib3GPP/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn +++ b/ttcn/Lib3GPP/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn @@ -117,7 +117,7 @@ module NAS_AuxiliaryDefsAndFunctions { function f_ExtdProtocolConfigOptions_Get(template (omit) ExtdProtocolConfigOptions p_Pco, O2_Type p_ProtocolID) return template (omit) octetstring { - var NAS_ProtocolConfigOptions_Type v_ProtocolConfigOptions; + var NAS_ExtdProtocolConfigOptions_Type v_ProtocolConfigOptions; var integer i; if (isvalue(p_Pco.pco)) { @@ -220,7 +220,7 @@ module NAS_AuxiliaryDefsAndFunctions { { var ProtocolConfigOptions v_Pco; var integer i; - + if (isvalue(p_Pco)) { v_Pco := valueof (p_Pco); for (i := 0; i < lengthof(v_Pco.pco); i := i + 1) { @@ -231,7 +231,7 @@ module NAS_AuxiliaryDefsAndFunctions { } return false; } - + /* * @desc Function used to check whether the UE requests in its PCO a specific protocol * (SIP signalling) @@ -245,7 +245,7 @@ module NAS_AuxiliaryDefsAndFunctions { { var ExtdProtocolConfigOptions v_Pco; var integer i; - + if (isvalue(p_Pco)) { v_Pco := valueof (p_Pco); for (i := 0; i < lengthof(v_Pco.pco); i := i + 1) { @@ -256,7 +256,7 @@ module NAS_AuxiliaryDefsAndFunctions { } return false; } - + //------------------------------------ /* * @desc Function used to check whether the UE requests a P-CSCF address or DNS server address in its PCO @@ -279,12 +279,12 @@ module NAS_AuxiliaryDefsAndFunctions { var O2_Type v_ProtocolId; var octetstring v_Contents; var integer i; - + for (i := 0; i < lengthof(p_ConfigOptionsRX); i := i + 1) { - + v_ProtocolId := p_ConfigOptionsRX[i].protocolID; v_Contents := ''O; - + select (v_ProtocolId) { // See 24.008 Table 10.5.154 case ('0001'O) { // P-CSCF IPv6 address if (pc_IMS) { @@ -310,13 +310,13 @@ module NAS_AuxiliaryDefsAndFunctions { v_Contents := f_Convert_IPv4Addr2OctString(v_PDN_AddressInfo.DNS_ServerAddressIPv4); } } - + if (lengthof(v_Contents) > 0) { v_ProtocolContainerList[v_PcoCnt] := cs_ProtocolContainer(v_ProtocolId, v_Contents); v_PcoCnt := v_PcoCnt + 1; } } - return v_ProtocolContainerList & p_AdditionalProtocolConfigOptions; + return valueof(v_ProtocolContainerList) & valueof(p_AdditionalProtocolConfigOptions); } /* @@ -335,7 +335,7 @@ module NAS_AuxiliaryDefsAndFunctions { /* @sic R5-198996: p_AdditionalProtocolConfigOptions for 5GC options sic@ */ var template (value) NAS_ProtocolConfigOptions_Type v_ProtocolContainerListTX := {}; var NAS_ProtocolConfigOptions_Type v_ProtocolContainerListRX; - + if (isvalue(p_Pco.pco)) { /* @sic R5s170030 change 8 sic@ */ v_ProtocolContainerListRX := valueof(p_Pco.pco); v_ProtocolContainerListTX := f_NAS_GetProtocolConfigOptionList(v_ProtocolContainerListRX, p_PdnIndex, p_AdditionalProtocolConfigOptions); @@ -376,17 +376,17 @@ module NAS_AuxiliaryDefsAndFunctions { { var template (omit) NAS_ExtdProtocolConfigOptions_Type v_ProtocolContainerList := omit; // @sic R5s170233 sic@ var ExtdProtocolConfigOptions v_ProtocolConfigOptionsRX; - + if (isvalue(p_Pco)) { v_ProtocolConfigOptionsRX := valueof(p_Pco); if (ispresent(p_Pco.pco)) { // @sic R5s170233 sic@ v_ProtocolContainerList := f_NAS_GetExtdProtocolConfigOptionList(v_ProtocolConfigOptionsRX.pco, -, p_PdnIndex); // @sic R5-200649, R5s200643 sic@ } } - + return f_NAS_ExtdProtocolConfigOptionsTX(v_ProtocolContainerList); } - + /* * @desc Function used to check whether the UE requests a P-CSCF address or DNS server address in its PCO * If the UE does not support IMS, or doesn't request a P-CSCF address, the function returns the default PCO, PPP @@ -407,12 +407,12 @@ module NAS_AuxiliaryDefsAndFunctions { var O2_Type v_ProtocolId; var octetstring v_Contents; var integer i; - + for (i := 0; i < lengthof(p_ConfigOptionsRX); i := i + 1) { - + v_ProtocolId := p_ConfigOptionsRX[i].protocolID; v_Contents := ''O; - + select (v_ProtocolId) { // See 24.008 Table 10.5.154 case ('0002'O) { // IM CN Subsystem Signalling Flag, reply with an empty container if (not p_IgnoreIM_CN_SubsystemSignalingFlag) { @@ -428,7 +428,7 @@ module NAS_AuxiliaryDefsAndFunctions { v_Contents := f_Convert_IPv4Addr2OctString(v_PDN_AddressInfo.DNS_ServerAddressIPv4); } } - + if (lengthof(v_Contents) > 0) { v_ProtocolContainerList[v_PcoCnt] := cs_ProtocolContainer(v_ProtocolId, v_Contents); v_PcoCnt := v_PcoCnt + 1; @@ -504,7 +504,7 @@ module NAS_AuxiliaryDefsAndFunctions { function f_GetPDN_DNNTypeFromAPN(octetstring p_APN) return PDU_PDN_DNN_Type { // @sic R5-221467 sic@ var PDU_PDN_DNN_Type v_PDNType := None; - + if (match (p_APN, f_DomainName_Encode(pc_APN_ID_Internet))) { // @sic R5s210014 sic@ v_PDNType := Internet_DNN; } else if (match (p_APN, f_DomainName_Encode(pc_APN_ID_IMS))) { // @sic R5s210014 sic@ @@ -518,7 +518,7 @@ module NAS_AuxiliaryDefsAndFunctions { } else if (f_IsDNNForEmergency(p_APN)) { // this isn't specified in table 4.8.4-1, but is a valid PDU type v_PDNType := Emergency_PDN; } - + return v_PDNType; } @@ -531,7 +531,7 @@ module NAS_AuxiliaryDefsAndFunctions { function f_GetDNNStringFromPICS(PDU_PDN_DNN_Type p_PDUType) return charstring { var charstring v_DNN; - + select (p_PDUType) { case (Internet_DNN) { v_DNN := pc_APN_ID_Internet; @@ -556,7 +556,7 @@ module NAS_AuxiliaryDefsAndFunctions { } return v_DNN; } - + /* * @desc Get Default PDN DNN Type to be used in Multi PDN/PDU ATS from PICS * @return PDU_PDN_DNN_Type @@ -565,7 +565,7 @@ module NAS_AuxiliaryDefsAndFunctions { function f_GetDefaultAPN_DNNType_FromPICS() return PDU_PDN_DNN_Type { // @sic R5-221467 sic@ var PDU_PDN_DNN_Type v_PDNType := None; - + select (pc_APN_Default_Configuration) { case (internet) { v_PDNType := Internet_DNN; @@ -669,12 +669,12 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_Other := '00'O; var integer I; var integer K; - + if (v_Odd == 0) { // If length is even v_Length := v_Length + 1; p_MobileId := p_MobileId & 'F'H; // add '1111' on to the end of the IMSI } - + // Reverse each pair of digits // First digit is not included as it is treated differently K:=0; @@ -682,10 +682,10 @@ module NAS_AuxiliaryDefsAndFunctions { v_Other[K] := hex2oct(p_MobileId[I+1] & p_MobileId[I]); K := K + 1; } - + return v_Other; } - + //---------------------------------------------------------------------------- /* * @desc Convert from IMSI of type hexstring to NAS MobileIdentity @@ -700,10 +700,10 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_Other := f_ImsiImei2Octetstring (p_IMSI); // @sic R5s100092 sic@ var B4_Type v_FirstDigit := hex2bit(p_IMSI[0]); var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); - + return cds_MobileIdentityImsi_lv(v_FirstDigit, v_OddEvenInd, v_Other); } - + //---------------------------------------------------------------------------- /* * @desc Convert from IMEI of type hexstring to NAS MobileIdentity @@ -721,10 +721,10 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_Other := f_ImsiImei2Octetstring (substr(p_IMEI, 0, (v_ImeiLength - 1)) & '0'H); // @sic R5s160006 sic@ var B4_Type v_FirstDigit := hex2bit(p_IMEI[0]); var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); - + return cr_MobileIdentityImei(v_FirstDigit, v_OddEvenInd, v_Other, p_NAS_IdType); // @sic R5s130758 sic@ } - + //---------------------------------------------------------------------------- /* * @desc Convert from IMEISV of type hexstring to NAS MobileIdentity @@ -739,7 +739,7 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_Other := f_ImsiImei2Octetstring (p_IMEISV); var B4_Type v_FirstDigit := hex2bit(p_IMEISV[0]); var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); - + return cr_MobileIdentityImeisv(v_FirstDigit, v_OddEvenInd, v_Other); } @@ -757,22 +757,22 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_Result := '00'O; var integer I; var integer K; - + if (v_Odd == 1) { // If length is odd v_Length := v_Length + 1; p_EmgNum := p_EmgNum & 'F'H; // add '1111' on to the end of the Emergency Number } - + // Reverse each pair of digits, note that v_Length is even K:=0; for (I:=0; I < v_Length - 1; I:=I+2) { v_Result[K] := hex2oct(p_EmgNum[I+1] & p_EmgNum[I]); K := K + 1; } - + return v_Result; } - + /* * @desc To generate an local emergency number list * @param p_NoOfNums - To specify how many numbers to be included in the list (max = 10) @@ -789,7 +789,7 @@ module NAS_AuxiliaryDefsAndFunctions { var integer v_LocalLength := 0; var integer v_TotalLength := 0; var B7_Type v_ServCat; - + v_EmergNum.iei := '34'O; for (i := 0; i < p_NoOfNums; i:=i+1) { v_LocalNum := fl_EmgNum2Octetstring (p_NumList[i]); @@ -807,7 +807,7 @@ module NAS_AuxiliaryDefsAndFunctions { v_EmergNum.iel := int2oct (v_TotalLength, 1); return v_EmergNum; } - + /* * @desc To generate an extended emergency number list * @param p_NoOfNums @@ -827,7 +827,7 @@ module NAS_AuxiliaryDefsAndFunctions { var octetstring v_LocalNum; var integer v_LocalLength := 0; var integer v_TotalLength := 0; - + v_EmergNum.iei := '7A'O; for (i := 0; i < p_NoOfNums; i:=i+1) { v_LocalNum := fl_EmgNum2Octetstring (p_NumList[i]); @@ -840,7 +840,7 @@ module NAS_AuxiliaryDefsAndFunctions { v_EmergNum.iel := int2oct (v_TotalLength + 1, 2); // 1 octet for EENLV return v_EmergNum; } - + /* * @desc Generation of a new list of local emergency numbers different from existing ones * @param p_NoOfNums .. maximum 20 @@ -891,7 +891,7 @@ module NAS_AuxiliaryDefsAndFunctions { } return false; } // fl_CheckEmergencyNum - + /* * @desc check response on AT command from the UE @@ -914,11 +914,11 @@ module NAS_AuxiliaryDefsAndFunctions { var template charstring v_ExpectedString := pattern p_ExpectedString; var boolean v_MatchResult; var charstring v_CRLF := oct2char('0D'O) & oct2char('0A'O); - + v_Result := regexp(p_AT_Response, v_Expression, p_Group); - + v_MatchResult := match(v_Result, v_ExpectedString); - + if (v_MatchResult == true) { f_SetVerdict(pass,__FILE__, __LINE__, p_Text); } else { @@ -941,10 +941,10 @@ module NAS_AuxiliaryDefsAndFunctions { var MS_NetworkCap v_MS_NetworkCap; var B8_Type v_GEA := '00000000'B; var integer v_Length := 2; - + v_SecurityCapability.eeaCap := bit2oct(p_UeNetworkCapability.eeaCap); // @sic R5s180271 Baseline Moving 2018 Phase 1 sic@ v_SecurityCapability.eiaCap := bit2oct(p_UeNetworkCapability.eiaCap); // @sic R5s180271 Baseline Moving 2018 Phase 1 sic@ - + if (ispresent(p_UeNetworkCapability.ueaCap)) { v_SecurityCapability.ueaCap := bit2oct(p_UeNetworkCapability.ueaCap); // @sic R5s180271 Baseline Moving 2018 Phase 1 sic@ v_Length := v_Length + 2; // if octet 5 is present, 6 will be too @sic R5s100485 sic@ @@ -997,12 +997,12 @@ module NAS_AuxiliaryDefsAndFunctions { v_Length := 2; } } - + v_SecurityCapability.iel := int2oct (v_Length, 1); // Now store the length - + return v_SecurityCapability; } - + /* * @desc Calculate current year from System Time * @return integer @@ -1026,7 +1026,7 @@ module NAS_AuxiliaryDefsAndFunctions { { return hex2oct(f_SwappedNibbles(p_Year)); } - + /* * @desc Extract the last 2 digits of the current year (as integer value) * @param p_Year @@ -1037,5 +1037,5 @@ module NAS_AuxiliaryDefsAndFunctions { { return int2str(p_Year mod 100); } - + } diff --git a/ttcn/Lib3GPP/NAS/NAS_CommonTemplates.ttcn b/ttcn/Lib3GPP/NAS/NAS_CommonTemplates.ttcn index b7a31ddb5ba74141a0522fe269b1035933449dba..778f41d4d9068e4ee095a2f04fda72bf1cacd17d 100644 --- a/ttcn/Lib3GPP/NAS/NAS_CommonTemplates.ttcn +++ b/ttcn/Lib3GPP/NAS/NAS_CommonTemplates.ttcn @@ -15,10 +15,10 @@ module NAS_CommonTemplates { import from NAS_CommonTypeDefs all; import from CommonIP all; import from Parameters all; - + //============================================================================== group NAS_CommonConstants { // Constants being used for NAS_CommonTemplates - + const B1_Type tsc_Spare1 := '0'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, MCX, NBIOT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ const B2_Type tsc_Spare2 := '00'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS, UTRAN) */ const B3_Type tsc_Spare3 := '000'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, MCX, NBIOT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -27,7 +27,7 @@ module NAS_CommonTemplates { const B6_Type tsc_Spare6 := '000000'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, MCX, NBIOT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ const B7_Type tsc_Spare7 := '0000000'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ const SpareHalfOctet tsc_SpareHalfOctet := '0'H; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ - + const SecurityHeaderType tsc_SHT_NoSecurityProtection := '0000'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS, UTRAN) */ const SecurityHeaderType tsc_SHT_IntegrityProtected := '0001'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS, UTRAN) */ const SecurityHeaderType tsc_SHT_IntegrityProtected_Ciphered := '0010'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS, UTRAN) */ @@ -46,7 +46,7 @@ module NAS_CommonTemplates { const NAS_IdType tsc_IdType_TMSI := '100'B; /* suitable for identity type 24.008 cl. 10.5.3.4 and identiy type 2 24.008 cl. 10.5.5.9 @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ const NAS_IdType tsc_IdType_GUTI := '110'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ - + const B3_Type tsc_IMEISV_Requested := '001'B; /* @sic R5s130438 sic@ suitable for IMEISV request type 24.008 cl. 10.5.5.10 @status APPROVED (IMS, LTE, NBIOT, NR5GC, NR5GC_IRAT, POS) */ @@ -64,7 +64,7 @@ module NAS_CommonTemplates { const NAS_CauseValue_Type tsc_Cause_PLMN_NotAllowedToOperateAtPresentUELocation := '01001110'B; const NAS_KsiValue tsc_NasKsi_NoKey := '111'B; /* @status APPROVED (LTE, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT) */ - + const TmsiStatusValue tsc_NoValidTmsi := '0'B; /* @status APPROVED (UTRAN) */ const GprsTimerUnit tsc_GprsTimerUnit_2sec := '000'B; /* @status APPROVED (LTE, NBIOT) */ @@ -75,7 +75,7 @@ module NAS_CommonTemplates { const GprsTimerUnit tsc_GprsTimerUnit_deact := '111'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ const O2_Type tsc_PCO_Id_DSMIPv6 := '0007'O; const O2_Type tsc_PCO_Id_DSMIPv6_IPv4 := '0009'O; - + const O4_Type tsc_IPv4Mask := 'FFFFFFFF'O; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS, UTRAN) */ const O16_Type tsc_IPv6Mask := 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'O; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, UTRAN) */ @@ -108,28 +108,28 @@ module NAS_CommonTemplates { } // end group NAS_CommonConstants //------------------------------------------------------------------------------ - + template (value) AccessPointName cs_AccessPointName(octetstring p_Name) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ iei := omit, iel := int2oct(lengthof(p_Name), 1), nameValue := p_Name }; - + template (present) AccessPointName cr_AccessPointName(octetstring p_Name) := { /* @status APPROVED (ENDC, IMS, LTE, LTE_A_R10_R11, NBIOT) */ iei := '28'O, iel := int2oct(lengthof(p_Name), 1), nameValue := p_Name }; - + template (present) AccessPointName cr_AccessPointName_Any := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, UTRAN) */ iei := '28'O, iel := ?, nameValue := ? }; - + template (present) AdditionalUpdateType cr_AdditionalUpdateTypeAny := { /* 24.301 cl. 9.9.3.0B */ /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -139,7 +139,7 @@ module NAS_CommonTemplates { signallingActiveFlag := tsc_Spare1, // @sic R5s160711 Baseline Moving sic@ addUpdateTypeValue := ? }; - + template (present) AuthenticationFailureParameter cr_AuthFailParam_Any := { /* TLV format to be used in Authentication_Failure */ /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_IRAT, NBIOT, NR5GC, POS, SSNITZ, UTRAN) */ @@ -147,45 +147,45 @@ module NAS_CommonTemplates { iel := '0E'O, auts := ? }; - + template (present) AuthenticationFailureParameter cdr_AuthFailParamGSM_Any modifies cr_AuthFailParam_Any := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := '22'O }; - + template (value) RAND cs_RAND_v(B128_Type p_RAND) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ iei := omit, randValue := p_RAND }; - + template (value) RAND cs_GMM_AuthRAND(B128_Type p_Rand) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := '21'O, randValue := p_Rand }; - + template (value) AUTN cs_AUTN_lv(B128_Type p_AUTN) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ iei := omit, iel := '10'O, /* AUTN has length of 128 bits i.e. 16 octets */ aUTN := p_AUTN }; - + template (value) AUTN cs_GSM_AUTN(template (value) B128_Type p_AUTN) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := '20'O, iel := '10'O, // Length of 16 octets aUTN := p_AUTN // value of Authentication Parameter AUTN }; - + template (value) AUTN cs_GMM_AUTN(B128_Type p_Autn) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := '28'O, iel := '10'O, aUTN := p_Autn }; - + template (value) CiphKeySeqNum cs_CiphKeySeqNum(template (omit) IEI4_Type p_IEI, template (value) KeySeq p_KeySeq) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ @@ -193,7 +193,7 @@ module NAS_CommonTemplates { spare1 := '0'B, keySeq := p_KeySeq }; - + template (present) CiphKeySeqNum cr_CiphKeySeqNum(template (omit) IEI4_Type p_IEI, template (present) KeySeq p_KeySeq) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -201,7 +201,7 @@ module NAS_CommonTemplates { spare1 := '0'B, keySeq := p_KeySeq }; - + // ============================================================================= // Structured Type Constraint // Codec @@ -214,7 +214,7 @@ module NAS_CommonTemplates { bitMap1to8 := ?, // codec bitmap bits 1-8 bitMap9to16 := * // codec bitmap bits 9-16 }; - + // ============================================================================= // Structured Type Constraint // Supported Codec List @@ -226,7 +226,7 @@ module NAS_CommonTemplates { iel := ?, // length codec := ({cr_CodecAny, cr_CodecAny, cr_CodecAny, *}, {cr_CodecAny, cr_CodecAny, *}, {cr_CodecAny, *}) // Codec list @sic R5s110278 sic@ }; - + template (value) DCN_ID cs_Dcn_Id (O2_Type p_DCNIdValue) := { /* @status APPROVED (IMS, SSNITZ, UTRAN) */ iei := '41'O, @@ -239,14 +239,14 @@ module NAS_CommonTemplates { switchOff := '0'B, typeOfDetach := p_TypeOfDetach }; - + template (present) DetachType cr_DetachType(template (present) B1_Type p_SwitchOff, template (present) NAS_AttDetValue_Type p_TypeOfDetach) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ switchOff := p_SwitchOff, typeOfDetach := p_TypeOfDetach }; - + template (present) DetachType cr_DetachTypeOnSwitchOff := cr_DetachType('1'B, ?); /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ template (present) DeviceProperties cr_DeviceProperties(IEI4_Type p_IEI, @@ -274,7 +274,7 @@ module NAS_CommonTemplates { pwrMask2 := ?, eDGE_RF_PowerCapability2 := * // not present if pwrMask2 = 0 }; - + // ============================================================================= // Structured Type Constraint // Emergency Service Category @@ -291,7 +291,7 @@ module NAS_CommonTemplates { spare := '0'B, emergSCValue := p_EmergSCValue // Emergency Service Category value }; - + template (value) EmergNum cs_EmergencyLocalNumber(Type4Length_Type p_Length, template (value) EmergServCat p_EmergSCValue, octetstring p_Number) := @@ -312,7 +312,7 @@ module NAS_CommonTemplates { eDRXValue := ?, extdPTW := * // @sic R5s221182 Baseline Moving Rel-17 sic@ }; - + template (value) GPRS_Timer cs_GprsTimer_tv(IEI8_Type p_IEI, // @sic R5s100662 sic@ B3_Type p_Unit, B5_Type p_Value) := @@ -321,7 +321,7 @@ module NAS_CommonTemplates { unit := p_Unit, timerValue := p_Value }; - + template (value) GPRS_Timer cs_GprsTimer_v(GprsTimerUnit p_Unit, B5_Type p_Value) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -329,7 +329,7 @@ module NAS_CommonTemplates { unit := p_Unit, timerValue := p_Value }; - + template (value) GPRS_Timer cs_GprsTimer_v_deact := cs_GprsTimer_v(tsc_GprsTimerUnit_deact, tsc_Spare5); /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ template (value) IdentityType cs_IdentityType(NAS_IdType p_NAS_IdType) := @@ -337,7 +337,7 @@ module NAS_CommonTemplates { spare := '0'B, typeOfId := p_NAS_IdType }; - + template (present) LocAreaId cr_LAI(template (omit) IEI8_Type p_IEI, template (present) octetstring p_PLMN := ?, template (present) octetstring p_LAC := ?) := @@ -346,10 +346,10 @@ module NAS_CommonTemplates { plmn := p_PLMN, // MCC + MNC lac := p_LAC // location area code }; - + template (present) LocAreaId cr_LAI_Any := cr_LAI('13'O); /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ template (present) LocAreaId cr_LAI_Any_v := cr_LAI(omit); /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ - + template (value) LocAreaId cs_LAI(template (omit) IEI8_Type p_IEI, template (value) octetstring p_PLMN, template (value) octetstring p_LAC) := @@ -358,7 +358,7 @@ module NAS_CommonTemplates { plmn := p_PLMN, // MCC + MNC lac := p_LAC // location area code }; - + template (value) LLC_SAPI cs_LLC_SAPI(template (omit) IEI8_Type p_IEI := omit, B4_Type p_LlcSapiValue) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, UTRAN) */ @@ -366,10 +366,10 @@ module NAS_CommonTemplates { spare := '0000'B, llcSapiValue := p_LlcSapiValue }; - + template (value) LLC_SAPI cs_LLC_SAPI_11 (template (omit) IEI8_Type p_IEI := omit) := cs_LLC_SAPI(p_IEI, '1011'B); /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ template (value) LLC_SAPI cs_LLC_SAPI_03 (template (omit) IEI8_Type p_IEI := omit) := cs_LLC_SAPI(p_IEI, '0011'B); /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, UTRAN) */ - + template (present) MobileIdentity cr_MobileIdAny(template (omit) IEI8_Type p_IEI := omit) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := p_IEI, @@ -379,7 +379,7 @@ module NAS_CommonTemplates { typeOfId := ?, otherDigits := ? }; - + template (value) MobileIdentity cs_MobileIdentityGuti(template (omit) IEI8_Type p_IEI, octetstring p_Guti) := { @@ -392,7 +392,7 @@ module NAS_CommonTemplates { typeOfId := tsc_IdType_GUTI, // 3 bits otherDigits := p_Guti // 10 octets acc. to 24.301 }; - + template (value) MobileIdentity cs_MobileIdentityImsi(B4_Type p_FirstDigit, B1_Type p_OddEvenInd, octetstring p_OtherDigits) := @@ -404,7 +404,7 @@ module NAS_CommonTemplates { typeOfId := tsc_IdType_IMSI, // 3 bits otherDigits := p_OtherDigits }; - + template (value) MobileIdentity cds_MobileIdentityImsi_lv(B4_Type p_FirstDigit, B1_Type p_OddEvenInd, octetstring p_OtherDigits) @@ -412,7 +412,7 @@ module NAS_CommonTemplates { { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_R10_R11, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := omit }; - + template (value) MobileIdentity cs_MobileIdTMSIorPTMSI(template (omit) IEI8_Type p_IEI, O4_Type p_TmsiPtmsi) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -423,12 +423,12 @@ module NAS_CommonTemplates { typeOfId := tsc_IdType_TMSI, // TMSI / P-TMSI otherDigits := p_TmsiPtmsi }; - + template (value) MobileIdentity cs_MobileIdTMSI(template (omit) IEI8_Type p_IEI, // iei can be '17' (MM) or '13' (GMM) or omit O4_Type p_Tmsi) := /* @status APPROVED (IMS_IRAT, LTE_IRAT, SSNITZ) */ cs_MobileIdTMSIorPTMSI(p_IEI, p_Tmsi); - + template (present) MobileIdentity cr_MobileIdTMSI_lv(template (present) octetstring p_Tmsi := ?) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := omit, @@ -438,14 +438,14 @@ module NAS_CommonTemplates { typeOfId := tsc_IdType_TMSI, // TMSI otherDigits := p_Tmsi }; - + template (present) MobileIdentity cdr_MobileIdTMSI_tlv(template (present) octetstring p_Tmsi := ?, IEI8_Type p_IEI := '18'O) modifies cr_MobileIdTMSI_lv := { /* @status APPROVED (IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := p_IEI }; - + template (present) MobileIdentity cr_MobileIdentityImei(B4_Type p_FirstDigit, B1_Type p_OddEvenInd, octetstring p_OtherDigits, @@ -470,7 +470,7 @@ module NAS_CommonTemplates { typeOfId := tsc_IdType_IMEISV, // 3 bits otherDigits := p_OtherDigits }; - + template (present) MS_Clsmk2 cr_MS_Clsmk2_Any_tlv(template (omit) IEI8_Type p_IEI := '11'O) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := p_IEI, // @sic R5s100662, R5s110112 sic@ @@ -496,11 +496,11 @@ module NAS_CommonTemplates { a5_3 := ?, a5_2 := ? }; - + template (present) MS_Clsmk2 cr_MS_Clsmk2_Any := /* @status APPROVED (IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ cr_MS_Clsmk2_Any_tlv (omit); - + template (present) MS_Clsmk3 cr_MSCLSMK3_Any := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := '20'O, /* 0x20 */ @@ -601,7 +601,7 @@ module NAS_CommonTemplates { xtdEARFCNValueRange := *, // @sic R5s160712 Baseline Moving sic@ spareBits2 := * }; - + template (present) MS_Clsmk3 cdr_MSCLSMK3_EutraCheck (template (omit) IEI8_Type p_IEI) modifies cr_MSCLSMK3_Any := { /* @status APPROVED (LTE) */ iei := p_IEI, // @sic R5s110244, R5s140493 sic@ @@ -615,7 +615,7 @@ module NAS_CommonTemplates { sMS_VALUE := ?, sM_VALUE := ? }; - + template (present) MS_NetworkCap cr_MS_NetworkCap_Any := { /* 24.301 cl. 9.9.3.18 -> 24.008 cl. 10.5.5.12; @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -654,12 +654,12 @@ module NAS_CommonTemplates { dualConnectivityEUTRA_NR := *, // @sic R5s180553 Baseline Moving sic@ spareBits := * }; - + template (present) MS_NetworkCap cdr_MS_NetworkCapAss_lv modifies cr_MS_NetworkCap_Any := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := omit }; - + template (present) MS_NetworkFeatureSupport cr_MS_NetworkFeatureSupport(IEI4_Type p_IEI, template (present) B1_Type p_ExtdPeriodicTimers := ?) := { /* 24.301 cl. 9.9.2.0A -> 24.008 cl. 10.5.5.15 */ @@ -675,7 +675,7 @@ module NAS_CommonTemplates { iel := ?, // length containerContents := ? }; - + template (present) NwkResourceId cr_NwkResourceIdAny (IEI8_Type p_IEI := '10'O) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := p_IEI, @@ -683,7 +683,7 @@ module NAS_CommonTemplates { nriContainerValue := ?, spareBits := tsc_Spare6 // @sic R5s140778 sic@ }; - + template (value) PacketFlowIdentifier cs_PktFlowId := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, UTRAN) */ iei := '34'O, @@ -698,29 +698,29 @@ module NAS_CommonTemplates { iel := int2oct(lengthof(p_PlmnIdList) * 3, 1), plmnList := p_PlmnIdList }; - + template (value) PLMN_List cs_PLMN_List_1PLMN(NAS_PlmnId p_Plmn1) := /* @status APPROVED (LTE, LTE_A_IRAT, LTE_A_R10_R11, NBIOT, NR5GC, UTRAN) */ cs_PLMN_List({p_Plmn1}); - + template (value) PLMN_List cs_PLMN_List_2PLMNs(NAS_PlmnId p_Plmn1, NAS_PlmnId p_Plmn2) := /* @status APPROVED (LTE, LTE_A_R10_R11, NBIOT, NR5GC) */ cs_PLMN_List({p_Plmn1, p_Plmn2}); - + template (value) PLMN_List cs_PLMN_List_3PLMNs(NAS_PlmnId p_Plmn1, NAS_PlmnId p_Plmn2, NAS_PlmnId p_Plmn3) := /* @status APPROVED (LTE, NBIOT) */ cs_PLMN_List({p_Plmn1, p_Plmn2, p_Plmn3}); - + template (value) PLMN_List cs_PLMN_List_4PLMNs(NAS_PlmnId p_Plmn1, NAS_PlmnId p_Plmn2, NAS_PlmnId p_Plmn3, NAS_PlmnId p_Plmn4) := /* @status APPROVED (LTE, NBIOT) */ cs_PLMN_List({p_Plmn1, p_Plmn2, p_Plmn3, p_Plmn4}); - + template (value) ProtocolContainer cs_ProtocolContainer_Common(O2_Type p_ContainerId, integer p_ContainerLength := 0, template (omit) octetstring p_Content := omit) := @@ -790,32 +790,32 @@ module NAS_CommonTemplates { configProtocol := ?, pco := * }; - + template (value) PTMSI_Signature cs_PTMSI_Signature(octetstring p_Ptmsi) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := '19'O, iel := omit, signatureValue := p_Ptmsi }; - + template (present) PTMSI_Signature cr_PTMSI_Signature(template (present) O3_Type p_PtmsiSig) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := '19'O, iel := omit, signatureValue := p_PtmsiSig }; - + template (present) PTMSI_Signature cr_PTMSI_SignatureAny := /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ cr_PTMSI_Signature(?); - + template (present) PTMSI_Signature cr_PTMSI_Signature2Any := // Only used in Detach Request MO { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, POS, SSNITZ, UTRAN) */ iei := '19'O, iel := '03'O, signatureValue := ? }; - + template (value) QualityOfService cs_QoS_Negotiated_1 := { /* TS 34.123-3 Table 8.10.2 */ /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ @@ -853,7 +853,7 @@ module NAS_CommonTemplates { maxBitRateUL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ guaranteedBitRateUL_Ext2 := omit // @sic R5s1300195 Baseline Moving sic@ }; - + template (value) QualityOfService cds_QoS_Negotiated_2 modifies cs_QoS_Negotiated_1 := { /* TS 34.123-3 Table 8.10.2 */ /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ @@ -863,7 +863,7 @@ module NAS_CommonTemplates { residualBER := '0100'B, sduErrorRatio := '0011'B }; - + template (value) QualityOfService cds_QoS_Negotiated_3 modifies cs_QoS_Negotiated_1 := { /* TS 34.123-3 Table 8.10.2 */ /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ @@ -877,7 +877,7 @@ module NAS_CommonTemplates { guaranteedBitRateUL := '00000000'B, guaranteedBitRateDL := '00000000'B }; - + template (value) QualityOfService cds_QoS_Negotiated_4 (template (omit) IEI8_Type p_IEI := '30'O) modifies cs_QoS_PDP2 := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ relabilityClass := '101'B, @@ -891,13 +891,13 @@ module NAS_CommonTemplates { transferDelay := '001000'B, sourceStatisticsDescriptor := '0001'B }; - + template (value) QualityOfService cds_QoS_Negotiated_8 modifies cs_QoS_Negotiated_1 := { /* See in TS 36.508 Table 6.6.2-1A - Context #8 */ /* @status */ transferDelay := '000111'B // 70 msec - See 24.008 cl. 10.5.6.5 }; - + template (value) QualityOfService cs_QoS_PDP2 (template (omit) IEI8_Type p_IEI := '30'O) := { /* TS 51.010-1 Table 40.5 */ // @sic R5s120218 sic@ @@ -936,7 +936,7 @@ module NAS_CommonTemplates { maxBitRateUL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ guaranteedBitRateUL_Ext2 := omit // @sic R5s1300195 Baseline Moving sic@ }; - + template (value) QualityOfService cds_QoS_PDP3 (template (omit) IEI8_Type p_IEI := '30'O) modifies cs_QoS_PDP2 := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ relabilityClass := '101'B, @@ -957,7 +957,7 @@ module NAS_CommonTemplates { sduErrorRatio := '0001'B, transferDelay := '001000'B }; - + template (present) TrafficFlowTemplate cr_Tft(template IEI8_Type p_IEI := omit, template (present) B3_Type p_Code := ?) := { /* 24.301 cl. 9.9.4.13 -> 24.008 cl. 10.5.6.12 */ @@ -970,7 +970,7 @@ module NAS_CommonTemplates { packetFilterList := ?, parameterList := * }; - + template (value) TrafficFlowTemplate cs_TrafficFlowTemplate(integer p_IeLength, template (value) TrafficFlowTemplate.packetFilterList p_PacketFilterList):= { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, UTRAN) */ @@ -995,7 +995,7 @@ module NAS_CommonTemplates { // ============================================================================= // A value of 1 is the highest radio priority level // ----------------------------------------------------------------------------- - + template (value) RadioPriority cs_RadioPriority (template (omit) IEI4_Type p_IEI, B3_Type p_Val) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -1003,17 +1003,17 @@ module NAS_CommonTemplates { spare := '0'B, levelValue := p_Val }; - + template (value) RadioPriority cs_RadioPriorityHigh (template (omit) IEI4_Type p_IEI) := cs_RadioPriority (p_IEI, '001'B); /* @status APPROVED (IMS, LTE_A_IRAT, LTE_IRAT, POS, UTRAN) */ template (value) RadioPriority cs_RadioPriorityLow (template (omit) IEI4_Type p_IEI) := cs_RadioPriority (p_IEI, '100'B); /* @status APPROVED (LTE_IRAT) */ - + template (present) TMSI_Status cr_TMSI_Status(template (present) TmsiStatusValue p_TmsiStatus := ?) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := '9'H, spare3 := tsc_Spare3, flag := p_TmsiStatus }; - + template (present) UE_NetworkCap cr_UENetworkCap_Any (template (omit) IEI8_Type p_IEI) := { /* 24.301 cl. 9.9.3.34 @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ @@ -1034,10 +1034,10 @@ module NAS_CommonTemplates { template (present) UE_NetworkCap cdr_NR5GC_UENetworkCap (template (omit) IEI8_Type p_IEI) modifies cr_UENetworkCap_Any := { /* @status APPROVED (ENDC, NR5GC_IRAT) */ - cIoT_proSeCap := ('1'B & ? length (7)), // @sic R5-196647, R5-217714 sic@ - cIoT_V2X := (? length (2) & '1'B & ? length (5)) + cIoT_proSeCap := '1???????'B, // @sic R5-196647, R5-217714 sic@ + cIoT_V2X := '??1?????'B }; - + template (present) VoiceDomainPref cr_VoiceDomainPref_Any := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS, SSNITZ, UTRAN) */ iei := ?, // 01111110'B @@ -1046,7 +1046,7 @@ module NAS_CommonTemplates { ueUsageSetting := ?, voiceDomainPrefEUTRA := ? }; - + template (value) GPRS_Timer2 cs_GPRS_Timer2_3_IEI(template (omit) IEI8_Type p_IEI, // @sic R5s150329 Baseline Moving sic@ B3_Type p_Unit, B5_Type p_Value) := @@ -1088,7 +1088,7 @@ module NAS_CommonTemplates { second := p_Second, timeZone := p_TimeZone }; - + template (value) TimeZone cs_TimeZone (O1_Type p_TimeZone):= { /* @status APPROVED (LTE, NR5GC, SSNITZ) */ iei := '46'O, @@ -1119,7 +1119,7 @@ module NAS_CommonTemplates { function f_ConvertPackingToCodingScheme(Gsm7BitPacking_Type p_Gsm7BitPacking_Type) return B3_Type { var B3_Type v_CodingScheme := '000'B; - + if (p_Gsm7BitPacking_Type == SMS_Packing) {v_CodingScheme := '000'B } else {FatalError (__FILE__, __LINE__, "Unexpected Packing for conversion to Coding Scheme")}; //if (p_Gsm7BitPacking_Type == CBS_Packing) {v_CodingScheme := '000'B }; //if (p_Gsm7BitPacking_Type == USSD_Packing) {v_CodingScheme := '000'B }; @@ -1135,7 +1135,7 @@ module NAS_CommonTemplates { spare := tsc_Spare6, val := p_DaylightSavingTime }; - + //============================================================================ // Packet filters //---------------------------------------------------------------------------- @@ -1149,7 +1149,7 @@ module NAS_CommonTemplates { ipv4RemoteAddress := f_Convert_IPv4Addr2OctString(p_RemoteAddress) & p_Mask // @sic R5s100189, R5-113734 sic@ } }; - + template (value) PacketFilterComponent cs_PktFilterCompIPv6RemoteAddress(charstring p_RemoteAddress, O16_Type p_Mask := tsc_IPv6Mask) := { // 33 octets @@ -1229,7 +1229,7 @@ module NAS_CommonTemplates { securityParameterIndex := p_IPSecSPI } }; - + template (value) PacketFilterComponent cs_PktFilterCompFlowLabel(O3_Type p_FlowLabel) := { // 4 octets /* @status APPROVED (LTE, NBIOT, UTRAN) */ @@ -1238,7 +1238,7 @@ module NAS_CommonTemplates { flowLabel := p_FlowLabel } }; - + /* * @desc Calculate Packet Filters applied in test case 10.9.1 of 36.523-1 * @param p_PacketFilterByRef (by reference) @@ -1259,7 +1259,7 @@ module NAS_CommonTemplates { var integer v_FilterCount := 0; var template (value) PacketFilter v_Filter; - + select (p_PacketFilterID) { // @sic R5-110779 sic@ case (1) { // UL only filter, ID=1 @@ -1384,7 +1384,7 @@ module NAS_CommonTemplates { guaranteedBitRateDl_1 := ?, guaranteedBitRateDl_2 := ? }; - + const B1_Type tsc_NasKsi_NativeSecurityContext := '0'B; /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ const B1_Type tsc_NasKsi_MappedSecurityContext := '1'B; /* @status APPROVED (LTE_A_IRAT, LTE_IRAT, NR5GC_IRAT) */ @@ -1395,7 +1395,7 @@ module NAS_CommonTemplates { tsc := p_Tsc, nasKeySetId := p_NasKeySetId }; - + template (present) NAS_KeySetIdentifier cr_NAS_KeySetIdentifier(template (present) NAS_KsiValue p_KsiValue, template (present) B1_Type p_Tsc) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ @@ -1403,7 +1403,7 @@ module NAS_CommonTemplates { tsc := p_Tsc, nasKeySetId := p_KsiValue }; - + template (present) NAS_KeySetIdentifier cdr_NAS_KeySetIdentifier_tlv(template (present) NAS_KsiValue p_KsiValue, template (present) B1_Type p_Tsc) modifies cr_NAS_KeySetIdentifier := @@ -1417,7 +1417,7 @@ module NAS_CommonTemplates { iel := ?, /* RES has length of 32..128 bits i.e. 4..16 octets */ res := p_ExpectedRES }; - + template (value) IMEISV_Request cs_IMEISV_Request_WithIEI(B3_Type p_Value) := { /* @status APPROVED (IMS, LTE, NBIOT, NR5GC, NR5GC_IRAT, POS) */ iei := 'C'H, //@sic R5s090210 sic@ @@ -1435,7 +1435,7 @@ module NAS_CommonTemplates { spare2 := tsc_Spare1, integrityType := p_IntegrityType }; - + template (value) ExtdProtocolConfigOptions cs_ExtdPCO(Type6Length_Type p_Length, template (omit) NAS_ExtdProtocolConfigOptions_Type p_ProtocolContainers) := { /* 24.301 cl. 9.9.4.26 */ @@ -1447,7 +1447,7 @@ module NAS_CommonTemplates { configProtocol := tsc_Spare3, pco := p_ProtocolContainers }; - + template (present) DRXParamCommon cr_DRXParamCommonAny (IEI8_Type p_IEI):= { /* 24.301 cl. 9.9.3.63 */ /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ @@ -1464,7 +1464,7 @@ module NAS_CommonTemplates { iel := ?, infoType := ? }; - + template (present) WusInfoType cr_WusInfoTypeAny := { wusType := ?, @@ -1479,7 +1479,7 @@ module NAS_CommonTemplates { spare:='0'B, deleteReq:= p_DeleteReq }; - + template (present) UE_RequestType cr_UE_RequestType (template (present) B4_Type p_ReqType := ?) := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC_IRAT, POS) */ /* 24.301 cl. 9.9.3.65 */ @@ -1488,8 +1488,8 @@ module NAS_CommonTemplates { spare := tsc_Spare4, requestType := p_ReqType }; - - + + //---------------------------------------------------------------------------- template (value) QosFlow_Identification_Type cs_IP_QosFlowId(integer p_PDU_SessionId, integer p_QFI) := @@ -1541,7 +1541,7 @@ module NAS_CommonTemplates { } return 0; } - + /* * @desc To convert the SDU Error Ratio for the QoS * @param p_Val @@ -1561,7 +1561,7 @@ module NAS_CommonTemplates { } return ""; } - + /* * @desc To convert the Residual BER for the QoS * @param p_Val @@ -1602,25 +1602,25 @@ module NAS_CommonTemplates { if (v_SSDesc > 1) { v_SSDesc := 1; // Only allowed values are 0 or 1 } - + v_TrafficClass := v_TrafficClass - 1; // in AT command value is one less than in PDP Context if (v_TrafficClass < 0) { v_TrafficClass := 0; } - + select (v_DelOrder) { case (1) { v_DelOrder := 1; } case (2) { v_DelOrder := 0; } case else { v_DelOrder := 2; } } - + select (v_DeliveryErrorSDU) { case (1) { v_DeliveryErrorSDU := 2; } case (2) { v_DeliveryErrorSDU := 1; } case (3) { v_DeliveryErrorSDU := 0; } case else { v_DeliveryErrorSDU := 3; } } - + v_QoSstring := v_QoSstring & int2str(v_TrafficClass); v_QoSstring := v_QoSstring & "," & int2str(f_QoS_MaximumBitRate(v_QoS.maxBitRateUL)); v_QoSstring := v_QoSstring & "," & int2str(f_QoS_MaximumBitRate(v_QoS.maxBitRateDL)); @@ -1687,20 +1687,20 @@ module NAS_CommonTemplates { guaranteedBitRateUL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ guaranteedBitRateDL_Ext2 := omit // @sic R5s1300195 Baseline Moving sic@ }; - + template (value) EPS_QualityOfService cds_508_EPS_QoS_Default_1_tlv modifies cs_508_EPS_QoS_Default_1 := { /* according to table 6.6.2.1 in 36.508, including iei */ /* @status APPROVED (LTE, NBIOT) */ iei := '5B'O }; - + template (value) EPS_QualityOfService cds_EPS_QoS_Def_nonGBR_QCI modifies cs_508_EPS_QoS_Default_1 := { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ qci := '00000101'B // non-GBR QCI }; - + template (value) EPS_QualityOfService cds_EPS_QoS_Def_nonGBR_QCI_tlv modifies cs_508_EPS_QoS_Default_1 := { /* 10.7.2 specifies According to reference default Bearer context#2 except for GCI */ @@ -1713,8 +1713,8 @@ module NAS_CommonTemplates { { /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT, POS) */ qci := '01000101'B // 69 for MCPTT }; - - + + /* @desc Get the Default QoS according to 36.508 clause 4.7.3-6 * @param p_BearerContextNumber * @return template (value) EPS_QualityOfService @@ -1724,7 +1724,7 @@ module NAS_CommonTemplates { { /* @sic R5-144797: parameter p_BearerContextNumber sic@ */ var template (value) EPS_QualityOfService v_QoS; var BEARER_CONTEXT_TYPE v_BearerContextNumber := fl_BearerContextNumber_Def(p_BearerContextNumber); - + select (v_BearerContextNumber){ /* @sic R5-144797: v_QoS does not depend on pc_IMS anymore sic@ */ case (DEF_1) { v_QoS := cs_508_EPS_QoS_Default_1; /* Qos acc. to 36.508 Table 6.6.1-1 column 1 */ @@ -1738,18 +1738,18 @@ module NAS_CommonTemplates { } return v_QoS; } - + template (value) UERadioCapId cs_UERadioCapId (IEI8_Type p_IEI, octetstring p_Id) := { /* @status APPROVED (NR5GC, NR5GC_IRAT) */ iei := p_IEI, iel := int2oct(lengthof(p_Id), 1), id := p_Id }; - + //============================================================================ // Packet filters //---------------------------------------------------------------------------- - + /* * @desc local function to calculate single remote port acc. to reference packet filters in 36.508 * @param p_PortNumber @@ -1770,7 +1770,7 @@ module NAS_CommonTemplates { template (value) PacketFilterComponent cs_PktFilterCompSingleRemotePort31160(HalfOctet_Type p_EPS_BearerId) := /* @status APPROVED (ENDC, IMS, IMS_IRAT, LTE, LTE_A_IRAT, LTE_A_PRO, LTE_A_R10_R11, LTE_A_R12, LTE_IRAT, NBIOT, NR5GC, NR5GC_IRAT) */ cs_PktFilterCompSingleRemotePort(fl_SingleRemoteport508(31160, p_EPS_BearerId)); - + /* * @desc Get the Dedicated TFT according to 36.508 clause 6.6.2 * @param p_PacketFilterByRef (by reference) @@ -1807,7 +1807,7 @@ module NAS_CommonTemplates { v_ContentsLength := v_ContentsLength + 33; } } - + select (p_PacketFilterNumber){ case (1, 6) { // @sic R5-183239 sic@ v_Filter.spare := '00'B; // @sic R5s130195 Baseline Moving sic@ @@ -1945,7 +1945,7 @@ module NAS_CommonTemplates { } } v_Filter.iel := int2oct(v_ContentsLength, 1); - + p_PacketFilterByRef := v_Filter; p_PacketFilterLengthByRef := v_ContentsLength + 3; // length of the filter contents + 3 octets for iei, precedence and iel } @@ -1978,7 +1978,7 @@ module NAS_CommonTemplates { case (1) { // @sic R5-123632 sic@ fl_Get_508_PacketFilter(v_PacketFilter1ByRef, v_PacketFilterLen1ByRef, 1, p_EPS_BearerId, p_PdnTypeValue, p_PdnIndex); // get packet filter #1 acc. to 36.508 Table 6.6.2-2 @sic R5s130495 sic@ fl_Get_508_PacketFilter(v_PacketFilter2ByRef, v_PacketFilterLen2ByRef, 2, p_EPS_BearerId, p_PdnTypeValue, p_PdnIndex); // get packet filter #2 acc. to 36.508 Table 6.6.2-3 @sic R5s130495 sic@ - + v_IeLength := v_PacketFilterLen1ByRef + v_PacketFilterLen2ByRef + 1; // packet filter 1 + packet filter 2 + one octet for tftOperationCode, eBit and noOfPktFilter v_PacketFilterList := {v_PacketFilter1ByRef, v_PacketFilter2ByRef}; } @@ -2046,5 +2046,5 @@ module NAS_CommonTemplates { } return cs_TrafficFlowTemplate(v_IeLength, v_PacketFilterList); } - + } diff --git a/ttcn/Lib3GPP/NAS/NAS_CommonTypeDefs.ttcn b/ttcn/Lib3GPP/NAS/NAS_CommonTypeDefs.ttcn index f1c13cecef5e20869495c53c9071f98282f77987..8c3dd55b165708ea3fd60564b07d7433d509bb5b 100644 --- a/ttcn/Lib3GPP/NAS/NAS_CommonTypeDefs.ttcn +++ b/ttcn/Lib3GPP/NAS/NAS_CommonTypeDefs.ttcn @@ -24,8 +24,8 @@ module NAS_CommonTypeDefs { type HalfOctet_Type IEI4_Type; /* 4 bit info element identifier for type 1 IEs */ type Octet_Type IEI8_Type; /* 8 bit info element identifier */ - type O1_Type Type4Length_Type; - type O2_Type Type6Length_Type; + type O1_Type Type4Length_Type with { variant "COMP(nosign), BYTEORDER(last)" }; + type O2_Type Type6Length_Type with { variant "COMP(nosign), BYTEORDER(last)" }; type HalfOctet_Type SpareHalfOctet; @@ -246,7 +246,7 @@ module NAS_CommonTypeDefs { variant (iel) "LENGTHTO (unit, gprsTimerValue)"; variant (iel) "BYTEORDER(last)"; }; - + type GPRS_Timer2 GPRS_Timer3; // definition is identical @sic R5s150329 Baseline Moving sic@ // ============================================================================= @@ -458,7 +458,7 @@ module NAS_CommonTypeDefs { bitstring spareBits2 optional } with { variant "FIELDORDER(msb)"; - variant (iel) "LENGTHTO (spareBit, multibandSupported, a5_7, a5_6, a5_5, a5_4, associatedRadioCapabilty2, spareBits1, associatedRadioCapabilty1, maskBit1, rGSM_RadioCapability, maskBit2, multiSlotClass, uCS2Treatment, extMeasurementCapability, maskBit3, msMeasurementCapability, maskBit4, msPositioningMethod, maskBit5, eDGE_MultiSlot, maskBit6, psk8_Struct, maskBit7, gSM400BandsSupported, gSM400AssociatedRadioCapability, maskBit8, gSM850AssociatedRadiioCapability, maskBit9, pCS1900AssociatedRadiioCapability, uMTS_FDD_RAT_Capability, uMTS384TDD_RAT_Capability, cDMA2000_RAT_Capability, maskBit10, dTM_GPRS_MultiSlotSubclass, singleSlotDTM, maskBit11, dTM_EGPRS_MultiSlorSubclass, maskBit12, singleBandSupport, maskBit13, gSM700AssociatedRadioCapability, uMTS128TDD_RAT_Capability, gERANFeatPack1, mask14, extDTM_GPRS_MultiSlotSubclass, etxDTM_EGPRS_MultiSlotSubclass, mask15, highMultislotCap, spare2, gERANFeatPack2, gMSKMultislotPowerProfile, pSKMultislotPowerProfile, mask17, tGSM400BandsSupported, tGSM400AssocRadioCap, spare, dlAdvancedRxPerf, dTMEhancCap, mask19, dTMGPRSHighMultislotClass, offsetReq, mask20, dTMEGPRSHighMultislotClass, rptdACCHCap, mask21, gsm710AssocRadioCap, mask22, tgsm810AssocRadioCap, cipheringModeSettingCap, addPositionCap, eutraFDDSupport, eutraTDDSupport, eutraMeasAndReporting, priorityBasedReselection, utraCSGCellsReporting, vamosLevel, tighterCap, selectCipheringDLSACCH, csPS_SRVCC_G2U, csPS_SRVCC_G2E, geranNwkSharing, eutraWidebandRSRQMeas, erBandSupport, utraMultipleFreqBandInd, eutraMultipleFreqBandInd, xtdTSCSetCap, xtdEARFCNValueRange)"; + variant (iel) "LENGTHTO (spareBit, multibandSupported, a5_7, a5_6, a5_5, a5_4, associatedRadioCapabilty2, spareBits1, associatedRadioCapabilty1, maskBit1, rGSM_RadioCapability, maskBit2, multiSlotClass, uCS2Treatment, extMeasurementCapability, maskBit3, msMeasurementCapability, maskBit4, msPositioningMethod, maskBit5, eDGE_MultiSlot, maskBit6, psk8_Struct, maskBit7, gSM400BandsSupported, gSM400AssociatedRadioCapability, maskBit8, gSM850AssociatedRadiioCapability, maskBit9, pCS1900AssociatedRadiioCapability, uMTS_FDD_RAT_Capability, uMTS384TDD_RAT_Capability, cDMA2000_RAT_Capability, maskBit10, dTM_GPRS_MultiSlotSubclass, singleSlotDTM, maskBit11, dTM_EGPRS_MultiSlorSubclass, maskBit12, singleBandSupport, maskBit13, gSM700AssociatedRadioCapability, uMTS128TDD_RAT_Capability, gERANFeatPack1, mask14, extDTM_GPRS_MultiSlotSubclass, etxDTM_EGPRS_MultiSlotSubclass, mask15, highMultislotCap, spare2, gERANFeatPack2, gMSKMultislotPowerProfile, pSKMultislotPowerProfile, mask17, tGSM400BandsSupported, tGSM400AssocRadioCap, spare, dlAdvancedRxPerf, dTMEhancCap, mask19, dTMGPRSHighMultislotClass, offsetReq, mask20, dTMEGPRSHighMultislotClass, rptdACCHCap, mask21, gsm710AssocRadioCap, mask22, tgsm810AssocRadioCap, cipheringModeSettingCap, addPositionCap, eutraFDDSupport, eutraTDDSupport, eutraMeasAndReporting, priorityBasedReselection, utraCSGCellsReporting, vamosLevel, tighterCap, selectCipheringDLSACCH, csPS_SRVCC_G2U, csPS_SRVCC_G2E, geranNwkSharing, eutraWidebandRSRQMeas, erBandSupport, utraMultipleFreqBandInd, eutraMultipleFreqBandInd, xtdTSCSetCap, xtdEARFCNValueRange, spareBits2)"; variant (iel) "BYTEORDER(last)"; variant (spareBits2) "BYTEORDER(last)"; }; @@ -637,8 +637,7 @@ type record Non3GPP_NW_ProvidedPolicies { B1_Type ext, B4_Type spare, B3_Type configProtocol, - record length (0..83) of - ProtocolContainer pco optional + NAS_ProtocolConfigOptions_Type pco optional } with { variant "FIELDORDER(msb)"; // FIXME variant (pco) "FORCEOMIT(protocolLongLength)"; @@ -658,7 +657,7 @@ type record Non3GPP_NW_ProvidedPolicies { variant (content) "BYTEORDER(last)"; }; - type ProtocolConfigOptions.pco NAS_ProtocolConfigOptions_Type; + type record length (0..83) of ProtocolContainer NAS_ProtocolConfigOptions_Type; type record APNRateControlParams { // 3GPP 24.008 / 10.5.6.3.2 B4_Type spare, @@ -894,7 +893,7 @@ type record Non3GPP_NW_ProvidedPolicies { variant (iel) "LENGTHTO(eeaCap, eiaCap, ueaCap, uiaCap, srvcc_LPP_ProSeCap, cIoT_proSeCap, cIoT_V2X, edt_WUS, musim, spare)"; variant (iel) "BYTEORDER(last)"; } - + type record ReAttemptIndicator { // 24.301 cl. 9.9.4.13A, 24.008 cl. 10.5.6.5A // The two definitions are exactly the same. // The only difference is the meaning of the ratcValue bit @@ -908,7 +907,7 @@ type record Non3GPP_NW_ProvidedPolicies { variant (iel) "LENGTHTO(spare, eplmncValue, ratcValue)"; variant (iel) "BYTEORDER(last)"; } - + // ============================================================================= // Structured Type Definition // Authentication Parameter AUTN @@ -1040,7 +1039,7 @@ type record Non3GPP_NW_ProvidedPolicies { } with { variant "FIELDORDER(msb)"; }; - + // ============================================================================= // Structured Type Definition // FACILITY @@ -1054,7 +1053,7 @@ type record Non3GPP_NW_ProvidedPolicies { } with { variant "FIELDORDER(msb)"; }; - + // ============================================================================= // Structured Type Definition // FACILITY @@ -1127,7 +1126,7 @@ type record Non3GPP_NW_ProvidedPolicies { } with { variant "FIELDORDER(msb)"; }; - + // ============================================================================= // Structured Type Definition // WLANOffloadAcceptability @@ -1202,10 +1201,10 @@ type record NBIFOMContainer { B1_Type ext, B4_Type spare, B3_Type configProtocol, - record of ProtocolContainer pco optional + NAS_ExtdProtocolConfigOptions_Type pco optional } with { variant "FIELDORDER(msb)"; - variant (iel) "LENGTHTO (ext, spare, configProtocol, configProtocol)"; + variant (iel) "LENGTHTO (ext, spare, configProtocol, pco)"; variant (iel) "BYTEORDER(last)"; }; @@ -1387,7 +1386,7 @@ type record NBIFOMContainer { B8_Type guaranteedBitRateDL_Ext2 optional // @sic R5s1300195 Baseline Moving, R5s180640 sic@ } with { variant "FIELDORDER(msb)"; - variant (iel) "LENGTHTO (maxBitRateUl, maxBitRateDl, guaranteedBitRateUl, guaranteedBitRateDl, maxBitRateUlExt, maxBitRateDlExt, guaranteedBitRateUlExt, guaranteedBitRateDlExt, maxBitRateUL_Ext2, maxBitRateDL_Ext2, guaranteedBitRateUL_Ext2, guaranteedBitRateDL_Ext2)"; + variant (iel) "LENGTHTO (qci, maxBitRateUl, maxBitRateDl, guaranteedBitRateUl, guaranteedBitRateDl, maxBitRateUlExt, maxBitRateDlExt, guaranteedBitRateUlExt, guaranteedBitRateDlExt, maxBitRateUL_Ext2, maxBitRateDL_Ext2, guaranteedBitRateUL_Ext2, guaranteedBitRateDL_Ext2)"; variant (iel) "BYTEORDER(last)"; }; @@ -1400,7 +1399,7 @@ type record NBIFOMContainer { B8_Type ebi8_15 /* EBI(8)- EBI(15)*/ } with { variant "FIELDORDER(msb)"; - variant (iel) "LENGTHTO (ebi5_7, ebi4_1, spare, ebi5_7)"; + variant (iel) "LENGTHTO (ebi5_7, ebi4_1, spare, ebi8_15)"; variant (iel) "BYTEORDER(last)"; }; @@ -1451,7 +1450,7 @@ type record NBIFOMContainer { variant (iel) "LENGTHTO (infoType)"; variant (iel) "BYTEORDER(last)"; }; - + type record WusInfoType { B3_Type wusType, B5_Type pagingProbability, @@ -1503,6 +1502,6 @@ type record NBIFOMContainer { variant (iel) "LENGTHTO (spare, requestType)"; variant (iel) "BYTEORDER(last)"; }; - + //} with { encode "NAS Types" } } with { encode "RAW" } diff --git a/ttcn/Lib3GPP/NG_NAS/NG_NAS_Common.ttcn b/ttcn/Lib3GPP/NG_NAS/NG_NAS_Common.ttcn index 0908a567ead222cc2108df7c21242d0d121b6d03..e2e974cea37a4114a014159d6ca33e65dc36e729 100644 --- a/ttcn/Lib3GPP/NG_NAS/NG_NAS_Common.ttcn +++ b/ttcn/Lib3GPP/NG_NAS/NG_NAS_Common.ttcn @@ -32,7 +32,7 @@ module NG_NAS_Common { } with { variant "FIELDORDER(msb)"; }; - + type record GSM_MobilityInfo_Type { /* structured type to be stored & passed in/out of GSM Msgs @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ O1_Type SessionId, // @sic R5s200564 sic@ @@ -48,9 +48,9 @@ module NG_NAS_Common { } with { variant "FIELDORDER(msb)"; }; - + type record of GSM_MobilityInfo_Type PDUSessionInfoList_Type; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + type enumerated DeleteNSSAI_Type {Delete_Default_Configured, Delete_Configured, Delete_Allowed}; /* @status APPROVED (NR5GC) */ const ExtdProtocolDiscriminator tsc_EPD_GMM := '01111110'B; // from 24.007 /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -89,7 +89,7 @@ module NG_NAS_Common { const MessageType tsc_MT_NG_NotificationResponse := '01100110'B; const MessageType tsc_MT_NG_UL_NASTransport := '01100111'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const MessageType tsc_MT_NG_DL_NASTransport := '01101000'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + const MessageType tsc_MT_NG_PDUSessionEstablishmentRequest := '11000001'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const MessageType tsc_MT_NG_PDUSessionEstablishmentAccept := '11000010'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const MessageType tsc_MT_NG_PDUSessionEstablishmentReject := '11000011'B; /* @status APPROVED (NR5GC) */ @@ -106,14 +106,14 @@ module NG_NAS_Common { const MessageType tsc_MT_NG_PDUSessionReleaseCommand := '11010011'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const MessageType tsc_MT_NG_PDUSessionReleaseComplete := '11010100'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const MessageType tsc_MT_NG_GSM_Status := '11010110'B; /* @status APPROVED (NR5GC) */ - + const MessageType tsc_MsgType_NSSAI_DeleteReq := '10100110'B; /* @sic R5-201207 sic@ @status APPROVED (NR5GC) */ const MessageType tsc_MsgType_NSSAI_DeleteResp := '10100111'B; /* @sic R5s200339 sic@ @status APPROVED (NR5GC) */ const MessageType tsc_MsgType_SetUAIReq := '10101000'B; /* @status APPROVED (NR5GC) */ const MessageType tsc_MsgType_SetUAIResp := '10101001'B; /* @status APPROVED (NR5GC) */ - + const B8_Type tsc_DeleteNSSAI_DefaultConfiguredNSSAI := '00000000'B; /* @status APPROVED (NR5GC) */ const B8_Type tsc_DeleteNSSAI_ConfiguredNSSAI := '00000001'B; /* @sic R5s200339 sic@ @status APPROVED (NR5GC) */ @@ -125,7 +125,7 @@ module NG_NAS_Common { type enumerated NG_ALL_STATE_Type {STATE_OFF_0A, STATE_OFF_0B, STATE_IDLE_1A, STATE_INACTIVE_2A, STATE_CONNECTED_3A, STATE_CONNECTED_3A_T3540, /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ STATE_DEREGISTERED, STATE_EMERGENCY_RELEASE_CONNECTED, STATE_EMERGENCY_RELEASE_IDLE}; // Used for Postamble @sic R5-214620 sic@ type NG_ALL_STATE_Type NG_STATE_Type (STATE_OFF_0A, STATE_OFF_0B, STATE_IDLE_1A, STATE_INACTIVE_2A, STATE_CONNECTED_3A, STATE_CONNECTED_3A_T3540); // Used for Preamble /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + const B3_Type tsc_NG_RegistrationInitial := '001'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const B3_Type tsc_NG_RegistrationMobility := '010'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const B3_Type tsc_NG_RegistrationPeriodic := '011'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -134,13 +134,13 @@ module NG_NAS_Common { const B3_Type tsc_NG_RegResult_3GPP := '001'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const B3_Type tsc_NG_RegResult_Non3GPP := '010'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const B3_Type tsc_NG_RegResult_Both := '011'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + const B4_Type tsc_PayloadContainerSMSMsg := '0010'B; /* @status APPROVED (NR5GC) */ const B4_Type tsc_PayloadContainerLPPMsg := '0011'B; /* @status APPROVED (POS) */ const B4_Type tsc_PayloadContainerSORMsg := '0100'B; /* @status APPROVED (NR5GC) */ const B4_Type tsc_PayloadContainerUEPolicyMsg := '0101'B; const B4_Type tsc_PayloadContainerCIoTUserData := '1000'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + const O1_Type tsc_QoSFlowParameter_5QI := '01'O; /* @status APPROVED (ENDC, IMS, NR5GC, NR5GC_IRAT, POS) */ const O1_Type tsc_QoSFlowParameter_GFBR_UL := '02'O; /* @status APPROVED (ENDC, IMS, NR5GC, NR5GC_IRAT, POS) */ const O1_Type tsc_QoSFlowParameter_GFBR_DL := '03'O; /* @status APPROVED (ENDC, IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -160,12 +160,12 @@ module NG_NAS_Common { const NAS_IdType tsc_IdType_NG_IMEI := '011'B; /* @status APPROVED (NR5GC) */ const NAS_IdType tsc_IdType_NG_STMSI := '100'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ const NAS_IdType tsc_IdType_NG_IMEISV := '101'B; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ - + const NAS_CauseValue_Type tsc_NR5GCCause_ServNetNotAuthorized := '01001001'B; /* @status APPROVED (NR5GC) */ const NAS_CauseValue_Type tsc_NR5GCCause_InvalidPDUSessionIdentity := '00101011'B; /* @status APPROVED (NR5GC) */ const NAS_CauseValue_Type tsc_NR5GCCause_NoSuitableCellsInTA := '00001111'B; /* @status APPROVED (NR5GC) */ const NAS_CauseValue_Type tsc_NR5GCCause_Congestion := '00010110'B; /* @status APPROVED (NR5GC) */ - + type record NG_NAS_GutiParameters_Type { /* to be stored in component @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ B8_Type AMF_RegionId, @@ -182,10 +182,10 @@ module NG_NAS_Common { packetFilterId := p_Id, len := int2oct(lengthof(p_Component), 1), contents := p_Component - + }} }; - + template (value) QoS_Rule cs_QoS_RuleRemoteAccess (O1_Type p_Id, B1_Type p_DQR, O1_Type p_Precedence, @@ -237,7 +237,7 @@ module NG_NAS_Common { typeOfId := tsc_IdType_NG_STMSI, otherDigits := p_Guti }; - + template (present) NG_MobileIdentity cr_NG_MobileIdentity_TypeOfId(template (present) B4_Type p_FirstDigit, template (present) B1_Type p_OddEvenInd, template (present) octetstring p_OtherDigits, @@ -251,7 +251,7 @@ module NG_NAS_Common { typeOfId := p_TypeOfId, // 3 bits otherDigits := p_OtherDigits }; - + template (present) NG_MobileIdentity cr_NG_MobileIdentitySUCI(template (present) B4_Type p_SUPIFormat, template (present) octetstring p_OtherDigits) := { /* @status APPROVED (NR5GC) */ @@ -262,7 +262,7 @@ module NG_NAS_Common { typeOfId := tsc_IdType_NG_SUCI, // 3 bits otherDigits := p_OtherDigits }; - + template (present) NG_MobileIdentity cr_NG_MobileIdentityNoIdentity := { /* @status APPROVED (NR5GC) */ iei := omit, @@ -306,7 +306,7 @@ module NG_NAS_Common { var octetstring v_STMSIString := bit2oct(v_AMFId) & bit2oct(p_GutiParams.NG_TMSI); return cs_NG_MobileIdentity_STMSI(p_IEI, v_STMSIString); } - + //---------------------------------------------------------------------------- /* * @desc Convert from IMEISV of type hexstring to NAS NG_MobileIdentity @@ -321,10 +321,10 @@ module NG_NAS_Common { var octetstring v_Other := f_ImsiImei2Octetstring (p_IMEISV); var B4_Type v_FirstDigit := hex2bit(p_IMEISV[0]); var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); - + return cr_NG_MobileIdentity_TypeOfId(v_FirstDigit, v_OddEvenInd, v_Other); } - + //---------------------------------------------------------------------------- /* * @desc To convert the RejectedS_NSSAI into a charstring for the AT command @@ -336,7 +336,7 @@ module NG_NAS_Common { { var RejectedS_NSSAI v_S_NSSAI := valueof(p_S_NSSAI); var charstring v_S_NSSAIstring := ""; - + v_S_NSSAIstring := oct2str(v_S_NSSAI.sst); if (ispresent(v_S_NSSAI.sd)) { v_S_NSSAIstring := v_S_NSSAIstring & "." & oct2str(v_S_NSSAI.sd); @@ -344,7 +344,7 @@ module NG_NAS_Common { v_S_NSSAIstring := v_S_NSSAIstring & "#" & int2str(bit2int(v_S_NSSAI.causeValue)); // @sic R5s201142 sic@ return v_S_NSSAIstring; } - + /* * @desc To convert the NSSAI (list of S_NSSAI_Type) into a charstring for the AT command * @param p_NSSAI @@ -357,7 +357,7 @@ module NG_NAS_Common { var integer v_Length := lengthof(p_NSSAI.rejectS_NSSAI); var charstring v_ListOfNSSAI := ""; var charstring v_S_NSSAI := ""; - + for (i := 0; i < v_Length; i := i+1) { v_S_NSSAI := f_ConvertRejectedS_NSSAI_ForATCommand(p_NSSAI.rejectS_NSSAI[i]); v_ListOfNSSAI := v_ListOfNSSAI & v_S_NSSAI; @@ -379,7 +379,7 @@ module NG_NAS_Common { var integer v_Length := lengthof(p_NSSAI.partialXtd); var charstring v_ListOfNSSAI := ""; var charstring v_S_NSSAI := ""; - + for (i := 0; i < v_Length; i := i+1) { v_S_NSSAI := f_ConvertPartialXtdRejectedS_NSSAI_ForMMICommand(p_NSSAI.partialXtd[i]); v_ListOfNSSAI := v_ListOfNSSAI & v_S_NSSAI; @@ -403,7 +403,7 @@ module NG_NAS_Common { var integer v_NumOfElements; var integer i; var charstring v_S_NSSAIstring := ""; - + if (ischosen (v_Partial_NSSAI.type0)) { v_NumOfElements := bit2int(v_Partial_NSSAI.type0.numOfElements); v_Xtd_List := v_Partial_NSSAI.type0.rejectS_NSSAI; @@ -412,7 +412,7 @@ module NG_NAS_Common { v_NumOfElements := bit2int(v_Partial_NSSAI.type1.numOfElements); v_Xtd_List := v_Partial_NSSAI.type1.rejectS_NSSAI; } - + for (i := 0; i < v_NumOfElements; i := i+1) { v_XtdRejectedS_NSSAI := v_Xtd_List[i]; v_S_NSSAIstring := v_S_NSSAIstring & f_ConvertXtdRejectedS_NSSAI_ForMMICommand(v_XtdRejectedS_NSSAI); @@ -422,7 +422,7 @@ module NG_NAS_Common { } return v_S_NSSAIstring; } - + /* * @desc To convert the XtdRejectedS_NSSAI into a charstring for the AT command * @param p_Xtd_NSSAI @@ -431,12 +431,12 @@ module NG_NAS_Common { function f_ConvertXtdRejectedS_NSSAI_ForMMICommand(XtdRejectedS_NSSAI p_Xtd_NSSAI) return charstring { var charstring v_S_NSSAIstring := ""; - + v_S_NSSAIstring := f_ConvertS_NSSAI_VForMMICommand(p_Xtd_NSSAI.snssai); v_S_NSSAIstring := v_S_NSSAIstring & "#" & int2str(bit2int(p_Xtd_NSSAI.causeValue)); return v_S_NSSAIstring; } - + /* * @desc To convert the S_NSSAI_V into a charstring for the AT command * @param p_S_NSSAI @@ -445,7 +445,7 @@ module NG_NAS_Common { function f_ConvertS_NSSAI_VForMMICommand(S_NSSAI_V p_S_NSSAI) return charstring { var charstring v_S_NSSAIstring := ""; - + v_S_NSSAIstring := oct2str(p_S_NSSAI.sst); if (ispresent(p_S_NSSAI.sd)) { v_S_NSSAIstring := v_S_NSSAIstring & "." & oct2str(p_S_NSSAI.sd); @@ -458,7 +458,7 @@ module NG_NAS_Common { } return v_S_NSSAIstring; } - + /* * @desc To convert the S_NSSAI into a charstring for the AT command * @param p_S_NSSAI @@ -469,7 +469,7 @@ module NG_NAS_Common { { var S_NSSAI_LV v_S_NSSAI := valueof(p_S_NSSAI); var charstring v_S_NSSAIstring := ""; - + v_S_NSSAIstring := oct2str(v_S_NSSAI.vPart.sst); // @sic R5s221179 Baseline Moving sic@ if (ispresent(v_S_NSSAI.vPart.sd)) { v_S_NSSAIstring := v_S_NSSAIstring & "." & oct2str(v_S_NSSAI.vPart.sd); // @sic R5s221179 Baseline Moving sic@ @@ -482,7 +482,7 @@ module NG_NAS_Common { } return v_S_NSSAIstring; } - + /* * @desc To convert the NSSAI (list of S_NSSAI_Type) into a charstring for the AT command * @param p_NSSAI @@ -495,7 +495,7 @@ module NG_NAS_Common { var integer v_Length := lengthof(p_NSSAI.lvPart.s_nssai); // @sic R5s221179 Baseline Moving sic@ var charstring v_ListOfNSSAI := ""; var charstring v_S_NSSAI := ""; - + for (i := 0; i < v_Length; i := i+1) { v_S_NSSAI := f_ConvertS_NSSAI_ForATCommand(p_NSSAI.lvPart.s_nssai[i]); // @sic R5s221179 Baseline Moving sic@ v_ListOfNSSAI := v_ListOfNSSAI & v_S_NSSAI; // @sic R5s200339 sic@ @@ -505,7 +505,7 @@ module NG_NAS_Common { } return v_ListOfNSSAI; } - + /* * @desc To build QoS Rule for Remote Access * @param p_RuleNum @@ -521,7 +521,7 @@ module NG_NAS_Common { var octetstring v_Component; var O2_Type v_Length; var B4_Type v_FilterId; - + select (p_RuleNum) { case ("3") { v_Id := int2oct(str2int(p_RuleNum),1); @@ -593,7 +593,7 @@ module NG_NAS_Common { { var template (value) PacketFilterComponent v_Component; var bitstring v_EncodedComponent; - + v_Component := cs_PktFilterCompIPv4RemoteAddress(fl_GetIPv4Address(p_FilterNum), tsc_IPv4Mask); v_EncodedComponent := encvalue(v_Component); return bit2oct(v_EncodedComponent); @@ -609,13 +609,13 @@ module NG_NAS_Common { { var O1_Type v_PrefixLength := '64'O; var octetstring v_PacketFilter; - + v_PacketFilter := '21'O; // id = IPv6 remote address / Prefix length v_PacketFilter := v_PacketFilter & f_Convert_IPv6Addr2OctString(fl_GetIPv6Address(p_FilterNum)); v_PacketFilter := v_PacketFilter & v_PrefixLength; return v_PacketFilter; } - + /* * @desc Build an IPv4 address according to 38.508-1 cl. 4.8.2 * @param p_FilterNum @@ -702,7 +702,7 @@ module NG_NAS_Common { var UInt8_Type v_Protocol := tsc_IP_Protocol_UDP; var O4_Type v_IPSecSPI := '0F80F000'O; var boolean v_IpTypeIsIPv4 := false; - + if (pc_IPv6) {} //variable initialised to false else if (pc_IPv4) { v_IpTypeIsIPv4 := true; @@ -710,7 +710,7 @@ module NG_NAS_Common { else { FatalError(__FILE__, __LINE__, "Neither IPv4 nor IPv6 supported"); } - + return f_PacketFilterTest_CreateDatagram(v_IpTypeIsIPv4, v_Protocol, v_IPv4_SourceAddr, @@ -723,5 +723,5 @@ module NG_NAS_Common { v_IPSecSPI, v_TOS_TC); } - + } with { encode "RAW"/*"NAS Types"*/} diff --git a/ttcn/Lib3GPP/NG_NAS/NG_NAS_SecurityFunctions.ttcn b/ttcn/Lib3GPP/NG_NAS/NG_NAS_SecurityFunctions.ttcn index 1822e7652643dc4e4e9076f6ffaca72a60a17eb4..5a90d5b1ed3d07c78fd281aeb585132e58e8263b 100644 --- a/ttcn/Lib3GPP/NG_NAS/NG_NAS_SecurityFunctions.ttcn +++ b/ttcn/Lib3GPP/NG_NAS/NG_NAS_SecurityFunctions.ttcn @@ -17,10 +17,10 @@ module NG_NAS_SecurityFunctions { import from Parameters all; import from NAS_5GC_Parameters all; import from EAP_TypeDefs all; - + //============================================================================ // constants and types - + type record NG_NAS_SecurityParams_Type { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ // Keys shared with NR KDF_Type KDF, @@ -63,14 +63,14 @@ module NG_NAS_SecurityFunctions { NAS_Ciphering := cs_NG_NAS_SecurityInfo (px_NAS_5GC_CipheringAlgorithm, tsc_AuthUndefinedB128), AuthParams := cs_CommonAuthParams_Init (px_eAuthRAND) }; - + template (value) NG_NAS_SecurityInfo_Type cs_NG_NAS_SecurityInfo(B4_Type p_Algo, B128_Key_Type p_Key) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ Algorithm := p_Algo, K_NAS := p_Key }; - + template (value) EAP_Message_Type cs_EAP_Request_AKAChallenge(O2_Type p_Length, template (value) EAP_AT_RAND p_RAND, template (value) EAP_AT_AUTN p_AUTN, @@ -114,7 +114,7 @@ module NG_NAS_SecurityFunctions { } } }; - + template (present) EAP_Message_Type cr_EAP_Response_AKAChallenge(O2_Type p_Length, template (present) EAP_AT_RES p_RES, template (present) EAP_AT_MAC p_MAC, @@ -156,7 +156,7 @@ module NG_NAS_SecurityFunctions { } } }; - + template (value) EAP_Message_Type cs_EAP_Success (O1_Type p_Id := '00'O) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ success := { @@ -165,7 +165,7 @@ module NG_NAS_SecurityFunctions { len := '0004'O // RFC 3748 cl. 4.1 } }; - + template (value) EAP_Message_Type cs_EAP_Failure (O1_Type p_Id := '00'O) := { /* @status APPROVED (NR5GC) */ failure := { @@ -174,7 +174,7 @@ module NG_NAS_SecurityFunctions { len := '0004'O // RFC 3748 cl. 4.1 } }; - + template (value) EAP_AT_RAND cs_EAP_AT_RAND (O16_Type p_Rand) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ // RFC 4187 cl. 10.6 @@ -222,7 +222,7 @@ module NG_NAS_SecurityFunctions { reslen := p_ActualLength, res := p_Res }; - + //---------------------------------------------------------------------------- /* * @desc Used when building the network name from the PLMN @@ -234,7 +234,7 @@ module NG_NAS_SecurityFunctions { { var charstring v_MNC := ""; var hexstring v_PLMN_hexstring := oct2hex(p_NAS_PlmnId); - + if (v_PLMN_hexstring[2] == 'F'H) { v_MNC := "0"; } @@ -244,7 +244,7 @@ module NG_NAS_SecurityFunctions { } return v_MNC; } - + /* * @desc Used when building the network name from the PLMN * @param p_NAS_PlmnId @@ -255,9 +255,9 @@ module NG_NAS_SecurityFunctions { { var charstring v_MCC; var hexstring v_PLMN_hexstring := oct2hex(p_NAS_PlmnId); - + v_MCC := hex2str(v_PLMN_hexstring[1]) & hex2str(v_PLMN_hexstring[0]) & hex2str(v_PLMN_hexstring[3]); - + return v_MCC; } @@ -277,7 +277,7 @@ module NG_NAS_SecurityFunctions { } return char2oct (v_P0); } - + /* * @desc To build the NAI * @param p_PLMN @@ -289,7 +289,7 @@ module NG_NAS_SecurityFunctions { var charstring v_P0 := hex2str(p_Identity) & "@nai.5gc.mnc" & fl_Nas2SNN_MNC(p_PLMN) & ".mcc" & fl_Nas2SNN_MCC(p_PLMN) & ".3gppnetwork.org"; // @sic R5s230215 sic@ return char2oct (v_P0); } - + //============================================================================ // Group of S functions defined in Annex A of 33.501 //---------------------------------------------------------------------------- @@ -312,7 +312,7 @@ module NG_NAS_SecurityFunctions { const octetstring const_S6A_FC := '6A'O; var octetstring v_S; var octetstring v_P0; - + // Generation of String v_S := const_S6A_FC; //FC = 0x6A @@ -349,7 +349,7 @@ module NG_NAS_SecurityFunctions { const octetstring const_S20_FC := '20'O; var octetstring v_S; var octetstring v_P0; - + // Generation of String v_S := const_S20_FC; //FC = 0x20 @@ -417,14 +417,14 @@ module NG_NAS_SecurityFunctions { v_S := ( v_S & int2oct(px_NAS_5GC_XRES_Length, 2) ); // @sic R5w190117 sic@ log("f_NG_Authentication_A4: v_S=", v_S); //L2 = length of RES/XRES (e.g. 0x00 0x10) - + var bitstring bs := fx_KeyDerivationFunction(p_KDF, p_Key, v_S); // Already 128 bits length - + return bs; //return substr(fx_KeyDerivationFunction(p_KDF, p_Key, v_S), 128, 128); // returns LSB 128 bits[truncated] of the key generated } - + //-------------------------------------------------------------------------- /* * @desc KSEAF derivation function @@ -453,10 +453,10 @@ module NG_NAS_SecurityFunctions { //P0 = serving network ID v_S := (v_S & int2oct(lengthof(v_P0), 2)) ; //L0 = length of serving network ID - + return fx_KeyDerivationFunction(p_KDF_Type, p_KAUSF, v_S); }; - + //-------------------------------------------------------------------------- /* * @desc KAMF derivation function @@ -477,7 +477,7 @@ module NG_NAS_SecurityFunctions { var octetstring v_S; var octetstring v_P0 := char2oct(p_SUPI); // @sic R5s190109 sic@ var octetstring v_P1 := p_ABBA; - + // Generation of String v_S := const_S6D_FC; //FC = 0x6D @@ -489,10 +489,10 @@ module NG_NAS_SecurityFunctions { //P0 = serving network ID v_S := (v_S & int2oct(lengthof(v_P1), 2)) ; //L1 = length of ABBA - + return fx_KeyDerivationFunction(p_KDF_Type, p_KSEAF, v_S); } - + //-------------------------------------------------------------------------- /* * @desc SOR MAC-I AUSF derivation function @@ -513,7 +513,7 @@ module NG_NAS_SecurityFunctions { { const octetstring const_S77_FC :='77'O; var octetstring v_S; - + // Generation of String v_S := const_S77_FC; //FC = 0x77 @@ -532,7 +532,7 @@ module NG_NAS_SecurityFunctions { return substr(fx_KeyDerivationFunction(p_KDF_Type, p_KAUSF, v_S), 128, 128); // returns LSB 128 bits[truncated] of the key generated } - + //-------------------------------------------------------------------------- /* * @desc SOR MAC-I UE derivation function @@ -549,7 +549,7 @@ module NG_NAS_SecurityFunctions { { const octetstring const_S78_FC :='78'O; var octetstring v_S; - + // Generation of String v_S := const_S78_FC; //FC = 0x78 @@ -565,7 +565,7 @@ module NG_NAS_SecurityFunctions { return substr(fx_KeyDerivationFunction(p_KDF_Type, p_KAUSF, v_S), 128, 128); // returns LSB 128 bits[truncated] of the key generated } - + //-------------------------------------------------------------------------- /* * @desc HASH AMF derivation function @@ -579,10 +579,10 @@ module NG_NAS_SecurityFunctions { { var B256_Type v_Key := int2bit(0, 256); var B256_Type v_Result := fx_KeyDerivationFunction(p_KDF_Type, v_Key, p_NASMsg); - + return substr(v_Result, 192, 64); }; - + //-------------------------------------------------------------------------- //============================================================================ // Initialisations: @@ -611,14 +611,14 @@ module NG_NAS_SecurityFunctions { { var NG_NAS_SecurityParams_Type v_Auth_Params := p_Auth_Params; var B128_Type v_XRESstar; - + // Generates Ck, Ik, AUTN, XRES if (isvalue(p_Common_AuthenticationParams)) { v_Auth_Params.AuthParams := valueof(p_Common_AuthenticationParams); } else { v_Auth_Params.AuthParams := f_AuthenticationInit(v_Auth_Params.AuthParams, p_AuthenticationError); // @sic R5-197217 sic@ } - + v_Auth_Params.Ks := v_Auth_Params.AuthParams.CK & v_Auth_Params.AuthParams.IK; // As per 33.501 clause 6.1.3.2 // Generates KAUSF @@ -656,22 +656,22 @@ module NG_NAS_SecurityFunctions { template (omit) hexstring p_NID := omit) return NG_NAS_SecurityParams_Type { var NG_NAS_SecurityParams_Type v_Auth_Params := p_Auth_Params; - + // update KSI v_Auth_Params.KSIamf := f_Authentication_IncrementKeySeq(v_Auth_Params.KSIamf); - + // Generate KSEAF v_Auth_Params.KSEAF := f_NG_Authentication_A6(p_PLMN, v_Auth_Params.KAUSF, v_Auth_Params.KDF, p_NID); //@sic R5s220753 sic@ - + // Generate KAMF v_Auth_Params.KAMF := f_NG_Authentication_A7(p_Identity, // @sic R5s190109, R5s230215 sic@ v_Auth_Params.KSEAF, v_Auth_Params.ABBA, v_Auth_Params.KDF); - + // Derive KNASenc key v_Auth_Params.NAS_Ciphering.K_NAS := f_NG_Authentication_A8(tsc_NAS_Enc_Alg, v_Auth_Params.NAS_Ciphering.Algorithm, @@ -720,7 +720,7 @@ module NG_NAS_SecurityFunctions { // Generates Ck, Ik, AUTN, XRES according to TS 33.102 and TS 34.108 v_Auth_Params.AuthParams := f_AuthenticationInit(v_Auth_Params.AuthParams, p_AuthenticationError); // @sic R5s201223 sic@ } - + v_Auth_Params.Ks := v_Auth_Params.AuthParams.CK & v_Auth_Params.AuthParams.IK; // Generates Ck' and IK' v_Ck_Ik_ := f_NG_Authentication_A3(v_Auth_Params.AuthParams, @@ -730,23 +730,23 @@ module NG_NAS_SecurityFunctions { p_NID); // @sic R5s220753 sic@ v_Ck_ := substr (v_Ck_Ik_, 0, 128); v_Ik_ := substr (v_Ck_Ik_, 128, 128); - + // RFC 5448 cl. 3.3 v_K := v_Ik_ & v_Ck_; v_S := "EAP-AKA'" & p_Identity; // Master Key v_MK := f_ExtendedEAPAKA_PRF (v_K, char2oct (v_S)); v_Auth_Params.MK := v_MK; - + // As per 33.501 clause 6.1.3.1 // KAUSF is EMSK in RFC 5448 cl. 3.3 v_Auth_Params.KAUSF := substr (v_MK, 1152, 256); - + // Now update the other parameters (common to 5GAKA and EAP) v_Auth_Params := fl_NG_NAS_AuthenticationInitOtherParams (v_Auth_Params, p_PLMN, p_Identity, p_NID); // @sic R5s220753, R5s230215 sic@ return v_Auth_Params; } - + /* * @desc Generate and encode EAP-AKA' challenge according TS 33.501 clause 6.1.3.1 and RFC 5448 * @param p_Auth_Params @@ -776,17 +776,17 @@ module NG_NAS_SecurityFunctions { var integer v_Len; var integer v_Paddinglen; var integer i; - - + + v_RAND := cs_EAP_AT_RAND (bit2oct(p_Auth_Params.AuthParams.RandValue)); v_Msglen := v_Msglen + 5*4; - + v_AUTN := cs_EAP_AT_AUTN (bit2oct(p_Auth_Params.AuthParams.AUTN)); v_Msglen := v_Msglen + 5*4; - + v_KDF := cs_EAP_AT_KDF; v_Msglen := v_Msglen + 4; - + v_Len := lengthof(v_NetworkName); if (v_Len mod 4 > 0) { v_Paddinglen := 4 - v_Len mod 4; @@ -797,26 +797,26 @@ module NG_NAS_SecurityFunctions { v_KDF_INPUT := cs_EAP_AT_KDF_INPUT (v_NetworkName, int2oct(v_Len, 2)); v_Msglen := v_Msglen + lengthof(v_NetworkName) + 4; - + v_MAC := cs_EAP_AT_MAC (v_MACValue); v_Msglen := v_Msglen + 5*4; - + // Build the message with MAC=0 v_EAP_Message := cs_EAP_Request_AKAChallenge(int2oct(v_Msglen, 2), v_RAND, v_AUTN, v_KDF, v_KDF_INPUT, v_MAC, p_Id); // @sic R5s201410 sic@ - + // Compute MAC according to RFC 5448 cl. 3.4.2 v_EncodedMsg := encvalue(v_EAP_Message); v_K_aut := substr(p_Auth_Params.MK, 128,256); // RFC 5448 cl. 3.3 K_aut to be used for computing MAC @sic R5s200400 sic@ v_MACValue := bit2oct(substr(f_HMAC_SHA_256(v_K_aut, bit2oct(v_EncodedMsg)), 0, 128)); // @sic R5s200400 sic@ v_MAC := cs_EAP_AT_MAC (v_MACValue); - + // Finally return the complete EAP-AKA' challenge with correct MAC return (bit2oct(encvalue(cs_EAP_Request_AKAChallenge (int2oct(v_Msglen, 2), v_RAND, v_AUTN, v_KDF, v_KDF_INPUT, v_MAC, p_Id)))); // @sic R5s201410 sic@ - + } /* @@ -846,16 +846,16 @@ module NG_NAS_SecurityFunctions { var integer v_Len; var integer v_Paddinglen; var integer i; - + if (decvalue(v_ReceivedEAP, v_EAP_Message) != 0) { FatalError(__FILE__, __LINE__, "EAP message cannot be decoded"); } - + //get length in bits of received RES (as it's a variable length, need to compare the correct length) v_Len := oct2int(v_EAP_Message.akaChallenge_Rsp.attributes.res.reslen); // store this in the global info p_Auth_Params.AuthParams.XRESLength := v_Len / 8; - + // Get the RES value from the global info v_RESValue := substr(p_Auth_Params.AuthParams.XRES, 0, v_Len); // Now pad it so that it's (hopefully) the same length of the received value @@ -866,12 +866,12 @@ module NG_NAS_SecurityFunctions { v_RESValue := v_RESValue & '0'B; } } - + // Check message is AKAChallenge, length and AT_RES is correct if (match (v_EAP_Message, cr_EAP_Response_AKAChallenge(int2oct(lengthof(p_ReceivedEAP), 2), cr_EAP_AT_RES (bit2oct(v_RESValue), int2oct(v_Len, 2)), ?, p_ResultInd, p_Id))) { // @sic R5-201142, R5s201483 sic@ // Then test MAC v_RxdMAC := v_EAP_Message.akaChallenge_Rsp.attributes.mac.mac; - + // First build the message with MAC=0 v_ModifiedEAP := fl_NG_EAP_Response_ClearMACValue(p_ReceivedEAP); // @sic R5s210153 sic@ // Compute MAC according to RFC 5448 cl. 3.4.2 @@ -884,7 +884,7 @@ module NG_NAS_SecurityFunctions { } return v_Result; } - + /* * @desc Local function to find then replace the value in the MAC attribute of the received EAP message with all 0s, @@ -900,7 +900,7 @@ module NG_NAS_SecurityFunctions { var octetstring v_ModifiedEAP := p_ReceivedEAP; var integer i := 8; /* according to RFC 4187 clause 8.1 the EAP-AKA header is 8 octets */ var integer k; - + while (p_ReceivedEAP[i] != '0B'O) { /* MAC attribute type is 11 according to RFC 4187 clause 11 */ i := i + (oct2int(p_ReceivedEAP[i+1]) * 4); if (i > lengthof(p_ReceivedEAP)) { @@ -913,5 +913,5 @@ module NG_NAS_SecurityFunctions { } return v_ModifiedEAP; } - + } diff --git a/ttcn/Lib3GPP/NG_NAS/NG_NAS_Templates.ttcn b/ttcn/Lib3GPP/NG_NAS/NG_NAS_Templates.ttcn index f82cfed8e30124d8801ef0b37a7f4925bf5e75aa..6707134423bdc8c632d928191545b3f434fb1064 100644 --- a/ttcn/Lib3GPP/NG_NAS/NG_NAS_Templates.ttcn +++ b/ttcn/Lib3GPP/NG_NAS/NG_NAS_Templates.ttcn @@ -24,22 +24,22 @@ module NG_NAS_Templates { // common NAS message (security protected or non security protected) //---------------------------------------------------------------------------- // templates for NAS_SecurityProtectionInfo_Type - + template (value) NG_NAS_SecurityProtectionInfoDL_Type cs_NG_NAS_SecurityProtectionInfo(SecurityHeaderType p_Status, boolean p_ForceMacError := false) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ Status := p_Status, ForceMacError := p_ForceMacError }; - + template (present) NG_NAS_SecurityProtectionInfoUL_Type cr_NG_NAS_SecurityProtectionInfo(template (present) SecurityHeaderType p_ExpectedStatus) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ Status := p_ExpectedStatus, NasCount := ? }; - + // common templates for security-protected or non security-protected NAS messages - + template (value) NG_NAS_MSG_Request_Type cs_NG_NAS_Request(SecurityHeaderType p_SecurityStatus, template (value) NG_NAS_DL_Message_Type p_Msg) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -49,8 +49,8 @@ module NG_NAS_Templates { PiggybackedPduList := omit } }; - - + + template (present) NG_NAS_MSG_Indication_Type cr_NG_NAS_Ind(template (present) SecurityHeaderType p_ExpectedSecurityStatus, template (present) NG_NAS_UL_Message_Type p_Msg := ?) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -60,14 +60,14 @@ module NG_NAS_Templates { PiggybackedPduList := omit } }; - + template (value) NG_NAS_MSG_Request_Type cs_NG_NAS_RequestWithPiggybacking(SecurityHeaderType p_SecurityStatus, template (value) NG_NAS_DL_Pdu_Type p_PiggyBackList) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ SecurityProtection := cs_NG_NAS_SecurityProtectionInfo(p_SecurityStatus), Pdu := p_PiggyBackList }; - + template (value) NG_NAS_DL_Pdu_Type cs_NG_NAS_DL_PduWithPiggybacking(template (value) NG_NAS_DL_Message_Type p_GmmMsg, template (value) NG_NAS_DL_Message_Type p_PiggyBackedMsg) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -79,13 +79,13 @@ module NG_NAS_Templates { } } }; - + template (value) NG_NAS_DL_Pdu_Type cs_NG_NAS_DL_PduWithoutPiggyback(template (value) NG_NAS_DL_Message_Type p_GmmMsg) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ Msg := p_GmmMsg, PiggybackedPduList := omit }; - + template (present) NG_NAS_MSG_Indication_Type cr_NG_NAS_IndWithPiggybacking(template (present) SecurityHeaderType p_ExpectedSecurityStatus, template (present) NG_NAS_UL_Pdu_Type p_PiggyBackList := ?) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -285,7 +285,7 @@ module NG_NAS_Templates { ngRAN_RCU := p_NgRAN_RCU, smsRequested := p_SmsRequested }; - + template (omit) NG_NAS_DL_Message_Type cs_NG_REGISTRATION_ACCEPT(template (value) RegistrationResult p_RegistrationResult, template (omit) NG_MobileIdentity p_GUTI, template (omit) PLMN_List p_EPLMNs, @@ -434,7 +434,7 @@ module NG_NAS_Templates { '73'O, int2oct(lengthof(p_Data) + 19, 2)); - + template (omit) SORTransparentContainer cs_NG_SORTransparentContainerValue(template (value) SOR_Header p_Header, O16_Type p_Mac_UE, template (omit) O2_Type p_Counter := omit, @@ -450,7 +450,7 @@ module NG_NAS_Templates { counter := p_Counter, data := p_Data }; - + template (present) SORTransparentContainer cr_NG_SORTransparentContainerValue(template (present) SOR_Header p_Header, O16_Type p_Mac_UE, template (omit) O2_Type p_Counter := omit, @@ -481,7 +481,7 @@ module NG_NAS_Templates { listInd_MSSI :=p_ListInd, dataType :=p_DataType }; - + template(present) SOR_Header cr_NG_SOR_Header(B1_Type p_Ack, template(present) B1_Type p_ListType, template(present) B1_Type p_ListInd, @@ -601,7 +601,7 @@ module NG_NAS_Templates { ngMobileId := p_MobileId /* cl. 9.11.3.4 M LV 5-? */ } }; - + template (value) NG_NAS_DL_Message_Type cs_NG_DEREGISTRATION_ACCEPT := { /* @status APPROVED (NR5GC) */ /* 24.501 cl. 8.2.13/15 (DL) */ @@ -693,7 +693,7 @@ module NG_NAS_Templates { pagingRestrict := p_PagingRestrict /* cl. 9.11.3.77 O TLV 3-35 IEI=28 Sep22 @sic R5s221179 Baseline Moving sic@ */ } }; - + template (present) NG_NAS_UL_Message_Type cr_NG_SERVICE_REQUEST (template (present) B4_Type p_ServiceType, template (present) NAS_KeySetIdentifier p_KSI, template (present) NG_MobileIdentity p_S_TMSI, @@ -857,7 +857,7 @@ module NG_NAS_Templates { priorityInd := p_PriorityInd /* cl. 9.11.3.91 O TV 1 IEI=E- Sep22 @sic R5s221179 Baseline Moving sic@ */ } } - + template (present) NG_NAS_UL_Message_Type cr_NG_CONFIGURATION_UPDATE_COMPLETE := { /* @status APPROVED (NR5GC) */ /* 24.501 cl. 8.2.20 */ @@ -868,7 +868,7 @@ module NG_NAS_Templates { messageType := tsc_MT_NG_ConfigurationUpdateComplete /* cl. 9.7 M V 1 */ } }; - + template (value) NG_NAS_DL_Message_Type cs_NG_IDENTITY_REQUEST(NAS_IdType p_IdType) := { /* @status APPROVED (NR5GC) */ identity_Request :={ @@ -880,7 +880,7 @@ module NG_NAS_Templates { identityType := cs_IdentityType(p_IdType) } }; - + template (present) NG_NAS_UL_Message_Type cr_NG_IDENTITY_RESPONSE(template (present) NG_MobileIdentity p_MobileId) := { /* @status APPROVED (NR5GC) */ identity_Response :={ @@ -891,7 +891,7 @@ module NG_NAS_Templates { ngMobileId := p_MobileId } }; - + template (omit) NG_NAS_DL_Message_Type cs_NG_SECURITY_MODE_COMMAND(template (value) NG_NAS_SecurityAlgorithms p_Algs, NAS_KsiValue p_KeySetId, NG_UE_SecurityCapability p_UECap, @@ -1319,7 +1319,7 @@ module NG_NAS_Templates { extdProtocolConfigurationOptions := p_ExtdPCO /* cl. 9.11.4.6 O TLV-E 4-65538 IEI=0x7B */ } }; - + template (present) NG_NAS_UL_Message_Type cr_NG_GSM_STATUS (template (present) NG_PDU_SessionId p_PDU_SessionId, template ProcedureTransactionIdentifier p_PTI := *, template GMM_GSM_Cause p_Cause := *) := @@ -1333,7 +1333,7 @@ module NG_NAS_Templates { gsmCause := p_Cause /* cl. 9.11.4.2 M V 1 IEI=59 */ } }; - + //---------------------------------------------------------------------------- // NG Mobility Management (GMM) information elements (24.501 cl. 9.11.3) //---------------------------------------------------------------------------- @@ -1395,13 +1395,13 @@ module NG_NAS_Templates { { /* @status APPROVED (NR5GC_IRAT) */ iwk_N26 := '1'B }; - + template (value) NG_NetworkFeatureSupport cds_NG_NetworkFeatureSupport_NoImsVoPS_3GPP modifies cs_NG_NetworkFeatureSupport_Def := { /* @status APPROVED (NR5GC) */ imsVoPS_3GPP := '0'B }; - + template (value) RegistrationResult cs_RegistrationResult(B3_Type p_Result, B1_Type p_SMS, B1_Type p_EmergencyRegistered, @@ -1433,14 +1433,14 @@ module NG_NAS_Templates { iel := '0000'O, listOfCAGInfos := omit }; - + template (present) AuthenticationResponseParameter cr_AuthenticationResponseParameter(template (present) B32_128_Type p_ExpectedRES) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ iei := '2D'O, iel := ?, /* RES has length of 32..128 bits i.e. 4..16 octets */ res := p_ExpectedRES }; - + template (value) NG_PartialTaiType cs_NG_NonConsecutivePartialTaiList(NAS_PlmnId p_PlmnId, NG_NAS_TacList p_TacList):= { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -1451,7 +1451,7 @@ module NG_NAS_Templates { } } }; - + template (value) NG_ListOfPartialTaiList cs_NG_ListNonConsecutivePartialTaiList (NAS_PlmnId p_PlmnId, NG_NAS_TacList p_TacList):= { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -1460,7 +1460,7 @@ module NG_NAS_Templates { numberOfElements := int2bit(lengthof(p_TacList) - 1, 5), partialTaiList := cs_NG_NonConsecutivePartialTaiList (p_PlmnId, p_TacList) }; - + template (value) NG_TrackingAreaIdList cs_NG_TAIListNonConsecutive(NAS_PlmnId p_PlmnId, NG_NAS_TacList p_TacList) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -1470,7 +1470,7 @@ module NG_NAS_Templates { listOfPartialTais := {cs_NG_ListNonConsecutivePartialTaiList (p_PlmnId, p_TacList) } } }; - + template (value) NG_PartialTaiType cs_NG_ConsecutivePartialTaiList(NG_PartialTai p_PartialTac):= { /* @status APPROVED (NR5GC) */ type1List := { @@ -1479,7 +1479,7 @@ module NG_NAS_Templates { } } }; - + template (value) NG_ListOfPartialTaiList cs_NG_ListConsecutivePartialTaiList ( B5_Type p_NumberOfElements, NG_PartialTai p_PartialTac):= { /* @status APPROVED (NR5GC) */ @@ -1488,7 +1488,7 @@ module NG_NAS_Templates { numberOfElements := p_NumberOfElements, partialTaiList := cs_NG_ConsecutivePartialTaiList (p_PartialTac) }; - + template (value) NG_TrackingAreaIdList cs_NG_TAIListConsecutive(B5_Type p_NumberOfElements, NG_PartialTai p_PartialTac) := { /* @status APPROVED (NR5GC) */ @@ -1498,7 +1498,7 @@ module NG_NAS_Templates { listOfPartialTais := {cs_NG_ListConsecutivePartialTaiList(p_NumberOfElements, p_PartialTac) } } }; - + template (value) NG_PartialTai cs_NG_PartialTai(NAS_PlmnId p_PlmnId, O3_Type p_Tac) := { /* @status APPROVED (NR5GC) */ plmnId :=p_PlmnId, @@ -1511,7 +1511,7 @@ module NG_NAS_Templates { plmnId := p_PlmnId, tac := p_Tac }; - + template (value) NG_NAS_SecurityAlgorithms cs_NG_NAS_SecurityAlgorithms (B4_Type p_CipherAlg, B4_Type p_IntAlg) := { /* 24.501 cl. 9.11.3.34 */ @@ -1545,7 +1545,7 @@ module NG_NAS_Templates { red := p_Red, //B1_Type cl. 9.11.3.18 ack := p_Ack //B1_Type cl. 9.11.3.18 }; - + template (value) DNN cs_DNN (template (omit) IEI8_Type p_IEI := '25'O, // @sic R5s190109 sic@ octetstring p_DNN) := { /* 24.501 cl. 9.11.3.21 */ @@ -1586,13 +1586,13 @@ module NG_NAS_Templates { dcni := p_DCNI, nssci := p_NSSCI }; - + template (value) S_NSSAI_Type cs_S_NSSAI_WithIEI(IEI8_Type p_IEI, template (value) S_NSSAI_LV p_LvPart) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ iei := p_IEI, lvPart := p_LvPart - + }; template (value) S_NSSAI_LV cs_S_NSSAI(Type4Length_Type p_Length, @@ -1611,7 +1611,7 @@ module NG_NAS_Templates { mappedSD := p_MappedSD } }; - + template (value) S_NSSAI_Type cs_S_NSSAI_SST1eMBB_WithIEI := cs_S_NSSAI_WithIEI('22'O, cs_S_NSSAI_SST1eMBB); /* @sic R5s221179 sic@ @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ template (value) S_NSSAI_LV cs_S_NSSAI_SST1eMBB := cs_S_NSSAI('01'O, '01'O, omit); /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ template (value) S_NSSAI_LV cs_S_NSSAI_SST2_URLLC := cs_S_NSSAI('01'O, '02'O, omit); /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -1622,7 +1622,7 @@ module NG_NAS_Templates { // 24.501 cl. 9.11.3.37 /* @status */ cs_NSSAI_Def (p_IEI, {cs_S_NSSAI_SST1eMBB}); - + template (value) NSSAI cs_NSSAI_SSTs (template (value) IEI8_Type p_IEI) := /* @status APPROVED (NR5GC) */ // @sic R5s210440 Ch. 1 sic@ @@ -1631,7 +1631,7 @@ module NG_NAS_Templates { template (value) NSSAI cs_NSSAI_Allowed_Def := /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ cs_NSSAI_Def ('15'O, {cs_S_NSSAI_SST1eMBB, cs_S_NSSAI_SST2_URLLC, cs_S_NSSAI_SST3_MIoT, cs_S_NSSAI_SST4_V2X}); - + template (value) NSSAI cs_NSSAI_Def (template (value) IEI8_Type p_IEI, template (value) S_NSSAI_TypeList p_List) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ // 24.501 cl. 9.11.3.37 @@ -1641,7 +1641,7 @@ module NG_NAS_Templates { s_nssai := p_List } }; - + template (value) RejectedS_NSSAI cs_RejectedS_NSSAI(B4_Type p_Length, B4_Type p_CauseValue, O1_Type p_SST, @@ -1654,7 +1654,7 @@ module NG_NAS_Templates { sst := p_SST, sd := p_SD }; - + /* * @desc Returns length of S-NSSAI list * @param p_List @@ -1665,7 +1665,7 @@ module NG_NAS_Templates { { var integer j; var integer v_Length:=0; - + for (j:= 0; j < lengthof(p_List); j:= j+1) { v_Length := v_Length + oct2int(valueof(p_List[j].iel)); v_Length := v_Length + 1; // for iel @@ -1692,9 +1692,9 @@ module NG_NAS_Templates { var template (omit) O1_Type v_MappedSST; var template (omit) O3_Type v_MappedSD; var integer v_Length := 0; - + p_Cause := -1; - + // AT Command format is sst.sd;mappedsst.mappedsd[if rejectedNSSAI #cause]: v_ListOfRejCause := f_StringSplit(p_ATCommand, {"#"}); if (lengthof(v_ListOfRejCause) > 1) { // There is a cause value @@ -1728,10 +1728,10 @@ module NG_NAS_Templates { v_MappedSST := omit; v_MappedSD := omit; } - + return cs_S_NSSAI (int2oct(v_Length, 1), v_SST, v_SD, v_MappedSST, v_MappedSD); } - + /* * @desc To match the AT command with a listed NSSAI in any order * @param p_NSSAI @@ -1746,7 +1746,7 @@ module NG_NAS_Templates { var template S_NSSAI_TypeList v_PermutationNSSAI := {}; var integer v_Cause; // ignore cause value for NSSAI_LV types var integer v_NumAllowed; - + // AT Command format is NSSAI:NSSAI v_ListOfAllowed := f_StringSplit(p_ATCommand, {":"}); for (v_NumAllowed := 0; v_NumAllowed < lengthof(v_ListOfAllowed); v_NumAllowed := v_NumAllowed +1 ) { @@ -1755,7 +1755,7 @@ module NG_NAS_Templates { v_PermutationNSSAI := {permutation (all from p_NSSAI.s_nssai)}; return match (valueof(v_ListOfNSSAI), v_PermutationNSSAI); } - + /* * @desc To match the AT command with a list of RejectNSSAI in any order * @param p_NSSAI - of type XtdRejectedS_NSSAI_List @@ -1773,7 +1773,7 @@ module NG_NAS_Templates { var template (value) S_NSSAI_LV v_NSSAI_LV; var integer v_Cause; var integer v_NumAllowed; - + // AT Command format is NSSAI:NSSAI v_ListOfAllowed := f_StringSplit(p_ATCommand, {":"}); for (v_NumAllowed := 0; v_NumAllowed < lengthof(v_ListOfAllowed); v_NumAllowed := v_NumAllowed +1 ) { @@ -1793,7 +1793,7 @@ module NG_NAS_Templates { } return match (valueof(v_ListOfNSSAI), v_PermutationNSSAI); } - + /* * @desc Returns length of XtdRejectedS_NSSAI list * @param p_List @@ -1803,7 +1803,7 @@ module NG_NAS_Templates { { var integer j; var integer v_Length:=0; - + for (j:= 0; j < lengthof(p_List); j:= j+1) { v_Length := v_Length + bit2int(valueof(p_List[j].len)); v_Length := v_Length + 1; // for len & cause @@ -1821,7 +1821,7 @@ module NG_NAS_Templates { var integer j; var integer v_Length:=0; var integer v_NumOfElements := -1; - + for (j:= 0; j < lengthof(p_List); j:= j+1) { v_NumOfElements := v_NumOfElements +1; v_Length := v_Length + bit2int(valueof(p_List[j].len)); @@ -1830,7 +1830,7 @@ module NG_NAS_Templates { return cs_PartialXtdRejectedNSSAIType0(int2bit(v_NumOfElements, 4), p_List); } - + /* * @desc Returns a template of type PartialXtdRejectedNSSAIType1 * @param p_List @@ -1842,7 +1842,7 @@ module NG_NAS_Templates { var integer j; var integer v_Length:=0; var integer v_NumOfElements := -1; - + for (j:= 0; j < lengthof(p_List); j:= j+1) { v_NumOfElements := v_NumOfElements +1; v_Length := v_Length + bit2int(valueof(p_List[j].len)); @@ -1852,7 +1852,7 @@ module NG_NAS_Templates { p_BackOffTimer, p_List); } - + /* * @desc Returns a template of type ExtdRejectedNSSAI * @param p_List @@ -1874,7 +1874,7 @@ module NG_NAS_Templates { } return cs_ExtdRejectedNSSAI(int2oct(v_Length, 1), p_List); } - + template (value) ExtdRejectedNSSAI cs_ExtdRejectedNSSAI(Type4Length_Type p_Len, template(value) PartialXtdRejectedNSSAI_List p_List) := { @@ -1974,12 +1974,12 @@ module NG_NAS_Templates { rcmap := *, /* Jun23 @sic R5s230533 sic@ */ spare := omit }; - + template (present) NG_GMM_Cap cdr_NG_GMM_Cap_RACS modifies cr_NG_GMM_CapAny := { /* @status APPROVED (NR5GC, NR5GC_IRAT) */ racs := '1'B }; - + template (present) NG_GMM_Cap cdr_NG_GMM_Cap_S1 modifies cr_NG_GMM_CapAny := { /* @status APPROVED (NR5GC_IRAT) */ s1Cap := '1'B @@ -1998,7 +1998,7 @@ module NG_NAS_Templates { iel := '0000'O, payload := ''O }; - + template (present) PayloadContainer cr_PayloadContainer(template IEI8_Type p_IEI := omit) := { // 24.501 cl. 9.11.3.39 /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -2006,7 +2006,7 @@ module NG_NAS_Templates { iel := ?, /* allow any length */ payload := ? /* allow any value for now */ }; - + template (value) PayloadContainerType cs_PayloadContainerType (B4_Type p_ContainerType, template (omit) IEI4_Type p_IEI := omit) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -2056,7 +2056,7 @@ module NG_NAS_Templates { iel := p_Length, abbaValue := p_ABBA }; - + template (present) GMM_GSM_Cause cr_GMM_GSM_Cause(template IEI8_Type p_IEI, template (present) NAS_CauseValue_Type p_Cause := ?) := { /* 24.501 cl. 9.11.3.2, 9.11.4.2 */ @@ -2074,7 +2074,7 @@ module NG_NAS_Templates { psi8_15 := ?, /* PSI(8)- PSI(15)*/ spare := * }; - + template (present) PDU_SessionStatus cr_PDU_SessionStatus(B8_Type p_Psi0_7, B8_Type p_Psi8_15):= { /* @status APPROVED (NR5GC_IRAT) */ /* 24.501 cl. 9.11.3.44 */ @@ -2114,14 +2114,14 @@ module NG_NAS_Templates { lenOfContent := omit, // this field is included in the EPS QoS template @sic R5s210302 sic@ epsParam := p_Param }; - + template (value) EPSParameters cs_EPSParameter_TFT (octetstring p_Param) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT) */ id := '03'O, lenOfContent := omit, // this field is included in the TFT template epsParam := p_Param }; - + template (value) MappedEPSContext cs_OneMappedEPSContext (O1_Type p_EPSBearerId, integer p_ParamLength, template (value) EPSParameters p_EPSParams) := @@ -2134,7 +2134,7 @@ module NG_NAS_Templates { numOfParams := '0001'B, epsParamsList := {p_EPSParams} }; - + template (value) MappedEPSContext cs_OneMappedEPSContextTwoParams (O1_Type p_EPSBearerId, integer p_ParamLength, template (value) EPSParameters p_EPSParam1, @@ -2148,7 +2148,7 @@ module NG_NAS_Templates { numOfParams := '0010'B, epsParamsList := {p_EPSParam1, p_EPSParam2} }; - + template (value) MappedEPSBearerContexts cs_OneMappedEPSBearerContextList (template (value) MappedEPSContext p_MappedEPSContext) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ /* 24.501 cl. 9.11.4.8 */ @@ -2156,7 +2156,7 @@ module NG_NAS_Templates { iel := int2oct(oct2int(valueof(p_MappedEPSContext.lenOfContext)) + 3, 2), // @sic R5s190987 sic@ bearer id + 2 octets of len mappedContextList := {p_MappedEPSContext} }; - + template (value) MappedEPSBearerContexts cs_TwoMappedEPSBearerContextList (template (value) MappedEPSContext p_MappedEPSContext1, template (value) MappedEPSContext p_MappedEPSContext2) := { /* @status APPROVED (IMS, NR5GC) */ @@ -2165,7 +2165,7 @@ module NG_NAS_Templates { iel := int2oct(oct2int(valueof(p_MappedEPSContext1.lenOfContext)) + 3 + oct2int(valueof(p_MappedEPSContext2.lenOfContext)) + 3, 2), // @sic R5s211478 sic@ mappedContextList := {p_MappedEPSContext1, p_MappedEPSContext2} }; - + template (value) PDU_SessionType cs_PDU_SessionType (B3_Type p_Type) := { /* 24.501 cl. 9.11.4.11 */ /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ @@ -2211,7 +2211,7 @@ module NG_NAS_Templates { numOfParameters := int2bit(lengthof(p_ParamList), 6), parameterList := p_ParamList }; - + template (value) PEIPS_AssistInfo cs_PEIPS_AssistInfo(template (value) IEI8_Type p_IEI, template (value) Type4Length_Type p_IEL, template (value)PEIPS_AssistIEList p_EIPS_AssistIEList):= @@ -2223,7 +2223,7 @@ module NG_NAS_Templates { //================================================================== // QoS Templates //================================================================== - + /* * @desc To convert the bit rate used in the QoS Flow parameters GFBR and MFBR * according to 24.501 table 9.11.4.12.1 @@ -2238,18 +2238,18 @@ module NG_NAS_Templates { var integer v_BitValue; var integer v_Unit; var integer i := 256; - + while ((p_Value mod i) != 0) { i := i / 4; } v_BitValue := p_Value / i; v_Unit := (f_FloorLog2(i) / 2) + 1; - + v_Unit := v_Unit + (5* (p_Multiplier -1)); - + return int2oct(v_Unit, 1) & int2oct(v_BitValue, 2); } - + /* * @desc Returns default Qos Flow according to 38.508-1 cl.4.8.2.3 * @param p_FlowNumber @@ -2264,7 +2264,7 @@ module NG_NAS_Templates { { var template (value) QoSParametersList v_QoSParametersList; var B6_Type v_QFI; - + select (p_FlowNumber) { case ("1") { v_QFI := '000001'B; @@ -2321,7 +2321,7 @@ module NG_NAS_Templates { } return cs_QoS_Flow (v_QFI, v_QoSParametersList); } - + template (value) QoS_Flow cs_QoS_Flow1(boolean p_InterworkWithEPS := false, O1_Type p_EPSBearerId := '00'O) := f_BuildDefaultQosFlow("1", p_InterworkWithEPS, p_EPSBearerId); /* @sic R5-204400 sic@ @status APPROVED (ENDC, IMS, NR5GC, NR5GC_IRAT, POS) */ template (value) QoS_Flow cs_QoS_Flow2(boolean p_InterworkWithEPS := false, @@ -2331,7 +2331,7 @@ module NG_NAS_Templates { template (value) QoS_Flow cs_QoS_Flow4 := f_BuildDefaultQosFlow("4"); /* @sic R5s201094 sic@ @status APPROVED (NR5GC) */ template (value) QoS_Flow cs_QoS_Flow5(boolean p_InterworkWithEPS := true, O1_Type p_EPSBearerId := '00'O) := f_BuildDefaultQosFlow("5", p_InterworkWithEPS, p_EPSBearerId); /* @status APPROVED (IMS, NR5GC) */ template (value) QoS_Flow cs_QoS_Flow6(boolean p_InterworkWithEPS := true, O1_Type p_EPSBearerId := '00'O) := f_BuildDefaultQosFlow("6", p_InterworkWithEPS, p_EPSBearerId); /* @status APPROVED (IMS, NR5GC) */ - + /* * @desc Returns length of QoS Flow list * @param p_FlowList @@ -2343,7 +2343,7 @@ module NG_NAS_Templates { var integer i; var integer j; var integer v_Length:=0; - + for (j:= 0; j < lengthof(p_FlowList); j:= j+1) { if (isvalue(p_FlowList[j].parameterList)) { // @sic R5s210671 sic@ for (i:= 0; i < lengthof(p_FlowList[j].parameterList); i:= i+1) { @@ -2379,7 +2379,7 @@ module NG_NAS_Templates { } } }; - + template (value) NG_PacketFilterList cs_PacketFilterList_MediaUDP (B4_Type p_Id, integer p_Port) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ new := { @@ -2388,7 +2388,7 @@ module NG_NAS_Templates { fl_BuildRemotePortRange(p_Port) & fl_BuildProtocolIdNextHeaderUDP()) // @sic R5s220046 sic@ // Protocol id / Next Header UDP } }; - + template (value) NG_PacketFilter_Type2 cs_NG_PacketFilter_Type2 (B2_Type p_Dir, B4_Type p_Id, octetstring p_Contents) := @@ -2399,7 +2399,7 @@ module NG_NAS_Templates { len := int2oct(lengthof(p_Contents), 1), contents := p_Contents }; - + /* * @desc Build a Remote Port Range Packet Filter according to 38.508-1 cl. 4.8.2 * @param p_Port @@ -2409,12 +2409,12 @@ module NG_NAS_Templates { function fl_BuildRemotePortRange (integer p_Port) return octetstring { var octetstring v_PacketFilter; - + v_PacketFilter := '51'O; // id = remote port range v_PacketFilter := v_PacketFilter & int2oct(p_Port, 2) & int2oct(p_Port+1, 2); // @sic R5s220046 sic@ return v_PacketFilter; } - + /* * @desc Build a Protocol Id Next Header Packet Filter according to 38.508-1 cl. 4.8.2 * @return octetstring @@ -2423,13 +2423,13 @@ module NG_NAS_Templates { function fl_BuildProtocolIdNextHeaderUDP () return octetstring { var octetstring v_PacketFilter; - + v_PacketFilter := '30'O; // id = remote port range v_PacketFilter := v_PacketFilter & int2oct(17, 1); return v_PacketFilter; } - - + + template (value) QoS_Rule cs_QoS_Rule (O1_Type p_Id, B6_Type p_QFI, O1_Type p_Precedence, @@ -2464,7 +2464,7 @@ module NG_NAS_Templates { { var template (value) QoS_Rules v_QoS_Rules; var template (value) QoS_Rule v_VoiceQoS := cs_QoS_Rule('03'O, int2bit(7, 6), '01'O, -, cs_PacketFilterList_MediaUDP('0110'B, tsc_IMS_MediaPort_M1), '0'B); // @sic R5-210627, R5s220046 sic@; - + if (p_RuleNum == "7_Voice") { v_QoS_Rules := cs_QoS_Rules ({v_VoiceQoS}, p_IEI) // @sic R5-213440 sic@ } else if (p_RuleNum == "7_Video") { @@ -2476,7 +2476,7 @@ module NG_NAS_Templates { } return v_QoS_Rules; } - + /* * @desc To build a single default QoS Rule as defined in 38.508-1 cl. 4.8.2.1 * Builds rules #1 to #6 @@ -2487,7 +2487,7 @@ module NG_NAS_Templates { function f_BuildDefaultQoSRule (charstring p_RuleNum) return template (value) QoS_Rule { var template (value) QoS_Rule v_QoS_Rule; - + select (p_RuleNum) { case ("1") { v_QoS_Rule := cs_QoS_Rule('01'O, int2bit(1, 6), 'FF'O); // @sic R5-202585 sic@ @@ -2515,7 +2515,7 @@ module NG_NAS_Templates { { var integer i; var integer v_Length:=0; - + if (ischosen(p_FilterList.modify)) { v_Length := 1; } @@ -2539,13 +2539,13 @@ module NG_NAS_Templates { { var integer i; var integer v_Length:=0; - + for (i:= 0; i < lengthof(p_Rules); i:= i+1) { v_Length := v_Length + oct2int (valueof(p_Rules[i].iel)) + 3; // @sic R5s190109 sic@ } return int2oct(v_Length, 2); } - + template (value) QoS_Rules cs_QoS_Rules (template (value) QoS_RuleList p_Rules, template (omit) IEI8_Type p_IEI := omit) := // @sic R5s190673 sic@ { // 24.501 cl. 9.11.4.13 @@ -2554,7 +2554,7 @@ module NG_NAS_Templates { iel := fl_NR5GC_QosRulesLength(p_Rules), // @sic R5s190109 sic@ listofQoSRules := p_Rules }; - + template (value) Session_AMBR cs_Session_AMBR(template (omit) Type4Length_Type p_Length, O1_Type p_UnitDL, O2_Type p_DL, @@ -2574,7 +2574,7 @@ module NG_NAS_Templates { { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ iei := 'E'H }; - + template (value) AllowedNSSAI cs_AllowedNSSAI (template (value) NAS_PlmnId p_PLMN, B2_Type p_AccessType) := { /* @status APPROVED (NR5GC) */ @@ -2582,7 +2582,7 @@ module NG_NAS_Templates { spareBits := tsc_Spare6, accessType := p_AccessType }; - + template (value) NG_NAS_DL_Message_Type cs_NSSAI_DELETE_REQUEST (B8_Type p_DeleteNSSAI_Type, template (omit) NAS_PlmnId p_Configured, template (omit) AllowedNSSAI p_Allowed) := @@ -2596,7 +2596,7 @@ module NG_NAS_Templates { allowedNSSAI := p_Allowed /* only present if deleteNSSAI_Type = DeleteAllowed */ } }; - + template (present) NG_NAS_UL_Message_Type cr_NSSAI_DELETE_RESPONSE := { /* @status APPROVED (NR5GC) */ nssai_Delete_Response:= { @@ -2605,7 +2605,7 @@ module NG_NAS_Templates { messageType := tsc_MsgType_NSSAI_DeleteResp /* M V 1 */ } }; - + template (value) NG_NAS_DL_Message_Type cs_SET_UAI_REQUEST (B2_Type p_PreferredRRCState) := { /* @status APPROVED (NR5GC) */ set_UAI_Request:= { @@ -2616,7 +2616,7 @@ module NG_NAS_Templates { preferredRRCState := p_PreferredRRCState } }; - + template (present) NG_NAS_UL_Message_Type cr_SET_UAI_RESPONSE := { /* @status APPROVED (NR5GC) */ set_UAI_Response:= { @@ -2625,7 +2625,7 @@ module NG_NAS_Templates { messageType := tsc_MsgType_SetUAIResp /* M V 1 */ } }; - + template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) GMM_GSM_Cause p_Cause) := { /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */ /* 24.501 cl. 8.2.29 */ @@ -2637,14 +2637,14 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G gmmCause := p_Cause /* cl. 9.11.3.2 M V 1 */ } }; - + template (value) NSSAI_LV cs_NSSAI_LV(Type4Length_Type p_Length, template (value) S_NSSAI_TypeList p_S_NSSAI):= { /* 24.501 cl. 9.11.3.37 */ iel := p_Length, s_nssai := p_S_NSSAI }; - + /* * @desc Returns length of NSAG info element * @param p_NSAG @@ -2654,9 +2654,9 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G function fl_NR5GC_NSAGLength (template (value) NSSAI_LV p_NSAG, template(omit) NG_TrackingAreaIdList_LV p_TaiList) return Type4Length_Type { var integer v_Length := oct2int(valueof(p_NSAG.iel)); - + v_Length := v_Length + 3; // id + length of S-NSSAI list + priority - + if (isvalue(p_TaiList)) { v_Length := v_Length + oct2int(valueof(p_TaiList.iel)) + 1; // + length of TAIList } @@ -2674,7 +2674,7 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G priority := p_Priority, taiList := p_TaiList }; - + template (value) NSAG_Info cs_NSAG_2Elements(template(value) NSAG p_NSAG1, template(value) NSAG p_NSAG2) := { // 24.501 cl. 9.11.3.87, Figure 9.11.3.87.1: NSAG information information element @@ -2682,7 +2682,7 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G iel := int2oct(oct2int(valueof(p_NSAG1.iel)) + oct2int(valueof(p_NSAG2.iel)) + 2, 2), // 1 + 1 + (p_NSAG1.iel) + (p_NSAG2.iel) nsagList := {p_NSAG1, p_NSAG2} }; - + /* * @desc Build an NID according to 24.502 cl. 9.2.7 * @return template (value) NID @@ -2692,20 +2692,20 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G var hexstring v_Hex := int2hex(p_NID, 10); var hexstring v_Digits2_9 := '00000000'H; var template (value) NID v_NIDTemplate := cs_NIDBlank (int2bit(p_AssignmentMode, 4)); - + // arrange digits 2 to 9 in the order specified in 24.502 cl. 9.2.7 v_Digits2_9 := v_Hex[2] & v_Hex[1] & v_Hex[4] & v_Hex[3] & v_Hex[6] & v_Hex[5] & v_Hex[8] & v_Hex[7]; - + v_NIDTemplate.digit1 := v_Hex[0]; v_NIDTemplate.digits2_9 := v_Digits2_9; v_NIDTemplate.digit10 := v_Hex[9]; return v_NIDTemplate; } - + template (value) NID cs_NIDBlank (B4_Type p_AssignmentMode) := { /* 24.301 cl. 9.11.3.79 */ iei := '32'O, /* present in case of TV; omit in case of V */ @@ -2727,7 +2727,7 @@ template (present) NG_NAS_UL_Message_Type cr_NG_GMM_STATUS (template (present) G eDRXValue := p_EDRXVal, extdPTW := p_ExtdPTW }; - - + + } diff --git a/ttcn/Lib3GPP/NG_NAS/NG_NAS_TypeDefs.ttcn b/ttcn/Lib3GPP/NG_NAS/NG_NAS_TypeDefs.ttcn index 596b10f84736d7dc000dcad6f1ce5093101614e5..80881dfd45f3ed3e114123c2b0e1e3d550bce30b 100644 --- a/ttcn/Lib3GPP/NG_NAS/NG_NAS_TypeDefs.ttcn +++ b/ttcn/Lib3GPP/NG_NAS/NG_NAS_TypeDefs.ttcn @@ -742,6 +742,7 @@ module NG_NAS_TypeDefs { S1_UE_SecurityCapability replayedUESecurityCap optional /* cl. 9.11.3.48A O TLV 4-7 IEI=19 Dec18 @sic R5s190421 sic@*/ } with { variant "FIELDORDER(msb)"; + variant (nasSecurityAlgorithms) "FORCEOMIT(iei)"; variant (ngNasKSI) "FORCEOMIT(iei)"; variant (ueSecurityCapability) "FORCEOMIT(iei)"; variant "TAG(imeisvRequest, iei = 'E'H; @@ -1108,7 +1109,7 @@ module NG_NAS_TypeDefs { ipHeaderCompressionConfig, iei = '66'O; ethernetHeaderCompressConfig, iei = '1F'O; requestedMBS, iei = '70'O; - serviceLvlAA, iei = '72'O; + serviceLvlAA, iei = '72'O; )"; } @@ -1130,7 +1131,7 @@ module NG_NAS_TypeDefs { variant "TAG(backOffTimerValue, iei = '37'O; ngsmCongestionReattemptInd, iei = '61'O; extdProtocolConfigurationOptions, iei = '7b'O; - reattemptInd, iei = '1d'O; + reattemptInd, iei = '1d'O; )"; } @@ -2218,7 +2219,7 @@ module NG_NAS_TypeDefs { B1_Type spare, B3_Type typeOfList ('000'B), B4_Type numOfElements, - record of XtdRejectedS_NSSAI rejectS_NSSAI // @sic RAN5#97 sidebar sic@ + XtdRejectedS_NSSAI_List rejectS_NSSAI // @sic RAN5#97 sidebar sic@ } with { variant "FIELDORDER(msb)"; }; @@ -2249,6 +2250,7 @@ module NG_NAS_TypeDefs { PartialXtdRejectedNSSAI_List partialXtd // @sic RAN5#97 sidebar sic@ } with { variant "FIELDORDER(msb)"; + variant (iel) "LENGTHTO(partialXtd)"; }; type record NG_PagingRestriction { /* 24.501 cl. 9.11.3.77 */ @@ -2508,7 +2510,7 @@ module NG_NAS_TypeDefs { B6_Type spare6, B1_Type eBit, B6_Type numOfParameters, - record of QoSParameters parameterList optional + QoSParametersList parameterList optional } with { variant "FIELDORDER(msb)"; }; @@ -2517,7 +2519,7 @@ module NG_NAS_TypeDefs { type record QoSFlowDescr { /* 24.501 cl. 9.11.4.12 */ IEI8_Type iei, // @sic R5s190470 sic@ Type6Length_Type iel, - record of QoS_Flow listofFlows + QoS_FlowList listofFlows } with { variant "FIELDORDER(msb)"; variant (iel) "LENGTHTO (listofFlows)"; @@ -2893,6 +2895,7 @@ module NG_NAS_TypeDefs { PacketCounterValueList counterValue } with { variant "FIELDORDER(msb)"; + variant (iel) "LENGTHTO(counterValue)"; }; type record UE_TEST_LOOP_NR_SIDELINK_COUNTER_RESPONSE { diff --git a/ttcn/Lib_NG_NAS/Lib_NG_NAS_Templates.ttcn b/ttcn/Lib_NG_NAS/Lib_NG_NAS_Templates.ttcn index 9b04cf212df5fbb76c42c2d99424c75c5ca13b79..627d9962f855771399ac3263d2e9b3d8e64a0229 100644 --- a/ttcn/Lib_NG_NAS/Lib_NG_NAS_Templates.ttcn +++ b/ttcn/Lib_NG_NAS/Lib_NG_NAS_Templates.ttcn @@ -1139,7 +1139,7 @@ module Lib_NG_NAS_Templates { ) modifies cs_NG_IDENTITY_REQUEST := { identity_Request :={} } // End of template m_NG_IDENTITY_REQUEST - + template (present) NG_NAS_DL_Message_Type mw_NG_IDENTITY_REQUEST( template (present) NAS_IdType p_IdType := ? ) := { @@ -1152,7 +1152,7 @@ module Lib_NG_NAS_Templates { identityType := mw_IdentityType(p_IdType) } } // End of template mw_NG_IDENTITY_REQUEST - + template (value) NG_NAS_UL_Message_Type m_NG_IDENTITY_RESPONSE( in NG_MobileIdentity p_MobileId ) := { @@ -1288,7 +1288,7 @@ module Lib_NG_NAS_Templates { } } // End of template m_NG_CONFIGURATION_UPDATE_COMMAND - template (value) NG_NAS_UL_Message_Type m_NG_CONFIGURATION_UPDATE_COMPLETE := { + template (value) NG_NAS_UL_Message_Type m_NG_CONFIGURATION_UPDATE_COMPLETE := { configuration_Update_Complete := { protocolDiscriminator := tsc_EPD_GMM , /* cl. 9.2 M V 1 */ spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.5 M V 1/2 */ @@ -1305,7 +1305,7 @@ module Lib_NG_NAS_Templates { messageType := tsc_MT_NG_ConfigurationUpdateComplete /* cl. 9.7 M V 1 */ } } // End of template mw_NG_CONFIGURATION_UPDATE_COMPLETE - + template (omit) NG_NAS_UL_Message_Type m_NG_UL_NAS_TRANSPORT( in template (value) PayloadContainerType p_PayloadContainerType, in template (value) PayloadContainer p_PayloadContainer, @@ -2135,7 +2135,7 @@ module Lib_NG_NAS_Templates { typeOfId := tsc_IdType_NG_SUCI, // 3 bits otherDigits := p_OtherDigits }; - + template RegistrationType m_rt(B1_Type p_fOR, B3_Type p_registrationType):= { /* 24.501 cl. 9.11.3.7 */ // IEI is always skipped fOR := p_fOR, @@ -2156,7 +2156,7 @@ module Lib_NG_NAS_Templates { template IEI8_Type p_IEI := ? ) modifies cr_PayloadContainer := { } // End of template mw_PayloadContainer - + template (value) NG_SECURITY_PROTECTED_NAS_MESSAGE m_NG_SECURITY_PROTECTED_NAS_MESSAGE( in template (value) ExtdProtocolDiscriminator p_protocolDiscriminator, in template (value) SpareHalfOctet p_spareHalfOctet, @@ -2195,7 +2195,7 @@ module Lib_NG_NAS_Templates { iei := '21'O, randValue := p_rand } // End of template mw_GMM_AuthRAND - + template (present) AUTN mw_GSM_AUTN( template (present) B128_Type p_autn := ? ) := { /* @status APPROVED (IMS, IMS_IRAT, LTE_A_IRAT, LTE_IRAT, NR5GC, NR5GC_IRAT, POS, SSNITZ, UTRAN) */