osmo-ttcn3-hacks/library/L3_Templates.ttcn

306 lines
6.5 KiB
Plaintext
Raw Normal View History

module L3_Templates {
/* L3 Templates, building on top of MobileL3*_Types from Ericsson.
*
* (C) 2017 by Harald Welte <laforge@gnumonks.org>
* All rights reserved.
*
* Released under the terms of GNU General Public License, Version 2 or
* (at your option) any later version.
*/
import from General_Types all;
import from MobileL3_Types all;
import from MobileL3_CommonIE_Types all;
import from MobileL3_MM_Types all;
import from MobileL3_RRM_Types all;
import from MobileL3_CC_Types all;
//import from MobileL3_GMM_SM_Types all;
//import from MobileL3_SMS_Types all;
type enumerated CmServiceType {
CM_TYPE_MO_CALL ('0001'B),
CM_TYPE_EMERG_CALL ('0010'B),
CM_TYPE_MO_SMS ('0100'B),
CM_TYPE_SS_ACT ('1000'B)
}
/* send template fro Mobile Identity (TMSI) */
template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := {
lengthIndicator := 0, /* overwritten */
mobileIdentityV := {
typeOfIdentity := '000'B, /* overwritten */
oddEvenInd_identity := {
tmsi_ptmsi := {
oddevenIndicator := '0'B,
fillerDigit := '1111'B,
octets := tmsi
}
}
}
}
private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 {
var IMSI_L3 l3;
var integer len := lengthof(digits);
if (len rem 2 == 1) { /* modulo remainder */
l3.oddevenIndicator := '1'B;
l3.fillerDigit := '1111'B;
} else {
l3.oddevenIndicator := '0'B;
l3.fillerDigit := omit;
}
l3.digits := digits;
return l3;
}
/* send template fro Mobile Identity (IMSI) */
template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := {
lengthIndicator := 0, /* overwritten */
mobileIdentityV := {
typeOfIdentity := '000'B, /* overwritten */
oddEvenInd_identity := {
imsi := f_enc_IMSI_L3(imsi_digits)
}
}
}
/* Send template for Classmark 2 */
template (value) MobileStationClassmark2_LV ts_CM2 := {
lengthIndicator := 0,
rf_PowerCapability := '000'B,
a5_1 := '0'B,
esind := '1'B,
revisionLevel := '10'B,
spare1_1 := '0'B,
mobileStationClassmark2_oct4 := omit,
mobileStationClassmark2_oct5 := omit
};
/* Send template for CM SERVICE REQUEST */
template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := {
discriminator := '0000'B, /* overwritten */
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
mm := {
cMServiceRequest := {
messageType := '000000'B, /* overwritten */
nsd := '00'B,
cm_ServiceType := serv_type,
cipheringKeySequenceNumber := { '000'B, '0'B },
mobileStationClassmark2 := ts_CM2,
mobileIdentity := mi_lv,
priorityLevel := omit,
additionalUpdateParameterTV := omit,
deviceProperties := omit
}
}
}
}
template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := {
discriminator := discr,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := ?
}
template PDU_ML3_NW_MS tr_CM_SERV_ACC := {
discriminator := '0101'B,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
mm := {
cMServiceAccept := {
messageType := '100001'B,
nsd := ?
}
}
}
}
template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := {
discriminator := '0101'B,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
mm := {
cMServiceReject := {
messageType := '100010'B,
nsd := ?,
rejectCause := rej_cause,
t3246_Value := *
}
}
}
}
/* Send template for PAGING RESPONSE */
template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := {
discriminator := '0000'B, /* overwritten */
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
rrm := {
pagingResponse := {
messageType := '00000000'B, /* overwritten */
cipheringKeySequenceNumber := { '000'B, '0'B },
spare1_4 := '0000'B,
mobileStationClassmark := ts_CM2,
mobileIdentity := mi_lv,
additionalUpdateParameters := omit
}
}
}
}
template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := {
discriminator := '0000'B, /* overwritten */
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
rrm := {
channelModeModifyAck := {
messageType := '00010111'B,
channelDescription := desc,
channelMode := mode,
extendedTSCSet := omit
}
}
}
}
template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := {
discriminator := '0000'B, /* overwritten */
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
rrm := {
cipheringModeComplete := {
messageType := '00110010'B,
mobileEquipmentIdentity := omit
}
}
}
}
template PDU_ML3_MS_NW ts_ML3_MO := {
discriminator := '0000'B,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := ?
}
template LocationUpdatingType ts_ML3_IE_LuType := {
lut := ?,
spare1_1 := '0'B,
fop := '0'B
}
template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := {
lut := '00'B
}
template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := {
lut := '01'B
}
template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := {
lut := '10'B
}
template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := {
keySequence := int2bit(cksn, 3),
spare := '0'B
}
template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai,
MobileIdentityLV mi, MobileStationClassmark1_V cm1)
modifies ts_ML3_MO := {
msgs := {
mm := {
locationUpdateRequest := {
messageType := '001000'B,
nsd := '00'B, /* ? */
locationUpdatingType := lu_type,
cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0),
locationAreaIdentification := lai,
mobileStationClassmark1 := cm1,
mobileIdentityLV := mi,
classmarkInformationType2_forUMTS := omit,
additionalUpdateParameterTV := omit,
deviceProperties := omit,
mS_NetworkFeatureSupport := omit
}
}
}
}
template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := {
msgs := {
mm := {
tmsiReallocComplete := {
messageType := '011011'B,
nsd := '00'B
}
}
}
}
template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := {
discriminator := '0101'B,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
mm := {
locationUpdateAccept := {
messageType := '000010'B,
nsd := '00'B,
locationAreaIdentification := ?,
mobileIdentityTLV := *,
followOnProceed := *,
cTS_Permission := *,
equivalentPLMNs := *,
emergencyNumberList := *,
perMS_T3212 := *
}
}
}
}
template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := {
discriminator := '0101'B,
tiOrSkip := {
skipIndicator := '0000'B
},
msgs := {
mm := {
locationUpdateReject := {
messageType := '000100'B,
nsd := '00'B,
rejectCause := cause,
t3246_Value := *
}
}
}
}
}