blob: bcbb7be58e03d8faeb4867ecd38f82008f481d66 [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}
Pau Espin Pedrolad5d2db2022-08-03 14:02:02 +0200384function ts_CBSP_WRITE_EMERG_COMPL(uint16_t msg_id, uint16_t new_ser_nr,
385 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list)
386return template (value) CBSP_PDU {
387 var template (value) CBSP_IEs ies := {
388 ts_CbspMsgId(msg_id),
389 ts_NewSerNo(new_ser_nr)
390 };
391 if (not istemplatekind(cell_list, "omit")) {
392 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
393 }
394 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
395}
396
Harald Welteea260342019-08-01 09:49:38 +0200397function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
398 template BSSMAP_FIELD_CellIdentificationList cell_list,
399 template uint8_t channel_ind)
400return template CBSP_PDU {
401 var template CBSP_IEs ies := {
402 tr_CbspMsgId(msg_id),
403 tr_NewSerNo(new_ser_nr)
404 };
405 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200406 testcase.stop("TITAN > 6.5.0 doesn't support this");
407 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200408 } else if (istemplatekind(cell_list, "?")) {
409 ies[lengthof(ies)] := tr_CbspCellList(?);
410 } else if (not istemplatekind(cell_list, "omit")) {
411 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
412 }
Pau Espin Pedrolad5d2db2022-08-03 14:02:02 +0200413 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
414 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
415}
416function tr_CBSP_WRITE_EMERG_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
417 template BSSMAP_FIELD_CellIdentificationList cell_list)
418return template CBSP_PDU {
419 var template CBSP_IEs ies := {
420 tr_CbspMsgId(msg_id),
421 tr_NewSerNo(new_ser_nr)
422 };
423 if (istemplatekind(cell_list, "*")) {
424 testcase.stop("TITAN > 6.5.0 doesn't support this");
425 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
426 } else if (istemplatekind(cell_list, "?")) {
427 ies[lengthof(ies)] := tr_CbspCellList(?);
428 } else if (not istemplatekind(cell_list, "omit")) {
429 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
Harald Welte25a60752019-09-06 23:08:23 +0200430 }
Harald Welteea260342019-08-01 09:49:38 +0200431 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
432}
433
434
435function ts_CBSP_REPLACE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
436 template (value) CBSP_IE_NumBcastComplList compl_list,
437 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
438 template (value) uint8_t channel_ind)
439return template (value) CBSP_PDU {
440 var template (value) CBSP_IEs ies := {
441 ts_CbspMsgId(msg_id),
442 ts_NewSerNo(new_ser_nr),
443 ts_OldSerNo(old_ser_nr),
444 ts_CbspNumComplList(compl_list)
445 };
446 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200447 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200448 }
449 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
450 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
451}
Pau Espin Pedrolad5d2db2022-08-03 14:02:02 +0200452function ts_CBSP_REPLACE_EMERG_COMPL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
453 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list)
454return template (value) CBSP_PDU {
455 var template (value) CBSP_IEs ies := {
456 ts_CbspMsgId(msg_id),
457 ts_NewSerNo(new_ser_nr),
458 ts_OldSerNo(old_ser_nr)
459 };
460 if (not istemplatekind(cell_list, "omit")) {
461 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
462 }
463 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
464}
Harald Welteea260342019-08-01 09:49:38 +0200465function tr_CBSP_REPLACE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
466 template uint16_t old_ser_nr,
467 template CBSP_IE_NumBcastComplList compl_list,
468 template BSSMAP_FIELD_CellIdentificationList cell_list,
469 template uint8_t channel_ind)
470return template CBSP_PDU {
471 var template CBSP_IEs ies := {
472 tr_CbspMsgId(msg_id),
473 tr_NewSerNo(new_ser_nr),
Harald Welted6869412022-04-27 17:50:13 +0200474 tr_OldSerNo(old_ser_nr)
Harald Welteea260342019-08-01 09:49:38 +0200475 };
Harald Welted6869412022-04-27 17:50:13 +0200476 if (istemplatekind(compl_list, "*")) {
477 testcase.stop("TITAN > 6.5.0 doesn't support this");
478 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
479 } else if (istemplatekind(compl_list, "?")) {
480 ies[lengthof(ies)] := tr_CbspNumComplList(?);
481 } else if (not istemplatekind(compl_list, "omit")) {
482 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
483 }
484
Harald Welteea260342019-08-01 09:49:38 +0200485 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200486 testcase.stop("TITAN > 6.5.0 doesn't support this");
487 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200488 } else if (istemplatekind(cell_list, "?")) {
489 ies[lengthof(ies)] := tr_CbspCellList(?);
490 } else if (not istemplatekind(cell_list, "omit")) {
491 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
492 }
Harald Welte25a60752019-09-06 23:08:23 +0200493 if (not istemplatekind(channel_ind, "omit")) {
494 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
495 }
Harald Welteea260342019-08-01 09:49:38 +0200496 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
497}
Pau Espin Pedrolad5d2db2022-08-03 14:02:02 +0200498function tr_CBSP_REPLACE_EMERG_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
499 template uint16_t old_ser_nr,
500 template BSSMAP_FIELD_CellIdentificationList cell_list)
501return template CBSP_PDU {
502 var template CBSP_IEs ies := {
503 tr_CbspMsgId(msg_id),
504 tr_NewSerNo(new_ser_nr),
505 tr_OldSerNo(old_ser_nr)
506 };
507
508 if (istemplatekind(cell_list, "*")) {
509 testcase.stop("TITAN > 6.5.0 doesn't support this");
510 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
511 } else if (istemplatekind(cell_list, "?")) {
512 ies[lengthof(ies)] := tr_CbspCellList(?);
513 } else if (not istemplatekind(cell_list, "omit")) {
514 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
515 }
516 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
517}
Harald Welteea260342019-08-01 09:49:38 +0200518
519
520/* 8.1.3.3 WRITE-REPLACE FAILURE */
521function ts_CBSP_WRITE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr,
522 template (value) CBSP_FailureListItems fail_list,
523 template (omit) CBSP_IE_NumBcastComplList compl_list,
524 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
525 template (value) uint8_t channel_ind)
526return template (value) CBSP_PDU {
527 var template (value) CBSP_IEs ies := {
528 ts_CbspMsgId(msg_id),
529 ts_NewSerNo(new_ser_nr),
530 ts_CbspFailList(fail_list)
531 };
532 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200533 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200534 }
535 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200536 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200537 }
538 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
539 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
540}
541function tr_CBSP_WRITE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
542 template CBSP_FailureListItems fail_list,
543 template CBSP_IE_NumBcastComplList compl_list,
544 template BSSMAP_FIELD_CellIdentificationList cell_list,
545 template uint8_t channel_ind)
546return template CBSP_PDU {
547 var template CBSP_IEs ies := {
548 tr_CbspMsgId(msg_id),
549 tr_NewSerNo(new_ser_nr),
550 tr_CbspFailList(fail_list)
551 };
552 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200553 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200554 } else if (istemplatekind(compl_list, "?")) {
555 ies[lengthof(ies)] := tr_CbspNumComplList(?);
556 } else if (not istemplatekind(compl_list, "omit")) {
557 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
558 }
559 if (istemplatekind(cell_list, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200560 testcase.stop("TITAN > 6.5.0 doesn't support this");
561 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200562 } else if (istemplatekind(cell_list, "?")) {
563 ies[lengthof(ies)] := tr_CbspCellList(?);
564 } else if (not istemplatekind(cell_list, "omit")) {
565 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
566 }
Harald Welte25a60752019-09-06 23:08:23 +0200567 if (not istemplatekind(channel_ind, "omit")) {
568 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
569 }
Harald Welteea260342019-08-01 09:49:38 +0200570 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
571}
572
573
574function ts_CBSP_REPLACE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr,
575 template (value) CBSP_FailureListItems fail_list,
576 template (omit) CBSP_IE_NumBcastComplList compl_list,
577 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
578 template (value) uint8_t channel_ind)
579return template (value) CBSP_PDU {
580 var template (value) CBSP_IEs ies := {
581 ts_CbspMsgId(msg_id),
582 ts_NewSerNo(new_ser_nr),
583 ts_OldSerNo(old_ser_nr),
584 ts_CbspFailList(fail_list)
585 };
586 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200587 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200588 }
589 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200590 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200591 }
592 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
593 return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
594}
595function tr_CBSP_REPLACE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr,
596 template uint16_t old_ser_nr,
597 template CBSP_FailureListItems fail_list,
598 template CBSP_IE_NumBcastComplList compl_list,
599 template BSSMAP_FIELD_CellIdentificationList cell_list,
600 template uint8_t channel_ind)
601return template CBSP_PDU {
602 var template CBSP_IEs ies := {
603 tr_CbspMsgId(msg_id),
604 tr_NewSerNo(new_ser_nr),
605 tr_OldSerNo(old_ser_nr),
606 tr_CbspFailList(fail_list)
607 };
608 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200609 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200610 } else if (istemplatekind(compl_list, "?")) {
611 ies[lengthof(ies)] := tr_CbspNumComplList(?);
612 } else if (not istemplatekind(compl_list, "omit")) {
613 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
614 }
615 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200616 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200617 } else if (istemplatekind(cell_list, "?")) {
618 ies[lengthof(ies)] := tr_CbspCellList(?);
619 } else if (not istemplatekind(cell_list, "omit")) {
620 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
621 }
622 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
623 return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies);
624}
625
626/* 8.1.3.4 KILL */
Harald Welte4a788a02022-04-27 16:57:24 +0200627function ts_CBSP_KILL(template (value) uint16_t msg_id,
628 template (value) uint16_t old_ser_nr,
629 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
630 template (omit) uint8_t channel_ind)
631return template (value) CBSP_PDU {
632 var template (value) CBSP_IEs ies := {
633 ts_CbspMsgId(msg_id),
634 ts_OldSerNo(old_ser_nr),
635 ts_CbspCellList(cell_list)
636 };
637 if (not istemplatekind(channel_ind, "omit")) {
638 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
639 }
640 return ts_CBSP(CBSP_MSGT_KILL, ies);
641}
Harald Welte08332302019-08-01 09:54:40 +0200642function tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
643 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
644 template uint8_t channel_ind := ?)
645return template (present) CBSP_PDU {
646 var template CBSP_IEs ies := {
647 tr_CbspMsgId(msg_id),
648 tr_OldSerNo(old_ser_nr),
649 tr_CbspCellList(cell_list)
650 };
651 if (not istemplatekind(channel_ind, "omit")) {
652 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
653 }
654 return tr_CBSP(CBSP_MSGT_KILL, ies);
655}
Harald Welteea260342019-08-01 09:49:38 +0200656
657/* 8.1.3.5 KILL COMPLETE */
658function ts_CBSP_KILL_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
659 template (omit) CBSP_IE_NumBcastComplList compl_list,
660 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
661 template (omit) uint8_t channel_ind)
662return template (value) CBSP_PDU {
663 var template (value) CBSP_IEs ies := {
664 ts_CbspMsgId(msg_id),
665 ts_OldSerNo(old_ser_nr)
666 };
667 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200668 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200669 }
670 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200671 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200672 }
673 if (not istemplatekind(channel_ind, "omit")) {
674 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
675 }
676 return ts_CBSP(CBSP_MSGT_KILL_COMPL, ies);
677}
678function tr_CBSP_KILL_COMPL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
679 template CBSP_IE_NumBcastComplList compl_list := ?,
680 template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
681 template uint8_t channel_ind)
682return template CBSP_PDU {
683 var template CBSP_IEs ies := {
684 tr_CbspMsgId(msg_id),
685 tr_OldSerNo(old_ser_nr)
686 };
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200687 /* As soon as adding a '*' IE item, lengthof() no longer works on the ies record. So keep track of the
688 * next index to use separately. */
689 var integer next_idx := lengthof(ies);
Harald Welteea260342019-08-01 09:49:38 +0200690 if (istemplatekind(compl_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200691 ies[next_idx] := *;
692 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200693 } else if (not istemplatekind(compl_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200694 ies[next_idx] := tr_CbspNumComplList(compl_list);
695 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200696 }
697 if (istemplatekind(cell_list, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200698 ies[next_idx] := *;
699 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200700 } else if (not istemplatekind(cell_list, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200701 ies[next_idx] := tr_CbspCellList(cell_list);
702 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200703 }
704 if (istemplatekind(channel_ind, "*")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200705 ies[next_idx] := *;
706 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200707 } else if (not istemplatekind(channel_ind, "omit")) {
Neels Hofmeyrcb11a972020-07-31 16:57:40 +0200708 ies[next_idx] := tr_CbspChannelInd(channel_ind);
709 next_idx := next_idx + 1;
Harald Welteea260342019-08-01 09:49:38 +0200710 }
711 return tr_CBSP(CBSP_MSGT_KILL_COMPL, ies);
712}
713
714/* 8.1.3.6 KILL FAILURE */
715function ts_CBSP_KILL_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
716 template (value) CBSP_FailureListItems fail_list,
717 template (omit) CBSP_IE_NumBcastComplList compl_list,
718 template (omit) BSSMAP_FIELD_CellIdentificationList cell_list,
719 template (omit) uint8_t channel_ind)
720return template (value) CBSP_PDU {
721 var template (value) CBSP_IEs ies := {
722 ts_CbspMsgId(msg_id),
723 ts_OldSerNo(old_ser_nr),
724 ts_CbspFailList(fail_list)
725 };
726 if (not istemplatekind(compl_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200727 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
Harald Welteea260342019-08-01 09:49:38 +0200728 }
729 if (not istemplatekind(cell_list, "omit")) {
Harald Welteafd87ef2020-08-21 12:22:31 +0200730 ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list));
Harald Welteea260342019-08-01 09:49:38 +0200731 }
732 if (not istemplatekind(channel_ind, "omit")) {
733 ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind);
734 }
735 return ts_CBSP(CBSP_MSGT_KILL_FAIL, ies);
736}
737function tr_CBSP_KILL_FAIL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?,
738 template CBSP_FailureListItems fail_list := ?,
739 template CBSP_IE_NumBcastComplList compl_list := *,
740 template BSSMAP_FIELD_CellIdentificationList cell_list := *,
741 template uint8_t channel_ind := *)
742return template CBSP_PDU {
743 var template CBSP_IEs ies := {
744 tr_CbspMsgId(msg_id),
745 tr_OldSerNo(old_ser_nr),
746 tr_CbspFailList(fail_list)
747 };
748 if (istemplatekind(compl_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200749 //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200750 } else if (not istemplatekind(compl_list, "omit")) {
751 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
752 }
Harald Welte885de1c2020-04-20 17:50:22 +0200753 if (istemplatekind(cell_list, "*")) {
Harald Welteb5223232019-09-05 11:13:56 +0200754 //ies[lengthof(ies)] := tr_CbspCellList ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200755 } else if (not istemplatekind(cell_list, "omit")) {
756 ies[lengthof(ies)] := tr_CbspCellList(cell_list);
757 }
758 if (istemplatekind(channel_ind, "*")) {
Harald Weltee53a23d2020-04-20 18:01:00 +0200759 testcase.stop("TITAN > 6.5.0 doesn't support this");
760 //ies[lengthof(ies)] := tr_CbspChannelInd(?) ifpresent;
Harald Welteea260342019-08-01 09:49:38 +0200761 } else if (not istemplatekind(channel_ind, "omit")) {
762 ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
763 }
764 return tr_CBSP(CBSP_MSGT_KILL_FAIL, ies);
765}
766
Harald Welte562d28e2022-03-28 21:29:04 +0200767/* 8.1.3.10 MESSAGE STATUS QUERY */
768template (value) CBSP_PDU
769ts_CBSP_MSG_STATUS_QUERY(template (value) uint16_t msg_id,
770 template (value) uint16_t old_ser_nr,
771 template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
772 template (value) uint8_t channel_ind) :=
773 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
774 ts_CbspMsgId(msg_id),
775 ts_OldSerNo(old_ser_nr),
776 ts_CbspCellList(cell_list),
777 ts_CbspChannelInd(channel_ind)});
778template (present) CBSP_PDU
779tr_CBSP_MSG_STATUS_QUERY(template (present) uint16_t msg_id := ?,
780 template (present) uint16_t old_ser_nr := ?,
781 template (present) BSSMAP_FIELD_CellIdentificationList cell_list := ?,
782 template (present) uint8_t channel_ind := ?) :=
783 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY, {
784 ts_CbspMsgId(msg_id),
785 ts_OldSerNo(old_ser_nr),
786 ts_CbspCellList(cell_list),
787 ts_CbspChannelInd(channel_ind)});
788
789/* 8.1.3.11 MESSAGE STATUS QUERY COMPLETE */
790template (value) CBSP_PDU
791ts_CBSP_MSG_STATUS_QUERY_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
792 template (value) CBSP_IE_NumBcastComplList compl_list,
793 template (value) uint8_t channel_ind) :=
794 ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
795 ts_CbspMsgId(msg_id),
796 ts_OldSerNo(old_ser_nr),
797 ts_CbspNumComplList(valueof(compl_list)),
798 ts_CbspChannelInd(channel_ind)});
799template (present) CBSP_PDU
800tr_CBSP_MSG_STATUS_QUERY_COMPL(template (present) uint16_t msg_id, template (present) uint16_t old_ser_nr,
801 template (present) CBSP_IE_NumBcastComplList compl_list,
802 template (present) uint8_t channel_ind) :=
803 tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_COMPL, {
804 tr_CbspMsgId(msg_id),
805 tr_OldSerNo(old_ser_nr),
806 tr_CbspNumComplList(compl_list),
807 tr_CbspChannelInd(channel_ind)});
808
809/* 8.1.3.12 MESSAGE STATUS QUERY FAILURE */
810function ts_CBSP_MSG_STATUS_QUERY_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr,
811 template (value) CBSP_FailureListItems fail_list,
812 template (value) uint8_t channel_ind,
813 template (omit) CBSP_IE_NumBcastComplList compl_list)
814return template (value) CBSP_PDU {
815 var template (value) CBSP_IEs ies := {
816 ts_CbspMsgId(msg_id),
817 ts_OldSerNo(old_ser_nr),
818 ts_CbspFailList(fail_list),
819 ts_CbspChannelInd(channel_ind)
820 };
821 if (not istemplatekind(compl_list, "omit")) {
822 ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
823 }
824 return ts_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
825}
826function tr_CBSP_MSG_STATUS_QUERY_FAIL(template (present) uint16_t msg_id := ?, template (present) uint16_t old_ser_nr := ?,
827 template (present) CBSP_FailureListItems fail_list := ?,
828 template (present) uint8_t channel_ind := ?,
829 template CBSP_IE_NumBcastComplList compl_list := *)
830return template (present) CBSP_PDU {
831 var template (present) CBSP_IEs ies := {
832 tr_CbspMsgId(msg_id),
833 tr_OldSerNo(old_ser_nr),
834 tr_CbspFailList(fail_list),
835 tr_CbspChannelInd(channel_ind)
836 };
837 if (istemplatekind(compl_list, "*")) {
838 testcase.stop("TITAN > 6.5.0 doesn't support this");
839 //ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list));
840 } else if (not istemplatekind(compl_list, "omit")) {
841 ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
842 }
843 return tr_CBSP(CBSP_MSGT_MSG_STATUS_QUERY_FAIL, ies);
844}
845
Harald Welteea260342019-08-01 09:49:38 +0200846
847/* 8.1.3.16 RESET */
848template (value) CBSP_PDU ts_CBSP_RESET(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
849 ts_CBSP(CBSP_MSGT_RESET, {
850 ts_CbspCellList(cell_list)
851 });
852template CBSP_PDU tr_CBSP_RESET(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
853 tr_CBSP(CBSP_MSGT_RESET, {
854 tr_CbspCellList(cell_list)
855 });
856
857/* 8.1.3.17 RESET COMPLETE */
858template (value) CBSP_PDU ts_CBSP_RESET_COMPL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) :=
859 ts_CBSP(CBSP_MSGT_RESET_COMPL, {
860 ts_CbspCellList(cell_list)
861 });
862template CBSP_PDU tr_CBSP_RESET_COMPL(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) :=
863 tr_CBSP(CBSP_MSGT_RESET_COMPL, {
864 tr_CbspCellList(cell_list)
865 });
866
867/* 8.1.3.18 RESET FAILURE */
868template (value) CBSP_PDU ts_CBSP_RESET_FAIL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
869 template (value) CBSP_FailureListItems fail_items) :=
870 ts_CBSP(CBSP_MSGT_RESET_FAIL, {
871 ts_CbspFailList(fail_items),
872 ts_CbspCellList(cell_list)
873 });
874
875template CBSP_PDU tr_CBSP_RESET_FAIL(template BSSMAP_FIELD_CellIdentificationList cell_list,
876 template CBSP_FailureListItems fail_items) :=
877 tr_CBSP(CBSP_MSGT_RESET_FAIL, {
878 tr_CbspFailList(fail_items),
879 tr_CbspCellList(cell_list)
880 });
881
882/* 8.1.3.18a KEEP-ALIVE */
883template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE(uint8_t rep_period) :=
884 ts_CBSP(CBSP_MSGT_KEEP_ALIVE, {ts_CbspKARepPeriod(rep_period)});
885template CBSP_PDU tr_CBSP_KEEP_ALIVE(template uint8_t rep_period := ?) :=
886 tr_CBSP(CBSP_MSGT_KEEP_ALIVE, {tr_CbspKARepPeriod(rep_period)});
887
888/* 8.1.3.18b KEEP-ALIVE COMPLETE */
889template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE_COMPL :=
890 ts_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
891template CBSP_PDU tr_CBSP_KEEP_ALIVE_COMPL :=
892 tr_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {});
893
894/* 8.1.3.19 RESTART */
895template (value) CBSP_PDU ts_CBSP_RESTART(template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
896 template (value) CBSP_BcastMsgType msg_type,
897 template (value) CBSP_RecoveryInd rec_ind) :=
898 ts_CBSP(CBSP_MSGT_RESTART, {
899 ts_CbspCellList(cell_list),
900 ts_CbspBcastMsgType(msg_type),
901 ts_CbspRecoveryInd(rec_ind)
902 });
903template CBSP_PDU tr_CBSP_RESTART(template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
904 template CBSP_BcastMsgType msg_type := ?,
905 template CBSP_RecoveryInd rec_ind := ?) :=
906 tr_CBSP(CBSP_MSGT_RESTART, {
907 tr_CbspCellList(cell_list),
908 tr_CbspBcastMsgType(msg_type),
909 tr_CbspRecoveryInd(rec_ind)
910 });
911
912/* 8.1.3.20 FAILURE */
913template (value) CBSP_PDU ts_CBSP_FAILURE(template (value) CBSP_FailureListItems fail_list,
914 template (value) CBSP_BcastMsgType msg_type) :=
915 ts_CBSP(CBSP_MSGT_FAILURE, {
916 ts_CbspFailList(fail_list),
917 ts_CbspBcastMsgType(msg_type)
918 });
919template CBSP_PDU tr_CBSP_FAILURE(template CBSP_FailureListItems fail_list := ?,
920 template CBSP_BcastMsgType msg_type := ?) :=
921 tr_CBSP(CBSP_MSGT_FAILURE, {
922 tr_CbspFailList(fail_list),
923 tr_CbspBcastMsgType(msg_type)
924 });
925
926/* 8.1.3.21 ERROR INDICATION */
927template (value) CBSP_PDU ts_CBSP_ERROR_IND(CBSP_Cause cause) :=
928 ts_CBSP(CBSP_MSGT_ERROR_IND, {ts_CbspCause(cause)});
929template CBSP_PDU tr_CBSP_ERROR_IND(template CBSP_Cause cause) :=
930 tr_CBSP(CBSP_MSGT_ERROR_IND, {tr_CbspCause(cause), *});
931
932
933function f_cbsp_find_ie(CBSP_PDU msg, CBSP_IEI iei, out CBSP_IE ret) return boolean {
934 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
935 if (msg.ies[i].iei == iei) {
936 ret := msg.ies[i];
937 return true;
938 }
939 }
940 return false;
941}
942
943
944}