Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 1 | module CBSP_Templates { |
| 2 | |
| 3 | import from Osmocom_Types all; |
| 4 | import from BSSAP_Types all; |
| 5 | import 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 :( */ |
| 12 | template (value) CBSP_IE ts_CBSP_IE(CBSP_IEI iei, template (value) CBSP_IE_Body body) := { |
| 13 | iei := iei, |
| 14 | body := body |
| 15 | } |
| 16 | |
| 17 | template CBSP_IE tr_CBSP_IE(template CBSP_IE_Body body) := { |
| 18 | iei := ?, |
| 19 | body := body |
| 20 | } |
| 21 | |
| 22 | |
| 23 | template (value) CBSP_IE ts_CbspMsgId(template (value) uint16_t val) := |
| 24 | ts_CBSP_IE(CBSP_IEI_MSG_ID, {msg_id := val}); |
| 25 | template CBSP_IE tr_CbspMsgId(template uint16_t val := ?) := |
| 26 | tr_CBSP_IE({msg_id := val}); |
| 27 | |
| 28 | template (value) CBSP_IE ts_NewSerNo(template (value) uint16_t val) := |
| 29 | ts_CBSP_IE(CBSP_IEI_NEW_SERIAL_NR, {new_ser_nr := val}); |
| 30 | template CBSP_IE tr_NewSerNo(template uint16_t val := ?) := |
| 31 | tr_CBSP_IE({new_ser_nr := val}); |
| 32 | |
| 33 | template (value) CBSP_IE ts_OldSerNo(template (value) uint16_t val) := |
| 34 | ts_CBSP_IE(CBSP_IEI_OLD_SERIAL_NR, {old_ser_nr := val}); |
| 35 | template CBSP_IE tr_OldSerNo(template uint16_t val := ?) := |
| 36 | tr_CBSP_IE({old_ser_nr := val}); |
| 37 | |
| 38 | template (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}); |
| 40 | template CBSP_IE tr_CbspKARepPeriod(template uint8_t rep_per := ?) := |
| 41 | tr_CBSP_IE({keep_alive_rep_period := rep_per}); |
| 42 | |
| 43 | function 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 | } |
| 52 | function 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 Welte | 0833230 | 2019-08-01 09:54:40 +0200 | [diff] [blame] | 57 | ie := tr_CBSP_IE({channel_ind := ?}); //ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 58 | } else { |
| 59 | ie := tr_CBSP_IE({channel_ind := val}); |
| 60 | } |
| 61 | return ie; |
| 62 | } |
| 63 | |
| 64 | template (value) CBSP_IE ts_CbspCause(template (value) CBSP_Cause c) := |
| 65 | ts_CBSP_IE(CBSP_IEI_CAUSE, {cause := c}); |
| 66 | template CBSP_IE tr_CbspCause(template CBSP_Cause c := ?) := |
| 67 | tr_CBSP_IE({cause := c}); |
| 68 | |
| 69 | template (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 | }}); |
| 77 | template 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 | |
| 86 | template (value) CBSP_IE ts_CbspCategory(template (value) CBSP_Category cat) := |
| 87 | ts_CBSP_IE(CBSP_IEI_CATEGORY, {category := cat}); |
| 88 | template CBSP_IE tr_CbspCategory(template CBSP_Category cat := ?) := |
| 89 | tr_CBSP_IE({category := cat}); |
| 90 | |
| 91 | template (value) CBSP_IE ts_CbspRepetitionPeriod(template (value) uint16_t per) := |
| 92 | ts_CBSP_IE(CBSP_IEI_REP_PERIOD, {rep_period := per}); |
| 93 | template CBSP_IE tr_CbspRepetitionPeriod(template uint16_t per := ?) := |
| 94 | tr_CBSP_IE({rep_period := per}); |
| 95 | |
| 96 | template (value) CBSP_IE ts_CbspNumBcastReq(template (value) uint16_t num) := |
| 97 | ts_CBSP_IE(CBSP_IEI_NUM_BCAST_REQ, {num_bcast_req := num}); |
| 98 | template CBSP_IE tr_CbspNumBcastReq(template uint16_t num := ?) := |
| 99 | tr_CBSP_IE({num_bcast_req := num}); |
| 100 | |
| 101 | template (value) CBSP_IE ts_CbspNumPages(template (value) uint8_t num) := |
| 102 | ts_CBSP_IE(CBSP_IEI_NUM_OF_PAGES, {num_of_pages := num}); |
| 103 | template CBSP_IE tr_CbspNumPages(template uint16_t num := ?) := |
| 104 | tr_CBSP_IE({num_of_pages := num}); |
| 105 | |
| 106 | template (value) CBSP_IE ts_EmergencyInd(template (value) uint8_t val) := |
| 107 | ts_CBSP_IE(CBSP_IEI_EMERG_IND, {emerg_ind := val}); |
| 108 | template CBSP_IE tr_EmergencyInd(template uint8_t val := ?) := |
| 109 | tr_CBSP_IE({emerg_ind := val}); |
| 110 | |
| 111 | template (value) CBSP_IE ts_WarningType(template (value) uint16_t val) := |
| 112 | ts_CBSP_IE(CBSP_IEI_WARN_TYPE, {warn_type := val}); |
| 113 | template CBSP_IE tr_WarningType(template uint16_t val) := |
| 114 | tr_CBSP_IE({warn_type := val}); |
| 115 | |
| 116 | template (value) CBSP_IE ts_WarnSecInfo(template (value) octetstring payl := ''O) := |
| 117 | ts_CBSP_IE(CBSP_IEI_WARN_SEC_INFO, {warn_sec_info := payl}); |
| 118 | template CBSP_IE tr_WarnSecInfo(template octetstring payl := ?) := |
| 119 | tr_CBSP_IE({warn_sec_info := payl}); |
| 120 | |
| 121 | template (value) CBSP_IE ts_WarningPeriod(template (value) uint8_t val) := |
| 122 | ts_CBSP_IE(CBSP_IEI_WARNING_PERIOD, {warning_period := val}); |
| 123 | template CBSP_IE tr_WarningPeriod(template uint8_t val := ?) := |
| 124 | tr_CBSP_IE({warning_period := val}); |
| 125 | |
| 126 | template (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 | }}); |
| 131 | template CBSP_IE tr_CbspFailList(template CBSP_FailureListItems items := ?) := |
| 132 | tr_CBSP_IE({failure_list := { |
Harald Welte | 09538f8 | 2019-08-01 09:50:25 +0200 | [diff] [blame] | 133 | len := ?, |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 134 | list := items |
| 135 | }}); |
| 136 | |
| 137 | template (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}); |
| 139 | template CBSP_IE tr_CbspNumComplList(template CBSP_IE_NumBcastComplList list := ?) := |
| 140 | tr_CBSP_IE({num_bcast_compl_list := list}); |
| 141 | |
| 142 | template (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 | }}); |
| 147 | template CBSP_IE tr_CbspBcastMsgType(template CBSP_BcastMsgType bi := ?) := |
| 148 | tr_CBSP_IE({bcast_msg_type := { |
| 149 | spare1_4 := ?, |
| 150 | msg_type := bi |
| 151 | }}); |
| 152 | |
| 153 | template (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 | }}); |
| 158 | template CBSP_IE tr_CbspRecoveryInd(template CBSP_RecoveryInd ri) := |
| 159 | tr_CBSP_IE({recovery_ind := { |
| 160 | spare1_4 := ?, |
| 161 | recovery := ri |
| 162 | }}); |
| 163 | |
| 164 | template (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 | }}); |
| 169 | template 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 | |
| 175 | template (value) CBSP_IE ts_CbspDCS(template (value) uint8_t dcs) := |
| 176 | ts_CBSP_IE(CBSP_IEI_DCS, {dcs := dcs}); |
| 177 | template CBSP_IE tr_CbspDCS(template uint8_t dcs := ?) := |
| 178 | tr_CBSP_IE({dcs := dcs}); |
| 179 | |
| 180 | |
| 181 | template (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 | } |
| 186 | template 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 */ |
| 195 | function 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 | } |
| 217 | template 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 | |
| 238 | function 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 | } |
| 260 | template 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 | |
| 282 | template (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 Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 286 | 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) }); |
| 296 | template 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 | |
| 313 | template (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, |
| 317 | template (value) uint16_t num_bcast_req, |
| 318 | template (value) uint8_t warn_per |
| 319 | ) := |
| 320 | ts_CBSP(CBSP_MSGT_WRITE_REPLACE, { |
| 321 | ts_CbspMsgId(msg_id), |
| 322 | ts_NewSerNo(new_ser_nr), |
| 323 | ts_OldSerNo(old_ser_nr), |
| 324 | ts_CbspCellList(cell_list), |
| 325 | ts_EmergencyInd(emerg_ind), |
| 326 | ts_WarningType(warn_type), |
| 327 | ts_WarnSecInfo, |
| 328 | ts_WarningPeriod(warn_per) }); |
| 329 | template CBSP_PDU tr_CBSP_REPLACE_EMERG(template uint16_t msg_id := ?, template uint16_t new_ser_nr := ?, |
| 330 | template uint16_t old_ser_nr := ?, |
| 331 | template BSSMAP_FIELD_CellIdentificationList cell_list := ?, |
| 332 | template uint8_t emerg_ind := ?, |
| 333 | template uint16_t warn_type := ?, |
| 334 | template uint16_t num_bcast_req := ?, |
| 335 | template uint8_t warn_per := ? |
| 336 | ) := |
| 337 | tr_CBSP(CBSP_MSGT_WRITE_REPLACE, { |
| 338 | tr_CbspMsgId(msg_id), |
| 339 | tr_NewSerNo(new_ser_nr), |
| 340 | tr_OldSerNo(old_ser_nr), |
| 341 | tr_CbspCellList(cell_list), |
| 342 | tr_EmergencyInd(emerg_ind), |
| 343 | tr_WarningType(warn_type), |
| 344 | tr_WarnSecInfo, |
| 345 | tr_WarningPeriod(warn_per) }); |
| 346 | |
| 347 | /* 8.1.3.2 WRITE-REPLACE COMPLETE */ |
| 348 | function ts_CBSP_WRITE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr, |
| 349 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 350 | template (value) uint8_t channel_ind) |
| 351 | return template (value) CBSP_PDU { |
| 352 | var template (value) CBSP_IEs ies := { |
| 353 | ts_CbspMsgId(msg_id), |
| 354 | ts_NewSerNo(new_ser_nr) |
| 355 | }; |
| 356 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 357 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 358 | } |
| 359 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 360 | return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies); |
| 361 | } |
| 362 | function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr, |
| 363 | template BSSMAP_FIELD_CellIdentificationList cell_list, |
| 364 | template uint8_t channel_ind) |
| 365 | return template CBSP_PDU { |
| 366 | var template CBSP_IEs ies := { |
| 367 | tr_CbspMsgId(msg_id), |
| 368 | tr_NewSerNo(new_ser_nr) |
| 369 | }; |
| 370 | if (istemplatekind(cell_list, "*")) { |
Harald Welte | e53a23d | 2020-04-20 18:01:00 +0200 | [diff] [blame] | 371 | testcase.stop("TITAN > 6.5.0 doesn't support this"); |
| 372 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 373 | } else if (istemplatekind(cell_list, "?")) { |
| 374 | ies[lengthof(ies)] := tr_CbspCellList(?); |
| 375 | } else if (not istemplatekind(cell_list, "omit")) { |
| 376 | ies[lengthof(ies)] := tr_CbspCellList(cell_list); |
| 377 | } |
Harald Welte | 25a6075 | 2019-09-06 23:08:23 +0200 | [diff] [blame] | 378 | if (not istemplatekind(channel_ind, "omit")) { |
| 379 | ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); |
| 380 | } |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 381 | return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies); |
| 382 | } |
| 383 | |
| 384 | |
| 385 | function ts_CBSP_REPLACE_CBS_COMPL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr, |
| 386 | template (value) CBSP_IE_NumBcastComplList compl_list, |
| 387 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 388 | template (value) uint8_t channel_ind) |
| 389 | return template (value) CBSP_PDU { |
| 390 | var template (value) CBSP_IEs ies := { |
| 391 | ts_CbspMsgId(msg_id), |
| 392 | ts_NewSerNo(new_ser_nr), |
| 393 | ts_OldSerNo(old_ser_nr), |
| 394 | ts_CbspNumComplList(compl_list) |
| 395 | }; |
| 396 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 397 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 398 | } |
| 399 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 400 | return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies); |
| 401 | } |
| 402 | function tr_CBSP_REPLACE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr, |
| 403 | template uint16_t old_ser_nr, |
| 404 | template CBSP_IE_NumBcastComplList compl_list, |
| 405 | template BSSMAP_FIELD_CellIdentificationList cell_list, |
| 406 | template uint8_t channel_ind) |
| 407 | return template CBSP_PDU { |
| 408 | var template CBSP_IEs ies := { |
| 409 | tr_CbspMsgId(msg_id), |
| 410 | tr_NewSerNo(new_ser_nr), |
| 411 | tr_OldSerNo(old_ser_nr), |
| 412 | tr_CbspNumComplList(compl_list) |
| 413 | }; |
| 414 | if (istemplatekind(cell_list, "*")) { |
Harald Welte | e53a23d | 2020-04-20 18:01:00 +0200 | [diff] [blame] | 415 | testcase.stop("TITAN > 6.5.0 doesn't support this"); |
| 416 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 417 | } else if (istemplatekind(cell_list, "?")) { |
| 418 | ies[lengthof(ies)] := tr_CbspCellList(?); |
| 419 | } else if (not istemplatekind(cell_list, "omit")) { |
| 420 | ies[lengthof(ies)] := tr_CbspCellList(cell_list); |
| 421 | } |
Harald Welte | 25a6075 | 2019-09-06 23:08:23 +0200 | [diff] [blame] | 422 | if (not istemplatekind(channel_ind, "omit")) { |
| 423 | ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); |
| 424 | } |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 425 | return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies); |
| 426 | } |
| 427 | |
| 428 | |
| 429 | /* 8.1.3.3 WRITE-REPLACE FAILURE */ |
| 430 | function ts_CBSP_WRITE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr, |
| 431 | template (value) CBSP_FailureListItems fail_list, |
| 432 | template (omit) CBSP_IE_NumBcastComplList compl_list, |
| 433 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 434 | template (value) uint8_t channel_ind) |
| 435 | return template (value) CBSP_PDU { |
| 436 | var template (value) CBSP_IEs ies := { |
| 437 | ts_CbspMsgId(msg_id), |
| 438 | ts_NewSerNo(new_ser_nr), |
| 439 | ts_CbspFailList(fail_list) |
| 440 | }; |
| 441 | if (not istemplatekind(compl_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 442 | ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 443 | } |
| 444 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 445 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 446 | } |
| 447 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 448 | return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); |
| 449 | } |
| 450 | function tr_CBSP_WRITE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr, |
| 451 | template CBSP_FailureListItems fail_list, |
| 452 | template CBSP_IE_NumBcastComplList compl_list, |
| 453 | template BSSMAP_FIELD_CellIdentificationList cell_list, |
| 454 | template uint8_t channel_ind) |
| 455 | return template CBSP_PDU { |
| 456 | var template CBSP_IEs ies := { |
| 457 | tr_CbspMsgId(msg_id), |
| 458 | tr_NewSerNo(new_ser_nr), |
| 459 | tr_CbspFailList(fail_list) |
| 460 | }; |
| 461 | if (istemplatekind(compl_list, "*")) { |
Harald Welte | b522323 | 2019-09-05 11:13:56 +0200 | [diff] [blame] | 462 | //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 463 | } else if (istemplatekind(compl_list, "?")) { |
| 464 | ies[lengthof(ies)] := tr_CbspNumComplList(?); |
| 465 | } else if (not istemplatekind(compl_list, "omit")) { |
| 466 | ies[lengthof(ies)] := tr_CbspNumComplList(compl_list); |
| 467 | } |
| 468 | if (istemplatekind(cell_list, "*")) { |
Harald Welte | e53a23d | 2020-04-20 18:01:00 +0200 | [diff] [blame] | 469 | testcase.stop("TITAN > 6.5.0 doesn't support this"); |
| 470 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 471 | } else if (istemplatekind(cell_list, "?")) { |
| 472 | ies[lengthof(ies)] := tr_CbspCellList(?); |
| 473 | } else if (not istemplatekind(cell_list, "omit")) { |
| 474 | ies[lengthof(ies)] := tr_CbspCellList(cell_list); |
| 475 | } |
Harald Welte | 25a6075 | 2019-09-06 23:08:23 +0200 | [diff] [blame] | 476 | if (not istemplatekind(channel_ind, "omit")) { |
| 477 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 478 | } |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 479 | return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); |
| 480 | } |
| 481 | |
| 482 | |
| 483 | function ts_CBSP_REPLACE_CBS_FAIL(uint16_t msg_id, uint16_t new_ser_nr, uint16_t old_ser_nr, |
| 484 | template (value) CBSP_FailureListItems fail_list, |
| 485 | template (omit) CBSP_IE_NumBcastComplList compl_list, |
| 486 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 487 | template (value) uint8_t channel_ind) |
| 488 | return template (value) CBSP_PDU { |
| 489 | var template (value) CBSP_IEs ies := { |
| 490 | ts_CbspMsgId(msg_id), |
| 491 | ts_NewSerNo(new_ser_nr), |
| 492 | ts_OldSerNo(old_ser_nr), |
| 493 | ts_CbspFailList(fail_list) |
| 494 | }; |
| 495 | if (not istemplatekind(compl_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 496 | ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 497 | } |
| 498 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 499 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 500 | } |
| 501 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 502 | return ts_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); |
| 503 | } |
| 504 | function tr_CBSP_REPLACE_CBS_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr, |
| 505 | template uint16_t old_ser_nr, |
| 506 | template CBSP_FailureListItems fail_list, |
| 507 | template CBSP_IE_NumBcastComplList compl_list, |
| 508 | template BSSMAP_FIELD_CellIdentificationList cell_list, |
| 509 | template uint8_t channel_ind) |
| 510 | return template CBSP_PDU { |
| 511 | var template CBSP_IEs ies := { |
| 512 | tr_CbspMsgId(msg_id), |
| 513 | tr_NewSerNo(new_ser_nr), |
| 514 | tr_OldSerNo(old_ser_nr), |
| 515 | tr_CbspFailList(fail_list) |
| 516 | }; |
| 517 | if (istemplatekind(compl_list, "*")) { |
Harald Welte | b522323 | 2019-09-05 11:13:56 +0200 | [diff] [blame] | 518 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 519 | } else if (istemplatekind(compl_list, "?")) { |
| 520 | ies[lengthof(ies)] := tr_CbspNumComplList(?); |
| 521 | } else if (not istemplatekind(compl_list, "omit")) { |
| 522 | ies[lengthof(ies)] := tr_CbspNumComplList(compl_list); |
| 523 | } |
| 524 | if (istemplatekind(cell_list, "*")) { |
Harald Welte | b522323 | 2019-09-05 11:13:56 +0200 | [diff] [blame] | 525 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 526 | } else if (istemplatekind(cell_list, "?")) { |
| 527 | ies[lengthof(ies)] := tr_CbspCellList(?); |
| 528 | } else if (not istemplatekind(cell_list, "omit")) { |
| 529 | ies[lengthof(ies)] := tr_CbspCellList(cell_list); |
| 530 | } |
| 531 | ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); |
| 532 | return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); |
| 533 | } |
| 534 | |
| 535 | /* 8.1.3.4 KILL */ |
| 536 | template (value) CBSP_PDU ts_CBSP_KILL(template (value) uint16_t msg_id, |
| 537 | template (value) uint16_t old_ser_nr, |
| 538 | template (value) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 539 | template (omit) uint8_t channel_ind) := |
| 540 | ts_CBSP(CBSP_MSGT_KILL, { |
| 541 | ts_CbspMsgId(msg_id), |
| 542 | ts_OldSerNo(old_ser_nr), |
| 543 | ts_CbspCellList(cell_list), |
| 544 | ts_CbspChannelInd(channel_ind)}); |
Harald Welte | 0833230 | 2019-08-01 09:54:40 +0200 | [diff] [blame] | 545 | function tr_CBSP_KILL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?, |
| 546 | template BSSMAP_FIELD_CellIdentificationList cell_list := ?, |
| 547 | template uint8_t channel_ind := ?) |
| 548 | return template (present) CBSP_PDU { |
| 549 | var template CBSP_IEs ies := { |
| 550 | tr_CbspMsgId(msg_id), |
| 551 | tr_OldSerNo(old_ser_nr), |
| 552 | tr_CbspCellList(cell_list) |
| 553 | }; |
| 554 | if (not istemplatekind(channel_ind, "omit")) { |
| 555 | ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); |
| 556 | } |
| 557 | return tr_CBSP(CBSP_MSGT_KILL, ies); |
| 558 | } |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 559 | |
| 560 | /* 8.1.3.5 KILL COMPLETE */ |
| 561 | function ts_CBSP_KILL_COMPL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr, |
| 562 | template (omit) CBSP_IE_NumBcastComplList compl_list, |
| 563 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 564 | template (omit) uint8_t channel_ind) |
| 565 | return template (value) CBSP_PDU { |
| 566 | var template (value) CBSP_IEs ies := { |
| 567 | ts_CbspMsgId(msg_id), |
| 568 | ts_OldSerNo(old_ser_nr) |
| 569 | }; |
| 570 | if (not istemplatekind(compl_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 571 | ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 572 | } |
| 573 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 574 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 575 | } |
| 576 | if (not istemplatekind(channel_ind, "omit")) { |
| 577 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 578 | } |
| 579 | return ts_CBSP(CBSP_MSGT_KILL_COMPL, ies); |
| 580 | } |
| 581 | function tr_CBSP_KILL_COMPL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?, |
| 582 | template CBSP_IE_NumBcastComplList compl_list := ?, |
| 583 | template BSSMAP_FIELD_CellIdentificationList cell_list := ?, |
| 584 | template uint8_t channel_ind) |
| 585 | return template CBSP_PDU { |
| 586 | var template CBSP_IEs ies := { |
| 587 | tr_CbspMsgId(msg_id), |
| 588 | tr_OldSerNo(old_ser_nr) |
| 589 | }; |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 590 | /* As soon as adding a '*' IE item, lengthof() no longer works on the ies record. So keep track of the |
| 591 | * next index to use separately. */ |
| 592 | var integer next_idx := lengthof(ies); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 593 | if (istemplatekind(compl_list, "*")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 594 | ies[next_idx] := *; |
| 595 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 596 | } else if (not istemplatekind(compl_list, "omit")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 597 | ies[next_idx] := tr_CbspNumComplList(compl_list); |
| 598 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 599 | } |
| 600 | if (istemplatekind(cell_list, "*")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 601 | ies[next_idx] := *; |
| 602 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 603 | } else if (not istemplatekind(cell_list, "omit")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 604 | ies[next_idx] := tr_CbspCellList(cell_list); |
| 605 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 606 | } |
| 607 | if (istemplatekind(channel_ind, "*")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 608 | ies[next_idx] := *; |
| 609 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 610 | } else if (not istemplatekind(channel_ind, "omit")) { |
Neels Hofmeyr | cb11a97 | 2020-07-31 16:57:40 +0200 | [diff] [blame] | 611 | ies[next_idx] := tr_CbspChannelInd(channel_ind); |
| 612 | next_idx := next_idx + 1; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 613 | } |
| 614 | return tr_CBSP(CBSP_MSGT_KILL_COMPL, ies); |
| 615 | } |
| 616 | |
| 617 | /* 8.1.3.6 KILL FAILURE */ |
| 618 | function ts_CBSP_KILL_FAIL(template (value) uint16_t msg_id, template (value) uint16_t old_ser_nr, |
| 619 | template (value) CBSP_FailureListItems fail_list, |
| 620 | template (omit) CBSP_IE_NumBcastComplList compl_list, |
| 621 | template (omit) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 622 | template (omit) uint8_t channel_ind) |
| 623 | return template (value) CBSP_PDU { |
| 624 | var template (value) CBSP_IEs ies := { |
| 625 | ts_CbspMsgId(msg_id), |
| 626 | ts_OldSerNo(old_ser_nr), |
| 627 | ts_CbspFailList(fail_list) |
| 628 | }; |
| 629 | if (not istemplatekind(compl_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 630 | ies[lengthof(ies)] := ts_CbspNumComplList(valueof(compl_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 631 | } |
| 632 | if (not istemplatekind(cell_list, "omit")) { |
Harald Welte | afd87ef | 2020-08-21 12:22:31 +0200 | [diff] [blame] | 633 | ies[lengthof(ies)] := ts_CbspCellList(valueof(cell_list)); |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 634 | } |
| 635 | if (not istemplatekind(channel_ind, "omit")) { |
| 636 | ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); |
| 637 | } |
| 638 | return ts_CBSP(CBSP_MSGT_KILL_FAIL, ies); |
| 639 | } |
| 640 | function tr_CBSP_KILL_FAIL(template uint16_t msg_id := ?, template uint16_t old_ser_nr := ?, |
| 641 | template CBSP_FailureListItems fail_list := ?, |
| 642 | template CBSP_IE_NumBcastComplList compl_list := *, |
| 643 | template BSSMAP_FIELD_CellIdentificationList cell_list := *, |
| 644 | template uint8_t channel_ind := *) |
| 645 | return template CBSP_PDU { |
| 646 | var template CBSP_IEs ies := { |
| 647 | tr_CbspMsgId(msg_id), |
| 648 | tr_OldSerNo(old_ser_nr), |
| 649 | tr_CbspFailList(fail_list) |
| 650 | }; |
| 651 | if (istemplatekind(compl_list, "*")) { |
Harald Welte | b522323 | 2019-09-05 11:13:56 +0200 | [diff] [blame] | 652 | //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 653 | } else if (not istemplatekind(compl_list, "omit")) { |
| 654 | ies[lengthof(ies)] := tr_CbspNumComplList(compl_list); |
| 655 | } |
Harald Welte | 885de1c | 2020-04-20 17:50:22 +0200 | [diff] [blame] | 656 | if (istemplatekind(cell_list, "*")) { |
Harald Welte | b522323 | 2019-09-05 11:13:56 +0200 | [diff] [blame] | 657 | //ies[lengthof(ies)] := tr_CbspCellList ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 658 | } else if (not istemplatekind(cell_list, "omit")) { |
| 659 | ies[lengthof(ies)] := tr_CbspCellList(cell_list); |
| 660 | } |
| 661 | if (istemplatekind(channel_ind, "*")) { |
Harald Welte | e53a23d | 2020-04-20 18:01:00 +0200 | [diff] [blame] | 662 | testcase.stop("TITAN > 6.5.0 doesn't support this"); |
| 663 | //ies[lengthof(ies)] := tr_CbspChannelInd(?) ifpresent; |
Harald Welte | ea26034 | 2019-08-01 09:49:38 +0200 | [diff] [blame] | 664 | } else if (not istemplatekind(channel_ind, "omit")) { |
| 665 | ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); |
| 666 | } |
| 667 | return tr_CBSP(CBSP_MSGT_KILL_FAIL, ies); |
| 668 | } |
| 669 | |
| 670 | |
| 671 | /* 8.1.3.16 RESET */ |
| 672 | template (value) CBSP_PDU ts_CBSP_RESET(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) := |
| 673 | ts_CBSP(CBSP_MSGT_RESET, { |
| 674 | ts_CbspCellList(cell_list) |
| 675 | }); |
| 676 | template CBSP_PDU tr_CBSP_RESET(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) := |
| 677 | tr_CBSP(CBSP_MSGT_RESET, { |
| 678 | tr_CbspCellList(cell_list) |
| 679 | }); |
| 680 | |
| 681 | /* 8.1.3.17 RESET COMPLETE */ |
| 682 | template (value) CBSP_PDU ts_CBSP_RESET_COMPL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list) := |
| 683 | ts_CBSP(CBSP_MSGT_RESET_COMPL, { |
| 684 | ts_CbspCellList(cell_list) |
| 685 | }); |
| 686 | template CBSP_PDU tr_CBSP_RESET_COMPL(template BSSMAP_FIELD_CellIdentificationList cell_list := ?) := |
| 687 | tr_CBSP(CBSP_MSGT_RESET_COMPL, { |
| 688 | tr_CbspCellList(cell_list) |
| 689 | }); |
| 690 | |
| 691 | /* 8.1.3.18 RESET FAILURE */ |
| 692 | template (value) CBSP_PDU ts_CBSP_RESET_FAIL(template (value) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 693 | template (value) CBSP_FailureListItems fail_items) := |
| 694 | ts_CBSP(CBSP_MSGT_RESET_FAIL, { |
| 695 | ts_CbspFailList(fail_items), |
| 696 | ts_CbspCellList(cell_list) |
| 697 | }); |
| 698 | |
| 699 | template CBSP_PDU tr_CBSP_RESET_FAIL(template BSSMAP_FIELD_CellIdentificationList cell_list, |
| 700 | template CBSP_FailureListItems fail_items) := |
| 701 | tr_CBSP(CBSP_MSGT_RESET_FAIL, { |
| 702 | tr_CbspFailList(fail_items), |
| 703 | tr_CbspCellList(cell_list) |
| 704 | }); |
| 705 | |
| 706 | /* 8.1.3.18a KEEP-ALIVE */ |
| 707 | template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE(uint8_t rep_period) := |
| 708 | ts_CBSP(CBSP_MSGT_KEEP_ALIVE, {ts_CbspKARepPeriod(rep_period)}); |
| 709 | template CBSP_PDU tr_CBSP_KEEP_ALIVE(template uint8_t rep_period := ?) := |
| 710 | tr_CBSP(CBSP_MSGT_KEEP_ALIVE, {tr_CbspKARepPeriod(rep_period)}); |
| 711 | |
| 712 | /* 8.1.3.18b KEEP-ALIVE COMPLETE */ |
| 713 | template (value) CBSP_PDU ts_CBSP_KEEP_ALIVE_COMPL := |
| 714 | ts_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {}); |
| 715 | template CBSP_PDU tr_CBSP_KEEP_ALIVE_COMPL := |
| 716 | tr_CBSP(CBSP_MSGT_KEEP_ALIVE_COMPL, {}); |
| 717 | |
| 718 | /* 8.1.3.19 RESTART */ |
| 719 | template (value) CBSP_PDU ts_CBSP_RESTART(template (value) BSSMAP_FIELD_CellIdentificationList cell_list, |
| 720 | template (value) CBSP_BcastMsgType msg_type, |
| 721 | template (value) CBSP_RecoveryInd rec_ind) := |
| 722 | ts_CBSP(CBSP_MSGT_RESTART, { |
| 723 | ts_CbspCellList(cell_list), |
| 724 | ts_CbspBcastMsgType(msg_type), |
| 725 | ts_CbspRecoveryInd(rec_ind) |
| 726 | }); |
| 727 | template CBSP_PDU tr_CBSP_RESTART(template BSSMAP_FIELD_CellIdentificationList cell_list := ?, |
| 728 | template CBSP_BcastMsgType msg_type := ?, |
| 729 | template CBSP_RecoveryInd rec_ind := ?) := |
| 730 | tr_CBSP(CBSP_MSGT_RESTART, { |
| 731 | tr_CbspCellList(cell_list), |
| 732 | tr_CbspBcastMsgType(msg_type), |
| 733 | tr_CbspRecoveryInd(rec_ind) |
| 734 | }); |
| 735 | |
| 736 | /* 8.1.3.20 FAILURE */ |
| 737 | template (value) CBSP_PDU ts_CBSP_FAILURE(template (value) CBSP_FailureListItems fail_list, |
| 738 | template (value) CBSP_BcastMsgType msg_type) := |
| 739 | ts_CBSP(CBSP_MSGT_FAILURE, { |
| 740 | ts_CbspFailList(fail_list), |
| 741 | ts_CbspBcastMsgType(msg_type) |
| 742 | }); |
| 743 | template CBSP_PDU tr_CBSP_FAILURE(template CBSP_FailureListItems fail_list := ?, |
| 744 | template CBSP_BcastMsgType msg_type := ?) := |
| 745 | tr_CBSP(CBSP_MSGT_FAILURE, { |
| 746 | tr_CbspFailList(fail_list), |
| 747 | tr_CbspBcastMsgType(msg_type) |
| 748 | }); |
| 749 | |
| 750 | /* 8.1.3.21 ERROR INDICATION */ |
| 751 | template (value) CBSP_PDU ts_CBSP_ERROR_IND(CBSP_Cause cause) := |
| 752 | ts_CBSP(CBSP_MSGT_ERROR_IND, {ts_CbspCause(cause)}); |
| 753 | template CBSP_PDU tr_CBSP_ERROR_IND(template CBSP_Cause cause) := |
| 754 | tr_CBSP(CBSP_MSGT_ERROR_IND, {tr_CbspCause(cause), *}); |
| 755 | |
| 756 | |
| 757 | function f_cbsp_find_ie(CBSP_PDU msg, CBSP_IEI iei, out CBSP_IE ret) return boolean { |
| 758 | for (var integer i := 0; i < sizeof(msg.ies); i := i+1) { |
| 759 | if (msg.ies[i].iei == iei) { |
| 760 | ret := msg.ies[i]; |
| 761 | return true; |
| 762 | } |
| 763 | } |
| 764 | return false; |
| 765 | } |
| 766 | |
| 767 | |
| 768 | } |