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; |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 5 | import from GSM_Types all; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 6 | import from BSSAP_Types all; |
| 7 | |
| 8 | type integer BssmapCause; |
| 9 | |
| 10 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 11 | discriminator := '0'B, |
| 12 | spare := '0000000'B, |
| 13 | dlci := omit, |
| 14 | lengthIndicator := 0, /* overwritten by codec */ |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 15 | pdu := { |
| 16 | bssmap := ? |
| 17 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 21 | discriminator := '0'B, |
| 22 | spare := '0000000'B, |
| 23 | dlci := omit, |
| 24 | lengthIndicator := ?, |
| 25 | pdu := { |
| 26 | bssmap := ? |
| 27 | } |
| 28 | } |
| 29 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 30 | template PDU_BSSAP ts_BSSAP_DTAP := { |
| 31 | discriminator := '1'B, |
| 32 | spare := '0000000'B, |
| 33 | dlci := omit, |
| 34 | lengthIndicator := 0, /* overwritten by codec */ |
| 35 | pdu := { |
| 36 | dtap := ? |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | template PDU_BSSAP tr_BSSAP_DTAP := { |
| 41 | discriminator := '1'B, |
| 42 | spare := '0000000'B, |
| 43 | dlci := omit, |
| 44 | lengthIndicator := ?, |
| 45 | pdu := { |
| 46 | dtap := ? |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 51 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 52 | elementIdentifier := '04'O, |
| 53 | lengthIndicator := 0, |
| 54 | causeValue := int2bit(val, 7), |
| 55 | extensionCauseValue := '0'B, |
| 56 | spare1 := omit |
| 57 | } |
| 58 | |
| 59 | template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| 60 | pdu := { |
| 61 | bssmap := { |
| 62 | reset := { |
| 63 | messageType := '30'O, |
| 64 | cause := ts_BSSMAP_IE_Cause(cause), |
| 65 | a_InterfaceSelectorForReset := omit |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 71 | template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := { |
| 72 | pdu := { |
| 73 | bssmap := { |
| 74 | reset := { |
| 75 | messageType := '30'O, |
| 76 | cause := ?, |
| 77 | a_InterfaceSelectorForReset := * |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 83 | template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| 84 | pdu := { |
| 85 | bssmap := { |
| 86 | resetAck := { |
| 87 | messageType := '31'O, |
| 88 | a_InterfaceSelectorForReset := omit |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| 95 | pdu := { |
| 96 | bssmap := { |
| 97 | resetAck := { |
| 98 | messageType := '31'O, |
| 99 | a_InterfaceSelectorForReset := * |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 106 | elementIdentifier := '05'O, |
| 107 | lengthIndicator := 0, |
| 108 | cellIdentifierDiscriminator := '0000'B, |
| 109 | spare1_4 := '0000'B, |
| 110 | cellIdentification := ? |
| 111 | } |
| 112 | |
| 113 | type uint16_t BssmapLAC; |
| 114 | type uint16_t BssmapCI; |
| 115 | |
| 116 | /* |
| 117 | template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) |
| 118 | modifies ts_BSSMAP_IE_CellID := { |
| 119 | cellIdentification := { |
| 120 | cI_LAC_CGI := { |
| 121 | mnc_mcc := FIXME, |
| 122 | lac := int2oct(lac, 2), |
| 123 | ci := int2oct(ci, 2) |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | */ |
| 128 | |
| 129 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 130 | modifies ts_BSSMAP_IE_CellID := { |
| 131 | cellIdentification := { |
| 132 | cI_LAC_CI := { |
| 133 | lac := int2oct(lac, 2), |
| 134 | ci := int2oct(ci, 2) |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 140 | modifies ts_BSSMAP_IE_CellID := { |
| 141 | cellIdentification := { |
| 142 | cI_CI := int2oct(ci, 2) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 147 | modifies ts_BSSMAP_IE_CellID := { |
| 148 | cellIdentification := { |
| 149 | cI_noCell := ''O |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | |
| 154 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 155 | elementIdentifier := '17'O, |
| 156 | lengthIndicator := 0, |
| 157 | layer3info := l3info |
| 158 | } |
| 159 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 160 | template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring l3info) := { |
| 161 | elementIdentifier := '17'O, |
| 162 | lengthIndicator := ?, |
| 163 | layer3info := l3info |
| 164 | } |
| 165 | |
| 166 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 167 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 168 | modifies ts_BSSAP_BSSMAP := { |
| 169 | pdu := { |
| 170 | bssmap := { |
| 171 | completeLayer3Information := { |
| 172 | messageType := '57'O, |
| 173 | cellIdentifier := cell_id, |
| 174 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 175 | chosenChannel := omit, |
| 176 | lSAIdentifier := omit, |
| 177 | aPDU := omit, |
| 178 | codecList := omit, |
| 179 | redirectAttemptFlag := omit, |
| 180 | sendSequenceNumber := omit, |
| 181 | iMSI := omit |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 187 | template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?, |
| 188 | template BSSMAP_IE_CellIdentifier cell_id := ?) |
| 189 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 190 | pdu := { |
| 191 | bssmap := { |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 192 | completeLayer3Information := { |
| 193 | messageType := '57'O, |
| 194 | cellIdentifier := cell_id, |
| 195 | layer3Information := tr_BSSMAP_IE_L3Info(l3_info), |
| 196 | chosenChannel := *, |
| 197 | lSAIdentifier := *, |
| 198 | aPDU := *, |
| 199 | codecList := *, |
| 200 | redirectAttemptFlag := *, |
| 201 | sendSequenceNumber := *, |
| 202 | iMSI := * |
| 203 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 208 | template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(BSSMAP_FIELD_CellIdentificationList cid_list) := { |
| 209 | elementIdentifier := '1A'O, |
| 210 | lengthIndicator := 0, /* overwritten */ |
| 211 | cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| 212 | spare1_4 := '0000'B, |
| 213 | cellIdentificationList := cid_list |
| 214 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 215 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 216 | template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_FIELD_CellIdentificationList cid_list) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 217 | modifies ts_BSSAP_BSSMAP := { |
| 218 | pdu := { |
| 219 | bssmap := { |
| 220 | handoverRequired := { |
| 221 | messageType := '11'O, |
| 222 | cause := ts_BSSMAP_IE_Cause(cause), |
| 223 | responseRequest := omit, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 224 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 225 | circuitPoolList := omit, |
| 226 | currentChannelType1 := omit, |
| 227 | speechVersion := omit, |
| 228 | queueingIndicator := omit, |
| 229 | oldToNewBSSInfo := omit, |
| 230 | sourceToTargetRNCTransparentInfo := omit, |
| 231 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 232 | gERANClassmark := omit, |
| 233 | talkerPriority := omit, |
| 234 | speechCodec := omit, |
| 235 | cSG_Identifier := omit |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 241 | const OCT1 ChRate_TCHF := '08'O; |
| 242 | const OCT1 ChRate_TCHH := '09'O; |
| 243 | |
| 244 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 245 | elementIdentifier := '0B'O, /* overwritten */ |
| 246 | lengthIndicator := 0, /* overwritten */ |
| 247 | speechOrDataIndicator := '0001'B, /* speech */ |
| 248 | spare1_4 := '0000'B, |
| 249 | channelRateAndType := ChRate_TCHF, |
| 250 | speechId_DataIndicator := '01'O /* FRv1 */ |
| 251 | } |
| 252 | |
| 253 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 254 | elementIdentifier := '01'O, /* overwritten */ |
| 255 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 256 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 257 | } |
| 258 | |
Harald Welte | ab05d6c | 2017-11-23 18:50:52 +0100 | [diff] [blame] | 259 | 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] | 260 | modifies ts_BSSAP_BSSMAP := { |
| 261 | pdu := { |
| 262 | bssmap := { |
| 263 | assignmentRequest := { |
| 264 | messageType :='01'O, /* overwritten */ |
| 265 | channelType := ts_BSSMAP_IE_ChannelType, |
| 266 | layer3HeaderInfo := omit, |
| 267 | priority := omit, |
| 268 | circuitIdentityCode := ts_BSSMAP_IE_CIC(span, ts), |
| 269 | downLinkDTX_Flag := omit, |
| 270 | interferenceBandToBeUsed := omit, |
| 271 | classmarkInformationType2 := omit, |
| 272 | groupCallReference := omit, |
| 273 | talkerFlag := omit, |
| 274 | configurationEvolutionIndication := omit, |
| 275 | lsaAccesControlSuppression := omit, |
| 276 | serviceHandover := omit, |
| 277 | encryptionInformation := omit, |
| 278 | talkerPriority := omit, |
| 279 | aoIPTransportLayer := omit, |
| 280 | codecList := omit, |
| 281 | callIdentifier := omit, |
| 282 | kC128 := omit, |
| 283 | globalCallReference := omit, |
| 284 | lCLS_Configuration := omit, |
| 285 | lCLS_ConnectionStatusControl := omit, |
| 286 | lCLS_CorrelationNotNeeded := omit |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 291 | |
Harald Welte | ab05d6c | 2017-11-23 18:50:52 +0100 | [diff] [blame] | 292 | template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 293 | pdu := { |
| 294 | bssmap := { |
| 295 | assignmentRequest := { |
| 296 | messageType :='01'O, /* overwritten */ |
| 297 | channelType := ?, |
| 298 | layer3HeaderInfo := *, |
| 299 | priority := *, |
| 300 | circuitIdentityCode := ?, |
| 301 | downLinkDTX_Flag := *, |
| 302 | interferenceBandToBeUsed := *, |
| 303 | classmarkInformationType2 := *, |
| 304 | groupCallReference := *, |
| 305 | talkerFlag := *, |
| 306 | configurationEvolutionIndication := *, |
| 307 | lsaAccesControlSuppression := *, |
| 308 | serviceHandover := *, |
| 309 | encryptionInformation := *, |
| 310 | talkerPriority := *, |
| 311 | aoIPTransportLayer := *, |
| 312 | codecList := *, |
| 313 | callIdentifier := *, |
| 314 | kC128 := *, |
| 315 | globalCallReference := *, |
| 316 | lCLS_Configuration := *, |
| 317 | lCLS_ConnectionStatusControl := *, |
| 318 | lCLS_CorrelationNotNeeded := * |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | template (value) PDU_BSSAP ts_BSSMAP_AssignmentComplete(BSSMAP_IE_CircuitIdentityCode cic) |
| 325 | modifies ts_BSSAP_BSSMAP := { |
| 326 | pdu := { |
| 327 | bssmap := { |
| 328 | assignmentComplete := { |
| 329 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 330 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 331 | circuitIdentityCode := cic, |
| 332 | cellIdentifier := omit, |
| 333 | chosenChannel := omit, |
| 334 | chosenEncryptionAlgorithm := omit, |
| 335 | circuitPool := omit, |
| 336 | speechVersion := omit, |
| 337 | lSAIdentifier := omit, |
| 338 | talkerPriority := omit, |
| 339 | aoIPTransportLayer := omit, |
| 340 | speechCodec := omit, |
| 341 | codecList := omit, |
| 342 | lCLS_BSS_Status := omit |
| 343 | } |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete modifies tr_BSSAP_BSSMAP := { |
| 349 | pdu := { |
| 350 | bssmap := { |
| 351 | assignmentComplete := { |
| 352 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 353 | rR_Cause := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 354 | circuitIdentityCode := ?, |
| 355 | cellIdentifier := *, |
| 356 | chosenChannel := *, |
| 357 | chosenEncryptionAlgorithm := *, |
| 358 | circuitPool := *, |
| 359 | speechVersion := *, |
| 360 | lSAIdentifier := *, |
| 361 | talkerPriority := *, |
| 362 | aoIPTransportLayer := *, |
| 363 | speechCodec := *, |
| 364 | codecList := *, |
| 365 | lCLS_BSS_Status := * |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 372 | modifies ts_BSSAP_BSSMAP := { |
| 373 | pdu := { |
| 374 | bssmap := { |
| 375 | clearCommand := { |
| 376 | messageType := '20'O, /* overwritten */ |
| 377 | layer3HeaderInfo := omit, |
| 378 | cause := ts_BSSMAP_IE_Cause(cause), |
| 379 | cSFB_Indication := omit |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 386 | pdu := { |
| 387 | bssmap := { |
| 388 | clearCommand := { |
| 389 | messageType := '20'O, /* overwritten */ |
| 390 | layer3HeaderInfo := *, |
| 391 | cause := ?, |
| 392 | cSFB_Indication := * |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 399 | modifies ts_BSSAP_BSSMAP := { |
| 400 | pdu := { |
| 401 | bssmap := { |
| 402 | clearComplete := { |
| 403 | messageType := '21'O /* overwritten */ |
| 404 | } |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 409 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 410 | pdu := { |
| 411 | bssmap := { |
| 412 | clearComplete := { |
| 413 | messageType := '21'O |
| 414 | } |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 419 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 420 | pdu := { |
| 421 | bssmap := { |
| 422 | clearRequest := { |
| 423 | messageType := '22'O, /* overwritten */ |
| 424 | cause := ? |
| 425 | } |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 431 | function f_hex_is_odd_length(hexstring digits) return bitstring { |
| 432 | if (lengthof(digits) rem 2 == 1) { |
| 433 | return '1'B; |
| 434 | } else { |
| 435 | return '0'B; |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 440 | elementIdentifier := '08'O, |
| 441 | lengthIndicator := 0, /* overwritten */ |
| 442 | typeOfIdentity := '001'B, /* IMSI */ |
| 443 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 444 | digits := imsi_digits |
| 445 | } |
| 446 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 447 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 448 | cIl_noCell := ''O |
| 449 | } |
| 450 | |
| 451 | private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 452 | return hex2oct(mcc[1] & mcc[0] & mnc[0] & mnc[2] & mnc[1]); |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 453 | } |
| 454 | |
| 455 | template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { |
| 456 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 457 | lac := int2oct(lac, 2), |
| 458 | ci := int2oct(ci, 2) |
| 459 | } |
| 460 | |
| 461 | template BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := { |
| 462 | lac := int2oct(lac, 2), |
| 463 | ci := int2oct(ci, 2) |
| 464 | } |
| 465 | |
| 466 | template BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := { |
| 467 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 468 | lac := int2oct(lac, 2) |
| 469 | } |
| 470 | |
| 471 | template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
| 472 | template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 473 | |
| 474 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 475 | elementIdentifier := '24'O, |
| 476 | channel := chneed, |
| 477 | spare := '000000'B |
| 478 | } |
| 479 | |
| 480 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 481 | elementIdentifier := '09'O, |
| 482 | lengthIndicator := 4, |
| 483 | tmsiOctets := tmsi |
| 484 | }; |
| 485 | |
| 486 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 487 | var template BSSMAP_IE_TMSI ret; |
| 488 | if (ispresent(tmsi)) { |
| 489 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 490 | } else { |
| 491 | ret := omit; |
| 492 | } |
| 493 | return ret; |
| 494 | } |
| 495 | |
| 496 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 497 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 498 | template OCT4 tmsi := omit, |
| 499 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 500 | modifies ts_BSSAP_BSSMAP := { |
| 501 | pdu := { |
| 502 | bssmap := { |
| 503 | paging := { |
| 504 | messageType := '51'O, |
| 505 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 506 | tMSI := f_tmsi_or_omit(tmsi), |
| 507 | cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), |
| 508 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 509 | eMLPP_Priority := omit, |
| 510 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 516 | |
| 517 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 518 | } |