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 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 310 | template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(template BSSMAP_FIELD_CellIdentificationList cid_list) := { |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 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 | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 318 | const OCT1 ChRate_ANY := '00'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 319 | const OCT1 ChRate_TCHF := '08'O; |
| 320 | const OCT1 ChRate_TCHH := '09'O; |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 321 | const OCT1 ChRate_TCHForH_Fpref := '0A'O; |
| 322 | const OCT1 ChRate_TCHForH_Hpref := '0B'O; |
| 323 | const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O; |
| 324 | const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O; |
| 325 | const OCT1 ChRate_TCHForH := '0F'O; |
| 326 | const OCT1 ChRate_TCHForH_nochg := '1F'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 327 | |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 328 | const OCT1 Spdi_TCHF_FR := '01'O; |
| 329 | const OCT1 Spdi_TCHF_EFR := '11'O; |
| 330 | const OCT1 Spdi_TCHF_AMR := '21'O; |
| 331 | const OCT1 Spdi_TCHH_HR := '05'O; |
| 332 | const OCT1 Spdi_TCHH_AMR := '25'O; |
| 333 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 334 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 335 | elementIdentifier := '0B'O, /* overwritten */ |
| 336 | lengthIndicator := 0, /* overwritten */ |
| 337 | speechOrDataIndicator := '0001'B, /* speech */ |
| 338 | spare1_4 := '0000'B, |
| 339 | channelRateAndType := ChRate_TCHF, |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 340 | speechId_DataIndicator := Spdi_TCHF_FR |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 341 | } |
| 342 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 343 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := { |
| 344 | speechOrDataIndicator := '0100'B /* speech + CTM */ |
| 345 | } |
| 346 | |
| 347 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := { |
| 348 | elementIdentifier := '0B'O, /* overwritten */ |
| 349 | lengthIndicator := 0, /* overwritten */ |
| 350 | speechOrDataIndicator := '0010'B, /* data */ |
| 351 | spare1_4 := '0000'B, |
| 352 | channelRateAndType := ChRate_TCHF, |
| 353 | speechId_DataIndicator := '10'O /* 9600 bps / transparent */ |
| 354 | } |
| 355 | |
| 356 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := { |
| 357 | elementIdentifier := '0B'O, /* overwritten */ |
| 358 | lengthIndicator := 0, /* overwritten */ |
| 359 | speechOrDataIndicator := '0011'B, /* data */ |
| 360 | spare1_4 := '0000'B, |
| 361 | channelRateAndType := ChRate_ANY, |
| 362 | speechId_DataIndicator := '00'O /* spare */ |
| 363 | } |
| 364 | |
| 365 | template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := { |
| 366 | elementIdentifier := '0A'O, |
| 367 | lengthIndicator := 0, /* overwritten */ |
| 368 | permittedAlgorithms := algs, |
| 369 | key := kc |
| 370 | } |
| 371 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 372 | template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { |
| 373 | elementIdentifier := '0A'O, |
| 374 | lengthIndicator := ?, /* overwritten */ |
| 375 | permittedAlgorithms := algs, |
| 376 | key := kc |
| 377 | } |
| 378 | |
| 379 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 380 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 381 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 382 | elementIdentifier := '01'O, /* overwritten */ |
| 383 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 384 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 385 | } |
| 386 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 387 | 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] | 388 | uint16_t udp_port, |
| 389 | integer len) := { |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 390 | elementIdentifier := '7C'O, |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 391 | lengthIndicator := len, /* overwritten */ |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 392 | ipAddress := addr, |
| 393 | uDPPortValue := udp_port |
| 394 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 395 | 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] | 396 | ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 397 | 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] | 398 | ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 399 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 400 | template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { |
| 401 | elementIdentifier := '83'O, |
| 402 | kC128_Value := kc128 |
| 403 | } |
| 404 | |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 405 | /* 3.2.2.103 */ |
| 406 | template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := { |
| 407 | codecType := GSM_FR, |
| 408 | tF := '0'B, |
| 409 | pT := '0'B, |
| 410 | pI := '0'B, |
| 411 | fI := '1'B, |
| 412 | extendedCodecType := omit, |
| 413 | s0_7 := omit, |
| 414 | s8_15 := omit |
| 415 | } |
| 416 | template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := { |
| 417 | codecType := GSM_FR |
| 418 | } |
| 419 | template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := { |
| 420 | codecType := GSM_EFR |
| 421 | } |
| 422 | template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := { |
| 423 | codecType := GSM_HR |
| 424 | } |
| 425 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := { |
| 426 | codecType := FR_AMR, |
| 427 | s0_7 := '11111111'B, |
| 428 | s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */ |
| 429 | } |
| 430 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := { |
| 431 | codecType := HR_AMR, |
| 432 | s0_7 := '00111111'B, |
| 433 | s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */ |
| 434 | } |
| 435 | template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { |
| 436 | elementIdentifier := '7D'O, |
| 437 | lengthIndicator := 0, /* overwritten */ |
| 438 | codecElements := valueof(elem) |
| 439 | } |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 440 | template BSSMAP_IE_SpeechCodec ts_BSSMAP_IE_SpeechCodec(template BSSMAP_FIELD_CodecElements elem) := { |
| 441 | elementIdentifier := '7E'O, |
| 442 | lengthIndicator := 0, /* overwritten */ |
| 443 | codecElements := valueof(elem) |
| 444 | } |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 445 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 446 | template PDU_BSSAP |
| 447 | ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 448 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 449 | modifies ts_BSSAP_BSSMAP := { |
| 450 | pdu := { |
| 451 | bssmap := { |
| 452 | assignmentRequest := { |
| 453 | messageType :='01'O, /* overwritten */ |
| 454 | channelType := ts_BSSMAP_IE_ChannelType, |
| 455 | layer3HeaderInfo := omit, |
| 456 | priority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 457 | circuitIdentityCode := cic, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 458 | downLinkDTX_Flag := omit, |
| 459 | interferenceBandToBeUsed := omit, |
| 460 | classmarkInformationType2 := omit, |
| 461 | groupCallReference := omit, |
| 462 | talkerFlag := omit, |
| 463 | configurationEvolutionIndication := omit, |
| 464 | lsaAccesControlSuppression := omit, |
| 465 | serviceHandover := omit, |
| 466 | encryptionInformation := omit, |
| 467 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 468 | aoIPTransportLayer := aoip, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 469 | codecList := omit, |
| 470 | callIdentifier := omit, |
| 471 | kC128 := omit, |
| 472 | globalCallReference := omit, |
| 473 | lCLS_Configuration := omit, |
| 474 | lCLS_ConnectionStatusControl := omit, |
| 475 | lCLS_CorrelationNotNeeded := omit |
| 476 | } |
| 477 | } |
| 478 | } |
| 479 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 480 | |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 481 | template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, |
| 482 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) |
| 483 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 484 | pdu := { |
| 485 | bssmap := { |
| 486 | assignmentRequest := { |
| 487 | messageType :='01'O, /* overwritten */ |
| 488 | channelType := ?, |
| 489 | layer3HeaderInfo := *, |
| 490 | priority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 491 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 492 | downLinkDTX_Flag := *, |
| 493 | interferenceBandToBeUsed := *, |
| 494 | classmarkInformationType2 := *, |
| 495 | groupCallReference := *, |
| 496 | talkerFlag := *, |
| 497 | configurationEvolutionIndication := *, |
| 498 | lsaAccesControlSuppression := *, |
| 499 | serviceHandover := *, |
| 500 | encryptionInformation := *, |
| 501 | talkerPriority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 502 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 503 | codecList := *, |
| 504 | callIdentifier := *, |
| 505 | kC128 := *, |
| 506 | globalCallReference := *, |
| 507 | lCLS_Configuration := *, |
| 508 | lCLS_ConnectionStatusControl := *, |
| 509 | lCLS_CorrelationNotNeeded := * |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 515 | template PDU_BSSAP |
| 516 | ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 517 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit, |
| 518 | template BSSMAP_IE_SpeechCodec speechCodec := omit) |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 519 | modifies ts_BSSAP_BSSMAP := { |
| 520 | pdu := { |
| 521 | bssmap := { |
| 522 | assignmentComplete := { |
| 523 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 524 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 525 | circuitIdentityCode := cic, |
| 526 | cellIdentifier := omit, |
| 527 | chosenChannel := omit, |
| 528 | chosenEncryptionAlgorithm := omit, |
| 529 | circuitPool := omit, |
| 530 | speechVersion := omit, |
| 531 | lSAIdentifier := omit, |
| 532 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 533 | aoIPTransportLayer := aoip, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 534 | speechCodec := speechCodec, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 535 | codecList := omit, |
| 536 | lCLS_BSS_Status := omit |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 542 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *, |
| 543 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) |
| 544 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 545 | pdu := { |
| 546 | bssmap := { |
| 547 | assignmentComplete := { |
| 548 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 549 | rR_Cause := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 550 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 551 | cellIdentifier := *, |
| 552 | chosenChannel := *, |
| 553 | chosenEncryptionAlgorithm := *, |
| 554 | circuitPool := *, |
| 555 | speechVersion := *, |
| 556 | lSAIdentifier := *, |
| 557 | talkerPriority := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 558 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 559 | speechCodec := *, |
| 560 | codecList := *, |
| 561 | lCLS_BSS_Status := * |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 567 | template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := { |
| 568 | pdu := { |
| 569 | bssmap := { |
| 570 | assignmentFailure := { |
| 571 | messageType := '03'O, /* overwritten */ |
| 572 | rR_Cause := *, |
| 573 | circuitPool := *, |
| 574 | circuitPoolList := *, |
| 575 | talkerPriority := *, |
| 576 | codecList := * |
| 577 | } |
| 578 | } |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 583 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 584 | modifies ts_BSSAP_BSSMAP := { |
| 585 | pdu := { |
| 586 | bssmap := { |
| 587 | clearCommand := { |
| 588 | messageType := '20'O, /* overwritten */ |
| 589 | layer3HeaderInfo := omit, |
| 590 | cause := ts_BSSMAP_IE_Cause(cause), |
| 591 | cSFB_Indication := omit |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | } |
Harald Welte | 9978710 | 2019-02-04 10:41:36 +0100 | [diff] [blame] | 596 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause) |
| 597 | modifies ts_BSSMAP_ClearCommand := { |
| 598 | pdu := { |
| 599 | bssmap := { |
| 600 | clearCommand := { |
| 601 | cSFB_Indication := { |
| 602 | elementIdentifier := '8F'O |
| 603 | } |
| 604 | } |
| 605 | } |
| 606 | } |
| 607 | } |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 608 | |
| 609 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 610 | pdu := { |
| 611 | bssmap := { |
| 612 | clearCommand := { |
| 613 | messageType := '20'O, /* overwritten */ |
| 614 | layer3HeaderInfo := *, |
| 615 | cause := ?, |
| 616 | cSFB_Indication := * |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | } |
| 621 | |
Harald Welte | 4c422b7 | 2019-02-17 16:27:10 +0100 | [diff] [blame] | 622 | template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := { |
| 623 | pdu := { |
| 624 | bssmap := { |
| 625 | clearCommand := { |
| 626 | messageType := '20'O, /* overwritten */ |
| 627 | layer3HeaderInfo := *, |
| 628 | cause := ?, |
| 629 | cSFB_Indication := { |
| 630 | elementIdentifier := '8F'O |
| 631 | } |
| 632 | } |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 637 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 638 | modifies ts_BSSAP_BSSMAP := { |
| 639 | pdu := { |
| 640 | bssmap := { |
| 641 | clearComplete := { |
| 642 | messageType := '21'O /* overwritten */ |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | } |
| 647 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 648 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 649 | pdu := { |
| 650 | bssmap := { |
| 651 | clearComplete := { |
| 652 | messageType := '21'O |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 658 | template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) |
| 659 | modifies ts_BSSAP_BSSMAP := { |
| 660 | pdu := { |
| 661 | bssmap := { |
| 662 | clearRequest := { |
| 663 | messageType := '22'O, /* overwritten */ |
| 664 | cause := ts_BSSMAP_IE_Cause(cause) |
| 665 | } |
| 666 | } |
| 667 | } |
| 668 | } |
| 669 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 670 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 671 | pdu := { |
| 672 | bssmap := { |
| 673 | clearRequest := { |
| 674 | messageType := '22'O, /* overwritten */ |
| 675 | cause := ? |
| 676 | } |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 681 | template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause, |
| 682 | template BSSMAP_FIELD_CellIdentificationList cid_list) |
| 683 | modifies ts_BSSAP_BSSMAP := { |
| 684 | pdu := { |
| 685 | bssmap := { |
| 686 | handoverRequired := { |
| 687 | messageType := '11'O, |
| 688 | cause := ts_BSSMAP_IE_Cause(cause), |
| 689 | responseRequest := omit, |
| 690 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
| 691 | circuitPoolList := omit, |
| 692 | currentChannelType1 := omit, |
| 693 | speechVersion := omit, |
| 694 | queueingIndicator := omit, |
| 695 | oldToNewBSSInfo := omit, |
| 696 | sourceToTargetRNCTransparentInfo := omit, |
| 697 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 698 | gERANClassmark := omit, |
| 699 | talkerPriority := omit, |
| 700 | speechCodec := omit, |
| 701 | cSG_Identifier := omit |
| 702 | } |
| 703 | } |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 708 | template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies tr_BSSAP_BSSMAP := { |
| 709 | pdu := { |
| 710 | bssmap := { |
| 711 | handoverRequired := { |
| 712 | messageType := '11'O |
| 713 | } |
| 714 | } |
| 715 | } |
| 716 | } |
| 717 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 718 | template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := { |
| 719 | pdu := { |
| 720 | bssmap := { |
| 721 | handoverRequiredReject := { |
| 722 | messageType := '1A'O |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | template PDU_BSSAP tr_BSSMAP_HandoverCommand |
| 729 | modifies tr_BSSAP_BSSMAP := { |
| 730 | pdu := { |
| 731 | bssmap := { |
| 732 | handoverCommand := { |
| 733 | messageType := '13'O |
| 734 | } |
| 735 | } |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | template PDU_BSSAP tr_BSSMAP_HandoverSucceeded |
| 740 | modifies tr_BSSAP_BSSMAP := { |
| 741 | pdu := { |
| 742 | bssmap := { |
| 743 | handoverSucceeded := { |
| 744 | messageType := '15'O |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | } |
| 749 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 750 | template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) |
| 751 | modifies ts_BSSAP_BSSMAP := { |
| 752 | pdu := { |
| 753 | bssmap := { |
| 754 | handoverCommand := { |
| 755 | messageType := '13'O, |
| 756 | layer3Information := { |
| 757 | elementIdentifier := '17'O, |
| 758 | lengthIndicator := 0, |
| 759 | layer3info := layer3info |
| 760 | }, |
| 761 | cellIdentifier := omit, |
| 762 | newBSSToOldBSSInfo := omit, |
| 763 | talkerPriority := omit |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
Neels Hofmeyr | 61ebb8b | 2018-10-09 18:28:06 +0200 | [diff] [blame] | 769 | template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := { |
| 770 | pdu := { |
| 771 | bssmap := { |
| 772 | handoverFailure := { |
| 773 | messageType := '16'O, |
| 774 | cause := ?, |
| 775 | rR_Cause := *, |
| 776 | circuitPool := *, |
| 777 | circuitPoolList := *, |
| 778 | gERANClassmark := *, |
| 779 | newBSSToOldBSSInfo := *, |
| 780 | interSystemInformation := *, |
| 781 | talkerPriority := *, |
| 782 | codecList := * |
| 783 | } |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 788 | template PDU_BSSAP tr_BSSMAP_HandoverRequest modifies tr_BSSAP_BSSMAP := { |
| 789 | pdu := { |
| 790 | bssmap := { |
| 791 | handoverRequest := { |
| 792 | messageType := '10'O |
| 793 | } |
| 794 | } |
| 795 | } |
| 796 | } |
| 797 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 798 | template PDU_BSSAP ts_BSSMAP_HandoverRequest( |
| 799 | template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 800 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit, |
| 801 | template BSSMAP_IE_CellIdentifier cell_id_target := ts_CellID_LAC_CI(1, 0), |
| 802 | template BSSMAP_IE_CellIdentifier cell_id_source := ts_CellID_LAC_CI(1, 1) |
| 803 | ) |
| 804 | modifies ts_BSSAP_BSSMAP := { |
| 805 | pdu := { |
| 806 | bssmap := { |
| 807 | handoverRequest := { |
| 808 | messageType := '10'O, |
| 809 | channelType := ts_BSSMAP_IE_ChannelType, |
| 810 | encryptionInformation := |
| 811 | ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O), |
| 812 | classmarkInformationType := { |
| 813 | classmarkInformationType1 := { |
| 814 | elementIdentifier := '1D'O, |
| 815 | rf_PowerCapability := '000'B, |
| 816 | a5_1 := '0'B, |
| 817 | esind := '0'B, |
| 818 | revisionLevel := '10'B, |
| 819 | spare1_1 := '0'B |
| 820 | } |
| 821 | }, |
| 822 | cellIdentifierSource := cell_id_source, |
| 823 | priority := omit, |
| 824 | circuitIdentityCode := cic, |
| 825 | downLinkDTX_Flag := omit, |
| 826 | cellIdentifierTarget := cell_id_target, |
| 827 | interferenceBandToBeUsed := omit, |
| 828 | cause := omit, |
| 829 | classmarkInformationType3 := omit, |
| 830 | currentChannelType1 := omit, |
| 831 | speechVersion := omit, |
| 832 | groupCallReference := omit, |
| 833 | talkerFlag := omit, |
| 834 | configurationEvolutionIndication := omit, |
| 835 | chosenEncryptionAlgorithm := omit, |
| 836 | oldToNewBSSInfo := omit, |
| 837 | lSAInformation := omit, |
| 838 | lSAAccessControlSuppression := omit, |
| 839 | serviceHandover := omit, |
| 840 | iMSI_bssmap := omit, |
| 841 | sourceToTargetRNCTransparentInfo := omit, |
| 842 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 843 | sNAAccessInformation := omit, |
| 844 | talkerPriority := omit, |
| 845 | aoIPTransportLayer := aoip_tla, |
| 846 | codecList := omit, |
| 847 | callIdentifier := omit, |
| 848 | kC128 := omit, |
| 849 | globalCallReference := omit, |
| 850 | lCLS_Configuration := omit, |
| 851 | connectionStatusControl := omit |
| 852 | } |
| 853 | } |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info) |
| 858 | modifies tr_BSSAP_BSSMAP := { |
| 859 | pdu := { |
| 860 | bssmap := { |
| 861 | handoverRequestAck := { |
| 862 | messageType := '12'O, |
| 863 | layer3Information := { |
| 864 | elementIdentifier := '17'O, |
| 865 | lengthIndicator := ?, |
| 866 | layer3info := layer3info |
| 867 | } |
| 868 | } |
| 869 | } |
| 870 | } |
| 871 | } |
| 872 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 873 | template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge( |
| 874 | template octetstring layer3info, |
| 875 | template LIN1 layer3infoLength, |
| 876 | template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit, |
| 877 | template BSSMAP_IE_SpeechCodec speechCodec := omit, |
| 878 | template BSSMAP_IE_ChosenChannel chosenChannel := omit, |
| 879 | template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit) |
| 880 | modifies ts_BSSAP_BSSMAP := { |
| 881 | pdu := { |
| 882 | bssmap := { |
| 883 | handoverRequestAck := { |
| 884 | messageType := '12'O, |
| 885 | layer3Information := { |
| 886 | elementIdentifier := '17'O, |
| 887 | lengthIndicator := layer3infoLength, |
| 888 | layer3info := layer3info |
| 889 | }, |
| 890 | chosenChannel := chosenChannel, |
| 891 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
| 892 | circuitPool := omit, |
| 893 | speechVersion := omit, |
| 894 | circuitIdentityCode := omit, |
| 895 | lSAIdentifier := omit, |
| 896 | newBSSToOldBSSInfo := omit, |
| 897 | interSystemInformation := omit, |
| 898 | talkerPriority := omit, |
| 899 | aoIPTransportLayer := aoIPTransportLayer, |
| 900 | codecList := omit, |
| 901 | speechCodec := speechCodec, |
| 902 | lCLS_bSS_Status := omit |
| 903 | } |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 908 | template PDU_BSSAP tr_BSSMAP_HandoverDetect |
| 909 | modifies tr_BSSAP_BSSMAP := { |
| 910 | pdu := { |
| 911 | bssmap := { |
| 912 | handoverDetect := { |
| 913 | messageType := '1B'O, |
| 914 | talkerPriority := * |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | } |
| 919 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 920 | template PDU_BSSAP ts_BSSMAP_HandoverDetect |
| 921 | modifies ts_BSSAP_BSSMAP := { |
| 922 | pdu := { |
| 923 | bssmap := { |
| 924 | handoverDetect := { |
| 925 | messageType := '1B'O, |
| 926 | talkerPriority := omit |
| 927 | } |
| 928 | } |
| 929 | } |
| 930 | } |
| 931 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 932 | template PDU_BSSAP tr_BSSMAP_HandoverComplete |
| 933 | modifies tr_BSSAP_BSSMAP := { |
| 934 | pdu := { |
| 935 | bssmap := { |
| 936 | handoverComplete := { |
| 937 | messageType := '14'O, |
| 938 | rR_Cause := *, |
| 939 | talkerPriority := *, |
| 940 | speechCodec := *, |
| 941 | codecList := *, |
| 942 | chosenEncryptionAlgorithm := *, |
| 943 | chosenChannel := *, |
| 944 | lCLS_BSS_Status := * |
| 945 | } |
| 946 | } |
| 947 | } |
| 948 | } |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 949 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 950 | template PDU_BSSAP ts_BSSMAP_HandoverComplete |
| 951 | modifies ts_BSSAP_BSSMAP := { |
| 952 | pdu := { |
| 953 | bssmap := { |
| 954 | handoverComplete := { |
| 955 | messageType := '14'O, |
| 956 | rR_Cause := omit, |
| 957 | talkerPriority := omit, |
| 958 | speechCodec := omit, |
| 959 | codecList := omit, |
| 960 | chosenEncryptionAlgorithm := omit, |
| 961 | chosenChannel := omit, |
| 962 | lCLS_BSS_Status := omit |
| 963 | } |
| 964 | } |
| 965 | } |
| 966 | } |
| 967 | |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 968 | template PDU_BSSAP tr_BSSMAP_HandoverPerformed |
| 969 | modifies tr_BSSAP_BSSMAP := { |
| 970 | pdu := { |
| 971 | bssmap := { |
| 972 | handoverPerformed := { |
| 973 | messageType := '17'O, |
| 974 | cause := ?, |
| 975 | cellIdentifier := ?, |
Philipp Maier | 8d33a13 | 2018-11-12 11:58:55 +0100 | [diff] [blame] | 976 | chosenChannel := *, |
| 977 | chosenEncryptionAlgorithm := *, |
| 978 | speechVersion := *, |
| 979 | lSAIdentifier := *, |
| 980 | talkerPriority := *, |
| 981 | codecList := *, |
| 982 | speechCodec := *, |
| 983 | lCLS_BSS_Status := * |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 984 | } |
| 985 | } |
| 986 | } |
| 987 | } |
| 988 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 989 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 990 | elementIdentifier := '08'O, |
| 991 | lengthIndicator := 0, /* overwritten */ |
| 992 | typeOfIdentity := '001'B, /* IMSI */ |
| 993 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 994 | digits := imsi_digits |
| 995 | } |
| 996 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 997 | template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { |
| 998 | elementIdentifier := '08'O, |
| 999 | lengthIndicator := ?, /* overwritten */ |
| 1000 | typeOfIdentity := '001'B, /* IMSI */ |
| 1001 | oddEvenIndicator := ?, |
| 1002 | digits := imsi_digits |
| 1003 | } |
| 1004 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1005 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 1006 | cIl_noCell := ''O |
| 1007 | } |
| 1008 | |
| 1009 | private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Harald Welte | 24135bd | 2018-03-17 19:27:53 +0100 | [diff] [blame] | 1010 | if (lengthof(mnc) == 2) { |
| 1011 | 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] | 1012 | } else { |
| 1013 | return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); |
| 1014 | } |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1015 | } |
| 1016 | |
| 1017 | template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { |
| 1018 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1019 | lac := int2oct(lac, 2), |
| 1020 | ci := int2oct(ci, 2) |
| 1021 | } |
| 1022 | |
| 1023 | template BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := { |
| 1024 | lac := int2oct(lac, 2), |
| 1025 | ci := int2oct(ci, 2) |
| 1026 | } |
| 1027 | |
| 1028 | template BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := { |
| 1029 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1030 | lac := int2oct(lac, 2) |
| 1031 | } |
| 1032 | |
| 1033 | template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
| 1034 | template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 1035 | |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1036 | template BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC |
| 1037 | ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { |
| 1038 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1039 | lac := int2oct(lac, 2), |
| 1040 | rncId := int2oct(rnc_id, 2) |
| 1041 | } |
| 1042 | |
| 1043 | template BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := { |
| 1044 | lac := int2oct(lac, 2), |
| 1045 | rncId := int2oct(rnc_id, 2) |
| 1046 | } |
| 1047 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1048 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 1049 | elementIdentifier := '24'O, |
| 1050 | channel := chneed, |
| 1051 | spare := '000000'B |
| 1052 | } |
| 1053 | |
| 1054 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 1055 | elementIdentifier := '09'O, |
| 1056 | lengthIndicator := 4, |
| 1057 | tmsiOctets := tmsi |
| 1058 | }; |
| 1059 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1060 | template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { |
| 1061 | elementIdentifier := '09'O, |
| 1062 | lengthIndicator := 4, |
| 1063 | tmsiOctets := tmsi |
| 1064 | }; |
| 1065 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1066 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 1067 | var template BSSMAP_IE_TMSI ret; |
| 1068 | if (ispresent(tmsi)) { |
| 1069 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 1070 | } else { |
| 1071 | ret := omit; |
| 1072 | } |
| 1073 | return ret; |
| 1074 | } |
| 1075 | |
| 1076 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 1077 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 1078 | template OCT4 tmsi := omit, |
| 1079 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1080 | modifies ts_BSSAP_BSSMAP := { |
| 1081 | pdu := { |
| 1082 | bssmap := { |
| 1083 | paging := { |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1084 | messageType := '52'O, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1085 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1086 | tMSI := f_tmsi_or_omit(tmsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1087 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1088 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1089 | eMLPP_Priority := omit, |
| 1090 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1091 | } |
| 1092 | } |
| 1093 | } |
| 1094 | } |
| 1095 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1096 | template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, |
| 1097 | template OCT4 tmsi := *, |
| 1098 | template BSSMAP_IE_ChannelNeeded chneed := *) |
| 1099 | modifies tr_BSSAP_BSSMAP := { |
| 1100 | pdu := { |
| 1101 | bssmap := { |
| 1102 | paging := { |
| 1103 | messageType := '52'O, |
| 1104 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
| 1105 | tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, |
| 1106 | cellIdentifierList := ?, |
| 1107 | channelNeeded := chneed, |
| 1108 | eMLPP_Priority := omit, |
| 1109 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | } |
| 1114 | |
| 1115 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1116 | template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) |
| 1117 | modifies ts_BSSAP_BSSMAP := { |
| 1118 | pdu := { |
| 1119 | bssmap := { |
| 1120 | cipherModeCommand := { |
| 1121 | messageType := '53'O, |
| 1122 | layer3HeaderInfo := omit, |
| 1123 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1124 | cipherResponseMode := omit, |
| 1125 | kC128 := omit |
| 1126 | } |
| 1127 | } |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128) |
| 1132 | modifies ts_BSSAP_BSSMAP := { |
| 1133 | pdu := { |
| 1134 | bssmap := { |
| 1135 | cipherModeCommand := { |
| 1136 | messageType := '53'O, |
| 1137 | layer3HeaderInfo := omit, |
| 1138 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1139 | cipherResponseMode := omit, |
| 1140 | kC128 := { '83'O, kc128 } |
| 1141 | } |
| 1142 | } |
| 1143 | } |
| 1144 | } |
| 1145 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1146 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key) |
| 1147 | modifies tr_BSSAP_BSSMAP := { |
| 1148 | pdu := { |
| 1149 | bssmap := { |
| 1150 | cipherModeCommand := { |
| 1151 | messageType := '53'O, |
| 1152 | layer3HeaderInfo := *, |
| 1153 | encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg), |
| 1154 | cipherResponseMode := *, |
| 1155 | kC128 := * |
| 1156 | } |
| 1157 | } |
| 1158 | } |
| 1159 | } |
| 1160 | |
| 1161 | template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) |
| 1162 | modifies ts_BSSAP_BSSMAP := { |
| 1163 | pdu := { |
| 1164 | bssmap := { |
| 1165 | cipherModeComplete := { |
| 1166 | messageType := '55'O, |
| 1167 | layer3MessageContents := omit, |
| 1168 | chosenEncryptionAlgorithm := { |
| 1169 | elementIdentifier := '2C'O, |
| 1170 | algorithmIdentifier := alg |
| 1171 | } |
| 1172 | } |
| 1173 | } |
| 1174 | } |
| 1175 | } |
| 1176 | |
Stefan Sperling | a2d59c6 | 2018-12-18 16:32:44 +0100 | [diff] [blame^] | 1177 | template PDU_BSSAP ts_BSSMAP_CipherModeComplAlg(template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := ?) |
| 1178 | modifies ts_BSSAP_BSSMAP := { |
| 1179 | pdu := { |
| 1180 | bssmap := { |
| 1181 | cipherModeComplete := { |
| 1182 | messageType := '55'O, |
| 1183 | layer3MessageContents := omit, |
| 1184 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm |
| 1185 | } |
| 1186 | } |
| 1187 | } |
| 1188 | } |
| 1189 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1190 | template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { |
| 1191 | pdu := { |
| 1192 | bssmap := { |
| 1193 | cipherModeComplete := { |
| 1194 | messageType := '55'O, |
| 1195 | layer3MessageContents := *, |
| 1196 | chosenEncryptionAlgorithm := { |
| 1197 | elementIdentifier := '2C'O, |
| 1198 | algorithmIdentifier := alg |
| 1199 | } |
| 1200 | } |
| 1201 | } |
| 1202 | } |
| 1203 | } |
| 1204 | |
| 1205 | template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := { |
| 1206 | pdu := { |
| 1207 | bssmap := { |
| 1208 | cipherModeReject := { |
| 1209 | messageType := '59'O, |
| 1210 | cause := ? |
| 1211 | } |
| 1212 | } |
| 1213 | } |
| 1214 | } |
| 1215 | |
Daniel Willmann | 52918e5 | 2018-09-20 14:39:09 +0200 | [diff] [blame] | 1216 | template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := { |
| 1217 | pdu := { |
| 1218 | bssmap := { |
| 1219 | classmarkRequest := { |
| 1220 | messageType := '58'O, |
| 1221 | talkerPriority := * |
| 1222 | } |
| 1223 | } |
| 1224 | } |
| 1225 | } |
| 1226 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1227 | template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { |
| 1228 | elementIdentifier := '12'O, |
| 1229 | lengthIndicator := 0, /* overwritten */ |
| 1230 | /* CM1 */ |
| 1231 | rf_PowerCapability := '010'B, /* class3 */ |
| 1232 | a5_1 := '0'B, /* supported */ |
| 1233 | esind := '1'B, /* early classmark supported */ |
| 1234 | revisionLevel := '10'B, /* R99 */ |
| 1235 | spare1_1 := '0'B, |
| 1236 | /* CM2 */ |
| 1237 | fc := '1'B, /* E-GSM support */ |
| 1238 | vgcs := '0'B, |
| 1239 | vbs := '0'B, |
| 1240 | sm_Capability := '1'B, |
| 1241 | ss_ScreenIndicator := '00'B, |
| 1242 | ps_Capability := '1'B, |
| 1243 | spare2_1 := '0'B, |
| 1244 | classmarkInformationType2_oct5 := { |
| 1245 | a5_2 := '0'B, /* not available */ |
| 1246 | a5_3 := '1'B, /* available */ |
| 1247 | cmsp := '0'B, /* not supported */ |
| 1248 | solsa := '0'B, /* not suported */ |
| 1249 | ucs2 := '0'B, /* GSM alphabet preferred */ |
| 1250 | lcsvacap := '0'B, /* not supported */ |
| 1251 | spare := '0'B, |
| 1252 | cm3 := '0'B /* no CM3 */ |
| 1253 | } |
| 1254 | } |
| 1255 | |
| 1256 | template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, |
| 1257 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) |
| 1258 | modifies ts_BSSAP_BSSMAP := { |
| 1259 | pdu := { |
| 1260 | bssmap := { |
| 1261 | classmarkUpdate := { |
| 1262 | messageType := '54'O, |
| 1263 | classmarkInformationType2 := cm2, |
| 1264 | classmarkInformationType3 := cm3, |
| 1265 | talkerPriority := omit |
| 1266 | } |
| 1267 | } |
| 1268 | } |
| 1269 | } |
| 1270 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1271 | template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, |
| 1272 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) |
| 1273 | modifies tr_BSSAP_BSSMAP := { |
| 1274 | pdu := { |
| 1275 | bssmap := { |
| 1276 | classmarkUpdate := { |
| 1277 | messageType := '54'O, |
| 1278 | classmarkInformationType2 := cm2, |
| 1279 | classmarkInformationType3 := cm3, |
| 1280 | talkerPriority := * |
| 1281 | } |
| 1282 | } |
| 1283 | } |
| 1284 | } |
| 1285 | |
Neels Hofmeyr | 92b12b7 | 2018-09-18 14:30:23 +0200 | [diff] [blame] | 1286 | template PDU_BSSAP ts_BSSMAP_ClassmarkRequest |
| 1287 | modifies ts_BSSAP_BSSMAP := { |
| 1288 | pdu := { |
| 1289 | bssmap := { |
| 1290 | classmarkRequest := { |
| 1291 | messageType := '58'O, |
| 1292 | talkerPriority := omit |
| 1293 | } |
| 1294 | } |
| 1295 | } |
| 1296 | } |
| 1297 | |
Harald Welte | 49518bf | 2018-02-10 11:39:19 +0100 | [diff] [blame] | 1298 | /* return Layer3 octetstring inside BSSAP PDU */ |
| 1299 | function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring { |
| 1300 | if (ischosen(bssap.pdu.bssmap)) { |
| 1301 | var PDU_BSSMAP bssmap := bssap.pdu.bssmap; |
| 1302 | if (ischosen(bssmap.completeLayer3Information)) { |
| 1303 | return bssmap.completeLayer3Information.layer3Information.layer3info; |
| 1304 | } else if (ischosen(bssmap.handoverRequestAck)) { |
| 1305 | return bssmap.handoverRequestAck.layer3Information.layer3info; |
| 1306 | } else if (ischosen(bssmap.handoverCommand)) { |
| 1307 | return bssmap.handoverCommand.layer3Information.layer3info; |
| 1308 | } else if (ischosen(bssmap.uplinkRequest)) { |
| 1309 | return bssmap.uplinkRequest.layer3Information.layer3info; |
| 1310 | } else if (ischosen(bssmap.uplinkRequestConfirmation)) { |
| 1311 | return bssmap.uplinkRequestConfirmation.layer3Information.layer3info; |
| 1312 | } else if (ischosen(bssmap.uplinkApplicationData)) { |
| 1313 | return bssmap.uplinkApplicationData.layer3Information.layer3info; |
| 1314 | } else if (ischosen(bssmap.rerouteCommand)) { |
| 1315 | return bssmap.rerouteCommand.initialLayer3Information.layer3info; |
| 1316 | } else { |
| 1317 | return omit; |
| 1318 | } |
| 1319 | } else { |
| 1320 | return bssap.pdu.dtap; |
| 1321 | } |
| 1322 | } |
| 1323 | |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1324 | /* TS 29.205 B.2.1.9 */ |
| 1325 | template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := { |
| 1326 | networkIDLengthIndicator := 0, /* overwritten */ |
| 1327 | networkID := net_id, |
| 1328 | nodeIDLengthIndicator := 0, /* overwritten */ |
| 1329 | nodeID := node_id, |
| 1330 | callReferenceIDLengthIndicator := 0, /* overwritten */ |
| 1331 | callReferenceID := cref_id |
| 1332 | } |
| 1333 | template GlobalCallReferenceValue tr_GCR(template octetstring net_id, |
| 1334 | template OCT2 node_id, |
| 1335 | template OCT5 cref_id) := { |
| 1336 | networkIDLengthIndicator := ?, |
| 1337 | networkID := net_id, |
| 1338 | nodeIDLengthIndicator := ?, |
| 1339 | nodeID := node_id, |
| 1340 | callReferenceIDLengthIndicator := ?, |
| 1341 | callReferenceID := cref_id |
| 1342 | } |
| 1343 | |
| 1344 | /* TS 47.008 3.2.2.115 */ |
| 1345 | template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := { |
| 1346 | elementIdentifier := '89'O, |
| 1347 | lengthIndicator := 0, /* overwritten */ |
| 1348 | globalCallReferenceValue := gcr |
| 1349 | } |
| 1350 | template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := { |
| 1351 | elementIdentifier := '89'O, |
| 1352 | lengthIndicator := ?, |
| 1353 | globalCallReferenceValue := gcr |
| 1354 | } |
| 1355 | |
| 1356 | /* TS 48.008 3.2.2.116 */ |
| 1357 | const BIT4 LCLS_CFG_both_way := '0000'B; |
| 1358 | const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B; |
| 1359 | const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B; |
| 1360 | const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B; |
| 1361 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B; |
| 1362 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B; |
| 1363 | |
| 1364 | template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := { |
| 1365 | elementIdentifier := '8A'O, |
| 1366 | lCLS_ConfigurationValue := cfg_val, |
| 1367 | spare := '0000'B |
| 1368 | } |
| 1369 | template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := { |
| 1370 | elementIdentifier := '8A'O, |
| 1371 | lCLS_ConfigurationValue := cfg_val, |
| 1372 | spare := '0000'B |
| 1373 | } |
| 1374 | |
| 1375 | /* TS 48.008 3.2.2.117 */ |
| 1376 | const BIT4 LCLS_CSC_connect := '0000'B; |
| 1377 | const BIT4 LCLS_CSC_do_not_connect := '0001'B; |
| 1378 | const BIT4 LCLS_CSC_release_lcls := '0010'B; |
| 1379 | const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B; |
| 1380 | const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B; |
| 1381 | |
| 1382 | template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := { |
| 1383 | elementIdentifier := '8B'O, |
| 1384 | lCLS_ConnectionStatusControlValue := csc, |
| 1385 | spare := '0000'B |
| 1386 | } |
| 1387 | template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := { |
| 1388 | elementIdentifier := '8B'O, |
| 1389 | lCLS_ConnectionStatusControlValue := csc, |
| 1390 | spare := '0000'B |
| 1391 | } |
| 1392 | |
| 1393 | /* TS 48.008 3.2.2.119 */ |
| 1394 | const BIT4 LCLS_STS_not_yet_ls := '0000'B; |
| 1395 | const BIT4 LCLS_STS_not_possible_ls := '0001'B; |
| 1396 | const BIT4 LCLS_STS_no_longer_ls := '0010'B; |
| 1397 | const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B; |
| 1398 | const BIT4 LCLS_STS_locally_switched := '0100'B; |
| 1399 | |
| 1400 | template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := { |
| 1401 | elementIdentifier := '8D'O, |
| 1402 | lCLS_BSS_StatusValue := sts, |
| 1403 | spare := '0000'B |
| 1404 | } |
| 1405 | template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := { |
| 1406 | elementIdentifier := '8D'O, |
| 1407 | lCLS_BSS_StatusValue := sts, |
| 1408 | spare := '0000'B |
| 1409 | } |
| 1410 | |
| 1411 | /* TS 48.008 3.2.1.91 */ |
| 1412 | 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] | 1413 | template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1414 | pdu := { |
| 1415 | bssmap := { |
| 1416 | lCLS_ConnectControl := { |
| 1417 | messageType := '74'O, |
| 1418 | lCLS_Configuration := cfg, |
| 1419 | lCLS_ConnectionStatusControl := csc |
| 1420 | } |
| 1421 | } |
| 1422 | } |
| 1423 | } |
| 1424 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1425 | template BSSMAP_IE_LCLS_ConnectionStatusControl csc) |
| 1426 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1427 | pdu := { |
| 1428 | bssmap := { |
| 1429 | lCLS_ConnectControl := { |
| 1430 | messageType := '74'O, |
| 1431 | lCLS_Configuration := cfg, |
| 1432 | lCLS_ConnectionStatusControl := csc |
| 1433 | } |
| 1434 | } |
| 1435 | } |
| 1436 | } |
| 1437 | |
| 1438 | /* TS 48.008 3.2.1.92 */ |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1439 | template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts) |
| 1440 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1441 | pdu := { |
| 1442 | bssmap := { |
| 1443 | lCLS_connectControlAck := { |
| 1444 | messageType := '75'O, |
| 1445 | lCLS_BSS_Status := sts |
| 1446 | } |
| 1447 | } |
| 1448 | } |
| 1449 | } |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1450 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts) |
| 1451 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1452 | pdu := { |
| 1453 | bssmap := { |
| 1454 | lCLS_connectControlAck := { |
| 1455 | messageType := '75'O, |
| 1456 | lCLS_BSS_Status := sts |
| 1457 | } |
| 1458 | } |
| 1459 | } |
| 1460 | } |
| 1461 | |
| 1462 | /* TS 48.008 3.2.1.93 */ |
| 1463 | 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] | 1464 | template (omit) BSSMAP_IE_LCLS_BreakRequest brq) |
| 1465 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1466 | pdu := { |
| 1467 | bssmap := { |
| 1468 | lCLS_Notification := { |
| 1469 | messageType := '76'O, |
| 1470 | lCLS_BSS_Status := sts, |
| 1471 | lCLS_BreakRequest := brq |
| 1472 | } |
| 1473 | } |
| 1474 | } |
| 1475 | } |
| 1476 | 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] | 1477 | template BSSMAP_IE_LCLS_BreakRequest brq) |
| 1478 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1479 | pdu := { |
| 1480 | bssmap := { |
| 1481 | lCLS_Notification := { |
| 1482 | messageType := '76'O, |
| 1483 | lCLS_BSS_Status := sts, |
| 1484 | lCLS_BreakRequest := brq |
| 1485 | } |
| 1486 | } |
| 1487 | } |
| 1488 | } |
| 1489 | |
Harald Welte | cc0b014 | 2018-05-29 15:19:33 +0200 | [diff] [blame] | 1490 | template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts) |
| 1491 | modifies tr_BSSAP_BSSMAP := { |
| 1492 | pdu := { |
| 1493 | bssmap := { |
| 1494 | lCLS_Notification := { |
| 1495 | messageType := '76'O, |
| 1496 | lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts), |
| 1497 | lCLS_BreakRequest := omit |
| 1498 | } |
| 1499 | } |
| 1500 | } |
| 1501 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1502 | |
| 1503 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1504 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 1505 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 1506 | } with { encode "RAW" }; |