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; |
| 324 | |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 325 | 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] | 326 | modifies ts_BSSMAP_IE_CellID := { |
| 327 | cellIdentification := { |
Harald Welte | ae8ce23 | 2018-01-21 13:56:46 +0100 | [diff] [blame] | 328 | cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 329 | } |
| 330 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 331 | |
| 332 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 333 | modifies ts_BSSMAP_IE_CellID := { |
| 334 | cellIdentification := { |
| 335 | cI_LAC_CI := { |
| 336 | lac := int2oct(lac, 2), |
| 337 | ci := int2oct(ci, 2) |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 343 | modifies ts_BSSMAP_IE_CellID := { |
| 344 | cellIdentification := { |
| 345 | cI_CI := int2oct(ci, 2) |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 350 | modifies ts_BSSMAP_IE_CellID := { |
| 351 | cellIdentification := { |
| 352 | cI_noCell := ''O |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | |
| 357 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 358 | elementIdentifier := '17'O, |
| 359 | lengthIndicator := 0, |
| 360 | layer3info := l3info |
| 361 | } |
| 362 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 363 | template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring l3info) := { |
| 364 | elementIdentifier := '17'O, |
| 365 | lengthIndicator := ?, |
| 366 | layer3info := l3info |
| 367 | } |
| 368 | |
| 369 | |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 370 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 371 | modifies ts_BSSAP_BSSMAP := { |
| 372 | pdu := { |
| 373 | bssmap := { |
| 374 | completeLayer3Information := { |
| 375 | messageType := '57'O, |
| 376 | cellIdentifier := cell_id, |
| 377 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 378 | chosenChannel := omit, |
| 379 | lSAIdentifier := omit, |
| 380 | aPDU := omit, |
| 381 | codecList := omit, |
| 382 | redirectAttemptFlag := omit, |
| 383 | sendSequenceNumber := omit, |
| 384 | iMSI := omit |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 390 | template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?, |
Vadim Yanitskiy | a47cd4e | 2021-12-04 20:05:04 +0300 | [diff] [blame] | 391 | template BSSMAP_IE_CellIdentifier cell_id := ?, |
| 392 | template BSSMAP_IE_SpeechCodecList codec_list := *) |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 393 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 394 | pdu := { |
| 395 | bssmap := { |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 396 | completeLayer3Information := { |
| 397 | messageType := '57'O, |
| 398 | cellIdentifier := cell_id, |
| 399 | layer3Information := tr_BSSMAP_IE_L3Info(l3_info), |
| 400 | chosenChannel := *, |
| 401 | lSAIdentifier := *, |
| 402 | aPDU := *, |
Vadim Yanitskiy | a47cd4e | 2021-12-04 20:05:04 +0300 | [diff] [blame] | 403 | codecList := codec_list, |
Harald Welte | f8a0bda | 2017-12-09 00:53:17 +0100 | [diff] [blame] | 404 | redirectAttemptFlag := *, |
| 405 | sendSequenceNumber := *, |
| 406 | iMSI := * |
| 407 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 408 | } |
| 409 | } |
| 410 | } |
| 411 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 412 | 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] | 413 | elementIdentifier := '1A'O, |
| 414 | lengthIndicator := 0, /* overwritten */ |
| 415 | cellIdentifierDiscriminator := '0000'B, /* overwritten */ |
| 416 | spare1_4 := '0000'B, |
| 417 | cellIdentificationList := cid_list |
| 418 | } |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 419 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 420 | const OCT1 ChRate_ANY := '00'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 421 | const OCT1 ChRate_TCHF := '08'O; |
| 422 | const OCT1 ChRate_TCHH := '09'O; |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 423 | const OCT1 ChRate_TCHForH_Fpref := '0A'O; |
| 424 | const OCT1 ChRate_TCHForH_Hpref := '0B'O; |
| 425 | const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O; |
| 426 | const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O; |
| 427 | const OCT1 ChRate_TCHForH := '0F'O; |
| 428 | const OCT1 ChRate_TCHForH_nochg := '1F'O; |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 429 | |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 430 | const OCT1 Spdi_TCHF_FR := '01'O; |
| 431 | const OCT1 Spdi_TCHF_EFR := '11'O; |
| 432 | const OCT1 Spdi_TCHF_AMR := '21'O; |
| 433 | const OCT1 Spdi_TCHH_HR := '05'O; |
| 434 | const OCT1 Spdi_TCHH_AMR := '25'O; |
| 435 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 436 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := { |
| 437 | elementIdentifier := '0B'O, /* overwritten */ |
| 438 | lengthIndicator := 0, /* overwritten */ |
| 439 | speechOrDataIndicator := '0001'B, /* speech */ |
| 440 | spare1_4 := '0000'B, |
| 441 | channelRateAndType := ChRate_TCHF, |
Harald Welte | dbd6b3f | 2018-03-21 18:45:02 +0100 | [diff] [blame] | 442 | speechId_DataIndicator := Spdi_TCHF_FR |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 443 | } |
| 444 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 445 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := { |
| 446 | speechOrDataIndicator := '0100'B /* speech + CTM */ |
| 447 | } |
| 448 | |
| 449 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := { |
| 450 | elementIdentifier := '0B'O, /* overwritten */ |
| 451 | lengthIndicator := 0, /* overwritten */ |
| 452 | speechOrDataIndicator := '0010'B, /* data */ |
| 453 | spare1_4 := '0000'B, |
| 454 | channelRateAndType := ChRate_TCHF, |
| 455 | speechId_DataIndicator := '10'O /* 9600 bps / transparent */ |
| 456 | } |
| 457 | |
| 458 | template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := { |
| 459 | elementIdentifier := '0B'O, /* overwritten */ |
| 460 | lengthIndicator := 0, /* overwritten */ |
| 461 | speechOrDataIndicator := '0011'B, /* data */ |
| 462 | spare1_4 := '0000'B, |
| 463 | channelRateAndType := ChRate_ANY, |
| 464 | speechId_DataIndicator := '00'O /* spare */ |
| 465 | } |
| 466 | |
| 467 | template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := { |
| 468 | elementIdentifier := '0A'O, |
| 469 | lengthIndicator := 0, /* overwritten */ |
| 470 | permittedAlgorithms := algs, |
| 471 | key := kc |
| 472 | } |
| 473 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 474 | template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { |
| 475 | elementIdentifier := '0A'O, |
| 476 | lengthIndicator := ?, /* overwritten */ |
| 477 | permittedAlgorithms := algs, |
| 478 | key := kc |
| 479 | } |
| 480 | |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 481 | template BSSMAP_IE_ChosenEncryptionAlgorithm ts_BSSMAP_IE_ChosenEncryptionAlgorithm(OCT1 algorithmIdentifier) := { |
| 482 | elementIdentifier := '2C'O, |
| 483 | algorithmIdentifier := algorithmIdentifier |
| 484 | } |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 485 | |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 486 | template BSSMAP_IE_ChosenEncryptionAlgorithm tr_BSSMAP_IE_ChosenEncryptionAlgorithm(template OCT1 algorithmIdentifier := ?) := { |
| 487 | elementIdentifier := '2C'O, |
| 488 | algorithmIdentifier := algorithmIdentifier |
| 489 | } |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 490 | |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 491 | template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { |
| 492 | elementIdentifier := '01'O, /* overwritten */ |
| 493 | cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)), |
| 494 | cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5)) |
| 495 | } |
| 496 | |
Pau Espin Pedrol | 43021cb | 2019-06-18 17:32:15 +0200 | [diff] [blame] | 497 | function f_bssmap_ie_cic_2_int(BSSMAP_IE_CircuitIdentityCode cic_ie) return integer { |
| 498 | var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); |
| 499 | return cic; |
| 500 | } |
| 501 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 502 | 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] | 503 | uint16_t udp_port, |
| 504 | integer len) := { |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 505 | elementIdentifier := '7C'O, |
Harald Welte | b6e1d7e | 2018-01-26 21:38:59 +0100 | [diff] [blame] | 506 | lengthIndicator := len, /* overwritten */ |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 507 | ipAddress := addr, |
| 508 | uDPPortValue := udp_port |
| 509 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 510 | 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] | 511 | ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 512 | 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] | 513 | ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 514 | |
Pau Espin Pedrol | 6a846bc | 2020-09-04 13:01:22 +0200 | [diff] [blame] | 515 | function f_ts_BSSMAP_IE_AoIP_TLA(charstring addr, uint16_t udp_port) |
| 516 | return template (value) BSSMAP_IE_AoIP_TransportLayerAddress { |
| 517 | if (f_addr_is_ipv6(addr)) { |
| 518 | var OCT16 ip6 := f_inet6_addr(addr); |
| 519 | return ts_BSSMAP_IE_AoIP_TLA6(ip6, udp_port); |
| 520 | } else { |
| 521 | var OCT4 ip := f_inet_addr(addr); |
| 522 | return ts_BSSMAP_IE_AoIP_TLA4(ip, udp_port); |
| 523 | } |
| 524 | } |
| 525 | |
Neels Hofmeyr | 3c89a6b | 2019-10-15 16:54:37 +0200 | [diff] [blame] | 526 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA(template BSSMAP_FIELD_IPAddress addr, |
| 527 | template uint16_t udp_port, |
| 528 | template integer len := ?) := { |
| 529 | elementIdentifier := '7C'O, |
| 530 | lengthIndicator := len, |
| 531 | ipAddress := addr, |
| 532 | uDPPortValue := udp_port |
| 533 | } |
| 534 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA4(template OCT4 ip, template uint16_t pt) := |
| 535 | tr_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); |
| 536 | template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA6(template OCT16 ip, template uint16_t pt) := |
| 537 | tr_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); |
| 538 | |
Pau Espin Pedrol | 6a846bc | 2020-09-04 13:01:22 +0200 | [diff] [blame] | 539 | function f_tr_BSSMAP_IE_AoIP_TLA(charstring addr, template uint16_t udp_port) |
| 540 | return template BSSMAP_IE_AoIP_TransportLayerAddress { |
| 541 | if (f_addr_is_ipv6(addr)) { |
| 542 | var OCT16 ip6 := f_inet6_addr(addr); |
| 543 | return tr_BSSMAP_IE_AoIP_TLA6(ip6, udp_port); |
| 544 | } else { |
| 545 | var OCT4 ip := f_inet_addr(addr); |
| 546 | return tr_BSSMAP_IE_AoIP_TLA4(ip, udp_port); |
| 547 | } |
| 548 | } |
| 549 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 550 | template (present) BSSMAP_IE_KC128 tr_BSSMAP_IE_Kc128(template (present) OCT16 kc128) := { |
| 551 | elementIdentifier := '83'O, |
| 552 | kC128_Value := kc128 |
| 553 | } |
| 554 | |
Harald Welte | 4bf5fc9 | 2017-12-15 13:56:06 +0100 | [diff] [blame] | 555 | template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { |
| 556 | elementIdentifier := '83'O, |
| 557 | kC128_Value := kc128 |
| 558 | } |
| 559 | |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 560 | /* 3.2.2.103 */ |
| 561 | template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := { |
| 562 | codecType := GSM_FR, |
| 563 | tF := '0'B, |
| 564 | pT := '0'B, |
| 565 | pI := '0'B, |
| 566 | fI := '1'B, |
| 567 | extendedCodecType := omit, |
| 568 | s0_7 := omit, |
| 569 | s8_15 := omit |
| 570 | } |
| 571 | template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := { |
| 572 | codecType := GSM_FR |
| 573 | } |
| 574 | template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := { |
| 575 | codecType := GSM_EFR |
| 576 | } |
| 577 | template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := { |
| 578 | codecType := GSM_HR |
| 579 | } |
| 580 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := { |
| 581 | codecType := FR_AMR, |
| 582 | s0_7 := '11111111'B, |
| 583 | s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */ |
| 584 | } |
| 585 | template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := { |
| 586 | codecType := HR_AMR, |
| 587 | s0_7 := '00111111'B, |
| 588 | s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */ |
| 589 | } |
| 590 | template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := { |
| 591 | elementIdentifier := '7D'O, |
| 592 | lengthIndicator := 0, /* overwritten */ |
| 593 | codecElements := valueof(elem) |
| 594 | } |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 595 | template BSSMAP_IE_SpeechCodec ts_BSSMAP_IE_SpeechCodec(template BSSMAP_FIELD_CodecElements elem) := { |
| 596 | elementIdentifier := '7E'O, |
| 597 | lengthIndicator := 0, /* overwritten */ |
| 598 | codecElements := valueof(elem) |
| 599 | } |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 600 | |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 601 | template (value) BSSMAP_IE_Osmo_OsmuxCID ts_OsmuxCID(INT1 cid) := { |
| 602 | elementIdentifier := 'F1'O, |
| 603 | osmuxCID := cid |
| 604 | } |
| 605 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 606 | template PDU_BSSAP |
| 607 | ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 608 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit, |
| 609 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit) |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 610 | modifies ts_BSSAP_BSSMAP := { |
| 611 | pdu := { |
| 612 | bssmap := { |
| 613 | assignmentRequest := { |
| 614 | messageType :='01'O, /* overwritten */ |
| 615 | channelType := ts_BSSMAP_IE_ChannelType, |
| 616 | layer3HeaderInfo := omit, |
| 617 | priority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 618 | circuitIdentityCode := cic, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 619 | downLinkDTX_Flag := omit, |
| 620 | interferenceBandToBeUsed := omit, |
| 621 | classmarkInformationType2 := omit, |
| 622 | groupCallReference := omit, |
| 623 | talkerFlag := omit, |
| 624 | configurationEvolutionIndication := omit, |
| 625 | lsaAccesControlSuppression := omit, |
| 626 | serviceHandover := omit, |
| 627 | encryptionInformation := omit, |
| 628 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 629 | aoIPTransportLayer := aoip, |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 630 | codecList := omit, |
| 631 | callIdentifier := omit, |
| 632 | kC128 := omit, |
| 633 | globalCallReference := omit, |
| 634 | lCLS_Configuration := omit, |
| 635 | lCLS_ConnectionStatusControl := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 636 | lCLS_CorrelationNotNeeded := omit, |
| 637 | osmuxCID := osmuxCID |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 638 | } |
| 639 | } |
| 640 | } |
| 641 | } |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 642 | |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 643 | template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 644 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *, |
| 645 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *) |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 646 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 647 | pdu := { |
| 648 | bssmap := { |
| 649 | assignmentRequest := { |
| 650 | messageType :='01'O, /* overwritten */ |
| 651 | channelType := ?, |
| 652 | layer3HeaderInfo := *, |
| 653 | priority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 654 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 655 | downLinkDTX_Flag := *, |
| 656 | interferenceBandToBeUsed := *, |
| 657 | classmarkInformationType2 := *, |
| 658 | groupCallReference := *, |
| 659 | talkerFlag := *, |
| 660 | configurationEvolutionIndication := *, |
| 661 | lsaAccesControlSuppression := *, |
| 662 | serviceHandover := *, |
| 663 | encryptionInformation := *, |
| 664 | talkerPriority := *, |
Harald Welte | be48a7c | 2018-01-26 21:39:25 +0100 | [diff] [blame] | 665 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 666 | codecList := *, |
| 667 | callIdentifier := *, |
| 668 | kC128 := *, |
| 669 | globalCallReference := *, |
| 670 | lCLS_Configuration := *, |
| 671 | lCLS_ConnectionStatusControl := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 672 | lCLS_CorrelationNotNeeded := *, |
| 673 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 674 | } |
| 675 | } |
| 676 | } |
| 677 | } |
| 678 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 679 | template PDU_BSSAP |
| 680 | ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 681 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 682 | template BSSMAP_IE_SpeechCodec speechCodec := omit, |
| 683 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit) |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 684 | modifies ts_BSSAP_BSSMAP := { |
| 685 | pdu := { |
| 686 | bssmap := { |
| 687 | assignmentComplete := { |
| 688 | messageType :='02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 689 | rR_Cause := omit, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 690 | circuitIdentityCode := cic, |
| 691 | cellIdentifier := omit, |
| 692 | chosenChannel := omit, |
| 693 | chosenEncryptionAlgorithm := omit, |
| 694 | circuitPool := omit, |
| 695 | speechVersion := omit, |
| 696 | lSAIdentifier := omit, |
| 697 | talkerPriority := omit, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 698 | aoIPTransportLayer := aoip, |
Neels Hofmeyr | 82fd04b | 2019-02-28 08:43:00 +0100 | [diff] [blame] | 699 | speechCodec := speechCodec, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 700 | codecList := omit, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 701 | lCLS_BSS_Status := omit, |
| 702 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 703 | } |
| 704 | } |
| 705 | } |
| 706 | } |
| 707 | |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 708 | template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 709 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *, |
| 710 | template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *) |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 711 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 712 | pdu := { |
| 713 | bssmap := { |
| 714 | assignmentComplete := { |
| 715 | messageType := '02'O, /* overwritten */ |
Harald Welte | 7ed2b08 | 2017-11-23 18:52:13 +0100 | [diff] [blame] | 716 | rR_Cause := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 717 | circuitIdentityCode := cic, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 718 | cellIdentifier := *, |
| 719 | chosenChannel := *, |
| 720 | chosenEncryptionAlgorithm := *, |
| 721 | circuitPool := *, |
| 722 | speechVersion := *, |
| 723 | lSAIdentifier := *, |
| 724 | talkerPriority := *, |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 725 | aoIPTransportLayer := aoip, |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 726 | speechCodec := *, |
| 727 | codecList := *, |
Pau Espin Pedrol | 5eff975 | 2019-05-23 15:03:54 +0200 | [diff] [blame] | 728 | lCLS_BSS_Status := *, |
| 729 | osmuxCID := osmuxCID |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 730 | } |
| 731 | } |
| 732 | } |
| 733 | } |
| 734 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 735 | template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := { |
| 736 | pdu := { |
| 737 | bssmap := { |
| 738 | assignmentFailure := { |
| 739 | messageType := '03'O, /* overwritten */ |
| 740 | rR_Cause := *, |
| 741 | circuitPool := *, |
| 742 | circuitPoolList := *, |
| 743 | talkerPriority := *, |
| 744 | codecList := * |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 751 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause) |
| 752 | modifies ts_BSSAP_BSSMAP := { |
| 753 | pdu := { |
| 754 | bssmap := { |
| 755 | clearCommand := { |
| 756 | messageType := '20'O, /* overwritten */ |
| 757 | layer3HeaderInfo := omit, |
| 758 | cause := ts_BSSMAP_IE_Cause(cause), |
| 759 | cSFB_Indication := omit |
| 760 | } |
| 761 | } |
| 762 | } |
| 763 | } |
Harald Welte | 9978710 | 2019-02-04 10:41:36 +0100 | [diff] [blame] | 764 | template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause) |
| 765 | modifies ts_BSSMAP_ClearCommand := { |
| 766 | pdu := { |
| 767 | bssmap := { |
| 768 | clearCommand := { |
| 769 | cSFB_Indication := { |
| 770 | elementIdentifier := '8F'O |
| 771 | } |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | } |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 776 | |
| 777 | template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := { |
| 778 | pdu := { |
| 779 | bssmap := { |
| 780 | clearCommand := { |
| 781 | messageType := '20'O, /* overwritten */ |
| 782 | layer3HeaderInfo := *, |
| 783 | cause := ?, |
| 784 | cSFB_Indication := * |
| 785 | } |
| 786 | } |
| 787 | } |
| 788 | } |
| 789 | |
Harald Welte | 4c422b7 | 2019-02-17 16:27:10 +0100 | [diff] [blame] | 790 | template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := { |
| 791 | pdu := { |
| 792 | bssmap := { |
| 793 | clearCommand := { |
| 794 | messageType := '20'O, /* overwritten */ |
| 795 | layer3HeaderInfo := *, |
| 796 | cause := ?, |
| 797 | cSFB_Indication := { |
| 798 | elementIdentifier := '8F'O |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 | |
Harald Welte | b3414b2 | 2017-11-23 18:22:10 +0100 | [diff] [blame] | 805 | template (value) PDU_BSSAP ts_BSSMAP_ClearComplete |
| 806 | modifies ts_BSSAP_BSSMAP := { |
| 807 | pdu := { |
| 808 | bssmap := { |
| 809 | clearComplete := { |
| 810 | messageType := '21'O /* overwritten */ |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 816 | template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := { |
| 817 | pdu := { |
| 818 | bssmap := { |
| 819 | clearComplete := { |
| 820 | messageType := '21'O |
| 821 | } |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 826 | template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) |
| 827 | modifies ts_BSSAP_BSSMAP := { |
| 828 | pdu := { |
| 829 | bssmap := { |
| 830 | clearRequest := { |
| 831 | messageType := '22'O, /* overwritten */ |
| 832 | cause := ts_BSSMAP_IE_Cause(cause) |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | } |
| 837 | |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 838 | template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { |
| 839 | pdu := { |
| 840 | bssmap := { |
| 841 | clearRequest := { |
| 842 | messageType := '22'O, /* overwritten */ |
| 843 | cause := ? |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 849 | template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause, |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 850 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 851 | template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit) |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 852 | modifies ts_BSSAP_BSSMAP := { |
| 853 | pdu := { |
| 854 | bssmap := { |
| 855 | handoverRequired := { |
| 856 | messageType := '11'O, |
| 857 | cause := ts_BSSMAP_IE_Cause(cause), |
| 858 | responseRequest := omit, |
| 859 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
| 860 | circuitPoolList := omit, |
| 861 | currentChannelType1 := omit, |
| 862 | speechVersion := omit, |
| 863 | queueingIndicator := omit, |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 864 | oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 865 | sourceToTargetRNCTransparentInfo := omit, |
| 866 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 867 | gERANClassmark := omit, |
| 868 | talkerPriority := omit, |
| 869 | speechCodec := omit, |
| 870 | cSG_Identifier := omit |
| 871 | } |
| 872 | } |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 877 | 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] | 878 | pdu := { |
| 879 | bssmap := { |
| 880 | handoverRequired := { |
Pau Espin Pedrol | 35801c3 | 2021-04-19 13:03:20 +0200 | [diff] [blame] | 881 | messageType := '11'O, |
| 882 | oldToNewBSSInfo := f_tr_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs) |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 883 | } |
| 884 | } |
| 885 | } |
| 886 | } |
| 887 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 888 | template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := { |
| 889 | pdu := { |
| 890 | bssmap := { |
| 891 | handoverRequiredReject := { |
| 892 | messageType := '1A'O |
| 893 | } |
| 894 | } |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | template PDU_BSSAP tr_BSSMAP_HandoverCommand |
| 899 | modifies tr_BSSAP_BSSMAP := { |
| 900 | pdu := { |
| 901 | bssmap := { |
| 902 | handoverCommand := { |
| 903 | messageType := '13'O |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | } |
| 908 | |
| 909 | template PDU_BSSAP tr_BSSMAP_HandoverSucceeded |
| 910 | modifies tr_BSSAP_BSSMAP := { |
| 911 | pdu := { |
| 912 | bssmap := { |
| 913 | handoverSucceeded := { |
| 914 | messageType := '15'O |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | } |
| 919 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 920 | template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) |
| 921 | modifies ts_BSSAP_BSSMAP := { |
| 922 | pdu := { |
| 923 | bssmap := { |
| 924 | handoverCommand := { |
| 925 | messageType := '13'O, |
| 926 | layer3Information := { |
| 927 | elementIdentifier := '17'O, |
| 928 | lengthIndicator := 0, |
| 929 | layer3info := layer3info |
| 930 | }, |
| 931 | cellIdentifier := omit, |
| 932 | newBSSToOldBSSInfo := omit, |
| 933 | talkerPriority := omit |
| 934 | } |
| 935 | } |
| 936 | } |
| 937 | } |
| 938 | |
Neels Hofmeyr | 61ebb8b | 2018-10-09 18:28:06 +0200 | [diff] [blame] | 939 | template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := { |
| 940 | pdu := { |
| 941 | bssmap := { |
| 942 | handoverFailure := { |
| 943 | messageType := '16'O, |
| 944 | cause := ?, |
| 945 | rR_Cause := *, |
| 946 | circuitPool := *, |
| 947 | circuitPoolList := *, |
| 948 | gERANClassmark := *, |
| 949 | newBSSToOldBSSInfo := *, |
| 950 | interSystemInformation := *, |
| 951 | talkerPriority := *, |
| 952 | codecList := * |
| 953 | } |
| 954 | } |
| 955 | } |
| 956 | } |
| 957 | |
Neels Hofmeyr | 0d841d9 | 2021-06-21 22:27:21 +0200 | [diff] [blame] | 958 | template PDU_BSSAP tr_BSSMAP_HandoverRequest(template BSSMAP_IE_EncryptionInformation encryptionInformation := *, |
| 959 | template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := *, |
| 960 | template BSSMAP_IE_KC128 kC128 := * |
| 961 | ) |
| 962 | modifies tr_BSSAP_BSSMAP := { |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 963 | pdu := { |
| 964 | bssmap := { |
| 965 | handoverRequest := { |
Neels Hofmeyr | 0d841d9 | 2021-06-21 22:27:21 +0200 | [diff] [blame] | 966 | messageType := '10'O, |
| 967 | encryptionInformation := encryptionInformation, |
| 968 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
| 969 | kC128 := kC128 |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 970 | } |
| 971 | } |
| 972 | } |
| 973 | } |
| 974 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 975 | template PDU_BSSAP ts_BSSMAP_HandoverRequest( |
| 976 | template BSSMAP_IE_CircuitIdentityCode cic := omit, |
| 977 | template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit, |
| 978 | 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] | 979 | 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] | 980 | template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit, |
| 981 | template BSSMAP_IE_EncryptionInformation encryptionInformation := ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O), |
| 982 | template (omit) BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit, |
| 983 | template (omit) BSSMAP_IE_KC128 kC128 := omit |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 984 | ) |
| 985 | modifies ts_BSSAP_BSSMAP := { |
| 986 | pdu := { |
| 987 | bssmap := { |
| 988 | handoverRequest := { |
| 989 | messageType := '10'O, |
| 990 | channelType := ts_BSSMAP_IE_ChannelType, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 991 | encryptionInformation := encryptionInformation, |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 992 | classmarkInformationType := { |
| 993 | classmarkInformationType1 := { |
| 994 | elementIdentifier := '1D'O, |
| 995 | rf_PowerCapability := '000'B, |
| 996 | a5_1 := '0'B, |
| 997 | esind := '0'B, |
| 998 | revisionLevel := '10'B, |
| 999 | spare1_1 := '0'B |
| 1000 | } |
| 1001 | }, |
| 1002 | cellIdentifierSource := cell_id_source, |
| 1003 | priority := omit, |
| 1004 | circuitIdentityCode := cic, |
| 1005 | downLinkDTX_Flag := omit, |
| 1006 | cellIdentifierTarget := cell_id_target, |
| 1007 | interferenceBandToBeUsed := omit, |
| 1008 | cause := omit, |
| 1009 | classmarkInformationType3 := omit, |
| 1010 | currentChannelType1 := omit, |
| 1011 | speechVersion := omit, |
| 1012 | groupCallReference := omit, |
| 1013 | talkerFlag := omit, |
| 1014 | configurationEvolutionIndication := omit, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 1015 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
Pau Espin Pedrol | c08d552 | 2021-04-16 15:40:38 +0200 | [diff] [blame] | 1016 | oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs), |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1017 | lSAInformation := omit, |
| 1018 | lSAAccessControlSuppression := omit, |
| 1019 | serviceHandover := omit, |
| 1020 | iMSI_bssmap := omit, |
| 1021 | sourceToTargetRNCTransparentInfo := omit, |
| 1022 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 1023 | sNAAccessInformation := omit, |
| 1024 | talkerPriority := omit, |
| 1025 | aoIPTransportLayer := aoip_tla, |
| 1026 | codecList := omit, |
| 1027 | callIdentifier := omit, |
Neels Hofmeyr | 1d8dece | 2021-06-21 05:25:46 +0200 | [diff] [blame] | 1028 | kC128 := kC128, |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1029 | globalCallReference := omit, |
| 1030 | lCLS_Configuration := omit, |
| 1031 | connectionStatusControl := omit |
| 1032 | } |
| 1033 | } |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info) |
| 1038 | modifies tr_BSSAP_BSSMAP := { |
| 1039 | pdu := { |
| 1040 | bssmap := { |
| 1041 | handoverRequestAck := { |
| 1042 | messageType := '12'O, |
| 1043 | layer3Information := { |
| 1044 | elementIdentifier := '17'O, |
| 1045 | lengthIndicator := ?, |
| 1046 | layer3info := layer3info |
| 1047 | } |
| 1048 | } |
| 1049 | } |
| 1050 | } |
| 1051 | } |
| 1052 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1053 | template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge( |
| 1054 | template octetstring layer3info, |
| 1055 | template LIN1 layer3infoLength, |
| 1056 | template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit, |
| 1057 | template BSSMAP_IE_SpeechCodec speechCodec := omit, |
| 1058 | template BSSMAP_IE_ChosenChannel chosenChannel := omit, |
| 1059 | template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit) |
| 1060 | modifies ts_BSSAP_BSSMAP := { |
| 1061 | pdu := { |
| 1062 | bssmap := { |
| 1063 | handoverRequestAck := { |
| 1064 | messageType := '12'O, |
| 1065 | layer3Information := { |
| 1066 | elementIdentifier := '17'O, |
| 1067 | lengthIndicator := layer3infoLength, |
| 1068 | layer3info := layer3info |
| 1069 | }, |
| 1070 | chosenChannel := chosenChannel, |
| 1071 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, |
| 1072 | circuitPool := omit, |
| 1073 | speechVersion := omit, |
| 1074 | circuitIdentityCode := omit, |
| 1075 | lSAIdentifier := omit, |
| 1076 | newBSSToOldBSSInfo := omit, |
| 1077 | interSystemInformation := omit, |
| 1078 | talkerPriority := omit, |
| 1079 | aoIPTransportLayer := aoIPTransportLayer, |
| 1080 | codecList := omit, |
| 1081 | speechCodec := speechCodec, |
| 1082 | lCLS_bSS_Status := omit |
| 1083 | } |
| 1084 | } |
| 1085 | } |
| 1086 | } |
| 1087 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1088 | template PDU_BSSAP tr_BSSMAP_HandoverDetect |
| 1089 | modifies tr_BSSAP_BSSMAP := { |
| 1090 | pdu := { |
| 1091 | bssmap := { |
| 1092 | handoverDetect := { |
| 1093 | messageType := '1B'O, |
| 1094 | talkerPriority := * |
| 1095 | } |
| 1096 | } |
| 1097 | } |
| 1098 | } |
| 1099 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1100 | template PDU_BSSAP ts_BSSMAP_HandoverDetect |
| 1101 | modifies ts_BSSAP_BSSMAP := { |
| 1102 | pdu := { |
| 1103 | bssmap := { |
| 1104 | handoverDetect := { |
| 1105 | messageType := '1B'O, |
| 1106 | talkerPriority := omit |
| 1107 | } |
| 1108 | } |
| 1109 | } |
| 1110 | } |
| 1111 | |
Neels Hofmeyr | bd0ef93 | 2018-03-19 14:58:46 +0100 | [diff] [blame] | 1112 | template PDU_BSSAP tr_BSSMAP_HandoverComplete |
| 1113 | modifies tr_BSSAP_BSSMAP := { |
| 1114 | pdu := { |
| 1115 | bssmap := { |
| 1116 | handoverComplete := { |
| 1117 | messageType := '14'O, |
| 1118 | rR_Cause := *, |
| 1119 | talkerPriority := *, |
| 1120 | speechCodec := *, |
| 1121 | codecList := *, |
| 1122 | chosenEncryptionAlgorithm := *, |
| 1123 | chosenChannel := *, |
| 1124 | lCLS_BSS_Status := * |
| 1125 | } |
| 1126 | } |
| 1127 | } |
| 1128 | } |
Harald Welte | cfa79ad | 2017-12-09 22:33:47 +0100 | [diff] [blame] | 1129 | |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1130 | template PDU_BSSAP ts_BSSMAP_HandoverComplete |
| 1131 | modifies ts_BSSAP_BSSMAP := { |
| 1132 | pdu := { |
| 1133 | bssmap := { |
| 1134 | handoverComplete := { |
| 1135 | messageType := '14'O, |
| 1136 | rR_Cause := omit, |
| 1137 | talkerPriority := omit, |
| 1138 | speechCodec := omit, |
| 1139 | codecList := omit, |
| 1140 | chosenEncryptionAlgorithm := omit, |
| 1141 | chosenChannel := omit, |
| 1142 | lCLS_BSS_Status := omit |
| 1143 | } |
| 1144 | } |
| 1145 | } |
| 1146 | } |
| 1147 | |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 1148 | template PDU_BSSAP tr_BSSMAP_HandoverPerformed |
| 1149 | modifies tr_BSSAP_BSSMAP := { |
| 1150 | pdu := { |
| 1151 | bssmap := { |
| 1152 | handoverPerformed := { |
| 1153 | messageType := '17'O, |
| 1154 | cause := ?, |
| 1155 | cellIdentifier := ?, |
Philipp Maier | 8d33a13 | 2018-11-12 11:58:55 +0100 | [diff] [blame] | 1156 | chosenChannel := *, |
| 1157 | chosenEncryptionAlgorithm := *, |
| 1158 | speechVersion := *, |
| 1159 | lSAIdentifier := *, |
| 1160 | talkerPriority := *, |
| 1161 | codecList := *, |
| 1162 | speechCodec := *, |
| 1163 | lCLS_BSS_Status := * |
Philipp Maier | aee6039 | 2018-11-05 17:09:00 +0100 | [diff] [blame] | 1164 | } |
| 1165 | } |
| 1166 | } |
| 1167 | } |
| 1168 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1169 | template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := { |
| 1170 | elementIdentifier := '08'O, |
| 1171 | lengthIndicator := 0, /* overwritten */ |
| 1172 | typeOfIdentity := '001'B, /* IMSI */ |
| 1173 | oddEvenIndicator := f_hex_is_odd_length(imsi_digits), |
| 1174 | digits := imsi_digits |
| 1175 | } |
| 1176 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1177 | template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { |
| 1178 | elementIdentifier := '08'O, |
| 1179 | lengthIndicator := ?, /* overwritten */ |
| 1180 | typeOfIdentity := '001'B, /* IMSI */ |
| 1181 | oddEvenIndicator := ?, |
| 1182 | digits := imsi_digits |
| 1183 | } |
| 1184 | |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1185 | template (value) BSSAMAP_IE_LastUsedEUTRANPLMNId ts_BSSMAP_LastUsedEUTRANPLMNId(OCT3 mcc_mnc) := { |
| 1186 | elementIdentifier := '95'O, |
| 1187 | mcc_mnc := mcc_mnc |
| 1188 | } |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1189 | template BSSAMAP_IE_LastUsedEUTRANPLMNId tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) := { |
| 1190 | elementIdentifier := '95'O, |
| 1191 | mcc_mnc := mcc_mnc |
| 1192 | } |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1193 | function f_ts_BSSMAP_LastUsedEUTRANPLMNId(template (omit) OCT3 mcc_mnc) |
| 1194 | return template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId { |
| 1195 | if (not istemplatekind(mcc_mnc, "omit")) { |
| 1196 | return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc)); |
| 1197 | } else { |
| 1198 | return omit; |
| 1199 | } |
| 1200 | } |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1201 | function f_tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) |
| 1202 | return template BSSAMAP_IE_LastUsedEUTRANPLMNId { |
| 1203 | if (istemplatekind(mcc_mnc, "*")) { |
| 1204 | return *; |
| 1205 | } else if (istemplatekind(mcc_mnc, "?")) { |
| 1206 | return ?; |
| 1207 | } else if (istemplatekind(mcc_mnc, "omit")) { |
| 1208 | return omit; |
| 1209 | } else { |
| 1210 | return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc)); |
| 1211 | } |
| 1212 | } |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1213 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1214 | template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { |
| 1215 | cIl_noCell := ''O |
| 1216 | } |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1217 | template (value) BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_BSS := { |
| 1218 | cIl_allInBSS := ''O |
| 1219 | } |
| 1220 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_BSS := { |
| 1221 | cIl_allInBSS := ''O |
| 1222 | } |
| 1223 | |
| 1224 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1225 | ts_BSSMAP_CIL_CGI(template (value) BSSMAP_FIELD_CellIdentificationList_CGI cgil) := { |
| 1226 | cIl_CGI := cgil |
| 1227 | } |
| 1228 | template BSSMAP_FIELD_CellIdentificationList |
| 1229 | tr_BSSMAP_CIL_CGI(template BSSMAP_FIELD_CellIdentificationList_CGI cgil) := { |
| 1230 | cIl_CGI := cgil |
| 1231 | } |
| 1232 | |
| 1233 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1234 | ts_BSSMAP_CIL_LAC_CI(template (value) BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := { |
| 1235 | cIl_LAC_CI := lac_cil |
| 1236 | } |
| 1237 | template BSSMAP_FIELD_CellIdentificationList |
| 1238 | tr_BSSMAP_CIL_LAC_CI(template BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := { |
| 1239 | cIl_LAC_CI := lac_cil |
| 1240 | } |
| 1241 | |
| 1242 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1243 | ts_BSSMAP_CIL_CI(template (value) RecordOfOCT2 cil) := { |
| 1244 | cIl_CI := cil |
| 1245 | } |
| 1246 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_CI(template RecordOfOCT2 cil) := { |
| 1247 | cIl_CI := cil |
| 1248 | } |
| 1249 | |
| 1250 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1251 | ts_BSSMAP_CIL_LAI(template (value) BSSMAP_FIELD_CellIdentificationList_LAI lail) := { |
| 1252 | cIl_LAI := lail |
| 1253 | } |
| 1254 | template BSSMAP_FIELD_CellIdentificationList |
| 1255 | tr_BSSMAP_CIL_LAI(template BSSMAP_FIELD_CellIdentificationList_LAI lail) := { |
| 1256 | cIl_LAI := lail |
| 1257 | } |
| 1258 | |
| 1259 | template (value) BSSMAP_FIELD_CellIdentificationList |
| 1260 | ts_BSSMAP_CIL_LAC(template (value) RecordOfOCT2 lacl) := { |
| 1261 | cIl_LAC := lacl |
| 1262 | } |
| 1263 | template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_LAC(template RecordOfOCT2 lacl) := { |
| 1264 | cIl_LAC := lacl |
| 1265 | } |
| 1266 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1267 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1268 | function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { |
Harald Welte | 24135bd | 2018-03-17 19:27:53 +0100 | [diff] [blame] | 1269 | if (lengthof(mnc) == 2) { |
| 1270 | 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] | 1271 | } else { |
| 1272 | return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); |
| 1273 | } |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1274 | } |
| 1275 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1276 | function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) { |
| 1277 | var hexstring hs := oct2hex(mcc_mnc); |
| 1278 | mcc := hs[1] & hs[0] & hs[3]; |
| 1279 | mnc := hs[5] & hs[4]; |
| 1280 | if (hs[2] == 'F'H) { |
| 1281 | mnc := mnc & hs[2]; |
| 1282 | } |
| 1283 | } |
| 1284 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1285 | 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] | 1286 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1287 | lac := int2oct(lac, 2), |
| 1288 | ci := int2oct(ci, 2) |
| 1289 | } |
| 1290 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1291 | 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] | 1292 | lac := int2oct(lac, 2), |
| 1293 | ci := int2oct(ci, 2) |
| 1294 | } |
| 1295 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1296 | 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] | 1297 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1298 | lac := int2oct(lac, 2) |
| 1299 | } |
| 1300 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1301 | template (value) OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); |
| 1302 | template (value) OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1303 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1304 | template (value) BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1305 | ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { |
| 1306 | mcc_mnc := f_enc_mcc_mnc(mcc, mnc), |
| 1307 | lac := int2oct(lac, 2), |
| 1308 | rncId := int2oct(rnc_id, 2) |
| 1309 | } |
| 1310 | |
Harald Welte | aba4216 | 2019-06-19 18:17:59 +0200 | [diff] [blame] | 1311 | 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] | 1312 | lac := int2oct(lac, 2), |
| 1313 | rncId := int2oct(rnc_id, 2) |
| 1314 | } |
| 1315 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1316 | template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { |
| 1317 | elementIdentifier := '24'O, |
| 1318 | channel := chneed, |
| 1319 | spare := '000000'B |
| 1320 | } |
| 1321 | |
| 1322 | template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := { |
| 1323 | elementIdentifier := '09'O, |
| 1324 | lengthIndicator := 4, |
| 1325 | tmsiOctets := tmsi |
| 1326 | }; |
| 1327 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1328 | template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { |
| 1329 | elementIdentifier := '09'O, |
| 1330 | lengthIndicator := 4, |
| 1331 | tmsiOctets := tmsi |
| 1332 | }; |
| 1333 | |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1334 | private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { |
| 1335 | var template BSSMAP_IE_TMSI ret; |
| 1336 | if (ispresent(tmsi)) { |
| 1337 | ret := ts_BSSMAP_IE_TMSI(valueof(tmsi)); |
| 1338 | } else { |
| 1339 | ret := omit; |
| 1340 | } |
| 1341 | return ret; |
| 1342 | } |
| 1343 | |
| 1344 | template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits, |
| 1345 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
| 1346 | template OCT4 tmsi := omit, |
| 1347 | template BSSMAP_IE_ChannelNeeded chneed := omit) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1348 | modifies ts_BSSAP_BSSMAP := { |
| 1349 | pdu := { |
| 1350 | bssmap := { |
| 1351 | paging := { |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1352 | messageType := '52'O, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1353 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1354 | tMSI := f_tmsi_or_omit(tmsi), |
Neels Hofmeyr | 0ac6315 | 2019-05-07 01:20:17 +0200 | [diff] [blame] | 1355 | cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), |
Harald Welte | 72cecfa | 2017-12-11 19:50:14 +0100 | [diff] [blame] | 1356 | channelNeeded := chneed, |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1357 | eMLPP_Priority := omit, |
| 1358 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1359 | } |
| 1360 | } |
| 1361 | } |
| 1362 | } |
| 1363 | |
Harald Welte | 17d2115 | 2018-01-27 00:47:11 +0100 | [diff] [blame] | 1364 | template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, |
| 1365 | template OCT4 tmsi := *, |
| 1366 | template BSSMAP_IE_ChannelNeeded chneed := *) |
| 1367 | modifies tr_BSSAP_BSSMAP := { |
| 1368 | pdu := { |
| 1369 | bssmap := { |
| 1370 | paging := { |
| 1371 | messageType := '52'O, |
| 1372 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
| 1373 | tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, |
| 1374 | cellIdentifierList := ?, |
| 1375 | channelNeeded := chneed, |
| 1376 | eMLPP_Priority := omit, |
| 1377 | pagingInformation := omit /* only VGCS/VBS flag */ |
| 1378 | } |
| 1379 | } |
| 1380 | } |
| 1381 | } |
| 1382 | |
| 1383 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1384 | template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) |
| 1385 | modifies ts_BSSAP_BSSMAP := { |
| 1386 | pdu := { |
| 1387 | bssmap := { |
| 1388 | cipherModeCommand := { |
| 1389 | messageType := '53'O, |
| 1390 | layer3HeaderInfo := omit, |
| 1391 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1392 | cipherResponseMode := omit, |
| 1393 | kC128 := omit |
| 1394 | } |
| 1395 | } |
| 1396 | } |
| 1397 | } |
| 1398 | |
| 1399 | template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128) |
| 1400 | modifies ts_BSSAP_BSSMAP := { |
| 1401 | pdu := { |
| 1402 | bssmap := { |
| 1403 | cipherModeCommand := { |
| 1404 | messageType := '53'O, |
| 1405 | layer3HeaderInfo := omit, |
| 1406 | encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg), |
| 1407 | cipherResponseMode := omit, |
| 1408 | kC128 := { '83'O, kc128 } |
| 1409 | } |
| 1410 | } |
| 1411 | } |
| 1412 | } |
| 1413 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1414 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd2(template BSSMAP_IE_EncryptionInformation encryptionInformation := *, |
| 1415 | template BSSMAP_IE_KC128 kC128 := *) |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1416 | modifies tr_BSSAP_BSSMAP := { |
| 1417 | pdu := { |
| 1418 | bssmap := { |
| 1419 | cipherModeCommand := { |
| 1420 | messageType := '53'O, |
| 1421 | layer3HeaderInfo := *, |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1422 | encryptionInformation := encryptionInformation, |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1423 | cipherResponseMode := *, |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1424 | kC128 := kC128 |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1425 | } |
| 1426 | } |
| 1427 | } |
| 1428 | } |
| 1429 | |
Neels Hofmeyr | f7831cb | 2021-06-23 20:04:58 +0200 | [diff] [blame] | 1430 | template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key, template BSSMAP_IE_KC128 kC128 := omit) |
| 1431 | := tr_BSSMAP_CipherModeCmd2(tr_BSSMAP_IE_EncrInfo(key, alg), kC128); |
| 1432 | |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1433 | template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) |
| 1434 | modifies ts_BSSAP_BSSMAP := { |
| 1435 | pdu := { |
| 1436 | bssmap := { |
| 1437 | cipherModeComplete := { |
| 1438 | messageType := '55'O, |
| 1439 | layer3MessageContents := omit, |
| 1440 | chosenEncryptionAlgorithm := { |
| 1441 | elementIdentifier := '2C'O, |
| 1442 | algorithmIdentifier := alg |
| 1443 | } |
| 1444 | } |
| 1445 | } |
| 1446 | } |
| 1447 | } |
| 1448 | |
Stefan Sperling | a2d59c6 | 2018-12-18 16:32:44 +0100 | [diff] [blame] | 1449 | template PDU_BSSAP ts_BSSMAP_CipherModeComplAlg(template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := ?) |
| 1450 | modifies ts_BSSAP_BSSMAP := { |
| 1451 | pdu := { |
| 1452 | bssmap := { |
| 1453 | cipherModeComplete := { |
| 1454 | messageType := '55'O, |
| 1455 | layer3MessageContents := omit, |
| 1456 | chosenEncryptionAlgorithm := chosenEncryptionAlgorithm |
| 1457 | } |
| 1458 | } |
| 1459 | } |
| 1460 | } |
| 1461 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1462 | template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { |
| 1463 | pdu := { |
| 1464 | bssmap := { |
| 1465 | cipherModeComplete := { |
| 1466 | messageType := '55'O, |
| 1467 | layer3MessageContents := *, |
| 1468 | chosenEncryptionAlgorithm := { |
| 1469 | elementIdentifier := '2C'O, |
| 1470 | algorithmIdentifier := alg |
| 1471 | } |
| 1472 | } |
| 1473 | } |
| 1474 | } |
| 1475 | } |
| 1476 | |
| 1477 | template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := { |
| 1478 | pdu := { |
| 1479 | bssmap := { |
| 1480 | cipherModeReject := { |
| 1481 | messageType := '59'O, |
| 1482 | cause := ? |
| 1483 | } |
| 1484 | } |
| 1485 | } |
| 1486 | } |
| 1487 | |
Daniel Willmann | 52918e5 | 2018-09-20 14:39:09 +0200 | [diff] [blame] | 1488 | template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := { |
| 1489 | pdu := { |
| 1490 | bssmap := { |
| 1491 | classmarkRequest := { |
| 1492 | messageType := '58'O, |
| 1493 | talkerPriority := * |
| 1494 | } |
| 1495 | } |
| 1496 | } |
| 1497 | } |
| 1498 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1499 | template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { |
| 1500 | elementIdentifier := '12'O, |
| 1501 | lengthIndicator := 0, /* overwritten */ |
| 1502 | /* CM1 */ |
| 1503 | rf_PowerCapability := '010'B, /* class3 */ |
| 1504 | a5_1 := '0'B, /* supported */ |
| 1505 | esind := '1'B, /* early classmark supported */ |
| 1506 | revisionLevel := '10'B, /* R99 */ |
| 1507 | spare1_1 := '0'B, |
| 1508 | /* CM2 */ |
| 1509 | fc := '1'B, /* E-GSM support */ |
| 1510 | vgcs := '0'B, |
| 1511 | vbs := '0'B, |
| 1512 | sm_Capability := '1'B, |
| 1513 | ss_ScreenIndicator := '00'B, |
| 1514 | ps_Capability := '1'B, |
| 1515 | spare2_1 := '0'B, |
| 1516 | classmarkInformationType2_oct5 := { |
| 1517 | a5_2 := '0'B, /* not available */ |
| 1518 | a5_3 := '1'B, /* available */ |
| 1519 | cmsp := '0'B, /* not supported */ |
| 1520 | solsa := '0'B, /* not suported */ |
| 1521 | ucs2 := '0'B, /* GSM alphabet preferred */ |
| 1522 | lcsvacap := '0'B, /* not supported */ |
| 1523 | spare := '0'B, |
| 1524 | cm3 := '0'B /* no CM3 */ |
| 1525 | } |
| 1526 | } |
| 1527 | |
Eric Wild | 26f4a62 | 2021-05-17 15:27:05 +0200 | [diff] [blame] | 1528 | |
| 1529 | template BSSMAP_IE_ClassmarkInformationType3 ts_CM3_default := { |
| 1530 | elementIdentifier := '13'O, |
| 1531 | lengthIndicator := 0, /* overwritten */ |
| 1532 | classmark3ValuePart := '01'O /* A5/4 supported */ |
| 1533 | } |
| 1534 | |
Harald Welte | 5c2622c | 2018-01-21 20:45:20 +0100 | [diff] [blame] | 1535 | template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, |
| 1536 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) |
| 1537 | modifies ts_BSSAP_BSSMAP := { |
| 1538 | pdu := { |
| 1539 | bssmap := { |
| 1540 | classmarkUpdate := { |
| 1541 | messageType := '54'O, |
| 1542 | classmarkInformationType2 := cm2, |
| 1543 | classmarkInformationType3 := cm3, |
| 1544 | talkerPriority := omit |
| 1545 | } |
| 1546 | } |
| 1547 | } |
| 1548 | } |
| 1549 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1550 | template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, |
| 1551 | template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) |
| 1552 | modifies tr_BSSAP_BSSMAP := { |
| 1553 | pdu := { |
| 1554 | bssmap := { |
| 1555 | classmarkUpdate := { |
| 1556 | messageType := '54'O, |
| 1557 | classmarkInformationType2 := cm2, |
| 1558 | classmarkInformationType3 := cm3, |
| 1559 | talkerPriority := * |
| 1560 | } |
| 1561 | } |
| 1562 | } |
| 1563 | } |
| 1564 | |
Neels Hofmeyr | 92b12b7 | 2018-09-18 14:30:23 +0200 | [diff] [blame] | 1565 | template PDU_BSSAP ts_BSSMAP_ClassmarkRequest |
| 1566 | modifies ts_BSSAP_BSSMAP := { |
| 1567 | pdu := { |
| 1568 | bssmap := { |
| 1569 | classmarkRequest := { |
| 1570 | messageType := '58'O, |
| 1571 | talkerPriority := omit |
| 1572 | } |
| 1573 | } |
| 1574 | } |
| 1575 | } |
| 1576 | |
Eric Wild | 26f4a62 | 2021-05-17 15:27:05 +0200 | [diff] [blame] | 1577 | template PDU_BSSAP tr_BSSMAP_ClassmarkRequest |
| 1578 | modifies tr_BSSAP_BSSMAP := { |
| 1579 | pdu := { |
| 1580 | bssmap := { |
| 1581 | classmarkRequest := { |
| 1582 | messageType := '58'O, |
| 1583 | talkerPriority := * |
| 1584 | } |
| 1585 | } |
| 1586 | } |
| 1587 | } |
| 1588 | |
Harald Welte | 49518bf | 2018-02-10 11:39:19 +0100 | [diff] [blame] | 1589 | /* return Layer3 octetstring inside BSSAP PDU */ |
| 1590 | function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring { |
| 1591 | if (ischosen(bssap.pdu.bssmap)) { |
| 1592 | var PDU_BSSMAP bssmap := bssap.pdu.bssmap; |
| 1593 | if (ischosen(bssmap.completeLayer3Information)) { |
| 1594 | return bssmap.completeLayer3Information.layer3Information.layer3info; |
| 1595 | } else if (ischosen(bssmap.handoverRequestAck)) { |
| 1596 | return bssmap.handoverRequestAck.layer3Information.layer3info; |
| 1597 | } else if (ischosen(bssmap.handoverCommand)) { |
| 1598 | return bssmap.handoverCommand.layer3Information.layer3info; |
| 1599 | } else if (ischosen(bssmap.uplinkRequest)) { |
| 1600 | return bssmap.uplinkRequest.layer3Information.layer3info; |
| 1601 | } else if (ischosen(bssmap.uplinkRequestConfirmation)) { |
| 1602 | return bssmap.uplinkRequestConfirmation.layer3Information.layer3info; |
| 1603 | } else if (ischosen(bssmap.uplinkApplicationData)) { |
| 1604 | return bssmap.uplinkApplicationData.layer3Information.layer3info; |
| 1605 | } else if (ischosen(bssmap.rerouteCommand)) { |
| 1606 | return bssmap.rerouteCommand.initialLayer3Information.layer3info; |
| 1607 | } else { |
| 1608 | return omit; |
| 1609 | } |
| 1610 | } else { |
| 1611 | return bssap.pdu.dtap; |
| 1612 | } |
| 1613 | } |
| 1614 | |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1615 | /* TS 29.205 B.2.1.9 */ |
| 1616 | template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := { |
| 1617 | networkIDLengthIndicator := 0, /* overwritten */ |
| 1618 | networkID := net_id, |
| 1619 | nodeIDLengthIndicator := 0, /* overwritten */ |
| 1620 | nodeID := node_id, |
| 1621 | callReferenceIDLengthIndicator := 0, /* overwritten */ |
| 1622 | callReferenceID := cref_id |
| 1623 | } |
| 1624 | template GlobalCallReferenceValue tr_GCR(template octetstring net_id, |
| 1625 | template OCT2 node_id, |
| 1626 | template OCT5 cref_id) := { |
| 1627 | networkIDLengthIndicator := ?, |
| 1628 | networkID := net_id, |
| 1629 | nodeIDLengthIndicator := ?, |
| 1630 | nodeID := node_id, |
| 1631 | callReferenceIDLengthIndicator := ?, |
| 1632 | callReferenceID := cref_id |
| 1633 | } |
| 1634 | |
| 1635 | /* TS 47.008 3.2.2.115 */ |
| 1636 | template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := { |
| 1637 | elementIdentifier := '89'O, |
| 1638 | lengthIndicator := 0, /* overwritten */ |
| 1639 | globalCallReferenceValue := gcr |
| 1640 | } |
| 1641 | template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := { |
| 1642 | elementIdentifier := '89'O, |
| 1643 | lengthIndicator := ?, |
| 1644 | globalCallReferenceValue := gcr |
| 1645 | } |
| 1646 | |
| 1647 | /* TS 48.008 3.2.2.116 */ |
| 1648 | const BIT4 LCLS_CFG_both_way := '0000'B; |
| 1649 | const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B; |
| 1650 | const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B; |
| 1651 | const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B; |
| 1652 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B; |
| 1653 | const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B; |
| 1654 | |
| 1655 | template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := { |
| 1656 | elementIdentifier := '8A'O, |
| 1657 | lCLS_ConfigurationValue := cfg_val, |
| 1658 | spare := '0000'B |
| 1659 | } |
| 1660 | template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := { |
| 1661 | elementIdentifier := '8A'O, |
| 1662 | lCLS_ConfigurationValue := cfg_val, |
| 1663 | spare := '0000'B |
| 1664 | } |
| 1665 | |
| 1666 | /* TS 48.008 3.2.2.117 */ |
| 1667 | const BIT4 LCLS_CSC_connect := '0000'B; |
| 1668 | const BIT4 LCLS_CSC_do_not_connect := '0001'B; |
| 1669 | const BIT4 LCLS_CSC_release_lcls := '0010'B; |
| 1670 | const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B; |
| 1671 | const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B; |
| 1672 | |
| 1673 | template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := { |
| 1674 | elementIdentifier := '8B'O, |
| 1675 | lCLS_ConnectionStatusControlValue := csc, |
| 1676 | spare := '0000'B |
| 1677 | } |
| 1678 | template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := { |
| 1679 | elementIdentifier := '8B'O, |
| 1680 | lCLS_ConnectionStatusControlValue := csc, |
| 1681 | spare := '0000'B |
| 1682 | } |
| 1683 | |
| 1684 | /* TS 48.008 3.2.2.119 */ |
| 1685 | const BIT4 LCLS_STS_not_yet_ls := '0000'B; |
| 1686 | const BIT4 LCLS_STS_not_possible_ls := '0001'B; |
| 1687 | const BIT4 LCLS_STS_no_longer_ls := '0010'B; |
| 1688 | const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B; |
| 1689 | const BIT4 LCLS_STS_locally_switched := '0100'B; |
| 1690 | |
| 1691 | template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := { |
| 1692 | elementIdentifier := '8D'O, |
| 1693 | lCLS_BSS_StatusValue := sts, |
| 1694 | spare := '0000'B |
| 1695 | } |
| 1696 | template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := { |
| 1697 | elementIdentifier := '8D'O, |
| 1698 | lCLS_BSS_StatusValue := sts, |
| 1699 | spare := '0000'B |
| 1700 | } |
| 1701 | |
| 1702 | /* TS 48.008 3.2.1.91 */ |
| 1703 | 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] | 1704 | template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1705 | pdu := { |
| 1706 | bssmap := { |
| 1707 | lCLS_ConnectControl := { |
| 1708 | messageType := '74'O, |
| 1709 | lCLS_Configuration := cfg, |
| 1710 | lCLS_ConnectionStatusControl := csc |
| 1711 | } |
| 1712 | } |
| 1713 | } |
| 1714 | } |
| 1715 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg, |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1716 | template BSSMAP_IE_LCLS_ConnectionStatusControl csc) |
| 1717 | modifies tr_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 | |
| 1729 | /* TS 48.008 3.2.1.92 */ |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1730 | template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts) |
| 1731 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1732 | pdu := { |
| 1733 | bssmap := { |
| 1734 | lCLS_connectControlAck := { |
| 1735 | messageType := '75'O, |
| 1736 | lCLS_BSS_Status := sts |
| 1737 | } |
| 1738 | } |
| 1739 | } |
| 1740 | } |
Harald Welte | 354722e | 2018-06-01 13:15:32 +0200 | [diff] [blame] | 1741 | template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts) |
| 1742 | modifies tr_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1743 | pdu := { |
| 1744 | bssmap := { |
| 1745 | lCLS_connectControlAck := { |
| 1746 | messageType := '75'O, |
| 1747 | lCLS_BSS_Status := sts |
| 1748 | } |
| 1749 | } |
| 1750 | } |
| 1751 | } |
| 1752 | |
| 1753 | /* TS 48.008 3.2.1.93 */ |
| 1754 | 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] | 1755 | template (omit) BSSMAP_IE_LCLS_BreakRequest brq) |
| 1756 | modifies ts_BSSAP_BSSMAP := { |
Harald Welte | 0b50aed | 2018-05-28 22:33:07 +0200 | [diff] [blame] | 1757 | pdu := { |
| 1758 | bssmap := { |
| 1759 | lCLS_Notification := { |
| 1760 | messageType := '76'O, |
| 1761 | lCLS_BSS_Status := sts, |
| 1762 | lCLS_BreakRequest := brq |
| 1763 | } |
| 1764 | } |
| 1765 | } |
| 1766 | } |
| 1767 | 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] | 1768 | template BSSMAP_IE_LCLS_BreakRequest brq) |
| 1769 | modifies tr_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 | |
Harald Welte | cc0b014 | 2018-05-29 15:19:33 +0200 | [diff] [blame] | 1781 | template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts) |
| 1782 | modifies tr_BSSAP_BSSMAP := { |
| 1783 | pdu := { |
| 1784 | bssmap := { |
| 1785 | lCLS_Notification := { |
| 1786 | messageType := '76'O, |
| 1787 | lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts), |
| 1788 | lCLS_BreakRequest := omit |
| 1789 | } |
| 1790 | } |
| 1791 | } |
| 1792 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1793 | |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1794 | template PDU_BSSAP ts_BSSMAP_CommonId(hexstring imsi_digits, |
| 1795 | template (omit) OCT3 last_eutran_plmn := omit) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1796 | modifies ts_BSSAP_BSSMAP := { |
| 1797 | pdu := { |
| 1798 | bssmap := { |
| 1799 | commonID := { |
| 1800 | messageType := '2F'O, |
| 1801 | iMSI := ts_BSSMAP_Imsi(imsi_digits), |
Pau Espin Pedrol | d5ba6ce | 2021-04-15 14:18:13 +0200 | [diff] [blame] | 1802 | sNAAccessInformation := omit, |
| 1803 | selectedPLMNId := omit, |
Pau Espin Pedrol | ee8cec8 | 2021-04-15 14:39:05 +0200 | [diff] [blame] | 1804 | lastUsedEUTRANPLMNId := f_ts_BSSMAP_LastUsedEUTRANPLMNId(last_eutran_plmn) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1805 | } |
| 1806 | } |
| 1807 | } |
| 1808 | } |
| 1809 | |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1810 | template PDU_BSSAP tr_BSSMAP_CommonId(template hexstring imsi_digits, |
| 1811 | template BSSAMAP_IE_LastUsedEUTRANPLMNId lastUsedEUTRANPLMNId := *) |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1812 | modifies tr_BSSAP_BSSMAP := { |
| 1813 | pdu := { |
| 1814 | bssmap := { |
| 1815 | commonID := { |
| 1816 | messageType := '2F'O, |
| 1817 | iMSI := tr_BSSMAP_Imsi(imsi_digits), |
Pau Espin Pedrol | e979c40 | 2021-04-28 17:29:54 +0200 | [diff] [blame] | 1818 | sNAAccessInformation := *, |
| 1819 | selectedPLMNId := *, |
| 1820 | lastUsedEUTRANPLMNId := lastUsedEUTRANPLMNId |
Harald Welte | eddf0e9 | 2020-06-21 19:42:15 +0200 | [diff] [blame] | 1821 | } |
| 1822 | } |
| 1823 | } |
| 1824 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1825 | |
Vadim Yanitskiy | 4806396 | 2020-08-28 07:49:44 +0700 | [diff] [blame] | 1826 | template PDU_BSSAP tr_BSSMAP_SAPInReject(template (present) GsmSapi sapi := ?, |
| 1827 | template BSSMAP_IE_Cause cause := ?) |
| 1828 | modifies tr_BSSAP_BSSMAP := { |
| 1829 | pdu := { |
| 1830 | bssmap := { |
| 1831 | sAPInReject := { |
| 1832 | messageType := '25'O, |
| 1833 | dLCI := { |
| 1834 | elementIdentifier := '18'O, |
| 1835 | sapiValue := f_tr_SAPI(sapi), |
| 1836 | spare := ?, |
| 1837 | c1 := ?, c2 := ? |
| 1838 | }, |
| 1839 | cause := cause |
| 1840 | } |
| 1841 | } |
| 1842 | } |
| 1843 | } |
| 1844 | |
| 1845 | private function f_tr_SAPI(template (present) GsmSapi sapi) |
| 1846 | return template (present) BIT3 { |
| 1847 | if (istemplatekind(sapi, "?")) { |
| 1848 | return ?; |
| 1849 | } else { |
| 1850 | return int2bit(valueof(sapi), 3); |
| 1851 | } |
| 1852 | } |
| 1853 | |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1854 | template (value) BSSMAP_IE_LocationType ts_BSSMAP_IE_LocationType |
| 1855 | := { |
| 1856 | elementIdentifier := '44'O, |
| 1857 | lengthIndicator := 1, |
| 1858 | locationInformation := '00'O, |
| 1859 | positioningMethod := omit |
| 1860 | } |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1861 | |
Neels Hofmeyr | e52bc2d | 2020-10-01 06:39:10 +0200 | [diff] [blame] | 1862 | template (value) PDU_BSSAP ts_BSSMAP_Perform_Location_Request(template (omit) BSSMAP_IE_IMSI imsi, |
| 1863 | template (omit) BSSMAP_IE_CellIdentifier cellIdentifier := omit |
| 1864 | ) |
| 1865 | modifies ts_BSSAP_BSSMAP := { |
| 1866 | pdu := { |
| 1867 | bssmap := { |
| 1868 | performLocationRequest := { |
| 1869 | messageType := '2B'O, |
| 1870 | locationType := ts_BSSMAP_IE_LocationType, |
| 1871 | cellIdentifier := cellIdentifier, |
| 1872 | classmarkInformationType3 := omit, |
| 1873 | lCS_ClientType := omit, |
| 1874 | chosenChannel := omit, |
| 1875 | lCS_Priority := omit, |
| 1876 | lCS_QOS := omit, |
| 1877 | gPS_AssistanceData := omit, |
| 1878 | aPDU := omit, |
| 1879 | iMSI := imsi, |
| 1880 | iMEI := omit, |
| 1881 | gANSS_LocationType := omit, |
| 1882 | gANSS_AssistanceData := omit |
| 1883 | } |
| 1884 | } |
| 1885 | } |
| 1886 | } |
| 1887 | |
| 1888 | template (present) BSSMAP_IE_LocationEstimate tr_BSSMAP_IE_LocationEstimate(template (present) octetstring geo_loc := ?) |
| 1889 | := { |
| 1890 | elementIdentifier := '45'O, |
| 1891 | lengthIndicator := ?, |
| 1892 | geographicLocation := geo_loc |
| 1893 | } |
| 1894 | |
| 1895 | function tr_BSSMAP_LcsCause(template (present) BSSMAP_LcsCause cause) |
| 1896 | return template (omit) BSSMAP_IE_LCSCause { |
| 1897 | if (istemplatekind(cause, "omit")) { |
| 1898 | return omit; |
| 1899 | } |
| 1900 | var template BSSMAP_IE_LCSCause ie := { |
| 1901 | elementIdentifier := '47'O, |
| 1902 | lengthIndicator := 1, |
| 1903 | causeValue := int2bit(enum2int(valueof(cause)), 8), |
| 1904 | diagnosticValue := omit |
| 1905 | } |
| 1906 | return ie; |
| 1907 | } |
| 1908 | |
| 1909 | template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Response( |
| 1910 | template BSSMAP_IE_LocationEstimate locationEstimate := *, |
| 1911 | template BSSMAP_IE_PositioningData positioningData := *, |
| 1912 | template BSSMAP_IE_LCSCause lCS_Cause := * |
| 1913 | ) |
| 1914 | modifies tr_BSSAP_BSSMAP := { |
| 1915 | pdu := { |
| 1916 | bssmap := { |
| 1917 | performLocationResponse := { |
| 1918 | messageType := '2D'O, |
| 1919 | locationEstimate := locationEstimate, |
| 1920 | positioningData := positioningData, |
| 1921 | decipheringKeys := *, |
| 1922 | lCS_Cause := lCS_Cause, |
| 1923 | velocityEstimate := *, |
| 1924 | gANSS_PositioningData := * |
| 1925 | } |
| 1926 | } |
| 1927 | } |
| 1928 | } |
| 1929 | |
| 1930 | template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Abort(template (present) BSSMAP_IE_LCSCause lCS_Cause := ?) |
| 1931 | modifies tr_BSSAP_BSSMAP := { |
| 1932 | pdu := { |
| 1933 | bssmap := { |
| 1934 | performLocationAbort := { |
| 1935 | messageType := '2E'O, |
| 1936 | lCS_Cause := lCS_Cause |
| 1937 | } |
| 1938 | } |
| 1939 | } |
| 1940 | } |
Harald Welte | c859df5 | 2017-11-24 23:41:41 +0100 | [diff] [blame] | 1941 | |
Harald Welte | b69533d | 2017-12-15 13:55:17 +0100 | [diff] [blame] | 1942 | } with { encode "RAW" }; |