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