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