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