blob: a93fb0258a2e0c76d849495cd65ea0ffb317e87e [file] [log] [blame]
Harald Weltec76f29f2017-11-22 12:46:46 +01001module BSSMAP_Templates {
2
Harald Welte35bb7162018-01-03 21:07:52 +01003/* BSSMAP Templates, building on top of BSSAP_Types from Ericsson.
4 *
Harald Welte44d055f2023-04-17 09:18:55 +08005 * (C) 2017-2023 by Harald Welte <laforge@gnumonks.org>
Harald Welte34b5a952019-05-27 11:54:11 +02006 * contributions by sysmocom - s.f.m.c. GmbH
Harald Welte35bb7162018-01-03 21:07:52 +01007 * 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 Welte34b5a952019-05-27 11:54:11 +020011 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010013 */
14
Harald Weltec76f29f2017-11-22 12:46:46 +010015import from General_Types all;
16import from Osmocom_Types all;
Pau Espin Pedrol6a846bc2020-09-04 13:01:22 +020017import from Native_Functions all;
18import from Misc_Helpers all;
Harald Welte72cecfa2017-12-11 19:50:14 +010019import from GSM_Types all;
Harald Weltec76f29f2017-11-22 12:46:46 +010020import from BSSAP_Types all;
21
22type integer BssmapCause;
Philipp Maier34bd80e2018-03-27 14:28:52 +020023type integer SpeechVersion;
24type integer Channel;
25type integer ChannelMode;
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +020026//type octetstring BSSMAP_oldToNewBSSIEs;
27
28// Old BSS to New BSS Information - 48.008 subclause 3.2.2.58
29type record BSSMAP_oldToNewBSSIEs
30{
31 BSSAMAP_IE_LastUsedEUTRANPLMNId LastUsedEUTRANPLMNId optional
32 /* TODO: add other FIELDS here from specs */
33}
34external function enc_BSSMAP_oldToNewBSSIEs(in BSSMAP_oldToNewBSSIEs val) return octetstring
35 with { extension "prototype(convert) encode(RAW)" };
Harald Weltec76f29f2017-11-22 12:46:46 +010036
Harald Welteb69533d2017-12-15 13:55:17 +010037/* 48.008 3.2.2.5 - this actually belongs to BSSAP_Types.ttcn */
38type 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 Smithdd002752023-02-21 13:35:00 +0100115/* 3GPP TS 48.008 3.2.2.11 Channel Type
116 * Transparent: Data Rate */
117const OCT1 GSM0808_DATA_RATE_TRANSP_32k0 := ('3a'O);
118const OCT1 GSM0808_DATA_RATE_TRANSP_28k8 := ('39'O);
119const OCT1 GSM0808_DATA_RATE_TRANSP_14k4 := ('18'O);
120const OCT1 GSM0808_DATA_RATE_TRANSP_9k6 := ('10'O);
121const OCT1 GSM0808_DATA_RATE_TRANSP_4k8 := ('11'O);
122const OCT1 GSM0808_DATA_RATE_TRANSP_2k4 := ('12'O);
123const OCT1 GSM0808_DATA_RATE_TRANSP_1k2 := ('13'O);
124const OCT1 GSM0808_DATA_RATE_TRANSP_600 := ('14'O);
125const 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) */
129const OCT1 GSM0808_DATA_RATE_NON_TRANSP_12000_6000 := ('00'O);
130const OCT1 GSM0808_DATA_RATE_NON_TRANSP_43k5 := ('34'O);
131const OCT1 GSM0808_DATA_RATE_NON_TRANSP_29k0 := ('31'O);
132const OCT1 GSM0808_DATA_RATE_NON_TRANSP_14k5 := ('14'O);
133const OCT1 GSM0808_DATA_RATE_NON_TRANSP_12k0 := ('10'O);
134const 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) */
138const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_43k5 := ('40'O);
139const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_32k0 := ('20'O);
140const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_29k0 := ('10'O);
141const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_14k5 := ('08'O);
142const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_12k0 := ('02'O);
143const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_6k0 := ('01'O);
144
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +0200145type 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 Weltec76f29f2017-11-22 12:46:46 +0100164template PDU_BSSAP ts_BSSAP_BSSMAP := {
165 discriminator := '0'B,
166 spare := '0000000'B,
167 dlci := omit,
168 lengthIndicator := 0, /* overwritten by codec */
Harald Welteb3414b22017-11-23 18:22:10 +0100169 pdu := {
170 bssmap := ?
171 }
Harald Weltec76f29f2017-11-22 12:46:46 +0100172}
173
174template PDU_BSSAP tr_BSSAP_BSSMAP := {
175 discriminator := '0'B,
176 spare := '0000000'B,
Harald Welte049ca642018-01-21 13:54:34 +0100177 dlci := *,
Harald Weltec76f29f2017-11-22 12:46:46 +0100178 lengthIndicator := ?,
179 pdu := {
180 bssmap := ?
181 }
182}
183
Harald Welte0a6835c2018-01-21 13:56:01 +0100184template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := {
Harald Welteb3414b22017-11-23 18:22:10 +0100185 discriminator := '1'B,
186 spare := '0000000'B,
Harald Welte0a6835c2018-01-21 13:56:01 +0100187 dlci := dlci,
Harald Welteb3414b22017-11-23 18:22:10 +0100188 lengthIndicator := 0, /* overwritten by codec */
189 pdu := {
Harald Welte0a6835c2018-01-21 13:56:01 +0100190 dtap := dtap
Harald Welteb3414b22017-11-23 18:22:10 +0100191 }
192}
193
194template PDU_BSSAP tr_BSSAP_DTAP := {
195 discriminator := '1'B,
196 spare := '0000000'B,
Harald Welte049ca642018-01-21 13:54:34 +0100197 dlci := *,
Harald Welteb3414b22017-11-23 18:22:10 +0100198 lengthIndicator := ?,
199 pdu := {
200 dtap := ?
201 }
202}
203
Harald Weltec76f29f2017-11-22 12:46:46 +0100204template (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 Yanitskiy48063962020-08-28 07:49:44 +0700211template 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}
218private function f_tr_causeValue(template (present) myBSSMAP_Cause val)
219return 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 Weltec76f29f2017-11-22 12:46:46 +0100227
Philipp Maier34bd80e2018-03-27 14:28:52 +0200228template (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
234template (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 Pedrolc08d5522021-04-16 15:40:38 +0200240template (value) BSSMAP_oldToNewBSSIEs ts_BSSMAP_oldToNewBSSIEs(template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId last_used_eutran_plmn) := {
241 LastUsedEUTRANPLMNId := last_used_eutran_plmn
242}
243function 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}
251template (value) BSSMAP_IE_OldToNewBSSInfo ts_BSSMAP_IE_OldToNewBSSInfo(template (value) BSSMAP_oldToNewBSSIEs val) := {
Philipp Maier34bd80e2018-03-27 14:28:52 +0200252 elementIdentifier := '3A'O,
253 lengthIndicator := 0, /* overwritten by codec */
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +0200254 oldToNewBSSIEs := enc_BSSMAP_oldToNewBSSIEs(valueof(val))
255}
256function 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 Maier34bd80e2018-03-27 14:28:52 +0200263}
264
Pau Espin Pedrol35801c32021-04-19 13:03:20 +0200265template 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}
270function 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 Welte420c6b02020-08-21 11:54:30 +0200283template (value) BSSMAP_IE_Osmo_OsmuxSupport tr_BSSMAP_IE_Osmo_OsmuxSupport := {
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200284 elementIdentifier := 'F0'O
285}
286
Harald Welte420c6b02020-08-21 11:54:30 +0200287private function f_enc_osmux_support(boolean osmux_enabled) return template (omit) BSSMAP_IE_Osmo_OsmuxSupport {
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200288 if (osmux_enabled) {
289 return tr_BSSMAP_IE_Osmo_OsmuxSupport;
290 }
291 return omit;
292}
293
294template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause, boolean osmux_enabled := false) modifies ts_BSSAP_BSSMAP := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100295 pdu := {
296 bssmap := {
297 reset := {
298 messageType := '30'O,
299 cause := ts_BSSMAP_IE_Cause(cause),
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200300 a_InterfaceSelectorForReset := omit,
301 osmuxSupport := f_enc_osmux_support(osmux_enabled)
Harald Weltec76f29f2017-11-22 12:46:46 +0100302 }
303 }
304 }
305}
306
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200307template PDU_BSSAP tr_BSSMAP_Reset(boolean osmux_enabled := false) modifies tr_BSSAP_BSSMAP := {
Harald Welte365f4ed2017-11-23 00:00:43 +0100308 pdu := {
309 bssmap := {
310 reset := {
311 messageType := '30'O,
312 cause := ?,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200313 a_InterfaceSelectorForReset := *,
314 osmuxSupport := f_enc_osmux_support(osmux_enabled)
Harald Welte365f4ed2017-11-23 00:00:43 +0100315 }
316 }
317 }
318}
319
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200320template (value) PDU_BSSAP ts_BSSMAP_ResetAck(boolean osmux_enabled := false) modifies ts_BSSAP_BSSMAP := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100321 pdu := {
322 bssmap := {
323 resetAck := {
324 messageType := '31'O,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200325 a_InterfaceSelectorForReset := omit,
326 osmuxSupport := f_enc_osmux_support(osmux_enabled)
Harald Weltec76f29f2017-11-22 12:46:46 +0100327 }
328 }
329 }
330}
331
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200332template PDU_BSSAP tr_BSSMAP_ResetAck(boolean osmux_enabled := false) modifies tr_BSSAP_BSSMAP := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100333 pdu := {
334 bssmap := {
335 resetAck := {
336 messageType := '31'O,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200337 a_InterfaceSelectorForReset := *,
338 osmuxSupport := f_enc_osmux_support(osmux_enabled)
Harald Weltec76f29f2017-11-22 12:46:46 +0100339 }
340 }
341 }
342}
343
344template 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
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200352template BSSMAP_IE_CellIdentifier tr_BSSMAP_IE_CellID := {
353 elementIdentifier := '05'O,
354 lengthIndicator := ?,
355 cellIdentifierDiscriminator := ?,
356 spare1_4 := '0000'B,
357 cellIdentification := ?
358}
359
Harald Weltec76f29f2017-11-22 12:46:46 +0100360type uint16_t BssmapLAC;
361type uint16_t BssmapCI;
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100362type uint16_t BssmapSAC;
Harald Weltec76f29f2017-11-22 12:46:46 +0100363
Harald Welteae8ce232018-01-21 13:56:46 +0100364template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100365modifies ts_BSSMAP_IE_CellID := {
366 cellIdentification := {
Harald Welteae8ce232018-01-21 13:56:46 +0100367 cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100368 }
369}
Harald Weltec76f29f2017-11-22 12:46:46 +0100370
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200371template (present) BSSMAP_IE_CellIdentifier tr_CellId_CGI(template (present) OCT3 mcc_mnc,
372 template (present) BssmapLAC lac,
373 template (present) BssmapCI ci)
374modifies tr_BSSMAP_IE_CellID := {
375 cellIdentification := {
376 cI_CGI := tr_BSSMAP_CI_CGI(mcc_mnc, lac, ci)
377 }
378}
379
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100380template (value) BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100381modifies ts_BSSMAP_IE_CellID := {
382 cellIdentification := {
383 cI_LAC_CI := {
384 lac := int2oct(lac, 2),
385 ci := int2oct(ci, 2)
386 }
387 }
388}
389
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200390template (present) BSSMAP_IE_CellIdentifier tr_CellID_LAC_CI(template (present) BssmapLAC lac,
391 template (present) BssmapCI ci)
392modifies tr_BSSMAP_IE_CellID := {
393 cellIdentification := {
394 cI_LAC_CI := {
395 lac := f_tr_LAC(lac),
396 ci := f_tr_CI(ci)
397 }
398 }
399}
400
Harald Weltec76f29f2017-11-22 12:46:46 +0100401template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci)
402modifies ts_BSSMAP_IE_CellID := {
403 cellIdentification := {
404 cI_CI := int2oct(ci, 2)
405 }
406}
407
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200408template (present) BSSMAP_IE_CellIdentifier tr_CellId_CI(template (present) BssmapCI ci)
409modifies tr_BSSMAP_IE_CellID := {
410 cellIdentification := {
411 cI_CI := f_tr_CI(ci)
412 }
413}
414
Harald Weltec76f29f2017-11-22 12:46:46 +0100415template BSSMAP_IE_CellIdentifier ts_CellId_none
416modifies ts_BSSMAP_IE_CellID := {
417 cellIdentification := {
418 cI_noCell := ''O
419 }
420}
421
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200422template BSSMAP_IE_CellIdentifier tr_CellId_none
423modifies tr_BSSMAP_IE_CellID := {
424 cellIdentification := {
425 cI_noCell := ''O
426 }
427}
428
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100429template (value) BSSMAP_IE_CellIdentifier ts_CellID_SAI(OCT3 mcc_mnc, BssmapLAC lac, BssmapSAC sac)
430modifies ts_BSSMAP_IE_CellID := {
431 cellIdentification := {
432 cI_SAI := {
433 mcc_mnc := mcc_mnc,
434 lac := int2oct(lac, 2),
435 sac := int2oct(sac, 2)
436 }
437 }
438}
439
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +0200440template (present) BSSMAP_IE_CellIdentifier tr_CellID_SAI(template (present) OCT3 mcc_mnc,
441 template (present) BssmapLAC lac,
442 template (present) BssmapSAC sac)
443modifies tr_BSSMAP_IE_CellID := {
444 cellIdentification := {
445 cI_SAI := {
446 mcc_mnc := mcc_mnc,
447 lac := f_tr_LAC(lac),
448 sac := f_tr_SAC(sac)
449 }
450 }
451}
452
453private function f_tr_LAC(template (present) BssmapLAC lac)
454return template (present) OCT2 {
455 if (istemplatekind(lac, "?")) {
456 return ?;
457 } else {
458 return int2oct(valueof(lac), 2);
459 }
460}
461
462private function f_tr_SAC(template (present) BssmapSAC sac)
463return template (present) OCT2 {
464 if (istemplatekind(sac, "?")) {
465 return ?;
466 } else {
467 return int2oct(valueof(sac), 2);
468 }
469}
470
471private function f_tr_CI(template (present) BssmapCI ci)
472return template (present) OCT2 {
473 if (istemplatekind(ci, "?")) {
474 return ?;
475 } else {
476 return int2oct(valueof(ci), 2);
477 }
478}
479
Harald Weltec76f29f2017-11-22 12:46:46 +0100480
Harald Welte44d055f2023-04-17 09:18:55 +0800481template (value) BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(template (value) octetstring l3info) := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100482 elementIdentifier := '17'O,
483 lengthIndicator := 0,
484 layer3info := l3info
485}
486
Harald Welte44d055f2023-04-17 09:18:55 +0800487template (present) BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template (present) octetstring l3info) := {
Harald Weltef8a0bda2017-12-09 00:53:17 +0100488 elementIdentifier := '17'O,
489 lengthIndicator := ?,
490 layer3info := l3info
491}
492
493
Harald Weltec76f29f2017-11-22 12:46:46 +0100494template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info)
495modifies ts_BSSAP_BSSMAP := {
496 pdu := {
497 bssmap := {
498 completeLayer3Information := {
499 messageType := '57'O,
500 cellIdentifier := cell_id,
501 layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
502 chosenChannel := omit,
503 lSAIdentifier := omit,
504 aPDU := omit,
505 codecList := omit,
506 redirectAttemptFlag := omit,
507 sendSequenceNumber := omit,
508 iMSI := omit
509 }
510 }
511 }
512}
513
Harald Weltef8a0bda2017-12-09 00:53:17 +0100514template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?,
Vadim Yanitskiya47cd4e2021-12-04 20:05:04 +0300515 template BSSMAP_IE_CellIdentifier cell_id := ?,
516 template BSSMAP_IE_SpeechCodecList codec_list := *)
Harald Weltef8a0bda2017-12-09 00:53:17 +0100517modifies tr_BSSAP_BSSMAP := {
Harald Welte365f4ed2017-11-23 00:00:43 +0100518 pdu := {
519 bssmap := {
Harald Weltef8a0bda2017-12-09 00:53:17 +0100520 completeLayer3Information := {
521 messageType := '57'O,
522 cellIdentifier := cell_id,
523 layer3Information := tr_BSSMAP_IE_L3Info(l3_info),
524 chosenChannel := *,
525 lSAIdentifier := *,
526 aPDU := *,
Vadim Yanitskiya47cd4e2021-12-04 20:05:04 +0300527 codecList := codec_list,
Harald Weltef8a0bda2017-12-09 00:53:17 +0100528 redirectAttemptFlag := *,
529 sendSequenceNumber := *,
530 iMSI := *
531 }
Harald Welte365f4ed2017-11-23 00:00:43 +0100532 }
533 }
534}
535
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200536template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(template BSSMAP_FIELD_CellIdentificationList cid_list) := {
Harald Welte28d943e2017-11-25 15:00:50 +0100537 elementIdentifier := '1A'O,
538 lengthIndicator := 0, /* overwritten */
539 cellIdentifierDiscriminator := '0000'B, /* overwritten */
540 spare1_4 := '0000'B,
541 cellIdentificationList := cid_list
542}
Harald Welte365f4ed2017-11-23 00:00:43 +0100543
Harald Welte4bf5fc92017-12-15 13:56:06 +0100544const OCT1 ChRate_ANY := '00'O;
Harald Welte365f4ed2017-11-23 00:00:43 +0100545const OCT1 ChRate_TCHF := '08'O;
546const OCT1 ChRate_TCHH := '09'O;
Harald Welte4bf5fc92017-12-15 13:56:06 +0100547const OCT1 ChRate_TCHForH_Fpref := '0A'O;
548const OCT1 ChRate_TCHForH_Hpref := '0B'O;
549const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O;
550const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O;
551const OCT1 ChRate_TCHForH := '0F'O;
552const OCT1 ChRate_TCHForH_nochg := '1F'O;
Harald Welte365f4ed2017-11-23 00:00:43 +0100553
Harald Weltedbd6b3f2018-03-21 18:45:02 +0100554const OCT1 Spdi_TCHF_FR := '01'O;
555const OCT1 Spdi_TCHF_EFR := '11'O;
556const OCT1 Spdi_TCHF_AMR := '21'O;
557const OCT1 Spdi_TCHH_HR := '05'O;
558const OCT1 Spdi_TCHH_AMR := '25'O;
559
Harald Welte365f4ed2017-11-23 00:00:43 +0100560template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := {
561 elementIdentifier := '0B'O, /* overwritten */
562 lengthIndicator := 0, /* overwritten */
563 speechOrDataIndicator := '0001'B, /* speech */
564 spare1_4 := '0000'B,
565 channelRateAndType := ChRate_TCHF,
Harald Weltedbd6b3f2018-03-21 18:45:02 +0100566 speechId_DataIndicator := Spdi_TCHF_FR
Harald Welte365f4ed2017-11-23 00:00:43 +0100567}
568
Andreas Eversberg466d2db2023-05-17 15:05:08 +0200569template (present) BSSMAP_IE_ChannelType tr_BSSMAP_IE_ChannelType(template (present) BIT4 speech_data_ind,
570 template (present) OCT1 chan_rate_type,
571 template (present) octetstring speech_id) := {
572 elementIdentifier := '0B'O,
573 lengthIndicator := ?,
574 speechOrDataIndicator := speech_data_ind,
575 spare1_4 := '0000'B,
576 channelRateAndType := chan_rate_type,
577 speechId_DataIndicator := speech_id
578}
579
Harald Welte4bf5fc92017-12-15 13:56:06 +0100580template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := {
581 speechOrDataIndicator := '0100'B /* speech + CTM */
582}
583
584template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := {
585 elementIdentifier := '0B'O, /* overwritten */
586 lengthIndicator := 0, /* overwritten */
587 speechOrDataIndicator := '0010'B, /* data */
588 spare1_4 := '0000'B,
589 channelRateAndType := ChRate_TCHF,
590 speechId_DataIndicator := '10'O /* 9600 bps / transparent */
591}
592
593template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := {
594 elementIdentifier := '0B'O, /* overwritten */
595 lengthIndicator := 0, /* overwritten */
596 speechOrDataIndicator := '0011'B, /* data */
597 spare1_4 := '0000'B,
598 channelRateAndType := ChRate_ANY,
599 speechId_DataIndicator := '00'O /* spare */
600}
601
602template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := {
603 elementIdentifier := '0A'O,
604 lengthIndicator := 0, /* overwritten */
605 permittedAlgorithms := algs,
606 key := kc
607}
608
Harald Welte16114282018-01-24 22:41:21 +0100609template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := {
610 elementIdentifier := '0A'O,
611 lengthIndicator := ?, /* overwritten */
612 permittedAlgorithms := algs,
613 key := kc
614}
615
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +0200616template BSSMAP_IE_ChosenEncryptionAlgorithm ts_BSSMAP_IE_ChosenEncryptionAlgorithm(OCT1 algorithmIdentifier) := {
617 elementIdentifier := '2C'O,
618 algorithmIdentifier := algorithmIdentifier
619}
Harald Welte16114282018-01-24 22:41:21 +0100620
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +0200621template BSSMAP_IE_ChosenEncryptionAlgorithm tr_BSSMAP_IE_ChosenEncryptionAlgorithm(template OCT1 algorithmIdentifier := ?) := {
622 elementIdentifier := '2C'O,
623 algorithmIdentifier := algorithmIdentifier
624}
Harald Welte4bf5fc92017-12-15 13:56:06 +0100625
Harald Welte365f4ed2017-11-23 00:00:43 +0100626template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := {
627 elementIdentifier := '01'O, /* overwritten */
628 cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)),
629 cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5))
630}
631
Pau Espin Pedrol43021cb2019-06-18 17:32:15 +0200632function f_bssmap_ie_cic_2_int(BSSMAP_IE_CircuitIdentityCode cic_ie) return integer {
633 var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow);
634 return cic;
635}
636
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100637template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr,
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100638 uint16_t udp_port,
639 integer len) := {
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100640 elementIdentifier := '7C'O,
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100641 lengthIndicator := len, /* overwritten */
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100642 ipAddress := addr,
643 uDPPortValue := udp_port
644}
Harald Welte235ebf12017-12-15 14:18:16 +0100645template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) :=
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100646 ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6);
Harald Welte235ebf12017-12-15 14:18:16 +0100647template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) :=
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100648 ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18);
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100649
Pau Espin Pedrol6a846bc2020-09-04 13:01:22 +0200650function f_ts_BSSMAP_IE_AoIP_TLA(charstring addr, uint16_t udp_port)
651 return template (value) BSSMAP_IE_AoIP_TransportLayerAddress {
652 if (f_addr_is_ipv6(addr)) {
653 var OCT16 ip6 := f_inet6_addr(addr);
654 return ts_BSSMAP_IE_AoIP_TLA6(ip6, udp_port);
655 } else {
656 var OCT4 ip := f_inet_addr(addr);
657 return ts_BSSMAP_IE_AoIP_TLA4(ip, udp_port);
658 }
659}
660
Neels Hofmeyr3c89a6b2019-10-15 16:54:37 +0200661template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA(template BSSMAP_FIELD_IPAddress addr,
662 template uint16_t udp_port,
663 template integer len := ?) := {
664 elementIdentifier := '7C'O,
665 lengthIndicator := len,
666 ipAddress := addr,
667 uDPPortValue := udp_port
668}
669template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA4(template OCT4 ip, template uint16_t pt) :=
670 tr_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6);
671template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA6(template OCT16 ip, template uint16_t pt) :=
672 tr_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18);
673
Pau Espin Pedrol6a846bc2020-09-04 13:01:22 +0200674function f_tr_BSSMAP_IE_AoIP_TLA(charstring addr, template uint16_t udp_port)
675 return template BSSMAP_IE_AoIP_TransportLayerAddress {
676 if (f_addr_is_ipv6(addr)) {
677 var OCT16 ip6 := f_inet6_addr(addr);
678 return tr_BSSMAP_IE_AoIP_TLA6(ip6, udp_port);
679 } else {
680 var OCT4 ip := f_inet_addr(addr);
681 return tr_BSSMAP_IE_AoIP_TLA4(ip, udp_port);
682 }
683}
684
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +0200685template (present) BSSMAP_IE_KC128 tr_BSSMAP_IE_Kc128(template (present) OCT16 kc128) := {
686 elementIdentifier := '83'O,
687 kC128_Value := kc128
688}
689
Harald Welte4bf5fc92017-12-15 13:56:06 +0100690template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := {
691 elementIdentifier := '83'O,
692 kC128_Value := kc128
693}
694
Harald Weltef1b64e22017-12-15 14:55:14 +0100695/* 3.2.2.103 */
696template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := {
697 codecType := GSM_FR,
698 tF := '0'B,
699 pT := '0'B,
700 pI := '0'B,
701 fI := '1'B,
702 extendedCodecType := omit,
703 s0_7 := omit,
704 s8_15 := omit
705}
706template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := {
707 codecType := GSM_FR
708}
709template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := {
710 codecType := GSM_EFR
711}
712template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := {
713 codecType := GSM_HR
714}
715template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := {
716 codecType := FR_AMR,
717 s0_7 := '11111111'B,
718 s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */
719}
720template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := {
721 codecType := HR_AMR,
722 s0_7 := '00111111'B,
723 s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */
724}
Neels Hofmeyra47a8c62022-04-07 00:31:19 +0200725template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_WB modifies ts_CodecBase := {
726 codecType := FR_AMR_WB,
727 s0_7 := '00000001'B
728}
Oliver Smithdd002752023-02-21 13:35:00 +0100729template (value) BSSMAP_FIELD_CodecElement ts_CodecCSData modifies ts_CodecBase := {
730 codecType := CodecExtension,
731 tF := '0'B, /* Spare */
732 pT := '0'B, /* CSDoTDM */
733 pI := '1'B, /* CSDoIP */
734 fI := '0'B, /* Spare */
735 extendedCodecType := 'FD'O, /* CSData */
736 s0_7 := '00000000'B /* R2, R3, Spare */
737}
Harald Weltef1b64e22017-12-15 14:55:14 +0100738template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := {
739 elementIdentifier := '7D'O,
740 lengthIndicator := 0, /* overwritten */
741 codecElements := valueof(elem)
742}
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100743template BSSMAP_IE_SpeechCodec ts_BSSMAP_IE_SpeechCodec(template BSSMAP_FIELD_CodecElements elem) := {
744 elementIdentifier := '7E'O,
745 lengthIndicator := 0, /* overwritten */
746 codecElements := valueof(elem)
747}
Harald Weltef1b64e22017-12-15 14:55:14 +0100748
Harald Welte44d055f2023-04-17 09:18:55 +0800749function ts_BSSMAP_IE_CallIdentifier(template (omit) OCT4 cid) return template (omit) BSSMAP_IE_CallIdentifier {
750 if (istemplatekind(cid, "omit")) {
751 return omit;
752 } else {
753 var template (present) BSSMAP_IE_CallIdentifier ie := {
754 elementIdentifier := '7F'O,
755 callIdentifierInfo := cid
756 }
757 return ie;
758 }
759}
760function tr_BSSMAP_IE_CallIdentifier(template OCT4 cid) return template BSSMAP_IE_CallIdentifier {
761 if (istemplatekind(cid, "*")) {
762 return *;
763 } else if (istemplatekind(cid, "omit")) {
764 return omit;
765 } else {
766 var template BSSMAP_IE_CallIdentifier ie := {
767 elementIdentifier := '7F'O,
768 callIdentifierInfo := cid
769 }
770 return ie;
771 }
772}
773
774
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200775template (present) BSSMAP_IE_Osmo_OsmuxCID tr_OsmuxCID(template (present) INT1 cid := ?) := {
776 elementIdentifier := 'F1'O,
777 osmuxCID := cid
778}
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200779template (value) BSSMAP_IE_Osmo_OsmuxCID ts_OsmuxCID(INT1 cid) := {
780 elementIdentifier := 'F1'O,
781 osmuxCID := cid
782}
783
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100784template PDU_BSSAP
785ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200786 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
787 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit)
Harald Welte365f4ed2017-11-23 00:00:43 +0100788modifies ts_BSSAP_BSSMAP := {
789 pdu := {
790 bssmap := {
791 assignmentRequest := {
792 messageType :='01'O, /* overwritten */
793 channelType := ts_BSSMAP_IE_ChannelType,
794 layer3HeaderInfo := omit,
795 priority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100796 circuitIdentityCode := cic,
Harald Welte365f4ed2017-11-23 00:00:43 +0100797 downLinkDTX_Flag := omit,
798 interferenceBandToBeUsed := omit,
799 classmarkInformationType2 := omit,
800 groupCallReference := omit,
801 talkerFlag := omit,
802 configurationEvolutionIndication := omit,
803 lsaAccesControlSuppression := omit,
804 serviceHandover := omit,
805 encryptionInformation := omit,
806 talkerPriority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100807 aoIPTransportLayer := aoip,
Harald Welte365f4ed2017-11-23 00:00:43 +0100808 codecList := omit,
809 callIdentifier := omit,
810 kC128 := omit,
811 globalCallReference := omit,
812 lCLS_Configuration := omit,
813 lCLS_ConnectionStatusControl := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200814 lCLS_CorrelationNotNeeded := omit,
815 osmuxCID := osmuxCID
Harald Welte365f4ed2017-11-23 00:00:43 +0100816 }
817 }
818 }
819}
Harald Weltec76f29f2017-11-22 12:46:46 +0100820
Harald Weltebe48a7c2018-01-26 21:39:25 +0100821template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200822 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
823 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *)
Harald Weltebe48a7c2018-01-26 21:39:25 +0100824modifies tr_BSSAP_BSSMAP := {
Harald Welteb3414b22017-11-23 18:22:10 +0100825 pdu := {
826 bssmap := {
827 assignmentRequest := {
828 messageType :='01'O, /* overwritten */
829 channelType := ?,
830 layer3HeaderInfo := *,
831 priority := *,
Harald Weltebe48a7c2018-01-26 21:39:25 +0100832 circuitIdentityCode := cic,
Harald Welteb3414b22017-11-23 18:22:10 +0100833 downLinkDTX_Flag := *,
834 interferenceBandToBeUsed := *,
835 classmarkInformationType2 := *,
836 groupCallReference := *,
837 talkerFlag := *,
838 configurationEvolutionIndication := *,
839 lsaAccesControlSuppression := *,
840 serviceHandover := *,
841 encryptionInformation := *,
842 talkerPriority := *,
Harald Weltebe48a7c2018-01-26 21:39:25 +0100843 aoIPTransportLayer := aoip,
Harald Welteb3414b22017-11-23 18:22:10 +0100844 codecList := *,
845 callIdentifier := *,
846 kC128 := *,
847 globalCallReference := *,
848 lCLS_Configuration := *,
849 lCLS_ConnectionStatusControl := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200850 lCLS_CorrelationNotNeeded := *,
851 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100852 }
853 }
854 }
855}
856
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100857template PDU_BSSAP
858ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit,
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100859 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200860 template BSSMAP_IE_SpeechCodec speechCodec := omit,
861 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit)
Harald Welteb3414b22017-11-23 18:22:10 +0100862modifies ts_BSSAP_BSSMAP := {
863 pdu := {
864 bssmap := {
865 assignmentComplete := {
866 messageType :='02'O, /* overwritten */
Harald Welte7ed2b082017-11-23 18:52:13 +0100867 rR_Cause := omit,
Harald Welteb3414b22017-11-23 18:22:10 +0100868 circuitIdentityCode := cic,
869 cellIdentifier := omit,
870 chosenChannel := omit,
871 chosenEncryptionAlgorithm := omit,
872 circuitPool := omit,
873 speechVersion := omit,
874 lSAIdentifier := omit,
875 talkerPriority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100876 aoIPTransportLayer := aoip,
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100877 speechCodec := speechCodec,
Harald Welteb3414b22017-11-23 18:22:10 +0100878 codecList := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200879 lCLS_BSS_Status := omit,
880 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100881 }
882 }
883 }
884}
885
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100886template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200887 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
888 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *)
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100889modifies tr_BSSAP_BSSMAP := {
Harald Welteb3414b22017-11-23 18:22:10 +0100890 pdu := {
891 bssmap := {
892 assignmentComplete := {
893 messageType := '02'O, /* overwritten */
Harald Welte7ed2b082017-11-23 18:52:13 +0100894 rR_Cause := *,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100895 circuitIdentityCode := cic,
Harald Welteb3414b22017-11-23 18:22:10 +0100896 cellIdentifier := *,
897 chosenChannel := *,
898 chosenEncryptionAlgorithm := *,
899 circuitPool := *,
900 speechVersion := *,
901 lSAIdentifier := *,
902 talkerPriority := *,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100903 aoIPTransportLayer := aoip,
Harald Welteb3414b22017-11-23 18:22:10 +0100904 speechCodec := *,
905 codecList := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200906 lCLS_BSS_Status := *,
907 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100908 }
909 }
910 }
911}
912
Harald Welte16a4adf2017-12-14 18:54:01 +0100913template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := {
914 pdu := {
915 bssmap := {
916 assignmentFailure := {
917 messageType := '03'O, /* overwritten */
918 rR_Cause := *,
919 circuitPool := *,
920 circuitPoolList := *,
921 talkerPriority := *,
922 codecList := *
923 }
924 }
925 }
926}
927
928
Harald Welteb3414b22017-11-23 18:22:10 +0100929template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause)
930modifies ts_BSSAP_BSSMAP := {
931 pdu := {
932 bssmap := {
933 clearCommand := {
934 messageType := '20'O, /* overwritten */
935 layer3HeaderInfo := omit,
936 cause := ts_BSSMAP_IE_Cause(cause),
937 cSFB_Indication := omit
938 }
939 }
940 }
941}
Harald Welte99787102019-02-04 10:41:36 +0100942template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause)
943modifies ts_BSSMAP_ClearCommand := {
944 pdu := {
945 bssmap := {
946 clearCommand := {
947 cSFB_Indication := {
948 elementIdentifier := '8F'O
949 }
950 }
951 }
952 }
953}
Harald Welteb3414b22017-11-23 18:22:10 +0100954
955template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := {
956 pdu := {
957 bssmap := {
958 clearCommand := {
959 messageType := '20'O, /* overwritten */
960 layer3HeaderInfo := *,
961 cause := ?,
962 cSFB_Indication := *
963 }
964 }
965 }
966}
967
Harald Welte4c422b72019-02-17 16:27:10 +0100968template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := {
969 pdu := {
970 bssmap := {
971 clearCommand := {
972 messageType := '20'O, /* overwritten */
973 layer3HeaderInfo := *,
974 cause := ?,
975 cSFB_Indication := {
976 elementIdentifier := '8F'O
977 }
978 }
979 }
980 }
981}
982
Harald Welteb3414b22017-11-23 18:22:10 +0100983template (value) PDU_BSSAP ts_BSSMAP_ClearComplete
984modifies ts_BSSAP_BSSMAP := {
985 pdu := {
986 bssmap := {
987 clearComplete := {
988 messageType := '21'O /* overwritten */
989 }
990 }
991 }
992}
993
Harald Weltec859df52017-11-24 23:41:41 +0100994template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := {
995 pdu := {
996 bssmap := {
997 clearComplete := {
998 messageType := '21'O
999 }
1000 }
1001 }
1002}
1003
Harald Weltebc881782018-01-23 20:09:15 +01001004template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause)
1005modifies ts_BSSAP_BSSMAP := {
1006 pdu := {
1007 bssmap := {
1008 clearRequest := {
1009 messageType := '22'O, /* overwritten */
1010 cause := ts_BSSMAP_IE_Cause(cause)
1011 }
1012 }
1013 }
1014}
1015
Harald Weltecfa79ad2017-12-09 22:33:47 +01001016template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := {
1017 pdu := {
1018 bssmap := {
1019 clearRequest := {
1020 messageType := '22'O, /* overwritten */
1021 cause := ?
1022 }
1023 }
1024 }
1025}
1026
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001027template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause,
Pau Espin Pedrol35801c32021-04-19 13:03:20 +02001028 template BSSMAP_FIELD_CellIdentificationList cid_list,
1029 template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit)
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001030modifies ts_BSSAP_BSSMAP := {
1031 pdu := {
1032 bssmap := {
1033 handoverRequired := {
1034 messageType := '11'O,
1035 cause := ts_BSSMAP_IE_Cause(cause),
1036 responseRequest := omit,
1037 cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list),
1038 circuitPoolList := omit,
1039 currentChannelType1 := omit,
1040 speechVersion := omit,
1041 queueingIndicator := omit,
Pau Espin Pedrol35801c32021-04-19 13:03:20 +02001042 oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs),
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001043 sourceToTargetRNCTransparentInfo := omit,
1044 sourceToTargetRNCTransparentInfoCDMA := omit,
1045 gERANClassmark := omit,
1046 talkerPriority := omit,
1047 speechCodec := omit,
1048 cSG_Identifier := omit
1049 }
1050 }
1051 }
1052}
1053
1054
Oliver Smithc9a5f532022-10-21 11:32:23 +02001055template PDU_BSSAP tr_BSSMAP_HandoverRequired(template BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := *,
1056 template (present) BSSMAP_FIELD_CellIdentificationList cid_list := ?)
1057modifies tr_BSSAP_BSSMAP := {
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001058 pdu := {
1059 bssmap := {
1060 handoverRequired := {
Pau Espin Pedrol35801c32021-04-19 13:03:20 +02001061 messageType := '11'O,
Oliver Smithc9a5f532022-10-21 11:32:23 +02001062 cellIdentifierList := {
1063 cellIdentificationList := cid_list
1064 },
Pau Espin Pedrol35801c32021-04-19 13:03:20 +02001065 oldToNewBSSInfo := f_tr_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs)
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001066 }
1067 }
1068 }
1069}
1070
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001071template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := {
1072 pdu := {
1073 bssmap := {
1074 handoverRequiredReject := {
1075 messageType := '1A'O
1076 }
1077 }
1078 }
1079}
1080
1081template PDU_BSSAP tr_BSSMAP_HandoverCommand
1082modifies tr_BSSAP_BSSMAP := {
1083 pdu := {
1084 bssmap := {
1085 handoverCommand := {
1086 messageType := '13'O
1087 }
1088 }
1089 }
1090}
1091
1092template PDU_BSSAP tr_BSSMAP_HandoverSucceeded
1093modifies tr_BSSAP_BSSMAP := {
1094 pdu := {
1095 bssmap := {
1096 handoverSucceeded := {
1097 messageType := '15'O
1098 }
1099 }
1100 }
1101}
1102
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001103template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info)
1104modifies ts_BSSAP_BSSMAP := {
1105 pdu := {
1106 bssmap := {
1107 handoverCommand := {
1108 messageType := '13'O,
1109 layer3Information := {
1110 elementIdentifier := '17'O,
1111 lengthIndicator := 0,
1112 layer3info := layer3info
1113 },
1114 cellIdentifier := omit,
1115 newBSSToOldBSSInfo := omit,
1116 talkerPriority := omit
1117 }
1118 }
1119 }
1120}
1121
Neels Hofmeyr61ebb8b2018-10-09 18:28:06 +02001122template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := {
1123 pdu := {
1124 bssmap := {
1125 handoverFailure := {
1126 messageType := '16'O,
1127 cause := ?,
1128 rR_Cause := *,
1129 circuitPool := *,
1130 circuitPoolList := *,
1131 gERANClassmark := *,
1132 newBSSToOldBSSInfo := *,
1133 interSystemInformation := *,
1134 talkerPriority := *,
1135 codecList := *
1136 }
1137 }
1138 }
1139}
1140
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001141template PDU_BSSAP tr_BSSMAP_HandoverRequest(template BSSMAP_IE_EncryptionInformation encryptionInformation := *,
1142 template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := *,
Vadim Yanitskiy6fe5d4e2022-08-04 04:04:54 +07001143 template BSSMAP_IE_KC128 kC128 := *,
1144 template BSSMAP_IE_SpeechCodecList codecList := *
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001145 )
1146 modifies tr_BSSAP_BSSMAP := {
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001147 pdu := {
1148 bssmap := {
1149 handoverRequest := {
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001150 messageType := '10'O,
1151 encryptionInformation := encryptionInformation,
1152 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
Vadim Yanitskiy6fe5d4e2022-08-04 04:04:54 +07001153 codecList := codecList,
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001154 kC128 := kC128
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001155 }
1156 }
1157 }
1158}
1159
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001160template PDU_BSSAP ts_BSSMAP_HandoverRequest(
1161 template BSSMAP_IE_CircuitIdentityCode cic := omit,
1162 template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit,
1163 template BSSMAP_IE_CellIdentifier cell_id_target := ts_CellID_LAC_CI(1, 0),
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +02001164 template BSSMAP_IE_CellIdentifier cell_id_source := ts_CellID_LAC_CI(1, 1),
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001165 template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit,
1166 template BSSMAP_IE_EncryptionInformation encryptionInformation := ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O),
1167 template (omit) BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit,
Neels Hofmeyr9fe13202022-03-04 00:05:43 +01001168 template (omit) BSSMAP_IE_KC128 kC128 := omit,
1169 template (omit) BSSMAP_IE_SpeechCodecList codecList := omit
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001170 )
1171modifies ts_BSSAP_BSSMAP := {
1172 pdu := {
1173 bssmap := {
1174 handoverRequest := {
1175 messageType := '10'O,
1176 channelType := ts_BSSMAP_IE_ChannelType,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001177 encryptionInformation := encryptionInformation,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001178 classmarkInformationType := {
1179 classmarkInformationType1 := {
1180 elementIdentifier := '1D'O,
1181 rf_PowerCapability := '000'B,
1182 a5_1 := '0'B,
1183 esind := '0'B,
1184 revisionLevel := '10'B,
1185 spare1_1 := '0'B
1186 }
1187 },
1188 cellIdentifierSource := cell_id_source,
1189 priority := omit,
1190 circuitIdentityCode := cic,
1191 downLinkDTX_Flag := omit,
1192 cellIdentifierTarget := cell_id_target,
1193 interferenceBandToBeUsed := omit,
1194 cause := omit,
1195 classmarkInformationType3 := omit,
1196 currentChannelType1 := omit,
1197 speechVersion := omit,
1198 groupCallReference := omit,
1199 talkerFlag := omit,
1200 configurationEvolutionIndication := omit,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001201 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +02001202 oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs),
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001203 lSAInformation := omit,
1204 lSAAccessControlSuppression := omit,
1205 serviceHandover := omit,
1206 iMSI_bssmap := omit,
1207 sourceToTargetRNCTransparentInfo := omit,
1208 sourceToTargetRNCTransparentInfoCDMA := omit,
1209 sNAAccessInformation := omit,
1210 talkerPriority := omit,
1211 aoIPTransportLayer := aoip_tla,
Neels Hofmeyr9fe13202022-03-04 00:05:43 +01001212 codecList := codecList,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001213 callIdentifier := omit,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001214 kC128 := kC128,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001215 globalCallReference := omit,
1216 lCLS_Configuration := omit,
1217 connectionStatusControl := omit
1218 }
1219 }
1220 }
1221}
1222
1223template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info)
1224modifies tr_BSSAP_BSSMAP := {
1225 pdu := {
1226 bssmap := {
1227 handoverRequestAck := {
1228 messageType := '12'O,
1229 layer3Information := {
1230 elementIdentifier := '17'O,
1231 lengthIndicator := ?,
1232 layer3info := layer3info
1233 }
1234 }
1235 }
1236 }
1237}
1238
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001239template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge(
1240 template octetstring layer3info,
1241 template LIN1 layer3infoLength,
1242 template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit,
1243 template BSSMAP_IE_SpeechCodec speechCodec := omit,
1244 template BSSMAP_IE_ChosenChannel chosenChannel := omit,
1245 template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit)
1246modifies ts_BSSAP_BSSMAP := {
1247 pdu := {
1248 bssmap := {
1249 handoverRequestAck := {
1250 messageType := '12'O,
1251 layer3Information := {
1252 elementIdentifier := '17'O,
1253 lengthIndicator := layer3infoLength,
1254 layer3info := layer3info
1255 },
1256 chosenChannel := chosenChannel,
1257 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
1258 circuitPool := omit,
1259 speechVersion := omit,
1260 circuitIdentityCode := omit,
1261 lSAIdentifier := omit,
1262 newBSSToOldBSSInfo := omit,
1263 interSystemInformation := omit,
1264 talkerPriority := omit,
1265 aoIPTransportLayer := aoIPTransportLayer,
1266 codecList := omit,
1267 speechCodec := speechCodec,
1268 lCLS_bSS_Status := omit
1269 }
1270 }
1271 }
1272}
1273
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001274template PDU_BSSAP tr_BSSMAP_HandoverDetect
1275modifies tr_BSSAP_BSSMAP := {
1276 pdu := {
1277 bssmap := {
1278 handoverDetect := {
1279 messageType := '1B'O,
1280 talkerPriority := *
1281 }
1282 }
1283 }
1284}
1285
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001286template PDU_BSSAP ts_BSSMAP_HandoverDetect
1287modifies ts_BSSAP_BSSMAP := {
1288 pdu := {
1289 bssmap := {
1290 handoverDetect := {
1291 messageType := '1B'O,
1292 talkerPriority := omit
1293 }
1294 }
1295 }
1296}
1297
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001298template PDU_BSSAP tr_BSSMAP_HandoverComplete
1299modifies tr_BSSAP_BSSMAP := {
1300 pdu := {
1301 bssmap := {
1302 handoverComplete := {
1303 messageType := '14'O,
1304 rR_Cause := *,
1305 talkerPriority := *,
1306 speechCodec := *,
1307 codecList := *,
1308 chosenEncryptionAlgorithm := *,
1309 chosenChannel := *,
1310 lCLS_BSS_Status := *
1311 }
1312 }
1313 }
1314}
Harald Weltecfa79ad2017-12-09 22:33:47 +01001315
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001316template PDU_BSSAP ts_BSSMAP_HandoverComplete
1317modifies ts_BSSAP_BSSMAP := {
1318 pdu := {
1319 bssmap := {
1320 handoverComplete := {
1321 messageType := '14'O,
1322 rR_Cause := omit,
1323 talkerPriority := omit,
1324 speechCodec := omit,
1325 codecList := omit,
1326 chosenEncryptionAlgorithm := omit,
1327 chosenChannel := omit,
1328 lCLS_BSS_Status := omit
1329 }
1330 }
1331 }
1332}
1333
Philipp Maieraee60392018-11-05 17:09:00 +01001334template PDU_BSSAP tr_BSSMAP_HandoverPerformed
1335modifies tr_BSSAP_BSSMAP := {
1336 pdu := {
1337 bssmap := {
1338 handoverPerformed := {
1339 messageType := '17'O,
1340 cause := ?,
1341 cellIdentifier := ?,
Philipp Maier8d33a132018-11-12 11:58:55 +01001342 chosenChannel := *,
1343 chosenEncryptionAlgorithm := *,
1344 speechVersion := *,
1345 lSAIdentifier := *,
1346 talkerPriority := *,
1347 codecList := *,
1348 speechCodec := *,
1349 lCLS_BSS_Status := *
Philipp Maieraee60392018-11-05 17:09:00 +01001350 }
1351 }
1352 }
1353}
1354
Harald Welte28d943e2017-11-25 15:00:50 +01001355template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := {
1356 elementIdentifier := '08'O,
1357 lengthIndicator := 0, /* overwritten */
1358 typeOfIdentity := '001'B, /* IMSI */
1359 oddEvenIndicator := f_hex_is_odd_length(imsi_digits),
1360 digits := imsi_digits
1361}
1362
Harald Welte17d21152018-01-27 00:47:11 +01001363template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := {
1364 elementIdentifier := '08'O,
1365 lengthIndicator := ?, /* overwritten */
1366 typeOfIdentity := '001'B, /* IMSI */
1367 oddEvenIndicator := ?,
1368 digits := imsi_digits
1369}
1370
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001371template (value) BSSAMAP_IE_LastUsedEUTRANPLMNId ts_BSSMAP_LastUsedEUTRANPLMNId(OCT3 mcc_mnc) := {
1372 elementIdentifier := '95'O,
1373 mcc_mnc := mcc_mnc
1374}
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001375template BSSAMAP_IE_LastUsedEUTRANPLMNId tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) := {
1376 elementIdentifier := '95'O,
1377 mcc_mnc := mcc_mnc
1378}
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001379function f_ts_BSSMAP_LastUsedEUTRANPLMNId(template (omit) OCT3 mcc_mnc)
1380 return template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId {
1381 if (not istemplatekind(mcc_mnc, "omit")) {
1382 return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc));
1383 } else {
1384 return omit;
1385 }
1386}
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001387function f_tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc)
1388return template BSSAMAP_IE_LastUsedEUTRANPLMNId {
1389 if (istemplatekind(mcc_mnc, "*")) {
1390 return *;
1391 } else if (istemplatekind(mcc_mnc, "?")) {
1392 return ?;
1393 } else if (istemplatekind(mcc_mnc, "omit")) {
1394 return omit;
1395 } else {
1396 return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc));
1397 }
1398}
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001399
Harald Welte72cecfa2017-12-11 19:50:14 +01001400template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := {
1401 cIl_noCell := ''O
1402}
Harald Welteaba42162019-06-19 18:17:59 +02001403template (value) BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_BSS := {
1404 cIl_allInBSS := ''O
1405}
1406template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_BSS := {
1407 cIl_allInBSS := ''O
1408}
1409
1410template (value) BSSMAP_FIELD_CellIdentificationList
1411 ts_BSSMAP_CIL_CGI(template (value) BSSMAP_FIELD_CellIdentificationList_CGI cgil) := {
1412 cIl_CGI := cgil
1413}
1414template BSSMAP_FIELD_CellIdentificationList
1415 tr_BSSMAP_CIL_CGI(template BSSMAP_FIELD_CellIdentificationList_CGI cgil) := {
1416 cIl_CGI := cgil
1417}
1418
1419template (value) BSSMAP_FIELD_CellIdentificationList
1420 ts_BSSMAP_CIL_LAC_CI(template (value) BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := {
1421 cIl_LAC_CI := lac_cil
1422}
1423template BSSMAP_FIELD_CellIdentificationList
1424 tr_BSSMAP_CIL_LAC_CI(template BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := {
1425 cIl_LAC_CI := lac_cil
1426}
1427
1428template (value) BSSMAP_FIELD_CellIdentificationList
1429 ts_BSSMAP_CIL_CI(template (value) RecordOfOCT2 cil) := {
1430 cIl_CI := cil
1431}
1432template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_CI(template RecordOfOCT2 cil) := {
1433 cIl_CI := cil
1434}
1435
1436template (value) BSSMAP_FIELD_CellIdentificationList
1437 ts_BSSMAP_CIL_LAI(template (value) BSSMAP_FIELD_CellIdentificationList_LAI lail) := {
1438 cIl_LAI := lail
1439}
1440template BSSMAP_FIELD_CellIdentificationList
1441 tr_BSSMAP_CIL_LAI(template BSSMAP_FIELD_CellIdentificationList_LAI lail) := {
1442 cIl_LAI := lail
1443}
1444
1445template (value) BSSMAP_FIELD_CellIdentificationList
1446 ts_BSSMAP_CIL_LAC(template (value) RecordOfOCT2 lacl) := {
1447 cIl_LAC := lacl
1448}
1449template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_LAC(template RecordOfOCT2 lacl) := {
1450 cIl_LAC := lacl
1451}
1452
Harald Welte72cecfa2017-12-11 19:50:14 +01001453
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001454function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 {
Harald Welte24135bd2018-03-17 19:27:53 +01001455 if (lengthof(mnc) == 2) {
1456 return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]);
Stefan Sperling83348bc2018-03-14 17:44:40 +01001457 } else {
1458 return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]);
1459 }
Harald Welte72cecfa2017-12-11 19:50:14 +01001460}
1461
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001462function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) {
1463 var hexstring hs := oct2hex(mcc_mnc);
1464 mcc := hs[1] & hs[0] & hs[3];
1465 mnc := hs[5] & hs[4];
1466 if (hs[2] == 'F'H) {
1467 mnc := mnc & hs[2];
1468 }
1469}
1470
Harald Welteaba42162019-06-19 18:17:59 +02001471template (value) BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001472 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1473 lac := int2oct(lac, 2),
1474 ci := int2oct(ci, 2)
1475}
1476
Andreas Eversberg63c4b4c2023-05-17 15:02:03 +02001477template (present) BSSMAP_FIELD_CellIdentification_CGI tr_BSSMAP_CI_CGI(template (present) OCT3 mcc_mnc,
1478 template (present) GsmLac lac,
1479 template (present) GsmCellId ci) := {
1480 mcc_mnc := mcc_mnc,
1481 lac := f_tr_LAC(lac),
1482 ci := f_tr_CI(ci)
1483}
1484
Harald Welteaba42162019-06-19 18:17:59 +02001485template (value) BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001486 lac := int2oct(lac, 2),
1487 ci := int2oct(ci, 2)
1488}
1489
Harald Welteaba42162019-06-19 18:17:59 +02001490template (value) BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001491 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1492 lac := int2oct(lac, 2)
1493}
1494
Harald Welteaba42162019-06-19 18:17:59 +02001495template (value) OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2);
1496template (value) OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2);
Harald Welte72cecfa2017-12-11 19:50:14 +01001497
Harald Welteaba42162019-06-19 18:17:59 +02001498template (value) BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC
Harald Welte751d3eb2018-01-31 15:51:06 +01001499ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := {
1500 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1501 lac := int2oct(lac, 2),
1502 rncId := int2oct(rnc_id, 2)
1503}
1504
Harald Welteaba42162019-06-19 18:17:59 +02001505template (value) BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := {
Harald Welte751d3eb2018-01-31 15:51:06 +01001506 lac := int2oct(lac, 2),
1507 rncId := int2oct(rnc_id, 2)
1508}
1509
Harald Welte72cecfa2017-12-11 19:50:14 +01001510template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := {
1511 elementIdentifier := '24'O,
1512 channel := chneed,
1513 spare := '000000'B
1514}
1515
1516template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := {
1517 elementIdentifier := '09'O,
1518 lengthIndicator := 4,
1519 tmsiOctets := tmsi
1520};
1521
Harald Welte17d21152018-01-27 00:47:11 +01001522template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := {
1523 elementIdentifier := '09'O,
1524 lengthIndicator := 4,
1525 tmsiOctets := tmsi
1526};
1527
Harald Welte72cecfa2017-12-11 19:50:14 +01001528private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI {
1529 var template BSSMAP_IE_TMSI ret;
1530 if (ispresent(tmsi)) {
1531 ret := ts_BSSMAP_IE_TMSI(valueof(tmsi));
1532 } else {
1533 ret := omit;
1534 }
1535 return ret;
1536}
1537
1538template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits,
1539 template BSSMAP_FIELD_CellIdentificationList cid_list,
1540 template OCT4 tmsi := omit,
1541 template BSSMAP_IE_ChannelNeeded chneed := omit)
Harald Welte28d943e2017-11-25 15:00:50 +01001542modifies ts_BSSAP_BSSMAP := {
1543 pdu := {
1544 bssmap := {
1545 paging := {
Harald Welte17d21152018-01-27 00:47:11 +01001546 messageType := '52'O,
Harald Welte28d943e2017-11-25 15:00:50 +01001547 iMSI := ts_BSSMAP_Imsi(imsi_digits),
Harald Welte72cecfa2017-12-11 19:50:14 +01001548 tMSI := f_tmsi_or_omit(tmsi),
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001549 cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list),
Harald Welte72cecfa2017-12-11 19:50:14 +01001550 channelNeeded := chneed,
Harald Welte28d943e2017-11-25 15:00:50 +01001551 eMLPP_Priority := omit,
1552 pagingInformation := omit /* only VGCS/VBS flag */
1553 }
1554 }
1555 }
1556}
1557
Harald Welte17d21152018-01-27 00:47:11 +01001558template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?,
1559 template OCT4 tmsi := *,
1560 template BSSMAP_IE_ChannelNeeded chneed := *)
1561modifies tr_BSSAP_BSSMAP := {
1562 pdu := {
1563 bssmap := {
1564 paging := {
1565 messageType := '52'O,
1566 iMSI := tr_BSSMAP_Imsi(imsi_digits),
1567 tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent,
1568 cellIdentifierList := ?,
1569 channelNeeded := chneed,
1570 eMLPP_Priority := omit,
1571 pagingInformation := omit /* only VGCS/VBS flag */
1572 }
1573 }
1574 }
1575}
1576
1577
Harald Welte73cd2712017-12-17 00:44:52 +01001578template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key)
1579modifies ts_BSSAP_BSSMAP := {
1580 pdu := {
1581 bssmap := {
1582 cipherModeCommand := {
1583 messageType := '53'O,
1584 layer3HeaderInfo := omit,
1585 encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg),
1586 cipherResponseMode := omit,
1587 kC128 := omit
1588 }
1589 }
1590 }
1591}
1592
1593template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128)
1594modifies ts_BSSAP_BSSMAP := {
1595 pdu := {
1596 bssmap := {
1597 cipherModeCommand := {
1598 messageType := '53'O,
1599 layer3HeaderInfo := omit,
1600 encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg),
1601 cipherResponseMode := omit,
1602 kC128 := { '83'O, kc128 }
1603 }
1604 }
1605 }
1606}
1607
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001608template PDU_BSSAP tr_BSSMAP_CipherModeCmd2(template BSSMAP_IE_EncryptionInformation encryptionInformation := *,
1609 template BSSMAP_IE_KC128 kC128 := *)
Harald Welte16114282018-01-24 22:41:21 +01001610modifies tr_BSSAP_BSSMAP := {
1611 pdu := {
1612 bssmap := {
1613 cipherModeCommand := {
1614 messageType := '53'O,
1615 layer3HeaderInfo := *,
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001616 encryptionInformation := encryptionInformation,
Harald Welte16114282018-01-24 22:41:21 +01001617 cipherResponseMode := *,
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001618 kC128 := kC128
Harald Welte16114282018-01-24 22:41:21 +01001619 }
1620 }
1621 }
1622}
1623
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001624template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key, template BSSMAP_IE_KC128 kC128 := omit)
1625 := tr_BSSMAP_CipherModeCmd2(tr_BSSMAP_IE_EncrInfo(key, alg), kC128);
1626
Harald Welte16114282018-01-24 22:41:21 +01001627template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg)
1628modifies ts_BSSAP_BSSMAP := {
1629 pdu := {
1630 bssmap := {
1631 cipherModeComplete := {
1632 messageType := '55'O,
1633 layer3MessageContents := omit,
1634 chosenEncryptionAlgorithm := {
1635 elementIdentifier := '2C'O,
1636 algorithmIdentifier := alg
1637 }
1638 }
1639 }
1640 }
1641}
1642
Stefan Sperlinga2d59c62018-12-18 16:32:44 +01001643template PDU_BSSAP ts_BSSMAP_CipherModeComplAlg(template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := ?)
1644modifies ts_BSSAP_BSSMAP := {
1645 pdu := {
1646 bssmap := {
1647 cipherModeComplete := {
1648 messageType := '55'O,
1649 layer3MessageContents := omit,
1650 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm
1651 }
1652 }
1653 }
1654}
1655
Harald Welte73cd2712017-12-17 00:44:52 +01001656template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := {
1657 pdu := {
1658 bssmap := {
1659 cipherModeComplete := {
1660 messageType := '55'O,
1661 layer3MessageContents := *,
1662 chosenEncryptionAlgorithm := {
1663 elementIdentifier := '2C'O,
1664 algorithmIdentifier := alg
1665 }
1666 }
1667 }
1668 }
1669}
1670
1671template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := {
1672 pdu := {
1673 bssmap := {
1674 cipherModeReject := {
1675 messageType := '59'O,
1676 cause := ?
1677 }
1678 }
1679 }
1680}
1681
Daniel Willmann52918e52018-09-20 14:39:09 +02001682template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := {
1683 pdu := {
1684 bssmap := {
1685 classmarkRequest := {
1686 messageType := '58'O,
1687 talkerPriority := *
1688 }
1689 }
1690 }
1691}
1692
Harald Welte5c2622c2018-01-21 20:45:20 +01001693template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := {
1694 elementIdentifier := '12'O,
1695 lengthIndicator := 0, /* overwritten */
1696 /* CM1 */
1697 rf_PowerCapability := '010'B, /* class3 */
1698 a5_1 := '0'B, /* supported */
1699 esind := '1'B, /* early classmark supported */
1700 revisionLevel := '10'B, /* R99 */
1701 spare1_1 := '0'B,
1702 /* CM2 */
1703 fc := '1'B, /* E-GSM support */
1704 vgcs := '0'B,
1705 vbs := '0'B,
1706 sm_Capability := '1'B,
1707 ss_ScreenIndicator := '00'B,
1708 ps_Capability := '1'B,
1709 spare2_1 := '0'B,
1710 classmarkInformationType2_oct5 := {
1711 a5_2 := '0'B, /* not available */
1712 a5_3 := '1'B, /* available */
1713 cmsp := '0'B, /* not supported */
1714 solsa := '0'B, /* not suported */
1715 ucs2 := '0'B, /* GSM alphabet preferred */
1716 lcsvacap := '0'B, /* not supported */
1717 spare := '0'B,
1718 cm3 := '0'B /* no CM3 */
1719 }
1720}
1721
Eric Wild26f4a622021-05-17 15:27:05 +02001722
1723template BSSMAP_IE_ClassmarkInformationType3 ts_CM3_default := {
1724 elementIdentifier := '13'O,
1725 lengthIndicator := 0, /* overwritten */
1726 classmark3ValuePart := '01'O /* A5/4 supported */
1727}
1728
Harald Welte5c2622c2018-01-21 20:45:20 +01001729template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default,
1730 template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit)
1731modifies ts_BSSAP_BSSMAP := {
1732 pdu := {
1733 bssmap := {
1734 classmarkUpdate := {
1735 messageType := '54'O,
1736 classmarkInformationType2 := cm2,
1737 classmarkInformationType3 := cm3,
1738 talkerPriority := omit
1739 }
1740 }
1741 }
1742}
1743
Harald Welte898113b2018-01-31 18:32:21 +01001744template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *,
1745 template BSSMAP_IE_ClassmarkInformationType3 cm3 := *)
1746modifies tr_BSSAP_BSSMAP := {
1747 pdu := {
1748 bssmap := {
1749 classmarkUpdate := {
1750 messageType := '54'O,
1751 classmarkInformationType2 := cm2,
1752 classmarkInformationType3 := cm3,
1753 talkerPriority := *
1754 }
1755 }
1756 }
1757}
1758
Neels Hofmeyr92b12b72018-09-18 14:30:23 +02001759template PDU_BSSAP ts_BSSMAP_ClassmarkRequest
1760modifies ts_BSSAP_BSSMAP := {
1761 pdu := {
1762 bssmap := {
1763 classmarkRequest := {
1764 messageType := '58'O,
1765 talkerPriority := omit
1766 }
1767 }
1768 }
1769}
1770
Eric Wild26f4a622021-05-17 15:27:05 +02001771template PDU_BSSAP tr_BSSMAP_ClassmarkRequest
1772modifies tr_BSSAP_BSSMAP := {
1773 pdu := {
1774 bssmap := {
1775 classmarkRequest := {
1776 messageType := '58'O,
1777 talkerPriority := *
1778 }
1779 }
1780 }
1781}
1782
Harald Welte49518bf2018-02-10 11:39:19 +01001783/* return Layer3 octetstring inside BSSAP PDU */
1784function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring {
1785 if (ischosen(bssap.pdu.bssmap)) {
1786 var PDU_BSSMAP bssmap := bssap.pdu.bssmap;
1787 if (ischosen(bssmap.completeLayer3Information)) {
1788 return bssmap.completeLayer3Information.layer3Information.layer3info;
1789 } else if (ischosen(bssmap.handoverRequestAck)) {
1790 return bssmap.handoverRequestAck.layer3Information.layer3info;
1791 } else if (ischosen(bssmap.handoverCommand)) {
1792 return bssmap.handoverCommand.layer3Information.layer3info;
1793 } else if (ischosen(bssmap.uplinkRequest)) {
1794 return bssmap.uplinkRequest.layer3Information.layer3info;
1795 } else if (ischosen(bssmap.uplinkRequestConfirmation)) {
1796 return bssmap.uplinkRequestConfirmation.layer3Information.layer3info;
1797 } else if (ischosen(bssmap.uplinkApplicationData)) {
1798 return bssmap.uplinkApplicationData.layer3Information.layer3info;
1799 } else if (ischosen(bssmap.rerouteCommand)) {
1800 return bssmap.rerouteCommand.initialLayer3Information.layer3info;
1801 } else {
1802 return omit;
1803 }
1804 } else {
1805 return bssap.pdu.dtap;
1806 }
1807}
1808
Harald Welte0b50aed2018-05-28 22:33:07 +02001809/* TS 29.205 B.2.1.9 */
1810template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := {
1811 networkIDLengthIndicator := 0, /* overwritten */
1812 networkID := net_id,
1813 nodeIDLengthIndicator := 0, /* overwritten */
1814 nodeID := node_id,
1815 callReferenceIDLengthIndicator := 0, /* overwritten */
1816 callReferenceID := cref_id
1817}
1818template GlobalCallReferenceValue tr_GCR(template octetstring net_id,
1819 template OCT2 node_id,
1820 template OCT5 cref_id) := {
1821 networkIDLengthIndicator := ?,
1822 networkID := net_id,
1823 nodeIDLengthIndicator := ?,
1824 nodeID := node_id,
1825 callReferenceIDLengthIndicator := ?,
1826 callReferenceID := cref_id
1827}
1828
1829/* TS 47.008 3.2.2.115 */
1830template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := {
1831 elementIdentifier := '89'O,
1832 lengthIndicator := 0, /* overwritten */
1833 globalCallReferenceValue := gcr
1834}
1835template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := {
1836 elementIdentifier := '89'O,
1837 lengthIndicator := ?,
1838 globalCallReferenceValue := gcr
1839}
1840
1841/* TS 48.008 3.2.2.116 */
1842const BIT4 LCLS_CFG_both_way := '0000'B;
1843const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B;
1844const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B;
1845const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B;
1846const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B;
1847const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B;
1848
1849template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := {
1850 elementIdentifier := '8A'O,
1851 lCLS_ConfigurationValue := cfg_val,
1852 spare := '0000'B
1853}
1854template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := {
1855 elementIdentifier := '8A'O,
1856 lCLS_ConfigurationValue := cfg_val,
1857 spare := '0000'B
1858}
1859
1860/* TS 48.008 3.2.2.117 */
1861const BIT4 LCLS_CSC_connect := '0000'B;
1862const BIT4 LCLS_CSC_do_not_connect := '0001'B;
1863const BIT4 LCLS_CSC_release_lcls := '0010'B;
1864const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B;
1865const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B;
1866
1867template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := {
1868 elementIdentifier := '8B'O,
1869 lCLS_ConnectionStatusControlValue := csc,
1870 spare := '0000'B
1871}
1872template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := {
1873 elementIdentifier := '8B'O,
1874 lCLS_ConnectionStatusControlValue := csc,
1875 spare := '0000'B
1876}
1877
1878/* TS 48.008 3.2.2.119 */
1879const BIT4 LCLS_STS_not_yet_ls := '0000'B;
1880const BIT4 LCLS_STS_not_possible_ls := '0001'B;
1881const BIT4 LCLS_STS_no_longer_ls := '0010'B;
1882const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B;
1883const BIT4 LCLS_STS_locally_switched := '0100'B;
1884
1885template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := {
1886 elementIdentifier := '8D'O,
1887 lCLS_BSS_StatusValue := sts,
1888 spare := '0000'B
1889}
1890template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := {
1891 elementIdentifier := '8D'O,
1892 lCLS_BSS_StatusValue := sts,
1893 spare := '0000'B
1894}
1895
1896/* TS 48.008 3.2.1.91 */
1897template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrl(template (omit) BSSMAP_IE_LCLS_Configuration cfg,
Harald Welte354722e2018-06-01 13:15:32 +02001898 template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001899 pdu := {
1900 bssmap := {
1901 lCLS_ConnectControl := {
1902 messageType := '74'O,
1903 lCLS_Configuration := cfg,
1904 lCLS_ConnectionStatusControl := csc
1905 }
1906 }
1907 }
1908}
1909template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg,
Harald Welte354722e2018-06-01 13:15:32 +02001910 template BSSMAP_IE_LCLS_ConnectionStatusControl csc)
1911modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001912 pdu := {
1913 bssmap := {
1914 lCLS_ConnectControl := {
1915 messageType := '74'O,
1916 lCLS_Configuration := cfg,
1917 lCLS_ConnectionStatusControl := csc
1918 }
1919 }
1920 }
1921}
1922
1923/* TS 48.008 3.2.1.92 */
Harald Welte354722e2018-06-01 13:15:32 +02001924template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts)
1925modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001926 pdu := {
1927 bssmap := {
1928 lCLS_connectControlAck := {
1929 messageType := '75'O,
1930 lCLS_BSS_Status := sts
1931 }
1932 }
1933 }
1934}
Harald Welte354722e2018-06-01 13:15:32 +02001935template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts)
1936modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001937 pdu := {
1938 bssmap := {
1939 lCLS_connectControlAck := {
1940 messageType := '75'O,
1941 lCLS_BSS_Status := sts
1942 }
1943 }
1944 }
1945}
1946
1947/* TS 48.008 3.2.1.93 */
1948template (value) PDU_BSSAP ts_BSSMAP_LclsNotification(template (omit) BSSMAP_IE_LCLS_BSS_Status sts,
Harald Welte354722e2018-06-01 13:15:32 +02001949 template (omit) BSSMAP_IE_LCLS_BreakRequest brq)
1950modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001951 pdu := {
1952 bssmap := {
1953 lCLS_Notification := {
1954 messageType := '76'O,
1955 lCLS_BSS_Status := sts,
1956 lCLS_BreakRequest := brq
1957 }
1958 }
1959 }
1960}
1961template PDU_BSSAP tr_BSSMAP_LclsNotification(template BSSMAP_IE_LCLS_BSS_Status sts,
Harald Welte354722e2018-06-01 13:15:32 +02001962 template BSSMAP_IE_LCLS_BreakRequest brq)
1963modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001964 pdu := {
1965 bssmap := {
1966 lCLS_Notification := {
1967 messageType := '76'O,
1968 lCLS_BSS_Status := sts,
1969 lCLS_BreakRequest := brq
1970 }
1971 }
1972 }
1973}
1974
Harald Weltecc0b0142018-05-29 15:19:33 +02001975template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts)
1976modifies tr_BSSAP_BSSMAP := {
1977 pdu := {
1978 bssmap := {
1979 lCLS_Notification := {
1980 messageType := '76'O,
1981 lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts),
1982 lCLS_BreakRequest := omit
1983 }
1984 }
1985 }
1986}
Harald Welte898113b2018-01-31 18:32:21 +01001987
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001988template PDU_BSSAP ts_BSSMAP_CommonId(hexstring imsi_digits,
1989 template (omit) OCT3 last_eutran_plmn := omit)
Harald Welteeddf0e92020-06-21 19:42:15 +02001990modifies ts_BSSAP_BSSMAP := {
1991 pdu := {
1992 bssmap := {
1993 commonID := {
1994 messageType := '2F'O,
1995 iMSI := ts_BSSMAP_Imsi(imsi_digits),
Pau Espin Pedrold5ba6ce2021-04-15 14:18:13 +02001996 sNAAccessInformation := omit,
1997 selectedPLMNId := omit,
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001998 lastUsedEUTRANPLMNId := f_ts_BSSMAP_LastUsedEUTRANPLMNId(last_eutran_plmn)
Harald Welteeddf0e92020-06-21 19:42:15 +02001999 }
2000 }
2001 }
2002}
2003
Pau Espin Pedrole979c402021-04-28 17:29:54 +02002004template PDU_BSSAP tr_BSSMAP_CommonId(template hexstring imsi_digits,
2005 template BSSAMAP_IE_LastUsedEUTRANPLMNId lastUsedEUTRANPLMNId := *)
Harald Welteeddf0e92020-06-21 19:42:15 +02002006modifies tr_BSSAP_BSSMAP := {
2007 pdu := {
2008 bssmap := {
2009 commonID := {
2010 messageType := '2F'O,
2011 iMSI := tr_BSSMAP_Imsi(imsi_digits),
Pau Espin Pedrole979c402021-04-28 17:29:54 +02002012 sNAAccessInformation := *,
2013 selectedPLMNId := *,
2014 lastUsedEUTRANPLMNId := lastUsedEUTRANPLMNId
Harald Welteeddf0e92020-06-21 19:42:15 +02002015 }
2016 }
2017 }
2018}
Harald Welte898113b2018-01-31 18:32:21 +01002019
Vadim Yanitskiy48063962020-08-28 07:49:44 +07002020template PDU_BSSAP tr_BSSMAP_SAPInReject(template (present) GsmSapi sapi := ?,
2021 template BSSMAP_IE_Cause cause := ?)
2022modifies tr_BSSAP_BSSMAP := {
2023 pdu := {
2024 bssmap := {
2025 sAPInReject := {
2026 messageType := '25'O,
2027 dLCI := {
2028 elementIdentifier := '18'O,
2029 sapiValue := f_tr_SAPI(sapi),
2030 spare := ?,
2031 c1 := ?, c2 := ?
2032 },
2033 cause := cause
2034 }
2035 }
2036 }
2037}
2038
2039private function f_tr_SAPI(template (present) GsmSapi sapi)
2040return template (present) BIT3 {
2041 if (istemplatekind(sapi, "?")) {
2042 return ?;
2043 } else {
2044 return int2bit(valueof(sapi), 3);
2045 }
2046}
2047
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002048template (value) BSSMAP_IE_LocationType ts_BSSMAP_IE_LocationType
2049:= {
2050 elementIdentifier := '44'O,
2051 lengthIndicator := 1,
2052 locationInformation := '00'O,
2053 positioningMethod := omit
2054}
Harald Welte73cd2712017-12-17 00:44:52 +01002055
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03002056template (value) BSSMAP_IE_LCSClientType
2057ts_BSSMAP_IE_LCSClientType(template (value) BIT4 category := '0010'B,
2058 template (value) BIT4 subtype := '0000'B) := {
2059 elementIdentifier := '48'O,
2060 lengthIndicator := 0, /* overwritten */
2061 subtype := subtype,
2062 category := category
2063}
2064
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03002065template (value) BSSMAP_IE_LCSPriority
2066ts_BSSMAP_IE_LCSPriority(template (value) OCT1 priority := '00'O) := {
2067 elementIdentifier := '43'O,
2068 lengthIndicator := 0, /* overwritten */
2069 priority := priority
2070}
2071
2072template (value) BSSMAP_IE_LCSQOS
2073ts_BSSMAP_IE_LCSQOS(template (value) BIT1 vCI := '0'B,
2074 template (value) BIT1 vEL := '0'B,
2075 template (value) BIT1 hAI := '1'B,
2076 template (value) BIT7 hAV := '0010010'B,
2077 template (value) BIT1 vAI := '0'B,
2078 template (value) BIT7 vAV := '0000000'B) := {
2079 elementIdentifier := '3E'O,
2080 lengthIndicator := 0, /* overwritten */
2081 vCI := vCI, /* Vertical Coordinate Indicator: VC requested ('1'B) or not ('0'B) */
2082 vEL := vEL, /* report velocity if available (1) or not(0) */
2083 spare_1_6 := '000000'B,
2084 horizontalAccuracy := hAV, /* Accuracy Horizontal (HA) */
2085 hAI := hAI, /* Horizontal Accuracy Indicator HA is specified (1) or not (0) */
2086 verticalAccuracy := vAV, /* Accuracy Vertical (VA) */
2087 vAI := vAI, /* Vertical Accuracy Indicator VA is specified (1) or not (0) */
2088 spare_2_6 := '000000'B,
2089 rTC := '00'B /* Response Time is not specified */
2090}
2091
Harald Welte44d055f2023-04-17 09:18:55 +08002092
2093/* 3.2.2.55 */
2094template (value) BSSMAP_IE_GroupCallReference
2095ts_BSSMAP_IE_GroupCallRef(template (value) GroupCallRef group_call_ref) :={
2096 elementIdentifier := '37'O,
2097 lengthIndicator := 0, // overwritten
2098 descrGroupbroadcastCallRef := group_call_ref
2099}
2100template (present) BSSMAP_IE_GroupCallReference
2101tr_BSSMAP_IE_GroupCallRef(template (present) GroupCallRef group_call_ref) :={
2102 elementIdentifier := '37'O,
Andreas Eversberg5b9d2eb2023-07-27 16:01:42 +02002103 lengthIndicator := ?,
Harald Welte44d055f2023-04-17 09:18:55 +08002104 descrGroupbroadcastCallRef := group_call_ref
2105}
2106
2107/* 3.2.2.88 */
2108template (value) BSSMAP_IE_VGCS_FeatureFlags
2109ts_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 tcp) := {
2110 elementIdentifier := '69'O,
2111 lengthIndicator := 0, // overwritten
2112 TP_Ind := tp_ind,
2113 AS_Ind := as_ind,
2114 BSS_Res := bss_res,
2115 tCP := tcp,
2116 spare := '000'B
2117};
2118template (present) BSSMAP_IE_VGCS_FeatureFlags
2119tr_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 tcp) := {
2120 elementIdentifier := '69'O,
2121 lengthIndicator := ?,
2122 TP_Ind := tp_ind,
2123 AS_Ind := as_ind,
2124 BSS_Res := bss_res,
2125 tCP := tcp,
2126 spare := ?
2127};
2128
2129/* 3.2.2.98 */
2130template (value) BSSMAP_IE_ApplicationData
2131ts_BSSMAP_IE_ApplicationData(template (value) OCT9 adi) := {
2132 elementIdentifier := '78'O,
2133 lengthIndicator := 0, // overwritten
2134 applicationDataInfo := adi
2135};
2136template (present) BSSMAP_IE_ApplicationData
2137tr_BSSMAP_IE_ApplicationData(template (present) OCT9 adi) := {
2138 elementIdentifier := '78'O,
2139 lengthIndicator := ?,
2140 applicationDataInfo := adi
2141};
2142
2143/* 3.2.2.99 */
2144template (value) BSSMAP_IE_DataIdentity
2145ts_BSSMAP_IE_DataIdentity(template (value) DataIdentity data_id) := {
2146 elementIdentifier := '79'O,
2147 lengthIndicator := 0, // overwritten
2148 dataIdentityInfo := data_id
2149};
2150template (present) BSSMAP_IE_DataIdentity
2151tr_BSSMAP_IE_DataIdentity(template (present) DataIdentity data_id) := {
2152 elementIdentifier := '79'O,
2153 lengthIndicator := ?,
2154 dataIdentityInfo := data_id
2155};
2156
2157/* 3.2.2.52 */
2158template (value) BSSMAP_IE_AssignmentRequirement
2159ts_BSSMAP_IE_AssRequirement(template (value) OCT1 ass_rqm) := {
2160 elementIdentifier := '33'O,
2161 assignmentRequirement := ass_rqm
2162}
2163template (present) BSSMAP_IE_AssignmentRequirement
2164tr_BSSMAP_IE_AssRequirement(template (present) OCT1 ass_rqm) := {
2165 elementIdentifier := '33'O,
2166 assignmentRequirement := ass_rqm
2167}
2168
2169/* 3.2.2.89 */
2170function ts_BSSMAP_IE_TalkerPriority(template (omit) BIT2 prio)
2171return template (omit) BSSMAP_IE_TalkerPriority {
2172 if (istemplatekind(prio, "omit")) {
2173 return omit;
2174 } else {
2175 var template (present) BSSMAP_IE_TalkerPriority tp := {
2176 elementIdentifier := '6A'O,
2177 priority := prio,
2178 spare := '000000'B
2179 };
2180 return tp;
2181 }
2182}
2183function tr_BSSMAP_IE_TalkerPriority(template BIT2 prio)
2184return template BSSMAP_IE_TalkerPriority {
2185 if (istemplatekind(prio, "omit")) {
2186 return omit;
2187 } else if (istemplatekind(prio, "*")) {
2188 return *;
2189 } else {
2190 var template BSSMAP_IE_TalkerPriority tp := {
2191 elementIdentifier := '6A'O,
2192 priority := prio,
2193 spare := ?
2194 }
2195 return tp;
2196 }
2197}
2198
2199/* 3.2.2.90 */
2200template (value) BSSMAP_IE_EmergencySetIndication
2201ts_BSSMAP_IE_EmergencySetIndication := {
2202 elementIdentifier := '6B'O
2203}
2204template (present) BSSMAP_IE_EmergencySetIndication
2205tr_BSSMAP_IE_EmergencySetIndication := {
2206 elementIdentifier := '6B'O
2207}
2208
2209
2210
2211
2212/* Section 3.2.1.50 */
2213template (value) PDU_BSSAP
2214ts_BSSMAP_VGCS_VBS_Setup(template (value) GroupCallRef group_call_ref,
2215 template (omit) BSSMAP_IE_VGCS_FeatureFlags feature_flags := omit)
2216modifies ts_BSSAP_BSSMAP := {
2217 pdu := {
2218 bssmap := {
2219 vGCS_VBSSetup := {
2220 messageType := '04'O,
2221 groupCallReference := ts_BSSMAP_IE_GroupCallRef(group_call_ref),
2222 priority := omit,
2223 vGCS_FeatureFlags := feature_flags
2224 }
2225 }
2226 }
2227}
2228template (present) PDU_BSSAP
2229tr_BSSMAP_VGCS_VBS_Setup(template (present) GroupCallRef group_call_ref,
2230 template BSSMAP_IE_VGCS_FeatureFlags feature_flags := *)
2231modifies tr_BSSAP_BSSMAP := {
2232 pdu := {
2233 bssmap := {
2234 vGCS_VBSSetup := {
2235 messageType := '04'O,
2236 groupCallReference := tr_BSSMAP_IE_GroupCallRef(group_call_ref),
2237 priority := *,
2238 vGCS_FeatureFlags := feature_flags
2239 }
2240 }
2241 }
2242}
2243
2244/* Section 3.2.1.51 */
2245template (value) PDU_BSSAP
2246ts_BSSMAP_VGCS_VBS_SetupAck(template (omit) BSSMAP_IE_VGCS_FeatureFlags feature_flags := omit)
2247modifies ts_BSSAP_BSSMAP := {
2248 pdu := {
2249 bssmap := {
2250 vGCS_VBSSetupAck := {
2251 messageType := '05'O,
2252 vGCS_FeatureFlags := feature_flags
2253 }
2254 }
2255 }
2256}
2257template (present) PDU_BSSAP
2258tr_BSSMAP_VGCS_VBS_SetupAck(template BSSMAP_IE_VGCS_FeatureFlags feature_flags := *)
2259modifies tr_BSSAP_BSSMAP := {
2260 pdu := {
2261 bssmap := {
2262 vGCS_VBSSetupAck := {
2263 messageType := '05'O,
2264 vGCS_FeatureFlags := feature_flags
2265 }
2266 }
2267 }
2268}
2269
2270/* Section 3.2.1.52 */
2271template (value) PDU_BSSAP
2272ts_BSSMAP_VGCS_VBS_SetupRefuse(BssmapCause cause)
2273modifies ts_BSSAP_BSSMAP := {
2274 pdu := {
2275 bssmap := {
2276 vGCS_VBSSetupRefuse := {
2277 messageType := '06'O,
2278 cause := ts_BSSMAP_IE_Cause(cause)
2279 }
2280 }
2281 }
2282}
2283template (present) PDU_BSSAP
2284tr_BSSMAP_VGCS_VBS_SetupRefuse(template (present) myBSSMAP_Cause cause := ?)
2285modifies tr_BSSAP_BSSMAP := {
2286 pdu := {
2287 bssmap := {
2288 vGCS_VBSSetupRefuse := {
2289 messageType := '06'O,
2290 cause := tr_BSSMAP_IE_Cause(cause)
2291 }
2292 }
2293 }
2294}
2295
2296/* Section 3.2.1.53 */
2297template (value) PDU_BSSAP
2298ts_BSSMAP_VGCS_VBS_AssignmentReq(template (value) BSSMAP_IE_ChannelType ch_type,
2299 template (value) OCT1 ass_requirement,
2300 template (value) BSSMAP_IE_CellIdentifier cell_id,
2301 template (value) GroupCallRef group_call_ref,
2302 template (omit) BSSMAP_IE_CircuitIdentityCode cic := omit,
2303 template (omit) BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
Andreas Eversbergd26bba02023-05-17 15:05:43 +02002304 template (omit) OCT4 call_id := omit,
2305 template (omit) BSSMAP_IE_SpeechCodecList codecList := omit)
Harald Welte44d055f2023-04-17 09:18:55 +08002306modifies ts_BSSAP_BSSMAP := {
2307 pdu := {
2308 bssmap := {
2309 vGCS_VBSAssignmentRequest := {
2310 messageType := '07'O, /* overwritten */
2311 channelType := ch_type,
2312 assignmentRequirement := ts_BSSMAP_IE_AssRequirement(ass_requirement),
2313 cellIdentifier := cell_id,
2314 groupCallReference := ts_BSSMAP_IE_GroupCallRef(group_call_ref),
2315 priority := omit,
2316 circuitIdentityCode := cic,
2317 downLinkDTX_Flag := omit,
2318 encryptionInformation := omit,
2319 vSTK_RAND := omit,
2320 vSTK := omit,
2321 cellIdentifierListSegment := omit,
2322 aoIPTransportLayer := aoip,
2323 callIdentifier := ts_BSSMAP_IE_CallIdentifier(call_id),
Andreas Eversbergd26bba02023-05-17 15:05:43 +02002324 codecList := codecList
Harald Welte44d055f2023-04-17 09:18:55 +08002325 }
2326 }
2327 }
2328}
2329template (present) PDU_BSSAP
2330tr_BSSMAP_VGCS_VBS_AssignmentReq(template (present) BSSMAP_IE_ChannelType ch_type,
2331 template (present) OCT1 ass_requirement,
2332 template (present) BSSMAP_IE_CellIdentifier cell_id,
2333 template (present) GroupCallRef group_call_ref,
2334 template BSSMAP_IE_CircuitIdentityCode cic := *,
Andreas Eversbergd26bba02023-05-17 15:05:43 +02002335 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
2336 template OCT4 call_id := *,
2337 template BSSMAP_IE_SpeechCodecList codecList := *)
Harald Welte44d055f2023-04-17 09:18:55 +08002338modifies tr_BSSAP_BSSMAP := {
2339 pdu := {
2340 bssmap := {
2341 vGCS_VBSAssignmentRequest := {
2342 messageType := '07'O, /* overwritten */
2343 channelType := ch_type,
2344 assignmentRequirement := tr_BSSMAP_IE_AssRequirement(ass_requirement),
2345 cellIdentifier := cell_id,
2346 groupCallReference := tr_BSSMAP_IE_GroupCallRef(group_call_ref),
2347 priority := omit,
2348 circuitIdentityCode := cic,
2349 downLinkDTX_Flag := omit,
2350 encryptionInformation := omit,
2351 vSTK_RAND := omit,
2352 vSTK := omit,
2353 cellIdentifierListSegment := omit,
2354 aoIPTransportLayer := aoip,
2355 callIdentifier := tr_BSSMAP_IE_CallIdentifier(call_id),
Andreas Eversbergd26bba02023-05-17 15:05:43 +02002356 codecList := codecList
Harald Welte44d055f2023-04-17 09:18:55 +08002357 }
2358 }
2359 }
2360}
2361
2362/* Section 3.2.1.54 */
2363template (value) PDU_BSSAP
2364ts_BSSMAP_VGCS_VBS_AssignmentRes(template (value) BSSMAP_IE_ChannelType ch_type,
2365 template (value) BSSMAP_IE_CellIdentifier cell_id,
2366 template (omit) BSSMAP_IE_ChosenChannel chosen_ch := omit,
2367 template (omit) BSSMAP_IE_CircuitIdentityCode cic := omit,
2368 template (omit) BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
2369 template (omit) BSSMAP_IE_SpeechCodec speech_codec := omit,
2370 template (omit) OCT4 call_id := omit)
2371modifies ts_BSSAP_BSSMAP := {
2372 pdu := {
2373 bssmap := {
2374 vGCS_VBSAssignmentResult := {
2375 messageType := '1C'O, /* overwritten */
2376 channelType := ch_type,
2377 cellIdentifier := cell_id,
2378 chosenChannel := chosen_ch,
2379 circuitIdentityCode := cic,
2380 circuitPool := omit,
2381 aoIPTransportLayer := aoip,
2382 speechCodec := speech_codec,
2383 callIdentifier := ts_BSSMAP_IE_CallIdentifier(call_id)
2384 }
2385 }
2386 }
2387}
2388template (present) PDU_BSSAP
2389tr_BSSMAP_VGCS_VBS_AssignmentRes(template (present) BSSMAP_IE_ChannelType ch_type,
2390 template (present) BSSMAP_IE_CellIdentifier cell_id,
2391 template BSSMAP_IE_ChosenChannel chosen_ch := *,
2392 template BSSMAP_IE_CircuitIdentityCode cic := omit,
Andreas Eversbergd26bba02023-05-17 15:05:43 +02002393 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
2394 template BSSMAP_IE_SpeechCodec speech_codec := *,
2395 template OCT4 call_id := *)
Harald Welte44d055f2023-04-17 09:18:55 +08002396modifies tr_BSSAP_BSSMAP := {
2397 pdu := {
2398 bssmap := {
2399 vGCS_VBSAssignmentResult := {
2400 messageType := '1C'O, /* overwritten */
2401 channelType := ch_type,
2402 cellIdentifier := cell_id,
2403 chosenChannel := chosen_ch,
2404 circuitIdentityCode := cic,
2405 circuitPool := *,
2406 aoIPTransportLayer := aoip,
2407 speechCodec := speech_codec,
2408 callIdentifier := tr_BSSMAP_IE_CallIdentifier(call_id)
2409 }
2410 }
2411 }
2412}
2413
2414/* Section 3.2.1.55 */
2415template (value) PDU_BSSAP
2416ts_BSSMAP_VGCS_VBS_AssignmentFail(BssmapCause cause)
2417modifies ts_BSSAP_BSSMAP := {
2418 pdu := {
2419 bssmap := {
2420 vGCS_VBSAssignmentFailure := {
2421 messageType := '1D'O, /* overwritten */
2422 cause := ts_BSSMAP_IE_Cause(cause),
2423 /* we only implement AoIP for now... */
2424 circuitPool := omit,
Andreas Eversberg74528062023-07-27 16:04:10 +02002425 circuitPoolList := omit,
2426 codecList := omit
Harald Welte44d055f2023-04-17 09:18:55 +08002427 }
2428 }
2429 }
2430}
2431template (present) PDU_BSSAP
2432tr_BSSMAP_VGCS_VBS_AssignmentFail(template (present) myBSSMAP_Cause cause := ?)
2433modifies tr_BSSAP_BSSMAP := {
2434 pdu := {
2435 bssmap := {
2436 vGCS_VBSAssignmentFailure := {
2437 messageType := '1D'O, /* overwritten */
2438 cause := tr_BSSMAP_IE_Cause(cause),
2439 /* we only implement AoIP for now... */
2440 circuitPool := omit,
Andreas Eversberg74528062023-07-27 16:04:10 +02002441 circuitPoolList := omit,
2442 codecList := omit
Harald Welte44d055f2023-04-17 09:18:55 +08002443 }
2444 }
2445 }
2446}
2447
2448/* Section 3.2.1.56 */
2449template (value) PDU_BSSAP
2450ts_BSSMAP_VGCS_VBS_QueuingInd
2451modifies ts_BSSAP_BSSMAP := {
2452 pdu := {
2453 bssmap := {
2454 vGCS_VBSQueuingIndication := {
2455 messageType := '1E'O
2456 }
2457 }
2458 }
2459}
2460template (present) PDU_BSSAP
2461tr_BSSMAP_VGCS_VBS_QueuingInd
2462modifies tr_BSSAP_BSSMAP := {
2463 pdu := {
2464 bssmap := {
2465 vGCS_VBSQueuingIndication := {
2466 messageType := '1E'O
2467 }
2468 }
2469 }
2470}
2471
2472/* Section 3.2.1.57 */
Andreas Eversberg6561a1d2023-06-01 16:00:39 +02002473template (value) PDU_BSSAP ts_BSSMAP_UplinkReq
2474modifies ts_BSSAP_BSSMAP := {
2475 pdu := {
2476 bssmap := {
2477 uplinkRequest := {
2478 messageType := '1F'O,
2479 talkerPriority := omit,
2480 cellIdentifier := omit,
2481 layer3Information := omit,
2482 mobileIdentity := omit
2483 }
2484 }
2485 }
2486}
2487template (present) PDU_BSSAP tr_BSSMAP_UplinkReq
2488modifies tr_BSSAP_BSSMAP := {
2489 pdu := {
2490 bssmap := {
2491 uplinkRequest := {
2492 messageType := '1F'O,
2493 talkerPriority := *,
2494 cellIdentifier := *,
2495 layer3Information := *,
2496 mobileIdentity := *
2497 }
2498 }
2499 }
2500}
Harald Welte44d055f2023-04-17 09:18:55 +08002501template (value) PDU_BSSAP
2502ts_BSSMAP_UplinkReq_L3(template (value) BIT2 priority,
2503 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2504 template (value) octetstring l3_info)
2505modifies ts_BSSAP_BSSMAP := {
2506 pdu := {
2507 bssmap := {
2508 uplinkRequest := {
2509 messageType := '1F'O,
2510 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2511 cellIdentifier := cell_id,
2512 layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
2513 mobileIdentity := omit
2514 }
2515 }
2516 }
2517}
2518template (present) PDU_BSSAP
2519tr_BSSMAP_UplinkReq_L3(template (present) BIT2 priority,
2520 template BSSMAP_IE_CellIdentifier cell_id,
2521 template (present) octetstring l3_info)
2522modifies tr_BSSAP_BSSMAP := {
2523 pdu := {
2524 bssmap := {
2525 uplinkRequest := {
2526 messageType := '1F'O,
2527 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2528 cellIdentifier := cell_id,
2529 layer3Information := tr_BSSMAP_IE_L3Info(l3_info),
2530 mobileIdentity := omit
2531 }
2532 }
2533 }
2534}
2535template (value) PDU_BSSAP
2536ts_BSSMAP_UplinkReq_MI(template (omit) BIT2 priority,
2537 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2538 template (value) BSSMAP_IE_MobileIdentity mobile_id)
2539modifies ts_BSSAP_BSSMAP := {
2540 pdu := {
2541 bssmap := {
2542 uplinkRequest := {
2543 messageType := '1F'O,
2544 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2545 cellIdentifier := cell_id,
2546 layer3Information := omit,
2547 mobileIdentity := mobile_id
2548 }
2549 }
2550 }
2551}
2552template (present) PDU_BSSAP
2553tr_BSSMAP_UplinkReq_MI(template BIT2 priority,
2554 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2555 template (present) BSSMAP_IE_MobileIdentity mobile_id)
2556modifies tr_BSSAP_BSSMAP := {
2557 pdu := {
2558 bssmap := {
2559 uplinkRequest := {
2560 messageType := '1F'O,
2561 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2562 cellIdentifier := cell_id,
2563 layer3Information := omit,
2564 mobileIdentity := mobile_id
2565 }
2566 }
2567 }
2568}
2569
2570/* 3.2.1.58 */
2571template (value) PDU_BSSAP
2572ts_BSSMAP_UplinkReqAck(template (omit) BIT2 priority,
2573 template (omit) BSSMAP_IE_EmergencySetIndication ems := omit,
2574 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2575modifies ts_BSSAP_BSSMAP := {
2576 pdu := {
2577 bssmap := {
2578 uplinkRequestAck := {
2579 messageType := '27'O,
2580 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2581 emergencySetIndication := ems,
2582 talkerIdentity := talker_id
2583 }
2584 }
2585 }
2586}
2587template (present) PDU_BSSAP
2588tr_BSSMAP_UplinkReqAck(template BIT2 priority,
2589 template BSSMAP_IE_EmergencySetIndication ems := *,
2590 template BSSMAP_IE_TalkerIdentity talker_id := *)
2591modifies tr_BSSAP_BSSMAP := {
2592 pdu := {
2593 bssmap := {
2594 uplinkRequestAck := {
2595 messageType := '27'O,
2596 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2597 emergencySetIndication := ems,
2598 talkerIdentity := talker_id
2599 }
2600 }
2601 }
2602}
2603
2604/* 3.2.1.59 */
2605template (value) PDU_BSSAP
2606ts_BSSMAP_UplinkReqConf(template (value) BSSMAP_IE_CellIdentifier cell_id,
2607 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit,
2608 template (value) octetstring l3_info)
2609modifies ts_BSSAP_BSSMAP := {
2610 pdu := {
2611 bssmap := {
2612 uplinkRequestConfirmation := {
2613 messageType := '49'O,
2614 cellIdentifier := cell_id,
2615 talkerIdentity := talker_id,
2616 layer3Information := ts_BSSMAP_IE_L3Info(l3_info)
2617 }
2618 }
2619 }
2620}
2621template (present) PDU_BSSAP
2622tr_BSSMAP_UplinkReqConf(template (present) BSSMAP_IE_CellIdentifier cell_id,
2623 template BSSMAP_IE_TalkerIdentity talker_id := *,
2624 template (present) octetstring l3_info)
2625modifies tr_BSSAP_BSSMAP := {
2626 pdu := {
2627 bssmap := {
2628 uplinkRequestConfirmation := {
2629 messageType := '49'O,
2630 cellIdentifier := cell_id,
2631 talkerIdentity := talker_id,
2632 layer3Information := tr_BSSMAP_IE_L3Info(l3_info)
2633 }
2634 }
2635 }
2636}
2637
2638
2639/* 3.2.1.60 */
2640template (value) PDU_BSSAP
2641ts_BSSMAP_UplinkRelInd(BssmapCause cause, template (omit) BIT2 prio)
2642modifies ts_BSSAP_BSSMAP := {
2643 pdu := {
2644 bssmap := {
2645 uplinkReleaseIndication := {
2646 messageType := '4A'O,
2647 cause := ts_BSSMAP_IE_Cause(cause),
2648 talkerPriority := ts_BSSMAP_IE_TalkerPriority(prio)
2649 }
2650 }
2651 }
2652}
2653template (present) PDU_BSSAP
2654tr_BSSMAP_UplinkRelInd(template (present) myBSSMAP_Cause cause, template BIT2 prio)
2655modifies tr_BSSAP_BSSMAP := {
2656 pdu := {
2657 bssmap := {
2658 uplinkReleaseIndication := {
2659 messageType := '4A'O,
2660 cause := tr_BSSMAP_IE_Cause(cause),
2661 talkerPriority := tr_BSSMAP_IE_TalkerPriority(prio)
2662 }
2663 }
2664 }
2665}
2666
2667
2668/* 3.2.1.61 */
2669template (value) PDU_BSSAP
2670ts_BSSMAP_UplinkRejCmd(BssmapCause cause,
2671 template (omit) BIT2 cur_talker_prio := omit,
2672 template (omit) BIT2 rej_talker_prio := omit,
2673 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2674modifies ts_BSSAP_BSSMAP := {
2675 pdu := {
2676 bssmap := {
2677 uplinkRejectCommand := {
2678 messageType := '4B'O,
2679 cause := ts_BSSMAP_IE_Cause(cause),
2680 currentTalkerPriority := ts_BSSMAP_IE_TalkerPriority(cur_talker_prio),
2681 rejectedTalkerPriority := ts_BSSMAP_IE_TalkerPriority(rej_talker_prio),
2682 talkerIdentity := talker_id
2683 }
2684 }
2685 }
2686}
2687template (present) PDU_BSSAP
2688tr_BSSMAP_UplinkRejCmd(template (present) myBSSMAP_Cause cause,
2689 template BIT2 cur_talker_prio := *,
2690 template BIT2 rej_talker_prio := *,
2691 template BSSMAP_IE_TalkerIdentity talker_id := *)
2692modifies tr_BSSAP_BSSMAP := {
2693 pdu := {
2694 bssmap := {
2695 uplinkRejectCommand := {
2696 messageType := '4B'O,
2697 cause := tr_BSSMAP_IE_Cause(cause),
2698 currentTalkerPriority := tr_BSSMAP_IE_TalkerPriority(cur_talker_prio),
2699 rejectedTalkerPriority := tr_BSSMAP_IE_TalkerPriority(rej_talker_prio),
2700 talkerIdentity := talker_id
2701 }
2702 }
2703 }
2704}
2705
2706
2707/* 3.2.1.62 */
2708template (value) PDU_BSSAP
2709ts_BSSMAP_UplinkRelCmd(BssmapCause cause)
2710modifies ts_BSSAP_BSSMAP := {
2711 pdu := {
2712 bssmap := {
2713 uplinkReleaseCommand := {
2714 messageType := '4C'O,
2715 cause := ts_BSSMAP_IE_Cause(cause)
2716 }
2717 }
2718 }
2719}
2720template (present) PDU_BSSAP
2721tr_BSSMAP_UplinkRelCmd(template (present) myBSSMAP_Cause cause)
2722modifies tr_BSSAP_BSSMAP := {
2723 pdu := {
2724 bssmap := {
2725 uplinkReleaseCommand := {
2726 messageType := '4C'O,
2727 cause := tr_BSSMAP_IE_Cause(cause)
2728 }
2729 }
2730 }
2731}
2732
2733
2734/* 3.2.1.63 */
2735template (value) PDU_BSSAP
2736ts_BSSMAP_UplinkSeizedCmd(BssmapCause cause,
2737 template (omit) BIT2 talker_prio := omit,
2738 template (omit) BSSMAP_IE_EmergencySetIndication emerg := omit,
2739 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2740modifies ts_BSSAP_BSSMAP := {
2741 pdu := {
2742 bssmap := {
2743 uplinkSeizedCommand := {
2744 messageType := '4D'O,
2745 cause := ts_BSSMAP_IE_Cause(cause),
2746 talkerPriority := ts_BSSMAP_IE_TalkerPriority(talker_prio),
2747 emergencySetIndication := emerg,
2748 talkerIdentity := talker_id
2749 }
2750 }
2751 }
2752}
2753template (present) PDU_BSSAP
2754tr_BSSMAP_UplinkSeizedCmd(template (present) myBSSMAP_Cause cause,
2755 template BIT2 talker_prio := *,
2756 template BSSMAP_IE_EmergencySetIndication emerg := *,
2757 template BSSMAP_IE_TalkerIdentity talker_id := *)
2758modifies tr_BSSAP_BSSMAP := {
2759 pdu := {
2760 bssmap := {
2761 uplinkSeizedCommand := {
2762 messageType := '4D'O,
2763 cause := tr_BSSMAP_IE_Cause(cause),
2764 talkerPriority := tr_BSSMAP_IE_TalkerPriority(talker_prio),
2765 emergencySetIndication := emerg,
2766 talkerIdentity := talker_id
2767 }
2768 }
2769 }
2770}
2771
2772
2773
2774/* Section 3.2.1.82 */
2775template (value) PDU_BSSAP
2776ts_BSSMAP_NotificationData(template (value) OCT9 app_data, template (value) DataIdentity data_identity)
2777modifies ts_BSSAP_BSSMAP := {
2778 pdu := {
2779 bssmap := {
2780 notificationData := {
2781 messageType := '62'O,
2782 applicationData := ts_BSSMAP_IE_ApplicationData(app_data),
2783 dataIdentity := ts_BSSMAP_IE_DataIdentity(data_identity),
2784 mSISDN := omit
2785 }
2786 }
2787 }
2788}
2789template (present) PDU_BSSAP
2790tr_BSSMAP_NotificationData(template (present) OCT9 app_data, template (present) DataIdentity data_identity)
2791modifies ts_BSSAP_BSSMAP := {
2792 pdu := {
2793 bssmap := {
2794 notificationData := {
2795 messageType := '62'O,
2796 applicationData := tr_BSSMAP_IE_ApplicationData(app_data),
2797 dataIdentity := tr_BSSMAP_IE_DataIdentity(data_identity),
2798 mSISDN := ?
2799 }
2800 }
2801 }
2802}
2803
2804
2805
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03002806template (value) PDU_BSSAP
2807ts_BSSMAP_Perform_Location_Request(template (omit) BSSMAP_IE_IMSI imsi,
2808 template (omit) BSSMAP_IE_CellIdentifier cellIdentifier := omit,
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03002809 template (omit) BSSMAP_IE_LCSClientType clientType := ts_BSSMAP_IE_LCSClientType,
2810 template (omit) BSSMAP_IE_LCSPriority priority := ts_BSSMAP_IE_LCSPriority,
2811 template (omit) BSSMAP_IE_LCSQOS qos := ts_BSSMAP_IE_LCSQOS)
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002812modifies ts_BSSAP_BSSMAP := {
2813 pdu := {
2814 bssmap := {
2815 performLocationRequest := {
2816 messageType := '2B'O,
2817 locationType := ts_BSSMAP_IE_LocationType,
2818 cellIdentifier := cellIdentifier,
2819 classmarkInformationType3 := omit,
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03002820 lCS_ClientType := clientType,
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002821 chosenChannel := omit,
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03002822 lCS_Priority := priority,
2823 lCS_QOS := qos,
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002824 gPS_AssistanceData := omit,
2825 aPDU := omit,
2826 iMSI := imsi,
2827 iMEI := omit,
2828 gANSS_LocationType := omit,
2829 gANSS_AssistanceData := omit
2830 }
2831 }
2832 }
2833}
2834
2835template (present) BSSMAP_IE_LocationEstimate tr_BSSMAP_IE_LocationEstimate(template (present) octetstring geo_loc := ?)
2836:= {
2837 elementIdentifier := '45'O,
2838 lengthIndicator := ?,
2839 geographicLocation := geo_loc
2840}
2841
2842function tr_BSSMAP_LcsCause(template (present) BSSMAP_LcsCause cause)
2843return template (omit) BSSMAP_IE_LCSCause {
2844 if (istemplatekind(cause, "omit")) {
2845 return omit;
2846 }
2847 var template BSSMAP_IE_LCSCause ie := {
2848 elementIdentifier := '47'O,
2849 lengthIndicator := 1,
2850 causeValue := int2bit(enum2int(valueof(cause)), 8),
2851 diagnosticValue := omit
2852 }
2853 return ie;
2854}
2855
2856template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Response(
2857 template BSSMAP_IE_LocationEstimate locationEstimate := *,
2858 template BSSMAP_IE_PositioningData positioningData := *,
2859 template BSSMAP_IE_LCSCause lCS_Cause := *
2860 )
2861modifies tr_BSSAP_BSSMAP := {
2862 pdu := {
2863 bssmap := {
2864 performLocationResponse := {
2865 messageType := '2D'O,
2866 locationEstimate := locationEstimate,
2867 positioningData := positioningData,
2868 decipheringKeys := *,
2869 lCS_Cause := lCS_Cause,
2870 velocityEstimate := *,
2871 gANSS_PositioningData := *
2872 }
2873 }
2874 }
2875}
2876
2877template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Abort(template (present) BSSMAP_IE_LCSCause lCS_Cause := ?)
2878modifies tr_BSSAP_BSSMAP := {
2879 pdu := {
2880 bssmap := {
2881 performLocationAbort := {
2882 messageType := '2E'O,
2883 lCS_Cause := lCS_Cause
2884 }
2885 }
2886 }
2887}
Harald Weltec859df52017-11-24 23:41:41 +01002888
Harald Welteb69533d2017-12-15 13:55:17 +01002889} with { encode "RAW" };