Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1 | module BSSMAP_Templates { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* BSSMAP Templates, building on top of BSSAP_Types from Ericsson. |
| 4 | * |
| 5 | * (C) 2017 by Harald Welte <laforge@gnumonks.org> |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Released under the terms of GNU General Public License, Version 2 or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 12 | import from General_Types all; |
| 13 | import from Osmocom_Types all; |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 14 | import from GSM_Types all; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 15 | import from BSSAP_Types all; |
| 16 | |
| 17 | type integer BssmapCause; |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 18 | type integer SpeechVersion; |
| 19 | type integer Channel; |
| 20 | type integer ChannelMode; |
| 21 | type octetstring oldToNewBSSIEs; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 22 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 23 | /* 48.008 3.2.2.5 - this actually belongs to BSSAP_Types.ttcn */ |
| 24 | type enumerated myBSSMAP_Cause { |
| 25 | /* 000 / 001: Normal event */ |
| 26 | GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE ('0000000'B), |
| 27 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE ('0000001'B), |
| 28 | GSM0808_CAUSE_UPLINK_QUALITY ('0000010'B), |
| 29 | GSM0808_CAUSE_UPLINK_STRENGTH ('0000011'B), |
| 30 | GSM0808_CAUSE_DOWNLINK_QUALITY ('0000100'B), |
| 31 | GSM0808_CAUSE_DOWNLINK_STRENGTH ('0000101'B), |
| 32 | GSM0808_CAUSE_DISTANCE ('0000110'B), |
| 33 | GSM0808_CAUSE_O_AND_M_INTERVENTION ('0000111'B), |
| 34 | GSM0808_CAUSE_RESPONSE_TO_MSC_INVOCATION ('0001000'B), |
| 35 | GSM0808_CAUSE_CALL_CONTROL ('0001001'B), |
| 36 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE_REVERSION ('0001010'B), |
| 37 | GSM0808_CAUSE_HANDOVER_SUCCESSFUL ('0001011'B), |
| 38 | GSM0808_CAUSE_BETTER_CELL ('0001100'B), |
| 39 | GSM0808_CAUSE_DIRECTED_RETRY ('0001101'B), |
| 40 | GSM0808_CAUSE_JOINED_GROUP_CALL_CHANNEL ('0001110'B), |
| 41 | GSM0808_CAUSE_TRAFFIC ('0001111'B), |
| 42 | GSM0808_CAUSE_REDUCE_LOAD_IN_SERVING_CELL ('0010000'B), |
| 43 | GSM0808_CAUSE_TRAFFIC_LOAD_IN_TGT_HIGHER_THAN_IN_SRC_CELL ('0010001'B), |
| 44 | GSM0808_CAUSE_RELOCATION_TRIGGERED ('0010010'B), |
| 45 | GSM0808_CAUSE_REQUSTED_OPT_NOT_AUTHORISED ('0010100'B), |
| 46 | GSM0808_CAUSE_ALT_CHAN_CONFIG_REQUESTED ('0010101'B), |
| 47 | GSM0808_CAUSE_RESP_TO_INT_HO_ENQ_MSG ('0010110'B), |
| 48 | GSM0808_CAUSE_INT_HO_ENQUIRY_REJECT ('0010111'B), |
| 49 | GSM0808_CAUSE_REDUNDANCY_LEVEL_NOT_ADEQUATE ('0011000'B), |
| 50 | /* reserved */ |
| 51 | /* 010: Resource unavailable */ |
| 52 | GSM0808_CAUSE_EQUIPMENT_FAILURE ('0100000'B), |
| 53 | GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE ('0100001'B), |
| 54 | GSM0808_CAUSE_RQSTED_TERRESTRIAL_RESOURCE_UNAVAILABLE ('0100010'B), |
| 55 | GSM0808_CAUSE_CCCH_OVERLOAD ('0100011'B), |
| 56 | GSM0808_CAUSE_PROCESSOR_OVERLOAD ('0100100'B), |
| 57 | GSM0808_CAUSE_BSS_NOT_EQUIPPED ('0100101'B), |
| 58 | GSM0808_CAUSE_MS_NOT_EQUIPPED ('0100110'B), |
| 59 | GSM0808_CAUSE_INVALID_CELL ('0100111'B), |
| 60 | GSM0808_CAUSE_TRAFFIC_LOAD ('0101000'B), |
| 61 | GSM0808_CAUSE_PREEMPTION ('0101001'B), |
| 62 | GSM0808_CAUSE_DTM_HO_SGSN_FAILURE ('0101010'B), |
| 63 | GSM0808_CAUSE_DTM_HO_PS_ALLOC_FAILURE ('0101011'B), |
| 64 | /* reserved */ |
| 65 | /* 011: Service or option not available, but implemented */ |
| 66 | GSM0808_CAUSE_RQSTED_TRANSCODING_RATE_ADAPTION_UNAVAILABLE ('0110000'B), |
| 67 | GSM0808_CAUSE_CIRCUIT_POOL_MISMATCH ('0110001'B), |
| 68 | GSM0808_CAUSE_SWITCH_CIRCUIT_POOL ('0110010'B), |
| 69 | GSM0808_CAUSE_RQSTED_SPEECH_VERSION_UNAVAILABLE ('0110011'B), |
| 70 | GSM0808_CAUSE_LSA_NOT_ALLOWED ('0110100'B), |
| 71 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL ('0110101'B), |
| 72 | GSM0808_CAUSE_REQ_A_IF_TYPE_UNAVAIL ('0110110'B), |
| 73 | GSM0808_CAUSE_INVALID_CSG_CELL ('0110111'B), |
| 74 | /* reserved */ |
| 75 | /* 100: Service or option not implemented or currently disabled */ |
| 76 | GSM0808_CAUSE_REQ_REDUND_LEVEL_NOT_AVAIL ('0111111'B), |
| 77 | GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED ('1000000'B), |
| 78 | GSM0808_CAUSE_GERAN_IU_MODE_FAILURE ('1000001'B), |
| 79 | GSM0808_CAUSE_INC_RELOC_NOT_SUPP_DT_PUESBINE_FEATURE ('1000010'B), |
| 80 | GSM0808_CAUSE_ACCESS_RESTRICTED_DUE_TO_SHARED_NETWORKS ('1000011'B), |
| 81 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP ('1000100'B), |
| 82 | GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP ('1000101'B), |
| 83 | GSM0808_CAUSE_REQ_REDUND_LVL_NOT_SUPP ('1000110'B), |
| 84 | /* reserved */ |
| 85 | /* 101: Invalid message */ |
| 86 | GSM0808_CAUSE_TERRESTRIAL_CIRCUIT_ALREADY_ALLOCATED ('1010000'B), |
| 87 | GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS ('1010001'B), |
| 88 | GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING ('1010010'B), |
| 89 | GSM0808_CAUSE_INCORRECT_VALUE ('1010011'B), |
| 90 | GSM0808_CAUSE_UNKNOWN_MESSAGE_TYPE ('1010100'B), |
| 91 | GSM0808_CAUSE_UNKNOWN_INFORMATION_ELEMENT ('1010101'B), |
| 92 | GSM0808_CAUSE_DTM_HO_INVALID_PS_IND ('1010110'B), |
| 93 | GSM0808_CAUSE_CALL_ID_ALREADY_ALLOC ('1010111'B), |
| 94 | /* reserved */ |
| 95 | /* 110: protocol error */ |
| 96 | GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC ('1100000'B), |
| 97 | GSM0808_CAUSE_VGCS_VBS_CALL_NON_EXISTANT ('1100001'B), |
| 98 | GSM0808_CAUSE_DTM_HO_TIMER_EXPIRY ('1100010'B) |
| 99 | } with { variant "FIELDLENGTH(7)" }; |
| 100 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 101 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 102 | discriminator := '0'B, |
| 103 | spare := '0000000'B, |
| 104 | dlci := omit, |
| 105 | lengthIndicator := 0, /* overwritten by codec */ |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 106 | pdu := { |
| 107 | bssmap := ? |
| 108 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 112 | discriminator := '0'B, |
| 113 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 114 | dlci := *, |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 115 | lengthIndicator := ?, |
| 116 | pdu := { |
| 117 | bssmap := ? |
| 118 | } |
| 119 | } |
| 120 | |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 121 | template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 122 | discriminator := '1'B, |
| 123 | spare := '0000000'B, |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 124 | dlci := dlci, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 125 | lengthIndicator := 0, /* overwritten by codec */ |
| 126 | pdu := { |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 127 | dtap := dtap |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 128 | } |
| 129 | } |
| 130 | |
| 131 | template PDU_BSSAP tr_BSSAP_DTAP := { |
| 132 | discriminator := '1'B, |
| 133 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 134 | dlci := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 135 | lengthIndicator := ?, |
| 136 | pdu := { |
| 137 | dtap := ? |
| 138 | } |
| 139 | } |
| 140 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 141 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 142 | elementIdentifier := '04'O, |
| 143 | lengthIndicator := 0, |
| 144 | causeValue := int2bit(val, 7), |
| 145 | extensionCauseValue := '0'B, |
| 146 | spare1 := omit |
| 147 | } |
| 148 | |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 149 | template (value) BSSMAP_IE_SpeechVersion ts_BSSMAP_IE_SpeechVersion(SpeechVersion val) := { |
| 150 | elementIdentifier := '40'O, |
| 151 | speechVersionIdentifier := int2bit(val, 7), |
| 152 | spare1_1 := '0'B |
| 153 | } |
| 154 | |
| 155 | template (value) BSSMAP_IE_CurrentChannelType1 ts_BSSMAP_IE_CurrentChannelType1(Channel c, ChannelMode cm) := { |
| 156 | elementIdentifier := '31'O, |
| 157 | channel := int2bit(c, 4), |
| 158 | channelMode := int2bit(cm, 4) |
| 159 | } |
| 160 | |
| 161 | template (value) BSSMAP_IE_OldToNewBSSInfo ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs val) := { |
| 162 | elementIdentifier := '3A'O, |
| 163 | lengthIndicator := 0, /* overwritten by codec */ |
| 164 | oldToNewBSSIEs := val |
| 165 | } |
| 166 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 167 | template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| 168 | pdu := { |
| 169 | bssmap := { |
| 170 | reset := { |
| 171 | messageType := '30'O, |
| 172 | cause := ts_BSSMAP_IE_Cause(cause), |
| 173 | a_InterfaceSelectorForReset := omit |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 179 | template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := { |
| 180 | pdu := { |
| 181 | bssmap := { |
| 182 | reset := { |
| 183 | messageType := '30'O, |
| 184 | cause := ?, |
| 185 | a_InterfaceSelectorForReset := * |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 191 | template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| 192 | pdu := { |
| 193 | bssmap := { |
| 194 | resetAck := { |
| 195 | messageType := '31'O, |
| 196 | a_InterfaceSelectorForReset := omit |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| 203 | pdu := { |
| 204 | bssmap := { |
| 205 | resetAck := { |
| 206 | messageType := '31'O, |
| 207 | a_InterfaceSelectorForReset := * |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 214 | elementIdentifier := '05'O, |
| 215 | lengthIndicator := 0, |
| 216 | cellIdentifierDiscriminator := '0000'B, |
| 217 | spare1_4 := '0000'B, |
| 218 | cellIdentification := ? |
| 219 | } |
| 220 | |
| 221 | type uint16_t BssmapLAC; |
| 222 | type uint16_t BssmapCI; |
| 223 | |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 224 | template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 225 | modifies ts_BSSMAP_IE_CellID := { |
| 226 | cellIdentification := { |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 227 | cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 228 | } |
| 229 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 230 | |
| 231 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 232 | modifies ts_BSSMAP_IE_CellID := { |
| 233 | cellIdentification := { |
| 234 | cI_LAC_CI := { |
| 235 | lac := int2oct(lac, 2), |
| 236 | ci := int2oct(ci, 2) |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 242 | modifies ts_BSSMAP_IE_CellID := { |
| 243 | cellIdentification := { |
| 244 | cI_CI := int2oct(ci, 2) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 249 | modifies ts_BSSMAP_IE_CellID := { |
| 250 | cellIdentification := { |
| 251 | cI_noCell := ''O |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | |
| 256 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 257 | elementIdentifier := '17'O, |
| 258 | lengthIndicator := 0, |
| 259 | layer3info := l3info |
| 260 | } |
| 261 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 262 | template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring l3info) := { |
| 263 | elementIdentifier := '17'O, |
| 264 | lengthIndicator := ?, |
| 265 | layer3info := l3info |
| 266 | } |
| 267 | |
| 268 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 269 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 270 | modifies ts_BSSAP_BSSMAP := { |
| 271 | pdu := { |
| 272 | bssmap := { |
| 273 | completeLayer3Information := { |
| 274 | messageType := '57'O, |
| 275 | cellIdentifier := cell_id, |
| 276 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 277 | chosenChannel := omit, |
| 278 | lSAIdentifier := omit, |
| 279 | aPDU := omit, |
| 280 | codecList := omit, |
| 281 | redirectAttemptFlag := omit, |
| 282 | sendSequenceNumber := omit, |
| 283 | iMSI := omit |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 289 | template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?, |
| 290 | template BSSMAP_IE_CellIdentifier cell_id := ?) |
| 291 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 292 | pdu := { |
| 293 | bssmap := { |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 294 | completeLayer3Information := { |
| 295 | messageType := '57'O, |
| 296 | cellIdentifier := cell_id, |
| 297 | layer3Information := tr_BSSMAP_IE_L3Info(l3_info), |
| 298 | chosenChannel := *, |
| 299 | lSAIdentifier := *, |
| 300 | aPDU := *, |
| 301 | codecList := *, |
| 302 | redirectAttemptFlag := *, |
| 303 | sendSequenceNumber := *, |
| 304 | iMSI := * |
| 305 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 306 | } |
| 307 | } |
| 308 | } |
| 309 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 310 | template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(BSSMAP_FIELD_CellIdentificationList cid_list) := { |
| 311 | elementIdentifier := '1A'O, |
| 312 | lengthIndicator := 0, /* overwritten */ |
| 313 | cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| 314 | spare1_4 := '0000'B, |
| 315 | cellIdentificationList := cid_list |
| 316 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 317 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 318 | 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] | 319 | modifies ts_BSSAP_BSSMAP := { |
| 320 | pdu := { |
| 321 | bssmap := { |
| 322 | handoverRequired := { |
| 323 | messageType := '11'O, |
| 324 | cause := ts_BSSMAP_IE_Cause(cause), |
| 325 | responseRequest := omit, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 326 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 327 | circuitPoolList := omit, |
| 328 | currentChannelType1 := omit, |
| 329 | speechVersion := omit, |
| 330 | queueingIndicator := omit, |
| 331 | oldToNewBSSInfo := omit, |
| 332 | sourceToTargetRNCTransparentInfo := omit, |
| 333 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 334 | gERANClassmark := omit, |
| 335 | talkerPriority := omit, |
| 336 | speechCodec := omit, |
| 337 | cSG_Identifier := omit |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 343 | const OCT1 ChRate_ANY := '00'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 344 | const OCT1 ChRate_TCHF := '08'O; |
| 345 | const OCT1 ChRate_TCHH := '09'O; |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 346 | const OCT1 ChRate_TCHForH_Fpref := '0A'O; |
| 347 | const OCT1 ChRate_TCHForH_Hpref := '0B'O; |
| 348 | const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O; |
| 349 | const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O; |
| 350 | const OCT1 ChRate_TCHForH := '0F'O; |
| 351 | const OCT1 ChRate_TCHForH_nochg := '1F'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 352 | |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 353 | const OCT1 Spdi_TCHF_FR := '01'O; |
| 354 | const OCT1 Spdi_TCHF_EFR := '11'O; |
| 355 | const OCT1 Spdi_TCHF_AMR := '21'O; |
| 356 | const OCT1 Spdi_TCHH_HR := '05'O; |
| 357 | const OCT1 Spdi_TCHH_AMR := '25'O; |
| 358 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 359 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 360 | elementIdentifier := '0B'O, /* overwritten */ |
| 361 | lengthIndicator := 0, /* overwritten */ |
| 362 | speechOrDataIndicator := '0001'B, /* speech */ |
| 363 | spare1_4 := '0000'B, |
| 364 | channelRateAndType := ChRate_TCHF, |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 365 | speechId_DataIndicator := Spdi_TCHF_FR |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 366 | } |
| 367 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 368 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := { |
| 369 | speechOrDataIndicator := '0100'B /* speech + CTM */ |
| 370 | } |
| 371 | |
| 372 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := { |
| 373 | elementIdentifier := '0B'O, /* overwritten */ |
| 374 | lengthIndicator := 0, /* overwritten */ |
| 375 | speechOrDataIndicator := '0010'B, /* data */ |
| 376 | spare1_4 := '0000'B, |
| 377 | channelRateAndType := ChRate_TCHF, |
| 378 | speechId_DataIndicator := '10'O /* 9600 bps / transparent */ |
| 379 | } |
| 380 | |
| 381 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := { |
| 382 | elementIdentifier := '0B'O, /* overwritten */ |
| 383 | lengthIndicator := 0, /* overwritten */ |
| 384 | speechOrDataIndicator := '0011'B, /* data */ |
| 385 | spare1_4 := '0000'B, |
| 386 | channelRateAndType := ChRate_ANY, |
| 387 | speechId_DataIndicator := '00'O /* spare */ |
| 388 | } |
| 389 | |
| 390 | template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := { |
| 391 | elementIdentifier := '0A'O, |
| 392 | lengthIndicator := 0, /* overwritten */ |
| 393 | permittedAlgorithms := algs, |
| 394 | key := kc |
| 395 | } |
| 396 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 397 | template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { |
| 398 | elementIdentifier := '0A'O, |
| 399 | lengthIndicator := ?, /* overwritten */ |
| 400 | permittedAlgorithms := algs, |
| 401 | key := kc |
| 402 | } |
| 403 | |
| 404 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 405 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 406 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 407 | elementIdentifier := '01'O, /* overwritten */ |
| 408 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 409 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 410 | } |
| 411 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 412 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr, |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 413 | uint16_t udp_port, |
| 414 | integer len) := { |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 415 | elementIdentifier := '7C'O, |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 416 | lengthIndicator := len, /* overwritten */ |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 417 | ipAddress := addr, |
| 418 | uDPPortValue := udp_port |
| 419 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 420 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) := |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 421 | ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 422 | template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) := |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 423 | ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 424 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 425 | template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { |
| 426 | elementIdentifier := '83'O, |
| 427 | kC128_Value := kc128 |
| 428 | } |
| 429 | |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 430 | /* 3.2.2.103 */ |
| 431 | template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := { |
| 432 | codecType := GSM_FR, |
| 433 | tF := '0'B, |
| 434 | pT := '0'B, |
| 435 | pI := '0'B, |
| 436 | fI := '1'B, |
| 437 | extendedCodecType := omit, |
| 438 | s0_7 := omit, |
| 439 | s8_15 := omit |
| 440 | } |
| 441 | template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := { |
| 442 | codecType := GSM_FR |
| 443 | } |
| 444 | template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := { |
| 445 | codecType := GSM_EFR |
| 446 | } |
| 447 | template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := { |
| 448 | codecType := GSM_HR |
| 449 | } |
| 450 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := { |
| 451 | codecType := FR_AMR, |
| 452 | s0_7 := '11111111'B, |
| 453 | s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */ |
| 454 | } |
| 455 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := { |
| 456 | codecType := HR_AMR, |
| 457 | s0_7 := '00111111'B, |
| 458 | s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */ |
| 459 | } |
| 460 | template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { |
| 461 | elementIdentifier := '7D'O, |
| 462 | lengthIndicator := 0, /* overwritten */ |
| 463 | codecElements := valueof(elem) |
| 464 | } |
| 465 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 466 | template PDU_BSSAP |
| 467 | ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 468 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 469 | modifies ts_BSSAP_BSSMAP := { |
| 470 | pdu := { |
| 471 | bssmap := { |
| 472 | assignmentRequest := { |
| 473 | messageType :='01'O, /* overwritten */ |
| 474 | channelType := ts_BSSMAP_IE_ChannelType, |
| 475 | layer3HeaderInfo := omit, |
| 476 | priority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 477 | circuitIdentityCode := cic, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 478 | downLinkDTX_Flag := omit, |
| 479 | interferenceBandToBeUsed := omit, |
| 480 | classmarkInformationType2 := omit, |
| 481 | groupCallReference := omit, |
| 482 | talkerFlag := omit, |
| 483 | configurationEvolutionIndication := omit, |
| 484 | lsaAccesControlSuppression := omit, |
| 485 | serviceHandover := omit, |
| 486 | encryptionInformation := omit, |
| 487 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 488 | aoIPTransportLayer := aoip, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 489 | codecList := omit, |
| 490 | callIdentifier := omit, |
| 491 | kC128 := omit, |
| 492 | globalCallReference := omit, |
| 493 | lCLS_Configuration := omit, |
| 494 | lCLS_ConnectionStatusControl := omit, |
| 495 | lCLS_CorrelationNotNeeded := omit |
| 496 | } |
| 497 | } |
| 498 | } |
| 499 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 500 | |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 501 | template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, |
| 502 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) |
| 503 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 504 | pdu := { |
| 505 | bssmap := { |
| 506 | assignmentRequest := { |
| 507 | messageType :='01'O, /* overwritten */ |
| 508 | channelType := ?, |
| 509 | layer3HeaderInfo := *, |
| 510 | priority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 511 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 512 | downLinkDTX_Flag := *, |
| 513 | interferenceBandToBeUsed := *, |
| 514 | classmarkInformationType2 := *, |
| 515 | groupCallReference := *, |
| 516 | talkerFlag := *, |
| 517 | configurationEvolutionIndication := *, |
| 518 | lsaAccesControlSuppression := *, |
| 519 | serviceHandover := *, |
| 520 | encryptionInformation := *, |
| 521 | talkerPriority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 522 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 523 | codecList := *, |
| 524 | callIdentifier := *, |
| 525 | kC128 := *, |
| 526 | globalCallReference := *, |
| 527 | lCLS_Configuration := *, |
| 528 | lCLS_ConnectionStatusControl := *, |
| 529 | lCLS_CorrelationNotNeeded := * |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 535 | template PDU_BSSAP |
| 536 | ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 537 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit) |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 538 | modifies ts_BSSAP_BSSMAP := { |
| 539 | pdu := { |
| 540 | bssmap := { |
| 541 | assignmentComplete := { |
| 542 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 543 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 544 | circuitIdentityCode := cic, |
| 545 | cellIdentifier := omit, |
| 546 | chosenChannel := omit, |
| 547 | chosenEncryptionAlgorithm := omit, |
| 548 | circuitPool := omit, |
| 549 | speechVersion := omit, |
| 550 | lSAIdentifier := omit, |
| 551 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 552 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 553 | speechCodec := omit, |
| 554 | codecList := omit, |
| 555 | lCLS_BSS_Status := omit |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 561 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *, |
| 562 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) |
| 563 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 564 | pdu := { |
| 565 | bssmap := { |
| 566 | assignmentComplete := { |
| 567 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 568 | rR_Cause := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 569 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 570 | cellIdentifier := *, |
| 571 | chosenChannel := *, |
| 572 | chosenEncryptionAlgorithm := *, |
| 573 | circuitPool := *, |
| 574 | speechVersion := *, |
| 575 | lSAIdentifier := *, |
| 576 | talkerPriority := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 577 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 578 | speechCodec := *, |
| 579 | codecList := *, |
| 580 | lCLS_BSS_Status := * |
| 581 | } |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 586 | template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := { |
| 587 | pdu := { |
| 588 | bssmap := { |
| 589 | assignmentFailure := { |
| 590 | messageType := '03'O, /* overwritten */ |
| 591 | rR_Cause := *, |
| 592 | circuitPool := *, |
| 593 | circuitPoolList := *, |
| 594 | talkerPriority := *, |
| 595 | codecList := * |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 602 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 603 | modifies ts_BSSAP_BSSMAP := { |
| 604 | pdu := { |
| 605 | bssmap := { |
| 606 | clearCommand := { |
| 607 | messageType := '20'O, /* overwritten */ |
| 608 | layer3HeaderInfo := omit, |
| 609 | cause := ts_BSSMAP_IE_Cause(cause), |
| 610 | cSFB_Indication := omit |
| 611 | } |
| 612 | } |
| 613 | } |
| 614 | } |
Harald Welte | 9978710 | 2019-02-04 10:41:36 +0100 | [diff] [blame] | 615 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause) |
| 616 | modifies ts_BSSMAP_ClearCommand := { |
| 617 | pdu := { |
| 618 | bssmap := { |
| 619 | clearCommand := { |
| 620 | cSFB_Indication := { |
| 621 | elementIdentifier := '8F'O |
| 622 | } |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | } |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 627 | |
| 628 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 629 | pdu := { |
| 630 | bssmap := { |
| 631 | clearCommand := { |
| 632 | messageType := '20'O, /* overwritten */ |
| 633 | layer3HeaderInfo := *, |
| 634 | cause := ?, |
| 635 | cSFB_Indication := * |
| 636 | } |
| 637 | } |
| 638 | } |
| 639 | } |
| 640 | |
Harald Welte | 4c422b7 | 2019-02-17 16:27:10 +0100 | [diff] [blame] | 641 | template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := { |
| 642 | pdu := { |
| 643 | bssmap := { |
| 644 | clearCommand := { |
| 645 | messageType := '20'O, /* overwritten */ |
| 646 | layer3HeaderInfo := *, |
| 647 | cause := ?, |
| 648 | cSFB_Indication := { |
| 649 | elementIdentifier := '8F'O |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 656 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 657 | modifies ts_BSSAP_BSSMAP := { |
| 658 | pdu := { |
| 659 | bssmap := { |
| 660 | clearComplete := { |
| 661 | messageType := '21'O /* overwritten */ |
| 662 | } |
| 663 | } |
| 664 | } |
| 665 | } |
| 666 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 667 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 668 | pdu := { |
| 669 | bssmap := { |
| 670 | clearComplete := { |
| 671 | messageType := '21'O |
| 672 | } |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 677 | template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) |
| 678 | modifies ts_BSSAP_BSSMAP := { |
| 679 | pdu := { |
| 680 | bssmap := { |
| 681 | clearRequest := { |
| 682 | messageType := '22'O, /* overwritten */ |
| 683 | cause := ts_BSSMAP_IE_Cause(cause) |
| 684 | } |
| 685 | } |
| 686 | } |
| 687 | } |
| 688 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 689 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 690 | pdu := { |
| 691 | bssmap := { |
| 692 | clearRequest := { |
| 693 | messageType := '22'O, /* overwritten */ |
| 694 | cause := ? |
| 695 | } |
| 696 | } |
| 697 | } |
| 698 | } |
| 699 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 700 | template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies tr_BSSAP_BSSMAP := { |
| 701 | pdu := { |
| 702 | bssmap := { |
| 703 | handoverRequired := { |
| 704 | messageType := '11'O |
| 705 | } |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) |
| 711 | modifies ts_BSSAP_BSSMAP := { |
| 712 | pdu := { |
| 713 | bssmap := { |
| 714 | handoverCommand := { |
| 715 | messageType := '13'O, |
| 716 | layer3Information := { |
| 717 | elementIdentifier := '17'O, |
| 718 | lengthIndicator := 0, |
| 719 | layer3info := layer3info |
| 720 | }, |
| 721 | cellIdentifier := omit, |
| 722 | newBSSToOldBSSInfo := omit, |
| 723 | talkerPriority := omit |
| 724 | } |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | |
Neels Hofmeyr | 61ebb8b | 2018-10-09 18:28:06 +0200 | [diff] [blame] | 729 | template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := { |
| 730 | pdu := { |
| 731 | bssmap := { |
| 732 | handoverFailure := { |
| 733 | messageType := '16'O, |
| 734 | cause := ?, |
| 735 | rR_Cause := *, |
| 736 | circuitPool := *, |
| 737 | circuitPoolList := *, |
| 738 | gERANClassmark := *, |
| 739 | newBSSToOldBSSInfo := *, |
| 740 | interSystemInformation := *, |
| 741 | talkerPriority := *, |
| 742 | codecList := * |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 748 | template PDU_BSSAP ts_BSSMAP_HandoverRequest( |
| 749 | template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 750 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit, |
| 751 | template BSSMAP_IE_CellIdentifier cell_id_target := ts_CellID_LAC_CI(1, 0), |
| 752 | template BSSMAP_IE_CellIdentifier cell_id_source := ts_CellID_LAC_CI(1, 1) |
| 753 | ) |
| 754 | modifies ts_BSSAP_BSSMAP := { |
| 755 | pdu := { |
| 756 | bssmap := { |
| 757 | handoverRequest := { |
| 758 | messageType := '10'O, |
| 759 | channelType := ts_BSSMAP_IE_ChannelType, |
| 760 | encryptionInformation := |
| 761 | ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O), |
| 762 | classmarkInformationType := { |
| 763 | classmarkInformationType1 := { |
| 764 | elementIdentifier := '1D'O, |
| 765 | rf_PowerCapability := '000'B, |
| 766 | a5_1 := '0'B, |
| 767 | esind := '0'B, |
| 768 | revisionLevel := '10'B, |
| 769 | spare1_1 := '0'B |
| 770 | } |
| 771 | }, |
| 772 | cellIdentifierSource := cell_id_source, |
| 773 | priority := omit, |
| 774 | circuitIdentityCode := cic, |
| 775 | downLinkDTX_Flag := omit, |
| 776 | cellIdentifierTarget := cell_id_target, |
| 777 | interferenceBandToBeUsed := omit, |
| 778 | cause := omit, |
| 779 | classmarkInformationType3 := omit, |
| 780 | currentChannelType1 := omit, |
| 781 | speechVersion := omit, |
| 782 | groupCallReference := omit, |
| 783 | talkerFlag := omit, |
| 784 | configurationEvolutionIndication := omit, |
| 785 | chosenEncryptionAlgorithm := omit, |
| 786 | oldToNewBSSInfo := omit, |
| 787 | lSAInformation := omit, |
| 788 | lSAAccessControlSuppression := omit, |
| 789 | serviceHandover := omit, |
| 790 | iMSI_bssmap := omit, |
| 791 | sourceToTargetRNCTransparentInfo := omit, |
| 792 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 793 | sNAAccessInformation := omit, |
| 794 | talkerPriority := omit, |
| 795 | aoIPTransportLayer := aoip_tla, |
| 796 | codecList := omit, |
| 797 | callIdentifier := omit, |
| 798 | kC128 := omit, |
| 799 | globalCallReference := omit, |
| 800 | lCLS_Configuration := omit, |
| 801 | connectionStatusControl := omit |
| 802 | } |
| 803 | } |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info) |
| 808 | modifies tr_BSSAP_BSSMAP := { |
| 809 | pdu := { |
| 810 | bssmap := { |
| 811 | handoverRequestAck := { |
| 812 | messageType := '12'O, |
| 813 | layer3Information := { |
| 814 | elementIdentifier := '17'O, |
| 815 | lengthIndicator := ?, |
| 816 | layer3info := layer3info |
| 817 | } |
| 818 | } |
| 819 | } |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | template PDU_BSSAP tr_BSSMAP_HandoverDetect |
| 824 | modifies tr_BSSAP_BSSMAP := { |
| 825 | pdu := { |
| 826 | bssmap := { |
| 827 | handoverDetect := { |
| 828 | messageType := '1B'O, |
| 829 | talkerPriority := * |
| 830 | } |
| 831 | } |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | template PDU_BSSAP tr_BSSMAP_HandoverComplete |
| 836 | modifies tr_BSSAP_BSSMAP := { |
| 837 | pdu := { |
| 838 | bssmap := { |
| 839 | handoverComplete := { |
| 840 | messageType := '14'O, |
| 841 | rR_Cause := *, |
| 842 | talkerPriority := *, |
| 843 | speechCodec := *, |
| 844 | codecList := *, |
| 845 | chosenEncryptionAlgorithm := *, |
| 846 | chosenChannel := *, |
| 847 | lCLS_BSS_Status := * |
| 848 | } |
| 849 | } |
| 850 | } |
| 851 | } |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 852 | |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 853 | template PDU_BSSAP tr_BSSMAP_HandoverPerformed |
| 854 | modifies tr_BSSAP_BSSMAP := { |
| 855 | pdu := { |
| 856 | bssmap := { |
| 857 | handoverPerformed := { |
| 858 | messageType := '17'O, |
| 859 | cause := ?, |
| 860 | cellIdentifier := ?, |
Philipp Maier | 8d33a13 | 2018-11-12 11:58:55 +0100 | [diff] [blame] | 861 | chosenChannel := *, |
| 862 | chosenEncryptionAlgorithm := *, |
| 863 | speechVersion := *, |
| 864 | lSAIdentifier := *, |
| 865 | talkerPriority := *, |
| 866 | codecList := *, |
| 867 | speechCodec := *, |
| 868 | lCLS_BSS_Status := * |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 869 | } |
| 870 | } |
| 871 | } |
| 872 | } |
| 873 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 874 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 875 | elementIdentifier := '08'O, |
| 876 | lengthIndicator := 0, /* overwritten */ |
| 877 | typeOfIdentity := '001'B, /* IMSI */ |
| 878 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 879 | digits := imsi_digits |
| 880 | } |
| 881 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 882 | template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { |
| 883 | elementIdentifier := '08'O, |
| 884 | lengthIndicator := ?, /* overwritten */ |
| 885 | typeOfIdentity := '001'B, /* IMSI */ |
| 886 | oddEvenIndicator := ?, |
| 887 | digits := imsi_digits |
| 888 | } |
| 889 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 890 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 891 | cIl_noCell := ''O |
| 892 | } |
| 893 | |
| 894 | private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Harald Welte | 24135bd | 2018-03-17 19:27:53 +0100 | [diff] [blame] | 895 | if (lengthof(mnc) == 2) { |
| 896 | return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]); |
Stefan Sperling | 83348bc | 2018-03-14 17:44:40 +0100 | [diff] [blame] | 897 | } else { |
| 898 | return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); |
| 899 | } |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 900 | } |
| 901 | |
| 902 | template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { |
| 903 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 904 | lac := int2oct(lac, 2), |
| 905 | ci := int2oct(ci, 2) |
| 906 | } |
| 907 | |
| 908 | template BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := { |
| 909 | lac := int2oct(lac, 2), |
| 910 | ci := int2oct(ci, 2) |
| 911 | } |
| 912 | |
| 913 | template BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := { |
| 914 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 915 | lac := int2oct(lac, 2) |
| 916 | } |
| 917 | |
| 918 | template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
| 919 | template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 920 | |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 921 | template BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC |
| 922 | ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { |
| 923 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 924 | lac := int2oct(lac, 2), |
| 925 | rncId := int2oct(rnc_id, 2) |
| 926 | } |
| 927 | |
| 928 | template BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := { |
| 929 | lac := int2oct(lac, 2), |
| 930 | rncId := int2oct(rnc_id, 2) |
| 931 | } |
| 932 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 933 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 934 | elementIdentifier := '24'O, |
| 935 | channel := chneed, |
| 936 | spare := '000000'B |
| 937 | } |
| 938 | |
| 939 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 940 | elementIdentifier := '09'O, |
| 941 | lengthIndicator := 4, |
| 942 | tmsiOctets := tmsi |
| 943 | }; |
| 944 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 945 | template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { |
| 946 | elementIdentifier := '09'O, |
| 947 | lengthIndicator := 4, |
| 948 | tmsiOctets := tmsi |
| 949 | }; |
| 950 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 951 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 952 | var template BSSMAP_IE_TMSI ret; |
| 953 | if (ispresent(tmsi)) { |
| 954 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 955 | } else { |
| 956 | ret := omit; |
| 957 | } |
| 958 | return ret; |
| 959 | } |
| 960 | |
| 961 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 962 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 963 | template OCT4 tmsi := omit, |
| 964 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 965 | modifies ts_BSSAP_BSSMAP := { |
| 966 | pdu := { |
| 967 | bssmap := { |
| 968 | paging := { |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 969 | messageType := '52'O, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 970 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 971 | tMSI := f_tmsi_or_omit(tmsi), |
| 972 | cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), |
| 973 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 974 | eMLPP_Priority := omit, |
| 975 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | } |
| 980 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 981 | template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, |
| 982 | template OCT4 tmsi := *, |
| 983 | template BSSMAP_IE_ChannelNeeded chneed := *) |
| 984 | modifies tr_BSSAP_BSSMAP := { |
| 985 | pdu := { |
| 986 | bssmap := { |
| 987 | paging := { |
| 988 | messageType := '52'O, |
| 989 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
| 990 | tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, |
| 991 | cellIdentifierList := ?, |
| 992 | channelNeeded := chneed, |
| 993 | eMLPP_Priority := omit, |
| 994 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 995 | } |
| 996 | } |
| 997 | } |
| 998 | } |
| 999 | |
| 1000 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1001 | template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) |
| 1002 | modifies ts_BSSAP_BSSMAP := { |
| 1003 | pdu := { |
| 1004 | bssmap := { |
| 1005 | cipherModeCommand := { |
| 1006 | messageType := '53'O, |
| 1007 | layer3HeaderInfo := omit, |
| 1008 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1009 | cipherResponseMode := omit, |
| 1010 | kC128 := omit |
| 1011 | } |
| 1012 | } |
| 1013 | } |
| 1014 | } |
| 1015 | |
| 1016 | template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128) |
| 1017 | modifies ts_BSSAP_BSSMAP := { |
| 1018 | pdu := { |
| 1019 | bssmap := { |
| 1020 | cipherModeCommand := { |
| 1021 | messageType := '53'O, |
| 1022 | layer3HeaderInfo := omit, |
| 1023 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1024 | cipherResponseMode := omit, |
| 1025 | kC128 := { '83'O, kc128 } |
| 1026 | } |
| 1027 | } |
| 1028 | } |
| 1029 | } |
| 1030 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1031 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key) |
| 1032 | modifies tr_BSSAP_BSSMAP := { |
| 1033 | pdu := { |
| 1034 | bssmap := { |
| 1035 | cipherModeCommand := { |
| 1036 | messageType := '53'O, |
| 1037 | layer3HeaderInfo := *, |
| 1038 | encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg), |
| 1039 | cipherResponseMode := *, |
| 1040 | kC128 := * |
| 1041 | } |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) |
| 1047 | modifies ts_BSSAP_BSSMAP := { |
| 1048 | pdu := { |
| 1049 | bssmap := { |
| 1050 | cipherModeComplete := { |
| 1051 | messageType := '55'O, |
| 1052 | layer3MessageContents := omit, |
| 1053 | chosenEncryptionAlgorithm := { |
| 1054 | elementIdentifier := '2C'O, |
| 1055 | algorithmIdentifier := alg |
| 1056 | } |
| 1057 | } |
| 1058 | } |
| 1059 | } |
| 1060 | } |
| 1061 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1062 | template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { |
| 1063 | pdu := { |
| 1064 | bssmap := { |
| 1065 | cipherModeComplete := { |
| 1066 | messageType := '55'O, |
| 1067 | layer3MessageContents := *, |
| 1068 | chosenEncryptionAlgorithm := { |
| 1069 | elementIdentifier := '2C'O, |
| 1070 | algorithmIdentifier := alg |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := { |
| 1078 | pdu := { |
| 1079 | bssmap := { |
| 1080 | cipherModeReject := { |
| 1081 | messageType := '59'O, |
| 1082 | cause := ? |
| 1083 | } |
| 1084 | } |
| 1085 | } |
| 1086 | } |
| 1087 | |
Daniel Willmann | 52918e5 | 2018-09-20 14:39:09 +0200 | [diff] [blame] | 1088 | template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := { |
| 1089 | pdu := { |
| 1090 | bssmap := { |
| 1091 | classmarkRequest := { |
| 1092 | messageType := '58'O, |
| 1093 | talkerPriority := * |
| 1094 | } |
| 1095 | } |
| 1096 | } |
| 1097 | } |
| 1098 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1099 | template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { |
| 1100 | elementIdentifier := '12'O, |
| 1101 | lengthIndicator := 0, /* overwritten */ |
| 1102 | /* CM1 */ |
| 1103 | rf_PowerCapability := '010'B, /* class3 */ |
| 1104 | a5_1 := '0'B, /* supported */ |
| 1105 | esind := '1'B, /* early classmark supported */ |
| 1106 | revisionLevel := '10'B, /* R99 */ |
| 1107 | spare1_1 := '0'B, |
| 1108 | /* CM2 */ |
| 1109 | fc := '1'B, /* E-GSM support */ |
| 1110 | vgcs := '0'B, |
| 1111 | vbs := '0'B, |
| 1112 | sm_Capability := '1'B, |
| 1113 | ss_ScreenIndicator := '00'B, |
| 1114 | ps_Capability := '1'B, |
| 1115 | spare2_1 := '0'B, |
| 1116 | classmarkInformationType2_oct5 := { |
| 1117 | a5_2 := '0'B, /* not available */ |
| 1118 | a5_3 := '1'B, /* available */ |
| 1119 | cmsp := '0'B, /* not supported */ |
| 1120 | solsa := '0'B, /* not suported */ |
| 1121 | ucs2 := '0'B, /* GSM alphabet preferred */ |
| 1122 | lcsvacap := '0'B, /* not supported */ |
| 1123 | spare := '0'B, |
| 1124 | cm3 := '0'B /* no CM3 */ |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, |
| 1129 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) |
| 1130 | modifies ts_BSSAP_BSSMAP := { |
| 1131 | pdu := { |
| 1132 | bssmap := { |
| 1133 | classmarkUpdate := { |
| 1134 | messageType := '54'O, |
| 1135 | classmarkInformationType2 := cm2, |
| 1136 | classmarkInformationType3 := cm3, |
| 1137 | talkerPriority := omit |
| 1138 | } |
| 1139 | } |
| 1140 | } |
| 1141 | } |
| 1142 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1143 | template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, |
| 1144 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) |
| 1145 | modifies tr_BSSAP_BSSMAP := { |
| 1146 | pdu := { |
| 1147 | bssmap := { |
| 1148 | classmarkUpdate := { |
| 1149 | messageType := '54'O, |
| 1150 | classmarkInformationType2 := cm2, |
| 1151 | classmarkInformationType3 := cm3, |
| 1152 | talkerPriority := * |
| 1153 | } |
| 1154 | } |
| 1155 | } |
| 1156 | } |
| 1157 | |
Neels Hofmeyr | 92b12b7 | 2018-09-18 14:30:23 +0200 | [diff] [blame] | 1158 | template PDU_BSSAP ts_BSSMAP_ClassmarkRequest |
| 1159 | modifies ts_BSSAP_BSSMAP := { |
| 1160 | pdu := { |
| 1161 | bssmap := { |
| 1162 | classmarkRequest := { |
| 1163 | messageType := '58'O, |
| 1164 | talkerPriority := omit |
| 1165 | } |
| 1166 | } |
| 1167 | } |
| 1168 | } |
| 1169 | |
Harald Welte | 49518bf | 2018-02-10 11:39:19 +0100 | [diff] [blame] | 1170 | /* return Layer3 octetstring inside BSSAP PDU */ |
| 1171 | function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring { |
| 1172 | if (ischosen(bssap.pdu.bssmap)) { |
| 1173 | var PDU_BSSMAP bssmap := bssap.pdu.bssmap; |
| 1174 | if (ischosen(bssmap.completeLayer3Information)) { |
| 1175 | return bssmap.completeLayer3Information.layer3Information.layer3info; |
| 1176 | } else if (ischosen(bssmap.handoverRequestAck)) { |
| 1177 | return bssmap.handoverRequestAck.layer3Information.layer3info; |
| 1178 | } else if (ischosen(bssmap.handoverCommand)) { |
| 1179 | return bssmap.handoverCommand.layer3Information.layer3info; |
| 1180 | } else if (ischosen(bssmap.uplinkRequest)) { |
| 1181 | return bssmap.uplinkRequest.layer3Information.layer3info; |
| 1182 | } else if (ischosen(bssmap.uplinkRequestConfirmation)) { |
| 1183 | return bssmap.uplinkRequestConfirmation.layer3Information.layer3info; |
| 1184 | } else if (ischosen(bssmap.uplinkApplicationData)) { |
| 1185 | return bssmap.uplinkApplicationData.layer3Information.layer3info; |
| 1186 | } else if (ischosen(bssmap.rerouteCommand)) { |
| 1187 | return bssmap.rerouteCommand.initialLayer3Information.layer3info; |
| 1188 | } else { |
| 1189 | return omit; |
| 1190 | } |
| 1191 | } else { |
| 1192 | return bssap.pdu.dtap; |
| 1193 | } |
| 1194 | } |
| 1195 | |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1196 | /* TS 29.205 B.2.1.9 */ |
| 1197 | template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := { |
| 1198 | networkIDLengthIndicator := 0, /* overwritten */ |
| 1199 | networkID := net_id, |
| 1200 | nodeIDLengthIndicator := 0, /* overwritten */ |
| 1201 | nodeID := node_id, |
| 1202 | callReferenceIDLengthIndicator := 0, /* overwritten */ |
| 1203 | callReferenceID := cref_id |
| 1204 | } |
| 1205 | template GlobalCallReferenceValue tr_GCR(template octetstring net_id, |
| 1206 | template OCT2 node_id, |
| 1207 | template OCT5 cref_id) := { |
| 1208 | networkIDLengthIndicator := ?, |
| 1209 | networkID := net_id, |
| 1210 | nodeIDLengthIndicator := ?, |
| 1211 | nodeID := node_id, |
| 1212 | callReferenceIDLengthIndicator := ?, |
| 1213 | callReferenceID := cref_id |
| 1214 | } |
| 1215 | |
| 1216 | /* TS 47.008 3.2.2.115 */ |
| 1217 | template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := { |
| 1218 | elementIdentifier := '89'O, |
| 1219 | lengthIndicator := 0, /* overwritten */ |
| 1220 | globalCallReferenceValue := gcr |
| 1221 | } |
| 1222 | template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := { |
| 1223 | elementIdentifier := '89'O, |
| 1224 | lengthIndicator := ?, |
| 1225 | globalCallReferenceValue := gcr |
| 1226 | } |
| 1227 | |
| 1228 | /* TS 48.008 3.2.2.116 */ |
| 1229 | const BIT4 LCLS_CFG_both_way := '0000'B; |
| 1230 | const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B; |
| 1231 | const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B; |
| 1232 | const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B; |
| 1233 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B; |
| 1234 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B; |
| 1235 | |
| 1236 | template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := { |
| 1237 | elementIdentifier := '8A'O, |
| 1238 | lCLS_ConfigurationValue := cfg_val, |
| 1239 | spare := '0000'B |
| 1240 | } |
| 1241 | template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := { |
| 1242 | elementIdentifier := '8A'O, |
| 1243 | lCLS_ConfigurationValue := cfg_val, |
| 1244 | spare := '0000'B |
| 1245 | } |
| 1246 | |
| 1247 | /* TS 48.008 3.2.2.117 */ |
| 1248 | const BIT4 LCLS_CSC_connect := '0000'B; |
| 1249 | const BIT4 LCLS_CSC_do_not_connect := '0001'B; |
| 1250 | const BIT4 LCLS_CSC_release_lcls := '0010'B; |
| 1251 | const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B; |
| 1252 | const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B; |
| 1253 | |
| 1254 | template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := { |
| 1255 | elementIdentifier := '8B'O, |
| 1256 | lCLS_ConnectionStatusControlValue := csc, |
| 1257 | spare := '0000'B |
| 1258 | } |
| 1259 | template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := { |
| 1260 | elementIdentifier := '8B'O, |
| 1261 | lCLS_ConnectionStatusControlValue := csc, |
| 1262 | spare := '0000'B |
| 1263 | } |
| 1264 | |
| 1265 | /* TS 48.008 3.2.2.119 */ |
| 1266 | const BIT4 LCLS_STS_not_yet_ls := '0000'B; |
| 1267 | const BIT4 LCLS_STS_not_possible_ls := '0001'B; |
| 1268 | const BIT4 LCLS_STS_no_longer_ls := '0010'B; |
| 1269 | const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B; |
| 1270 | const BIT4 LCLS_STS_locally_switched := '0100'B; |
| 1271 | |
| 1272 | template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := { |
| 1273 | elementIdentifier := '8D'O, |
| 1274 | lCLS_BSS_StatusValue := sts, |
| 1275 | spare := '0000'B |
| 1276 | } |
| 1277 | template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := { |
| 1278 | elementIdentifier := '8D'O, |
| 1279 | lCLS_BSS_StatusValue := sts, |
| 1280 | spare := '0000'B |
| 1281 | } |
| 1282 | |
| 1283 | /* TS 48.008 3.2.1.91 */ |
| 1284 | template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrl(template (omit) BSSMAP_IE_LCLS_Configuration cfg, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1285 | template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1286 | pdu := { |
| 1287 | bssmap := { |
| 1288 | lCLS_ConnectControl := { |
| 1289 | messageType := '74'O, |
| 1290 | lCLS_Configuration := cfg, |
| 1291 | lCLS_ConnectionStatusControl := csc |
| 1292 | } |
| 1293 | } |
| 1294 | } |
| 1295 | } |
| 1296 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1297 | template BSSMAP_IE_LCLS_ConnectionStatusControl csc) |
| 1298 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1299 | pdu := { |
| 1300 | bssmap := { |
| 1301 | lCLS_ConnectControl := { |
| 1302 | messageType := '74'O, |
| 1303 | lCLS_Configuration := cfg, |
| 1304 | lCLS_ConnectionStatusControl := csc |
| 1305 | } |
| 1306 | } |
| 1307 | } |
| 1308 | } |
| 1309 | |
| 1310 | /* TS 48.008 3.2.1.92 */ |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1311 | template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts) |
| 1312 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1313 | pdu := { |
| 1314 | bssmap := { |
| 1315 | lCLS_connectControlAck := { |
| 1316 | messageType := '75'O, |
| 1317 | lCLS_BSS_Status := sts |
| 1318 | } |
| 1319 | } |
| 1320 | } |
| 1321 | } |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1322 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts) |
| 1323 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1324 | pdu := { |
| 1325 | bssmap := { |
| 1326 | lCLS_connectControlAck := { |
| 1327 | messageType := '75'O, |
| 1328 | lCLS_BSS_Status := sts |
| 1329 | } |
| 1330 | } |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | /* TS 48.008 3.2.1.93 */ |
| 1335 | template (value) PDU_BSSAP ts_BSSMAP_LclsNotification(template (omit) BSSMAP_IE_LCLS_BSS_Status sts, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1336 | template (omit) BSSMAP_IE_LCLS_BreakRequest brq) |
| 1337 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1338 | pdu := { |
| 1339 | bssmap := { |
| 1340 | lCLS_Notification := { |
| 1341 | messageType := '76'O, |
| 1342 | lCLS_BSS_Status := sts, |
| 1343 | lCLS_BreakRequest := brq |
| 1344 | } |
| 1345 | } |
| 1346 | } |
| 1347 | } |
| 1348 | template PDU_BSSAP tr_BSSMAP_LclsNotification(template BSSMAP_IE_LCLS_BSS_Status sts, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1349 | template BSSMAP_IE_LCLS_BreakRequest brq) |
| 1350 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1351 | pdu := { |
| 1352 | bssmap := { |
| 1353 | lCLS_Notification := { |
| 1354 | messageType := '76'O, |
| 1355 | lCLS_BSS_Status := sts, |
| 1356 | lCLS_BreakRequest := brq |
| 1357 | } |
| 1358 | } |
| 1359 | } |
| 1360 | } |
| 1361 | |
Harald Welte | cc0b014 | 2018-05-29 15:19:33 +0200 | [diff] [blame] | 1362 | template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts) |
| 1363 | modifies tr_BSSAP_BSSMAP := { |
| 1364 | pdu := { |
| 1365 | bssmap := { |
| 1366 | lCLS_Notification := { |
| 1367 | messageType := '76'O, |
| 1368 | lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts), |
| 1369 | lCLS_BreakRequest := omit |
| 1370 | } |
| 1371 | } |
| 1372 | } |
| 1373 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1374 | |
| 1375 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1376 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 1377 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 1378 | } with { encode "RAW" }; |