| module BSSMAP_Templates { |
| |
| import from General_Types all; |
| import from Osmocom_Types all; |
| import from BSSAP_Types all; |
| |
| type integer BssmapCause; |
| |
| template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| discriminator := '0'B, |
| spare := '0000000'B, |
| dlci := omit, |
| lengthIndicator := 0, /* overwritten by codec */ |
| pdu := { |
| bssmap := ? |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| discriminator := '0'B, |
| spare := '0000000'B, |
| dlci := omit, |
| lengthIndicator := ?, |
| pdu := { |
| bssmap := ? |
| } |
| } |
| |
| template PDU_BSSAP ts_BSSAP_DTAP := { |
| discriminator := '1'B, |
| spare := '0000000'B, |
| dlci := omit, |
| lengthIndicator := 0, /* overwritten by codec */ |
| pdu := { |
| dtap := ? |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSAP_DTAP := { |
| discriminator := '1'B, |
| spare := '0000000'B, |
| dlci := omit, |
| lengthIndicator := ?, |
| pdu := { |
| dtap := ? |
| } |
| } |
| |
| |
| template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| elementIdentifier := '04'O, |
| lengthIndicator := 0, |
| causeValue := int2bit(val, 7), |
| extensionCauseValue := '0'B, |
| spare1 := omit |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| reset := { |
| messageType := '30'O, |
| cause := ts_BSSMAP_IE_Cause(cause), |
| a_InterfaceSelectorForReset := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| reset := { |
| messageType := '30'O, |
| cause := ?, |
| a_InterfaceSelectorForReset := * |
| } |
| } |
| } |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| resetAck := { |
| messageType := '31'O, |
| a_InterfaceSelectorForReset := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| resetAck := { |
| messageType := '31'O, |
| a_InterfaceSelectorForReset := * |
| } |
| } |
| } |
| } |
| |
| template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| elementIdentifier := '05'O, |
| lengthIndicator := 0, |
| cellIdentifierDiscriminator := '0000'B, |
| spare1_4 := '0000'B, |
| cellIdentification := ? |
| } |
| |
| type uint16_t BssmapLAC; |
| type uint16_t BssmapCI; |
| |
| /* |
| template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) |
| modifies ts_BSSMAP_IE_CellID := { |
| cellIdentification := { |
| cI_LAC_CGI := { |
| mnc_mcc := FIXME, |
| lac := int2oct(lac, 2), |
| ci := int2oct(ci, 2) |
| } |
| } |
| } |
| */ |
| |
| template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| modifies ts_BSSMAP_IE_CellID := { |
| cellIdentification := { |
| cI_LAC_CI := { |
| lac := int2oct(lac, 2), |
| ci := int2oct(ci, 2) |
| } |
| } |
| } |
| |
| template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| modifies ts_BSSMAP_IE_CellID := { |
| cellIdentification := { |
| cI_CI := int2oct(ci, 2) |
| } |
| } |
| |
| template BSSMAP_IE_CellIdentifier ts_CellId_none |
| modifies ts_BSSMAP_IE_CellID := { |
| cellIdentification := { |
| cI_noCell := ''O |
| } |
| } |
| |
| |
| template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| elementIdentifier := '17'O, |
| lengthIndicator := 0, |
| layer3info := l3info |
| } |
| |
| template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| completeLayer3Information := { |
| messageType := '57'O, |
| cellIdentifier := cell_id, |
| layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| chosenChannel := omit, |
| lSAIdentifier := omit, |
| aPDU := omit, |
| codecList := omit, |
| redirectAttemptFlag := omit, |
| sendSequenceNumber := omit, |
| iMSI := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_ComplL3 modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| completeLayer3Information := ? |
| } |
| } |
| } |
| |
| template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(BSSMAP_FIELD_CellIdentificationList cid_list) := { |
| elementIdentifier := '1A'O, |
| lengthIndicator := 0, /* overwritten */ |
| cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| spare1_4 := '0000'B, |
| cellIdentificationList := cid_list |
| } |
| |
| template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_FIELD_CellIdentificationList cid_list) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| handoverRequired := { |
| messageType := '11'O, |
| cause := ts_BSSMAP_IE_Cause(cause), |
| responseRequest := omit, |
| cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
| circuitPoolList := omit, |
| currentChannelType1 := omit, |
| speechVersion := omit, |
| queueingIndicator := omit, |
| oldToNewBSSInfo := omit, |
| sourceToTargetRNCTransparentInfo := omit, |
| sourceToTargetRNCTransparentInfoCDMA := omit, |
| gERANClassmark := omit, |
| talkerPriority := omit, |
| speechCodec := omit, |
| cSG_Identifier := omit |
| } |
| } |
| } |
| } |
| |
| const OCT1 ChRate_TCHF := '08'O; |
| const OCT1 ChRate_TCHH := '09'O; |
| |
| template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| elementIdentifier := '0B'O, /* overwritten */ |
| lengthIndicator := 0, /* overwritten */ |
| speechOrDataIndicator := '0001'B, /* speech */ |
| spare1_4 := '0000'B, |
| channelRateAndType := ChRate_TCHF, |
| speechId_DataIndicator := '01'O /* FRv1 */ |
| } |
| |
| template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| elementIdentifier := '01'O, /* overwritten */ |
| cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_AssignmentReq(uint11_t span, uint5_t ts) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| assignmentRequest := { |
| messageType :='01'O, /* overwritten */ |
| channelType := ts_BSSMAP_IE_ChannelType, |
| layer3HeaderInfo := omit, |
| priority := omit, |
| circuitIdentityCode := ts_BSSMAP_IE_CIC(span, ts), |
| downLinkDTX_Flag := omit, |
| interferenceBandToBeUsed := omit, |
| classmarkInformationType2 := omit, |
| groupCallReference := omit, |
| talkerFlag := omit, |
| configurationEvolutionIndication := omit, |
| lsaAccesControlSuppression := omit, |
| serviceHandover := omit, |
| encryptionInformation := omit, |
| talkerPriority := omit, |
| aoIPTransportLayer := omit, |
| codecList := omit, |
| callIdentifier := omit, |
| kC128 := omit, |
| globalCallReference := omit, |
| lCLS_Configuration := omit, |
| lCLS_ConnectionStatusControl := omit, |
| lCLS_CorrelationNotNeeded := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| assignmentRequest := { |
| messageType :='01'O, /* overwritten */ |
| channelType := ?, |
| layer3HeaderInfo := *, |
| priority := *, |
| circuitIdentityCode := ?, |
| downLinkDTX_Flag := *, |
| interferenceBandToBeUsed := *, |
| classmarkInformationType2 := *, |
| groupCallReference := *, |
| talkerFlag := *, |
| configurationEvolutionIndication := *, |
| lsaAccesControlSuppression := *, |
| serviceHandover := *, |
| encryptionInformation := *, |
| talkerPriority := *, |
| aoIPTransportLayer := *, |
| codecList := *, |
| callIdentifier := *, |
| kC128 := *, |
| globalCallReference := *, |
| lCLS_Configuration := *, |
| lCLS_ConnectionStatusControl := *, |
| lCLS_CorrelationNotNeeded := * |
| } |
| } |
| } |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_AssignmentComplete(BSSMAP_IE_CircuitIdentityCode cic) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| assignmentComplete := { |
| messageType :='02'O, /* overwritten */ |
| rR_Cause := omit, |
| circuitIdentityCode := cic, |
| cellIdentifier := omit, |
| chosenChannel := omit, |
| chosenEncryptionAlgorithm := omit, |
| circuitPool := omit, |
| speechVersion := omit, |
| lSAIdentifier := omit, |
| talkerPriority := omit, |
| aoIPTransportLayer := omit, |
| speechCodec := omit, |
| codecList := omit, |
| lCLS_BSS_Status := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_AssignmentComplete modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| assignmentComplete := { |
| messageType := '02'O, /* overwritten */ |
| rR_Cause := *, |
| circuitIdentityCode := ?, |
| cellIdentifier := *, |
| chosenChannel := *, |
| chosenEncryptionAlgorithm := *, |
| circuitPool := *, |
| speechVersion := *, |
| lSAIdentifier := *, |
| talkerPriority := *, |
| aoIPTransportLayer := *, |
| speechCodec := *, |
| codecList := *, |
| lCLS_BSS_Status := * |
| } |
| } |
| } |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| clearCommand := { |
| messageType := '20'O, /* overwritten */ |
| layer3HeaderInfo := omit, |
| cause := ts_BSSMAP_IE_Cause(cause), |
| cSFB_Indication := omit |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| clearCommand := { |
| messageType := '20'O, /* overwritten */ |
| layer3HeaderInfo := *, |
| cause := ?, |
| cSFB_Indication := * |
| } |
| } |
| } |
| } |
| |
| template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| clearComplete := { |
| messageType := '21'O /* overwritten */ |
| } |
| } |
| } |
| } |
| |
| template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| clearComplete := { |
| messageType := '21'O |
| } |
| } |
| } |
| } |
| |
| function f_hex_is_odd_length(hexstring digits) return bitstring { |
| if (lengthof(digits) rem 2 == 1) { |
| return '1'B; |
| } else { |
| return '0'B; |
| } |
| } |
| |
| template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| elementIdentifier := '08'O, |
| lengthIndicator := 0, /* overwritten */ |
| typeOfIdentity := '001'B, /* IMSI */ |
| oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| digits := imsi_digits |
| } |
| |
| template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, BSSMAP_FIELD_CellIdentificationList cid_list, |
| template integer tmsi := omit) |
| modifies ts_BSSAP_BSSMAP := { |
| pdu := { |
| bssmap := { |
| paging := { |
| messageType := '51'O, |
| iMSI := ts_BSSMAP_Imsi(imsi_digits), |
| tMSI := omit, // FIXME: convert tmsi, |
| cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
| channelNeeded := omit, |
| eMLPP_Priority := omit, |
| pagingInformation := omit /* only VGCS/VBS flag */ |
| } |
| } |
| } |
| } |
| |
| |
| |
| } |