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