Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1 | module Osmocom_Gb_Types { |
| 2 | |
| 3 | /* This module contains additional definitions and templates that we use on top of the |
| 4 | * TITAN NS + BSSGP modules */ |
| 5 | |
| 6 | import from General_Types all; |
| 7 | import from Osmocom_Types all; |
| 8 | import from GSM_Types all; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 9 | import from BSSGP_Types all |
| 10 | import from NS_Types all |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 11 | import from Native_Functions all; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 12 | |
| 13 | type uint16_t Nsvci; |
| 14 | type uint16_t Nsei; |
| 15 | type uint16_t BssgpBvci; |
| 16 | |
| 17 | /* TS 48.016 10.3.7 */ |
| 18 | type enumerated NsPduType { |
| 19 | NS_PDUT_NS_UNITDATA ('00000000'B), |
| 20 | NS_PDUT_NS_RESET ('00000010'B), |
| 21 | NS_PDUT_NS_RESET_ACK ('00000011'B), |
| 22 | NS_PDUT_NS_BLOCK ('00000100'B), |
| 23 | NS_PDUT_NS_BLOCK_ACK ('00000101'B), |
| 24 | NS_PDUT_NS_UNBLOCK ('00000110'B), |
| 25 | NS_PDUT_NS_UNBLOCK_ACK ('00000111'B), |
| 26 | NS_PDUT_NS_STATUS ('00001000'B), |
| 27 | NS_PDUT_NS_ALIVE ('00001010'B), |
| 28 | NS_PDUT_NS_ALIVE_ACK ('00001011'B) |
| 29 | /* FIXME: SNS */ |
| 30 | } with { variant "FIELDLENGTH(8)" }; |
| 31 | |
| 32 | /* TS 48.016 10.3 */ |
| 33 | type enumerated NsIEI { |
| 34 | NS_IEI_CAUSE ('00000000'B), |
| 35 | NS_IEI_NSVCI ('00000001'B), |
| 36 | NS_IEI_NS_PDU ('00000010'B), |
| 37 | NS_IEI_BVCI ('00000011'B), |
| 38 | NS_IEI_NSEI ('00000100'B), |
| 39 | NS_IEI_LIST_IPv4 ('00000101'B), |
| 40 | NS_IEI_LIST_IPv6 ('00000110'B), |
| 41 | NS_IEI_MAX_NUM_NSVC ('00000111'B), |
| 42 | NS_IEI_NUM_IPv4_EP ('00001000'B), |
| 43 | NS_IEI_NUM_IPv6_EP ('00001001'B), |
| 44 | NS_IEI_RESET_FLAG ('00001010'B), |
| 45 | NS_IEI_IP_ADDRESS ('00001011'B) |
| 46 | } with { variant "FIELDLENGTH(8)" }; |
| 47 | |
| 48 | /* TS 48.016 10.3.2 */ |
| 49 | type enumerated NsCause { |
| 50 | NS_CAUSE_TRANSIT_NETWORK_FAILURE ('00000000'B), |
| 51 | NS_CAUSE_OM_INTERVENTION ('00000001'B), |
| 52 | NS_CAUSE_EQUIPMENT_FAILURE ('00000010'B), |
| 53 | NS_CAUSE_NSVC_BLOCKED ('00000011'B), |
| 54 | NS_CAUSE_NSVC_UNKNOWN ('00000100'B), |
| 55 | NS_CAUSE_BVCI_UNKNOWN_AT_NSE ('00000101'B), |
| 56 | NS_CAUSE_SEMANTICALLY_INCORRECT_PDU ('00001000'B), |
| 57 | NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('00001010'B), |
| 58 | NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED ('00001011'B), |
| 59 | NS_CAUSE_INVALID_ESSENTIAL_IE ('00001100'B), |
| 60 | NS_CAUSE_MISSING_ESSENTIAL_IE ('00001101'B), |
| 61 | NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS ('00001110'B), |
| 62 | NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS ('00001111'B), |
| 63 | NS_CAUSE_INVALID_NR_OF_NSVCS ('00010000'B), |
| 64 | NS_CAUSE_INVALID_WEIGHTS ('00010001'B), |
| 65 | NS_CAUSE_UNKNOWN_IP_ENDPOINT ('00010010'B), |
| 66 | NS_CAUSE_UNKNOWN_IP_ADDRESS ('00010011'B), |
| 67 | NS_CAUSE_IP_TEST_FAILEDA ('00010100'B) |
| 68 | } with { variant "FIELDLENGTH(8)" }; |
| 69 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 70 | template (value) NS_SDU_ControlBits t_SduCtrlB := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 71 | rBit := '0'B, |
| 72 | cBit := '0'B, |
| 73 | spare := '000000'B |
| 74 | } |
| 75 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 76 | template (value) CauseNS ts_NS_IE_CAUSE(NsCause cause) := { |
| 77 | iEI := '00'O, |
| 78 | ext := '1'B, |
| 79 | lengthIndicator := { |
| 80 | length1 := 1 |
| 81 | }, |
| 82 | cause := int2oct(enum2int(valueof(cause)), 1) |
| 83 | } |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 84 | function ts_NS_IE_CAUSE_omit(template (omit) NsCause cause) return template (omit) CauseNS { |
| 85 | var template (omit) CauseNS ret; |
| 86 | if (istemplatekind(cause, "omit")) { |
| 87 | return omit; |
| 88 | } else { |
| 89 | ret := { |
| 90 | iEI := '00'O, |
| 91 | ext := '1'B, |
| 92 | lengthIndicator := { |
| 93 | length1 := 1 |
| 94 | }, |
| 95 | cause := int2oct(enum2int(valueof(cause)), 1) |
| 96 | } |
| 97 | return ret; |
| 98 | } |
| 99 | } |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 100 | |
| 101 | function tr_NS_IE_CAUSE(template NsCause cause) return template CauseNS { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 102 | var template CauseNS ret; |
| 103 | ret.iEI := '00'O; |
| 104 | ret.ext := '1'B; |
| 105 | ret.lengthIndicator := { length1 := 1 }; |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 106 | if (istemplatekind(cause, "omit")) { |
| 107 | return omit; |
| 108 | } else if (istemplatekind(cause, "*")) { |
| 109 | return *; |
| 110 | } else if (istemplatekind(cause, "?")) { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 111 | ret.cause := ? |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 112 | } else { |
| 113 | ret.cause := int2oct(enum2int(valueof(cause)), 1); |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 114 | } |
| 115 | return ret; |
| 116 | } |
| 117 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 118 | function ts_SNS_IP_ADDR(template (omit) IPAddress ip) return template (omit) IP_Address_NS { |
| 119 | var template (omit) IP_Address_NS ret; |
| 120 | if (istemplatekind(ip, "omit")) { |
| 121 | return omit; |
| 122 | } else { |
| 123 | ret.iEI := '0B'O; |
| 124 | ret.ipAddress := ip; |
| 125 | if (ischosen(ip.ip4Address)) { |
| 126 | ret.addressType := '01'O; |
| 127 | } else { |
| 128 | ret.addressType := '02'O; |
| 129 | } |
| 130 | } |
| 131 | return ret; |
| 132 | } |
| 133 | function tr_SNS_IP_ADDR(template IPAddress ip) return template IP_Address_NS { |
| 134 | var template IP_Address_NS ret; |
| 135 | ret.iEI := '0B'O; |
| 136 | if (istemplatekind(ip, "omit")) { |
| 137 | return omit; |
| 138 | } else if (istemplatekind(ip, "*")) { |
| 139 | return *; |
| 140 | } else if (istemplatekind(ip, "?")) { |
| 141 | return ?; |
| 142 | } else { |
| 143 | ret.ipAddress := ip; |
| 144 | if (ischosen(ip.ip4Address)) { |
| 145 | ret.addressType := '01'O; |
| 146 | } else { |
| 147 | ret.addressType := '02'O; |
| 148 | } |
| 149 | } |
| 150 | return ret; |
| 151 | } |
| 152 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 153 | private function f_oct_or_wc(template integer inp, integer len) return template octetstring { |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 154 | if (istemplatekind(inp, "omit")) { |
| 155 | return omit; |
| 156 | } else if (istemplatekind(inp, "*")) { |
| 157 | return *; |
| 158 | } else if (istemplatekind(inp, "?")) { |
| 159 | return ?; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 160 | } |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 161 | return int2oct(valueof(inp), len); |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 162 | } |
| 163 | |
Daniel Willmann | 00c0bbf | 2020-11-24 18:37:49 +0100 | [diff] [blame] | 164 | private function f_hex_or_wc(template integer inp, integer len) return template hexstring { |
| 165 | if (istemplatekind(inp, "omit")) { |
| 166 | return omit; |
| 167 | } else if (istemplatekind(inp, "*")) { |
| 168 | return *; |
| 169 | } else if (istemplatekind(inp, "?")) { |
| 170 | return ?; |
| 171 | } |
| 172 | return int2hex(valueof(inp), len); |
| 173 | } |
| 174 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 175 | template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := { |
| 176 | iEI := '01'O, |
| 177 | ext := '1'B, |
| 178 | lengthIndicator := { |
| 179 | length1 := 2 |
| 180 | }, |
| 181 | nS_VCI := int2oct(nsvci, 2) |
| 182 | } |
| 183 | template NS_VCI tr_NS_IE_NSVCI(template Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 184 | iEI := '01'O, |
| 185 | ext := '1'B, |
| 186 | lengthIndicator := { |
| 187 | length1 := 2 |
| 188 | }, |
| 189 | nS_VCI := f_oct_or_wc(nsvci, 2) |
| 190 | } |
| 191 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 192 | template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := { |
| 193 | iEI:= '04'O, |
| 194 | ext := '1'B, |
| 195 | lengthIndicator := { |
| 196 | length1 := 2 |
| 197 | }, |
| 198 | nSEI := int2oct(nsei, 2) |
| 199 | } |
| 200 | template NSEI_NS tr_NS_IE_NSEI(template Nsei nsei) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 201 | iEI:= '04'O, |
| 202 | ext := '1'B, |
| 203 | lengthIndicator := { |
| 204 | length1 := 2 |
| 205 | }, |
| 206 | nSEI := f_oct_or_wc(nsei, 2) |
| 207 | } |
| 208 | |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 209 | template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port, |
| 210 | uint8_t sig_weight := 1, uint8_t data_weight := 1) := { |
| 211 | ipAddress := f_inet_addr(ip), |
| 212 | uDP_Port := int2oct(udp_port, 2), |
| 213 | signallingWeight := int2oct(sig_weight, 1), |
| 214 | dataWeight := int2oct(data_weight, 1) |
| 215 | } |
| 216 | function tr_SNS_IPv4(template charstring ip, template integer udp_port, |
| 217 | template uint8_t sig_weight := ?, template uint8_t data_weight := ?) |
| 218 | return template IP4_Element { |
| 219 | var template IP4_Element e; |
| 220 | if (istemplatekind(ip, "?")) { |
| 221 | e.ipAddress := ?; |
| 222 | } else { |
| 223 | e.ipAddress := f_inet_addr(valueof(ip)); |
| 224 | } |
| 225 | if (istemplatekind(udp_port, "?")) { |
| 226 | e.uDP_Port := ?; |
| 227 | } else { |
| 228 | e.uDP_Port := int2oct(valueof(udp_port), 2); |
| 229 | } |
| 230 | if (istemplatekind(sig_weight, "?")) { |
| 231 | e.signallingWeight := ?; |
| 232 | } else { |
| 233 | e.signallingWeight := int2oct(valueof(sig_weight), 1); |
| 234 | } |
| 235 | if (istemplatekind(data_weight, "?")) { |
| 236 | e.dataWeight := ?; |
| 237 | } else { |
| 238 | e.dataWeight := int2oct(valueof(data_weight), 1); |
| 239 | } |
| 240 | return e; |
| 241 | } |
| 242 | |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 243 | template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port, |
| 244 | uint8_t sig_weight := 1, uint8_t data_weight := 1) := { |
| 245 | ipAddress := f_inet6_addr(ip), |
| 246 | uDP_Port := int2oct(udp_port, 2), |
| 247 | signallingWeight := int2oct(sig_weight, 1), |
| 248 | dataWeight := int2oct(data_weight, 1) |
| 249 | } |
| 250 | function tr_SNS_IPv6(template charstring ip, template integer udp_port, |
| 251 | template uint8_t sig_weight := ?, template uint8_t data_weight := ?) |
| 252 | return template IP6_Element { |
| 253 | var template IP6_Element e; |
| 254 | if (istemplatekind(ip, "?")) { |
| 255 | e.ipAddress := ?; |
| 256 | } else { |
| 257 | e.ipAddress := f_inet6_addr(valueof(ip)); |
| 258 | } |
| 259 | if (istemplatekind(udp_port, "?")) { |
| 260 | e.uDP_Port := ?; |
| 261 | } else { |
| 262 | e.uDP_Port := int2oct(valueof(udp_port), 2); |
| 263 | } |
| 264 | if (istemplatekind(sig_weight, "?")) { |
| 265 | e.signallingWeight := ?; |
| 266 | } else { |
| 267 | e.signallingWeight := int2oct(valueof(sig_weight), 1); |
| 268 | } |
| 269 | if (istemplatekind(data_weight, "?")) { |
| 270 | e.dataWeight := ?; |
| 271 | } else { |
| 272 | e.dataWeight := int2oct(valueof(data_weight), 1); |
| 273 | } |
| 274 | return e; |
| 275 | } |
| 276 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 277 | |
| 278 | template (value) PDU_NS ts_NS_RESET(NsCause cause, Nsvci nsvci, Nsei nsei) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 279 | pDU_NS_Reset := { |
| 280 | nsPduType := '02'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 281 | causeNS := ts_NS_IE_CAUSE(cause), |
| 282 | nS_VCI := ts_NS_IE_NSVCI(nsvci), |
| 283 | nSEI_NS := ts_NS_IE_NSEI(nsei) |
| 284 | } |
| 285 | } |
| 286 | template PDU_NS tr_NS_RESET(template NsCause cause, template Nsvci nsvci, template Nsei nsei) := { |
| 287 | pDU_NS_Reset := { |
| 288 | nsPduType := '02'O, |
| 289 | causeNS := tr_NS_IE_CAUSE(cause), |
| 290 | nS_VCI := tr_NS_IE_NSVCI(nsvci), |
| 291 | nSEI_NS := tr_NS_IE_NSEI(nsei) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 292 | } |
| 293 | } |
| 294 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 295 | template (value) PDU_NS ts_NS_RESET_ACK(Nsvci nsvci, Nsei nsei) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 296 | pDU_NS_Reset_Ack := { |
| 297 | nsPduType := '03'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 298 | nS_VCI := ts_NS_IE_NSVCI(nsvci), |
| 299 | nSEI_NS := ts_NS_IE_NSEI(nsei) |
| 300 | } |
| 301 | } |
| 302 | template PDU_NS tr_NS_RESET_ACK(template Nsvci nsvci, template Nsei nsei) := { |
| 303 | pDU_NS_Reset_Ack := { |
| 304 | nsPduType := '03'O, |
| 305 | nS_VCI := tr_NS_IE_NSVCI(nsvci), |
| 306 | nSEI_NS := tr_NS_IE_NSEI(nsei) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 307 | } |
| 308 | } |
| 309 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 310 | template (value) PDU_NS ts_NS_BLOCK(NsCause cause, Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 311 | pDU_NS_Block := { |
| 312 | nsPduType := '04'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 313 | causeNS := ts_NS_IE_CAUSE(cause), |
| 314 | nS_VCI := ts_NS_IE_NSVCI(nsvci) |
| 315 | } |
| 316 | } |
| 317 | template PDU_NS tr_NS_BLOCK(template NsCause cause, template Nsvci nsvci) := { |
| 318 | pDU_NS_Block := { |
| 319 | nsPduType := '04'O, |
| 320 | causeNS := tr_NS_IE_CAUSE(cause), |
| 321 | nS_VCI := tr_NS_IE_NSVCI(nsvci) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 322 | } |
| 323 | } |
| 324 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 325 | template (value) PDU_NS ts_NS_BLOCK_ACK(Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 326 | pDU_NS_Block_Ack := { |
| 327 | nsPduType := '05'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 328 | nS_VCI := ts_NS_IE_NSVCI(nsvci) |
| 329 | } |
| 330 | } |
| 331 | template PDU_NS tr_NS_BLOCK_ACK(template Nsvci nsvci) := { |
| 332 | pDU_NS_Block_Ack := { |
| 333 | nsPduType := '05'O, |
| 334 | nS_VCI := tr_NS_IE_NSVCI(nsvci) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 335 | } |
| 336 | } |
| 337 | |
| 338 | template PDU_NS t_NS_UNBLOCK := { |
| 339 | pDU_NS_Unblock := { |
| 340 | nsPduType := '06'O |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | template PDU_NS t_NS_UNBLOCK_ACK := { |
| 345 | pDU_NS_Unblock_Ack := { |
| 346 | nsPduType := '07'O |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | template PDU_NS t_NS_ALIVE := { |
| 351 | pDU_NS_Alive := { |
| 352 | nsPduType := '0A'O |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | template PDU_NS t_NS_ALIVE_ACK := { |
| 357 | pDU_NS_Alive_Ack := { |
| 358 | nsPduType := '0B'O |
| 359 | } |
| 360 | } |
| 361 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 362 | template (value) PDU_NS ts_NS_STATUS(NsCause cause, PDU_NS pdu) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 363 | pDU_NS_Status := { |
| 364 | nsPduType := '08'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 365 | causeNS := ts_NS_IE_CAUSE(cause), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 366 | nS_VCI := omit, |
| 367 | nS_PDU := { |
| 368 | iEI := '02'O, |
| 369 | ext := '1'B, |
| 370 | lengthIndicator := { |
| 371 | length1 := 0 /* overwritten */ |
| 372 | }, |
| 373 | ns_PDU := enc_PDU_NS(pdu) |
| 374 | }, |
| 375 | bVCI_NS := omit, |
| 376 | listofIP4Elements := omit, |
| 377 | listofIP6Elements := omit |
| 378 | } |
| 379 | } |
| 380 | |
Alexander Couzens | 9843b66 | 2020-09-07 05:20:54 +0200 | [diff] [blame] | 381 | template PDU_NS tr_NS_STATUS(template NsCause cause) := { |
| 382 | pDU_NS_Status := { |
| 383 | nsPduType := '08'O, |
| 384 | causeNS := tr_NS_IE_CAUSE(cause), |
| 385 | nS_VCI := *, |
| 386 | nS_PDU := *, |
| 387 | bVCI_NS := *, |
| 388 | listofIP4Elements := *, |
| 389 | listofIP6Elements := * |
| 390 | } |
| 391 | } |
| 392 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 393 | template (value) PDU_NS ts_NS_UNITDATA(template (value) NS_SDU_ControlBits bits, BssgpBvci bvci, octetstring sdu) := { |
| 394 | pDU_NS_Unitdata := { |
| 395 | nsPduType := '00'O, |
| 396 | nS_SDU_ControlBits := bits, |
| 397 | bVCI := int2oct(bvci, 2), |
| 398 | nS_SDU := sdu |
| 399 | } |
| 400 | } |
| 401 | template PDU_NS tr_NS_UNITDATA(template NS_SDU_ControlBits bits, template BssgpBvci bvci, template |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 402 | octetstring sdu) := { |
| 403 | pDU_NS_Unitdata := { |
| 404 | nsPduType := '00'O, |
| 405 | nS_SDU_ControlBits := bits, |
| 406 | bVCI := f_oct_or_wc(bvci, 2), |
| 407 | nS_SDU := sdu |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 412 | |
| 413 | private function ts_num_of_ep(OCT1 iei, template (omit) uint16_t num_ep) |
| 414 | return template (omit) NumberOfIP_Endpoints { |
| 415 | var template (omit) NumberOfIP_Endpoints t; |
| 416 | if (istemplatekind(num_ep, "omit")) { |
| 417 | return omit; |
| 418 | } else { |
| 419 | t.iEI := iei; |
| 420 | t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2); |
| 421 | return t; |
| 422 | } |
| 423 | } |
| 424 | private function tr_num_of_ep(OCT1 iei, template uint16_t num_ep) |
| 425 | return template NumberOfIP_Endpoints { |
| 426 | var template NumberOfIP_Endpoints t; |
| 427 | if (istemplatekind(num_ep, "omit")) { |
| 428 | return omit; |
| 429 | } else if (istemplatekind(num_ep, "*")) { |
| 430 | return *; |
| 431 | } else if (istemplatekind(num_ep, "?")) { |
| 432 | return ?; |
| 433 | } else { |
| 434 | t.iEI := iei; |
| 435 | t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2); |
| 436 | return t; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | |
| 441 | template (value) ResetFlag ts_SNS_IE_ResetFlag(boolean rst) := { |
| 442 | iEI := '0A'O, |
| 443 | resetBIT := bool2bit(rst), |
| 444 | spare := '0000000'B |
| 445 | } |
| 446 | template ResetFlag tr_SNS_IE_ResetFlag(template boolean rst) := { |
| 447 | iEI := '0A'O, |
| 448 | resetBIT := bool2bit_tmpl(rst), |
| 449 | spare := '0000000'B |
| 450 | } |
| 451 | |
| 452 | template (value) EndFlag ts_SNS_IE_EndFlag(boolean end) := { |
| 453 | eBIT := bool2bit(end), |
| 454 | spare := '0000000'B |
| 455 | } |
| 456 | template EndFlag tr_SNS_IE_EndFlag(template boolean end) := { |
| 457 | eBIT := bool2bit_tmpl(end), |
| 458 | spare := '0000000'B |
| 459 | } |
| 460 | |
| 461 | template (value) MaxNumberOfNSVCs ts_SNS_IE_MaxNumOfNSVCs(uint16_t num) := { |
| 462 | iEI := '07'O, |
| 463 | maxNumberOfNSVCs := int2oct(num, 2) |
| 464 | } |
| 465 | template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := { |
| 466 | iEI := '07'O, |
| 467 | maxNumberOfNSVCs := f_oct_or_wc(num, 2) |
| 468 | } |
| 469 | |
| 470 | template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true, |
| 471 | uint16_t max_nsvcs := 2, |
| 472 | template (omit) uint16_t num_v4 := 1, |
| 473 | template (omit) uint16_t num_v6 := omit) := { |
| 474 | pDU_SNS_Size := { |
| 475 | nsPduType := '12'O, |
| 476 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 477 | resetFlag := ts_SNS_IE_ResetFlag(rst_flag), |
| 478 | maxNumberOfNSVCs := ts_SNS_IE_MaxNumOfNSVCs(max_nsvcs), |
| 479 | numberOfIP4_Endpoints := ts_num_of_ep('08'O, num_v4), |
| 480 | numberOfIP6_Endpoints := ts_num_of_ep('09'O, num_v6) |
| 481 | } |
| 482 | } |
| 483 | template PDU_NS tr_SNS_SIZE(template Nsei nsei, template boolean rst_flag := ?, |
| 484 | template uint16_t max_nsvcs := ?, |
| 485 | template uint16_t num_v4 := ?, |
| 486 | template uint16_t num_v6 := *) := { |
| 487 | pDU_SNS_Size := { |
| 488 | nsPduType := '12'O, |
| 489 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 490 | resetFlag := tr_SNS_IE_ResetFlag(rst_flag), |
| 491 | maxNumberOfNSVCs := tr_SNS_IE_MaxNumOfNSVCs(max_nsvcs), |
| 492 | numberOfIP4_Endpoints := tr_num_of_ep('08'O, num_v4), |
| 493 | numberOfIP6_Endpoints := tr_num_of_ep('09'O, num_v6) |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | template PDU_NS ts_SNS_SIZE_ACK(Nsei nsei, template (omit) NsCause cause) := { |
| 498 | pDU_SNS_Size_Ack := { |
| 499 | nsPduType := '13'O, |
| 500 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 501 | causeNS := ts_NS_IE_CAUSE_omit(cause) |
| 502 | } |
| 503 | } |
| 504 | template PDU_NS tr_SNS_SIZE_ACK(template Nsei nsei, template NsCause cause) := { |
| 505 | pDU_SNS_Size_Ack := { |
| 506 | nsPduType := '13'O, |
| 507 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 508 | causeNS := tr_NS_IE_CAUSE(cause) |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | private function ts_SNS_IE_ListIP4(template (omit) IP4_Elements elem) |
| 513 | return template (omit) ListofIP4Elements { |
| 514 | var template (omit) ListofIP4Elements r; |
| 515 | if (istemplatekind(elem, "omit")) { |
| 516 | return omit; |
| 517 | } else { |
| 518 | r := { |
| 519 | iEI := '05'O, |
| 520 | ext := '1'B, |
| 521 | lengthIndicator := { |
| 522 | length1 := 0 /* overwritten */ |
| 523 | }, |
| 524 | iP4_Elements := elem |
| 525 | } |
| 526 | return r; |
| 527 | } |
| 528 | } |
| 529 | private function tr_SNS_IE_ListIP4(template IP4_Elements elem) |
| 530 | return template ListofIP4Elements { |
| 531 | var template ListofIP4Elements r; |
| 532 | if (istemplatekind(elem, "omit")) { |
| 533 | return omit; |
| 534 | } else { |
| 535 | r := { |
| 536 | iEI := '05'O, |
| 537 | ext := '1'B, |
| 538 | lengthIndicator := { |
| 539 | length1 := ? /* overwritten */ |
| 540 | }, |
| 541 | iP4_Elements := elem |
| 542 | } |
| 543 | return r; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | private function ts_SNS_IE_ListIP6(template (omit) IP6_Elements elem) |
| 548 | return template (omit) ListofIP6Elements { |
| 549 | var template (omit) ListofIP6Elements r; |
| 550 | if (istemplatekind(elem, "omit")) { |
| 551 | return omit; |
| 552 | } else { |
| 553 | r := { |
| 554 | iEI := '06'O, |
| 555 | ext := '1'B, |
| 556 | lengthIndicator := { |
| 557 | length1 := 0 /* overwritten */ |
| 558 | }, |
| 559 | iP6_Elements := elem |
| 560 | } |
| 561 | return r; |
| 562 | } |
| 563 | } |
| 564 | private function tr_SNS_IE_ListIP6(template IP6_Elements elem) |
| 565 | return template ListofIP6Elements { |
| 566 | var template ListofIP6Elements r; |
| 567 | if (istemplatekind(elem, "omit")) { |
| 568 | return omit; |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 569 | } else if (istemplatekind(elem, "*")) { |
| 570 | return *; |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 571 | } else { |
| 572 | r := { |
| 573 | iEI := '06'O, |
| 574 | ext := '1'B, |
| 575 | lengthIndicator := { |
| 576 | length1 := ? /* overwritten */ |
| 577 | }, |
| 578 | iP6_Elements := elem |
| 579 | } |
| 580 | return r; |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 585 | template (omit) IP4_Elements v4 := omit, |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 586 | template (omit) IP6_Elements v6 := omit) := { |
| 587 | pDU_SNS_Config := { |
| 588 | nsPduType := '0F'O, |
| 589 | endFlag := ts_SNS_IE_EndFlag(end_flag), |
| 590 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 591 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 592 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 593 | } |
| 594 | } |
| 595 | template PDU_NS tr_SNS_CONFIG(template Nsei nsei, template boolean end_flag, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 596 | template IP4_Elements v4 := omit, |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 597 | template IP6_Elements v6 := omit) := { |
| 598 | pDU_SNS_Config := { |
| 599 | nsPduType := '0F'O, |
| 600 | endFlag := tr_SNS_IE_EndFlag(end_flag), |
| 601 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 602 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 603 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | template (value) PDU_NS ts_SNS_CONFIG_ACK(Nsei nsei, template (omit) NsCause cause) := { |
| 608 | pDU_SNS_Config_Ack := { |
| 609 | nsPduType := '10'O, |
| 610 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 611 | causeNS := ts_NS_IE_CAUSE_omit(cause) |
| 612 | } |
| 613 | } |
| 614 | template PDU_NS tr_SNS_CONFIG_ACK(template Nsei nsei, template NsCause cause) := { |
| 615 | pDU_SNS_Config_Ack := { |
| 616 | nsPduType := '10'O, |
| 617 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 618 | causeNS := tr_NS_IE_CAUSE(cause) |
| 619 | } |
| 620 | } |
| 621 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 622 | template (value) PDU_NS ts_SNS_ADD(Nsei nsei, uint8_t trans_id, |
| 623 | template (omit) IP4_Elements v4, |
| 624 | template (omit) IP6_Elements v6 := omit) := { |
| 625 | pDU_SNS_Add := { |
| 626 | nsPduType := '0D'O, |
| 627 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 628 | transactionID := trans_id, |
| 629 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 630 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 631 | } |
| 632 | } |
| 633 | template PDU_NS tr_SNS_ADD(template Nsei nsei, template uint8_t trans_id, |
| 634 | template IP4_Elements v4, |
| 635 | template IP6_Elements v6 := omit) := { |
| 636 | pDU_SNS_Add := { |
| 637 | nsPduType := '0D'O, |
| 638 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 639 | transactionID := trans_id, |
| 640 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 641 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | template (value) PDU_NS ts_SNS_DEL(Nsei nsei, uint8_t trans_id, |
| 646 | template (omit) IPAddress ip_sns, |
| 647 | template (omit) IP4_Elements v4, |
| 648 | template (omit) IP6_Elements v6 := omit) := { |
| 649 | pDU_SNS_Delete := { |
| 650 | nsPduType := '11'O, |
| 651 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 652 | transactionID := trans_id, |
| 653 | iP_Address_NS := ts_SNS_IP_ADDR(ip_sns), |
| 654 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 655 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 656 | } |
| 657 | } |
| 658 | template PDU_NS tr_SNS_DEL(template Nsei nsei, template uint8_t trans_id, |
| 659 | template IPAddress ip_sns, |
| 660 | template IP4_Elements v4, |
| 661 | template IP6_Elements v6 := omit) := { |
| 662 | pDU_SNS_Delete := { |
| 663 | nsPduType := '11'O, |
| 664 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 665 | transactionID := trans_id, |
| 666 | iP_Address_NS := tr_SNS_IP_ADDR(ip_sns), |
| 667 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 668 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 669 | } |
| 670 | } |
| 671 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 672 | template (value) PDU_NS ts_SNS_CHG_WEIGHT(Nsei nsei, uint8_t trans_id, |
| 673 | template (omit) IP4_Elements v4, |
| 674 | template (omit) IP6_Elements v6 := omit) := { |
| 675 | pDU_SNS_ChangeWeight := { |
| 676 | nsPduType := '0E'O, |
| 677 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 678 | transactionID := trans_id, |
| 679 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 680 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 681 | } |
| 682 | } |
| 683 | template PDU_NS tr_SNS_CHG_WEIGHT(template Nsei nsei, template uint8_t trans_id, |
| 684 | template IP4_Elements v4, |
| 685 | template IP6_Elements v6 := omit) := { |
| 686 | pDU_SNS_ChangeWeight := { |
| 687 | nsPduType := '0E'O, |
| 688 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 689 | transactionID := trans_id, |
| 690 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 691 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 692 | } |
| 693 | } |
| 694 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 695 | |
| 696 | template (value) PDU_NS ts_SNS_ACK(Nsei nsei, uint8_t trans_id, |
| 697 | template (omit) NsCause cause := omit, |
| 698 | template (omit) IP4_Elements v4 := omit, |
| 699 | template (omit) IP6_Elements v6 := omit) := { |
| 700 | pDU_SNS_Ack := { |
| 701 | nsPduType := '0C'O, |
| 702 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 703 | transactionID := trans_id, |
| 704 | causeNS := ts_NS_IE_CAUSE_omit(cause), |
| 705 | iP_Address_NS := omit, |
| 706 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 707 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 708 | } |
| 709 | } |
| 710 | template PDU_NS tr_SNS_ACK(template Nsei nsei, template uint8_t trans_id := ?, |
| 711 | template NsCause cause := omit, |
| 712 | template IP4_Elements v4 := *, |
| 713 | template IP6_Elements v6 := *) := { |
| 714 | pDU_SNS_Ack := { |
| 715 | nsPduType := '0C'O, |
| 716 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 717 | transactionID := trans_id, |
| 718 | causeNS := tr_NS_IE_CAUSE(cause), |
| 719 | iP_Address_NS := omit, |
| 720 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 721 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 731 | type record BssgpCellId { |
| 732 | RoutingAreaIdentification ra_id, |
| 733 | CellIdentity cell_id |
| 734 | } with { variant "" }; |
| 735 | |
| 736 | type enumerated BssgpCause { |
| 737 | BSSGP_CAUSE_PROC_OVERLOAD ('00'H), |
| 738 | BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H), |
| 739 | BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE ('02'H), |
| 740 | BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS ('03'H), |
| 741 | BSSGP_CAUSE_UNKNOWN_MS ('04'H), |
| 742 | BSSGP_CAUSE_BVCI_UNKNOWN ('05'H), |
| 743 | BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION ('06'H), |
| 744 | BSSGP_CAUSE_SGSN_CONGESTION ('07'H), |
| 745 | BSSGP_CAUSE_OM_INTERVENTION ('08'H), |
| 746 | BSSGP_CAUSE_BVCI_BLOCKED ('09'H), |
| 747 | BSSGP_CAUSE_PFC_CREATE_FAILURE ('0a'H), |
| 748 | BSSGP_CAUSE_PFC_PREEMPTED ('0b'H), |
| 749 | BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED ('0c'H), |
| 750 | BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU ('20'H), |
| 751 | BSSGP_CAUSE_INVALID_MANDATORY_IE ('21'H), |
| 752 | BSSGP_CAUSE_MISSING_MANDATORY_IE ('22'H), |
| 753 | BSSGP_CAUSE_MISSING_CONDITIONAL_IE ('23'H), |
| 754 | BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE ('24'H), |
| 755 | BSSGP_CAUSE_CONDITIONAL_IE_ERROR ('25'H), |
| 756 | BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('26'H), |
| 757 | BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('27'H), |
| 758 | BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET ('28'H), |
| 759 | BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE ('29'H), |
| 760 | BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS ('2a'H), |
| 761 | BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY ('2b'H), |
| 762 | BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO ('2c'H), |
| 763 | BSSGP_CAUSE_PFC_QUEUING ('2d'H), |
| 764 | BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY ('2e'H), |
| 765 | BSSGP_CAUSE_T12_EXPIRY ('2f'H), |
| 766 | BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT ('30'H), |
| 767 | BSSGP_CAUSE_UPLINK_QUALITY ('31'H), |
| 768 | BSSGP_CAUSE_UPLINK_STRENGTH ('32'H), |
| 769 | BSSGP_CAUSE_DOWNLINK_QUALITY ('33'H), |
| 770 | BSSGP_CAUSE_DOWNLINK_STRENGTH ('34'H), |
| 771 | BSSGP_CAUSE_DISTANCE ('35'H), |
| 772 | BSSGP_CAUSE_BETTER_CELL ('36'H), |
| 773 | BSSGP_CAUSE_TRAFFIC ('37'H), |
| 774 | BSSGP_CAUSE_OM_INTERVENTION2 ('38'H), |
| 775 | BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL ('39'H), |
| 776 | BSSGP_CAUSE_T13_EXPIRY ('3a'H), |
| 777 | BSSGP_CAUSE_T14_EXPIRY ('3b'H), |
| 778 | BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H) |
| 779 | } with { variant "FIELDLENGTH(8)" }; |
| 780 | |
Daniel Willmann | 7f1d78e | 2020-11-24 14:42:40 +0100 | [diff] [blame] | 781 | private function t_FLUSH_ACTION(template OCT1 act) |
| 782 | return template Flush_Action { |
| 783 | var template Flush_Action r; |
| 784 | if (istemplatekind(act, "omit")) { |
| 785 | return omit; |
| 786 | } else if (istemplatekind(act, "*")) { |
| 787 | return *; |
| 788 | } else { |
| 789 | r := { |
| 790 | iEI := '0C'O, |
| 791 | ext := '1'B, |
| 792 | lengthIndicator := { |
| 793 | length1 := 1 |
| 794 | }, |
| 795 | actionValue := act |
| 796 | } |
| 797 | return r; |
| 798 | } |
| 799 | } |
| 800 | private function t_NO_OCT_AFF(template integer oct_aff) |
| 801 | return template Number_of_octets_affected { |
| 802 | var template Number_of_octets_affected r; |
| 803 | if (istemplatekind(oct_aff, "omit")) { |
| 804 | return omit; |
| 805 | } else if (istemplatekind(oct_aff, "*")) { |
| 806 | return *; |
| 807 | } else { |
| 808 | r := { |
| 809 | iEI := '25'O, |
| 810 | ext := '1'B, |
| 811 | lengthIndicator := { |
| 812 | length1 := 3 |
| 813 | }, |
| 814 | number_of_octets_transfered_or_deleted := f_oct_or_wc(oct_aff, 3) |
| 815 | } |
| 816 | return r; |
| 817 | } |
| 818 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 819 | |
Daniel Willmann | 00c0bbf | 2020-11-24 18:37:49 +0100 | [diff] [blame] | 820 | private function t_LLC_FRAMES_DISCARDED(template integer frames_discarded) |
| 821 | return template LLC_Frames_Discarded { |
| 822 | var template LLC_Frames_Discarded r; |
| 823 | if (istemplatekind(frames_discarded, "omit")) { |
| 824 | return omit; |
| 825 | } else if (istemplatekind(frames_discarded, "*")) { |
| 826 | return *; |
| 827 | } else { |
| 828 | r := { |
| 829 | iEI := '0F'O, |
| 830 | ext := '1'B, |
| 831 | lengthIndicator := { |
Harald Welte | c0351d1 | 2020-11-27 22:49:02 +0100 | [diff] [blame] | 832 | length1 := 1 |
Daniel Willmann | 00c0bbf | 2020-11-24 18:37:49 +0100 | [diff] [blame] | 833 | }, |
| 834 | number_of_frames_discarded := f_hex_or_wc(frames_discarded, 2) |
| 835 | } |
| 836 | return r; |
| 837 | } |
| 838 | } |
| 839 | |
Daniel Willmann | 379fc25 | 2020-11-20 18:34:22 +0100 | [diff] [blame] | 840 | private function t_BSSGP_BVCI(template BssgpBvci bvci) |
| 841 | return template BVCI { |
| 842 | var template BVCI r; |
| 843 | if (istemplatekind(bvci, "omit")) { |
| 844 | return omit; |
| 845 | } else if (istemplatekind(bvci, "*")) { |
| 846 | return *; |
| 847 | } else { |
| 848 | r := { |
| 849 | iEI := '04'O, |
| 850 | ext := '1'B, |
| 851 | lengthIndicator := { |
| 852 | length1 := 2 |
| 853 | }, |
| 854 | unstructured_value := f_oct_or_wc(bvci, 2) |
| 855 | } |
| 856 | return r; |
| 857 | } |
| 858 | } |
| 859 | private function t_BSSGP_NSEI(template Nsei nsei) |
| 860 | return template NSEI_BSSGP { |
| 861 | var template NSEI_BSSGP r; |
| 862 | if (istemplatekind(nsei, "omit")) { |
| 863 | return omit; |
| 864 | } else if (istemplatekind(nsei, "*")) { |
| 865 | return *; |
| 866 | } else { |
| 867 | r := { |
| 868 | iEI:= '3E'O, |
| 869 | ext := '1'B, |
| 870 | lengthIndicator := { |
| 871 | length1 := 2 |
| 872 | }, |
| 873 | nSEI := f_oct_or_wc(nsei, 2) |
| 874 | } |
| 875 | return r; |
| 876 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 877 | } |
| 878 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 879 | template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli tlli) := { |
| 880 | iEI := '1F'O, |
| 881 | ext := '1'B, |
| 882 | lengthIndicator := { |
| 883 | length1 := 4 |
| 884 | }, |
| 885 | tLLI_Value := tlli |
| 886 | } |
| 887 | template TLLI_BSSGP tr_BSSGP_TLLI(template GprsTlli tlli) := { |
| 888 | iEI := '1F'O, |
| 889 | ext := '1'B, |
| 890 | lengthIndicator := { |
| 891 | length1 := 4 |
| 892 | }, |
| 893 | tLLI_Value := tlli |
| 894 | } |
| 895 | |
| 896 | template (value) Suspend_Reference_Number ts_BSSGP_SUSP_REF(template (value) OCT1 susp_ref) := { |
| 897 | iEI := '1D'O, |
| 898 | ext := '1'B, |
| 899 | lengthIndicator := { |
| 900 | length1 := 1 |
| 901 | }, |
| 902 | suspend_Reference_Number_value := susp_ref |
| 903 | } |
| 904 | template Suspend_Reference_Number tr_BSSGP_SUSP_REF(template OCT1 susp_ref) := { |
| 905 | iEI := '1D'O, |
| 906 | ext := '1'B, |
| 907 | lengthIndicator := { |
| 908 | length1 := 1 |
| 909 | }, |
| 910 | suspend_Reference_Number_value := susp_ref |
| 911 | } |
| 912 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 913 | template IMSI_BSSGP tr_BSSGP_IMSI(template hexstring imsi) := { |
| 914 | iEI := '0D'O, |
| 915 | ext := '1'B, |
| 916 | lengthIndicator := ?, |
| 917 | type_of_Identity := '001'B, |
| 918 | oddevenIndicator := ?, |
| 919 | digits := imsi |
| 920 | } |
| 921 | |
| 922 | template IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := { |
| 923 | iEI := '0D'O, |
| 924 | ext := '1'B, |
| 925 | lengthIndicator := { length1 := 0 /* overwritten */ }, |
| 926 | type_of_Identity := '001'B, |
| 927 | oddevenIndicator := f_hex_is_odd_length(imsi), |
| 928 | digits := imsi |
| 929 | } |
| 930 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 931 | template (present) TMSI_BSSGP tr_BSSGP_TMSI(GsmTmsi tmsi) := { |
| 932 | iEI := '20'O, |
| 933 | ext := '1'B, |
| 934 | lengthIndicator := { length1 := 4 }, |
| 935 | tMSI_Value := int2oct(tmsi, 4) |
| 936 | } |
| 937 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 938 | template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := { |
| 939 | iEI := '20'O, |
| 940 | ext := '1'B, |
| 941 | lengthIndicator := { length1 := 4 }, |
| 942 | tMSI_Value := int2oct(tmsi, 4) |
| 943 | } |
| 944 | |
| 945 | function f_bssgp_length_ind(integer len) return LIN2_2a { |
| 946 | var LIN2_2a ret; |
| 947 | if (len > 255) { |
| 948 | ret := { length2 := len }; |
| 949 | } else { |
| 950 | ret := { length1 := len }; |
| 951 | } |
| 952 | return ret; |
| 953 | } |
| 954 | |
| 955 | template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := { |
| 956 | iEI := '0D'O, |
| 957 | ext := '1'B, |
| 958 | lengthIndicator := f_bssgp_length_ind(lengthof(pdu)), |
| 959 | lLC_PDU := pdu |
| 960 | } |
| 961 | |
| 962 | template LLC_PDU tr_BSSGP_LLC_PDU(template octetstring pdu := ?) := { |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 963 | iEI := '0E'O, |
| 964 | ext := ?, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 965 | lengthIndicator := ?, |
| 966 | lLC_PDU := pdu |
| 967 | } |
| 968 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 969 | function ts_BSSGP_CAUSE(template (omit) BssgpCause cause) return template (omit) Cause_BSSGP { |
| 970 | var template (omit) Cause_BSSGP ret; |
| 971 | if (istemplatekind(cause, "omit")) { |
| 972 | ret := omit; |
| 973 | } else { |
| 974 | ret.iEI := '07'O; |
| 975 | ret.ext := '1'B; |
| 976 | ret.lengthIndicator := { length1 := 1 }; |
| 977 | ret.cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 978 | } |
| 979 | return ret; |
| 980 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 981 | function t_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP { |
| 982 | var template Cause_BSSGP ret; |
Harald Welte | bacca28 | 2018-03-02 16:03:59 +0100 | [diff] [blame] | 983 | ret.iEI := '07'O; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 984 | ret.ext := '1'B; |
| 985 | ret.lengthIndicator := { length1 := 1 }; |
| 986 | if (isvalue(cause)) { |
| 987 | ret.cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 988 | } else { |
| 989 | ret.cause_Value := ? |
| 990 | } |
| 991 | return ret; |
| 992 | } |
| 993 | |
| 994 | function t_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier { |
| 995 | var template Cell_Identifier ret := { |
| 996 | iEI := '08'O, |
| 997 | ext := '1'B, |
| 998 | lengthIndicator := { length1 := 8 }, |
| 999 | mccDigit1 := ?, |
| 1000 | mccDigit2 := ?, |
| 1001 | mccDigit3 := ?, |
| 1002 | mncDigit3 := ?, |
| 1003 | mncDigit1 := ?, |
| 1004 | mncDigit2 := ?, |
| 1005 | lac := ?, |
| 1006 | rac := ?, |
| 1007 | cI_value := ? |
| 1008 | } |
| 1009 | if (istemplatekind(cid, "omit")) { |
| 1010 | return omit; |
| 1011 | } else if (istemplatekind(cid, "*")) { |
| 1012 | return *; |
| 1013 | } else if (istemplatekind(cid, "?")) { |
| 1014 | return ?; |
| 1015 | } |
| 1016 | if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { |
| 1017 | if (isvalue(cid.ra_id.lai.mcc_mnc)) { |
| 1018 | ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; |
| 1019 | ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; |
| 1020 | ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; |
Harald Welte | 797ab3a | 2019-03-21 21:33:28 +0100 | [diff] [blame] | 1021 | ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; |
Harald Welte | 797ab3a | 2019-03-21 21:33:28 +0100 | [diff] [blame] | 1022 | ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; |
Alexander Couzens | c7dddbd | 2019-04-11 19:18:35 +0200 | [diff] [blame] | 1023 | ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1024 | } |
| 1025 | if (isvalue(cid.ra_id.lai.lac)) { |
| 1026 | ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); |
| 1027 | } |
| 1028 | } |
| 1029 | if (isvalue(cid) and isvalue(cid.ra_id)) { |
| 1030 | ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); |
| 1031 | } |
| 1032 | if (isvalue(cid)) { |
| 1033 | ret.cI_value := f_oct_or_wc(cid.cell_id, 2); |
| 1034 | } |
| 1035 | return ret; |
| 1036 | } |
| 1037 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 1038 | template (value) Tag ts_BSSGP_IE_Tag(OCT1 tag) := { |
| 1039 | iEI := '1E'O, |
| 1040 | ext := '1'B, |
| 1041 | lengthIndicator := { |
| 1042 | length1 := 1 |
| 1043 | }, |
| 1044 | unstructured_Value := tag |
| 1045 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1046 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 1047 | template (present) Tag tr_BSSGP_IE_Tag(template (present) OCT1 tag) := { |
| 1048 | iEI := '1E'O, |
| 1049 | ext := '1'B, |
| 1050 | lengthIndicator := { |
| 1051 | length1 := 1 |
| 1052 | }, |
| 1053 | unstructured_Value := tag |
| 1054 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1055 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 1056 | template (value) RA_Cap_UPD_CAUSE ts_BSSGP_IE_RACU_Cause(template (value) OCT1 cause) := { |
| 1057 | iEI := '1A'O, |
| 1058 | ext := '1'B, |
| 1059 | lengthIndicator := { |
| 1060 | length1 := 1 |
| 1061 | }, |
| 1062 | rA_CAP_UPD_Cause_value := cause |
| 1063 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1064 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 1065 | template (present) RA_Cap_UPD_CAUSE tr_BSSGP_IE_RACU_Cause(template (present) OCT1 cause) := { |
| 1066 | iEI := '1A'O, |
| 1067 | ext := '1'B, |
| 1068 | lengthIndicator := { |
| 1069 | length1 := 1 |
| 1070 | }, |
| 1071 | rA_CAP_UPD_Cause_value := cause |
| 1072 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1073 | |
| 1074 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1075 | template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci, |
| 1076 | template BssgpCellId cell_id) := { |
| 1077 | pDU_BSSGP_BVC_RESET := { |
| 1078 | bssgpPduType := '22'O, |
| 1079 | bVCI := t_BSSGP_BVCI(bvci), |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 1080 | cause := ts_BSSGP_CAUSE(cause), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1081 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1082 | feature_bitmap := omit, |
| 1083 | extended_Feature_Bitmap := omit |
| 1084 | } |
| 1085 | } |
| 1086 | |
| 1087 | template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci, |
| 1088 | template BssgpCellId cell_id) := { |
| 1089 | pDU_BSSGP_BVC_RESET := { |
| 1090 | bssgpPduType := '22'O, |
| 1091 | bVCI := t_BSSGP_BVCI(bvci), |
| 1092 | cause := t_BSSGP_CAUSE(cause), |
| 1093 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1094 | feature_bitmap := *, |
| 1095 | extended_Feature_Bitmap := * |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template BssgpCellId cell_id) := { |
| 1100 | pDU_BSSGP_BVC_RESET_ACK := { |
| 1101 | bssgpPduType := '23'O, |
| 1102 | bVCI := t_BSSGP_BVCI(bvci), |
| 1103 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1104 | feature_bitmap := omit, |
| 1105 | extended_Feature_Bitmap := omit |
| 1106 | } |
| 1107 | } |
| 1108 | |
| 1109 | template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := { |
| 1110 | pDU_BSSGP_BVC_RESET_ACK := { |
| 1111 | bssgpPduType := '23'O, |
| 1112 | bVCI := t_BSSGP_BVCI(bvci), |
| 1113 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1114 | feature_bitmap := *, |
| 1115 | extended_Feature_Bitmap := * |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | |
| 1120 | template PDU_BSSGP t_BVC_UNBLOCK(template BssgpBvci bvci) := { |
| 1121 | pDU_BSSGP_BVC_UNBLOCK := { |
| 1122 | bssgpPduType := '24'O, |
| 1123 | bVCI := t_BSSGP_BVCI(bvci) |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | template PDU_BSSGP t_BVC_UNBLOCK_ACK(template BssgpBvci bvci) := { |
| 1128 | pDU_BSSGP_BVC_UNBLOCK_ACK := { |
| 1129 | bssgpPduType := '25'O, |
| 1130 | bVCI := t_BSSGP_BVCI(bvci) |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | template PDU_BSSGP t_BVC_BLOCK(template BssgpBvci bvci, template BssgpCause cause) := { |
| 1135 | pDU_BSSGP_BVC_BLOCK := { |
| 1136 | bssgpPduType := '20'O, |
| 1137 | bVCI := t_BSSGP_BVCI(bvci), |
| 1138 | cause := t_BSSGP_CAUSE(cause) |
| 1139 | } |
| 1140 | } |
| 1141 | |
| 1142 | template PDU_BSSGP t_BVC_BLOCK_ACK(template BssgpBvci bvci) := { |
| 1143 | pDU_BSSGP_BVC_BLOCK_ACK := { |
| 1144 | bssgpPduType := '21'O, |
| 1145 | bVCI := t_BSSGP_BVCI(bvci) |
| 1146 | } |
| 1147 | } |
| 1148 | |
| 1149 | template PDU_BSSGP t_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate, |
| 1150 | uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := { |
| 1151 | pDU_BSSGP_FLOW_CONTROL_BVC := { |
| 1152 | bssgpPduType := '26'O, |
| 1153 | tag := { |
| 1154 | iEI := '1E'O, |
| 1155 | ext := '1'B, |
| 1156 | lengthIndicator := { |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1157 | length1 := 1 |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1158 | }, |
| 1159 | unstructured_Value := tag |
| 1160 | }, |
| 1161 | bVC_Bucket_Size := { |
| 1162 | iEI := '05'O, |
| 1163 | ext := '1'B, |
| 1164 | lengthIndicator := { |
| 1165 | length1 := 2 |
| 1166 | }, |
| 1167 | bmax := f_oct_or_wc(bmax, 2) |
| 1168 | }, |
| 1169 | bucket_Leak_Rate := { |
| 1170 | iEI := '03'O, |
| 1171 | ext := '1'B, |
| 1172 | lengthIndicator := { |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1173 | length1 := 2 |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1174 | }, |
| 1175 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1176 | }, |
| 1177 | bmax_default_MS := { |
| 1178 | iEI := '01'O, |
| 1179 | ext := '1'B, |
| 1180 | lengthIndicator := { |
| 1181 | length1 := 2 |
| 1182 | }, |
| 1183 | bmax := f_oct_or_wc(bmax_default_ms, 2) |
| 1184 | }, |
| 1185 | r_default_MS := { |
| 1186 | iEI := '1C'O, |
| 1187 | ext := '1'B, |
| 1188 | lengthIndicator := { |
| 1189 | length1 := 2 |
| 1190 | }, |
| 1191 | r_default_MS_value := f_oct_or_wc(r_default_ms, 2) |
| 1192 | }, |
| 1193 | bucket_Full_Ratio := omit, |
| 1194 | bVC_Measurement := omit, |
| 1195 | flow_Control_Granularity := omit |
| 1196 | } |
| 1197 | } |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1198 | template PDU_BSSGP tr_BVC_FC_BVC(template uint16_t bmax := ?, |
| 1199 | template uint16_t bucket_leak_rate := ?, |
| 1200 | template uint16_t bmax_default_ms := ?, |
| 1201 | template uint16_t r_default_ms := ?, |
| 1202 | template OCT1 tag := ?) := { |
| 1203 | pDU_BSSGP_FLOW_CONTROL_BVC := { |
| 1204 | bssgpPduType := '26'O, |
| 1205 | tag := { |
| 1206 | iEI := '1E'O, |
| 1207 | ext := '1'B, |
| 1208 | lengthIndicator := { |
| 1209 | length1 := 1 |
| 1210 | }, |
| 1211 | unstructured_Value := tag |
| 1212 | }, |
| 1213 | bVC_Bucket_Size := { |
| 1214 | iEI := '05'O, |
| 1215 | ext := '1'B, |
| 1216 | lengthIndicator := { |
| 1217 | length1 := 2 |
| 1218 | }, |
| 1219 | bmax := f_oct_or_wc(bmax, 2) |
| 1220 | }, |
| 1221 | bucket_Leak_Rate := { |
| 1222 | iEI := '03'O, |
| 1223 | ext := '1'B, |
| 1224 | lengthIndicator := { |
| 1225 | length1 := 2 |
| 1226 | }, |
| 1227 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1228 | }, |
| 1229 | bmax_default_MS := { |
| 1230 | iEI := '01'O, |
| 1231 | ext := '1'B, |
| 1232 | lengthIndicator := { |
| 1233 | length1 := 2 |
| 1234 | }, |
| 1235 | bmax := f_oct_or_wc(bmax_default_ms, 2) |
| 1236 | }, |
| 1237 | r_default_MS := { |
| 1238 | iEI := '1C'O, |
| 1239 | ext := '1'B, |
| 1240 | lengthIndicator := { |
| 1241 | length1 := 2 |
| 1242 | }, |
| 1243 | r_default_MS_value := f_oct_or_wc(r_default_ms, 2) |
| 1244 | }, |
| 1245 | bucket_Full_Ratio := *, |
| 1246 | bVC_Measurement := *, |
| 1247 | flow_Control_Granularity := * |
| 1248 | } |
| 1249 | } |
| 1250 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1251 | template PDU_BSSGP t_BVC_FC_BVC_ACK(template OCT1 tag) := { |
| 1252 | pDU_BSSGP_FLOW_CONTROL_BVC_ACK := { |
| 1253 | bssgpPduType := '27'O, |
| 1254 | tag := { |
| 1255 | iEI := '1E'O, |
| 1256 | ext := '1'B, |
| 1257 | lengthIndicator := { |
Harald Welte | 86bdcaa | 2020-12-09 15:05:32 +0100 | [diff] [blame] | 1258 | length1 := 1 |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1259 | }, |
| 1260 | unstructured_Value := tag |
| 1261 | } |
| 1262 | } |
| 1263 | } |
| 1264 | |
Harald Welte | cc3894b | 2020-12-09 16:50:12 +0100 | [diff] [blame] | 1265 | template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, uint16_t bucket_leak_rate, |
| 1266 | OCT1 tag) := { |
| 1267 | pDU_BSSGP_FLOW_CONTROL_MS := { |
| 1268 | bssgpPduType := '28'O, |
| 1269 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1270 | tag := { |
| 1271 | iEI := '1E'O, |
| 1272 | ext := '1'B, |
| 1273 | lengthIndicator := { |
| 1274 | length1 := 1 |
| 1275 | }, |
| 1276 | unstructured_Value := tag |
| 1277 | }, |
| 1278 | mS_Bucket_Size := { |
| 1279 | iEI := '12'O, |
| 1280 | ext := '1'B, |
| 1281 | lengthIndicator := { |
| 1282 | length1 := 2 |
| 1283 | }, |
| 1284 | bmax := f_oct_or_wc(bmax, 2) |
| 1285 | }, |
| 1286 | bucket_Leak_Rate := { |
| 1287 | iEI := '03'O, |
| 1288 | ext := '1'B, |
| 1289 | lengthIndicator := { |
| 1290 | length1 := 2 |
| 1291 | }, |
| 1292 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1293 | }, |
| 1294 | bucket_Full_Ratio := omit, |
| 1295 | flow_Control_Granularity := omit |
| 1296 | } |
| 1297 | } |
| 1298 | template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli tlli := ?, |
| 1299 | template (present) uint16_t bmax := ?, |
| 1300 | template (present) uint16_t bucket_leak_rate := ?, |
| 1301 | template (present) OCT1 tag := ?) := { |
| 1302 | pDU_BSSGP_FLOW_CONTROL_MS := { |
| 1303 | bssgpPduType := '28'O, |
| 1304 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1305 | tag := { |
| 1306 | iEI := '1E'O, |
| 1307 | ext := '1'B, |
| 1308 | lengthIndicator := { |
| 1309 | length1 := 1 |
| 1310 | }, |
| 1311 | unstructured_Value := tag |
| 1312 | }, |
| 1313 | mS_Bucket_Size := { |
| 1314 | iEI := '12'O, |
| 1315 | ext := '1'B, |
| 1316 | lengthIndicator := { |
| 1317 | length1 := 2 |
| 1318 | }, |
| 1319 | bmax := f_oct_or_wc(bmax, 2) |
| 1320 | }, |
| 1321 | bucket_Leak_Rate := { |
| 1322 | iEI := '03'O, |
| 1323 | ext := '1'B, |
| 1324 | lengthIndicator := { |
| 1325 | length1 := 2 |
| 1326 | }, |
| 1327 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1328 | }, |
| 1329 | bucket_Full_Ratio := *, |
| 1330 | flow_Control_Granularity := * |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | template (value) PDU_BSSGP ts_BVC_FC_MS_ACK(template (value) GprsTlli tlli, |
| 1335 | template (value) OCT1 tag) := { |
| 1336 | |
| 1337 | pDU_BSSGP_FLOW_CONTROL_MS_ACK := { |
| 1338 | bssgpPduType := '29'O, |
| 1339 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1340 | tag := { |
| 1341 | iEI := '1E'O, |
| 1342 | ext := '1'B, |
| 1343 | lengthIndicator := { |
| 1344 | length1 := 1 |
| 1345 | }, |
| 1346 | unstructured_Value := tag |
| 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | template (present) PDU_BSSGP tr_BVC_FC_MS_ACK(template (present) GprsTlli tlli, |
| 1351 | template (present) OCT1 tag := ?) := { |
| 1352 | |
| 1353 | pDU_BSSGP_FLOW_CONTROL_MS_ACK := { |
| 1354 | bssgpPduType := '29'O, |
| 1355 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1356 | tag := { |
| 1357 | iEI := '1E'O, |
| 1358 | ext := '1'B, |
| 1359 | lengthIndicator := { |
| 1360 | length1 := 1 |
| 1361 | }, |
| 1362 | unstructured_Value := tag |
| 1363 | } |
| 1364 | } |
| 1365 | } |
| 1366 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1367 | template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause, |
| 1368 | PDU_BSSGP pdu) := { |
| 1369 | pDU_BSSGP_STATUS := { |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1370 | bssgpPduType := '41'O, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1371 | cause := t_BSSGP_CAUSE(cause), |
| 1372 | bVCI := t_BSSGP_BVCI(bvci), |
| 1373 | pDU_in_Error := { |
| 1374 | iEI := '15'O, |
| 1375 | ext := '1'B, |
| 1376 | lengthIndicator := { |
| 1377 | length1 := 0 /* overwritten */ |
| 1378 | }, |
| 1379 | erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu) |
| 1380 | } |
| 1381 | } |
| 1382 | } |
| 1383 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1384 | template PDU_BSSGP tr_BSSGP_STATUS(template BVCI bvci := ?, template BssgpCause cause := ?, |
| 1385 | template octetstring pdu := ?) := { |
| 1386 | pDU_BSSGP_STATUS := { |
| 1387 | bssgpPduType := '41'O, |
| 1388 | cause := t_BSSGP_CAUSE(cause), |
| 1389 | bVCI := bvci, |
| 1390 | pDU_in_Error := { |
| 1391 | iEI := '15'O, |
| 1392 | ext := '1'B, |
| 1393 | lengthIndicator := { |
| 1394 | length1 := ? |
| 1395 | }, |
| 1396 | erroneous_BSSGP_PDU := pdu |
| 1397 | } |
| 1398 | } |
| 1399 | } |
| 1400 | |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1401 | private function f_presence_bit_MultislotCap_GPRS_BSSGP(template (omit) MultislotCap_GPRS_BSSGP mscap_gprs) return BIT1 { |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1402 | if (istemplatekind(mscap_gprs, "omit")) { |
| 1403 | return '0'B; |
| 1404 | } |
| 1405 | return '1'B; |
| 1406 | } |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1407 | private function f_presence_bit_MultislotCap_EGPRS_BSSGP(template (omit) MultislotCap_EGPRS_BSSGP mscap_egprs) return BIT1 { |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1408 | if (istemplatekind(mscap_egprs, "omit")) { |
| 1409 | return '0'B; |
| 1410 | } |
| 1411 | return '1'B; |
| 1412 | } |
| 1413 | template (value) MSRACapabilityValuesRecord_BSSGP ts_RaCapRec_BSSGP(BIT4 att := '0001'B /* E-GSM */, template (omit) MultislotCap_GPRS_BSSGP mscap_gprs := omit, template (omit) MultislotCap_EGPRS_BSSGP mscap_egprs := omit) := { |
| 1414 | mSRACapabilityValues := { |
| 1415 | mSRACapabilityValuesExclude1111 := { |
| 1416 | accessTechnType := att, /* E-GSM */ |
| 1417 | accessCapabilities := { |
| 1418 | lengthIndicator := 0, /* overwritten */ |
| 1419 | accessCapabilities := { |
| 1420 | rfPowerCapability := '001'B, /* FIXME */ |
| 1421 | presenceBitA5 := '0'B, |
| 1422 | a5bits := omit, |
| 1423 | esind := '1'B, |
| 1424 | psbit := '0'B, |
| 1425 | vgcs := '0'B, |
| 1426 | vbs := '0'B, |
| 1427 | presenceBitMultislot := '1'B, |
| 1428 | multislotcap := { |
| 1429 | presenceBitHscsd := '0'B, |
| 1430 | hscsdmultislotclass := omit, |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1431 | presenceBitGprs := f_presence_bit_MultislotCap_GPRS_BSSGP(mscap_gprs), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1432 | gprsmultislot := mscap_gprs, |
| 1433 | presenceBitSms := '0'B, |
| 1434 | multislotCap_SMS := omit, |
| 1435 | multislotCapAdditionsAfterRel97 := { |
| 1436 | presenceBitEcsdmulti := '0'B, |
| 1437 | ecsdmultislotclass := omit, |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1438 | presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS_BSSGP(mscap_egprs), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1439 | multislotCap_EGPRS := mscap_egprs, |
| 1440 | presenceBitDtmGprsmulti := '0'B, |
| 1441 | multislotCapdtmgprsmultislotsubclass := omit |
| 1442 | } |
| 1443 | }, |
| 1444 | accessCapAdditionsAfterRel97 := omit |
| 1445 | }, |
| 1446 | spare_bits := omit |
| 1447 | } |
| 1448 | } |
| 1449 | }, |
| 1450 | presenceBitMSRACap := '0'B |
| 1451 | }; |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1452 | template (present) MSRACapabilityValuesRecord_BSSGP |
| 1453 | tr_RaCapRec_BSSGP(template (present) BIT4 att := '0001'B /* E-GSM */, template MultislotCap_GPRS_BSSGP mscap_gprs := *, |
| 1454 | template MultislotCap_EGPRS_BSSGP mscap_egprs := *) := { |
| 1455 | mSRACapabilityValues := { |
| 1456 | mSRACapabilityValuesExclude1111 := { |
| 1457 | accessTechnType := att, /* E-GSM */ |
| 1458 | accessCapabilities := { |
| 1459 | lengthIndicator := ?, /* overwritten */ |
| 1460 | accessCapabilities := { |
| 1461 | rfPowerCapability := '001'B, /* FIXME */ |
| 1462 | presenceBitA5 := ?, |
| 1463 | a5bits := *, |
| 1464 | esind := '1'B, |
| 1465 | psbit := '0'B, |
| 1466 | vgcs := '0'B, |
| 1467 | vbs := '0'B, |
| 1468 | presenceBitMultislot := '1'B, |
| 1469 | multislotcap := { |
| 1470 | presenceBitHscsd := '0'B, |
| 1471 | hscsdmultislotclass := omit, |
| 1472 | presenceBitGprs := ?, |
| 1473 | gprsmultislot := mscap_gprs, |
| 1474 | presenceBitSms := '0'B, |
| 1475 | multislotCap_SMS := omit, |
| 1476 | multislotCapAdditionsAfterRel97 := { |
| 1477 | presenceBitEcsdmulti := '0'B, |
| 1478 | ecsdmultislotclass := *, |
| 1479 | presenceBitEgprsmulti := ?, |
| 1480 | multislotCap_EGPRS := mscap_egprs, |
| 1481 | presenceBitDtmGprsmulti := ?, |
| 1482 | multislotCapdtmgprsmultislotsubclass := * |
| 1483 | } |
| 1484 | }, |
| 1485 | accessCapAdditionsAfterRel97 := * |
| 1486 | }, |
| 1487 | spare_bits := * |
| 1488 | } |
| 1489 | } |
| 1490 | }, |
| 1491 | presenceBitMSRACap := '0'B |
| 1492 | }; |
| 1493 | |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1494 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1495 | template QoS_Profile_V t_defaultQos := { |
| 1496 | peak_Bit_Rate := int2oct(80, 2), |
| 1497 | precedence := '000'B, |
| 1498 | a_bit := '0'B, |
| 1499 | t_bit := '0'B, |
| 1500 | c_r_bit := '0'B, |
| 1501 | peakBitRateGranularity := '00'B |
| 1502 | } |
| 1503 | |
| 1504 | template QoS_Profile ts_QoS_TLV(template QoS_Profile_V qos) := { |
| 1505 | iEI := '18'O, |
| 1506 | ext := '1'B, |
| 1507 | lengthIndicator := { length1 := 3 }, |
| 1508 | peak_Bit_Rate := qos.peak_Bit_Rate, |
| 1509 | precedence := qos.precedence, |
| 1510 | a_bit := qos.a_bit, |
| 1511 | t_bit := qos.t_bit, |
| 1512 | c_r_bit := qos.c_r_bit, |
| 1513 | peakBitRateGranularity := qos.peakBitRateGranularity |
| 1514 | } |
| 1515 | |
| 1516 | template PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := { |
| 1517 | iEI := '16'O, |
| 1518 | ext := '1'B, |
| 1519 | lengthIndicator := { |
| 1520 | length1 := 2 |
| 1521 | }, |
| 1522 | delay_Value := f_oct_or_wc(delay, 2) |
| 1523 | } |
| 1524 | |
Pau Espin Pedrol | 88bf537 | 2019-12-09 21:12:28 +0100 | [diff] [blame] | 1525 | template DRX_Parameters t_defaultDRXparam := { |
| 1526 | iEI := '0A'O, |
| 1527 | ext := '1'B, |
| 1528 | lengthIndicator := { |
| 1529 | length1 := 2 |
| 1530 | }, |
| 1531 | splitPG_CycleCode := '00'O, |
| 1532 | nonDRXTimer := '000'B, |
| 1533 | splitOnCCCH := '0'B, |
| 1534 | cnSpecificDRXCycleLength := '0000'B |
| 1535 | } |
| 1536 | |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1537 | function ts_BSSGP_IE_MSRAcap_omit(template (omit) MSRadioAccessCapabilityV_BSSGP racap) return template (omit) MS_Radio_Access_Capability { |
| 1538 | var template (omit) MS_Radio_Access_Capability ret; |
| 1539 | if (istemplatekind(racap, "omit")) { |
| 1540 | return omit; |
| 1541 | } else { |
| 1542 | ret := { |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1543 | iEI := '13'O, |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1544 | ext := '1'B, |
| 1545 | lengthIndicator := { |
| 1546 | length1 := 1 |
| 1547 | }, |
| 1548 | mSRadioAccessCapabilityV_BSSGP := racap |
| 1549 | } |
| 1550 | return ret; |
| 1551 | } |
| 1552 | } |
| 1553 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1554 | function tr_BSSGP_IE_MSRAcap(template MSRadioAccessCapabilityV_BSSGP racap) return template MS_Radio_Access_Capability { |
| 1555 | var template MS_Radio_Access_Capability ret; |
| 1556 | if (istemplatekind(racap, "omit")) { |
| 1557 | return omit; |
| 1558 | } else { |
| 1559 | ret := { |
| 1560 | iEI := '13'O, |
| 1561 | ext := ?, |
| 1562 | lengthIndicator := ?, |
| 1563 | mSRadioAccessCapabilityV_BSSGP := racap |
| 1564 | } |
| 1565 | return ret; |
| 1566 | } |
| 1567 | } |
| 1568 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1569 | template PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu, |
| 1570 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit, |
| 1571 | template (omit) IMSI_BSSGP imsi := omit) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1572 | pDU_BSSGP_DL_UNITDATA := { |
| 1573 | bssgpPduType := '00'O, |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1574 | tLLI_current := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1575 | qoS_Profile := t_defaultQos, |
| 1576 | pDU_Lifetime := t_DefaultLifetime(65535), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1577 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1578 | priority := omit, |
| 1579 | dRX_Parameters := omit, |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1580 | iMSI := imsi, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1581 | tLLI_old := omit, |
| 1582 | pFI := omit, |
| 1583 | lSA_Information := omit, |
| 1584 | service_UTRAN_CCO := omit, |
| 1585 | service_Class_Indicator := omit, |
| 1586 | subscriber_Profile_ID_For_RAT_Priority := omit, |
| 1587 | redirection_Indication := omit, |
| 1588 | redirection_Completed := omit, |
| 1589 | unconfirmed_Send_State_Variable := omit, |
| 1590 | sCI := omit, |
| 1591 | gGSN_PGW_Location := omit, |
| 1592 | eDRX_Paremeters := omit, |
| 1593 | old_Routing_Area_Identification := omit, |
| 1594 | attach_Indicator := omit, |
| 1595 | alignment_octets := omit, |
| 1596 | lLC_PDU := ts_BSSGP_LLC_PDU(pdu), |
| 1597 | initialLLC_PDU := omit |
| 1598 | } |
| 1599 | } |
| 1600 | |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1601 | template PDU_BSSGP tr_BSSGP_DL_UD(template (present) GprsTlli tlli, template (present) octetstring pdu, |
| 1602 | template IMSI_BSSGP imsi := omit) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1603 | pDU_BSSGP_DL_UNITDATA := { |
| 1604 | bssgpPduType := '00'O, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1605 | tLLI_current := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1606 | qoS_Profile := ?, |
| 1607 | pDU_Lifetime := ?, |
| 1608 | mS_Radio_Access_Capability := *, |
| 1609 | priority := *, |
| 1610 | dRX_Parameters := *, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1611 | iMSI := imsi, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1612 | tLLI_old := *, |
| 1613 | pFI := *, |
| 1614 | lSA_Information := *, |
| 1615 | service_UTRAN_CCO := *, |
| 1616 | service_Class_Indicator := *, |
| 1617 | subscriber_Profile_ID_For_RAT_Priority := *, |
| 1618 | redirection_Indication := *, |
| 1619 | redirection_Completed := *, |
| 1620 | unconfirmed_Send_State_Variable := *, |
| 1621 | sCI := *, |
| 1622 | gGSN_PGW_Location := *, |
| 1623 | eDRX_Paremeters := *, |
| 1624 | old_Routing_Area_Identification := *, |
| 1625 | attach_Indicator := *, |
| 1626 | alignment_octets := *, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1627 | lLC_PDU := tr_BSSGP_LLC_PDU(pdu), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1628 | initialLLC_PDU := * |
| 1629 | } |
| 1630 | } |
| 1631 | |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1632 | template PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := { |
Harald Welte | 78d9f27 | 2018-02-16 18:13:45 +0100 | [diff] [blame] | 1633 | pDU_BSSGP_UL_UNITDATA := { |
| 1634 | bssgpPduType := '01'O, |
| 1635 | tLLI := tlli, |
| 1636 | qoS_Profile := t_defaultQos, |
| 1637 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1638 | pFI := omit, |
| 1639 | lSA_Identifier_List := omit, |
| 1640 | redirect_Attempt_Flag := omit, |
| 1641 | iMSI_BSSGP := omit, |
| 1642 | unconfirmed_Send_State_Variable := omit, |
| 1643 | selected_PLMN_ID := omit, |
| 1644 | selected_Operator := omit, |
| 1645 | cS_Registered_Operator := omit, |
| 1646 | alignment_octets := omit, |
| 1647 | lLC_PDU := ts_BSSGP_LLC_PDU(payload) |
| 1648 | } |
| 1649 | } |
| 1650 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1651 | template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?, |
| 1652 | template octetstring payload := ?) := { |
| 1653 | pDU_BSSGP_UL_UNITDATA := { |
| 1654 | bssgpPduType := '01'O, |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1655 | tLLI := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1656 | qoS_Profile := ?, |
| 1657 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1658 | pFI := *, |
| 1659 | lSA_Identifier_List := *, |
| 1660 | redirect_Attempt_Flag := *, |
| 1661 | iMSI_BSSGP := *, |
| 1662 | unconfirmed_Send_State_Variable := *, |
| 1663 | selected_PLMN_ID := *, |
| 1664 | selected_Operator := *, |
| 1665 | cS_Registered_Operator := *, |
| 1666 | alignment_octets := *, |
| 1667 | lLC_PDU := tr_BSSGP_LLC_PDU(payload) |
| 1668 | } |
| 1669 | } |
| 1670 | |
Pau Espin Pedrol | 88bf537 | 2019-12-09 21:12:28 +0100 | [diff] [blame] | 1671 | template PDU_BSSGP tr_BSSGP_CS_PAGING(BssgpBvci bvci) := { |
| 1672 | pDU_BSSGP_PAGING_CS := { |
| 1673 | bssgpPduType := '07'O, |
| 1674 | iMSI := ?, |
| 1675 | dRX_Parameters := ?, |
| 1676 | paging_Field4 := { |
| 1677 | bVCI := t_BSSGP_BVCI(bvci) |
| 1678 | }, |
| 1679 | tLLI := *, |
| 1680 | channel_needed := *, |
| 1681 | eMLPP_Priority := *, |
| 1682 | tMSI := *, |
| 1683 | global_CN_Id := * |
| 1684 | } |
| 1685 | } |
| 1686 | |
| 1687 | template PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { |
| 1688 | pDU_BSSGP_PAGING_CS := { |
| 1689 | bssgpPduType := '07'O, |
| 1690 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1691 | dRX_Parameters := t_defaultDRXparam, |
| 1692 | paging_Field4 := { |
| 1693 | bVCI := t_BSSGP_BVCI(bvci) |
| 1694 | }, |
| 1695 | tLLI := omit, |
| 1696 | channel_needed := omit, |
| 1697 | eMLPP_Priority := omit, |
| 1698 | tMSI := omit, |
| 1699 | global_CN_Id := omit |
| 1700 | } |
| 1701 | } |
| 1702 | |
Vadim Yanitskiy | 7b22421 | 2020-03-26 02:43:55 +0700 | [diff] [blame] | 1703 | template PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { |
| 1704 | pDU_BSSGP_PAGING_CS := { |
| 1705 | bssgpPduType := '07'O, |
| 1706 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1707 | dRX_Parameters := t_defaultDRXparam, |
| 1708 | paging_Field4 := { |
| 1709 | bVCI := t_BSSGP_BVCI(bvci) |
| 1710 | }, |
| 1711 | tLLI := omit, |
| 1712 | channel_needed := omit, |
| 1713 | eMLPP_Priority := omit, |
| 1714 | tMSI := ts_BSSGP_TMSI(tmsi), |
| 1715 | global_CN_Id := omit |
| 1716 | } |
| 1717 | } |
| 1718 | |
Harald Welte | a36b246 | 2020-06-17 22:11:08 +0200 | [diff] [blame] | 1719 | template PDU_BSSGP tr_BSSGP_PS_PAGING(template BssgpBvci bvci) := { |
Harald Welte | 78d9f27 | 2018-02-16 18:13:45 +0100 | [diff] [blame] | 1720 | pDU_BSSGP_PAGING_PS := { |
| 1721 | bssgpPduType := '06'O, |
| 1722 | iMSI := ?, |
| 1723 | dRX_Parameters := *, |
| 1724 | paging_Field4 := { |
| 1725 | bVCI := t_BSSGP_BVCI(bvci) |
| 1726 | }, |
| 1727 | pFI := *, |
| 1728 | aBQP := *, |
| 1729 | qoS_Profile := ?, |
| 1730 | pTMSI := *, |
| 1731 | eDRX_Paremeters := * |
| 1732 | } |
| 1733 | } |
| 1734 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1735 | template PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { |
| 1736 | pDU_BSSGP_PAGING_PS := { |
| 1737 | bssgpPduType := '06'O, |
| 1738 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1739 | dRX_Parameters := omit, |
| 1740 | paging_Field4 := { |
| 1741 | bVCI := t_BSSGP_BVCI(bvci) |
| 1742 | }, |
| 1743 | pFI := omit, |
| 1744 | aBQP := omit, |
| 1745 | qoS_Profile := ts_QoS_TLV(t_defaultQos), |
| 1746 | pTMSI := omit, |
| 1747 | eDRX_Paremeters := omit |
| 1748 | } |
| 1749 | } |
| 1750 | |
| 1751 | template PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { |
| 1752 | pDU_BSSGP_PAGING_PS := { |
| 1753 | bssgpPduType := '06'O, |
| 1754 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1755 | dRX_Parameters := omit, |
| 1756 | paging_Field4 := { |
| 1757 | bVCI := t_BSSGP_BVCI(bvci) |
| 1758 | }, |
| 1759 | pFI := omit, |
| 1760 | aBQP := omit, |
| 1761 | qoS_Profile := ts_QoS_TLV(t_defaultQos), |
| 1762 | pTMSI := ts_BSSGP_TMSI(tmsi), |
| 1763 | eDRX_Paremeters := omit |
| 1764 | } |
| 1765 | } |
| 1766 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1767 | template (value) Paging_Field4 ts_BssgpP4BssArea := { |
| 1768 | bSS_Area_Indication := { |
| 1769 | iEI := '02'O, |
| 1770 | ext := '1'B, |
| 1771 | lengthIndicator := { |
| 1772 | length1 := 1 |
| 1773 | }, |
| 1774 | bSS_indicator := '00'O |
| 1775 | } |
| 1776 | } |
| 1777 | |
| 1778 | template (value) Paging_Field4 ts_BssgpP4LAC(GSM_Types.LocationAreaIdentification lai) := { |
| 1779 | location_Area := ts_BSSGP_LA_ID(lai) |
| 1780 | } |
| 1781 | |
| 1782 | template (value) Paging_Field4 ts_BssgpP4RAC(GSM_Types.RoutingAreaIdentification rai) := { |
| 1783 | routeing_Area := ts_BSSGP_RA_ID(rai) |
| 1784 | } |
| 1785 | |
| 1786 | template (value) Paging_Field4 ts_BssgpP4Bvci(BssgpBvci bvci) := { |
| 1787 | bVCI := t_BSSGP_BVCI(bvci) |
| 1788 | } |
| 1789 | |
| 1790 | template (value) Location_Area ts_BSSGP_LA_ID(GSM_Types.LocationAreaIdentification input) := { |
| 1791 | iEI := '10'O, |
| 1792 | ext := '1'B, |
| 1793 | lengthIndicator := { |
| 1794 | length1 := 5 |
| 1795 | }, |
| 1796 | mccDigit1 := input.mcc_mnc[0], |
| 1797 | mccDigit2 := input.mcc_mnc[1], |
| 1798 | mccDigit3 := input.mcc_mnc[2], |
| 1799 | mncDigit3 := input.mcc_mnc[3], |
| 1800 | mncDigit1 := input.mcc_mnc[4], |
| 1801 | mncDigit2 := input.mcc_mnc[5], |
| 1802 | lac := int2oct(input.lac, 2) |
| 1803 | } |
| 1804 | |
| 1805 | template (value) Routeing_Area ts_BSSGP_RA_ID(GSM_Types.RoutingAreaIdentification input) := { |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 1806 | iEI := '1B'O, |
| 1807 | ext := '1'B, |
| 1808 | lengthIndicator := { |
| 1809 | length1 := 6 |
| 1810 | }, |
| 1811 | mccDigit1 := input.lai.mcc_mnc[0], |
| 1812 | mccDigit2 := input.lai.mcc_mnc[1], |
| 1813 | mccDigit3 := input.lai.mcc_mnc[2], |
| 1814 | mncDigit3 := input.lai.mcc_mnc[3], |
| 1815 | mncDigit1 := input.lai.mcc_mnc[4], |
| 1816 | mncDigit2 := input.lai.mcc_mnc[5], |
| 1817 | lac := int2oct(input.lai.lac, 2), |
| 1818 | rac := int2oct(input.rac, 1) |
| 1819 | } |
| 1820 | |
| 1821 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND(GprsTlli tlli, RoutingAreaIdentification ra_id) := { |
| 1822 | pDU_BSSGP_SUSPEND := { |
| 1823 | bssgpPduType := '0B'O, |
| 1824 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1825 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1826 | } |
| 1827 | } |
| 1828 | template PDU_BSSGP tr_BSSGP_SUSPEND(template GprsTlli tlli, RoutingAreaIdentification ra_id) := { |
| 1829 | pDU_BSSGP_SUSPEND := { |
| 1830 | bssgpPduType := '0B'O, |
| 1831 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1832 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1833 | } |
| 1834 | } |
| 1835 | |
| 1836 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1837 | template (value) OCT1 susp_ref) := { |
| 1838 | pDU_BSSGP_SUSPEND_ACK := { |
| 1839 | bssgpPduType := '0C'O, |
| 1840 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1841 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1842 | suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref) |
| 1843 | } |
| 1844 | } |
| 1845 | template PDU_BSSGP tr_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1846 | template OCT1 susp_ref) := { |
| 1847 | pDU_BSSGP_SUSPEND_ACK := { |
| 1848 | bssgpPduType := '0C'O, |
| 1849 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1850 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1851 | suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref) |
| 1852 | } |
| 1853 | } |
| 1854 | |
| 1855 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1856 | template (omit) BssgpCause cause) := { |
| 1857 | pDU_BSSGP_SUSPEND_NACK := { |
| 1858 | bssgpPduType := '0D'O, |
| 1859 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1860 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1861 | cause := ts_BSSGP_CAUSE(cause) |
| 1862 | } |
| 1863 | } |
| 1864 | template PDU_BSSGP tr_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1865 | template BssgpCause cause) := { |
| 1866 | pDU_BSSGP_SUSPEND_NACK := { |
| 1867 | bssgpPduType := '0D'O, |
| 1868 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1869 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1870 | cause := t_BSSGP_CAUSE(cause) |
| 1871 | } |
| 1872 | } |
| 1873 | |
| 1874 | |
| 1875 | |
| 1876 | template (value) PDU_BSSGP ts_BSSGP_RESUME(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1877 | OCT1 susp_ref) := { |
| 1878 | pDU_BSSGP_RESUME := { |
| 1879 | bssgpPduType := '0E'O, |
| 1880 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1881 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1882 | suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref) |
| 1883 | } |
| 1884 | } |
| 1885 | template PDU_BSSGP tr_BSSGP_RESUME(template GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1886 | template OCT1 susp_ref) := { |
| 1887 | pDU_BSSGP_RESUME := { |
| 1888 | bssgpPduType := '0E'O, |
| 1889 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1890 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1891 | suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref) |
| 1892 | } |
| 1893 | } |
| 1894 | |
| 1895 | template (value) PDU_BSSGP ts_BSSGP_RESUME_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id) |
| 1896 | := { |
| 1897 | pDU_BSSGP_RESUME_ACK := { |
| 1898 | bssgpPduType := '0F'O, |
| 1899 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1900 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1901 | } |
| 1902 | } |
| 1903 | template PDU_BSSGP tr_BSSGP_RESUME_ACK(template GprsTlli tlli, |
| 1904 | RoutingAreaIdentification ra_id) := { |
| 1905 | pDU_BSSGP_RESUME_ACK := { |
| 1906 | bssgpPduType := '0F'O, |
| 1907 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1908 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1909 | } |
| 1910 | } |
| 1911 | |
| 1912 | template (value) PDU_BSSGP ts_BSSGP_RESUME_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1913 | template (omit) BssgpCause cause) := { |
| 1914 | pDU_BSSGP_RESUME_NACK := { |
| 1915 | bssgpPduType := '10'O, |
| 1916 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1917 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1918 | cause := ts_BSSGP_CAUSE(cause) |
| 1919 | } |
| 1920 | } |
| 1921 | template PDU_BSSGP tr_BSSGP_RESUME_NACK(template GprsTlli tlli, |
| 1922 | RoutingAreaIdentification ra_id, |
| 1923 | template BssgpCause cause) := { |
| 1924 | pDU_BSSGP_RESUME_NACK := { |
| 1925 | bssgpPduType := '10'O, |
| 1926 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1927 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1928 | cause := t_BSSGP_CAUSE(cause) |
| 1929 | } |
| 1930 | } |
| 1931 | |
Daniel Willmann | 379fc25 | 2020-11-20 18:34:22 +0100 | [diff] [blame] | 1932 | /* 10.4.1 */ |
| 1933 | template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL(GprsTlli tlli, template (value) BssgpBvci bvci_old, |
| 1934 | template (omit) BssgpBvci bvci_new := omit, |
| 1935 | template (omit) Nsei nsei := omit) := { |
| 1936 | pDU_BSSGP_FLUSH_LL := { |
| 1937 | bssgpPduType := '2A'O, |
| 1938 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1939 | bVCI_old := t_BSSGP_BVCI(bvci_old), |
| 1940 | bVCI_new := t_BSSGP_BVCI(bvci_new), |
| 1941 | nSEI := t_BSSGP_NSEI(nsei) |
| 1942 | } |
| 1943 | } |
| 1944 | template PDU_BSSGP tr_BSSGP_FLUSH_LL(template GprsTlli tlli, template BssgpBvci bvci_old, |
| 1945 | template (omit) BssgpBvci bvci_new := omit, |
| 1946 | template (omit) Nsei nsei := omit) := { |
| 1947 | pDU_BSSGP_FLUSH_LL := { |
| 1948 | bssgpPduType := '2A'O, |
| 1949 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1950 | bVCI_old := t_BSSGP_BVCI(bvci_old), |
| 1951 | bVCI_new := t_BSSGP_BVCI(bvci_new), |
| 1952 | nSEI := t_BSSGP_NSEI(nsei) |
| 1953 | } |
| 1954 | } |
| 1955 | |
Daniel Willmann | 7f1d78e | 2020-11-24 14:42:40 +0100 | [diff] [blame] | 1956 | /* 10.4.2 */ |
| 1957 | template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL_ACK(GprsTlli tlli, template (value) OCT1 act, |
| 1958 | template (value) integer oct_affected, |
| 1959 | template (omit) BssgpBvci bvci_new := omit, |
| 1960 | template (omit) Nsei nsei := omit) := { |
| 1961 | pDU_BSSGP_FLUSH_LL_ACK := { |
| 1962 | bssgpPduType := '2B'O, |
| 1963 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1964 | flush_Action := t_FLUSH_ACTION(act), |
| 1965 | bVCI_new := t_BSSGP_BVCI(bvci_new), |
| 1966 | number_of_octets_affected := t_NO_OCT_AFF(oct_affected), |
| 1967 | nSEI := t_BSSGP_NSEI(nsei) |
| 1968 | } |
| 1969 | } |
| 1970 | template PDU_BSSGP tr_BSSGP_FLUSH_LL_ACK(template GprsTlli tlli, template OCT1 act, |
| 1971 | template integer oct_affected, |
| 1972 | template (omit) BssgpBvci bvci_new := omit, |
| 1973 | template (omit) Nsei nsei := omit) := { |
| 1974 | pDU_BSSGP_FLUSH_LL_ACK := { |
| 1975 | bssgpPduType := '2B'O, |
| 1976 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1977 | flush_Action := t_FLUSH_ACTION(act), |
| 1978 | bVCI_new := t_BSSGP_BVCI(bvci_new), |
| 1979 | number_of_octets_affected := t_NO_OCT_AFF(oct_affected), |
| 1980 | nSEI := t_BSSGP_NSEI(nsei) |
| 1981 | } |
| 1982 | } |
| 1983 | |
Daniel Willmann | 00c0bbf | 2020-11-24 18:37:49 +0100 | [diff] [blame] | 1984 | /* 10.4.3 */ |
| 1985 | template (value) PDU_BSSGP ts_BSSGP_LLC_DISCARDED(GprsTlli tlli, template (value) integer frames_discarded, |
| 1986 | template (value) BssgpBvci bvci, |
| 1987 | template (value) integer oct_deleted) := { |
| 1988 | pDU_BSSGP_LLC_DISCARDED := { |
| 1989 | bssgpPduType := '2C'O, |
| 1990 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1991 | lLC_Frames_Discarded := t_LLC_FRAMES_DISCARDED(frames_discarded), |
| 1992 | bVCI := t_BSSGP_BVCI(bvci), |
| 1993 | number_of_octets_deleted := t_NO_OCT_AFF(oct_deleted), |
| 1994 | pFI := omit |
| 1995 | } |
| 1996 | } |
| 1997 | template PDU_BSSGP tr_BSSGP_LLC_DISCARDED(template GprsTlli tlli, template integer frames_discarded, |
| 1998 | template BssgpBvci bvci, |
| 1999 | template integer oct_deleted) := { |
| 2000 | pDU_BSSGP_LLC_DISCARDED := { |
| 2001 | bssgpPduType := '2C'O, |
| 2002 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2003 | lLC_Frames_Discarded := t_LLC_FRAMES_DISCARDED(frames_discarded), |
| 2004 | bVCI := t_BSSGP_BVCI(bvci), |
| 2005 | number_of_octets_deleted := t_NO_OCT_AFF(oct_deleted), |
| 2006 | pFI := * |
| 2007 | } |
| 2008 | } |
| 2009 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2010 | /* 10.2.3 */ |
| 2011 | template (value) PDU_BSSGP ts_BSSGP_RA_CAP(GprsTlli tlli, |
| 2012 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 2013 | pDU_BSSGP_RA_CAPABILITY := { |
| 2014 | bssgpPduType := '02'O, |
| 2015 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2016 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) |
| 2017 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2018 | } |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2019 | template (present) PDU_BSSGP tr_BSSGP_RA_CAP(template (present) GprsTlli tlli, |
| 2020 | template MSRadioAccessCapabilityV_BSSGP racap) := { |
| 2021 | pDU_BSSGP_RA_CAPABILITY := { |
| 2022 | bssgpPduType := '02'O, |
| 2023 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2024 | mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) |
| 2025 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2026 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2027 | |
| 2028 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2029 | /* 10.3.3 */ |
| 2030 | template (value) PDU_BSSGP ts_BSSGP_RA_CAP_UPD(GprsTlli tlli, OCT1 tag) := { |
| 2031 | pDU_BSSGP_RA_CAPABILITY_UPDATE := { |
| 2032 | bssgpPduType := '08'O, |
| 2033 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2034 | tag := ts_BSSGP_IE_Tag(tag) |
| 2035 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2036 | } |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2037 | template (present) PDU_BSSGP tr_BSSGP_RA_CAP_UPD(template (present) GprsTlli tlli, |
| 2038 | template OCT1 tag) := { |
| 2039 | pDU_BSSGP_RA_CAPABILITY_UPDATE := { |
| 2040 | bssgpPduType := '08'O, |
| 2041 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2042 | tag := tr_BSSGP_IE_Tag(tag) |
| 2043 | } |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 2044 | } |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 2045 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2046 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2047 | /* 10.3.4 */ |
| 2048 | template (value) PDU_BSSGP |
| 2049 | ts_BSSGP_RA_CAP_UPD_ACK(GprsTlli tlli, OCT1 tag, template (value) OCT1 cause, |
| 2050 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 2051 | pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { |
| 2052 | bssgpPduType := '09'O, |
| 2053 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2054 | tag := ts_BSSGP_IE_Tag(tag), |
| 2055 | iMSI := omit, |
| 2056 | rA_Cap_UPDATE_CAUSE := ts_BSSGP_IE_RACU_Cause(cause), |
| 2057 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) |
| 2058 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2059 | } |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2060 | template (present) PDU_BSSGP |
| 2061 | tr_BSSGP_RA_CAP_UPD_ACK(template (present) GprsTlli tlli, template OCT1 tag, template (present) OCT1 cause, |
| 2062 | template MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 2063 | pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { |
| 2064 | bssgpPduType := '09'O, |
| 2065 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2066 | tag := tr_BSSGP_IE_Tag(tag), |
| 2067 | iMSI := omit, |
| 2068 | rA_Cap_UPDATE_CAUSE := tr_BSSGP_IE_RACU_Cause(cause), |
| 2069 | mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) |
| 2070 | } |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 2071 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2072 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2073 | type enumerated BssgpRadioCause { |
| 2074 | BSSGP_RADIO_CAUSE_CONTACT_LOST ('00'H), |
| 2075 | BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF ('01'H), |
| 2076 | BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED ('02'H), |
| 2077 | BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE ('03'H), |
| 2078 | BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE ('04'H) |
| 2079 | } with { variant "FIELDLENGTH(8)" }; |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 2080 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 2081 | function ts_BSSGP_RADIO_CAUSE(template (omit) BssgpRadioCause cause) return template (omit) Radio_Cause { |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2082 | var template (omit) Radio_Cause ret; |
| 2083 | if (istemplatekind(cause, "omit")) { |
| 2084 | ret := omit; |
| 2085 | } else { |
| 2086 | ret.iEI := '19'O; |
| 2087 | ret.ext := '1'B; |
| 2088 | ret.lengthIndicator := { length1 := 1 }; |
| 2089 | ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 2090 | } |
| 2091 | return ret; |
| 2092 | } |
| 2093 | function tr_BSSGP_RADIO_CAUSE(template BssgpRadioCause cause) return template (present) Radio_Cause { |
| 2094 | var template Radio_Cause ret; |
Daniel Willmann | 05d4638 | 2020-11-19 14:20:33 +0100 | [diff] [blame] | 2095 | ret.iEI := '19'O; |
| 2096 | ret.ext := '1'B; |
| 2097 | ret.lengthIndicator := { length1 := 1 }; |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2098 | if (isvalue(cause)) { |
| 2099 | ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 2100 | } else { |
| 2101 | ret.radio_Cause_Value := ? |
| 2102 | } |
| 2103 | return ret; |
Daniel Willmann | 05d4638 | 2020-11-19 14:20:33 +0100 | [diff] [blame] | 2104 | } |
Daniel Willmann | 05d4638 | 2020-11-19 14:20:33 +0100 | [diff] [blame] | 2105 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2106 | /* 10.3.5 */ |
| 2107 | template (value) PDU_BSSGP |
| 2108 | ts_BSSGP_RADIO_STATUS(GprsTlli tlli, template (value) BssgpRadioCause cause) := { |
| 2109 | pDU_BSSGP_RADIO_STATUS := { |
| 2110 | bssgpPduType := '0a'O, |
| 2111 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2112 | tMSI := omit, |
| 2113 | iMSI := omit, |
| 2114 | radio_Cause := ts_BSSGP_RADIO_CAUSE(cause) |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2115 | } |
| 2116 | } |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2117 | template (present) PDU_BSSGP |
| 2118 | tr_BSSGP_RADIO_STATUS(template (present) GprsTlli tlli, template (present) BssgpRadioCause cause) := { |
| 2119 | pDU_BSSGP_RADIO_STATUS := { |
| 2120 | bssgpPduType := '0a'O, |
| 2121 | tLLI := ts_BSSGP_TLLI(tlli), |
| 2122 | tMSI := omit, |
| 2123 | iMSI := omit, |
| 2124 | radio_Cause := tr_BSSGP_RADIO_CAUSE(cause) |
| 2125 | } |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2126 | } |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 2127 | |
Harald Welte | f8e5c5d | 2020-11-27 22:37:23 +0100 | [diff] [blame] | 2128 | /* 10.4.15 */ |
| 2129 | template (value) PDU_BSSGP |
| 2130 | ts_BSSGP_INVOKE_TRACE(OCT1 eq_trace, OCT2 ref) := { |
| 2131 | pDU_BSSGP_SGSN_INVOKE_TRACE := { |
| 2132 | bssgpPduType := '40'O, |
| 2133 | traceType := { |
| 2134 | iEI := '22'O, |
| 2135 | ext := '1'B, |
| 2136 | lengthIndicator := { |
| 2137 | length1 := 1 |
| 2138 | }, |
| 2139 | equipment_Trace := eq_trace |
| 2140 | }, |
| 2141 | traceReference := { |
| 2142 | iEI := '21'O, |
| 2143 | ext := '1'B, |
| 2144 | lengthIndicator := { |
| 2145 | length1 := 2 |
| 2146 | }, |
| 2147 | trace_Reference := ref |
| 2148 | }, |
| 2149 | triggerId := omit, |
| 2150 | mobileId := omit, |
| 2151 | omcId := omit, |
| 2152 | transactionId := omit |
| 2153 | } |
| 2154 | } |
| 2155 | template (present) PDU_BSSGP |
| 2156 | tr_BSSGP_INVOKE_TRACE(template (present) OCT1 eq_trace, template (present) OCT2 ref) := { |
| 2157 | pDU_BSSGP_SGSN_INVOKE_TRACE := { |
| 2158 | bssgpPduType := '40'O, |
| 2159 | traceType := { |
| 2160 | iEI := '22'O, |
| 2161 | ext := '1'B, |
| 2162 | lengthIndicator := { |
| 2163 | length1 := 1 |
| 2164 | }, |
| 2165 | equipment_Trace := eq_trace |
| 2166 | }, |
| 2167 | traceReference := { |
| 2168 | iEI := '21'O, |
| 2169 | ext := '1'B, |
| 2170 | lengthIndicator := { |
| 2171 | length1 := 2 |
| 2172 | }, |
| 2173 | trace_Reference := ref |
| 2174 | }, |
| 2175 | triggerId := *, |
| 2176 | mobileId := *, |
| 2177 | omcId := *, |
| 2178 | transactionId := * |
| 2179 | } |
| 2180 | } |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2181 | |
Harald Welte | f20af41 | 2020-11-28 16:11:11 +0100 | [diff] [blame] | 2182 | /* 10.4.36 */ |
| 2183 | template (value) PDU_BSSGP |
| 2184 | ts_OVERLOAD(template (value) BIT1 priority_class) := { |
| 2185 | pDU_BSSGP_OVERLOAD := { |
| 2186 | bssgpPduType := '42'O, |
| 2187 | priority_Class_Indicator := { |
| 2188 | iEI := '8f'O, |
| 2189 | ext := '1'B, |
| 2190 | lengthIndicator := { |
| 2191 | length1 := 1 |
| 2192 | }, |
| 2193 | priority_Class_Indicator_Value := priority_class, |
| 2194 | spare := '0000000'B |
| 2195 | } |
| 2196 | } |
| 2197 | } |
| 2198 | template (present) PDU_BSSGP |
| 2199 | tr_OVERLOAD(template (present) BIT1 priority_class) := { |
| 2200 | pDU_BSSGP_OVERLOAD := { |
| 2201 | bssgpPduType := '42'O, |
| 2202 | priority_Class_Indicator := { |
| 2203 | iEI := '8f'O, |
| 2204 | ext := '1'B, |
| 2205 | lengthIndicator := { |
| 2206 | length1 := 1 |
| 2207 | }, |
| 2208 | priority_Class_Indicator_Value := priority_class, |
| 2209 | spare := '0000000'B |
| 2210 | } |
| 2211 | } |
| 2212 | } |
| 2213 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2214 | /* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */ |
| 2215 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := ( |
| 2216 | {pDU_BSSGP_DL_UNITDATA := ?}, |
| 2217 | {pDU_BSSGP_UL_UNITDATA := ?}, |
| 2218 | {pDU_BSSGP_RA_CAPABILITY := ?}, |
| 2219 | {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?}, |
| 2220 | {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?}, |
| 2221 | {pDU_BSSGP_RADIO_STATUS := ?}, |
| 2222 | {pDU_BSSGP_FLOW_CONTROL_BVC := ?}, |
| 2223 | {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?}, |
| 2224 | {pDU_BSSGP_FLOW_CONTROL_MS := ?}, |
| 2225 | {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?}, |
| 2226 | {pDU_BSSGP_FLOW_CONTROL_PFC := ?}, |
| 2227 | {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?}, |
| 2228 | {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?}, |
| 2229 | {pDU_BSSGP_CREATE_BSS_PFC := ?}, |
| 2230 | {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?}, |
| 2231 | {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?}, |
| 2232 | {pDU_BSSGP_MODIFY_BSS_PFC := ?}, |
| 2233 | {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?}, |
| 2234 | {pDU_BSSGP_DELETE_BSS_PFC := ?}, |
| 2235 | {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?}, |
| 2236 | {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?}, |
| 2237 | {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?}, |
| 2238 | {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?}, |
| 2239 | {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?}, |
| 2240 | {pDU_BSSGP_PS_HANDOVER_REQUEST := ?}, |
| 2241 | {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?}, |
| 2242 | {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?}, |
| 2243 | {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?}, |
| 2244 | {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?}, |
| 2245 | {pDU_BSSGP_PS_HANDOVER_CANCEL := ?} |
| 2246 | ); |
| 2247 | |
| 2248 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := ( |
| 2249 | tr_BSSGP_PERMITTED_PTP_ONLY, |
| 2250 | {pDU_BSSGP_PAGING_PS := ?}, |
| 2251 | {pDU_BSSGP_PAGING_CS := ?}, |
| 2252 | {pDU_BSSGP_STATUS := ?} |
| 2253 | ); |
| 2254 | |
| 2255 | /* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */ |
| 2256 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := ( |
| 2257 | {pDU_BSSGP_SUSPEND := ?}, |
| 2258 | {pDU_BSSGP_SUSPEND_ACK := ?}, |
| 2259 | {pDU_BSSGP_SUSPEND_NACK := ?}, |
| 2260 | {pDU_BSSGP_RESUME := ?}, |
| 2261 | {pDU_BSSGP_RESUME_ACK := ?}, |
| 2262 | {pDU_BSSGP_RESUME_NACK := ?}, |
| 2263 | {pDU_BSSGP_FLUSH_LL := ?}, |
| 2264 | {pDU_BSSGP_FLUSH_LL_ACK := ?}, |
| 2265 | {pDU_BSSGP_LLC_DISCARDED := ?}, |
| 2266 | {pDU_BSSGP_BVC_BLOCK := ?}, |
| 2267 | {pDU_BSSGP_BVC_BLOCK_ACK := ?}, |
| 2268 | {pDU_BSSGP_BVC_UNBLOCK := ?}, |
| 2269 | {pDU_BSSGP_BVC_UNBLOCK_ACK := ?}, |
| 2270 | {pDU_BSSGP_BVC_RESET := ?}, |
| 2271 | {pDU_BSSGP_BVC_RESET_ACK := ?}, |
| 2272 | {pDU_BSSGP_SGSN_INVOKE_TRACE := ?}, |
| 2273 | {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?}, |
| 2274 | {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?}, |
| 2275 | {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?}, |
| 2276 | {pDU_BSSGP_POSITION_COMMAND := ?}, |
| 2277 | {pDU_BSSGP_POSITION_RESPONSE := ?}, |
| 2278 | {pDU_BSSGP_RAN_INFORMATION := ?}, |
| 2279 | {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?}, |
| 2280 | {pDU_BSSGP_RAN_INFORMATION_ACK := ?}, |
| 2281 | {pDU_BSSGP_RAN_INFORMATION_ERROR := ?}, |
| 2282 | {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?}, |
| 2283 | {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?}, |
| 2284 | {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?}, |
| 2285 | {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?}, |
| 2286 | {pDU_BSSGP_MBMS_STOP_RESPONSE := ?}, |
| 2287 | {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?}, |
| 2288 | {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?} |
| 2289 | ); |
| 2290 | |
| 2291 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := ( |
| 2292 | tr_BSSGP_PERMITTED_SIGN_ONLY, |
| 2293 | {pDU_BSSGP_PAGING_PS := ?}, |
| 2294 | {pDU_BSSGP_PAGING_CS := ?}, |
| 2295 | {pDU_BSSGP_SUSPEND := ?}, |
| 2296 | {pDU_BSSGP_STATUS := ?} |
| 2297 | ); |
| 2298 | |
| 2299 | /* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */ |
| 2300 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := ( |
| 2301 | {pDU_BSSGP_DL_MBMS_UNITDATA := ?}, |
| 2302 | {pDU_BSSGP_UL_MBMS_UNITDATA := ?} |
| 2303 | ); |
| 2304 | |
| 2305 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := ( |
| 2306 | tr_BSSGP_PERMITTED_PTM_ONLY, |
| 2307 | {pDU_BSSGP_STATUS := ?} |
| 2308 | ); |
| 2309 | |
| 2310 | |
| 2311 | /* Template for any PTP BVCI IE */ |
| 2312 | template (present) BVCI tr_BSSGP_IE_PtpBvci := { |
| 2313 | iEI := '04'O, |
| 2314 | ext := '1'B, |
| 2315 | lengthIndicator := { |
| 2316 | length1 := 2 |
| 2317 | }, |
| 2318 | unstructured_value := complement ('0000'O, '0001'O) |
Harald Welte | 8f66af1 | 2020-11-12 17:27:58 +0100 | [diff] [blame] | 2319 | } |
Harald Welte | 8f66af1 | 2020-11-12 17:27:58 +0100 | [diff] [blame] | 2320 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2321 | /* message on signaling PTP but containing a ptp BVC */ |
| 2322 | /* |
| 2323 | template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := ( |
| 2324 | {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}}, |
| 2325 | {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, |
| 2326 | {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, |
| 2327 | {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}}, |
| 2328 | {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 2329 | {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 2330 | {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 2331 | {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}}, |
| 2332 | {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}}, |
| 2333 | {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}}, |
| 2334 | {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}}, |
| 2335 | {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}}, |
| 2336 | {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}}, |
| 2337 | {pDU_BSSGP_POSITION_COMMAND:{ |
| 2338 | ); |
| 2339 | */ |
Harald Welte | 8f66af1 | 2020-11-12 17:27:58 +0100 | [diff] [blame] | 2340 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2341 | /* extract the BVCI IE of given PDU + return it */ |
| 2342 | function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI { |
| 2343 | select (pdu) { |
| 2344 | case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) { |
| 2345 | return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old; |
| 2346 | } |
| 2347 | case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) { |
| 2348 | return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new; |
| 2349 | } |
| 2350 | case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) { |
| 2351 | return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI; |
| 2352 | } |
| 2353 | case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) { |
| 2354 | return pdu.pDU_BSSGP_BVC_BLOCK.bVCI; |
| 2355 | } |
| 2356 | case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) { |
| 2357 | return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI; |
| 2358 | } |
| 2359 | case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) { |
| 2360 | return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI; |
| 2361 | } |
| 2362 | case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) { |
| 2363 | return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI; |
| 2364 | } |
| 2365 | case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) { |
| 2366 | return pdu.pDU_BSSGP_BVC_RESET.bVCI; |
| 2367 | } |
| 2368 | case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) { |
| 2369 | return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI; |
| 2370 | } |
| 2371 | case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) { |
| 2372 | return pdu.pDU_BSSGP_STATUS.bVCI; |
| 2373 | } |
| 2374 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) { |
| 2375 | return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI; |
| 2376 | } |
| 2377 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) { |
| 2378 | return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI; |
| 2379 | } |
| 2380 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) { |
| 2381 | return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI; |
| 2382 | } |
| 2383 | case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) { |
| 2384 | return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI; |
| 2385 | } |
| 2386 | case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) { |
| 2387 | return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI; |
| 2388 | } |
| 2389 | case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) { |
| 2390 | return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI; |
| 2391 | } |
| 2392 | case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) { |
| 2393 | return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI; |
| 2394 | } |
| 2395 | case else { |
| 2396 | return omit; |
| 2397 | } |
| 2398 | } |
| 2399 | } |
Harald Welte | 8f66af1 | 2020-11-12 17:27:58 +0100 | [diff] [blame] | 2400 | |
Daniel Willmann | 670bbc0 | 2020-11-19 16:39:39 +0100 | [diff] [blame] | 2401 | /* extract the BVCI IE of given PDU + convert it to integer value */ |
| 2402 | function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci { |
| 2403 | var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu); |
| 2404 | if (istemplatekind(bvci_raw, "omit")) { |
| 2405 | return omit; |
| 2406 | } |
| 2407 | return oct2int(valueof(bvci_raw.unstructured_value)); |
| 2408 | } |
| 2409 | |
| 2410 | /* 3GPP TS 23.003 2.6 */ |
| 2411 | type enumerated TlliType { |
| 2412 | TLLI_LOCAL, |
| 2413 | TLLI_FOREIGN, |
| 2414 | TLLI_RANDOM, |
| 2415 | TLLI_AUXILIARY, |
| 2416 | TLLI_RESERVED, |
| 2417 | TLLI_G_RNTI, |
| 2418 | TLLI_RAND_G_RNTI |
| 2419 | } |
| 2420 | |
| 2421 | /* 3GPP TS 23.003 2.6 */ |
| 2422 | function f_gprs_tlli_type(OCT4 tlli) return TlliType { |
| 2423 | var bitstring tllib := oct2bit(tlli); |
| 2424 | if (substr(tllib, 0, 2) == '11'B) { |
| 2425 | return TLLI_LOCAL; |
| 2426 | } else if (substr(tllib, 0, 2) == '10'B) { |
| 2427 | return TLLI_FOREIGN; |
| 2428 | } else if (substr(tllib, 0, 5) == '01111'B) { |
| 2429 | return TLLI_RANDOM; |
| 2430 | } else if (substr(tllib, 0, 4) == '0110'B) { |
| 2431 | return TLLI_RESERVED; |
| 2432 | } else if (substr(tllib, 0, 3) == '010'B) { |
| 2433 | return TLLI_RESERVED; |
| 2434 | } else if (substr(tllib, 0, 4) == '0000'B) { |
| 2435 | return TLLI_G_RNTI; |
| 2436 | } else if (substr(tllib, 0, 4) == '0001'B) { |
| 2437 | return TLLI_RAND_G_RNTI; |
| 2438 | } else { |
| 2439 | setverdict(fail, "Unknonw TLLI Type ", tllib); |
| 2440 | mtc.stop; |
| 2441 | } |
| 2442 | } |
| 2443 | |
| 2444 | function f_gprs_tlli_random() return OCT4 { |
| 2445 | var OCT4 tlli := f_rnd_octstring(4); |
| 2446 | return tlli or4b 'c0000000'O; |
| 2447 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 2448 | |
| 2449 | } with { encode "RAW" }; |