blob: c564cfd2ecb7664454c23d4f121a89698fe814cb [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
352type uint16_t BssmapLAC;
353type uint16_t BssmapCI;
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100354type uint16_t BssmapSAC;
Harald Weltec76f29f2017-11-22 12:46:46 +0100355
Harald Welteae8ce232018-01-21 13:56:46 +0100356template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100357modifies ts_BSSMAP_IE_CellID := {
358 cellIdentification := {
Harald Welteae8ce232018-01-21 13:56:46 +0100359 cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100360 }
361}
Harald Weltec76f29f2017-11-22 12:46:46 +0100362
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100363template (value) BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci)
Harald Weltec76f29f2017-11-22 12:46:46 +0100364modifies ts_BSSMAP_IE_CellID := {
365 cellIdentification := {
366 cI_LAC_CI := {
367 lac := int2oct(lac, 2),
368 ci := int2oct(ci, 2)
369 }
370 }
371}
372
373template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci)
374modifies ts_BSSMAP_IE_CellID := {
375 cellIdentification := {
376 cI_CI := int2oct(ci, 2)
377 }
378}
379
380template BSSMAP_IE_CellIdentifier ts_CellId_none
381modifies ts_BSSMAP_IE_CellID := {
382 cellIdentification := {
383 cI_noCell := ''O
384 }
385}
386
Pau Espin Pedrola8ef3be2022-02-16 16:21:17 +0100387template (value) BSSMAP_IE_CellIdentifier ts_CellID_SAI(OCT3 mcc_mnc, BssmapLAC lac, BssmapSAC sac)
388modifies ts_BSSMAP_IE_CellID := {
389 cellIdentification := {
390 cI_SAI := {
391 mcc_mnc := mcc_mnc,
392 lac := int2oct(lac, 2),
393 sac := int2oct(sac, 2)
394 }
395 }
396}
397
Harald Weltec76f29f2017-11-22 12:46:46 +0100398
Harald Welte44d055f2023-04-17 09:18:55 +0800399template (value) BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(template (value) octetstring l3info) := {
Harald Weltec76f29f2017-11-22 12:46:46 +0100400 elementIdentifier := '17'O,
401 lengthIndicator := 0,
402 layer3info := l3info
403}
404
Harald Welte44d055f2023-04-17 09:18:55 +0800405template (present) BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template (present) octetstring l3info) := {
Harald Weltef8a0bda2017-12-09 00:53:17 +0100406 elementIdentifier := '17'O,
407 lengthIndicator := ?,
408 layer3info := l3info
409}
410
411
Harald Weltec76f29f2017-11-22 12:46:46 +0100412template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info)
413modifies ts_BSSAP_BSSMAP := {
414 pdu := {
415 bssmap := {
416 completeLayer3Information := {
417 messageType := '57'O,
418 cellIdentifier := cell_id,
419 layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
420 chosenChannel := omit,
421 lSAIdentifier := omit,
422 aPDU := omit,
423 codecList := omit,
424 redirectAttemptFlag := omit,
425 sendSequenceNumber := omit,
426 iMSI := omit
427 }
428 }
429 }
430}
431
Harald Weltef8a0bda2017-12-09 00:53:17 +0100432template PDU_BSSAP tr_BSSMAP_ComplL3(template octetstring l3_info := ?,
Vadim Yanitskiya47cd4e2021-12-04 20:05:04 +0300433 template BSSMAP_IE_CellIdentifier cell_id := ?,
434 template BSSMAP_IE_SpeechCodecList codec_list := *)
Harald Weltef8a0bda2017-12-09 00:53:17 +0100435modifies tr_BSSAP_BSSMAP := {
Harald Welte365f4ed2017-11-23 00:00:43 +0100436 pdu := {
437 bssmap := {
Harald Weltef8a0bda2017-12-09 00:53:17 +0100438 completeLayer3Information := {
439 messageType := '57'O,
440 cellIdentifier := cell_id,
441 layer3Information := tr_BSSMAP_IE_L3Info(l3_info),
442 chosenChannel := *,
443 lSAIdentifier := *,
444 aPDU := *,
Vadim Yanitskiya47cd4e2021-12-04 20:05:04 +0300445 codecList := codec_list,
Harald Weltef8a0bda2017-12-09 00:53:17 +0100446 redirectAttemptFlag := *,
447 sendSequenceNumber := *,
448 iMSI := *
449 }
Harald Welte365f4ed2017-11-23 00:00:43 +0100450 }
451 }
452}
453
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200454template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(template BSSMAP_FIELD_CellIdentificationList cid_list) := {
Harald Welte28d943e2017-11-25 15:00:50 +0100455 elementIdentifier := '1A'O,
456 lengthIndicator := 0, /* overwritten */
457 cellIdentifierDiscriminator := '0000'B, /* overwritten */
458 spare1_4 := '0000'B,
459 cellIdentificationList := cid_list
460}
Harald Welte365f4ed2017-11-23 00:00:43 +0100461
Harald Welte4bf5fc92017-12-15 13:56:06 +0100462const OCT1 ChRate_ANY := '00'O;
Harald Welte365f4ed2017-11-23 00:00:43 +0100463const OCT1 ChRate_TCHF := '08'O;
464const OCT1 ChRate_TCHH := '09'O;
Harald Welte4bf5fc92017-12-15 13:56:06 +0100465const OCT1 ChRate_TCHForH_Fpref := '0A'O;
466const OCT1 ChRate_TCHForH_Hpref := '0B'O;
467const OCT1 ChRate_TCHForH_Fpref_nochg := '1A'O;
468const OCT1 ChRate_TCHForH_Hpref_nochg := '1B'O;
469const OCT1 ChRate_TCHForH := '0F'O;
470const OCT1 ChRate_TCHForH_nochg := '1F'O;
Harald Welte365f4ed2017-11-23 00:00:43 +0100471
Harald Weltedbd6b3f2018-03-21 18:45:02 +0100472const OCT1 Spdi_TCHF_FR := '01'O;
473const OCT1 Spdi_TCHF_EFR := '11'O;
474const OCT1 Spdi_TCHF_AMR := '21'O;
475const OCT1 Spdi_TCHH_HR := '05'O;
476const OCT1 Spdi_TCHH_AMR := '25'O;
477
Harald Welte365f4ed2017-11-23 00:00:43 +0100478template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := {
479 elementIdentifier := '0B'O, /* overwritten */
480 lengthIndicator := 0, /* overwritten */
481 speechOrDataIndicator := '0001'B, /* speech */
482 spare1_4 := '0000'B,
483 channelRateAndType := ChRate_TCHF,
Harald Weltedbd6b3f2018-03-21 18:45:02 +0100484 speechId_DataIndicator := Spdi_TCHF_FR
Harald Welte365f4ed2017-11-23 00:00:43 +0100485}
486
Harald Welte4bf5fc92017-12-15 13:56:06 +0100487template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCTM modifies ts_BSSMAP_IE_ChannelType := {
488 speechOrDataIndicator := '0100'B /* speech + CTM */
489}
490
491template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeCSD := {
492 elementIdentifier := '0B'O, /* overwritten */
493 lengthIndicator := 0, /* overwritten */
494 speechOrDataIndicator := '0010'B, /* data */
495 spare1_4 := '0000'B,
496 channelRateAndType := ChRate_TCHF,
497 speechId_DataIndicator := '10'O /* 9600 bps / transparent */
498}
499
500template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelTypeSIGNAL := {
501 elementIdentifier := '0B'O, /* overwritten */
502 lengthIndicator := 0, /* overwritten */
503 speechOrDataIndicator := '0011'B, /* data */
504 spare1_4 := '0000'B,
505 channelRateAndType := ChRate_ANY,
506 speechId_DataIndicator := '00'O /* spare */
507}
508
509template (value) BSSMAP_IE_EncryptionInformation ts_BSSMAP_IE_EncrInfo(OCT8 kc, OCT1 algs := '05'O) := {
510 elementIdentifier := '0A'O,
511 lengthIndicator := 0, /* overwritten */
512 permittedAlgorithms := algs,
513 key := kc
514}
515
Harald Welte16114282018-01-24 22:41:21 +0100516template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := {
517 elementIdentifier := '0A'O,
518 lengthIndicator := ?, /* overwritten */
519 permittedAlgorithms := algs,
520 key := kc
521}
522
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +0200523template BSSMAP_IE_ChosenEncryptionAlgorithm ts_BSSMAP_IE_ChosenEncryptionAlgorithm(OCT1 algorithmIdentifier) := {
524 elementIdentifier := '2C'O,
525 algorithmIdentifier := algorithmIdentifier
526}
Harald Welte16114282018-01-24 22:41:21 +0100527
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +0200528template BSSMAP_IE_ChosenEncryptionAlgorithm tr_BSSMAP_IE_ChosenEncryptionAlgorithm(template OCT1 algorithmIdentifier := ?) := {
529 elementIdentifier := '2C'O,
530 algorithmIdentifier := algorithmIdentifier
531}
Harald Welte4bf5fc92017-12-15 13:56:06 +0100532
Harald Welte365f4ed2017-11-23 00:00:43 +0100533template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := {
534 elementIdentifier := '01'O, /* overwritten */
535 cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)),
536 cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5))
537}
538
Pau Espin Pedrol43021cb2019-06-18 17:32:15 +0200539function f_bssmap_ie_cic_2_int(BSSMAP_IE_CircuitIdentityCode cic_ie) return integer {
540 var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow);
541 return cic;
542}
543
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100544template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr,
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100545 uint16_t udp_port,
546 integer len) := {
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100547 elementIdentifier := '7C'O,
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100548 lengthIndicator := len, /* overwritten */
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100549 ipAddress := addr,
550 uDPPortValue := udp_port
551}
Harald Welte235ebf12017-12-15 14:18:16 +0100552template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) :=
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100553 ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6);
Harald Welte235ebf12017-12-15 14:18:16 +0100554template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) :=
Harald Welteb6e1d7e2018-01-26 21:38:59 +0100555 ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18);
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100556
Pau Espin Pedrol6a846bc2020-09-04 13:01:22 +0200557function f_ts_BSSMAP_IE_AoIP_TLA(charstring addr, uint16_t udp_port)
558 return template (value) BSSMAP_IE_AoIP_TransportLayerAddress {
559 if (f_addr_is_ipv6(addr)) {
560 var OCT16 ip6 := f_inet6_addr(addr);
561 return ts_BSSMAP_IE_AoIP_TLA6(ip6, udp_port);
562 } else {
563 var OCT4 ip := f_inet_addr(addr);
564 return ts_BSSMAP_IE_AoIP_TLA4(ip, udp_port);
565 }
566}
567
Neels Hofmeyr3c89a6b2019-10-15 16:54:37 +0200568template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA(template BSSMAP_FIELD_IPAddress addr,
569 template uint16_t udp_port,
570 template integer len := ?) := {
571 elementIdentifier := '7C'O,
572 lengthIndicator := len,
573 ipAddress := addr,
574 uDPPortValue := udp_port
575}
576template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA4(template OCT4 ip, template uint16_t pt) :=
577 tr_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6);
578template BSSMAP_IE_AoIP_TransportLayerAddress tr_BSSMAP_IE_AoIP_TLA6(template OCT16 ip, template uint16_t pt) :=
579 tr_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18);
580
Pau Espin Pedrol6a846bc2020-09-04 13:01:22 +0200581function f_tr_BSSMAP_IE_AoIP_TLA(charstring addr, template uint16_t udp_port)
582 return template BSSMAP_IE_AoIP_TransportLayerAddress {
583 if (f_addr_is_ipv6(addr)) {
584 var OCT16 ip6 := f_inet6_addr(addr);
585 return tr_BSSMAP_IE_AoIP_TLA6(ip6, udp_port);
586 } else {
587 var OCT4 ip := f_inet_addr(addr);
588 return tr_BSSMAP_IE_AoIP_TLA4(ip, udp_port);
589 }
590}
591
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +0200592template (present) BSSMAP_IE_KC128 tr_BSSMAP_IE_Kc128(template (present) OCT16 kc128) := {
593 elementIdentifier := '83'O,
594 kC128_Value := kc128
595}
596
Harald Welte4bf5fc92017-12-15 13:56:06 +0100597template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := {
598 elementIdentifier := '83'O,
599 kC128_Value := kc128
600}
601
Harald Weltef1b64e22017-12-15 14:55:14 +0100602/* 3.2.2.103 */
603template (value) BSSMAP_FIELD_CodecElement ts_CodecBase := {
604 codecType := GSM_FR,
605 tF := '0'B,
606 pT := '0'B,
607 pI := '0'B,
608 fI := '1'B,
609 extendedCodecType := omit,
610 s0_7 := omit,
611 s8_15 := omit
612}
613template (value) BSSMAP_FIELD_CodecElement ts_CodecFR modifies ts_CodecBase := {
614 codecType := GSM_FR
615}
616template (value) BSSMAP_FIELD_CodecElement ts_CodecEFR modifies ts_CodecBase := {
617 codecType := GSM_EFR
618}
619template (value) BSSMAP_FIELD_CodecElement ts_CodecHR modifies ts_CodecBase := {
620 codecType := GSM_HR
621}
622template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_F modifies ts_CodecBase := {
623 codecType := FR_AMR,
624 s0_7 := '11111111'B,
625 s8_15 := '01010111'B /* S11, S13 and S15 are reserved and coded with zeroes */
626}
627template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_H modifies ts_CodecBase := {
628 codecType := HR_AMR,
629 s0_7 := '00111111'B,
630 s8_15 := '00000111'B /* S6 - S7 and S11 – S15 are reserved and coded with zeroes */
631}
Neels Hofmeyra47a8c62022-04-07 00:31:19 +0200632template (value) BSSMAP_FIELD_CodecElement ts_CodecAMR_WB modifies ts_CodecBase := {
633 codecType := FR_AMR_WB,
634 s0_7 := '00000001'B
635}
Oliver Smithdd002752023-02-21 13:35:00 +0100636template (value) BSSMAP_FIELD_CodecElement ts_CodecCSData modifies ts_CodecBase := {
637 codecType := CodecExtension,
638 tF := '0'B, /* Spare */
639 pT := '0'B, /* CSDoTDM */
640 pI := '1'B, /* CSDoIP */
641 fI := '0'B, /* Spare */
642 extendedCodecType := 'FD'O, /* CSData */
643 s0_7 := '00000000'B /* R2, R3, Spare */
644}
Harald Weltef1b64e22017-12-15 14:55:14 +0100645template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := {
646 elementIdentifier := '7D'O,
647 lengthIndicator := 0, /* overwritten */
648 codecElements := valueof(elem)
649}
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100650template BSSMAP_IE_SpeechCodec ts_BSSMAP_IE_SpeechCodec(template BSSMAP_FIELD_CodecElements elem) := {
651 elementIdentifier := '7E'O,
652 lengthIndicator := 0, /* overwritten */
653 codecElements := valueof(elem)
654}
Harald Weltef1b64e22017-12-15 14:55:14 +0100655
Harald Welte44d055f2023-04-17 09:18:55 +0800656function ts_BSSMAP_IE_CallIdentifier(template (omit) OCT4 cid) return template (omit) BSSMAP_IE_CallIdentifier {
657 if (istemplatekind(cid, "omit")) {
658 return omit;
659 } else {
660 var template (present) BSSMAP_IE_CallIdentifier ie := {
661 elementIdentifier := '7F'O,
662 callIdentifierInfo := cid
663 }
664 return ie;
665 }
666}
667function tr_BSSMAP_IE_CallIdentifier(template OCT4 cid) return template BSSMAP_IE_CallIdentifier {
668 if (istemplatekind(cid, "*")) {
669 return *;
670 } else if (istemplatekind(cid, "omit")) {
671 return omit;
672 } else {
673 var template BSSMAP_IE_CallIdentifier ie := {
674 elementIdentifier := '7F'O,
675 callIdentifierInfo := cid
676 }
677 return ie;
678 }
679}
680
681
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200682template (present) BSSMAP_IE_Osmo_OsmuxCID tr_OsmuxCID(template (present) INT1 cid := ?) := {
683 elementIdentifier := 'F1'O,
684 osmuxCID := cid
685}
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200686template (value) BSSMAP_IE_Osmo_OsmuxCID ts_OsmuxCID(INT1 cid) := {
687 elementIdentifier := 'F1'O,
688 osmuxCID := cid
689}
690
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100691template PDU_BSSAP
692ts_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200693 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
694 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit)
Harald Welte365f4ed2017-11-23 00:00:43 +0100695modifies ts_BSSAP_BSSMAP := {
696 pdu := {
697 bssmap := {
698 assignmentRequest := {
699 messageType :='01'O, /* overwritten */
700 channelType := ts_BSSMAP_IE_ChannelType,
701 layer3HeaderInfo := omit,
702 priority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100703 circuitIdentityCode := cic,
Harald Welte365f4ed2017-11-23 00:00:43 +0100704 downLinkDTX_Flag := omit,
705 interferenceBandToBeUsed := omit,
706 classmarkInformationType2 := omit,
707 groupCallReference := omit,
708 talkerFlag := omit,
709 configurationEvolutionIndication := omit,
710 lsaAccesControlSuppression := omit,
711 serviceHandover := omit,
712 encryptionInformation := omit,
713 talkerPriority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100714 aoIPTransportLayer := aoip,
Harald Welte365f4ed2017-11-23 00:00:43 +0100715 codecList := omit,
716 callIdentifier := omit,
717 kC128 := omit,
718 globalCallReference := omit,
719 lCLS_Configuration := omit,
720 lCLS_ConnectionStatusControl := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200721 lCLS_CorrelationNotNeeded := omit,
722 osmuxCID := osmuxCID
Harald Welte365f4ed2017-11-23 00:00:43 +0100723 }
724 }
725 }
726}
Harald Weltec76f29f2017-11-22 12:46:46 +0100727
Harald Weltebe48a7c2018-01-26 21:39:25 +0100728template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200729 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
730 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *)
Harald Weltebe48a7c2018-01-26 21:39:25 +0100731modifies tr_BSSAP_BSSMAP := {
Harald Welteb3414b22017-11-23 18:22:10 +0100732 pdu := {
733 bssmap := {
734 assignmentRequest := {
735 messageType :='01'O, /* overwritten */
736 channelType := ?,
737 layer3HeaderInfo := *,
738 priority := *,
Harald Weltebe48a7c2018-01-26 21:39:25 +0100739 circuitIdentityCode := cic,
Harald Welteb3414b22017-11-23 18:22:10 +0100740 downLinkDTX_Flag := *,
741 interferenceBandToBeUsed := *,
742 classmarkInformationType2 := *,
743 groupCallReference := *,
744 talkerFlag := *,
745 configurationEvolutionIndication := *,
746 lsaAccesControlSuppression := *,
747 serviceHandover := *,
748 encryptionInformation := *,
749 talkerPriority := *,
Harald Weltebe48a7c2018-01-26 21:39:25 +0100750 aoIPTransportLayer := aoip,
Harald Welteb3414b22017-11-23 18:22:10 +0100751 codecList := *,
752 callIdentifier := *,
753 kC128 := *,
754 globalCallReference := *,
755 lCLS_Configuration := *,
756 lCLS_ConnectionStatusControl := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200757 lCLS_CorrelationNotNeeded := *,
758 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100759 }
760 }
761 }
762}
763
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100764template PDU_BSSAP
765ts_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := omit,
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100766 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200767 template BSSMAP_IE_SpeechCodec speechCodec := omit,
768 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := omit)
Harald Welteb3414b22017-11-23 18:22:10 +0100769modifies ts_BSSAP_BSSMAP := {
770 pdu := {
771 bssmap := {
772 assignmentComplete := {
773 messageType :='02'O, /* overwritten */
Harald Welte7ed2b082017-11-23 18:52:13 +0100774 rR_Cause := omit,
Harald Welteb3414b22017-11-23 18:22:10 +0100775 circuitIdentityCode := cic,
776 cellIdentifier := omit,
777 chosenChannel := omit,
778 chosenEncryptionAlgorithm := omit,
779 circuitPool := omit,
780 speechVersion := omit,
781 lSAIdentifier := omit,
782 talkerPriority := omit,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100783 aoIPTransportLayer := aoip,
Neels Hofmeyr82fd04b2019-02-28 08:43:00 +0100784 speechCodec := speechCodec,
Harald Welteb3414b22017-11-23 18:22:10 +0100785 codecList := omit,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200786 lCLS_BSS_Status := omit,
787 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100788 }
789 }
790 }
791}
792
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100793template PDU_BSSAP tr_BSSMAP_AssignmentComplete(template BSSMAP_IE_CircuitIdentityCode cic := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200794 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *,
795 template BSSMAP_IE_Osmo_OsmuxCID osmuxCID := *)
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100796modifies tr_BSSAP_BSSMAP := {
Harald Welteb3414b22017-11-23 18:22:10 +0100797 pdu := {
798 bssmap := {
799 assignmentComplete := {
800 messageType := '02'O, /* overwritten */
Harald Welte7ed2b082017-11-23 18:52:13 +0100801 rR_Cause := *,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100802 circuitIdentityCode := cic,
Harald Welteb3414b22017-11-23 18:22:10 +0100803 cellIdentifier := *,
804 chosenChannel := *,
805 chosenEncryptionAlgorithm := *,
806 circuitPool := *,
807 speechVersion := *,
808 lSAIdentifier := *,
809 talkerPriority := *,
Harald Weltecc7e4dc2017-12-14 21:55:10 +0100810 aoIPTransportLayer := aoip,
Harald Welteb3414b22017-11-23 18:22:10 +0100811 speechCodec := *,
812 codecList := *,
Pau Espin Pedrol5eff9752019-05-23 15:03:54 +0200813 lCLS_BSS_Status := *,
814 osmuxCID := osmuxCID
Harald Welteb3414b22017-11-23 18:22:10 +0100815 }
816 }
817 }
818}
819
Harald Welte16a4adf2017-12-14 18:54:01 +0100820template PDU_BSSAP tr_BSSMAP_AssignmentFail modifies tr_BSSAP_BSSMAP := {
821 pdu := {
822 bssmap := {
823 assignmentFailure := {
824 messageType := '03'O, /* overwritten */
825 rR_Cause := *,
826 circuitPool := *,
827 circuitPoolList := *,
828 talkerPriority := *,
829 codecList := *
830 }
831 }
832 }
833}
834
835
Harald Welteb3414b22017-11-23 18:22:10 +0100836template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause)
837modifies ts_BSSAP_BSSMAP := {
838 pdu := {
839 bssmap := {
840 clearCommand := {
841 messageType := '20'O, /* overwritten */
842 layer3HeaderInfo := omit,
843 cause := ts_BSSMAP_IE_Cause(cause),
844 cSFB_Indication := omit
845 }
846 }
847 }
848}
Harald Welte99787102019-02-04 10:41:36 +0100849template (value) PDU_BSSAP ts_BSSMAP_ClearCommandCSFB(BssmapCause cause)
850modifies ts_BSSMAP_ClearCommand := {
851 pdu := {
852 bssmap := {
853 clearCommand := {
854 cSFB_Indication := {
855 elementIdentifier := '8F'O
856 }
857 }
858 }
859 }
860}
Harald Welteb3414b22017-11-23 18:22:10 +0100861
862template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := {
863 pdu := {
864 bssmap := {
865 clearCommand := {
866 messageType := '20'O, /* overwritten */
867 layer3HeaderInfo := *,
868 cause := ?,
869 cSFB_Indication := *
870 }
871 }
872 }
873}
874
Harald Welte4c422b72019-02-17 16:27:10 +0100875template PDU_BSSAP tr_BSSMAP_ClearCommandCSFB modifies tr_BSSAP_BSSMAP := {
876 pdu := {
877 bssmap := {
878 clearCommand := {
879 messageType := '20'O, /* overwritten */
880 layer3HeaderInfo := *,
881 cause := ?,
882 cSFB_Indication := {
883 elementIdentifier := '8F'O
884 }
885 }
886 }
887 }
888}
889
Harald Welteb3414b22017-11-23 18:22:10 +0100890template (value) PDU_BSSAP ts_BSSMAP_ClearComplete
891modifies ts_BSSAP_BSSMAP := {
892 pdu := {
893 bssmap := {
894 clearComplete := {
895 messageType := '21'O /* overwritten */
896 }
897 }
898 }
899}
900
Harald Weltec859df52017-11-24 23:41:41 +0100901template PDU_BSSAP tr_BSSMAP_ClearComplete modifies tr_BSSAP_BSSMAP := {
902 pdu := {
903 bssmap := {
904 clearComplete := {
905 messageType := '21'O
906 }
907 }
908 }
909}
910
Harald Weltebc881782018-01-23 20:09:15 +0100911template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause)
912modifies ts_BSSAP_BSSMAP := {
913 pdu := {
914 bssmap := {
915 clearRequest := {
916 messageType := '22'O, /* overwritten */
917 cause := ts_BSSMAP_IE_Cause(cause)
918 }
919 }
920 }
921}
922
Harald Weltecfa79ad2017-12-09 22:33:47 +0100923template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := {
924 pdu := {
925 bssmap := {
926 clearRequest := {
927 messageType := '22'O, /* overwritten */
928 cause := ?
929 }
930 }
931 }
932}
933
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200934template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause,
Pau Espin Pedrol35801c32021-04-19 13:03:20 +0200935 template BSSMAP_FIELD_CellIdentificationList cid_list,
936 template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit)
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200937modifies ts_BSSAP_BSSMAP := {
938 pdu := {
939 bssmap := {
940 handoverRequired := {
941 messageType := '11'O,
942 cause := ts_BSSMAP_IE_Cause(cause),
943 responseRequest := omit,
944 cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list),
945 circuitPoolList := omit,
946 currentChannelType1 := omit,
947 speechVersion := omit,
948 queueingIndicator := omit,
Pau Espin Pedrol35801c32021-04-19 13:03:20 +0200949 oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs),
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200950 sourceToTargetRNCTransparentInfo := omit,
951 sourceToTargetRNCTransparentInfoCDMA := omit,
952 gERANClassmark := omit,
953 talkerPriority := omit,
954 speechCodec := omit,
955 cSG_Identifier := omit
956 }
957 }
958 }
959}
960
961
Oliver Smithc9a5f532022-10-21 11:32:23 +0200962template PDU_BSSAP tr_BSSMAP_HandoverRequired(template BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := *,
963 template (present) BSSMAP_FIELD_CellIdentificationList cid_list := ?)
964modifies tr_BSSAP_BSSMAP := {
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +0100965 pdu := {
966 bssmap := {
967 handoverRequired := {
Pau Espin Pedrol35801c32021-04-19 13:03:20 +0200968 messageType := '11'O,
Oliver Smithc9a5f532022-10-21 11:32:23 +0200969 cellIdentifierList := {
970 cellIdentificationList := cid_list
971 },
Pau Espin Pedrol35801c32021-04-19 13:03:20 +0200972 oldToNewBSSInfo := f_tr_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs)
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +0100973 }
974 }
975 }
976}
977
Neels Hofmeyr0ac63152019-05-07 01:20:17 +0200978template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := {
979 pdu := {
980 bssmap := {
981 handoverRequiredReject := {
982 messageType := '1A'O
983 }
984 }
985 }
986}
987
988template PDU_BSSAP tr_BSSMAP_HandoverCommand
989modifies tr_BSSAP_BSSMAP := {
990 pdu := {
991 bssmap := {
992 handoverCommand := {
993 messageType := '13'O
994 }
995 }
996 }
997}
998
999template PDU_BSSAP tr_BSSMAP_HandoverSucceeded
1000modifies tr_BSSAP_BSSMAP := {
1001 pdu := {
1002 bssmap := {
1003 handoverSucceeded := {
1004 messageType := '15'O
1005 }
1006 }
1007 }
1008}
1009
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001010template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info)
1011modifies ts_BSSAP_BSSMAP := {
1012 pdu := {
1013 bssmap := {
1014 handoverCommand := {
1015 messageType := '13'O,
1016 layer3Information := {
1017 elementIdentifier := '17'O,
1018 lengthIndicator := 0,
1019 layer3info := layer3info
1020 },
1021 cellIdentifier := omit,
1022 newBSSToOldBSSInfo := omit,
1023 talkerPriority := omit
1024 }
1025 }
1026 }
1027}
1028
Neels Hofmeyr61ebb8b2018-10-09 18:28:06 +02001029template PDU_BSSAP tr_BSSMAP_HandoverFailure modifies tr_BSSAP_BSSMAP := {
1030 pdu := {
1031 bssmap := {
1032 handoverFailure := {
1033 messageType := '16'O,
1034 cause := ?,
1035 rR_Cause := *,
1036 circuitPool := *,
1037 circuitPoolList := *,
1038 gERANClassmark := *,
1039 newBSSToOldBSSInfo := *,
1040 interSystemInformation := *,
1041 talkerPriority := *,
1042 codecList := *
1043 }
1044 }
1045 }
1046}
1047
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001048template PDU_BSSAP tr_BSSMAP_HandoverRequest(template BSSMAP_IE_EncryptionInformation encryptionInformation := *,
1049 template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := *,
Vadim Yanitskiy6fe5d4e2022-08-04 04:04:54 +07001050 template BSSMAP_IE_KC128 kC128 := *,
1051 template BSSMAP_IE_SpeechCodecList codecList := *
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001052 )
1053 modifies tr_BSSAP_BSSMAP := {
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001054 pdu := {
1055 bssmap := {
1056 handoverRequest := {
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001057 messageType := '10'O,
1058 encryptionInformation := encryptionInformation,
1059 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
Vadim Yanitskiy6fe5d4e2022-08-04 04:04:54 +07001060 codecList := codecList,
Neels Hofmeyr0d841d92021-06-21 22:27:21 +02001061 kC128 := kC128
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001062 }
1063 }
1064 }
1065}
1066
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001067template PDU_BSSAP ts_BSSMAP_HandoverRequest(
1068 template BSSMAP_IE_CircuitIdentityCode cic := omit,
1069 template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit,
1070 template BSSMAP_IE_CellIdentifier cell_id_target := ts_CellID_LAC_CI(1, 0),
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +02001071 template BSSMAP_IE_CellIdentifier cell_id_source := ts_CellID_LAC_CI(1, 1),
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001072 template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit,
1073 template BSSMAP_IE_EncryptionInformation encryptionInformation := ts_BSSMAP_IE_EncrInfo('0000000000000000'O,'01'O),
1074 template (omit) BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit,
Neels Hofmeyr9fe13202022-03-04 00:05:43 +01001075 template (omit) BSSMAP_IE_KC128 kC128 := omit,
1076 template (omit) BSSMAP_IE_SpeechCodecList codecList := omit
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001077 )
1078modifies ts_BSSAP_BSSMAP := {
1079 pdu := {
1080 bssmap := {
1081 handoverRequest := {
1082 messageType := '10'O,
1083 channelType := ts_BSSMAP_IE_ChannelType,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001084 encryptionInformation := encryptionInformation,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001085 classmarkInformationType := {
1086 classmarkInformationType1 := {
1087 elementIdentifier := '1D'O,
1088 rf_PowerCapability := '000'B,
1089 a5_1 := '0'B,
1090 esind := '0'B,
1091 revisionLevel := '10'B,
1092 spare1_1 := '0'B
1093 }
1094 },
1095 cellIdentifierSource := cell_id_source,
1096 priority := omit,
1097 circuitIdentityCode := cic,
1098 downLinkDTX_Flag := omit,
1099 cellIdentifierTarget := cell_id_target,
1100 interferenceBandToBeUsed := omit,
1101 cause := omit,
1102 classmarkInformationType3 := omit,
1103 currentChannelType1 := omit,
1104 speechVersion := omit,
1105 groupCallReference := omit,
1106 talkerFlag := omit,
1107 configurationEvolutionIndication := omit,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001108 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
Pau Espin Pedrolc08d5522021-04-16 15:40:38 +02001109 oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs),
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001110 lSAInformation := omit,
1111 lSAAccessControlSuppression := omit,
1112 serviceHandover := omit,
1113 iMSI_bssmap := omit,
1114 sourceToTargetRNCTransparentInfo := omit,
1115 sourceToTargetRNCTransparentInfoCDMA := omit,
1116 sNAAccessInformation := omit,
1117 talkerPriority := omit,
1118 aoIPTransportLayer := aoip_tla,
Neels Hofmeyr9fe13202022-03-04 00:05:43 +01001119 codecList := codecList,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001120 callIdentifier := omit,
Neels Hofmeyr1d8dece2021-06-21 05:25:46 +02001121 kC128 := kC128,
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001122 globalCallReference := omit,
1123 lCLS_Configuration := omit,
1124 connectionStatusControl := omit
1125 }
1126 }
1127 }
1128}
1129
1130template PDU_BSSAP tr_BSSMAP_HandoverRequestAcknowledge(template octetstring layer3info)
1131modifies tr_BSSAP_BSSMAP := {
1132 pdu := {
1133 bssmap := {
1134 handoverRequestAck := {
1135 messageType := '12'O,
1136 layer3Information := {
1137 elementIdentifier := '17'O,
1138 lengthIndicator := ?,
1139 layer3info := layer3info
1140 }
1141 }
1142 }
1143 }
1144}
1145
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001146template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge(
1147 template octetstring layer3info,
1148 template LIN1 layer3infoLength,
1149 template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit,
1150 template BSSMAP_IE_SpeechCodec speechCodec := omit,
1151 template BSSMAP_IE_ChosenChannel chosenChannel := omit,
1152 template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit)
1153modifies ts_BSSAP_BSSMAP := {
1154 pdu := {
1155 bssmap := {
1156 handoverRequestAck := {
1157 messageType := '12'O,
1158 layer3Information := {
1159 elementIdentifier := '17'O,
1160 lengthIndicator := layer3infoLength,
1161 layer3info := layer3info
1162 },
1163 chosenChannel := chosenChannel,
1164 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm,
1165 circuitPool := omit,
1166 speechVersion := omit,
1167 circuitIdentityCode := omit,
1168 lSAIdentifier := omit,
1169 newBSSToOldBSSInfo := omit,
1170 interSystemInformation := omit,
1171 talkerPriority := omit,
1172 aoIPTransportLayer := aoIPTransportLayer,
1173 codecList := omit,
1174 speechCodec := speechCodec,
1175 lCLS_bSS_Status := omit
1176 }
1177 }
1178 }
1179}
1180
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001181template PDU_BSSAP tr_BSSMAP_HandoverDetect
1182modifies tr_BSSAP_BSSMAP := {
1183 pdu := {
1184 bssmap := {
1185 handoverDetect := {
1186 messageType := '1B'O,
1187 talkerPriority := *
1188 }
1189 }
1190 }
1191}
1192
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001193template PDU_BSSAP ts_BSSMAP_HandoverDetect
1194modifies ts_BSSAP_BSSMAP := {
1195 pdu := {
1196 bssmap := {
1197 handoverDetect := {
1198 messageType := '1B'O,
1199 talkerPriority := omit
1200 }
1201 }
1202 }
1203}
1204
Neels Hofmeyrbd0ef932018-03-19 14:58:46 +01001205template PDU_BSSAP tr_BSSMAP_HandoverComplete
1206modifies tr_BSSAP_BSSMAP := {
1207 pdu := {
1208 bssmap := {
1209 handoverComplete := {
1210 messageType := '14'O,
1211 rR_Cause := *,
1212 talkerPriority := *,
1213 speechCodec := *,
1214 codecList := *,
1215 chosenEncryptionAlgorithm := *,
1216 chosenChannel := *,
1217 lCLS_BSS_Status := *
1218 }
1219 }
1220 }
1221}
Harald Weltecfa79ad2017-12-09 22:33:47 +01001222
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001223template PDU_BSSAP ts_BSSMAP_HandoverComplete
1224modifies ts_BSSAP_BSSMAP := {
1225 pdu := {
1226 bssmap := {
1227 handoverComplete := {
1228 messageType := '14'O,
1229 rR_Cause := omit,
1230 talkerPriority := omit,
1231 speechCodec := omit,
1232 codecList := omit,
1233 chosenEncryptionAlgorithm := omit,
1234 chosenChannel := omit,
1235 lCLS_BSS_Status := omit
1236 }
1237 }
1238 }
1239}
1240
Philipp Maieraee60392018-11-05 17:09:00 +01001241template PDU_BSSAP tr_BSSMAP_HandoverPerformed
1242modifies tr_BSSAP_BSSMAP := {
1243 pdu := {
1244 bssmap := {
1245 handoverPerformed := {
1246 messageType := '17'O,
1247 cause := ?,
1248 cellIdentifier := ?,
Philipp Maier8d33a132018-11-12 11:58:55 +01001249 chosenChannel := *,
1250 chosenEncryptionAlgorithm := *,
1251 speechVersion := *,
1252 lSAIdentifier := *,
1253 talkerPriority := *,
1254 codecList := *,
1255 speechCodec := *,
1256 lCLS_BSS_Status := *
Philipp Maieraee60392018-11-05 17:09:00 +01001257 }
1258 }
1259 }
1260}
1261
Harald Welte28d943e2017-11-25 15:00:50 +01001262template BSSMAP_IE_IMSI ts_BSSMAP_Imsi(hexstring imsi_digits) := {
1263 elementIdentifier := '08'O,
1264 lengthIndicator := 0, /* overwritten */
1265 typeOfIdentity := '001'B, /* IMSI */
1266 oddEvenIndicator := f_hex_is_odd_length(imsi_digits),
1267 digits := imsi_digits
1268}
1269
Harald Welte17d21152018-01-27 00:47:11 +01001270template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := {
1271 elementIdentifier := '08'O,
1272 lengthIndicator := ?, /* overwritten */
1273 typeOfIdentity := '001'B, /* IMSI */
1274 oddEvenIndicator := ?,
1275 digits := imsi_digits
1276}
1277
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001278template (value) BSSAMAP_IE_LastUsedEUTRANPLMNId ts_BSSMAP_LastUsedEUTRANPLMNId(OCT3 mcc_mnc) := {
1279 elementIdentifier := '95'O,
1280 mcc_mnc := mcc_mnc
1281}
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001282template BSSAMAP_IE_LastUsedEUTRANPLMNId tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc) := {
1283 elementIdentifier := '95'O,
1284 mcc_mnc := mcc_mnc
1285}
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001286function f_ts_BSSMAP_LastUsedEUTRANPLMNId(template (omit) OCT3 mcc_mnc)
1287 return template (omit) BSSAMAP_IE_LastUsedEUTRANPLMNId {
1288 if (not istemplatekind(mcc_mnc, "omit")) {
1289 return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc));
1290 } else {
1291 return omit;
1292 }
1293}
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001294function f_tr_BSSMAP_LastUsedEUTRANPLMNId(template OCT3 mcc_mnc)
1295return template BSSAMAP_IE_LastUsedEUTRANPLMNId {
1296 if (istemplatekind(mcc_mnc, "*")) {
1297 return *;
1298 } else if (istemplatekind(mcc_mnc, "?")) {
1299 return ?;
1300 } else if (istemplatekind(mcc_mnc, "omit")) {
1301 return omit;
1302 } else {
1303 return ts_BSSMAP_LastUsedEUTRANPLMNId(valueof(mcc_mnc));
1304 }
1305}
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001306
Harald Welte72cecfa2017-12-11 19:50:14 +01001307template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := {
1308 cIl_noCell := ''O
1309}
Harald Welteaba42162019-06-19 18:17:59 +02001310template (value) BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_BSS := {
1311 cIl_allInBSS := ''O
1312}
1313template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_BSS := {
1314 cIl_allInBSS := ''O
1315}
1316
1317template (value) BSSMAP_FIELD_CellIdentificationList
1318 ts_BSSMAP_CIL_CGI(template (value) BSSMAP_FIELD_CellIdentificationList_CGI cgil) := {
1319 cIl_CGI := cgil
1320}
1321template BSSMAP_FIELD_CellIdentificationList
1322 tr_BSSMAP_CIL_CGI(template BSSMAP_FIELD_CellIdentificationList_CGI cgil) := {
1323 cIl_CGI := cgil
1324}
1325
1326template (value) BSSMAP_FIELD_CellIdentificationList
1327 ts_BSSMAP_CIL_LAC_CI(template (value) BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := {
1328 cIl_LAC_CI := lac_cil
1329}
1330template BSSMAP_FIELD_CellIdentificationList
1331 tr_BSSMAP_CIL_LAC_CI(template BSSMAP_FIELD_CellIdentificationList_LAC_CI lac_cil) := {
1332 cIl_LAC_CI := lac_cil
1333}
1334
1335template (value) BSSMAP_FIELD_CellIdentificationList
1336 ts_BSSMAP_CIL_CI(template (value) RecordOfOCT2 cil) := {
1337 cIl_CI := cil
1338}
1339template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_CI(template RecordOfOCT2 cil) := {
1340 cIl_CI := cil
1341}
1342
1343template (value) BSSMAP_FIELD_CellIdentificationList
1344 ts_BSSMAP_CIL_LAI(template (value) BSSMAP_FIELD_CellIdentificationList_LAI lail) := {
1345 cIl_LAI := lail
1346}
1347template BSSMAP_FIELD_CellIdentificationList
1348 tr_BSSMAP_CIL_LAI(template BSSMAP_FIELD_CellIdentificationList_LAI lail) := {
1349 cIl_LAI := lail
1350}
1351
1352template (value) BSSMAP_FIELD_CellIdentificationList
1353 ts_BSSMAP_CIL_LAC(template (value) RecordOfOCT2 lacl) := {
1354 cIl_LAC := lacl
1355}
1356template BSSMAP_FIELD_CellIdentificationList tr_BSSMAP_CIL_LAC(template RecordOfOCT2 lacl) := {
1357 cIl_LAC := lacl
1358}
1359
Harald Welte72cecfa2017-12-11 19:50:14 +01001360
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001361function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 {
Harald Welte24135bd2018-03-17 19:27:53 +01001362 if (lengthof(mnc) == 2) {
1363 return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]);
Stefan Sperling83348bc2018-03-14 17:44:40 +01001364 } else {
1365 return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]);
1366 }
Harald Welte72cecfa2017-12-11 19:50:14 +01001367}
1368
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001369function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) {
1370 var hexstring hs := oct2hex(mcc_mnc);
1371 mcc := hs[1] & hs[0] & hs[3];
1372 mnc := hs[5] & hs[4];
1373 if (hs[2] == 'F'H) {
1374 mnc := mnc & hs[2];
1375 }
1376}
1377
Harald Welteaba42162019-06-19 18:17:59 +02001378template (value) BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001379 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1380 lac := int2oct(lac, 2),
1381 ci := int2oct(ci, 2)
1382}
1383
Harald Welteaba42162019-06-19 18:17:59 +02001384template (value) BSSMAP_FIELD_CellIdentification_LAC_CI ts_BSSMAP_CI_LAC_CI(GsmLac lac, GsmCellId ci) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001385 lac := int2oct(lac, 2),
1386 ci := int2oct(ci, 2)
1387}
1388
Harald Welteaba42162019-06-19 18:17:59 +02001389template (value) BSSMAP_FIELD_CellIdentification_LAI ts_BSSMAP_CI_LAI(GsmMcc mcc, GsmMnc mnc, GsmLac lac) := {
Harald Welte72cecfa2017-12-11 19:50:14 +01001390 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1391 lac := int2oct(lac, 2)
1392}
1393
Harald Welteaba42162019-06-19 18:17:59 +02001394template (value) OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2);
1395template (value) OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2);
Harald Welte72cecfa2017-12-11 19:50:14 +01001396
Harald Welteaba42162019-06-19 18:17:59 +02001397template (value) BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC
Harald Welte751d3eb2018-01-31 15:51:06 +01001398ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := {
1399 mcc_mnc := f_enc_mcc_mnc(mcc, mnc),
1400 lac := int2oct(lac, 2),
1401 rncId := int2oct(rnc_id, 2)
1402}
1403
Harald Welteaba42162019-06-19 18:17:59 +02001404template (value) BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := {
Harald Welte751d3eb2018-01-31 15:51:06 +01001405 lac := int2oct(lac, 2),
1406 rncId := int2oct(rnc_id, 2)
1407}
1408
Harald Welte72cecfa2017-12-11 19:50:14 +01001409template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := {
1410 elementIdentifier := '24'O,
1411 channel := chneed,
1412 spare := '000000'B
1413}
1414
1415template BSSMAP_IE_TMSI ts_BSSMAP_IE_TMSI(OCT4 tmsi) := {
1416 elementIdentifier := '09'O,
1417 lengthIndicator := 4,
1418 tmsiOctets := tmsi
1419};
1420
Harald Welte17d21152018-01-27 00:47:11 +01001421template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := {
1422 elementIdentifier := '09'O,
1423 lengthIndicator := 4,
1424 tmsiOctets := tmsi
1425};
1426
Harald Welte72cecfa2017-12-11 19:50:14 +01001427private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI {
1428 var template BSSMAP_IE_TMSI ret;
1429 if (ispresent(tmsi)) {
1430 ret := ts_BSSMAP_IE_TMSI(valueof(tmsi));
1431 } else {
1432 ret := omit;
1433 }
1434 return ret;
1435}
1436
1437template PDU_BSSAP ts_BSSMAP_Paging(hexstring imsi_digits,
1438 template BSSMAP_FIELD_CellIdentificationList cid_list,
1439 template OCT4 tmsi := omit,
1440 template BSSMAP_IE_ChannelNeeded chneed := omit)
Harald Welte28d943e2017-11-25 15:00:50 +01001441modifies ts_BSSAP_BSSMAP := {
1442 pdu := {
1443 bssmap := {
1444 paging := {
Harald Welte17d21152018-01-27 00:47:11 +01001445 messageType := '52'O,
Harald Welte28d943e2017-11-25 15:00:50 +01001446 iMSI := ts_BSSMAP_Imsi(imsi_digits),
Harald Welte72cecfa2017-12-11 19:50:14 +01001447 tMSI := f_tmsi_or_omit(tmsi),
Neels Hofmeyr0ac63152019-05-07 01:20:17 +02001448 cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list),
Harald Welte72cecfa2017-12-11 19:50:14 +01001449 channelNeeded := chneed,
Harald Welte28d943e2017-11-25 15:00:50 +01001450 eMLPP_Priority := omit,
1451 pagingInformation := omit /* only VGCS/VBS flag */
1452 }
1453 }
1454 }
1455}
1456
Harald Welte17d21152018-01-27 00:47:11 +01001457template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?,
1458 template OCT4 tmsi := *,
1459 template BSSMAP_IE_ChannelNeeded chneed := *)
1460modifies tr_BSSAP_BSSMAP := {
1461 pdu := {
1462 bssmap := {
1463 paging := {
1464 messageType := '52'O,
1465 iMSI := tr_BSSMAP_Imsi(imsi_digits),
1466 tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent,
1467 cellIdentifierList := ?,
1468 channelNeeded := chneed,
1469 eMLPP_Priority := omit,
1470 pagingInformation := omit /* only VGCS/VBS flag */
1471 }
1472 }
1473 }
1474}
1475
1476
Harald Welte73cd2712017-12-17 00:44:52 +01001477template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key)
1478modifies ts_BSSAP_BSSMAP := {
1479 pdu := {
1480 bssmap := {
1481 cipherModeCommand := {
1482 messageType := '53'O,
1483 layer3HeaderInfo := omit,
1484 encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg),
1485 cipherResponseMode := omit,
1486 kC128 := omit
1487 }
1488 }
1489 }
1490}
1491
1492template PDU_BSSAP ts_BSSMAP_CipherModeCmdKc128(OCT1 alg, OCT8 key, OCT16 kc128)
1493modifies ts_BSSAP_BSSMAP := {
1494 pdu := {
1495 bssmap := {
1496 cipherModeCommand := {
1497 messageType := '53'O,
1498 layer3HeaderInfo := omit,
1499 encryptionInformation := ts_BSSMAP_IE_EncrInfo(key, alg),
1500 cipherResponseMode := omit,
1501 kC128 := { '83'O, kc128 }
1502 }
1503 }
1504 }
1505}
1506
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001507template PDU_BSSAP tr_BSSMAP_CipherModeCmd2(template BSSMAP_IE_EncryptionInformation encryptionInformation := *,
1508 template BSSMAP_IE_KC128 kC128 := *)
Harald Welte16114282018-01-24 22:41:21 +01001509modifies tr_BSSAP_BSSMAP := {
1510 pdu := {
1511 bssmap := {
1512 cipherModeCommand := {
1513 messageType := '53'O,
1514 layer3HeaderInfo := *,
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001515 encryptionInformation := encryptionInformation,
Harald Welte16114282018-01-24 22:41:21 +01001516 cipherResponseMode := *,
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001517 kC128 := kC128
Harald Welte16114282018-01-24 22:41:21 +01001518 }
1519 }
1520 }
1521}
1522
Neels Hofmeyrf7831cb2021-06-23 20:04:58 +02001523template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key, template BSSMAP_IE_KC128 kC128 := omit)
1524 := tr_BSSMAP_CipherModeCmd2(tr_BSSMAP_IE_EncrInfo(key, alg), kC128);
1525
Harald Welte16114282018-01-24 22:41:21 +01001526template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg)
1527modifies ts_BSSAP_BSSMAP := {
1528 pdu := {
1529 bssmap := {
1530 cipherModeComplete := {
1531 messageType := '55'O,
1532 layer3MessageContents := omit,
1533 chosenEncryptionAlgorithm := {
1534 elementIdentifier := '2C'O,
1535 algorithmIdentifier := alg
1536 }
1537 }
1538 }
1539 }
1540}
1541
Stefan Sperlinga2d59c62018-12-18 16:32:44 +01001542template PDU_BSSAP ts_BSSMAP_CipherModeComplAlg(template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := ?)
1543modifies ts_BSSAP_BSSMAP := {
1544 pdu := {
1545 bssmap := {
1546 cipherModeComplete := {
1547 messageType := '55'O,
1548 layer3MessageContents := omit,
1549 chosenEncryptionAlgorithm := chosenEncryptionAlgorithm
1550 }
1551 }
1552 }
1553}
1554
Harald Welte73cd2712017-12-17 00:44:52 +01001555template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := {
1556 pdu := {
1557 bssmap := {
1558 cipherModeComplete := {
1559 messageType := '55'O,
1560 layer3MessageContents := *,
1561 chosenEncryptionAlgorithm := {
1562 elementIdentifier := '2C'O,
1563 algorithmIdentifier := alg
1564 }
1565 }
1566 }
1567 }
1568}
1569
1570template PDU_BSSAP tr_BSSMAP_CipherModeRej modifies tr_BSSAP_BSSMAP := {
1571 pdu := {
1572 bssmap := {
1573 cipherModeReject := {
1574 messageType := '59'O,
1575 cause := ?
1576 }
1577 }
1578 }
1579}
1580
Daniel Willmann52918e52018-09-20 14:39:09 +02001581template PDU_BSSAP tr_BSSMAP_ClassmarkReq modifies tr_BSSAP_BSSMAP := {
1582 pdu := {
1583 bssmap := {
1584 classmarkRequest := {
1585 messageType := '58'O,
1586 talkerPriority := *
1587 }
1588 }
1589 }
1590}
1591
Harald Welte5c2622c2018-01-21 20:45:20 +01001592template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := {
1593 elementIdentifier := '12'O,
1594 lengthIndicator := 0, /* overwritten */
1595 /* CM1 */
1596 rf_PowerCapability := '010'B, /* class3 */
1597 a5_1 := '0'B, /* supported */
1598 esind := '1'B, /* early classmark supported */
1599 revisionLevel := '10'B, /* R99 */
1600 spare1_1 := '0'B,
1601 /* CM2 */
1602 fc := '1'B, /* E-GSM support */
1603 vgcs := '0'B,
1604 vbs := '0'B,
1605 sm_Capability := '1'B,
1606 ss_ScreenIndicator := '00'B,
1607 ps_Capability := '1'B,
1608 spare2_1 := '0'B,
1609 classmarkInformationType2_oct5 := {
1610 a5_2 := '0'B, /* not available */
1611 a5_3 := '1'B, /* available */
1612 cmsp := '0'B, /* not supported */
1613 solsa := '0'B, /* not suported */
1614 ucs2 := '0'B, /* GSM alphabet preferred */
1615 lcsvacap := '0'B, /* not supported */
1616 spare := '0'B,
1617 cm3 := '0'B /* no CM3 */
1618 }
1619}
1620
Eric Wild26f4a622021-05-17 15:27:05 +02001621
1622template BSSMAP_IE_ClassmarkInformationType3 ts_CM3_default := {
1623 elementIdentifier := '13'O,
1624 lengthIndicator := 0, /* overwritten */
1625 classmark3ValuePart := '01'O /* A5/4 supported */
1626}
1627
Harald Welte5c2622c2018-01-21 20:45:20 +01001628template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default,
1629 template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit)
1630modifies ts_BSSAP_BSSMAP := {
1631 pdu := {
1632 bssmap := {
1633 classmarkUpdate := {
1634 messageType := '54'O,
1635 classmarkInformationType2 := cm2,
1636 classmarkInformationType3 := cm3,
1637 talkerPriority := omit
1638 }
1639 }
1640 }
1641}
1642
Harald Welte898113b2018-01-31 18:32:21 +01001643template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *,
1644 template BSSMAP_IE_ClassmarkInformationType3 cm3 := *)
1645modifies tr_BSSAP_BSSMAP := {
1646 pdu := {
1647 bssmap := {
1648 classmarkUpdate := {
1649 messageType := '54'O,
1650 classmarkInformationType2 := cm2,
1651 classmarkInformationType3 := cm3,
1652 talkerPriority := *
1653 }
1654 }
1655 }
1656}
1657
Neels Hofmeyr92b12b72018-09-18 14:30:23 +02001658template PDU_BSSAP ts_BSSMAP_ClassmarkRequest
1659modifies ts_BSSAP_BSSMAP := {
1660 pdu := {
1661 bssmap := {
1662 classmarkRequest := {
1663 messageType := '58'O,
1664 talkerPriority := omit
1665 }
1666 }
1667 }
1668}
1669
Eric Wild26f4a622021-05-17 15:27:05 +02001670template PDU_BSSAP tr_BSSMAP_ClassmarkRequest
1671modifies tr_BSSAP_BSSMAP := {
1672 pdu := {
1673 bssmap := {
1674 classmarkRequest := {
1675 messageType := '58'O,
1676 talkerPriority := *
1677 }
1678 }
1679 }
1680}
1681
Harald Welte49518bf2018-02-10 11:39:19 +01001682/* return Layer3 octetstring inside BSSAP PDU */
1683function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring {
1684 if (ischosen(bssap.pdu.bssmap)) {
1685 var PDU_BSSMAP bssmap := bssap.pdu.bssmap;
1686 if (ischosen(bssmap.completeLayer3Information)) {
1687 return bssmap.completeLayer3Information.layer3Information.layer3info;
1688 } else if (ischosen(bssmap.handoverRequestAck)) {
1689 return bssmap.handoverRequestAck.layer3Information.layer3info;
1690 } else if (ischosen(bssmap.handoverCommand)) {
1691 return bssmap.handoverCommand.layer3Information.layer3info;
1692 } else if (ischosen(bssmap.uplinkRequest)) {
1693 return bssmap.uplinkRequest.layer3Information.layer3info;
1694 } else if (ischosen(bssmap.uplinkRequestConfirmation)) {
1695 return bssmap.uplinkRequestConfirmation.layer3Information.layer3info;
1696 } else if (ischosen(bssmap.uplinkApplicationData)) {
1697 return bssmap.uplinkApplicationData.layer3Information.layer3info;
1698 } else if (ischosen(bssmap.rerouteCommand)) {
1699 return bssmap.rerouteCommand.initialLayer3Information.layer3info;
1700 } else {
1701 return omit;
1702 }
1703 } else {
1704 return bssap.pdu.dtap;
1705 }
1706}
1707
Harald Welte0b50aed2018-05-28 22:33:07 +02001708/* TS 29.205 B.2.1.9 */
1709template (value) GlobalCallReferenceValue ts_GCR(octetstring net_id, OCT2 node_id, OCT5 cref_id) := {
1710 networkIDLengthIndicator := 0, /* overwritten */
1711 networkID := net_id,
1712 nodeIDLengthIndicator := 0, /* overwritten */
1713 nodeID := node_id,
1714 callReferenceIDLengthIndicator := 0, /* overwritten */
1715 callReferenceID := cref_id
1716}
1717template GlobalCallReferenceValue tr_GCR(template octetstring net_id,
1718 template OCT2 node_id,
1719 template OCT5 cref_id) := {
1720 networkIDLengthIndicator := ?,
1721 networkID := net_id,
1722 nodeIDLengthIndicator := ?,
1723 nodeID := node_id,
1724 callReferenceIDLengthIndicator := ?,
1725 callReferenceID := cref_id
1726}
1727
1728/* TS 47.008 3.2.2.115 */
1729template (value) BSSMAP_IE_GlobalCallReference ts_BSSMAP_IE_GCR(template (value) GlobalCallReferenceValue gcr) := {
1730 elementIdentifier := '89'O,
1731 lengthIndicator := 0, /* overwritten */
1732 globalCallReferenceValue := gcr
1733}
1734template BSSMAP_IE_GlobalCallReference tr_BSSMAP_IE_GCR(template GlobalCallReferenceValue gcr) := {
1735 elementIdentifier := '89'O,
1736 lengthIndicator := ?,
1737 globalCallReferenceValue := gcr
1738}
1739
1740/* TS 48.008 3.2.2.116 */
1741const BIT4 LCLS_CFG_both_way := '0000'B;
1742const BIT4 LCLS_CFG_both_way_and_bicast_UL := '0001'B;
1743const BIT4 LCLS_CFG_both_way_and_send_DL := '0010'B;
1744const BIT4 LCLS_CFG_both_way_and_send_DL_block_local_DL := '0011'B;
1745const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL := '0100'B;
1746const BIT4 LCLS_CFG_both_way_and_bicast_UL_send_DL_block_local_DL := '0101'B;
1747
1748template (value) BSSMAP_IE_LCLS_Configuration ts_BSSMAP_IE_LclsCfg(BIT4 cfg_val) := {
1749 elementIdentifier := '8A'O,
1750 lCLS_ConfigurationValue := cfg_val,
1751 spare := '0000'B
1752}
1753template BSSMAP_IE_LCLS_Configuration tr_BSSMAP_IE_LclsCfg(template BIT4 cfg_val) := {
1754 elementIdentifier := '8A'O,
1755 lCLS_ConfigurationValue := cfg_val,
1756 spare := '0000'B
1757}
1758
1759/* TS 48.008 3.2.2.117 */
1760const BIT4 LCLS_CSC_connect := '0000'B;
1761const BIT4 LCLS_CSC_do_not_connect := '0001'B;
1762const BIT4 LCLS_CSC_release_lcls := '0010'B;
1763const BIT4 LCLS_CSC_bicast_UL_at_handover := '0011'B;
1764const BIT4 LCLS_CSC_bicast_UL_and_recv_DL_at_handover := '0100'B;
1765
1766template (value) BSSMAP_IE_LCLS_ConnectionStatusControl ts_BSSMAP_IE_LclsCsc(BIT4 csc) := {
1767 elementIdentifier := '8B'O,
1768 lCLS_ConnectionStatusControlValue := csc,
1769 spare := '0000'B
1770}
1771template BSSMAP_IE_LCLS_ConnectionStatusControl tr_BSSMAP_IE_LclsCsc(template BIT4 csc) := {
1772 elementIdentifier := '8B'O,
1773 lCLS_ConnectionStatusControlValue := csc,
1774 spare := '0000'B
1775}
1776
1777/* TS 48.008 3.2.2.119 */
1778const BIT4 LCLS_STS_not_yet_ls := '0000'B;
1779const BIT4 LCLS_STS_not_possible_ls := '0001'B;
1780const BIT4 LCLS_STS_no_longer_ls := '0010'B;
1781const BIT4 LCLS_STS_req_lcls_not_supp := '0011'B;
1782const BIT4 LCLS_STS_locally_switched := '0100'B;
1783
1784template (value) BSSMAP_IE_LCLS_BSS_Status ts_BSSMAP_IE_LclsSts(BIT4 sts) := {
1785 elementIdentifier := '8D'O,
1786 lCLS_BSS_StatusValue := sts,
1787 spare := '0000'B
1788}
1789template BSSMAP_IE_LCLS_BSS_Status tr_BSSMAP_IE_LclsSts(template BIT4 sts) := {
1790 elementIdentifier := '8D'O,
1791 lCLS_BSS_StatusValue := sts,
1792 spare := '0000'B
1793}
1794
1795/* TS 48.008 3.2.1.91 */
1796template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrl(template (omit) BSSMAP_IE_LCLS_Configuration cfg,
Harald Welte354722e2018-06-01 13:15:32 +02001797 template (omit) BSSMAP_IE_LCLS_ConnectionStatusControl csc) modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001798 pdu := {
1799 bssmap := {
1800 lCLS_ConnectControl := {
1801 messageType := '74'O,
1802 lCLS_Configuration := cfg,
1803 lCLS_ConnectionStatusControl := csc
1804 }
1805 }
1806 }
1807}
1808template PDU_BSSAP tr_BSSMAP_LclsConnCtrl(template BSSMAP_IE_LCLS_Configuration cfg,
Harald Welte354722e2018-06-01 13:15:32 +02001809 template BSSMAP_IE_LCLS_ConnectionStatusControl csc)
1810modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001811 pdu := {
1812 bssmap := {
1813 lCLS_ConnectControl := {
1814 messageType := '74'O,
1815 lCLS_Configuration := cfg,
1816 lCLS_ConnectionStatusControl := csc
1817 }
1818 }
1819 }
1820}
1821
1822/* TS 48.008 3.2.1.92 */
Harald Welte354722e2018-06-01 13:15:32 +02001823template (value) PDU_BSSAP ts_BSSMAP_LclsConnCtrlAck(template (value) BSSMAP_IE_LCLS_BSS_Status sts)
1824modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001825 pdu := {
1826 bssmap := {
1827 lCLS_connectControlAck := {
1828 messageType := '75'O,
1829 lCLS_BSS_Status := sts
1830 }
1831 }
1832 }
1833}
Harald Welte354722e2018-06-01 13:15:32 +02001834template PDU_BSSAP tr_BSSMAP_LclsConnCtrlAck(template BSSMAP_IE_LCLS_BSS_Status sts)
1835modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001836 pdu := {
1837 bssmap := {
1838 lCLS_connectControlAck := {
1839 messageType := '75'O,
1840 lCLS_BSS_Status := sts
1841 }
1842 }
1843 }
1844}
1845
1846/* TS 48.008 3.2.1.93 */
1847template (value) PDU_BSSAP ts_BSSMAP_LclsNotification(template (omit) BSSMAP_IE_LCLS_BSS_Status sts,
Harald Welte354722e2018-06-01 13:15:32 +02001848 template (omit) BSSMAP_IE_LCLS_BreakRequest brq)
1849modifies ts_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001850 pdu := {
1851 bssmap := {
1852 lCLS_Notification := {
1853 messageType := '76'O,
1854 lCLS_BSS_Status := sts,
1855 lCLS_BreakRequest := brq
1856 }
1857 }
1858 }
1859}
1860template PDU_BSSAP tr_BSSMAP_LclsNotification(template BSSMAP_IE_LCLS_BSS_Status sts,
Harald Welte354722e2018-06-01 13:15:32 +02001861 template BSSMAP_IE_LCLS_BreakRequest brq)
1862modifies tr_BSSAP_BSSMAP := {
Harald Welte0b50aed2018-05-28 22:33:07 +02001863 pdu := {
1864 bssmap := {
1865 lCLS_Notification := {
1866 messageType := '76'O,
1867 lCLS_BSS_Status := sts,
1868 lCLS_BreakRequest := brq
1869 }
1870 }
1871 }
1872}
1873
Harald Weltecc0b0142018-05-29 15:19:33 +02001874template PDU_BSSAP tr_BSSMAP_LclsNotificationSts(BIT4 sts)
1875modifies tr_BSSAP_BSSMAP := {
1876 pdu := {
1877 bssmap := {
1878 lCLS_Notification := {
1879 messageType := '76'O,
1880 lCLS_BSS_Status := tr_BSSMAP_IE_LclsSts(sts),
1881 lCLS_BreakRequest := omit
1882 }
1883 }
1884 }
1885}
Harald Welte898113b2018-01-31 18:32:21 +01001886
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001887template PDU_BSSAP ts_BSSMAP_CommonId(hexstring imsi_digits,
1888 template (omit) OCT3 last_eutran_plmn := omit)
Harald Welteeddf0e92020-06-21 19:42:15 +02001889modifies ts_BSSAP_BSSMAP := {
1890 pdu := {
1891 bssmap := {
1892 commonID := {
1893 messageType := '2F'O,
1894 iMSI := ts_BSSMAP_Imsi(imsi_digits),
Pau Espin Pedrold5ba6ce2021-04-15 14:18:13 +02001895 sNAAccessInformation := omit,
1896 selectedPLMNId := omit,
Pau Espin Pedrolee8cec82021-04-15 14:39:05 +02001897 lastUsedEUTRANPLMNId := f_ts_BSSMAP_LastUsedEUTRANPLMNId(last_eutran_plmn)
Harald Welteeddf0e92020-06-21 19:42:15 +02001898 }
1899 }
1900 }
1901}
1902
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001903template PDU_BSSAP tr_BSSMAP_CommonId(template hexstring imsi_digits,
1904 template BSSAMAP_IE_LastUsedEUTRANPLMNId lastUsedEUTRANPLMNId := *)
Harald Welteeddf0e92020-06-21 19:42:15 +02001905modifies tr_BSSAP_BSSMAP := {
1906 pdu := {
1907 bssmap := {
1908 commonID := {
1909 messageType := '2F'O,
1910 iMSI := tr_BSSMAP_Imsi(imsi_digits),
Pau Espin Pedrole979c402021-04-28 17:29:54 +02001911 sNAAccessInformation := *,
1912 selectedPLMNId := *,
1913 lastUsedEUTRANPLMNId := lastUsedEUTRANPLMNId
Harald Welteeddf0e92020-06-21 19:42:15 +02001914 }
1915 }
1916 }
1917}
Harald Welte898113b2018-01-31 18:32:21 +01001918
Vadim Yanitskiy48063962020-08-28 07:49:44 +07001919template PDU_BSSAP tr_BSSMAP_SAPInReject(template (present) GsmSapi sapi := ?,
1920 template BSSMAP_IE_Cause cause := ?)
1921modifies tr_BSSAP_BSSMAP := {
1922 pdu := {
1923 bssmap := {
1924 sAPInReject := {
1925 messageType := '25'O,
1926 dLCI := {
1927 elementIdentifier := '18'O,
1928 sapiValue := f_tr_SAPI(sapi),
1929 spare := ?,
1930 c1 := ?, c2 := ?
1931 },
1932 cause := cause
1933 }
1934 }
1935 }
1936}
1937
1938private function f_tr_SAPI(template (present) GsmSapi sapi)
1939return template (present) BIT3 {
1940 if (istemplatekind(sapi, "?")) {
1941 return ?;
1942 } else {
1943 return int2bit(valueof(sapi), 3);
1944 }
1945}
1946
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02001947template (value) BSSMAP_IE_LocationType ts_BSSMAP_IE_LocationType
1948:= {
1949 elementIdentifier := '44'O,
1950 lengthIndicator := 1,
1951 locationInformation := '00'O,
1952 positioningMethod := omit
1953}
Harald Welte73cd2712017-12-17 00:44:52 +01001954
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03001955template (value) BSSMAP_IE_LCSClientType
1956ts_BSSMAP_IE_LCSClientType(template (value) BIT4 category := '0010'B,
1957 template (value) BIT4 subtype := '0000'B) := {
1958 elementIdentifier := '48'O,
1959 lengthIndicator := 0, /* overwritten */
1960 subtype := subtype,
1961 category := category
1962}
1963
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03001964template (value) BSSMAP_IE_LCSPriority
1965ts_BSSMAP_IE_LCSPriority(template (value) OCT1 priority := '00'O) := {
1966 elementIdentifier := '43'O,
1967 lengthIndicator := 0, /* overwritten */
1968 priority := priority
1969}
1970
1971template (value) BSSMAP_IE_LCSQOS
1972ts_BSSMAP_IE_LCSQOS(template (value) BIT1 vCI := '0'B,
1973 template (value) BIT1 vEL := '0'B,
1974 template (value) BIT1 hAI := '1'B,
1975 template (value) BIT7 hAV := '0010010'B,
1976 template (value) BIT1 vAI := '0'B,
1977 template (value) BIT7 vAV := '0000000'B) := {
1978 elementIdentifier := '3E'O,
1979 lengthIndicator := 0, /* overwritten */
1980 vCI := vCI, /* Vertical Coordinate Indicator: VC requested ('1'B) or not ('0'B) */
1981 vEL := vEL, /* report velocity if available (1) or not(0) */
1982 spare_1_6 := '000000'B,
1983 horizontalAccuracy := hAV, /* Accuracy Horizontal (HA) */
1984 hAI := hAI, /* Horizontal Accuracy Indicator HA is specified (1) or not (0) */
1985 verticalAccuracy := vAV, /* Accuracy Vertical (VA) */
1986 vAI := vAI, /* Vertical Accuracy Indicator VA is specified (1) or not (0) */
1987 spare_2_6 := '000000'B,
1988 rTC := '00'B /* Response Time is not specified */
1989}
1990
Harald Welte44d055f2023-04-17 09:18:55 +08001991
1992/* 3.2.2.55 */
1993template (value) BSSMAP_IE_GroupCallReference
1994ts_BSSMAP_IE_GroupCallRef(template (value) GroupCallRef group_call_ref) :={
1995 elementIdentifier := '37'O,
1996 lengthIndicator := 0, // overwritten
1997 descrGroupbroadcastCallRef := group_call_ref
1998}
1999template (present) BSSMAP_IE_GroupCallReference
2000tr_BSSMAP_IE_GroupCallRef(template (present) GroupCallRef group_call_ref) :={
2001 elementIdentifier := '37'O,
2002 lengthIndicator := 0, // overwritten
2003 descrGroupbroadcastCallRef := group_call_ref
2004}
2005
2006/* 3.2.2.88 */
2007template (value) BSSMAP_IE_VGCS_FeatureFlags
2008ts_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 tcp) := {
2009 elementIdentifier := '69'O,
2010 lengthIndicator := 0, // overwritten
2011 TP_Ind := tp_ind,
2012 AS_Ind := as_ind,
2013 BSS_Res := bss_res,
2014 tCP := tcp,
2015 spare := '000'B
2016};
2017template (present) BSSMAP_IE_VGCS_FeatureFlags
2018tr_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 tcp) := {
2019 elementIdentifier := '69'O,
2020 lengthIndicator := ?,
2021 TP_Ind := tp_ind,
2022 AS_Ind := as_ind,
2023 BSS_Res := bss_res,
2024 tCP := tcp,
2025 spare := ?
2026};
2027
2028/* 3.2.2.98 */
2029template (value) BSSMAP_IE_ApplicationData
2030ts_BSSMAP_IE_ApplicationData(template (value) OCT9 adi) := {
2031 elementIdentifier := '78'O,
2032 lengthIndicator := 0, // overwritten
2033 applicationDataInfo := adi
2034};
2035template (present) BSSMAP_IE_ApplicationData
2036tr_BSSMAP_IE_ApplicationData(template (present) OCT9 adi) := {
2037 elementIdentifier := '78'O,
2038 lengthIndicator := ?,
2039 applicationDataInfo := adi
2040};
2041
2042/* 3.2.2.99 */
2043template (value) BSSMAP_IE_DataIdentity
2044ts_BSSMAP_IE_DataIdentity(template (value) DataIdentity data_id) := {
2045 elementIdentifier := '79'O,
2046 lengthIndicator := 0, // overwritten
2047 dataIdentityInfo := data_id
2048};
2049template (present) BSSMAP_IE_DataIdentity
2050tr_BSSMAP_IE_DataIdentity(template (present) DataIdentity data_id) := {
2051 elementIdentifier := '79'O,
2052 lengthIndicator := ?,
2053 dataIdentityInfo := data_id
2054};
2055
2056/* 3.2.2.52 */
2057template (value) BSSMAP_IE_AssignmentRequirement
2058ts_BSSMAP_IE_AssRequirement(template (value) OCT1 ass_rqm) := {
2059 elementIdentifier := '33'O,
2060 assignmentRequirement := ass_rqm
2061}
2062template (present) BSSMAP_IE_AssignmentRequirement
2063tr_BSSMAP_IE_AssRequirement(template (present) OCT1 ass_rqm) := {
2064 elementIdentifier := '33'O,
2065 assignmentRequirement := ass_rqm
2066}
2067
2068/* 3.2.2.89 */
2069function ts_BSSMAP_IE_TalkerPriority(template (omit) BIT2 prio)
2070return template (omit) BSSMAP_IE_TalkerPriority {
2071 if (istemplatekind(prio, "omit")) {
2072 return omit;
2073 } else {
2074 var template (present) BSSMAP_IE_TalkerPriority tp := {
2075 elementIdentifier := '6A'O,
2076 priority := prio,
2077 spare := '000000'B
2078 };
2079 return tp;
2080 }
2081}
2082function tr_BSSMAP_IE_TalkerPriority(template BIT2 prio)
2083return template BSSMAP_IE_TalkerPriority {
2084 if (istemplatekind(prio, "omit")) {
2085 return omit;
2086 } else if (istemplatekind(prio, "*")) {
2087 return *;
2088 } else {
2089 var template BSSMAP_IE_TalkerPriority tp := {
2090 elementIdentifier := '6A'O,
2091 priority := prio,
2092 spare := ?
2093 }
2094 return tp;
2095 }
2096}
2097
2098/* 3.2.2.90 */
2099template (value) BSSMAP_IE_EmergencySetIndication
2100ts_BSSMAP_IE_EmergencySetIndication := {
2101 elementIdentifier := '6B'O
2102}
2103template (present) BSSMAP_IE_EmergencySetIndication
2104tr_BSSMAP_IE_EmergencySetIndication := {
2105 elementIdentifier := '6B'O
2106}
2107
2108
2109
2110
2111/* Section 3.2.1.50 */
2112template (value) PDU_BSSAP
2113ts_BSSMAP_VGCS_VBS_Setup(template (value) GroupCallRef group_call_ref,
2114 template (omit) BSSMAP_IE_VGCS_FeatureFlags feature_flags := omit)
2115modifies ts_BSSAP_BSSMAP := {
2116 pdu := {
2117 bssmap := {
2118 vGCS_VBSSetup := {
2119 messageType := '04'O,
2120 groupCallReference := ts_BSSMAP_IE_GroupCallRef(group_call_ref),
2121 priority := omit,
2122 vGCS_FeatureFlags := feature_flags
2123 }
2124 }
2125 }
2126}
2127template (present) PDU_BSSAP
2128tr_BSSMAP_VGCS_VBS_Setup(template (present) GroupCallRef group_call_ref,
2129 template BSSMAP_IE_VGCS_FeatureFlags feature_flags := *)
2130modifies tr_BSSAP_BSSMAP := {
2131 pdu := {
2132 bssmap := {
2133 vGCS_VBSSetup := {
2134 messageType := '04'O,
2135 groupCallReference := tr_BSSMAP_IE_GroupCallRef(group_call_ref),
2136 priority := *,
2137 vGCS_FeatureFlags := feature_flags
2138 }
2139 }
2140 }
2141}
2142
2143/* Section 3.2.1.51 */
2144template (value) PDU_BSSAP
2145ts_BSSMAP_VGCS_VBS_SetupAck(template (omit) BSSMAP_IE_VGCS_FeatureFlags feature_flags := omit)
2146modifies ts_BSSAP_BSSMAP := {
2147 pdu := {
2148 bssmap := {
2149 vGCS_VBSSetupAck := {
2150 messageType := '05'O,
2151 vGCS_FeatureFlags := feature_flags
2152 }
2153 }
2154 }
2155}
2156template (present) PDU_BSSAP
2157tr_BSSMAP_VGCS_VBS_SetupAck(template BSSMAP_IE_VGCS_FeatureFlags feature_flags := *)
2158modifies tr_BSSAP_BSSMAP := {
2159 pdu := {
2160 bssmap := {
2161 vGCS_VBSSetupAck := {
2162 messageType := '05'O,
2163 vGCS_FeatureFlags := feature_flags
2164 }
2165 }
2166 }
2167}
2168
2169/* Section 3.2.1.52 */
2170template (value) PDU_BSSAP
2171ts_BSSMAP_VGCS_VBS_SetupRefuse(BssmapCause cause)
2172modifies ts_BSSAP_BSSMAP := {
2173 pdu := {
2174 bssmap := {
2175 vGCS_VBSSetupRefuse := {
2176 messageType := '06'O,
2177 cause := ts_BSSMAP_IE_Cause(cause)
2178 }
2179 }
2180 }
2181}
2182template (present) PDU_BSSAP
2183tr_BSSMAP_VGCS_VBS_SetupRefuse(template (present) myBSSMAP_Cause cause := ?)
2184modifies tr_BSSAP_BSSMAP := {
2185 pdu := {
2186 bssmap := {
2187 vGCS_VBSSetupRefuse := {
2188 messageType := '06'O,
2189 cause := tr_BSSMAP_IE_Cause(cause)
2190 }
2191 }
2192 }
2193}
2194
2195/* Section 3.2.1.53 */
2196template (value) PDU_BSSAP
2197ts_BSSMAP_VGCS_VBS_AssignmentReq(template (value) BSSMAP_IE_ChannelType ch_type,
2198 template (value) OCT1 ass_requirement,
2199 template (value) BSSMAP_IE_CellIdentifier cell_id,
2200 template (value) GroupCallRef group_call_ref,
2201 template (omit) BSSMAP_IE_CircuitIdentityCode cic := omit,
2202 template (omit) BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
2203 template (omit) OCT4 call_id := omit)
2204modifies ts_BSSAP_BSSMAP := {
2205 pdu := {
2206 bssmap := {
2207 vGCS_VBSAssignmentRequest := {
2208 messageType := '07'O, /* overwritten */
2209 channelType := ch_type,
2210 assignmentRequirement := ts_BSSMAP_IE_AssRequirement(ass_requirement),
2211 cellIdentifier := cell_id,
2212 groupCallReference := ts_BSSMAP_IE_GroupCallRef(group_call_ref),
2213 priority := omit,
2214 circuitIdentityCode := cic,
2215 downLinkDTX_Flag := omit,
2216 encryptionInformation := omit,
2217 vSTK_RAND := omit,
2218 vSTK := omit,
2219 cellIdentifierListSegment := omit,
2220 aoIPTransportLayer := aoip,
2221 callIdentifier := ts_BSSMAP_IE_CallIdentifier(call_id),
2222 codecList := omit
2223 }
2224 }
2225 }
2226}
2227template (present) PDU_BSSAP
2228tr_BSSMAP_VGCS_VBS_AssignmentReq(template (present) BSSMAP_IE_ChannelType ch_type,
2229 template (present) OCT1 ass_requirement,
2230 template (present) BSSMAP_IE_CellIdentifier cell_id,
2231 template (present) GroupCallRef group_call_ref,
2232 template BSSMAP_IE_CircuitIdentityCode cic := *,
2233 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := ?,
2234 template OCT4 call_id := ?)
2235modifies tr_BSSAP_BSSMAP := {
2236 pdu := {
2237 bssmap := {
2238 vGCS_VBSAssignmentRequest := {
2239 messageType := '07'O, /* overwritten */
2240 channelType := ch_type,
2241 assignmentRequirement := tr_BSSMAP_IE_AssRequirement(ass_requirement),
2242 cellIdentifier := cell_id,
2243 groupCallReference := tr_BSSMAP_IE_GroupCallRef(group_call_ref),
2244 priority := omit,
2245 circuitIdentityCode := cic,
2246 downLinkDTX_Flag := omit,
2247 encryptionInformation := omit,
2248 vSTK_RAND := omit,
2249 vSTK := omit,
2250 cellIdentifierListSegment := omit,
2251 aoIPTransportLayer := aoip,
2252 callIdentifier := tr_BSSMAP_IE_CallIdentifier(call_id),
2253 codecList := omit
2254 }
2255 }
2256 }
2257}
2258
2259/* Section 3.2.1.54 */
2260template (value) PDU_BSSAP
2261ts_BSSMAP_VGCS_VBS_AssignmentRes(template (value) BSSMAP_IE_ChannelType ch_type,
2262 template (value) BSSMAP_IE_CellIdentifier cell_id,
2263 template (omit) BSSMAP_IE_ChosenChannel chosen_ch := omit,
2264 template (omit) BSSMAP_IE_CircuitIdentityCode cic := omit,
2265 template (omit) BSSMAP_IE_AoIP_TransportLayerAddress aoip := omit,
2266 template (omit) BSSMAP_IE_SpeechCodec speech_codec := omit,
2267 template (omit) OCT4 call_id := omit)
2268modifies ts_BSSAP_BSSMAP := {
2269 pdu := {
2270 bssmap := {
2271 vGCS_VBSAssignmentResult := {
2272 messageType := '1C'O, /* overwritten */
2273 channelType := ch_type,
2274 cellIdentifier := cell_id,
2275 chosenChannel := chosen_ch,
2276 circuitIdentityCode := cic,
2277 circuitPool := omit,
2278 aoIPTransportLayer := aoip,
2279 speechCodec := speech_codec,
2280 callIdentifier := ts_BSSMAP_IE_CallIdentifier(call_id)
2281 }
2282 }
2283 }
2284}
2285template (present) PDU_BSSAP
2286tr_BSSMAP_VGCS_VBS_AssignmentRes(template (present) BSSMAP_IE_ChannelType ch_type,
2287 template (present) BSSMAP_IE_CellIdentifier cell_id,
2288 template BSSMAP_IE_ChosenChannel chosen_ch := *,
2289 template BSSMAP_IE_CircuitIdentityCode cic := omit,
2290 template BSSMAP_IE_AoIP_TransportLayerAddress aoip := ?,
2291 template BSSMAP_IE_SpeechCodec speech_codec := ?,
2292 template OCT4 call_id := ?)
2293modifies tr_BSSAP_BSSMAP := {
2294 pdu := {
2295 bssmap := {
2296 vGCS_VBSAssignmentResult := {
2297 messageType := '1C'O, /* overwritten */
2298 channelType := ch_type,
2299 cellIdentifier := cell_id,
2300 chosenChannel := chosen_ch,
2301 circuitIdentityCode := cic,
2302 circuitPool := *,
2303 aoIPTransportLayer := aoip,
2304 speechCodec := speech_codec,
2305 callIdentifier := tr_BSSMAP_IE_CallIdentifier(call_id)
2306 }
2307 }
2308 }
2309}
2310
2311/* Section 3.2.1.55 */
2312template (value) PDU_BSSAP
2313ts_BSSMAP_VGCS_VBS_AssignmentFail(BssmapCause cause)
2314modifies ts_BSSAP_BSSMAP := {
2315 pdu := {
2316 bssmap := {
2317 vGCS_VBSAssignmentFailure := {
2318 messageType := '1D'O, /* overwritten */
2319 cause := ts_BSSMAP_IE_Cause(cause),
2320 /* we only implement AoIP for now... */
2321 circuitPool := omit,
2322 circuitPoolList := omit
2323 }
2324 }
2325 }
2326}
2327template (present) PDU_BSSAP
2328tr_BSSMAP_VGCS_VBS_AssignmentFail(template (present) myBSSMAP_Cause cause := ?)
2329modifies tr_BSSAP_BSSMAP := {
2330 pdu := {
2331 bssmap := {
2332 vGCS_VBSAssignmentFailure := {
2333 messageType := '1D'O, /* overwritten */
2334 cause := tr_BSSMAP_IE_Cause(cause),
2335 /* we only implement AoIP for now... */
2336 circuitPool := omit,
2337 circuitPoolList := omit
2338 }
2339 }
2340 }
2341}
2342
2343/* Section 3.2.1.56 */
2344template (value) PDU_BSSAP
2345ts_BSSMAP_VGCS_VBS_QueuingInd
2346modifies ts_BSSAP_BSSMAP := {
2347 pdu := {
2348 bssmap := {
2349 vGCS_VBSQueuingIndication := {
2350 messageType := '1E'O
2351 }
2352 }
2353 }
2354}
2355template (present) PDU_BSSAP
2356tr_BSSMAP_VGCS_VBS_QueuingInd
2357modifies tr_BSSAP_BSSMAP := {
2358 pdu := {
2359 bssmap := {
2360 vGCS_VBSQueuingIndication := {
2361 messageType := '1E'O
2362 }
2363 }
2364 }
2365}
2366
2367/* Section 3.2.1.57 */
2368template (value) PDU_BSSAP
2369ts_BSSMAP_UplinkReq_L3(template (value) BIT2 priority,
2370 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2371 template (value) octetstring l3_info)
2372modifies ts_BSSAP_BSSMAP := {
2373 pdu := {
2374 bssmap := {
2375 uplinkRequest := {
2376 messageType := '1F'O,
2377 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2378 cellIdentifier := cell_id,
2379 layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
2380 mobileIdentity := omit
2381 }
2382 }
2383 }
2384}
2385template (present) PDU_BSSAP
2386tr_BSSMAP_UplinkReq_L3(template (present) BIT2 priority,
2387 template BSSMAP_IE_CellIdentifier cell_id,
2388 template (present) octetstring l3_info)
2389modifies tr_BSSAP_BSSMAP := {
2390 pdu := {
2391 bssmap := {
2392 uplinkRequest := {
2393 messageType := '1F'O,
2394 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2395 cellIdentifier := cell_id,
2396 layer3Information := tr_BSSMAP_IE_L3Info(l3_info),
2397 mobileIdentity := omit
2398 }
2399 }
2400 }
2401}
2402template (value) PDU_BSSAP
2403ts_BSSMAP_UplinkReq_MI(template (omit) BIT2 priority,
2404 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2405 template (value) BSSMAP_IE_MobileIdentity mobile_id)
2406modifies ts_BSSAP_BSSMAP := {
2407 pdu := {
2408 bssmap := {
2409 uplinkRequest := {
2410 messageType := '1F'O,
2411 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2412 cellIdentifier := cell_id,
2413 layer3Information := omit,
2414 mobileIdentity := mobile_id
2415 }
2416 }
2417 }
2418}
2419template (present) PDU_BSSAP
2420tr_BSSMAP_UplinkReq_MI(template BIT2 priority,
2421 template (omit) BSSMAP_IE_CellIdentifier cell_id,
2422 template (present) BSSMAP_IE_MobileIdentity mobile_id)
2423modifies tr_BSSAP_BSSMAP := {
2424 pdu := {
2425 bssmap := {
2426 uplinkRequest := {
2427 messageType := '1F'O,
2428 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2429 cellIdentifier := cell_id,
2430 layer3Information := omit,
2431 mobileIdentity := mobile_id
2432 }
2433 }
2434 }
2435}
2436
2437/* 3.2.1.58 */
2438template (value) PDU_BSSAP
2439ts_BSSMAP_UplinkReqAck(template (omit) BIT2 priority,
2440 template (omit) BSSMAP_IE_EmergencySetIndication ems := omit,
2441 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2442modifies ts_BSSAP_BSSMAP := {
2443 pdu := {
2444 bssmap := {
2445 uplinkRequestAck := {
2446 messageType := '27'O,
2447 talkerPriority := ts_BSSMAP_IE_TalkerPriority(priority),
2448 emergencySetIndication := ems,
2449 talkerIdentity := talker_id
2450 }
2451 }
2452 }
2453}
2454template (present) PDU_BSSAP
2455tr_BSSMAP_UplinkReqAck(template BIT2 priority,
2456 template BSSMAP_IE_EmergencySetIndication ems := *,
2457 template BSSMAP_IE_TalkerIdentity talker_id := *)
2458modifies tr_BSSAP_BSSMAP := {
2459 pdu := {
2460 bssmap := {
2461 uplinkRequestAck := {
2462 messageType := '27'O,
2463 talkerPriority := tr_BSSMAP_IE_TalkerPriority(priority),
2464 emergencySetIndication := ems,
2465 talkerIdentity := talker_id
2466 }
2467 }
2468 }
2469}
2470
2471/* 3.2.1.59 */
2472template (value) PDU_BSSAP
2473ts_BSSMAP_UplinkReqConf(template (value) BSSMAP_IE_CellIdentifier cell_id,
2474 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit,
2475 template (value) octetstring l3_info)
2476modifies ts_BSSAP_BSSMAP := {
2477 pdu := {
2478 bssmap := {
2479 uplinkRequestConfirmation := {
2480 messageType := '49'O,
2481 cellIdentifier := cell_id,
2482 talkerIdentity := talker_id,
2483 layer3Information := ts_BSSMAP_IE_L3Info(l3_info)
2484 }
2485 }
2486 }
2487}
2488template (present) PDU_BSSAP
2489tr_BSSMAP_UplinkReqConf(template (present) BSSMAP_IE_CellIdentifier cell_id,
2490 template BSSMAP_IE_TalkerIdentity talker_id := *,
2491 template (present) octetstring l3_info)
2492modifies tr_BSSAP_BSSMAP := {
2493 pdu := {
2494 bssmap := {
2495 uplinkRequestConfirmation := {
2496 messageType := '49'O,
2497 cellIdentifier := cell_id,
2498 talkerIdentity := talker_id,
2499 layer3Information := tr_BSSMAP_IE_L3Info(l3_info)
2500 }
2501 }
2502 }
2503}
2504
2505
2506/* 3.2.1.60 */
2507template (value) PDU_BSSAP
2508ts_BSSMAP_UplinkRelInd(BssmapCause cause, template (omit) BIT2 prio)
2509modifies ts_BSSAP_BSSMAP := {
2510 pdu := {
2511 bssmap := {
2512 uplinkReleaseIndication := {
2513 messageType := '4A'O,
2514 cause := ts_BSSMAP_IE_Cause(cause),
2515 talkerPriority := ts_BSSMAP_IE_TalkerPriority(prio)
2516 }
2517 }
2518 }
2519}
2520template (present) PDU_BSSAP
2521tr_BSSMAP_UplinkRelInd(template (present) myBSSMAP_Cause cause, template BIT2 prio)
2522modifies tr_BSSAP_BSSMAP := {
2523 pdu := {
2524 bssmap := {
2525 uplinkReleaseIndication := {
2526 messageType := '4A'O,
2527 cause := tr_BSSMAP_IE_Cause(cause),
2528 talkerPriority := tr_BSSMAP_IE_TalkerPriority(prio)
2529 }
2530 }
2531 }
2532}
2533
2534
2535/* 3.2.1.61 */
2536template (value) PDU_BSSAP
2537ts_BSSMAP_UplinkRejCmd(BssmapCause cause,
2538 template (omit) BIT2 cur_talker_prio := omit,
2539 template (omit) BIT2 rej_talker_prio := omit,
2540 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2541modifies ts_BSSAP_BSSMAP := {
2542 pdu := {
2543 bssmap := {
2544 uplinkRejectCommand := {
2545 messageType := '4B'O,
2546 cause := ts_BSSMAP_IE_Cause(cause),
2547 currentTalkerPriority := ts_BSSMAP_IE_TalkerPriority(cur_talker_prio),
2548 rejectedTalkerPriority := ts_BSSMAP_IE_TalkerPriority(rej_talker_prio),
2549 talkerIdentity := talker_id
2550 }
2551 }
2552 }
2553}
2554template (present) PDU_BSSAP
2555tr_BSSMAP_UplinkRejCmd(template (present) myBSSMAP_Cause cause,
2556 template BIT2 cur_talker_prio := *,
2557 template BIT2 rej_talker_prio := *,
2558 template BSSMAP_IE_TalkerIdentity talker_id := *)
2559modifies tr_BSSAP_BSSMAP := {
2560 pdu := {
2561 bssmap := {
2562 uplinkRejectCommand := {
2563 messageType := '4B'O,
2564 cause := tr_BSSMAP_IE_Cause(cause),
2565 currentTalkerPriority := tr_BSSMAP_IE_TalkerPriority(cur_talker_prio),
2566 rejectedTalkerPriority := tr_BSSMAP_IE_TalkerPriority(rej_talker_prio),
2567 talkerIdentity := talker_id
2568 }
2569 }
2570 }
2571}
2572
2573
2574/* 3.2.1.62 */
2575template (value) PDU_BSSAP
2576ts_BSSMAP_UplinkRelCmd(BssmapCause cause)
2577modifies ts_BSSAP_BSSMAP := {
2578 pdu := {
2579 bssmap := {
2580 uplinkReleaseCommand := {
2581 messageType := '4C'O,
2582 cause := ts_BSSMAP_IE_Cause(cause)
2583 }
2584 }
2585 }
2586}
2587template (present) PDU_BSSAP
2588tr_BSSMAP_UplinkRelCmd(template (present) myBSSMAP_Cause cause)
2589modifies tr_BSSAP_BSSMAP := {
2590 pdu := {
2591 bssmap := {
2592 uplinkReleaseCommand := {
2593 messageType := '4C'O,
2594 cause := tr_BSSMAP_IE_Cause(cause)
2595 }
2596 }
2597 }
2598}
2599
2600
2601/* 3.2.1.63 */
2602template (value) PDU_BSSAP
2603ts_BSSMAP_UplinkSeizedCmd(BssmapCause cause,
2604 template (omit) BIT2 talker_prio := omit,
2605 template (omit) BSSMAP_IE_EmergencySetIndication emerg := omit,
2606 template (omit) BSSMAP_IE_TalkerIdentity talker_id := omit)
2607modifies ts_BSSAP_BSSMAP := {
2608 pdu := {
2609 bssmap := {
2610 uplinkSeizedCommand := {
2611 messageType := '4D'O,
2612 cause := ts_BSSMAP_IE_Cause(cause),
2613 talkerPriority := ts_BSSMAP_IE_TalkerPriority(talker_prio),
2614 emergencySetIndication := emerg,
2615 talkerIdentity := talker_id
2616 }
2617 }
2618 }
2619}
2620template (present) PDU_BSSAP
2621tr_BSSMAP_UplinkSeizedCmd(template (present) myBSSMAP_Cause cause,
2622 template BIT2 talker_prio := *,
2623 template BSSMAP_IE_EmergencySetIndication emerg := *,
2624 template BSSMAP_IE_TalkerIdentity talker_id := *)
2625modifies tr_BSSAP_BSSMAP := {
2626 pdu := {
2627 bssmap := {
2628 uplinkSeizedCommand := {
2629 messageType := '4D'O,
2630 cause := tr_BSSMAP_IE_Cause(cause),
2631 talkerPriority := tr_BSSMAP_IE_TalkerPriority(talker_prio),
2632 emergencySetIndication := emerg,
2633 talkerIdentity := talker_id
2634 }
2635 }
2636 }
2637}
2638
2639
2640
2641/* Section 3.2.1.82 */
2642template (value) PDU_BSSAP
2643ts_BSSMAP_NotificationData(template (value) OCT9 app_data, template (value) DataIdentity data_identity)
2644modifies ts_BSSAP_BSSMAP := {
2645 pdu := {
2646 bssmap := {
2647 notificationData := {
2648 messageType := '62'O,
2649 applicationData := ts_BSSMAP_IE_ApplicationData(app_data),
2650 dataIdentity := ts_BSSMAP_IE_DataIdentity(data_identity),
2651 mSISDN := omit
2652 }
2653 }
2654 }
2655}
2656template (present) PDU_BSSAP
2657tr_BSSMAP_NotificationData(template (present) OCT9 app_data, template (present) DataIdentity data_identity)
2658modifies ts_BSSAP_BSSMAP := {
2659 pdu := {
2660 bssmap := {
2661 notificationData := {
2662 messageType := '62'O,
2663 applicationData := tr_BSSMAP_IE_ApplicationData(app_data),
2664 dataIdentity := tr_BSSMAP_IE_DataIdentity(data_identity),
2665 mSISDN := ?
2666 }
2667 }
2668 }
2669}
2670
2671
2672
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03002673template (value) PDU_BSSAP
2674ts_BSSMAP_Perform_Location_Request(template (omit) BSSMAP_IE_IMSI imsi,
2675 template (omit) BSSMAP_IE_CellIdentifier cellIdentifier := omit,
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03002676 template (omit) BSSMAP_IE_LCSClientType clientType := ts_BSSMAP_IE_LCSClientType,
2677 template (omit) BSSMAP_IE_LCSPriority priority := ts_BSSMAP_IE_LCSPriority,
2678 template (omit) BSSMAP_IE_LCSQOS qos := ts_BSSMAP_IE_LCSQOS)
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002679modifies ts_BSSAP_BSSMAP := {
2680 pdu := {
2681 bssmap := {
2682 performLocationRequest := {
2683 messageType := '2B'O,
2684 locationType := ts_BSSMAP_IE_LocationType,
2685 cellIdentifier := cellIdentifier,
2686 classmarkInformationType3 := omit,
Vadim Yanitskiy2ae269b2022-03-23 14:51:27 +03002687 lCS_ClientType := clientType,
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002688 chosenChannel := omit,
Vadim Yanitskiydcbdb822022-03-23 15:11:45 +03002689 lCS_Priority := priority,
2690 lCS_QOS := qos,
Neels Hofmeyre52bc2d2020-10-01 06:39:10 +02002691 gPS_AssistanceData := omit,
2692 aPDU := omit,
2693 iMSI := imsi,
2694 iMEI := omit,
2695 gANSS_LocationType := omit,
2696 gANSS_AssistanceData := omit
2697 }
2698 }
2699 }
2700}
2701
2702template (present) BSSMAP_IE_LocationEstimate tr_BSSMAP_IE_LocationEstimate(template (present) octetstring geo_loc := ?)
2703:= {
2704 elementIdentifier := '45'O,
2705 lengthIndicator := ?,
2706 geographicLocation := geo_loc
2707}
2708
2709function tr_BSSMAP_LcsCause(template (present) BSSMAP_LcsCause cause)
2710return template (omit) BSSMAP_IE_LCSCause {
2711 if (istemplatekind(cause, "omit")) {
2712 return omit;
2713 }
2714 var template BSSMAP_IE_LCSCause ie := {
2715 elementIdentifier := '47'O,
2716 lengthIndicator := 1,
2717 causeValue := int2bit(enum2int(valueof(cause)), 8),
2718 diagnosticValue := omit
2719 }
2720 return ie;
2721}
2722
2723template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Response(
2724 template BSSMAP_IE_LocationEstimate locationEstimate := *,
2725 template BSSMAP_IE_PositioningData positioningData := *,
2726 template BSSMAP_IE_LCSCause lCS_Cause := *
2727 )
2728modifies tr_BSSAP_BSSMAP := {
2729 pdu := {
2730 bssmap := {
2731 performLocationResponse := {
2732 messageType := '2D'O,
2733 locationEstimate := locationEstimate,
2734 positioningData := positioningData,
2735 decipheringKeys := *,
2736 lCS_Cause := lCS_Cause,
2737 velocityEstimate := *,
2738 gANSS_PositioningData := *
2739 }
2740 }
2741 }
2742}
2743
2744template (present) PDU_BSSAP tr_BSSMAP_Perform_Location_Abort(template (present) BSSMAP_IE_LCSCause lCS_Cause := ?)
2745modifies tr_BSSAP_BSSMAP := {
2746 pdu := {
2747 bssmap := {
2748 performLocationAbort := {
2749 messageType := '2E'O,
2750 lCS_Cause := lCS_Cause
2751 }
2752 }
2753 }
2754}
Harald Weltec859df52017-11-24 23:41:41 +01002755
Harald Welteb69533d2017-12-15 13:55:17 +01002756} with { encode "RAW" };