Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1 | module BSSMAP_Templates { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | import from BSSAP_Types all; |
| 6 | |
| 7 | type integer BssmapCause; |
| 8 | |
| 9 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 10 | discriminator := '0'B, |
| 11 | spare := '0000000'B, |
| 12 | dlci := omit, |
| 13 | lengthIndicator := 0, /* overwritten by codec */ |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 14 | pdu := { |
| 15 | bssmap := ? |
| 16 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 20 | discriminator := '0'B, |
| 21 | spare := '0000000'B, |
| 22 | dlci := omit, |
| 23 | lengthIndicator := ?, |
| 24 | pdu := { |
| 25 | bssmap := ? |
| 26 | } |
| 27 | } |
| 28 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 29 | template PDU_BSSAP ts_BSSAP_DTAP := { |
| 30 | discriminator := '1'B, |
| 31 | spare := '0000000'B, |
| 32 | dlci := omit, |
| 33 | lengthIndicator := 0, /* overwritten by codec */ |
| 34 | pdu := { |
| 35 | dtap := ? |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | template PDU_BSSAP tr_BSSAP_DTAP := { |
| 40 | discriminator := '1'B, |
| 41 | spare := '0000000'B, |
| 42 | dlci := omit, |
| 43 | lengthIndicator := ?, |
| 44 | pdu := { |
| 45 | dtap := ? |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 50 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 51 | elementIdentifier := '04'O, |
| 52 | lengthIndicator := 0, |
| 53 | causeValue := int2bit(val, 7), |
| 54 | extensionCauseValue := '0'B, |
| 55 | spare1 := omit |
| 56 | } |
| 57 | |
| 58 | template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| 59 | pdu := { |
| 60 | bssmap := { |
| 61 | reset := { |
| 62 | messageType := '30'O, |
| 63 | cause := ts_BSSMAP_IE_Cause(cause), |
| 64 | a_InterfaceSelectorForReset := omit |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 70 | template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := { |
| 71 | pdu := { |
| 72 | bssmap := { |
| 73 | reset := { |
| 74 | messageType := '30'O, |
| 75 | cause := ?, |
| 76 | a_InterfaceSelectorForReset := * |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 82 | template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| 83 | pdu := { |
| 84 | bssmap := { |
| 85 | resetAck := { |
| 86 | messageType := '31'O, |
| 87 | a_InterfaceSelectorForReset := omit |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| 94 | pdu := { |
| 95 | bssmap := { |
| 96 | resetAck := { |
| 97 | messageType := '31'O, |
| 98 | a_InterfaceSelectorForReset := * |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 105 | elementIdentifier := '05'O, |
| 106 | lengthIndicator := 0, |
| 107 | cellIdentifierDiscriminator := '0000'B, |
| 108 | spare1_4 := '0000'B, |
| 109 | cellIdentification := ? |
| 110 | } |
| 111 | |
| 112 | type uint16_t BssmapLAC; |
| 113 | type uint16_t BssmapCI; |
| 114 | |
| 115 | /* |
| 116 | template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) |
| 117 | modifies ts_BSSMAP_IE_CellID := { |
| 118 | cellIdentification := { |
| 119 | cI_LAC_CGI := { |
| 120 | mnc_mcc := FIXME, |
| 121 | lac := int2oct(lac, 2), |
| 122 | ci := int2oct(ci, 2) |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | */ |
| 127 | |
| 128 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 129 | modifies ts_BSSMAP_IE_CellID := { |
| 130 | cellIdentification := { |
| 131 | cI_LAC_CI := { |
| 132 | lac := int2oct(lac, 2), |
| 133 | ci := int2oct(ci, 2) |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 139 | modifies ts_BSSMAP_IE_CellID := { |
| 140 | cellIdentification := { |
| 141 | cI_CI := int2oct(ci, 2) |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 146 | modifies ts_BSSMAP_IE_CellID := { |
| 147 | cellIdentification := { |
| 148 | cI_noCell := ''O |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | |
| 153 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 154 | elementIdentifier := '17'O, |
| 155 | lengthIndicator := 0, |
| 156 | layer3info := l3info |
| 157 | } |
| 158 | |
| 159 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 160 | modifies ts_BSSAP_BSSMAP := { |
| 161 | pdu := { |
| 162 | bssmap := { |
| 163 | completeLayer3Information := { |
| 164 | messageType := '57'O, |
| 165 | cellIdentifier := cell_id, |
| 166 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 167 | chosenChannel := omit, |
| 168 | lSAIdentifier := omit, |
| 169 | aPDU := omit, |
| 170 | codecList := omit, |
| 171 | redirectAttemptFlag := omit, |
| 172 | sendSequenceNumber := omit, |
| 173 | iMSI := omit |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 179 | template PDU_BSSAP tr_BSSMAP_ComplL3 modifies tr_BSSAP_BSSMAP := { |
| 180 | pdu := { |
| 181 | bssmap := { |
| 182 | completeLayer3Information := ? |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 188 | template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_IE_CellIdentifierList cid_list) |
| 189 | modifies ts_BSSAP_BSSMAP := { |
| 190 | pdu := { |
| 191 | bssmap := { |
| 192 | handoverRequired := { |
| 193 | messageType := '11'O, |
| 194 | cause := ts_BSSMAP_IE_Cause(cause), |
| 195 | responseRequest := omit, |
| 196 | cellIdentifierList := cid_list, |
| 197 | circuitPoolList := omit, |
| 198 | currentChannelType1 := omit, |
| 199 | speechVersion := omit, |
| 200 | queueingIndicator := omit, |
| 201 | oldToNewBSSInfo := omit, |
| 202 | sourceToTargetRNCTransparentInfo := omit, |
| 203 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 204 | gERANClassmark := omit, |
| 205 | talkerPriority := omit, |
| 206 | speechCodec := omit, |
| 207 | cSG_Identifier := omit |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 213 | const OCT1 ChRate_TCHF := '08'O; |
| 214 | const OCT1 ChRate_TCHH := '09'O; |
| 215 | |
| 216 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 217 | elementIdentifier := '0B'O, /* overwritten */ |
| 218 | lengthIndicator := 0, /* overwritten */ |
| 219 | speechOrDataIndicator := '0001'B, /* speech */ |
| 220 | spare1_4 := '0000'B, |
| 221 | channelRateAndType := ChRate_TCHF, |
| 222 | speechId_DataIndicator := '01'O /* FRv1 */ |
| 223 | } |
| 224 | |
| 225 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 226 | elementIdentifier := '01'O, /* overwritten */ |
| 227 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 228 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 229 | } |
| 230 | |
Harald Welte | ab05d6c | 2017-11-23 18:50:52 +0100 | [diff] [blame] | 231 | template (value) PDU_BSSAP ts_BSSMAP_AssignmentReq(uint11_t span, uint5_t ts) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 232 | modifies ts_BSSAP_BSSMAP := { |
| 233 | pdu := { |
| 234 | bssmap := { |
| 235 | assignmentRequest := { |
| 236 | messageType :='01'O, /* overwritten */ |
| 237 | channelType := ts_BSSMAP_IE_ChannelType, |
| 238 | layer3HeaderInfo := omit, |
| 239 | priority := omit, |
| 240 | circuitIdentityCode := ts_BSSMAP_IE_CIC(span, ts), |
| 241 | downLinkDTX_Flag := omit, |
| 242 | interferenceBandToBeUsed := omit, |
| 243 | classmarkInformationType2 := omit, |
| 244 | groupCallReference := omit, |
| 245 | talkerFlag := omit, |
| 246 | configurationEvolutionIndication := omit, |
| 247 | lsaAccesControlSuppression := omit, |
| 248 | serviceHandover := omit, |
| 249 | encryptionInformation := omit, |
| 250 | talkerPriority := omit, |
| 251 | aoIPTransportLayer := omit, |
| 252 | codecList := omit, |
| 253 | callIdentifier := omit, |
| 254 | kC128 := omit, |
| 255 | globalCallReference := omit, |
| 256 | lCLS_Configuration := omit, |
| 257 | lCLS_ConnectionStatusControl := omit, |
| 258 | lCLS_CorrelationNotNeeded := omit |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 263 | |
Harald Welte | ab05d6c | 2017-11-23 18:50:52 +0100 | [diff] [blame] | 264 | template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 265 | pdu := { |
| 266 | bssmap := { |
| 267 | assignmentRequest := { |
| 268 | messageType :='01'O, /* overwritten */ |
| 269 | channelType := ?, |
| 270 | layer3HeaderInfo := *, |
| 271 | priority := *, |
| 272 | circuitIdentityCode := ?, |
| 273 | downLinkDTX_Flag := *, |
| 274 | interferenceBandToBeUsed := *, |
| 275 | classmarkInformationType2 := *, |
| 276 | groupCallReference := *, |
| 277 | talkerFlag := *, |
| 278 | configurationEvolutionIndication := *, |
| 279 | lsaAccesControlSuppression := *, |
| 280 | serviceHandover := *, |
| 281 | encryptionInformation := *, |
| 282 | talkerPriority := *, |
| 283 | aoIPTransportLayer := *, |
| 284 | codecList := *, |
| 285 | callIdentifier := *, |
| 286 | kC128 := *, |
| 287 | globalCallReference := *, |
| 288 | lCLS_Configuration := *, |
| 289 | lCLS_ConnectionStatusControl := *, |
| 290 | lCLS_CorrelationNotNeeded := * |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | template (value) PDU_BSSAP ts_BSSMAP_AssignmentComplete(BSSMAP_IE_CircuitIdentityCode cic) |
| 297 | modifies ts_BSSAP_BSSMAP := { |
| 298 | pdu := { |
| 299 | bssmap := { |
| 300 | assignmentComplete := { |
| 301 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 302 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 303 | circuitIdentityCode := cic, |
| 304 | cellIdentifier := omit, |
| 305 | chosenChannel := omit, |
| 306 | chosenEncryptionAlgorithm := omit, |
| 307 | circuitPool := omit, |
| 308 | speechVersion := omit, |
| 309 | lSAIdentifier := omit, |
| 310 | talkerPriority := omit, |
| 311 | aoIPTransportLayer := omit, |
| 312 | speechCodec := omit, |
| 313 | codecList := omit, |
| 314 | lCLS_BSS_Status := omit |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete modifies tr_BSSAP_BSSMAP := { |
| 321 | pdu := { |
| 322 | bssmap := { |
| 323 | assignmentComplete := { |
| 324 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 325 | rR_Cause := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 326 | circuitIdentityCode := ?, |
| 327 | cellIdentifier := *, |
| 328 | chosenChannel := *, |
| 329 | chosenEncryptionAlgorithm := *, |
| 330 | circuitPool := *, |
| 331 | speechVersion := *, |
| 332 | lSAIdentifier := *, |
| 333 | talkerPriority := *, |
| 334 | aoIPTransportLayer := *, |
| 335 | speechCodec := *, |
| 336 | codecList := *, |
| 337 | lCLS_BSS_Status := * |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 344 | modifies ts_BSSAP_BSSMAP := { |
| 345 | pdu := { |
| 346 | bssmap := { |
| 347 | clearCommand := { |
| 348 | messageType := '20'O, /* overwritten */ |
| 349 | layer3HeaderInfo := omit, |
| 350 | cause := ts_BSSMAP_IE_Cause(cause), |
| 351 | cSFB_Indication := omit |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 358 | pdu := { |
| 359 | bssmap := { |
| 360 | clearCommand := { |
| 361 | messageType := '20'O, /* overwritten */ |
| 362 | layer3HeaderInfo := *, |
| 363 | cause := ?, |
| 364 | cSFB_Indication := * |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 371 | modifies ts_BSSAP_BSSMAP := { |
| 372 | pdu := { |
| 373 | bssmap := { |
| 374 | clearComplete := { |
| 375 | messageType := '21'O /* overwritten */ |
| 376 | } |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 381 | } |