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; |
Pau Espin Pedrol | 6a846bc | 2020-09-04 13:01:22 +0200 | [diff] [blame] | 17 | import from Native_Functions all; |
| 18 | import from Misc_Helpers all; |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 19 | import from GSM_Types all; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 20 | import from BSSAP_Types all; |
| 21 | |
| 22 | type integer BssmapCause; |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 23 | type integer SpeechVersion; |
| 24 | type integer Channel; |
| 25 | type integer ChannelMode; |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 26 | //type octetstring BSSMAP_oldToNewBSSIEs; |
| 27 | |
| 28 | // Old BSS to New BSS Information - 48.008 subclause 3.2.2.58 |
| 29 | type record BSSMAP_oldToNewBSSIEs |
| 30 | { |
| 31 | BSSAMAP_IE_LastUsedEUTRANPLMNId LastUsedEUTRANPLMNId optional |
| 32 | /* TODO: add other FIELDS here from specs */ |
| 33 | } |
| 34 | external function enc_BSSMAP_oldToNewBSSIEs(in BSSMAP_oldToNewBSSIEs val) return octetstring |
| 35 | with { extension "prototype(convert) encode(RAW)" }; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 36 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 37 | /* 48.008 3.2.2.5 - this actually belongs to BSSAP_Types.ttcn */ |
| 38 | type enumerated myBSSMAP_Cause { |
| 39 | /* 000 / 001: Normal event */ |
| 40 | GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE ('0000000'B), |
| 41 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE ('0000001'B), |
| 42 | GSM0808_CAUSE_UPLINK_QUALITY ('0000010'B), |
| 43 | GSM0808_CAUSE_UPLINK_STRENGTH ('0000011'B), |
| 44 | GSM0808_CAUSE_DOWNLINK_QUALITY ('0000100'B), |
| 45 | GSM0808_CAUSE_DOWNLINK_STRENGTH ('0000101'B), |
| 46 | GSM0808_CAUSE_DISTANCE ('0000110'B), |
| 47 | GSM0808_CAUSE_O_AND_M_INTERVENTION ('0000111'B), |
| 48 | GSM0808_CAUSE_RESPONSE_TO_MSC_INVOCATION ('0001000'B), |
| 49 | GSM0808_CAUSE_CALL_CONTROL ('0001001'B), |
| 50 | GSM0808_CAUSE_RADIO_INTERFACE_FAILURE_REVERSION ('0001010'B), |
| 51 | GSM0808_CAUSE_HANDOVER_SUCCESSFUL ('0001011'B), |
| 52 | GSM0808_CAUSE_BETTER_CELL ('0001100'B), |
| 53 | GSM0808_CAUSE_DIRECTED_RETRY ('0001101'B), |
| 54 | GSM0808_CAUSE_JOINED_GROUP_CALL_CHANNEL ('0001110'B), |
| 55 | GSM0808_CAUSE_TRAFFIC ('0001111'B), |
| 56 | GSM0808_CAUSE_REDUCE_LOAD_IN_SERVING_CELL ('0010000'B), |
| 57 | GSM0808_CAUSE_TRAFFIC_LOAD_IN_TGT_HIGHER_THAN_IN_SRC_CELL ('0010001'B), |
| 58 | GSM0808_CAUSE_RELOCATION_TRIGGERED ('0010010'B), |
| 59 | GSM0808_CAUSE_REQUSTED_OPT_NOT_AUTHORISED ('0010100'B), |
| 60 | GSM0808_CAUSE_ALT_CHAN_CONFIG_REQUESTED ('0010101'B), |
| 61 | GSM0808_CAUSE_RESP_TO_INT_HO_ENQ_MSG ('0010110'B), |
| 62 | GSM0808_CAUSE_INT_HO_ENQUIRY_REJECT ('0010111'B), |
| 63 | GSM0808_CAUSE_REDUNDANCY_LEVEL_NOT_ADEQUATE ('0011000'B), |
| 64 | /* reserved */ |
| 65 | /* 010: Resource unavailable */ |
| 66 | GSM0808_CAUSE_EQUIPMENT_FAILURE ('0100000'B), |
| 67 | GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE ('0100001'B), |
| 68 | GSM0808_CAUSE_RQSTED_TERRESTRIAL_RESOURCE_UNAVAILABLE ('0100010'B), |
| 69 | GSM0808_CAUSE_CCCH_OVERLOAD ('0100011'B), |
| 70 | GSM0808_CAUSE_PROCESSOR_OVERLOAD ('0100100'B), |
| 71 | GSM0808_CAUSE_BSS_NOT_EQUIPPED ('0100101'B), |
| 72 | GSM0808_CAUSE_MS_NOT_EQUIPPED ('0100110'B), |
| 73 | GSM0808_CAUSE_INVALID_CELL ('0100111'B), |
| 74 | GSM0808_CAUSE_TRAFFIC_LOAD ('0101000'B), |
| 75 | GSM0808_CAUSE_PREEMPTION ('0101001'B), |
| 76 | GSM0808_CAUSE_DTM_HO_SGSN_FAILURE ('0101010'B), |
| 77 | GSM0808_CAUSE_DTM_HO_PS_ALLOC_FAILURE ('0101011'B), |
| 78 | /* reserved */ |
| 79 | /* 011: Service or option not available, but implemented */ |
| 80 | GSM0808_CAUSE_RQSTED_TRANSCODING_RATE_ADAPTION_UNAVAILABLE ('0110000'B), |
| 81 | GSM0808_CAUSE_CIRCUIT_POOL_MISMATCH ('0110001'B), |
| 82 | GSM0808_CAUSE_SWITCH_CIRCUIT_POOL ('0110010'B), |
| 83 | GSM0808_CAUSE_RQSTED_SPEECH_VERSION_UNAVAILABLE ('0110011'B), |
| 84 | GSM0808_CAUSE_LSA_NOT_ALLOWED ('0110100'B), |
| 85 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL ('0110101'B), |
| 86 | GSM0808_CAUSE_REQ_A_IF_TYPE_UNAVAIL ('0110110'B), |
| 87 | GSM0808_CAUSE_INVALID_CSG_CELL ('0110111'B), |
| 88 | /* reserved */ |
| 89 | /* 100: Service or option not implemented or currently disabled */ |
| 90 | GSM0808_CAUSE_REQ_REDUND_LEVEL_NOT_AVAIL ('0111111'B), |
| 91 | GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED ('1000000'B), |
| 92 | GSM0808_CAUSE_GERAN_IU_MODE_FAILURE ('1000001'B), |
| 93 | GSM0808_CAUSE_INC_RELOC_NOT_SUPP_DT_PUESBINE_FEATURE ('1000010'B), |
| 94 | GSM0808_CAUSE_ACCESS_RESTRICTED_DUE_TO_SHARED_NETWORKS ('1000011'B), |
| 95 | GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP ('1000100'B), |
| 96 | GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP ('1000101'B), |
| 97 | GSM0808_CAUSE_REQ_REDUND_LVL_NOT_SUPP ('1000110'B), |
| 98 | /* reserved */ |
| 99 | /* 101: Invalid message */ |
| 100 | GSM0808_CAUSE_TERRESTRIAL_CIRCUIT_ALREADY_ALLOCATED ('1010000'B), |
| 101 | GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS ('1010001'B), |
| 102 | GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING ('1010010'B), |
| 103 | GSM0808_CAUSE_INCORRECT_VALUE ('1010011'B), |
| 104 | GSM0808_CAUSE_UNKNOWN_MESSAGE_TYPE ('1010100'B), |
| 105 | GSM0808_CAUSE_UNKNOWN_INFORMATION_ELEMENT ('1010101'B), |
| 106 | GSM0808_CAUSE_DTM_HO_INVALID_PS_IND ('1010110'B), |
| 107 | GSM0808_CAUSE_CALL_ID_ALREADY_ALLOC ('1010111'B), |
| 108 | /* reserved */ |
| 109 | /* 110: protocol error */ |
| 110 | GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC ('1100000'B), |
| 111 | GSM0808_CAUSE_VGCS_VBS_CALL_NON_EXISTANT ('1100001'B), |
| 112 | GSM0808_CAUSE_DTM_HO_TIMER_EXPIRY ('1100010'B) |
| 113 | } with { variant "FIELDLENGTH(7)" }; |
| 114 | |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 115 | type enumerated BSSMAP_LcsCause { |
| 116 | BSSMAP_LCS_CAUSE_UNSPECIFIED ('00000000'B), |
| 117 | BSSMAP_LCS_CAUSE_SYSTEM_FAILURE ('00000001'B), |
| 118 | BSSMAP_LCS_CAUSE_PROTOCOL_ERROR ('00000010'B), |
| 119 | BSSMAP_LCS_CAUSE_DATA_MISSING_IN_REQ ('00000011'B), |
| 120 | BSSMAP_LCS_CAUSE_UNEXP_DATA_IN_REQ ('00000100'B), |
| 121 | BSSMAP_LCS_CAUSE_POS_METH_FAILURE ('00000101'B), |
| 122 | BSSMAP_LCS_CAUSE_TGT_MS_UNREACHABLE ('00000110'B), |
| 123 | BSSMAP_LCS_CAUSE_REQUEST_ABORTED ('00000111'B), |
| 124 | BSSMAP_LCS_CAUSE_FACILITY_NOTSUPP ('00001000'B), |
| 125 | BSSMAP_LCS_CAUSE_INTER_BSC_HO ('00001001'B), |
| 126 | BSSMAP_LCS_CAUSE_INTRA_BSC_HO ('00001010'B), |
| 127 | BSSMAP_LCS_CAUSE_CONGESTION ('00001011'B), |
| 128 | BSSMAP_LCS_CAUSE_INTER_NSE_CHG ('00001100'B), |
| 129 | BSSMAP_LCS_CAUSE_RA_UPDAT ('00001101'B), |
| 130 | BSSMAP_LCS_CAUSE_PTMSI_REALLOC ('00001110'B), |
| 131 | BSSMAP_LCS_CAUSE_GPRS_SUSPENSION ('00001111'B) |
| 132 | } with { variant "FIELDLENGTH(8)" }; |
| 133 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 134 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 135 | discriminator := '0'B, |
| 136 | spare := '0000000'B, |
| 137 | dlci := omit, |
| 138 | lengthIndicator := 0, /* overwritten by codec */ |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 139 | pdu := { |
| 140 | bssmap := ? |
| 141 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 145 | discriminator := '0'B, |
| 146 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 147 | dlci := *, |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 148 | lengthIndicator := ?, |
| 149 | pdu := { |
| 150 | bssmap := ? |
| 151 | } |
| 152 | } |
| 153 | |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 154 | template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 155 | discriminator := '1'B, |
| 156 | spare := '0000000'B, |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 157 | dlci := dlci, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 158 | lengthIndicator := 0, /* overwritten by codec */ |
| 159 | pdu := { |
Harald Welte | 0a6835c | 2018-01-21 13:56:01 +0100 | [diff] [blame] | 160 | dtap := dtap |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 161 | } |
| 162 | } |
| 163 | |
| 164 | template PDU_BSSAP tr_BSSAP_DTAP := { |
| 165 | discriminator := '1'B, |
| 166 | spare := '0000000'B, |
Harald Welte | 049ca64 | 2018-01-21 13:54:34 +0100 | [diff] [blame] | 167 | dlci := *, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 168 | lengthIndicator := ?, |
| 169 | pdu := { |
| 170 | dtap := ? |
| 171 | } |
| 172 | } |
| 173 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 174 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 175 | elementIdentifier := '04'O, |
| 176 | lengthIndicator := 0, |
| 177 | causeValue := int2bit(val, 7), |
| 178 | extensionCauseValue := '0'B, |
| 179 | spare1 := omit |
| 180 | } |
Vadim Yanitskiy | 4806396 | 2020-08-28 07:49:44 +0700 | [diff] [blame] | 181 | template BSSMAP_IE_Cause tr_BSSMAP_IE_Cause(template (present) myBSSMAP_Cause val) := { |
| 182 | elementIdentifier := '04'O, |
| 183 | lengthIndicator := ?, |
| 184 | causeValue := f_tr_causeValue(val), |
| 185 | extensionCauseValue := ?, |
| 186 | spare1 := * |
| 187 | } |
| 188 | private function f_tr_causeValue(template (present) myBSSMAP_Cause val) |
| 189 | return template (present) BIT7 { |
| 190 | if (istemplatekind(val, "?")) { |
| 191 | return ?; |
| 192 | } else { |
| 193 | var integer int_val := enum2int(valueof(val)); |
| 194 | return int2bit(valueof(int_val), 7); |
| 195 | } |
| 196 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 197 | |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 198 | template (value) BSSMAP_IE_SpeechVersion ts_BSSMAP_IE_SpeechVersion(SpeechVersion val) := { |
| 199 | elementIdentifier := '40'O, |
| 200 | speechVersionIdentifier := int2bit(val, 7), |
| 201 | spare1_1 := '0'B |
| 202 | } |
| 203 | |
| 204 | template (value) BSSMAP_IE_CurrentChannelType1 ts_BSSMAP_IE_CurrentChannelType1(Channel c, ChannelMode cm) := { |
| 205 | elementIdentifier := '31'O, |
| 206 | channel := int2bit(c, 4), |
| 207 | channelMode := int2bit(cm, 4) |
| 208 | } |
| 209 | |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 210 | template (value) BSSMAP_oldToNewBSSIEs ts_BSSMAP_oldToNewBSSIEs(template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId last_used_eutran_plmn) := { |
| 211 | LastUsedEUTRANPLMNId := last_used_eutran_plmn |
| 212 | } |
| 213 | function f_ts_BSSMAP_oldToNewBSSIEs(template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId last_used_eutran_plmn) |
| 214 | return template (omit) BSSMAP_oldToNewBSSIEs { |
| 215 | if (istemplatekind(last_used_eutran_plmn, "omit")) { |
| 216 | return omit; |
| 217 | } else { |
| 218 | return ts_BSSMAP_oldToNewBSSIEs(last_used_eutran_plmn); |
| 219 | } |
| 220 | } |
| 221 | template (value) BSSMAP_IE_OldToNewBSSInfo ts_BSSMAP_IE_OldToNewBSSInfo(template (value) BSSMAP_oldToNewBSSIEs val) := { |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 222 | elementIdentifier := '3A'O, |
| 223 | lengthIndicator := 0, /* overwritten by codec */ |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 224 | oldToNewBSSIEs := enc_BSSMAP_oldToNewBSSIEs(valueof(val)) |
| 225 | } |
| 226 | function f_ts_BSSMAP_IE_OldToNewBSSInfo(template (omit) BSSMAP_oldToNewBSSIEs val) |
| 227 | return template (omit) BSSMAP_IE_OldToNewBSSInfo { |
| 228 | if (istemplatekind(val, "omit")) { |
| 229 | return omit; |
| 230 | } else { |
| 231 | return ts_BSSMAP_IE_OldToNewBSSInfo(val); |
| 232 | } |
Philipp Maier | 34bd80e | 2018-03-27 14:28:52 +0200 | [diff] [blame] | 233 | } |
| 234 | |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 235 | template BSSMAP_IE_OldToNewBSSInfo tr_BSSMAP_IE_OldToNewBSSInfo(template (value) BSSMAP_oldToNewBSSIEs val) := { |
| 236 | elementIdentifier := '3A'O, |
| 237 | lengthIndicator := ?, /* overwritten by codec */ |
| 238 | oldToNewBSSIEs := enc_BSSMAP_oldToNewBSSIEs(valueof(val)) |
| 239 | } |
| 240 | function f_tr_BSSMAP_IE_OldToNewBSSInfo(template BSSMAP_oldToNewBSSIEs val := *) |
| 241 | return template BSSMAP_IE_OldToNewBSSInfo { |
| 242 | if (istemplatekind(val, "*")) { |
| 243 | return *; |
| 244 | } else if (istemplatekind(val, "?")) { |
| 245 | return ?; |
| 246 | } else if (istemplatekind(val, "omit")) { |
| 247 | return omit; |
| 248 | } else { |
| 249 | return tr_BSSMAP_IE_OldToNewBSSInfo(val); |
| 250 | } |
| 251 | } |
| 252 | |
Harald Welte | 420c6b0 | 2020-08-21 11:54:30 +0200 | [diff] [blame] | 253 | template (value) BSSMAP_IE_Osmo_OsmuxSupport tr_BSSMAP_IE_Osmo_OsmuxSupport := { |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 254 | elementIdentifier := 'F0'O |
| 255 | } |
| 256 | |
Harald Welte | 420c6b0 | 2020-08-21 11:54:30 +0200 | [diff] [blame] | 257 | 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] | 258 | if (osmux_enabled) { |
| 259 | return tr_BSSMAP_IE_Osmo_OsmuxSupport; |
| 260 | } |
| 261 | return omit; |
| 262 | } |
| 263 | |
| 264 | 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] | 265 | pdu := { |
| 266 | bssmap := { |
| 267 | reset := { |
| 268 | messageType := '30'O, |
| 269 | cause := ts_BSSMAP_IE_Cause(cause), |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 270 | a_InterfaceSelectorForReset := omit, |
| 271 | osmuxSupport := f_enc_osmux_support(osmux_enabled) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 277 | 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] | 278 | pdu := { |
| 279 | bssmap := { |
| 280 | reset := { |
| 281 | messageType := '30'O, |
| 282 | cause := ?, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 283 | a_InterfaceSelectorForReset := *, |
| 284 | osmuxSupport := f_enc_osmux_support(osmux_enabled) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 290 | 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] | 291 | pdu := { |
| 292 | bssmap := { |
| 293 | resetAck := { |
| 294 | messageType := '31'O, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 295 | a_InterfaceSelectorForReset := omit, |
| 296 | osmuxSupport := f_enc_osmux_support(osmux_enabled) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 297 | } |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 302 | 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] | 303 | pdu := { |
| 304 | bssmap := { |
| 305 | resetAck := { |
| 306 | messageType := '31'O, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 307 | a_InterfaceSelectorForReset := *, |
| 308 | osmuxSupport := f_enc_osmux_support(osmux_enabled) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 309 | } |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 315 | elementIdentifier := '05'O, |
| 316 | lengthIndicator := 0, |
| 317 | cellIdentifierDiscriminator := '0000'B, |
| 318 | spare1_4 := '0000'B, |
| 319 | cellIdentification := ? |
| 320 | } |
| 321 | |
| 322 | type uint16_t BssmapLAC; |
| 323 | type uint16_t BssmapCI; |
Pau Espin Pedrol | a8ef3be | 2022-02-16 16:21:17 +0100 | [diff] [blame] | 324 | type uint16_t BssmapSAC; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 325 | |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 326 | 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] | 327 | modifies ts_BSSMAP_IE_CellID := { |
| 328 | cellIdentification := { |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 329 | cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 330 | } |
| 331 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 332 | |
Pau Espin Pedrol | a8ef3be | 2022-02-16 16:21:17 +0100 | [diff] [blame] | 333 | template (value) BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 334 | modifies ts_BSSMAP_IE_CellID := { |
| 335 | cellIdentification := { |
| 336 | cI_LAC_CI := { |
| 337 | lac := int2oct(lac, 2), |
| 338 | ci := int2oct(ci, 2) |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 344 | modifies ts_BSSMAP_IE_CellID := { |
| 345 | cellIdentification := { |
| 346 | cI_CI := int2oct(ci, 2) |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 351 | modifies ts_BSSMAP_IE_CellID := { |
| 352 | cellIdentification := { |
| 353 | cI_noCell := ''O |
| 354 | } |
| 355 | } |
| 356 | |
Pau Espin Pedrol | a8ef3be | 2022-02-16 16:21:17 +0100 | [diff] [blame] | 357 | template (value) BSSMAP_IE_CellIdentifier ts_CellID_SAI(OCT3 mcc_mnc, BssmapLAC lac, BssmapSAC sac) |
| 358 | modifies ts_BSSMAP_IE_CellID := { |
| 359 | cellIdentification := { |
| 360 | cI_SAI := { |
| 361 | mcc_mnc := mcc_mnc, |
| 362 | lac := int2oct(lac, 2), |
| 363 | sac := int2oct(sac, 2) |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 368 | |
| 369 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 370 | elementIdentifier := '17'O, |
| 371 | lengthIndicator := 0, |
| 372 | layer3info := l3info |
| 373 | } |
| 374 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 375 | template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring l3info) := { |
| 376 | elementIdentifier := '17'O, |
| 377 | lengthIndicator := ?, |
| 378 | layer3info := l3info |
| 379 | } |
| 380 | |
| 381 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 382 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 383 | modifies ts_BSSAP_BSSMAP := { |
| 384 | pdu := { |
| 385 | bssmap := { |
| 386 | completeLayer3Information := { |
| 387 | messageType := '57'O, |
| 388 | cellIdentifier := cell_id, |
| 389 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 390 | chosenChannel := omit, |
| 391 | lSAIdentifier := omit, |
| 392 | aPDU := omit, |
| 393 | codecList := omit, |
| 394 | redirectAttemptFlag := omit, |
| 395 | sendSequenceNumber := omit, |
| 396 | iMSI := omit |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 402 | template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?, |
Vadim Yanitskiy | a47cd4e | 2021-12-04 20:05:04 +0300 | [diff] [blame] | 403 | template BSSMAP_IE_CellIdentifier cell_id := ?, |
| 404 | template BSSMAP_IE_SpeechCodecList codec_list := *) |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 405 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 406 | pdu := { |
| 407 | bssmap := { |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 408 | completeLayer3Information := { |
| 409 | messageType := '57'O, |
| 410 | cellIdentifier := cell_id, |
| 411 | layer3Information := tr_BSSMAP_IE_L3Info(l3_info), |
| 412 | chosenChannel := *, |
| 413 | lSAIdentifier := *, |
| 414 | aPDU := *, |
Vadim Yanitskiy | a47cd4e | 2021-12-04 20:05:04 +0300 | [diff] [blame] | 415 | codecList := codec_list, |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 416 | redirectAttemptFlag := *, |
| 417 | sendSequenceNumber := *, |
| 418 | iMSI := * |
| 419 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 420 | } |
| 421 | } |
| 422 | } |
| 423 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 424 | 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] | 425 | elementIdentifier := '1A'O, |
| 426 | lengthIndicator := 0, /* overwritten */ |
| 427 | cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| 428 | spare1_4 := '0000'B, |
| 429 | cellIdentificationList := cid_list |
| 430 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 431 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 432 | const OCT1 ChRate_ANY := '00'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 433 | const OCT1 ChRate_TCHF := '08'O; |
| 434 | const OCT1 ChRate_TCHH := '09'O; |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 435 | const OCT1 ChRate_TCHForH_Fpref := '0A'O; |
| 436 | const OCT1 ChRate_TCHForH_Hpref := '0B'O; |
| 437 | const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O; |
| 438 | const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O; |
| 439 | const OCT1 ChRate_TCHForH := '0F'O; |
| 440 | const OCT1 ChRate_TCHForH_nochg := '1F'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 441 | |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 442 | const OCT1 Spdi_TCHF_FR := '01'O; |
| 443 | const OCT1 Spdi_TCHF_EFR := '11'O; |
| 444 | const OCT1 Spdi_TCHF_AMR := '21'O; |
| 445 | const OCT1 Spdi_TCHH_HR := '05'O; |
| 446 | const OCT1 Spdi_TCHH_AMR := '25'O; |
| 447 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 448 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 449 | elementIdentifier := '0B'O, /* overwritten */ |
| 450 | lengthIndicator := 0, /* overwritten */ |
| 451 | speechOrDataIndicator := '0001'B, /* speech */ |
| 452 | spare1_4 := '0000'B, |
| 453 | channelRateAndType := ChRate_TCHF, |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 454 | speechId_DataIndicator := Spdi_TCHF_FR |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 455 | } |
| 456 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 457 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := { |
| 458 | speechOrDataIndicator := '0100'B /* speech + CTM */ |
| 459 | } |
| 460 | |
| 461 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := { |
| 462 | elementIdentifier := '0B'O, /* overwritten */ |
| 463 | lengthIndicator := 0, /* overwritten */ |
| 464 | speechOrDataIndicator := '0010'B, /* data */ |
| 465 | spare1_4 := '0000'B, |
| 466 | channelRateAndType := ChRate_TCHF, |
| 467 | speechId_DataIndicator := '10'O /* 9600 bps / transparent */ |
| 468 | } |
| 469 | |
| 470 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := { |
| 471 | elementIdentifier := '0B'O, /* overwritten */ |
| 472 | lengthIndicator := 0, /* overwritten */ |
| 473 | speechOrDataIndicator := '0011'B, /* data */ |
| 474 | spare1_4 := '0000'B, |
| 475 | channelRateAndType := ChRate_ANY, |
| 476 | speechId_DataIndicator := '00'O /* spare */ |
| 477 | } |
| 478 | |
| 479 | template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := { |
| 480 | elementIdentifier := '0A'O, |
| 481 | lengthIndicator := 0, /* overwritten */ |
| 482 | permittedAlgorithms := algs, |
| 483 | key := kc |
| 484 | } |
| 485 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 486 | template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { |
| 487 | elementIdentifier := '0A'O, |
| 488 | lengthIndicator := ?, /* overwritten */ |
| 489 | permittedAlgorithms := algs, |
| 490 | key := kc |
| 491 | } |
| 492 | |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 493 | template BSSMAP_IE_ChosenEncryptionAlgorithm ts_BSSMAP_IE_ChosenEncryptionAlgorithm(OCT1 algorithmIdentifier) := { |
| 494 | elementIdentifier := '2C'O, |
| 495 | algorithmIdentifier := algorithmIdentifier |
| 496 | } |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 497 | |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 498 | template BSSMAP_IE_ChosenEncryptionAlgorithm tr_BSSMAP_IE_ChosenEncryptionAlgorithm(template OCT1 algorithmIdentifier := ?) := { |
| 499 | elementIdentifier := '2C'O, |
| 500 | algorithmIdentifier := algorithmIdentifier |
| 501 | } |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 502 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 503 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 504 | elementIdentifier := '01'O, /* overwritten */ |
| 505 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 506 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 507 | } |
| 508 | |
Pau Espin Pedrol | 43021cb | 2019-06-18 17:32:15 +0200 | [diff] [blame] | 509 | function f_bssmap_ie_cic_2_int(BSSMAP_IE_CircuitIdentityCode cic_ie) return integer { |
| 510 | var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); |
| 511 | return cic; |
| 512 | } |
| 513 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 514 | 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] | 515 | uint16_t udp_port, |
| 516 | integer len) := { |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 517 | elementIdentifier := '7C'O, |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 518 | lengthIndicator := len, /* overwritten */ |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 519 | ipAddress := addr, |
| 520 | uDPPortValue := udp_port |
| 521 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 522 | 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] | 523 | ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 524 | 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] | 525 | ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 526 | |
Pau Espin Pedrol | 6a846bc | 2020-09-04 13:01:22 +0200 | [diff] [blame] | 527 | function f_ts_BSSMAP_IE_AoIP_TLA(charstring addr, uint16_t udp_port) |
| 528 | return template (value) BSSMAP_IE_AoIP_TransportLayerAddress { |
| 529 | if (f_addr_is_ipv6(addr)) { |
| 530 | var OCT16 ip6 := f_inet6_addr(addr); |
| 531 | return ts_BSSMAP_IE_AoIP_TLA6(ip6, udp_port); |
| 532 | } else { |
| 533 | var OCT4 ip := f_inet_addr(addr); |
| 534 | return ts_BSSMAP_IE_AoIP_TLA4(ip, udp_port); |
| 535 | } |
| 536 | } |
| 537 | |
Neels Hofmeyr | 3c89a6b | 2019-10-15 16:54:37 +0200 | [diff] [blame] | 538 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA(template BSSMAP_FIELD_IPAddress addr, |
| 539 | template uint16_t udp_port, |
| 540 | template integer len := ?) := { |
| 541 | elementIdentifier := '7C'O, |
| 542 | lengthIndicator := len, |
| 543 | ipAddress := addr, |
| 544 | uDPPortValue := udp_port |
| 545 | } |
| 546 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA4(template OCT4 ip, template uint16_t pt) := |
| 547 | tr_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
| 548 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA6(template OCT16 ip, template uint16_t pt) := |
| 549 | tr_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
| 550 | |
Pau Espin Pedrol | 6a846bc | 2020-09-04 13:01:22 +0200 | [diff] [blame] | 551 | function f_tr_BSSMAP_IE_AoIP_TLA(charstring addr, template uint16_t udp_port) |
| 552 | return template BSSMAP_IE_AoIP_TransportLayerAddress { |
| 553 | if (f_addr_is_ipv6(addr)) { |
| 554 | var OCT16 ip6 := f_inet6_addr(addr); |
| 555 | return tr_BSSMAP_IE_AoIP_TLA6(ip6, udp_port); |
| 556 | } else { |
| 557 | var OCT4 ip := f_inet_addr(addr); |
| 558 | return tr_BSSMAP_IE_AoIP_TLA4(ip, udp_port); |
| 559 | } |
| 560 | } |
| 561 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 562 | template (present) BSSMAP_IE_KC128 tr_BSSMAP_IE_Kc128(template (present) OCT16 kc128) := { |
| 563 | elementIdentifier := '83'O, |
| 564 | kC128_Value := kc128 |
| 565 | } |
| 566 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 567 | template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { |
| 568 | elementIdentifier := '83'O, |
| 569 | kC128_Value := kc128 |
| 570 | } |
| 571 | |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 572 | /* 3.2.2.103 */ |
| 573 | template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := { |
| 574 | codecType := GSM_FR, |
| 575 | tF := '0'B, |
| 576 | pT := '0'B, |
| 577 | pI := '0'B, |
| 578 | fI := '1'B, |
| 579 | extendedCodecType := omit, |
| 580 | s0_7 := omit, |
| 581 | s8_15 := omit |
| 582 | } |
| 583 | template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := { |
| 584 | codecType := GSM_FR |
| 585 | } |
| 586 | template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := { |
| 587 | codecType := GSM_EFR |
| 588 | } |
| 589 | template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := { |
| 590 | codecType := GSM_HR |
| 591 | } |
| 592 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := { |
| 593 | codecType := FR_AMR, |
| 594 | s0_7 := '11111111'B, |
| 595 | s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */ |
| 596 | } |
| 597 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := { |
| 598 | codecType := HR_AMR, |
| 599 | s0_7 := '00111111'B, |
| 600 | s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */ |
| 601 | } |
| 602 | template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { |
| 603 | elementIdentifier := '7D'O, |
| 604 | lengthIndicator := 0, /* overwritten */ |
| 605 | codecElements := valueof(elem) |
| 606 | } |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 607 | template BSSMAP_IE_SpeechCodec ts_BSSMAP_IE_SpeechCodec(template BSSMAP_FIELD_CodecElements elem) := { |
| 608 | elementIdentifier := '7E'O, |
| 609 | lengthIndicator := 0, /* overwritten */ |
| 610 | codecElements := valueof(elem) |
| 611 | } |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 612 | |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 613 | template (value) BSSMAP_IE_Osmo_OsmuxCID ts_OsmuxCID(INT1 cid) := { |
| 614 | elementIdentifier := 'F1'O, |
| 615 | osmuxCID := cid |
| 616 | } |
| 617 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 618 | template PDU_BSSAP |
| 619 | ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 620 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit, |
| 621 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 622 | modifies ts_BSSAP_BSSMAP := { |
| 623 | pdu := { |
| 624 | bssmap := { |
| 625 | assignmentRequest := { |
| 626 | messageType :='01'O, /* overwritten */ |
| 627 | channelType := ts_BSSMAP_IE_ChannelType, |
| 628 | layer3HeaderInfo := omit, |
| 629 | priority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 630 | circuitIdentityCode := cic, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 631 | downLinkDTX_Flag := omit, |
| 632 | interferenceBandToBeUsed := omit, |
| 633 | classmarkInformationType2 := omit, |
| 634 | groupCallReference := omit, |
| 635 | talkerFlag := omit, |
| 636 | configurationEvolutionIndication := omit, |
| 637 | lsaAccesControlSuppression := omit, |
| 638 | serviceHandover := omit, |
| 639 | encryptionInformation := omit, |
| 640 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 641 | aoIPTransportLayer := aoip, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 642 | codecList := omit, |
| 643 | callIdentifier := omit, |
| 644 | kC128 := omit, |
| 645 | globalCallReference := omit, |
| 646 | lCLS_Configuration := omit, |
| 647 | lCLS_ConnectionStatusControl := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 648 | lCLS_CorrelationNotNeeded := omit, |
| 649 | osmuxCID := osmuxCID |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 650 | } |
| 651 | } |
| 652 | } |
| 653 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 654 | |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 655 | template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 656 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *, |
| 657 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *) |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 658 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 659 | pdu := { |
| 660 | bssmap := { |
| 661 | assignmentRequest := { |
| 662 | messageType :='01'O, /* overwritten */ |
| 663 | channelType := ?, |
| 664 | layer3HeaderInfo := *, |
| 665 | priority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 666 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 667 | downLinkDTX_Flag := *, |
| 668 | interferenceBandToBeUsed := *, |
| 669 | classmarkInformationType2 := *, |
| 670 | groupCallReference := *, |
| 671 | talkerFlag := *, |
| 672 | configurationEvolutionIndication := *, |
| 673 | lsaAccesControlSuppression := *, |
| 674 | serviceHandover := *, |
| 675 | encryptionInformation := *, |
| 676 | talkerPriority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 677 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 678 | codecList := *, |
| 679 | callIdentifier := *, |
| 680 | kC128 := *, |
| 681 | globalCallReference := *, |
| 682 | lCLS_Configuration := *, |
| 683 | lCLS_ConnectionStatusControl := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 684 | lCLS_CorrelationNotNeeded := *, |
| 685 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 686 | } |
| 687 | } |
| 688 | } |
| 689 | } |
| 690 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 691 | template PDU_BSSAP |
| 692 | ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 693 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 694 | template BSSMAP_IE_SpeechCodec speechCodec := omit, |
| 695 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit) |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 696 | modifies ts_BSSAP_BSSMAP := { |
| 697 | pdu := { |
| 698 | bssmap := { |
| 699 | assignmentComplete := { |
| 700 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 701 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 702 | circuitIdentityCode := cic, |
| 703 | cellIdentifier := omit, |
| 704 | chosenChannel := omit, |
| 705 | chosenEncryptionAlgorithm := omit, |
| 706 | circuitPool := omit, |
| 707 | speechVersion := omit, |
| 708 | lSAIdentifier := omit, |
| 709 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 710 | aoIPTransportLayer := aoip, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 711 | speechCodec := speechCodec, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 712 | codecList := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 713 | lCLS_BSS_Status := omit, |
| 714 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 715 | } |
| 716 | } |
| 717 | } |
| 718 | } |
| 719 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 720 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 721 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *, |
| 722 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *) |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 723 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 724 | pdu := { |
| 725 | bssmap := { |
| 726 | assignmentComplete := { |
| 727 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 728 | rR_Cause := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 729 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 730 | cellIdentifier := *, |
| 731 | chosenChannel := *, |
| 732 | chosenEncryptionAlgorithm := *, |
| 733 | circuitPool := *, |
| 734 | speechVersion := *, |
| 735 | lSAIdentifier := *, |
| 736 | talkerPriority := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 737 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 738 | speechCodec := *, |
| 739 | codecList := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 740 | lCLS_BSS_Status := *, |
| 741 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 742 | } |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 747 | template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := { |
| 748 | pdu := { |
| 749 | bssmap := { |
| 750 | assignmentFailure := { |
| 751 | messageType := '03'O, /* overwritten */ |
| 752 | rR_Cause := *, |
| 753 | circuitPool := *, |
| 754 | circuitPoolList := *, |
| 755 | talkerPriority := *, |
| 756 | codecList := * |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 763 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 764 | modifies ts_BSSAP_BSSMAP := { |
| 765 | pdu := { |
| 766 | bssmap := { |
| 767 | clearCommand := { |
| 768 | messageType := '20'O, /* overwritten */ |
| 769 | layer3HeaderInfo := omit, |
| 770 | cause := ts_BSSMAP_IE_Cause(cause), |
| 771 | cSFB_Indication := omit |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | } |
Harald Welte | 9978710 | 2019-02-04 10:41:36 +0100 | [diff] [blame] | 776 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause) |
| 777 | modifies ts_BSSMAP_ClearCommand := { |
| 778 | pdu := { |
| 779 | bssmap := { |
| 780 | clearCommand := { |
| 781 | cSFB_Indication := { |
| 782 | elementIdentifier := '8F'O |
| 783 | } |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | } |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 788 | |
| 789 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 790 | pdu := { |
| 791 | bssmap := { |
| 792 | clearCommand := { |
| 793 | messageType := '20'O, /* overwritten */ |
| 794 | layer3HeaderInfo := *, |
| 795 | cause := ?, |
| 796 | cSFB_Indication := * |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | } |
| 801 | |
Harald Welte | 4c422b7 | 2019-02-17 16:27:10 +0100 | [diff] [blame] | 802 | template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := { |
| 803 | pdu := { |
| 804 | bssmap := { |
| 805 | clearCommand := { |
| 806 | messageType := '20'O, /* overwritten */ |
| 807 | layer3HeaderInfo := *, |
| 808 | cause := ?, |
| 809 | cSFB_Indication := { |
| 810 | elementIdentifier := '8F'O |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | } |
| 816 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 817 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 818 | modifies ts_BSSAP_BSSMAP := { |
| 819 | pdu := { |
| 820 | bssmap := { |
| 821 | clearComplete := { |
| 822 | messageType := '21'O /* overwritten */ |
| 823 | } |
| 824 | } |
| 825 | } |
| 826 | } |
| 827 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 828 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 829 | pdu := { |
| 830 | bssmap := { |
| 831 | clearComplete := { |
| 832 | messageType := '21'O |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | } |
| 837 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 838 | template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) |
| 839 | modifies ts_BSSAP_BSSMAP := { |
| 840 | pdu := { |
| 841 | bssmap := { |
| 842 | clearRequest := { |
| 843 | messageType := '22'O, /* overwritten */ |
| 844 | cause := ts_BSSMAP_IE_Cause(cause) |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 850 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 851 | pdu := { |
| 852 | bssmap := { |
| 853 | clearRequest := { |
| 854 | messageType := '22'O, /* overwritten */ |
| 855 | cause := ? |
| 856 | } |
| 857 | } |
| 858 | } |
| 859 | } |
| 860 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 861 | template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause, |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 862 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 863 | template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit) |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 864 | modifies ts_BSSAP_BSSMAP := { |
| 865 | pdu := { |
| 866 | bssmap := { |
| 867 | handoverRequired := { |
| 868 | messageType := '11'O, |
| 869 | cause := ts_BSSMAP_IE_Cause(cause), |
| 870 | responseRequest := omit, |
| 871 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
| 872 | circuitPoolList := omit, |
| 873 | currentChannelType1 := omit, |
| 874 | speechVersion := omit, |
| 875 | queueingIndicator := omit, |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 876 | oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 877 | sourceToTargetRNCTransparentInfo := omit, |
| 878 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 879 | gERANClassmark := omit, |
| 880 | talkerPriority := omit, |
| 881 | speechCodec := omit, |
| 882 | cSG_Identifier := omit |
| 883 | } |
| 884 | } |
| 885 | } |
| 886 | } |
| 887 | |
| 888 | |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 889 | template PDU_BSSAP tr_BSSMAP_HandoverRequired(template BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := *) modifies tr_BSSAP_BSSMAP := { |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 890 | pdu := { |
| 891 | bssmap := { |
| 892 | handoverRequired := { |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 893 | messageType := '11'O, |
| 894 | oldToNewBSSInfo := f_tr_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs) |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 895 | } |
| 896 | } |
| 897 | } |
| 898 | } |
| 899 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 900 | template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := { |
| 901 | pdu := { |
| 902 | bssmap := { |
| 903 | handoverRequiredReject := { |
| 904 | messageType := '1A'O |
| 905 | } |
| 906 | } |
| 907 | } |
| 908 | } |
| 909 | |
| 910 | template PDU_BSSAP tr_BSSMAP_HandoverCommand |
| 911 | modifies tr_BSSAP_BSSMAP := { |
| 912 | pdu := { |
| 913 | bssmap := { |
| 914 | handoverCommand := { |
| 915 | messageType := '13'O |
| 916 | } |
| 917 | } |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | template PDU_BSSAP tr_BSSMAP_HandoverSucceeded |
| 922 | modifies tr_BSSAP_BSSMAP := { |
| 923 | pdu := { |
| 924 | bssmap := { |
| 925 | handoverSucceeded := { |
| 926 | messageType := '15'O |
| 927 | } |
| 928 | } |
| 929 | } |
| 930 | } |
| 931 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 932 | template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) |
| 933 | modifies ts_BSSAP_BSSMAP := { |
| 934 | pdu := { |
| 935 | bssmap := { |
| 936 | handoverCommand := { |
| 937 | messageType := '13'O, |
| 938 | layer3Information := { |
| 939 | elementIdentifier := '17'O, |
| 940 | lengthIndicator := 0, |
| 941 | layer3info := layer3info |
| 942 | }, |
| 943 | cellIdentifier := omit, |
| 944 | newBSSToOldBSSInfo := omit, |
| 945 | talkerPriority := omit |
| 946 | } |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | |
Neels Hofmeyr | 61ebb8b | 2018-10-09 18:28:06 +0200 | [diff] [blame] | 951 | template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := { |
| 952 | pdu := { |
| 953 | bssmap := { |
| 954 | handoverFailure := { |
| 955 | messageType := '16'O, |
| 956 | cause := ?, |
| 957 | rR_Cause := *, |
| 958 | circuitPool := *, |
| 959 | circuitPoolList := *, |
| 960 | gERANClassmark := *, |
| 961 | newBSSToOldBSSInfo := *, |
| 962 | interSystemInformation := *, |
| 963 | talkerPriority := *, |
| 964 | codecList := * |
| 965 | } |
| 966 | } |
| 967 | } |
| 968 | } |
| 969 | |
Neels Hofmeyr | 0d841d9 | 2021-06-21 22:27:21 +0200 | [diff] [blame] | 970 | template PDU_BSSAP tr_BSSMAP_HandoverRequest(template BSSMAP_IE_EncryptionInformation encryptionInformation := *, |
| 971 | template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := *, |
| 972 | template BSSMAP_IE_KC128 kC128 := * |
| 973 | ) |
| 974 | modifies tr_BSSAP_BSSMAP := { |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 975 | pdu := { |
| 976 | bssmap := { |
| 977 | handoverRequest := { |
Neels Hofmeyr | 0d841d9 | 2021-06-21 22:27:21 +0200 | [diff] [blame] | 978 | messageType := '10'O, |
| 979 | encryptionInformation := encryptionInformation, |
| 980 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
| 981 | kC128 := kC128 |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 982 | } |
| 983 | } |
| 984 | } |
| 985 | } |
| 986 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 987 | template PDU_BSSAP ts_BSSMAP_HandoverRequest( |
| 988 | template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 989 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit, |
| 990 | template BSSMAP_IE_CellIdentifier cell_id_target := ts_CellID_LAC_CI(1, 0), |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 991 | template BSSMAP_IE_CellIdentifier cell_id_source := ts_CellID_LAC_CI(1, 1), |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 992 | template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit, |
| 993 | template BSSMAP_IE_EncryptionInformation encryptionInformation := ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O), |
| 994 | template (omit) BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit, |
Neels Hofmeyr | 9fe1320 | 2022-03-04 00:05:43 +0100 | [diff] [blame] | 995 | template (omit) BSSMAP_IE_KC128 kC128 := omit, |
| 996 | template (omit) BSSMAP_IE_SpeechCodecList codecList := omit |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 997 | ) |
| 998 | modifies ts_BSSAP_BSSMAP := { |
| 999 | pdu := { |
| 1000 | bssmap := { |
| 1001 | handoverRequest := { |
| 1002 | messageType := '10'O, |
| 1003 | channelType := ts_BSSMAP_IE_ChannelType, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 1004 | encryptionInformation := encryptionInformation, |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1005 | classmarkInformationType := { |
| 1006 | classmarkInformationType1 := { |
| 1007 | elementIdentifier := '1D'O, |
| 1008 | rf_PowerCapability := '000'B, |
| 1009 | a5_1 := '0'B, |
| 1010 | esind := '0'B, |
| 1011 | revisionLevel := '10'B, |
| 1012 | spare1_1 := '0'B |
| 1013 | } |
| 1014 | }, |
| 1015 | cellIdentifierSource := cell_id_source, |
| 1016 | priority := omit, |
| 1017 | circuitIdentityCode := cic, |
| 1018 | downLinkDTX_Flag := omit, |
| 1019 | cellIdentifierTarget := cell_id_target, |
| 1020 | interferenceBandToBeUsed := omit, |
| 1021 | cause := omit, |
| 1022 | classmarkInformationType3 := omit, |
| 1023 | currentChannelType1 := omit, |
| 1024 | speechVersion := omit, |
| 1025 | groupCallReference := omit, |
| 1026 | talkerFlag := omit, |
| 1027 | configurationEvolutionIndication := omit, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 1028 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 1029 | oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs), |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1030 | lSAInformation := omit, |
| 1031 | lSAAccessControlSuppression := omit, |
| 1032 | serviceHandover := omit, |
| 1033 | iMSI_bssmap := omit, |
| 1034 | sourceToTargetRNCTransparentInfo := omit, |
| 1035 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 1036 | sNAAccessInformation := omit, |
| 1037 | talkerPriority := omit, |
| 1038 | aoIPTransportLayer := aoip_tla, |
Neels Hofmeyr | 9fe1320 | 2022-03-04 00:05:43 +0100 | [diff] [blame] | 1039 | codecList := codecList, |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1040 | callIdentifier := omit, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 1041 | kC128 := kC128, |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1042 | globalCallReference := omit, |
| 1043 | lCLS_Configuration := omit, |
| 1044 | connectionStatusControl := omit |
| 1045 | } |
| 1046 | } |
| 1047 | } |
| 1048 | } |
| 1049 | |
| 1050 | template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info) |
| 1051 | modifies tr_BSSAP_BSSMAP := { |
| 1052 | pdu := { |
| 1053 | bssmap := { |
| 1054 | handoverRequestAck := { |
| 1055 | messageType := '12'O, |
| 1056 | layer3Information := { |
| 1057 | elementIdentifier := '17'O, |
| 1058 | lengthIndicator := ?, |
| 1059 | layer3info := layer3info |
| 1060 | } |
| 1061 | } |
| 1062 | } |
| 1063 | } |
| 1064 | } |
| 1065 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1066 | template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge( |
| 1067 | template octetstring layer3info, |
| 1068 | template LIN1 layer3infoLength, |
| 1069 | template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit, |
| 1070 | template BSSMAP_IE_SpeechCodec speechCodec := omit, |
| 1071 | template BSSMAP_IE_ChosenChannel chosenChannel := omit, |
| 1072 | template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit) |
| 1073 | modifies ts_BSSAP_BSSMAP := { |
| 1074 | pdu := { |
| 1075 | bssmap := { |
| 1076 | handoverRequestAck := { |
| 1077 | messageType := '12'O, |
| 1078 | layer3Information := { |
| 1079 | elementIdentifier := '17'O, |
| 1080 | lengthIndicator := layer3infoLength, |
| 1081 | layer3info := layer3info |
| 1082 | }, |
| 1083 | chosenChannel := chosenChannel, |
| 1084 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
| 1085 | circuitPool := omit, |
| 1086 | speechVersion := omit, |
| 1087 | circuitIdentityCode := omit, |
| 1088 | lSAIdentifier := omit, |
| 1089 | newBSSToOldBSSInfo := omit, |
| 1090 | interSystemInformation := omit, |
| 1091 | talkerPriority := omit, |
| 1092 | aoIPTransportLayer := aoIPTransportLayer, |
| 1093 | codecList := omit, |
| 1094 | speechCodec := speechCodec, |
| 1095 | lCLS_bSS_Status := omit |
| 1096 | } |
| 1097 | } |
| 1098 | } |
| 1099 | } |
| 1100 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1101 | template PDU_BSSAP tr_BSSMAP_HandoverDetect |
| 1102 | modifies tr_BSSAP_BSSMAP := { |
| 1103 | pdu := { |
| 1104 | bssmap := { |
| 1105 | handoverDetect := { |
| 1106 | messageType := '1B'O, |
| 1107 | talkerPriority := * |
| 1108 | } |
| 1109 | } |
| 1110 | } |
| 1111 | } |
| 1112 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1113 | template PDU_BSSAP ts_BSSMAP_HandoverDetect |
| 1114 | modifies ts_BSSAP_BSSMAP := { |
| 1115 | pdu := { |
| 1116 | bssmap := { |
| 1117 | handoverDetect := { |
| 1118 | messageType := '1B'O, |
| 1119 | talkerPriority := omit |
| 1120 | } |
| 1121 | } |
| 1122 | } |
| 1123 | } |
| 1124 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1125 | template PDU_BSSAP tr_BSSMAP_HandoverComplete |
| 1126 | modifies tr_BSSAP_BSSMAP := { |
| 1127 | pdu := { |
| 1128 | bssmap := { |
| 1129 | handoverComplete := { |
| 1130 | messageType := '14'O, |
| 1131 | rR_Cause := *, |
| 1132 | talkerPriority := *, |
| 1133 | speechCodec := *, |
| 1134 | codecList := *, |
| 1135 | chosenEncryptionAlgorithm := *, |
| 1136 | chosenChannel := *, |
| 1137 | lCLS_BSS_Status := * |
| 1138 | } |
| 1139 | } |
| 1140 | } |
| 1141 | } |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 1142 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1143 | template PDU_BSSAP ts_BSSMAP_HandoverComplete |
| 1144 | modifies ts_BSSAP_BSSMAP := { |
| 1145 | pdu := { |
| 1146 | bssmap := { |
| 1147 | handoverComplete := { |
| 1148 | messageType := '14'O, |
| 1149 | rR_Cause := omit, |
| 1150 | talkerPriority := omit, |
| 1151 | speechCodec := omit, |
| 1152 | codecList := omit, |
| 1153 | chosenEncryptionAlgorithm := omit, |
| 1154 | chosenChannel := omit, |
| 1155 | lCLS_BSS_Status := omit |
| 1156 | } |
| 1157 | } |
| 1158 | } |
| 1159 | } |
| 1160 | |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 1161 | template PDU_BSSAP tr_BSSMAP_HandoverPerformed |
| 1162 | modifies tr_BSSAP_BSSMAP := { |
| 1163 | pdu := { |
| 1164 | bssmap := { |
| 1165 | handoverPerformed := { |
| 1166 | messageType := '17'O, |
| 1167 | cause := ?, |
| 1168 | cellIdentifier := ?, |
Philipp Maier | 8d33a13 | 2018-11-12 11:58:55 +0100 | [diff] [blame] | 1169 | chosenChannel := *, |
| 1170 | chosenEncryptionAlgorithm := *, |
| 1171 | speechVersion := *, |
| 1172 | lSAIdentifier := *, |
| 1173 | talkerPriority := *, |
| 1174 | codecList := *, |
| 1175 | speechCodec := *, |
| 1176 | lCLS_BSS_Status := * |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 1177 | } |
| 1178 | } |
| 1179 | } |
| 1180 | } |
| 1181 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1182 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 1183 | elementIdentifier := '08'O, |
| 1184 | lengthIndicator := 0, /* overwritten */ |
| 1185 | typeOfIdentity := '001'B, /* IMSI */ |
| 1186 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 1187 | digits := imsi_digits |
| 1188 | } |
| 1189 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1190 | template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { |
| 1191 | elementIdentifier := '08'O, |
| 1192 | lengthIndicator := ?, /* overwritten */ |
| 1193 | typeOfIdentity := '001'B, /* IMSI */ |
| 1194 | oddEvenIndicator := ?, |
| 1195 | digits := imsi_digits |
| 1196 | } |
| 1197 | |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1198 | template (value) BSSAMAP_IE_LastUsedEUTRANPLMNId ts_BSSMAP_LastUsedEUTRANPLMNId(OCT3 mcc_mnc) := { |
| 1199 | elementIdentifier := '95'O, |
| 1200 | mcc_mnc := mcc_mnc |
| 1201 | } |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1202 | template BSSAMAP_IE_LastUsedEUTRANPLMNId tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) := { |
| 1203 | elementIdentifier := '95'O, |
| 1204 | mcc_mnc := mcc_mnc |
| 1205 | } |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1206 | function f_ts_BSSMAP_LastUsedEUTRANPLMNId(template (omit) OCT3 mcc_mnc) |
| 1207 | return template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId { |
| 1208 | if (not istemplatekind(mcc_mnc, "omit")) { |
| 1209 | return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc)); |
| 1210 | } else { |
| 1211 | return omit; |
| 1212 | } |
| 1213 | } |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1214 | function f_tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) |
| 1215 | return template BSSAMAP_IE_LastUsedEUTRANPLMNId { |
| 1216 | if (istemplatekind(mcc_mnc, "*")) { |
| 1217 | return *; |
| 1218 | } else if (istemplatekind(mcc_mnc, "?")) { |
| 1219 | return ?; |
| 1220 | } else if (istemplatekind(mcc_mnc, "omit")) { |
| 1221 | return omit; |
| 1222 | } else { |
| 1223 | return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc)); |
| 1224 | } |
| 1225 | } |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1226 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1227 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 1228 | cIl_noCell := ''O |
| 1229 | } |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1230 | template (value) BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_BSS := { |
| 1231 | cIl_allInBSS := ''O |
| 1232 | } |
| 1233 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_BSS := { |
| 1234 | cIl_allInBSS := ''O |
| 1235 | } |
| 1236 | |
| 1237 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1238 | ts_BSSMAP_CIL_CGI(template (value) BSSMAP_FIELD_CellIdentificationList_CGI cgil) := { |
| 1239 | cIl_CGI := cgil |
| 1240 | } |
| 1241 | template BSSMAP_FIELD_CellIdentificationList |
| 1242 | tr_BSSMAP_CIL_CGI(template BSSMAP_FIELD_CellIdentificationList_CGI cgil) := { |
| 1243 | cIl_CGI := cgil |
| 1244 | } |
| 1245 | |
| 1246 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1247 | ts_BSSMAP_CIL_LAC_CI(template (value) BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := { |
| 1248 | cIl_LAC_CI := lac_cil |
| 1249 | } |
| 1250 | template BSSMAP_FIELD_CellIdentificationList |
| 1251 | tr_BSSMAP_CIL_LAC_CI(template BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := { |
| 1252 | cIl_LAC_CI := lac_cil |
| 1253 | } |
| 1254 | |
| 1255 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1256 | ts_BSSMAP_CIL_CI(template (value) RecordOfOCT2 cil) := { |
| 1257 | cIl_CI := cil |
| 1258 | } |
| 1259 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_CI(template RecordOfOCT2 cil) := { |
| 1260 | cIl_CI := cil |
| 1261 | } |
| 1262 | |
| 1263 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1264 | ts_BSSMAP_CIL_LAI(template (value) BSSMAP_FIELD_CellIdentificationList_LAI lail) := { |
| 1265 | cIl_LAI := lail |
| 1266 | } |
| 1267 | template BSSMAP_FIELD_CellIdentificationList |
| 1268 | tr_BSSMAP_CIL_LAI(template BSSMAP_FIELD_CellIdentificationList_LAI lail) := { |
| 1269 | cIl_LAI := lail |
| 1270 | } |
| 1271 | |
| 1272 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1273 | ts_BSSMAP_CIL_LAC(template (value) RecordOfOCT2 lacl) := { |
| 1274 | cIl_LAC := lacl |
| 1275 | } |
| 1276 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_LAC(template RecordOfOCT2 lacl) := { |
| 1277 | cIl_LAC := lacl |
| 1278 | } |
| 1279 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1280 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1281 | function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Harald Welte | 24135bd | 2018-03-17 19:27:53 +0100 | [diff] [blame] | 1282 | if (lengthof(mnc) == 2) { |
| 1283 | 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] | 1284 | } else { |
| 1285 | return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); |
| 1286 | } |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1287 | } |
| 1288 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1289 | function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) { |
| 1290 | var hexstring hs := oct2hex(mcc_mnc); |
| 1291 | mcc := hs[1] & hs[0] & hs[3]; |
| 1292 | mnc := hs[5] & hs[4]; |
| 1293 | if (hs[2] == 'F'H) { |
| 1294 | mnc := mnc & hs[2]; |
| 1295 | } |
| 1296 | } |
| 1297 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1298 | 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] | 1299 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1300 | lac := int2oct(lac, 2), |
| 1301 | ci := int2oct(ci, 2) |
| 1302 | } |
| 1303 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1304 | 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] | 1305 | lac := int2oct(lac, 2), |
| 1306 | ci := int2oct(ci, 2) |
| 1307 | } |
| 1308 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1309 | 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] | 1310 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1311 | lac := int2oct(lac, 2) |
| 1312 | } |
| 1313 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1314 | template (value) OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 1315 | template (value) OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1316 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1317 | template (value) BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1318 | ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { |
| 1319 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1320 | lac := int2oct(lac, 2), |
| 1321 | rncId := int2oct(rnc_id, 2) |
| 1322 | } |
| 1323 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1324 | 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] | 1325 | lac := int2oct(lac, 2), |
| 1326 | rncId := int2oct(rnc_id, 2) |
| 1327 | } |
| 1328 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1329 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 1330 | elementIdentifier := '24'O, |
| 1331 | channel := chneed, |
| 1332 | spare := '000000'B |
| 1333 | } |
| 1334 | |
| 1335 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 1336 | elementIdentifier := '09'O, |
| 1337 | lengthIndicator := 4, |
| 1338 | tmsiOctets := tmsi |
| 1339 | }; |
| 1340 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1341 | template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { |
| 1342 | elementIdentifier := '09'O, |
| 1343 | lengthIndicator := 4, |
| 1344 | tmsiOctets := tmsi |
| 1345 | }; |
| 1346 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1347 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 1348 | var template BSSMAP_IE_TMSI ret; |
| 1349 | if (ispresent(tmsi)) { |
| 1350 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 1351 | } else { |
| 1352 | ret := omit; |
| 1353 | } |
| 1354 | return ret; |
| 1355 | } |
| 1356 | |
| 1357 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 1358 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 1359 | template OCT4 tmsi := omit, |
| 1360 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1361 | modifies ts_BSSAP_BSSMAP := { |
| 1362 | pdu := { |
| 1363 | bssmap := { |
| 1364 | paging := { |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1365 | messageType := '52'O, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1366 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1367 | tMSI := f_tmsi_or_omit(tmsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1368 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1369 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1370 | eMLPP_Priority := omit, |
| 1371 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1372 | } |
| 1373 | } |
| 1374 | } |
| 1375 | } |
| 1376 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1377 | template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, |
| 1378 | template OCT4 tmsi := *, |
| 1379 | template BSSMAP_IE_ChannelNeeded chneed := *) |
| 1380 | modifies tr_BSSAP_BSSMAP := { |
| 1381 | pdu := { |
| 1382 | bssmap := { |
| 1383 | paging := { |
| 1384 | messageType := '52'O, |
| 1385 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
| 1386 | tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, |
| 1387 | cellIdentifierList := ?, |
| 1388 | channelNeeded := chneed, |
| 1389 | eMLPP_Priority := omit, |
| 1390 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1391 | } |
| 1392 | } |
| 1393 | } |
| 1394 | } |
| 1395 | |
| 1396 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1397 | template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) |
| 1398 | modifies ts_BSSAP_BSSMAP := { |
| 1399 | pdu := { |
| 1400 | bssmap := { |
| 1401 | cipherModeCommand := { |
| 1402 | messageType := '53'O, |
| 1403 | layer3HeaderInfo := omit, |
| 1404 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1405 | cipherResponseMode := omit, |
| 1406 | kC128 := omit |
| 1407 | } |
| 1408 | } |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128) |
| 1413 | modifies ts_BSSAP_BSSMAP := { |
| 1414 | pdu := { |
| 1415 | bssmap := { |
| 1416 | cipherModeCommand := { |
| 1417 | messageType := '53'O, |
| 1418 | layer3HeaderInfo := omit, |
| 1419 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1420 | cipherResponseMode := omit, |
| 1421 | kC128 := { '83'O, kc128 } |
| 1422 | } |
| 1423 | } |
| 1424 | } |
| 1425 | } |
| 1426 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1427 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd2(template BSSMAP_IE_EncryptionInformation encryptionInformation := *, |
| 1428 | template BSSMAP_IE_KC128 kC128 := *) |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1429 | modifies tr_BSSAP_BSSMAP := { |
| 1430 | pdu := { |
| 1431 | bssmap := { |
| 1432 | cipherModeCommand := { |
| 1433 | messageType := '53'O, |
| 1434 | layer3HeaderInfo := *, |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1435 | encryptionInformation := encryptionInformation, |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1436 | cipherResponseMode := *, |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1437 | kC128 := kC128 |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1438 | } |
| 1439 | } |
| 1440 | } |
| 1441 | } |
| 1442 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1443 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key, template BSSMAP_IE_KC128 kC128 := omit) |
| 1444 | := tr_BSSMAP_CipherModeCmd2(tr_BSSMAP_IE_EncrInfo(key, alg), kC128); |
| 1445 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1446 | template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) |
| 1447 | modifies ts_BSSAP_BSSMAP := { |
| 1448 | pdu := { |
| 1449 | bssmap := { |
| 1450 | cipherModeComplete := { |
| 1451 | messageType := '55'O, |
| 1452 | layer3MessageContents := omit, |
| 1453 | chosenEncryptionAlgorithm := { |
| 1454 | elementIdentifier := '2C'O, |
| 1455 | algorithmIdentifier := alg |
| 1456 | } |
| 1457 | } |
| 1458 | } |
| 1459 | } |
| 1460 | } |
| 1461 | |
Stefan Sperling | a2d59c6 | 2018-12-18 16:32:44 +0100 | [diff] [blame] | 1462 | template PDU_BSSAP ts_BSSMAP_CipherModeComplAlg(template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := ?) |
| 1463 | modifies ts_BSSAP_BSSMAP := { |
| 1464 | pdu := { |
| 1465 | bssmap := { |
| 1466 | cipherModeComplete := { |
| 1467 | messageType := '55'O, |
| 1468 | layer3MessageContents := omit, |
| 1469 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm |
| 1470 | } |
| 1471 | } |
| 1472 | } |
| 1473 | } |
| 1474 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1475 | template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { |
| 1476 | pdu := { |
| 1477 | bssmap := { |
| 1478 | cipherModeComplete := { |
| 1479 | messageType := '55'O, |
| 1480 | layer3MessageContents := *, |
| 1481 | chosenEncryptionAlgorithm := { |
| 1482 | elementIdentifier := '2C'O, |
| 1483 | algorithmIdentifier := alg |
| 1484 | } |
| 1485 | } |
| 1486 | } |
| 1487 | } |
| 1488 | } |
| 1489 | |
| 1490 | template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := { |
| 1491 | pdu := { |
| 1492 | bssmap := { |
| 1493 | cipherModeReject := { |
| 1494 | messageType := '59'O, |
| 1495 | cause := ? |
| 1496 | } |
| 1497 | } |
| 1498 | } |
| 1499 | } |
| 1500 | |
Daniel Willmann | 52918e5 | 2018-09-20 14:39:09 +0200 | [diff] [blame] | 1501 | template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := { |
| 1502 | pdu := { |
| 1503 | bssmap := { |
| 1504 | classmarkRequest := { |
| 1505 | messageType := '58'O, |
| 1506 | talkerPriority := * |
| 1507 | } |
| 1508 | } |
| 1509 | } |
| 1510 | } |
| 1511 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1512 | template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { |
| 1513 | elementIdentifier := '12'O, |
| 1514 | lengthIndicator := 0, /* overwritten */ |
| 1515 | /* CM1 */ |
| 1516 | rf_PowerCapability := '010'B, /* class3 */ |
| 1517 | a5_1 := '0'B, /* supported */ |
| 1518 | esind := '1'B, /* early classmark supported */ |
| 1519 | revisionLevel := '10'B, /* R99 */ |
| 1520 | spare1_1 := '0'B, |
| 1521 | /* CM2 */ |
| 1522 | fc := '1'B, /* E-GSM support */ |
| 1523 | vgcs := '0'B, |
| 1524 | vbs := '0'B, |
| 1525 | sm_Capability := '1'B, |
| 1526 | ss_ScreenIndicator := '00'B, |
| 1527 | ps_Capability := '1'B, |
| 1528 | spare2_1 := '0'B, |
| 1529 | classmarkInformationType2_oct5 := { |
| 1530 | a5_2 := '0'B, /* not available */ |
| 1531 | a5_3 := '1'B, /* available */ |
| 1532 | cmsp := '0'B, /* not supported */ |
| 1533 | solsa := '0'B, /* not suported */ |
| 1534 | ucs2 := '0'B, /* GSM alphabet preferred */ |
| 1535 | lcsvacap := '0'B, /* not supported */ |
| 1536 | spare := '0'B, |
| 1537 | cm3 := '0'B /* no CM3 */ |
| 1538 | } |
| 1539 | } |
| 1540 | |
Eric Wild | 26f4a62 | 2021-05-17 15:27:05 +0200 | [diff] [blame] | 1541 | |
| 1542 | template BSSMAP_IE_ClassmarkInformationType3 ts_CM3_default := { |
| 1543 | elementIdentifier := '13'O, |
| 1544 | lengthIndicator := 0, /* overwritten */ |
| 1545 | classmark3ValuePart := '01'O /* A5/4 supported */ |
| 1546 | } |
| 1547 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1548 | template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, |
| 1549 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) |
| 1550 | modifies ts_BSSAP_BSSMAP := { |
| 1551 | pdu := { |
| 1552 | bssmap := { |
| 1553 | classmarkUpdate := { |
| 1554 | messageType := '54'O, |
| 1555 | classmarkInformationType2 := cm2, |
| 1556 | classmarkInformationType3 := cm3, |
| 1557 | talkerPriority := omit |
| 1558 | } |
| 1559 | } |
| 1560 | } |
| 1561 | } |
| 1562 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1563 | template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, |
| 1564 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) |
| 1565 | modifies tr_BSSAP_BSSMAP := { |
| 1566 | pdu := { |
| 1567 | bssmap := { |
| 1568 | classmarkUpdate := { |
| 1569 | messageType := '54'O, |
| 1570 | classmarkInformationType2 := cm2, |
| 1571 | classmarkInformationType3 := cm3, |
| 1572 | talkerPriority := * |
| 1573 | } |
| 1574 | } |
| 1575 | } |
| 1576 | } |
| 1577 | |
Neels Hofmeyr | 92b12b7 | 2018-09-18 14:30:23 +0200 | [diff] [blame] | 1578 | template PDU_BSSAP ts_BSSMAP_ClassmarkRequest |
| 1579 | modifies ts_BSSAP_BSSMAP := { |
| 1580 | pdu := { |
| 1581 | bssmap := { |
| 1582 | classmarkRequest := { |
| 1583 | messageType := '58'O, |
| 1584 | talkerPriority := omit |
| 1585 | } |
| 1586 | } |
| 1587 | } |
| 1588 | } |
| 1589 | |
Eric Wild | 26f4a62 | 2021-05-17 15:27:05 +0200 | [diff] [blame] | 1590 | template PDU_BSSAP tr_BSSMAP_ClassmarkRequest |
| 1591 | modifies tr_BSSAP_BSSMAP := { |
| 1592 | pdu := { |
| 1593 | bssmap := { |
| 1594 | classmarkRequest := { |
| 1595 | messageType := '58'O, |
| 1596 | talkerPriority := * |
| 1597 | } |
| 1598 | } |
| 1599 | } |
| 1600 | } |
| 1601 | |
Harald Welte | 49518bf | 2018-02-10 11:39:19 +0100 | [diff] [blame] | 1602 | /* return Layer3 octetstring inside BSSAP PDU */ |
| 1603 | function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring { |
| 1604 | if (ischosen(bssap.pdu.bssmap)) { |
| 1605 | var PDU_BSSMAP bssmap := bssap.pdu.bssmap; |
| 1606 | if (ischosen(bssmap.completeLayer3Information)) { |
| 1607 | return bssmap.completeLayer3Information.layer3Information.layer3info; |
| 1608 | } else if (ischosen(bssmap.handoverRequestAck)) { |
| 1609 | return bssmap.handoverRequestAck.layer3Information.layer3info; |
| 1610 | } else if (ischosen(bssmap.handoverCommand)) { |
| 1611 | return bssmap.handoverCommand.layer3Information.layer3info; |
| 1612 | } else if (ischosen(bssmap.uplinkRequest)) { |
| 1613 | return bssmap.uplinkRequest.layer3Information.layer3info; |
| 1614 | } else if (ischosen(bssmap.uplinkRequestConfirmation)) { |
| 1615 | return bssmap.uplinkRequestConfirmation.layer3Information.layer3info; |
| 1616 | } else if (ischosen(bssmap.uplinkApplicationData)) { |
| 1617 | return bssmap.uplinkApplicationData.layer3Information.layer3info; |
| 1618 | } else if (ischosen(bssmap.rerouteCommand)) { |
| 1619 | return bssmap.rerouteCommand.initialLayer3Information.layer3info; |
| 1620 | } else { |
| 1621 | return omit; |
| 1622 | } |
| 1623 | } else { |
| 1624 | return bssap.pdu.dtap; |
| 1625 | } |
| 1626 | } |
| 1627 | |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1628 | /* TS 29.205 B.2.1.9 */ |
| 1629 | template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := { |
| 1630 | networkIDLengthIndicator := 0, /* overwritten */ |
| 1631 | networkID := net_id, |
| 1632 | nodeIDLengthIndicator := 0, /* overwritten */ |
| 1633 | nodeID := node_id, |
| 1634 | callReferenceIDLengthIndicator := 0, /* overwritten */ |
| 1635 | callReferenceID := cref_id |
| 1636 | } |
| 1637 | template GlobalCallReferenceValue tr_GCR(template octetstring net_id, |
| 1638 | template OCT2 node_id, |
| 1639 | template OCT5 cref_id) := { |
| 1640 | networkIDLengthIndicator := ?, |
| 1641 | networkID := net_id, |
| 1642 | nodeIDLengthIndicator := ?, |
| 1643 | nodeID := node_id, |
| 1644 | callReferenceIDLengthIndicator := ?, |
| 1645 | callReferenceID := cref_id |
| 1646 | } |
| 1647 | |
| 1648 | /* TS 47.008 3.2.2.115 */ |
| 1649 | template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := { |
| 1650 | elementIdentifier := '89'O, |
| 1651 | lengthIndicator := 0, /* overwritten */ |
| 1652 | globalCallReferenceValue := gcr |
| 1653 | } |
| 1654 | template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := { |
| 1655 | elementIdentifier := '89'O, |
| 1656 | lengthIndicator := ?, |
| 1657 | globalCallReferenceValue := gcr |
| 1658 | } |
| 1659 | |
| 1660 | /* TS 48.008 3.2.2.116 */ |
| 1661 | const BIT4 LCLS_CFG_both_way := '0000'B; |
| 1662 | const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B; |
| 1663 | const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B; |
| 1664 | const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B; |
| 1665 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B; |
| 1666 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B; |
| 1667 | |
| 1668 | template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := { |
| 1669 | elementIdentifier := '8A'O, |
| 1670 | lCLS_ConfigurationValue := cfg_val, |
| 1671 | spare := '0000'B |
| 1672 | } |
| 1673 | template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := { |
| 1674 | elementIdentifier := '8A'O, |
| 1675 | lCLS_ConfigurationValue := cfg_val, |
| 1676 | spare := '0000'B |
| 1677 | } |
| 1678 | |
| 1679 | /* TS 48.008 3.2.2.117 */ |
| 1680 | const BIT4 LCLS_CSC_connect := '0000'B; |
| 1681 | const BIT4 LCLS_CSC_do_not_connect := '0001'B; |
| 1682 | const BIT4 LCLS_CSC_release_lcls := '0010'B; |
| 1683 | const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B; |
| 1684 | const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B; |
| 1685 | |
| 1686 | template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := { |
| 1687 | elementIdentifier := '8B'O, |
| 1688 | lCLS_ConnectionStatusControlValue := csc, |
| 1689 | spare := '0000'B |
| 1690 | } |
| 1691 | template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := { |
| 1692 | elementIdentifier := '8B'O, |
| 1693 | lCLS_ConnectionStatusControlValue := csc, |
| 1694 | spare := '0000'B |
| 1695 | } |
| 1696 | |
| 1697 | /* TS 48.008 3.2.2.119 */ |
| 1698 | const BIT4 LCLS_STS_not_yet_ls := '0000'B; |
| 1699 | const BIT4 LCLS_STS_not_possible_ls := '0001'B; |
| 1700 | const BIT4 LCLS_STS_no_longer_ls := '0010'B; |
| 1701 | const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B; |
| 1702 | const BIT4 LCLS_STS_locally_switched := '0100'B; |
| 1703 | |
| 1704 | template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := { |
| 1705 | elementIdentifier := '8D'O, |
| 1706 | lCLS_BSS_StatusValue := sts, |
| 1707 | spare := '0000'B |
| 1708 | } |
| 1709 | template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := { |
| 1710 | elementIdentifier := '8D'O, |
| 1711 | lCLS_BSS_StatusValue := sts, |
| 1712 | spare := '0000'B |
| 1713 | } |
| 1714 | |
| 1715 | /* TS 48.008 3.2.1.91 */ |
| 1716 | 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] | 1717 | template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1718 | pdu := { |
| 1719 | bssmap := { |
| 1720 | lCLS_ConnectControl := { |
| 1721 | messageType := '74'O, |
| 1722 | lCLS_Configuration := cfg, |
| 1723 | lCLS_ConnectionStatusControl := csc |
| 1724 | } |
| 1725 | } |
| 1726 | } |
| 1727 | } |
| 1728 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1729 | template BSSMAP_IE_LCLS_ConnectionStatusControl csc) |
| 1730 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1731 | pdu := { |
| 1732 | bssmap := { |
| 1733 | lCLS_ConnectControl := { |
| 1734 | messageType := '74'O, |
| 1735 | lCLS_Configuration := cfg, |
| 1736 | lCLS_ConnectionStatusControl := csc |
| 1737 | } |
| 1738 | } |
| 1739 | } |
| 1740 | } |
| 1741 | |
| 1742 | /* TS 48.008 3.2.1.92 */ |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1743 | template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts) |
| 1744 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1745 | pdu := { |
| 1746 | bssmap := { |
| 1747 | lCLS_connectControlAck := { |
| 1748 | messageType := '75'O, |
| 1749 | lCLS_BSS_Status := sts |
| 1750 | } |
| 1751 | } |
| 1752 | } |
| 1753 | } |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1754 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts) |
| 1755 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1756 | pdu := { |
| 1757 | bssmap := { |
| 1758 | lCLS_connectControlAck := { |
| 1759 | messageType := '75'O, |
| 1760 | lCLS_BSS_Status := sts |
| 1761 | } |
| 1762 | } |
| 1763 | } |
| 1764 | } |
| 1765 | |
| 1766 | /* TS 48.008 3.2.1.93 */ |
| 1767 | 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] | 1768 | template (omit) BSSMAP_IE_LCLS_BreakRequest brq) |
| 1769 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1770 | pdu := { |
| 1771 | bssmap := { |
| 1772 | lCLS_Notification := { |
| 1773 | messageType := '76'O, |
| 1774 | lCLS_BSS_Status := sts, |
| 1775 | lCLS_BreakRequest := brq |
| 1776 | } |
| 1777 | } |
| 1778 | } |
| 1779 | } |
| 1780 | 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] | 1781 | template BSSMAP_IE_LCLS_BreakRequest brq) |
| 1782 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1783 | pdu := { |
| 1784 | bssmap := { |
| 1785 | lCLS_Notification := { |
| 1786 | messageType := '76'O, |
| 1787 | lCLS_BSS_Status := sts, |
| 1788 | lCLS_BreakRequest := brq |
| 1789 | } |
| 1790 | } |
| 1791 | } |
| 1792 | } |
| 1793 | |
Harald Welte | cc0b014 | 2018-05-29 15:19:33 +0200 | [diff] [blame] | 1794 | template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts) |
| 1795 | modifies tr_BSSAP_BSSMAP := { |
| 1796 | pdu := { |
| 1797 | bssmap := { |
| 1798 | lCLS_Notification := { |
| 1799 | messageType := '76'O, |
| 1800 | lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts), |
| 1801 | lCLS_BreakRequest := omit |
| 1802 | } |
| 1803 | } |
| 1804 | } |
| 1805 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1806 | |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1807 | template PDU_BSSAP ts_BSSMAP_CommonId(hexstring imsi_digits, |
| 1808 | template (omit) OCT3 last_eutran_plmn := omit) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1809 | modifies ts_BSSAP_BSSMAP := { |
| 1810 | pdu := { |
| 1811 | bssmap := { |
| 1812 | commonID := { |
| 1813 | messageType := '2F'O, |
| 1814 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Pau Espin Pedrol | d5ba6ce | 2021-04-15 14:18:13 +0200 | [diff] [blame] | 1815 | sNAAccessInformation := omit, |
| 1816 | selectedPLMNId := omit, |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1817 | lastUsedEUTRANPLMNId := f_ts_BSSMAP_LastUsedEUTRANPLMNId(last_eutran_plmn) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1818 | } |
| 1819 | } |
| 1820 | } |
| 1821 | } |
| 1822 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1823 | template PDU_BSSAP tr_BSSMAP_CommonId(template hexstring imsi_digits, |
| 1824 | template BSSAMAP_IE_LastUsedEUTRANPLMNId lastUsedEUTRANPLMNId := *) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1825 | modifies tr_BSSAP_BSSMAP := { |
| 1826 | pdu := { |
| 1827 | bssmap := { |
| 1828 | commonID := { |
| 1829 | messageType := '2F'O, |
| 1830 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1831 | sNAAccessInformation := *, |
| 1832 | selectedPLMNId := *, |
| 1833 | lastUsedEUTRANPLMNId := lastUsedEUTRANPLMNId |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1834 | } |
| 1835 | } |
| 1836 | } |
| 1837 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1838 | |
Vadim Yanitskiy | 4806396 | 2020-08-28 07:49:44 +0700 | [diff] [blame] | 1839 | template PDU_BSSAP tr_BSSMAP_SAPInReject(template (present) GsmSapi sapi := ?, |
| 1840 | template BSSMAP_IE_Cause cause := ?) |
| 1841 | modifies tr_BSSAP_BSSMAP := { |
| 1842 | pdu := { |
| 1843 | bssmap := { |
| 1844 | sAPInReject := { |
| 1845 | messageType := '25'O, |
| 1846 | dLCI := { |
| 1847 | elementIdentifier := '18'O, |
| 1848 | sapiValue := f_tr_SAPI(sapi), |
| 1849 | spare := ?, |
| 1850 | c1 := ?, c2 := ? |
| 1851 | }, |
| 1852 | cause := cause |
| 1853 | } |
| 1854 | } |
| 1855 | } |
| 1856 | } |
| 1857 | |
| 1858 | private function f_tr_SAPI(template (present) GsmSapi sapi) |
| 1859 | return template (present) BIT3 { |
| 1860 | if (istemplatekind(sapi, "?")) { |
| 1861 | return ?; |
| 1862 | } else { |
| 1863 | return int2bit(valueof(sapi), 3); |
| 1864 | } |
| 1865 | } |
| 1866 | |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1867 | template (value) BSSMAP_IE_LocationType ts_BSSMAP_IE_LocationType |
| 1868 | := { |
| 1869 | elementIdentifier := '44'O, |
| 1870 | lengthIndicator := 1, |
| 1871 | locationInformation := '00'O, |
| 1872 | positioningMethod := omit |
| 1873 | } |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1874 | |
Vadim Yanitskiy | 2ae269b | 2022-03-23 14:51:27 +0300 | [diff] [blame] | 1875 | template (value) BSSMAP_IE_LCSClientType |
| 1876 | ts_BSSMAP_IE_LCSClientType(template (value) BIT4 category := '0010'B, |
| 1877 | template (value) BIT4 subtype := '0000'B) := { |
| 1878 | elementIdentifier := '48'O, |
| 1879 | lengthIndicator := 0, /* overwritten */ |
| 1880 | subtype := subtype, |
| 1881 | category := category |
| 1882 | } |
| 1883 | |
Vadim Yanitskiy | dcbdb82 | 2022-03-23 15:11:45 +0300 | [diff] [blame] | 1884 | template (value) BSSMAP_IE_LCSPriority |
| 1885 | ts_BSSMAP_IE_LCSPriority(template (value) OCT1 priority := '00'O) := { |
| 1886 | elementIdentifier := '43'O, |
| 1887 | lengthIndicator := 0, /* overwritten */ |
| 1888 | priority := priority |
| 1889 | } |
| 1890 | |
| 1891 | template (value) BSSMAP_IE_LCSQOS |
| 1892 | ts_BSSMAP_IE_LCSQOS(template (value) BIT1 vCI := '0'B, |
| 1893 | template (value) BIT1 vEL := '0'B, |
| 1894 | template (value) BIT1 hAI := '1'B, |
| 1895 | template (value) BIT7 hAV := '0010010'B, |
| 1896 | template (value) BIT1 vAI := '0'B, |
| 1897 | template (value) BIT7 vAV := '0000000'B) := { |
| 1898 | elementIdentifier := '3E'O, |
| 1899 | lengthIndicator := 0, /* overwritten */ |
| 1900 | vCI := vCI, /* Vertical Coordinate Indicator: VC requested ('1'B) or not ('0'B) */ |
| 1901 | vEL := vEL, /* report velocity if available (1) or not(0) */ |
| 1902 | spare_1_6 := '000000'B, |
| 1903 | horizontalAccuracy := hAV, /* Accuracy Horizontal (HA) */ |
| 1904 | hAI := hAI, /* Horizontal Accuracy Indicator HA is specified (1) or not (0) */ |
| 1905 | verticalAccuracy := vAV, /* Accuracy Vertical (VA) */ |
| 1906 | vAI := vAI, /* Vertical Accuracy Indicator VA is specified (1) or not (0) */ |
| 1907 | spare_2_6 := '000000'B, |
| 1908 | rTC := '00'B /* Response Time is not specified */ |
| 1909 | } |
| 1910 | |
Vadim Yanitskiy | 2ae269b | 2022-03-23 14:51:27 +0300 | [diff] [blame] | 1911 | template (value) PDU_BSSAP |
| 1912 | ts_BSSMAP_Perform_Location_Request(template (omit) BSSMAP_IE_IMSI imsi, |
| 1913 | template (omit) BSSMAP_IE_CellIdentifier cellIdentifier := omit, |
Vadim Yanitskiy | dcbdb82 | 2022-03-23 15:11:45 +0300 | [diff] [blame] | 1914 | template (omit) BSSMAP_IE_LCSClientType clientType := ts_BSSMAP_IE_LCSClientType, |
| 1915 | template (omit) BSSMAP_IE_LCSPriority priority := ts_BSSMAP_IE_LCSPriority, |
| 1916 | template (omit) BSSMAP_IE_LCSQOS qos := ts_BSSMAP_IE_LCSQOS) |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1917 | modifies ts_BSSAP_BSSMAP := { |
| 1918 | pdu := { |
| 1919 | bssmap := { |
| 1920 | performLocationRequest := { |
| 1921 | messageType := '2B'O, |
| 1922 | locationType := ts_BSSMAP_IE_LocationType, |
| 1923 | cellIdentifier := cellIdentifier, |
| 1924 | classmarkInformationType3 := omit, |
Vadim Yanitskiy | 2ae269b | 2022-03-23 14:51:27 +0300 | [diff] [blame] | 1925 | lCS_ClientType := clientType, |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1926 | chosenChannel := omit, |
Vadim Yanitskiy | dcbdb82 | 2022-03-23 15:11:45 +0300 | [diff] [blame] | 1927 | lCS_Priority := priority, |
| 1928 | lCS_QOS := qos, |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1929 | gPS_AssistanceData := omit, |
| 1930 | aPDU := omit, |
| 1931 | iMSI := imsi, |
| 1932 | iMEI := omit, |
| 1933 | gANSS_LocationType := omit, |
| 1934 | gANSS_AssistanceData := omit |
| 1935 | } |
| 1936 | } |
| 1937 | } |
| 1938 | } |
| 1939 | |
| 1940 | template (present) BSSMAP_IE_LocationEstimate tr_BSSMAP_IE_LocationEstimate(template (present) octetstring geo_loc := ?) |
| 1941 | := { |
| 1942 | elementIdentifier := '45'O, |
| 1943 | lengthIndicator := ?, |
| 1944 | geographicLocation := geo_loc |
| 1945 | } |
| 1946 | |
| 1947 | function tr_BSSMAP_LcsCause(template (present) BSSMAP_LcsCause cause) |
| 1948 | return template (omit) BSSMAP_IE_LCSCause { |
| 1949 | if (istemplatekind(cause, "omit")) { |
| 1950 | return omit; |
| 1951 | } |
| 1952 | var template BSSMAP_IE_LCSCause ie := { |
| 1953 | elementIdentifier := '47'O, |
| 1954 | lengthIndicator := 1, |
| 1955 | causeValue := int2bit(enum2int(valueof(cause)), 8), |
| 1956 | diagnosticValue := omit |
| 1957 | } |
| 1958 | return ie; |
| 1959 | } |
| 1960 | |
| 1961 | template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Response( |
| 1962 | template BSSMAP_IE_LocationEstimate locationEstimate := *, |
| 1963 | template BSSMAP_IE_PositioningData positioningData := *, |
| 1964 | template BSSMAP_IE_LCSCause lCS_Cause := * |
| 1965 | ) |
| 1966 | modifies tr_BSSAP_BSSMAP := { |
| 1967 | pdu := { |
| 1968 | bssmap := { |
| 1969 | performLocationResponse := { |
| 1970 | messageType := '2D'O, |
| 1971 | locationEstimate := locationEstimate, |
| 1972 | positioningData := positioningData, |
| 1973 | decipheringKeys := *, |
| 1974 | lCS_Cause := lCS_Cause, |
| 1975 | velocityEstimate := *, |
| 1976 | gANSS_PositioningData := * |
| 1977 | } |
| 1978 | } |
| 1979 | } |
| 1980 | } |
| 1981 | |
| 1982 | template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Abort(template (present) BSSMAP_IE_LCSCause lCS_Cause := ?) |
| 1983 | modifies tr_BSSAP_BSSMAP := { |
| 1984 | pdu := { |
| 1985 | bssmap := { |
| 1986 | performLocationAbort := { |
| 1987 | messageType := '2E'O, |
| 1988 | lCS_Cause := lCS_Cause |
| 1989 | } |
| 1990 | } |
| 1991 | } |
| 1992 | } |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 1993 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 1994 | } with { encode "RAW" }; |