blob: 6ff27425aefa9d246cedb7b3ba0bf69df2b4f15d [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
Pau Espin Pedrol696fbe72022-07-14 20:32:43 +0200137template (present) CBSP_FailureListItem CBSP_FailureListItem_CGI(
138 template (present) BSSMAP_FIELD_CellIdentification_CGI cgi := ?,
139 template (present) CBSP_Cause cause := ?) :=
140{
141 spare1_4 := '0000'B,
142 cell_id_discr := '0000'B,
143 cell_id := {
144 cI_CGI := cgi
145 },
146 cause := cause
147};
148
Pau Espin Pedrol2b33d4e2022-06-10 17:00:30 +0200149template (present) CBSP_FailureListItem CBSP_FailureListItem_LAC_CI(
150 template (present) BSSMAP_FIELD_CellIdentification_LAC_CI lac_ci := ?,
151 template (present) CBSP_Cause cause := ?) :=
152{
153 spare1_4 := '0000'B,
154 cell_id_discr := '0001'B,
155 cell_id := {
156 cI_LAC_CI := lac_ci
157 },
158 cause := cause
159};
160
Harald Welteea260342019-08-01 09:49:38 +0200161template (value) CBSP_IE ts_CbspNumComplList(template (value) CBSP_IE_NumBcastComplList list) :=
162 ts_CBSP_IE(CBSP_IEI_NUM_BCAST_COMPL_LIST, {num_bcast_compl_list := list});
163template CBSP_IE tr_CbspNumComplList(template CBSP_IE_NumBcastComplList list := ?) :=
164 tr_CBSP_IE({num_bcast_compl_list := list});
165
166template (value) CBSP_IE ts_CbspBcastMsgType(template (value) CBSP_BcastMsgType bi) :=
167 ts_CBSP_IE(CBSP_IEI_BCAST_MSG_TYPE, {bcast_msg_type := {
168 spare1_4 := '0000'B,
169 msg_type := bi
170 }});
171template CBSP_IE tr_CbspBcastMsgType(template CBSP_BcastMsgType bi := ?) :=
172 tr_CBSP_IE({bcast_msg_type := {
173 spare1_4 := ?,
174 msg_type := bi
175 }});
176
177template (value) CBSP_IE ts_CbspRecoveryInd(template (value) CBSP_RecoveryInd ri) :=
178 ts_CBSP_IE(CBSP_IEI_RECOVERY_IND, {recovery_ind := {
179 spare1_4 := '0000'B,
180 recovery := ri
181 }});
182template CBSP_IE tr_CbspRecoveryInd(template CBSP_RecoveryInd ri) :=
183 tr_CBSP_IE({recovery_ind := {
184 spare1_4 := ?,
185 recovery := ri
186 }});
187
188template (value) CBSP_IE ts_CbspMsgContent(template (value) octetstring payload, uint8_t user_len) :=
189 ts_CBSP_IE(CBSP_IEI_MSG_CONTENT, {msg_content := {
190 user_len := user_len,
191 val := payload
192 }});
193template CBSP_IE tr_CbspMsgContent(template octetstring payload := ?, template uint8_t user_len := ?) :=
194 tr_CBSP_IE({msg_content := {
195 user_len := user_len,
196 val := payload
197 }});
198
199template (value) CBSP_IE ts_CbspDCS(template (value) uint8_t dcs) :=
200 ts_CBSP_IE(CBSP_IEI_DCS, {dcs := dcs});
201template CBSP_IE tr_CbspDCS(template uint8_t dcs := ?) :=
202 tr_CBSP_IE({dcs := dcs});
203
204
205template (value) CBSP_PDU ts_CBSP(CBSP_MessageType msg_type, template (value) CBSP_IEs ies) := {
206 msg_type := msg_type,
207 len := 0, /* overwritten */
208 ies := ies
209}
210template CBSP_PDU tr_CBSP(template CBSP_MessageType msg_type := ?, template CBSP_IEs ies := *) := {
211 msg_type := msg_type,
212 len := ?,
213 ies := ies
214}
215
216
217
218/* 8.1.3.1 WRITE REPLACE */
219function ts_CBSP_WRITE_CBS(template (value) uint16_t msg_id,
220 template (value) uint16_t new_ser_nr,
221 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
222 template (value) uint8_t channel_ind,
223 template (value) CBSP_Category category,
224 template (value) uint16_t rep_period,
225 template (value) uint16_t num_bcast_req,
226 template (value) uint8_t dcs,
227 template (value) CBSP_IEs content) return template (value) CBSP_PDU {
228 var template (value) CBSP_IEs ies := {
229 ts_CbspMsgId(msg_id),
230 ts_NewSerNo(new_ser_nr),
231 ts_CbspCellList(cell_list),
232 ts_CbspChannelInd(channel_ind),
233 ts_CbspCategory(category),
234 ts_CbspRepetitionPeriod(rep_period),
235 ts_CbspNumBcastReq(num_bcast_req),
236 ts_CbspDCS(dcs),
237 ts_CbspNumPages(lengthof(content))
238 };
239 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE, valueof(ies) & valueof(content));
240}
241template CBSP_PDU tr_CBSP_WRITE_CBS(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
242 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
243 template uint8_t channel_ind := ?,
244 template CBSP_Category category := ?,
245 template uint16_t rep_period := ?,
246 template uint16_t num_bcast_req := ?,
247 template uint8_t dcs := ?,
248 template CBSP_IEs content := ?
249 ) :=
250 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, ({
251 tr_CbspMsgId(msg_id),
252 tr_NewSerNo(new_ser_nr),
253 tr_CbspCellList(cell_list),
254 tr_CbspChannelInd(channel_ind),
255 tr_CbspCategory(category),
256 tr_CbspRepetitionPeriod(rep_period),
257 tr_CbspNumBcastReq(num_bcast_req),
258 tr_CbspDCS(dcs),
259 tr_CbspNumPages(lengthof(content)), all from content }));
260
261
262function ts_CBSP_REPLACE_CBS(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
263 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
264 template (value) uint8_t channel_ind,
265 template (value) CBSP_Category category,
266 template (value) uint16_t rep_period,
267 template (value) uint16_t num_bcast_req,
268 template (value) uint8_t dcs,
269 template (value) CBSP_IEs content) return template (value) CBSP_PDU {
270 var template (value) CBSP_IEs ies := {
271 ts_CbspMsgId(msg_id),
272 ts_NewSerNo(new_ser_nr),
273 ts_OldSerNo(old_ser_nr),
274 ts_CbspCellList(cell_list),
275 ts_CbspChannelInd(channel_ind),
276 ts_CbspCategory(category),
277 ts_CbspRepetitionPeriod(rep_period),
278 ts_CbspNumBcastReq(num_bcast_req),
279 ts_CbspDCS(dcs),
280 ts_CbspNumPages(lengthof(content))
281 };
282 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE, valueof(ies) & valueof(content));
283}
284template CBSP_PDU tr_CBSP_REPLACE_CBS(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
285 template uint16_t old_ser_nr := ?,
286 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
287 template uint8_t channel_ind := ?,
288 template CBSP_Category category := ?,
289 template uint16_t rep_period := ?,
290 template uint16_t num_bcast_req := ?,
291 template uint8_t dcs := ?,
292 template CBSP_IEs content := ?
293 ) :=
294 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, ({
295 tr_CbspMsgId(msg_id),
296 tr_NewSerNo(new_ser_nr),
297 tr_OldSerNo(old_ser_nr),
298 tr_CbspCellList(cell_list),
299 tr_CbspChannelInd(channel_ind),
300 tr_CbspCategory(category),
301 tr_CbspRepetitionPeriod(rep_period),
302 tr_CbspNumBcastReq(num_bcast_req),
303 tr_CbspDCS(dcs),
304 tr_CbspNumPages(lengthof(content)), all from content }));
305
306template (value) CBSP_PDU ts_CBSP_WRITE_EMERG(uint16_t msg_id, uint16_t new_ser_nr,
307 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
308 template (value) uint8_t emerg_ind,
309 template (value) uint16_t warn_type,
Harald Welteea260342019-08-01 09:49:38 +0200310 template (value) uint8_t warn_per
311 ) :=
312 ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
313 ts_CbspMsgId(msg_id),
314 ts_NewSerNo(new_ser_nr),
315 ts_CbspCellList(cell_list),
316 ts_EmergencyInd(emerg_ind),
317 ts_WarningType(warn_type),
318 ts_WarnSecInfo,
319 ts_WarningPeriod(warn_per) });
320template CBSP_PDU tr_CBSP_WRITE_EMERG(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
321 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
322 template uint8_t emerg_ind := ?,
323 template uint16_t warn_type := ?,
324 template uint16_t num_bcast_req := ?,
325 template uint8_t warn_per := ?
326 ) :=
327 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, {
328 tr_CbspMsgId(msg_id),
329 tr_NewSerNo(new_ser_nr),
330 tr_CbspCellList(cell_list),
331 tr_EmergencyInd(emerg_ind),
332 tr_WarningType(warn_type),
333 tr_WarnSecInfo,
334 tr_WarningPeriod(warn_per) });
335
336
337template (value) CBSP_PDU ts_CBSP_REPLACE_EMERG(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
338 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
339 template (value) uint8_t emerg_ind,
340 template (value) uint16_t warn_type,
Harald Welteea260342019-08-01 09:49:38 +0200341 template (value) uint8_t warn_per
342 ) :=
343 ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
344 ts_CbspMsgId(msg_id),
345 ts_NewSerNo(new_ser_nr),
346 ts_OldSerNo(old_ser_nr),
347 ts_CbspCellList(cell_list),
348 ts_EmergencyInd(emerg_ind),
349 ts_WarningType(warn_type),
350 ts_WarnSecInfo,
351 ts_WarningPeriod(warn_per) });
352template CBSP_PDU tr_CBSP_REPLACE_EMERG(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?,
353 template uint16_t old_ser_nr := ?,
354 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
355 template uint8_t emerg_ind := ?,
356 template uint16_t warn_type := ?,
Harald Welteea260342019-08-01 09:49:38 +0200357 template uint8_t warn_per := ?
358 ) :=
359 tr_CBSP(CBSP_MSGT_WRITE_REPLACE, {
360 tr_CbspMsgId(msg_id),
361 tr_NewSerNo(new_ser_nr),
362 tr_OldSerNo(old_ser_nr),
363 tr_CbspCellList(cell_list),
364 tr_EmergencyInd(emerg_ind),
365 tr_WarningType(warn_type),
366 tr_WarnSecInfo,
367 tr_WarningPeriod(warn_per) });
368
369/* 8.1.3.2 WRITE-REPLACE COMPLETE */
370function ts_CBSP_WRITE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr,
371 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
372 template (value) uint8_t channel_ind)
373return template (value) CBSP_PDU {
374 var template (value) CBSP_IEs ies := {
375 ts_CbspMsgId(msg_id),
376 ts_NewSerNo(new_ser_nr)
377 };
378 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200379 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200380 }
381 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
382 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
383}
384function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
385 template BSSMAP_FIELD_CellIdentificationList cell_list,
386 template uint8_t channel_ind)
387return template CBSP_PDU {
388 var template CBSP_IEs ies := {
389 tr_CbspMsgId(msg_id),
390 tr_NewSerNo(new_ser_nr)
391 };
392 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200393 testcase.stop("TITAN > 6.5.0 doesn't support this");
394 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200395 } else if (istemplatekind(cell_list, "?")) {
396 ies[lengthof(ies)] := tr_CbspCellList(?);
397 } else if (not istemplatekind(cell_list, "omit")) {
398 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
399 }
Harald Welte25a60752019-09-06 23:08:23 +0200400 if (not istemplatekind(channel_ind, "omit")) {
401 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
402 }
Harald Welteea260342019-08-01 09:49:38 +0200403 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
404}
405
406
407function ts_CBSP_REPLACE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
408 template (value) CBSP_IE_NumBcastComplList compl_list,
409 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
410 template (value) uint8_t channel_ind)
411return template (value) CBSP_PDU {
412 var template (value) CBSP_IEs ies := {
413 ts_CbspMsgId(msg_id),
414 ts_NewSerNo(new_ser_nr),
415 ts_OldSerNo(old_ser_nr),
416 ts_CbspNumComplList(compl_list)
417 };
418 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200419 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200420 }
421 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
422 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
423}
424function tr_CBSP_REPLACE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
425 template uint16_t old_ser_nr,
426 template CBSP_IE_NumBcastComplList compl_list,
427 template BSSMAP_FIELD_CellIdentificationList cell_list,
428 template uint8_t channel_ind)
429return template CBSP_PDU {
430 var template CBSP_IEs ies := {
431 tr_CbspMsgId(msg_id),
432 tr_NewSerNo(new_ser_nr),
Harald Welted6869412022-04-27 17:50:13 +0200433 tr_OldSerNo(old_ser_nr)
Harald Welteea260342019-08-01 09:49:38 +0200434 };
Harald Welted6869412022-04-27 17:50:13 +0200435 if (istemplatekind(compl_list, "*")) {
436 testcase.stop("TITAN > 6.5.0 doesn't support this");
437 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
438 } else if (istemplatekind(compl_list, "?")) {
439 ies[lengthof(ies)] := tr_CbspNumComplList(?);
440 } else if (not istemplatekind(compl_list, "omit")) {
441 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
442 }
443
Harald Welteea260342019-08-01 09:49:38 +0200444 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200445 testcase.stop("TITAN > 6.5.0 doesn't support this");
446 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200447 } else if (istemplatekind(cell_list, "?")) {
448 ies[lengthof(ies)] := tr_CbspCellList(?);
449 } else if (not istemplatekind(cell_list, "omit")) {
450 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
451 }
Harald Welte25a60752019-09-06 23:08:23 +0200452 if (not istemplatekind(channel_ind, "omit")) {
453 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
454 }
Harald Welteea260342019-08-01 09:49:38 +0200455 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
456}
457
458
459/* 8.1.3.3 WRITE-REPLACE FAILURE */
460function ts_CBSP_WRITE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr,
461 template (value) CBSP_FailureListItems fail_list,
462 template (omit) CBSP_IE_NumBcastComplList compl_list,
463 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
464 template (value) uint8_t channel_ind)
465return template (value) CBSP_PDU {
466 var template (value) CBSP_IEs ies := {
467 ts_CbspMsgId(msg_id),
468 ts_NewSerNo(new_ser_nr),
469 ts_CbspFailList(fail_list)
470 };
471 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200472 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200473 }
474 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200475 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200476 }
477 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
478 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
479}
480function tr_CBSP_WRITE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
481 template CBSP_FailureListItems fail_list,
482 template CBSP_IE_NumBcastComplList compl_list,
483 template BSSMAP_FIELD_CellIdentificationList cell_list,
484 template uint8_t channel_ind)
485return template CBSP_PDU {
486 var template CBSP_IEs ies := {
487 tr_CbspMsgId(msg_id),
488 tr_NewSerNo(new_ser_nr),
489 tr_CbspFailList(fail_list)
490 };
491 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200492 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200493 } else if (istemplatekind(compl_list, "?")) {
494 ies[lengthof(ies)] := tr_CbspNumComplList(?);
495 } else if (not istemplatekind(compl_list, "omit")) {
496 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
497 }
498 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200499 testcase.stop("TITAN > 6.5.0 doesn't support this");
500 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200501 } else if (istemplatekind(cell_list, "?")) {
502 ies[lengthof(ies)] := tr_CbspCellList(?);
503 } else if (not istemplatekind(cell_list, "omit")) {
504 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
505 }
Harald Welte25a60752019-09-06 23:08:23 +0200506 if (not istemplatekind(channel_ind, "omit")) {
507 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
508 }
Harald Welteea260342019-08-01 09:49:38 +0200509 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
510}
511
512
513function ts_CBSP_REPLACE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
514 template (value) CBSP_FailureListItems fail_list,
515 template (omit) CBSP_IE_NumBcastComplList compl_list,
516 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
517 template (value) uint8_t channel_ind)
518return template (value) CBSP_PDU {
519 var template (value) CBSP_IEs ies := {
520 ts_CbspMsgId(msg_id),
521 ts_NewSerNo(new_ser_nr),
522 ts_OldSerNo(old_ser_nr),
523 ts_CbspFailList(fail_list)
524 };
525 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200526 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200527 }
528 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200529 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200530 }
531 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
532 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
533}
534function tr_CBSP_REPLACE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
535 template uint16_t old_ser_nr,
536 template CBSP_FailureListItems fail_list,
537 template CBSP_IE_NumBcastComplList compl_list,
538 template BSSMAP_FIELD_CellIdentificationList cell_list,
539 template uint8_t channel_ind)
540return template CBSP_PDU {
541 var template CBSP_IEs ies := {
542 tr_CbspMsgId(msg_id),
543 tr_NewSerNo(new_ser_nr),
544 tr_OldSerNo(old_ser_nr),
545 tr_CbspFailList(fail_list)
546 };
547 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200548 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200549 } else if (istemplatekind(compl_list, "?")) {
550 ies[lengthof(ies)] := tr_CbspNumComplList(?);
551 } else if (not istemplatekind(compl_list, "omit")) {
552 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
553 }
554 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200555 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200556 } else if (istemplatekind(cell_list, "?")) {
557 ies[lengthof(ies)] := tr_CbspCellList(?);
558 } else if (not istemplatekind(cell_list, "omit")) {
559 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
560 }
561 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
562 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
563}
564
565/* 8.1.3.4 KILL */
Harald Welte4a788a02022-04-27 16:57:24 +0200566function ts_CBSP_KILL(template (value) uint16_t msg_id,
567 template (value) uint16_t old_ser_nr,
568 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
569 template (omit) uint8_t channel_ind)
570return template (value) CBSP_PDU {
571 var template (value) CBSP_IEs ies := {
572 ts_CbspMsgId(msg_id),
573 ts_OldSerNo(old_ser_nr),
574 ts_CbspCellList(cell_list)
575 };
576 if (not istemplatekind(channel_ind, "omit")) {
577 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
578 }
579 return ts_CBSP(CBSP_MSGT_KILL, ies);
580}
Harald Welte08332302019-08-01 09:54:40 +0200581function tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
582 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
583 template uint8_t channel_ind := ?)
584return template (present) CBSP_PDU {
585 var template CBSP_IEs ies := {
586 tr_CbspMsgId(msg_id),
587 tr_OldSerNo(old_ser_nr),
588 tr_CbspCellList(cell_list)
589 };
590 if (not istemplatekind(channel_ind, "omit")) {
591 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
592 }
593 return tr_CBSP(CBSP_MSGT_KILL, ies);
594}
Harald Welteea260342019-08-01 09:49:38 +0200595
596/* 8.1.3.5 KILL COMPLETE */
597function ts_CBSP_KILL_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
598 template (omit) CBSP_IE_NumBcastComplList compl_list,
599 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
600 template (omit) uint8_t channel_ind)
601return template (value) CBSP_PDU {
602 var template (value) CBSP_IEs ies := {
603 ts_CbspMsgId(msg_id),
604 ts_OldSerNo(old_ser_nr)
605 };
606 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200607 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200608 }
609 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200610 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200611 }
612 if (not istemplatekind(channel_ind, "omit")) {
613 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
614 }
615 return ts_CBSP(CBSP_MSGT_KILL_COMPL, ies);
616}
617function tr_CBSP_KILL_COMPL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
618 template CBSP_IE_NumBcastComplList compl_list := ?,
619 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
620 template uint8_t channel_ind)
621return template CBSP_PDU {
622 var template CBSP_IEs ies := {
623 tr_CbspMsgId(msg_id),
624 tr_OldSerNo(old_ser_nr)
625 };
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200626 /* As soon as adding a '*' IE item, lengthof() no longer works on the ies record. So keep track of the
627 * next index to use separately. */
628 var integer next_idx := lengthof(ies);
Harald Welteea260342019-08-01 09:49:38 +0200629 if (istemplatekind(compl_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200630 ies[next_idx] := *;
631 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200632 } else if (not istemplatekind(compl_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200633 ies[next_idx] := tr_CbspNumComplList(compl_list);
634 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200635 }
636 if (istemplatekind(cell_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200637 ies[next_idx] := *;
638 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200639 } else if (not istemplatekind(cell_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200640 ies[next_idx] := tr_CbspCellList(cell_list);
641 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200642 }
643 if (istemplatekind(channel_ind, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200644 ies[next_idx] := *;
645 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200646 } else if (not istemplatekind(channel_ind, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200647 ies[next_idx] := tr_CbspChannelInd(channel_ind);
648 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200649 }
650 return tr_CBSP(CBSP_MSGT_KILL_COMPL, ies);
651}
652
653/* 8.1.3.6 KILL FAILURE */
654function ts_CBSP_KILL_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
655 template (value) CBSP_FailureListItems fail_list,
656 template (omit) CBSP_IE_NumBcastComplList compl_list,
657 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
658 template (omit) uint8_t channel_ind)
659return template (value) CBSP_PDU {
660 var template (value) CBSP_IEs ies := {
661 ts_CbspMsgId(msg_id),
662 ts_OldSerNo(old_ser_nr),
663 ts_CbspFailList(fail_list)
664 };
665 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200666 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200667 }
668 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200669 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200670 }
671 if (not istemplatekind(channel_ind, "omit")) {
672 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
673 }
674 return ts_CBSP(CBSP_MSGT_KILL_FAIL, ies);
675}
676function tr_CBSP_KILL_FAIL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
677 template CBSP_FailureListItems fail_list := ?,
678 template CBSP_IE_NumBcastComplList compl_list := *,
679 template BSSMAP_FIELD_CellIdentificationList cell_list := *,
680 template uint8_t channel_ind := *)
681return template CBSP_PDU {
682 var template CBSP_IEs ies := {
683 tr_CbspMsgId(msg_id),
684 tr_OldSerNo(old_ser_nr),
685 tr_CbspFailList(fail_list)
686 };
687 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200688 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200689 } else if (not istemplatekind(compl_list, "omit")) {
690 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
691 }
Harald Welte885de1c2020-04-20 17:50:22 +0200692 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200693 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200694 } else if (not istemplatekind(cell_list, "omit")) {
695 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
696 }
697 if (istemplatekind(channel_ind, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200698 testcase.stop("TITAN > 6.5.0 doesn't support this");
699 //ies[lengthof(ies)] := tr_CbspChannelInd(?) ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200700 } else if (not istemplatekind(channel_ind, "omit")) {
701 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
702 }
703 return tr_CBSP(CBSP_MSGT_KILL_FAIL, ies);
704}
705
Harald Welte562d28e2022-03-28 21:29:04 +0200706/* 8.1.3.10 MESSAGE STATUS QUERY */
707template (value) CBSP_PDU
708ts_CBSP_MSG_STATUS_QUERY(template (value) uint16_t msg_id,
709 template (value) uint16_t old_ser_nr,
710 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
711 template (value) uint8_t channel_ind) :=
712 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
713 ts_CbspMsgId(msg_id),
714 ts_OldSerNo(old_ser_nr),
715 ts_CbspCellList(cell_list),
716 ts_CbspChannelInd(channel_ind)});
717template (present) CBSP_PDU
718tr_CBSP_MSG_STATUS_QUERY(template (present) uint16_t msg_id := ?,
719 template (present) uint16_t old_ser_nr := ?,
720 template (present) BSSMAP_FIELD_CellIdentificationList cell_list := ?,
721 template (present) uint8_t channel_ind := ?) :=
722 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
723 ts_CbspMsgId(msg_id),
724 ts_OldSerNo(old_ser_nr),
725 ts_CbspCellList(cell_list),
726 ts_CbspChannelInd(channel_ind)});
727
728/* 8.1.3.11 MESSAGE STATUS QUERY COMPLETE */
729template (value) CBSP_PDU
730ts_CBSP_MSG_STATUS_QUERY_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
731 template (value) CBSP_IE_NumBcastComplList compl_list,
732 template (value) uint8_t channel_ind) :=
733 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
734 ts_CbspMsgId(msg_id),
735 ts_OldSerNo(old_ser_nr),
736 ts_CbspNumComplList(valueof(compl_list)),
737 ts_CbspChannelInd(channel_ind)});
738template (present) CBSP_PDU
739tr_CBSP_MSG_STATUS_QUERY_COMPL(template (present) uint16_t msg_id, template (present) uint16_t old_ser_nr,
740 template (present) CBSP_IE_NumBcastComplList compl_list,
741 template (present) uint8_t channel_ind) :=
742 tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
743 tr_CbspMsgId(msg_id),
744 tr_OldSerNo(old_ser_nr),
745 tr_CbspNumComplList(compl_list),
746 tr_CbspChannelInd(channel_ind)});
747
748/* 8.1.3.12 MESSAGE STATUS QUERY FAILURE */
749function ts_CBSP_MSG_STATUS_QUERY_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
750 template (value) CBSP_FailureListItems fail_list,
751 template (value) uint8_t channel_ind,
752 template (omit) CBSP_IE_NumBcastComplList compl_list)
753return template (value) CBSP_PDU {
754 var template (value) CBSP_IEs ies := {
755 ts_CbspMsgId(msg_id),
756 ts_OldSerNo(old_ser_nr),
757 ts_CbspFailList(fail_list),
758 ts_CbspChannelInd(channel_ind)
759 };
760 if (not istemplatekind(compl_list, "omit")) {
761 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
762 }
763 return ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
764}
765function tr_CBSP_MSG_STATUS_QUERY_FAIL(template (present) uint16_t msg_id := ?, template (present) uint16_t old_ser_nr := ?,
766 template (present) CBSP_FailureListItems fail_list := ?,
767 template (present) uint8_t channel_ind := ?,
768 template CBSP_IE_NumBcastComplList compl_list := *)
769return template (present) CBSP_PDU {
770 var template (present) CBSP_IEs ies := {
771 tr_CbspMsgId(msg_id),
772 tr_OldSerNo(old_ser_nr),
773 tr_CbspFailList(fail_list),
774 tr_CbspChannelInd(channel_ind)
775 };
776 if (istemplatekind(compl_list, "*")) {
777 testcase.stop("TITAN > 6.5.0 doesn't support this");
778 //ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
779 } else if (not istemplatekind(compl_list, "omit")) {
780 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
781 }
782 return tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
783}
784
Harald Welteea260342019-08-01 09:49:38 +0200785
786/* 8.1.3.16 RESET */
787template (value) CBSP_PDU ts_CBSP_RESET(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
788 ts_CBSP(CBSP_MSGT_RESET, {
789 ts_CbspCellList(cell_list)
790 });
791template CBSP_PDU tr_CBSP_RESET(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
792 tr_CBSP(CBSP_MSGT_RESET, {
793 tr_CbspCellList(cell_list)
794 });
795
796/* 8.1.3.17 RESET COMPLETE */
797template (value) CBSP_PDU ts_CBSP_RESET_COMPL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
798 ts_CBSP(CBSP_MSGT_RESET_COMPL, {
799 ts_CbspCellList(cell_list)
800 });
801template CBSP_PDU tr_CBSP_RESET_COMPL(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
802 tr_CBSP(CBSP_MSGT_RESET_COMPL, {
803 tr_CbspCellList(cell_list)
804 });
805
806/* 8.1.3.18 RESET FAILURE */
807template (value) CBSP_PDU ts_CBSP_RESET_FAIL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
808 template (value) CBSP_FailureListItems fail_items) :=
809 ts_CBSP(CBSP_MSGT_RESET_FAIL, {
810 ts_CbspFailList(fail_items),
811 ts_CbspCellList(cell_list)
812 });
813
814template CBSP_PDU tr_CBSP_RESET_FAIL(template BSSMAP_FIELD_CellIdentificationList cell_list,
815 template CBSP_FailureListItems fail_items) :=
816 tr_CBSP(CBSP_MSGT_RESET_FAIL, {
817 tr_CbspFailList(fail_items),
818 tr_CbspCellList(cell_list)
819 });
820
821/* 8.1.3.18a KEEP-ALIVE */
822template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE(uint8_t rep_period) :=
823 ts_CBSP(CBSP_MSGT_KEEP_ALIVE, {ts_CbspKARepPeriod(rep_period)});
824template CBSP_PDU tr_CBSP_KEEP_ALIVE(template uint8_t rep_period := ?) :=
825 tr_CBSP(CBSP_MSGT_KEEP_ALIVE, {tr_CbspKARepPeriod(rep_period)});
826
827/* 8.1.3.18b KEEP-ALIVE COMPLETE */
828template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE_COMPL :=
829 ts_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
830template CBSP_PDU tr_CBSP_KEEP_ALIVE_COMPL :=
831 tr_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
832
833/* 8.1.3.19 RESTART */
834template (value) CBSP_PDU ts_CBSP_RESTART(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
835 template (value) CBSP_BcastMsgType msg_type,
836 template (value) CBSP_RecoveryInd rec_ind) :=
837 ts_CBSP(CBSP_MSGT_RESTART, {
838 ts_CbspCellList(cell_list),
839 ts_CbspBcastMsgType(msg_type),
840 ts_CbspRecoveryInd(rec_ind)
841 });
842template CBSP_PDU tr_CBSP_RESTART(template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
843 template CBSP_BcastMsgType msg_type := ?,
844 template CBSP_RecoveryInd rec_ind := ?) :=
845 tr_CBSP(CBSP_MSGT_RESTART, {
846 tr_CbspCellList(cell_list),
847 tr_CbspBcastMsgType(msg_type),
848 tr_CbspRecoveryInd(rec_ind)
849 });
850
851/* 8.1.3.20 FAILURE */
852template (value) CBSP_PDU ts_CBSP_FAILURE(template (value) CBSP_FailureListItems fail_list,
853 template (value) CBSP_BcastMsgType msg_type) :=
854 ts_CBSP(CBSP_MSGT_FAILURE, {
855 ts_CbspFailList(fail_list),
856 ts_CbspBcastMsgType(msg_type)
857 });
858template CBSP_PDU tr_CBSP_FAILURE(template CBSP_FailureListItems fail_list := ?,
859 template CBSP_BcastMsgType msg_type := ?) :=
860 tr_CBSP(CBSP_MSGT_FAILURE, {
861 tr_CbspFailList(fail_list),
862 tr_CbspBcastMsgType(msg_type)
863 });
864
865/* 8.1.3.21 ERROR INDICATION */
866template (value) CBSP_PDU ts_CBSP_ERROR_IND(CBSP_Cause cause) :=
867 ts_CBSP(CBSP_MSGT_ERROR_IND, {ts_CbspCause(cause)});
868template CBSP_PDU tr_CBSP_ERROR_IND(template CBSP_Cause cause) :=
869 tr_CBSP(CBSP_MSGT_ERROR_IND, {tr_CbspCause(cause), *});
870
871
872function f_cbsp_find_ie(CBSP_PDU msg, CBSP_IEI iei, out CBSP_IE ret) return boolean {
873 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
874 if (msg.ies[i].iei == iei) {
875 ret := msg.ies[i];
876 return true;
877 }
878 }
879 return false;
880}
881
882
883}