blob: d166bcf365cc7069b8e330231e6945f178d20cbc [file] [log] [blame]
Harald Welteea260342019-08-01 09:49:38 +02001module CBSP_Templates {
2
3import from Osmocom_Types all;
4import from BSSAP_Types all;
5import from CBSP_Types all;
6
7/* TODO: receive templates must match IEs in any arbitrary order */
8
9/* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
10 * that it needs to set for a given union-choice (body). So we have to explicitly
11 * specify the IEI by the caller :( */
12template (value) CBSP_IE ts_CBSP_IE(CBSP_IEI iei, template (value) CBSP_IE_Body body) := {
13 iei := iei,
14 body := body
15}
16
17template CBSP_IE tr_CBSP_IE(template CBSP_IE_Body body) := {
18 iei := ?,
19 body := body
20}
21
22
23template (value) CBSP_IE ts_CbspMsgId(template (value) uint16_t val) :=
24 ts_CBSP_IE(CBSP_IEI_MSG_ID, {msg_id := val});
25template CBSP_IE tr_CbspMsgId(template uint16_t val := ?) :=
26 tr_CBSP_IE({msg_id := val});
27
28template (value) CBSP_IE ts_NewSerNo(template (value) uint16_t val) :=
29 ts_CBSP_IE(CBSP_IEI_NEW_SERIAL_NR, {new_ser_nr := val});
30template CBSP_IE tr_NewSerNo(template uint16_t val := ?) :=
31 tr_CBSP_IE({new_ser_nr := val});
32
33template (value) CBSP_IE ts_OldSerNo(template (value) uint16_t val) :=
34 ts_CBSP_IE(CBSP_IEI_OLD_SERIAL_NR, {old_ser_nr := val});
35template CBSP_IE tr_OldSerNo(template uint16_t val := ?) :=
36 tr_CBSP_IE({old_ser_nr := val});
37
38template (value) CBSP_IE ts_CbspKARepPeriod(template (value) uint8_t rep_per) :=
39 ts_CBSP_IE(CBSP_IEI_KEEP_ALIVE_REP_PERIOD, {keep_alive_rep_period := rep_per});
40template CBSP_IE tr_CbspKARepPeriod(template uint8_t rep_per := ?) :=
41 tr_CBSP_IE({keep_alive_rep_period := rep_per});
42
43function ts_CbspChannelInd(template (omit) uint8_t val) return template (omit) CBSP_IE {
44 var template (omit) CBSP_IE ie;
45 if (istemplatekind(val, "omit")) {
46 ie := omit;
47 } else {
48 ie := ts_CBSP_IE(CBSP_IEI_CHANNEL_IND, {channel_ind := val});
49 }
50 return ie;
51}
52function tr_CbspChannelInd(template uint8_t val := ?) return template CBSP_IE {
53 var template CBSP_IE ie;
54 if (istemplatekind(val, "omit")) {
55 ie := omit;
56 } else if (istemplatekind(val, "*")) {
Harald Welte08332302019-08-01 09:54:40 +020057 ie := tr_CBSP_IE({channel_ind := ?}); //ifpresent;
Harald Welteea260342019-08-01 09:49:38 +020058 } else {
59 ie := tr_CBSP_IE({channel_ind := val});
60 }
61 return ie;
62}
63
64template (value) CBSP_IE ts_CbspCause(template (value) CBSP_Cause c) :=
65 ts_CBSP_IE(CBSP_IEI_CAUSE, {cause := c});
66template CBSP_IE tr_CbspCause(template CBSP_Cause c := ?) :=
67 tr_CBSP_IE({cause := c});
68
69template (value) CBSP_IE ts_CbspCellList(template (value) BSSMAP_FIELD_CellIdentificationList list) :=
70 ts_CBSP_IE(CBSP_IEI_CELL_LIST, {
71 cell_list := {
72 len := 0,
73 spare1_4 := '0000'B,
74 cell_id_discr := '0000'B,
75 cell_id := list
76 }});
77template CBSP_IE tr_CbspCellList(template BSSMAP_FIELD_CellIdentificationList list := ?) :=
78 tr_CBSP_IE({
79 cell_list := {
80 len := ?,
81 spare1_4 := ?,
82 cell_id_discr := ?,
83 cell_id := list
84 }});
85
86template (value) CBSP_IE ts_CbspCategory(template (value) CBSP_Category cat) :=
87 ts_CBSP_IE(CBSP_IEI_CATEGORY, {category := cat});
88template CBSP_IE tr_CbspCategory(template CBSP_Category cat := ?) :=
89 tr_CBSP_IE({category := cat});
90
91template (value) CBSP_IE ts_CbspRepetitionPeriod(template (value) uint16_t per) :=
92 ts_CBSP_IE(CBSP_IEI_REP_PERIOD, {rep_period := per});
93template CBSP_IE tr_CbspRepetitionPeriod(template uint16_t per := ?) :=
94 tr_CBSP_IE({rep_period := per});
95
96template (value) CBSP_IE ts_CbspNumBcastReq(template (value) uint16_t num) :=
97 ts_CBSP_IE(CBSP_IEI_NUM_BCAST_REQ, {num_bcast_req := num});
98template CBSP_IE tr_CbspNumBcastReq(template uint16_t num := ?) :=
99 tr_CBSP_IE({num_bcast_req := num});
100
101template (value) CBSP_IE ts_CbspNumPages(template (value) uint8_t num) :=
102 ts_CBSP_IE(CBSP_IEI_NUM_OF_PAGES, {num_of_pages := num});
103template CBSP_IE tr_CbspNumPages(template uint16_t num := ?) :=
104 tr_CBSP_IE({num_of_pages := num});
105
106template (value) CBSP_IE ts_EmergencyInd(template (value) uint8_t val) :=
107 ts_CBSP_IE(CBSP_IEI_EMERG_IND, {emerg_ind := val});
108template CBSP_IE tr_EmergencyInd(template uint8_t val := ?) :=
109 tr_CBSP_IE({emerg_ind := val});
110
111template (value) CBSP_IE ts_WarningType(template (value) uint16_t val) :=
112 ts_CBSP_IE(CBSP_IEI_WARN_TYPE, {warn_type := val});
113template CBSP_IE tr_WarningType(template uint16_t val) :=
114 tr_CBSP_IE({warn_type := val});
115
116template (value) CBSP_IE ts_WarnSecInfo(template (value) octetstring payl := ''O) :=
117 ts_CBSP_IE(CBSP_IEI_WARN_SEC_INFO, {warn_sec_info := payl});
118template CBSP_IE tr_WarnSecInfo(template octetstring payl := ?) :=
119 tr_CBSP_IE({warn_sec_info := payl});
120
121template (value) CBSP_IE ts_WarningPeriod(template (value) uint8_t val) :=
122 ts_CBSP_IE(CBSP_IEI_WARNING_PERIOD, {warning_period := val});
123template CBSP_IE tr_WarningPeriod(template uint8_t val := ?) :=
124 tr_CBSP_IE({warning_period := val});
125
126template (value) CBSP_IE ts_CbspFailList(template (value) CBSP_FailureListItems items) :=
127 ts_CBSP_IE(CBSP_IEI_FAILURE_LIST, {failure_list := {
128 len := 0,
129 list := items
130 }});
131template CBSP_IE tr_CbspFailList(template CBSP_FailureListItems items := ?) :=
132 tr_CBSP_IE({failure_list := {
Harald Welte09538f82019-08-01 09:50:25 +0200133 len := ?,
Harald Welteea260342019-08-01 09:49:38 +0200134 list := items
135 }});
136
137template (value) CBSP_IE ts_CbspNumComplList(template (value) CBSP_IE_NumBcastComplList list) :=
138 ts_CBSP_IE(CBSP_IEI_NUM_BCAST_COMPL_LIST, {num_bcast_compl_list := list});
139template CBSP_IE tr_CbspNumComplList(template CBSP_IE_NumBcastComplList list := ?) :=
140 tr_CBSP_IE({num_bcast_compl_list := list});
141
142template (value) CBSP_IE ts_CbspBcastMsgType(template (value) CBSP_BcastMsgType bi) :=
143 ts_CBSP_IE(CBSP_IEI_BCAST_MSG_TYPE, {bcast_msg_type := {
144 spare1_4 := '0000'B,
145 msg_type := bi
146 }});
147template CBSP_IE tr_CbspBcastMsgType(template CBSP_BcastMsgType bi := ?) :=
148 tr_CBSP_IE({bcast_msg_type := {
149 spare1_4 := ?,
150 msg_type := bi
151 }});
152
153template (value) CBSP_IE ts_CbspRecoveryInd(template (value) CBSP_RecoveryInd ri) :=
154 ts_CBSP_IE(CBSP_IEI_RECOVERY_IND, {recovery_ind := {
155 spare1_4 := '0000'B,
156 recovery := ri
157 }});
158template CBSP_IE tr_CbspRecoveryInd(template CBSP_RecoveryInd ri) :=
159 tr_CBSP_IE({recovery_ind := {
160 spare1_4 := ?,
161 recovery := ri
162 }});
163
164template (value) CBSP_IE ts_CbspMsgContent(template (value) octetstring payload, uint8_t user_len) :=
165 ts_CBSP_IE(CBSP_IEI_MSG_CONTENT, {msg_content := {
166 user_len := user_len,
167 val := payload
168 }});
169template CBSP_IE tr_CbspMsgContent(template octetstring payload := ?, template uint8_t user_len := ?) :=
170 tr_CBSP_IE({msg_content := {
171 user_len := user_len,
172 val := payload
173 }});
174
175template (value) CBSP_IE ts_CbspDCS(template (value) uint8_t dcs) :=
176 ts_CBSP_IE(CBSP_IEI_DCS, {dcs := dcs});
177template CBSP_IE tr_CbspDCS(template uint8_t dcs := ?) :=
178 tr_CBSP_IE({dcs := dcs});
179
180
181template (value) CBSP_PDU ts_CBSP(CBSP_MessageType msg_type, template (value) CBSP_IEs ies) := {
182 msg_type := msg_type,
183 len := 0, /* overwritten */
184 ies := ies
185}
186template CBSP_PDU tr_CBSP(template CBSP_MessageType msg_type := ?, template CBSP_IEs ies := *) := {
187 msg_type := msg_type,
188 len := ?,
189 ies := ies
190}
191
192
193
194/* 8.1.3.1 WRITE REPLACE */
195function ts_CBSP_WRITE_CBS(template (value) uint16_t msg_id,
196 template (value) uint16_t new_ser_nr,
197 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
198 template (value) uint8_t channel_ind,
199 template (value) CBSP_Category category,
200 template (value) uint16_t rep_period,
201 template (value) uint16_t num_bcast_req,
202 template (value) uint8_t dcs,
203 template (value) CBSP_IEs content) return template (value) CBSP_PDU {
204 var template (value) CBSP_IEs ies := {
205 ts_CbspMsgId(msg_id),
206 ts_NewSerNo(new_ser_nr),
207 ts_CbspCellList(cell_list),
208 ts_CbspChannelInd(channel_ind),
209 ts_CbspCategory(category),
210 ts_CbspRepetitionPeriod(rep_period),
211 ts_CbspNumBcastReq(num_bcast_req),
212 ts_CbspDCS(dcs),
213 ts_CbspNumPages(lengthof(content))
214 };
215 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE, valueof(ies) & valueof(content));
216}
217template CBSP_PDU tr_CBSP_WRITE_CBS(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
218 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
219 template uint8_t channel_ind := ?,
220 template CBSP_Category category := ?,
221 template uint16_t rep_period := ?,
222 template uint16_t num_bcast_req := ?,
223 template uint8_t dcs := ?,
224 template CBSP_IEs content := ?
225 ) :=
226 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, ({
227 tr_CbspMsgId(msg_id),
228 tr_NewSerNo(new_ser_nr),
229 tr_CbspCellList(cell_list),
230 tr_CbspChannelInd(channel_ind),
231 tr_CbspCategory(category),
232 tr_CbspRepetitionPeriod(rep_period),
233 tr_CbspNumBcastReq(num_bcast_req),
234 tr_CbspDCS(dcs),
235 tr_CbspNumPages(lengthof(content)), all from content }));
236
237
238function ts_CBSP_REPLACE_CBS(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
239 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
240 template (value) uint8_t channel_ind,
241 template (value) CBSP_Category category,
242 template (value) uint16_t rep_period,
243 template (value) uint16_t num_bcast_req,
244 template (value) uint8_t dcs,
245 template (value) CBSP_IEs content) return template (value) CBSP_PDU {
246 var template (value) CBSP_IEs ies := {
247 ts_CbspMsgId(msg_id),
248 ts_NewSerNo(new_ser_nr),
249 ts_OldSerNo(old_ser_nr),
250 ts_CbspCellList(cell_list),
251 ts_CbspChannelInd(channel_ind),
252 ts_CbspCategory(category),
253 ts_CbspRepetitionPeriod(rep_period),
254 ts_CbspNumBcastReq(num_bcast_req),
255 ts_CbspDCS(dcs),
256 ts_CbspNumPages(lengthof(content))
257 };
258 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE, valueof(ies) & valueof(content));
259}
260template CBSP_PDU tr_CBSP_REPLACE_CBS(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
261 template uint16_t old_ser_nr := ?,
262 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
263 template uint8_t channel_ind := ?,
264 template CBSP_Category category := ?,
265 template uint16_t rep_period := ?,
266 template uint16_t num_bcast_req := ?,
267 template uint8_t dcs := ?,
268 template CBSP_IEs content := ?
269 ) :=
270 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, ({
271 tr_CbspMsgId(msg_id),
272 tr_NewSerNo(new_ser_nr),
273 tr_OldSerNo(old_ser_nr),
274 tr_CbspCellList(cell_list),
275 tr_CbspChannelInd(channel_ind),
276 tr_CbspCategory(category),
277 tr_CbspRepetitionPeriod(rep_period),
278 tr_CbspNumBcastReq(num_bcast_req),
279 tr_CbspDCS(dcs),
280 tr_CbspNumPages(lengthof(content)), all from content }));
281
282template (value) CBSP_PDU ts_CBSP_WRITE_EMERG(uint16_t msg_id, uint16_t new_ser_nr,
283 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
284 template (value) uint8_t emerg_ind,
285 template (value) uint16_t warn_type,
Harald Welteea260342019-08-01 09:49:38 +0200286 template (value) uint8_t warn_per
287 ) :=
288 ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
289 ts_CbspMsgId(msg_id),
290 ts_NewSerNo(new_ser_nr),
291 ts_CbspCellList(cell_list),
292 ts_EmergencyInd(emerg_ind),
293 ts_WarningType(warn_type),
294 ts_WarnSecInfo,
295 ts_WarningPeriod(warn_per) });
296template CBSP_PDU tr_CBSP_WRITE_EMERG(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
297 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
298 template uint8_t emerg_ind := ?,
299 template uint16_t warn_type := ?,
300 template uint16_t num_bcast_req := ?,
301 template uint8_t warn_per := ?
302 ) :=
303 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, {
304 tr_CbspMsgId(msg_id),
305 tr_NewSerNo(new_ser_nr),
306 tr_CbspCellList(cell_list),
307 tr_EmergencyInd(emerg_ind),
308 tr_WarningType(warn_type),
309 tr_WarnSecInfo,
310 tr_WarningPeriod(warn_per) });
311
312
313template (value) CBSP_PDU ts_CBSP_REPLACE_EMERG(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
314 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
315 template (value) uint8_t emerg_ind,
316 template (value) uint16_t warn_type,
Harald Welteea260342019-08-01 09:49:38 +0200317 template (value) uint8_t warn_per
318 ) :=
319 ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
320 ts_CbspMsgId(msg_id),
321 ts_NewSerNo(new_ser_nr),
322 ts_OldSerNo(old_ser_nr),
323 ts_CbspCellList(cell_list),
324 ts_EmergencyInd(emerg_ind),
325 ts_WarningType(warn_type),
326 ts_WarnSecInfo,
327 ts_WarningPeriod(warn_per) });
328template CBSP_PDU tr_CBSP_REPLACE_EMERG(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
329 template uint16_t old_ser_nr := ?,
330 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
331 template uint8_t emerg_ind := ?,
332 template uint16_t warn_type := ?,
Harald Welteea260342019-08-01 09:49:38 +0200333 template uint8_t warn_per := ?
334 ) :=
335 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, {
336 tr_CbspMsgId(msg_id),
337 tr_NewSerNo(new_ser_nr),
338 tr_OldSerNo(old_ser_nr),
339 tr_CbspCellList(cell_list),
340 tr_EmergencyInd(emerg_ind),
341 tr_WarningType(warn_type),
342 tr_WarnSecInfo,
343 tr_WarningPeriod(warn_per) });
344
345/* 8.1.3.2 WRITE-REPLACE COMPLETE */
346function ts_CBSP_WRITE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr,
347 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
348 template (value) uint8_t channel_ind)
349return template (value) CBSP_PDU {
350 var template (value) CBSP_IEs ies := {
351 ts_CbspMsgId(msg_id),
352 ts_NewSerNo(new_ser_nr)
353 };
354 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200355 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200356 }
357 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
358 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
359}
360function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
361 template BSSMAP_FIELD_CellIdentificationList cell_list,
362 template uint8_t channel_ind)
363return template CBSP_PDU {
364 var template CBSP_IEs ies := {
365 tr_CbspMsgId(msg_id),
366 tr_NewSerNo(new_ser_nr)
367 };
368 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200369 testcase.stop("TITAN > 6.5.0 doesn't support this");
370 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200371 } else if (istemplatekind(cell_list, "?")) {
372 ies[lengthof(ies)] := tr_CbspCellList(?);
373 } else if (not istemplatekind(cell_list, "omit")) {
374 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
375 }
Harald Welte25a60752019-09-06 23:08:23 +0200376 if (not istemplatekind(channel_ind, "omit")) {
377 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
378 }
Harald Welteea260342019-08-01 09:49:38 +0200379 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
380}
381
382
383function ts_CBSP_REPLACE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
384 template (value) CBSP_IE_NumBcastComplList compl_list,
385 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
386 template (value) uint8_t channel_ind)
387return template (value) CBSP_PDU {
388 var template (value) CBSP_IEs ies := {
389 ts_CbspMsgId(msg_id),
390 ts_NewSerNo(new_ser_nr),
391 ts_OldSerNo(old_ser_nr),
392 ts_CbspNumComplList(compl_list)
393 };
394 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200395 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200396 }
397 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
398 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
399}
400function tr_CBSP_REPLACE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
401 template uint16_t old_ser_nr,
402 template CBSP_IE_NumBcastComplList compl_list,
403 template BSSMAP_FIELD_CellIdentificationList cell_list,
404 template uint8_t channel_ind)
405return template CBSP_PDU {
406 var template CBSP_IEs ies := {
407 tr_CbspMsgId(msg_id),
408 tr_NewSerNo(new_ser_nr),
Harald Welted6869412022-04-27 17:50:13 +0200409 tr_OldSerNo(old_ser_nr)
Harald Welteea260342019-08-01 09:49:38 +0200410 };
Harald Welted6869412022-04-27 17:50:13 +0200411 if (istemplatekind(compl_list, "*")) {
412 testcase.stop("TITAN > 6.5.0 doesn't support this");
413 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
414 } else if (istemplatekind(compl_list, "?")) {
415 ies[lengthof(ies)] := tr_CbspNumComplList(?);
416 } else if (not istemplatekind(compl_list, "omit")) {
417 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
418 }
419
Harald Welteea260342019-08-01 09:49:38 +0200420 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200421 testcase.stop("TITAN > 6.5.0 doesn't support this");
422 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200423 } else if (istemplatekind(cell_list, "?")) {
424 ies[lengthof(ies)] := tr_CbspCellList(?);
425 } else if (not istemplatekind(cell_list, "omit")) {
426 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
427 }
Harald Welte25a60752019-09-06 23:08:23 +0200428 if (not istemplatekind(channel_ind, "omit")) {
429 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
430 }
Harald Welteea260342019-08-01 09:49:38 +0200431 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
432}
433
434
435/* 8.1.3.3 WRITE-REPLACE FAILURE */
436function ts_CBSP_WRITE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr,
437 template (value) CBSP_FailureListItems fail_list,
438 template (omit) CBSP_IE_NumBcastComplList compl_list,
439 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
440 template (value) uint8_t channel_ind)
441return template (value) CBSP_PDU {
442 var template (value) CBSP_IEs ies := {
443 ts_CbspMsgId(msg_id),
444 ts_NewSerNo(new_ser_nr),
445 ts_CbspFailList(fail_list)
446 };
447 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200448 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200449 }
450 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200451 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200452 }
453 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
454 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
455}
456function tr_CBSP_WRITE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
457 template CBSP_FailureListItems fail_list,
458 template CBSP_IE_NumBcastComplList compl_list,
459 template BSSMAP_FIELD_CellIdentificationList cell_list,
460 template uint8_t channel_ind)
461return template CBSP_PDU {
462 var template CBSP_IEs ies := {
463 tr_CbspMsgId(msg_id),
464 tr_NewSerNo(new_ser_nr),
465 tr_CbspFailList(fail_list)
466 };
467 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200468 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200469 } else if (istemplatekind(compl_list, "?")) {
470 ies[lengthof(ies)] := tr_CbspNumComplList(?);
471 } else if (not istemplatekind(compl_list, "omit")) {
472 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
473 }
474 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200475 testcase.stop("TITAN > 6.5.0 doesn't support this");
476 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200477 } else if (istemplatekind(cell_list, "?")) {
478 ies[lengthof(ies)] := tr_CbspCellList(?);
479 } else if (not istemplatekind(cell_list, "omit")) {
480 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
481 }
Harald Welte25a60752019-09-06 23:08:23 +0200482 if (not istemplatekind(channel_ind, "omit")) {
483 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
484 }
Harald Welteea260342019-08-01 09:49:38 +0200485 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
486}
487
488
489function ts_CBSP_REPLACE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
490 template (value) CBSP_FailureListItems fail_list,
491 template (omit) CBSP_IE_NumBcastComplList compl_list,
492 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
493 template (value) uint8_t channel_ind)
494return template (value) CBSP_PDU {
495 var template (value) CBSP_IEs ies := {
496 ts_CbspMsgId(msg_id),
497 ts_NewSerNo(new_ser_nr),
498 ts_OldSerNo(old_ser_nr),
499 ts_CbspFailList(fail_list)
500 };
501 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200502 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200503 }
504 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200505 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200506 }
507 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
508 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
509}
510function tr_CBSP_REPLACE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
511 template uint16_t old_ser_nr,
512 template CBSP_FailureListItems fail_list,
513 template CBSP_IE_NumBcastComplList compl_list,
514 template BSSMAP_FIELD_CellIdentificationList cell_list,
515 template uint8_t channel_ind)
516return template CBSP_PDU {
517 var template CBSP_IEs ies := {
518 tr_CbspMsgId(msg_id),
519 tr_NewSerNo(new_ser_nr),
520 tr_OldSerNo(old_ser_nr),
521 tr_CbspFailList(fail_list)
522 };
523 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200524 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200525 } else if (istemplatekind(compl_list, "?")) {
526 ies[lengthof(ies)] := tr_CbspNumComplList(?);
527 } else if (not istemplatekind(compl_list, "omit")) {
528 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
529 }
530 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200531 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200532 } else if (istemplatekind(cell_list, "?")) {
533 ies[lengthof(ies)] := tr_CbspCellList(?);
534 } else if (not istemplatekind(cell_list, "omit")) {
535 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
536 }
537 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
538 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
539}
540
541/* 8.1.3.4 KILL */
Harald Welte4a788a02022-04-27 16:57:24 +0200542function ts_CBSP_KILL(template (value) uint16_t msg_id,
543 template (value) uint16_t old_ser_nr,
544 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
545 template (omit) uint8_t channel_ind)
546return template (value) CBSP_PDU {
547 var template (value) CBSP_IEs ies := {
548 ts_CbspMsgId(msg_id),
549 ts_OldSerNo(old_ser_nr),
550 ts_CbspCellList(cell_list)
551 };
552 if (not istemplatekind(channel_ind, "omit")) {
553 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
554 }
555 return ts_CBSP(CBSP_MSGT_KILL, ies);
556}
Harald Welte08332302019-08-01 09:54:40 +0200557function tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
558 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
559 template uint8_t channel_ind := ?)
560return template (present) CBSP_PDU {
561 var template CBSP_IEs ies := {
562 tr_CbspMsgId(msg_id),
563 tr_OldSerNo(old_ser_nr),
564 tr_CbspCellList(cell_list)
565 };
566 if (not istemplatekind(channel_ind, "omit")) {
567 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
568 }
569 return tr_CBSP(CBSP_MSGT_KILL, ies);
570}
Harald Welteea260342019-08-01 09:49:38 +0200571
572/* 8.1.3.5 KILL COMPLETE */
573function ts_CBSP_KILL_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
574 template (omit) CBSP_IE_NumBcastComplList compl_list,
575 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
576 template (omit) uint8_t channel_ind)
577return template (value) CBSP_PDU {
578 var template (value) CBSP_IEs ies := {
579 ts_CbspMsgId(msg_id),
580 ts_OldSerNo(old_ser_nr)
581 };
582 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200583 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200584 }
585 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200586 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200587 }
588 if (not istemplatekind(channel_ind, "omit")) {
589 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
590 }
591 return ts_CBSP(CBSP_MSGT_KILL_COMPL, ies);
592}
593function tr_CBSP_KILL_COMPL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
594 template CBSP_IE_NumBcastComplList compl_list := ?,
595 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
596 template uint8_t channel_ind)
597return template CBSP_PDU {
598 var template CBSP_IEs ies := {
599 tr_CbspMsgId(msg_id),
600 tr_OldSerNo(old_ser_nr)
601 };
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200602 /* As soon as adding a '*' IE item, lengthof() no longer works on the ies record. So keep track of the
603 * next index to use separately. */
604 var integer next_idx := lengthof(ies);
Harald Welteea260342019-08-01 09:49:38 +0200605 if (istemplatekind(compl_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200606 ies[next_idx] := *;
607 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200608 } else if (not istemplatekind(compl_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200609 ies[next_idx] := tr_CbspNumComplList(compl_list);
610 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200611 }
612 if (istemplatekind(cell_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200613 ies[next_idx] := *;
614 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200615 } else if (not istemplatekind(cell_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200616 ies[next_idx] := tr_CbspCellList(cell_list);
617 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200618 }
619 if (istemplatekind(channel_ind, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200620 ies[next_idx] := *;
621 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200622 } else if (not istemplatekind(channel_ind, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200623 ies[next_idx] := tr_CbspChannelInd(channel_ind);
624 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200625 }
626 return tr_CBSP(CBSP_MSGT_KILL_COMPL, ies);
627}
628
629/* 8.1.3.6 KILL FAILURE */
630function ts_CBSP_KILL_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
631 template (value) CBSP_FailureListItems fail_list,
632 template (omit) CBSP_IE_NumBcastComplList compl_list,
633 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
634 template (omit) uint8_t channel_ind)
635return template (value) CBSP_PDU {
636 var template (value) CBSP_IEs ies := {
637 ts_CbspMsgId(msg_id),
638 ts_OldSerNo(old_ser_nr),
639 ts_CbspFailList(fail_list)
640 };
641 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200642 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200643 }
644 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200645 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200646 }
647 if (not istemplatekind(channel_ind, "omit")) {
648 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
649 }
650 return ts_CBSP(CBSP_MSGT_KILL_FAIL, ies);
651}
652function tr_CBSP_KILL_FAIL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
653 template CBSP_FailureListItems fail_list := ?,
654 template CBSP_IE_NumBcastComplList compl_list := *,
655 template BSSMAP_FIELD_CellIdentificationList cell_list := *,
656 template uint8_t channel_ind := *)
657return template CBSP_PDU {
658 var template CBSP_IEs ies := {
659 tr_CbspMsgId(msg_id),
660 tr_OldSerNo(old_ser_nr),
661 tr_CbspFailList(fail_list)
662 };
663 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200664 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200665 } else if (not istemplatekind(compl_list, "omit")) {
666 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
667 }
Harald Welte885de1c2020-04-20 17:50:22 +0200668 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200669 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200670 } else if (not istemplatekind(cell_list, "omit")) {
671 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
672 }
673 if (istemplatekind(channel_ind, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200674 testcase.stop("TITAN > 6.5.0 doesn't support this");
675 //ies[lengthof(ies)] := tr_CbspChannelInd(?) ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200676 } else if (not istemplatekind(channel_ind, "omit")) {
677 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
678 }
679 return tr_CBSP(CBSP_MSGT_KILL_FAIL, ies);
680}
681
Harald Welte562d28e2022-03-28 21:29:04 +0200682/* 8.1.3.10 MESSAGE STATUS QUERY */
683template (value) CBSP_PDU
684ts_CBSP_MSG_STATUS_QUERY(template (value) uint16_t msg_id,
685 template (value) uint16_t old_ser_nr,
686 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
687 template (value) uint8_t channel_ind) :=
688 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
689 ts_CbspMsgId(msg_id),
690 ts_OldSerNo(old_ser_nr),
691 ts_CbspCellList(cell_list),
692 ts_CbspChannelInd(channel_ind)});
693template (present) CBSP_PDU
694tr_CBSP_MSG_STATUS_QUERY(template (present) uint16_t msg_id := ?,
695 template (present) uint16_t old_ser_nr := ?,
696 template (present) BSSMAP_FIELD_CellIdentificationList cell_list := ?,
697 template (present) uint8_t channel_ind := ?) :=
698 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
699 ts_CbspMsgId(msg_id),
700 ts_OldSerNo(old_ser_nr),
701 ts_CbspCellList(cell_list),
702 ts_CbspChannelInd(channel_ind)});
703
704/* 8.1.3.11 MESSAGE STATUS QUERY COMPLETE */
705template (value) CBSP_PDU
706ts_CBSP_MSG_STATUS_QUERY_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
707 template (value) CBSP_IE_NumBcastComplList compl_list,
708 template (value) uint8_t channel_ind) :=
709 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
710 ts_CbspMsgId(msg_id),
711 ts_OldSerNo(old_ser_nr),
712 ts_CbspNumComplList(valueof(compl_list)),
713 ts_CbspChannelInd(channel_ind)});
714template (present) CBSP_PDU
715tr_CBSP_MSG_STATUS_QUERY_COMPL(template (present) uint16_t msg_id, template (present) uint16_t old_ser_nr,
716 template (present) CBSP_IE_NumBcastComplList compl_list,
717 template (present) uint8_t channel_ind) :=
718 tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
719 tr_CbspMsgId(msg_id),
720 tr_OldSerNo(old_ser_nr),
721 tr_CbspNumComplList(compl_list),
722 tr_CbspChannelInd(channel_ind)});
723
724/* 8.1.3.12 MESSAGE STATUS QUERY FAILURE */
725function ts_CBSP_MSG_STATUS_QUERY_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
726 template (value) CBSP_FailureListItems fail_list,
727 template (value) uint8_t channel_ind,
728 template (omit) CBSP_IE_NumBcastComplList compl_list)
729return template (value) CBSP_PDU {
730 var template (value) CBSP_IEs ies := {
731 ts_CbspMsgId(msg_id),
732 ts_OldSerNo(old_ser_nr),
733 ts_CbspFailList(fail_list),
734 ts_CbspChannelInd(channel_ind)
735 };
736 if (not istemplatekind(compl_list, "omit")) {
737 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
738 }
739 return ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
740}
741function tr_CBSP_MSG_STATUS_QUERY_FAIL(template (present) uint16_t msg_id := ?, template (present) uint16_t old_ser_nr := ?,
742 template (present) CBSP_FailureListItems fail_list := ?,
743 template (present) uint8_t channel_ind := ?,
744 template CBSP_IE_NumBcastComplList compl_list := *)
745return template (present) CBSP_PDU {
746 var template (present) CBSP_IEs ies := {
747 tr_CbspMsgId(msg_id),
748 tr_OldSerNo(old_ser_nr),
749 tr_CbspFailList(fail_list),
750 tr_CbspChannelInd(channel_ind)
751 };
752 if (istemplatekind(compl_list, "*")) {
753 testcase.stop("TITAN > 6.5.0 doesn't support this");
754 //ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
755 } else if (not istemplatekind(compl_list, "omit")) {
756 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
757 }
758 return tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
759}
760
Harald Welteea260342019-08-01 09:49:38 +0200761
762/* 8.1.3.16 RESET */
763template (value) CBSP_PDU ts_CBSP_RESET(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
764 ts_CBSP(CBSP_MSGT_RESET, {
765 ts_CbspCellList(cell_list)
766 });
767template CBSP_PDU tr_CBSP_RESET(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
768 tr_CBSP(CBSP_MSGT_RESET, {
769 tr_CbspCellList(cell_list)
770 });
771
772/* 8.1.3.17 RESET COMPLETE */
773template (value) CBSP_PDU ts_CBSP_RESET_COMPL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
774 ts_CBSP(CBSP_MSGT_RESET_COMPL, {
775 ts_CbspCellList(cell_list)
776 });
777template CBSP_PDU tr_CBSP_RESET_COMPL(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
778 tr_CBSP(CBSP_MSGT_RESET_COMPL, {
779 tr_CbspCellList(cell_list)
780 });
781
782/* 8.1.3.18 RESET FAILURE */
783template (value) CBSP_PDU ts_CBSP_RESET_FAIL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
784 template (value) CBSP_FailureListItems fail_items) :=
785 ts_CBSP(CBSP_MSGT_RESET_FAIL, {
786 ts_CbspFailList(fail_items),
787 ts_CbspCellList(cell_list)
788 });
789
790template CBSP_PDU tr_CBSP_RESET_FAIL(template BSSMAP_FIELD_CellIdentificationList cell_list,
791 template CBSP_FailureListItems fail_items) :=
792 tr_CBSP(CBSP_MSGT_RESET_FAIL, {
793 tr_CbspFailList(fail_items),
794 tr_CbspCellList(cell_list)
795 });
796
797/* 8.1.3.18a KEEP-ALIVE */
798template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE(uint8_t rep_period) :=
799 ts_CBSP(CBSP_MSGT_KEEP_ALIVE, {ts_CbspKARepPeriod(rep_period)});
800template CBSP_PDU tr_CBSP_KEEP_ALIVE(template uint8_t rep_period := ?) :=
801 tr_CBSP(CBSP_MSGT_KEEP_ALIVE, {tr_CbspKARepPeriod(rep_period)});
802
803/* 8.1.3.18b KEEP-ALIVE COMPLETE */
804template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE_COMPL :=
805 ts_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
806template CBSP_PDU tr_CBSP_KEEP_ALIVE_COMPL :=
807 tr_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
808
809/* 8.1.3.19 RESTART */
810template (value) CBSP_PDU ts_CBSP_RESTART(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
811 template (value) CBSP_BcastMsgType msg_type,
812 template (value) CBSP_RecoveryInd rec_ind) :=
813 ts_CBSP(CBSP_MSGT_RESTART, {
814 ts_CbspCellList(cell_list),
815 ts_CbspBcastMsgType(msg_type),
816 ts_CbspRecoveryInd(rec_ind)
817 });
818template CBSP_PDU tr_CBSP_RESTART(template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
819 template CBSP_BcastMsgType msg_type := ?,
820 template CBSP_RecoveryInd rec_ind := ?) :=
821 tr_CBSP(CBSP_MSGT_RESTART, {
822 tr_CbspCellList(cell_list),
823 tr_CbspBcastMsgType(msg_type),
824 tr_CbspRecoveryInd(rec_ind)
825 });
826
827/* 8.1.3.20 FAILURE */
828template (value) CBSP_PDU ts_CBSP_FAILURE(template (value) CBSP_FailureListItems fail_list,
829 template (value) CBSP_BcastMsgType msg_type) :=
830 ts_CBSP(CBSP_MSGT_FAILURE, {
831 ts_CbspFailList(fail_list),
832 ts_CbspBcastMsgType(msg_type)
833 });
834template CBSP_PDU tr_CBSP_FAILURE(template CBSP_FailureListItems fail_list := ?,
835 template CBSP_BcastMsgType msg_type := ?) :=
836 tr_CBSP(CBSP_MSGT_FAILURE, {
837 tr_CbspFailList(fail_list),
838 tr_CbspBcastMsgType(msg_type)
839 });
840
841/* 8.1.3.21 ERROR INDICATION */
842template (value) CBSP_PDU ts_CBSP_ERROR_IND(CBSP_Cause cause) :=
843 ts_CBSP(CBSP_MSGT_ERROR_IND, {ts_CbspCause(cause)});
844template CBSP_PDU tr_CBSP_ERROR_IND(template CBSP_Cause cause) :=
845 tr_CBSP(CBSP_MSGT_ERROR_IND, {tr_CbspCause(cause), *});
846
847
848function f_cbsp_find_ie(CBSP_PDU msg, CBSP_IEI iei, out CBSP_IE ret) return boolean {
849 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
850 if (msg.ies[i].iei == iei) {
851 ret := msg.ies[i];
852 return true;
853 }
854 }
855 return false;
856}
857
858
859}