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 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 164 | template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := { |
| 165 | iEI := '01'O, |
| 166 | ext := '1'B, |
| 167 | lengthIndicator := { |
| 168 | length1 := 2 |
| 169 | }, |
| 170 | nS_VCI := int2oct(nsvci, 2) |
| 171 | } |
| 172 | template NS_VCI tr_NS_IE_NSVCI(template Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 173 | iEI := '01'O, |
| 174 | ext := '1'B, |
| 175 | lengthIndicator := { |
| 176 | length1 := 2 |
| 177 | }, |
| 178 | nS_VCI := f_oct_or_wc(nsvci, 2) |
| 179 | } |
| 180 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 181 | template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := { |
| 182 | iEI:= '04'O, |
| 183 | ext := '1'B, |
| 184 | lengthIndicator := { |
| 185 | length1 := 2 |
| 186 | }, |
| 187 | nSEI := int2oct(nsei, 2) |
| 188 | } |
| 189 | template NSEI_NS tr_NS_IE_NSEI(template Nsei nsei) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 190 | iEI:= '04'O, |
| 191 | ext := '1'B, |
| 192 | lengthIndicator := { |
| 193 | length1 := 2 |
| 194 | }, |
| 195 | nSEI := f_oct_or_wc(nsei, 2) |
| 196 | } |
| 197 | |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 198 | template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port, |
| 199 | uint8_t sig_weight := 1, uint8_t data_weight := 1) := { |
| 200 | ipAddress := f_inet_addr(ip), |
| 201 | uDP_Port := int2oct(udp_port, 2), |
| 202 | signallingWeight := int2oct(sig_weight, 1), |
| 203 | dataWeight := int2oct(data_weight, 1) |
| 204 | } |
| 205 | function tr_SNS_IPv4(template charstring ip, template integer udp_port, |
| 206 | template uint8_t sig_weight := ?, template uint8_t data_weight := ?) |
| 207 | return template IP4_Element { |
| 208 | var template IP4_Element e; |
| 209 | if (istemplatekind(ip, "?")) { |
| 210 | e.ipAddress := ?; |
| 211 | } else { |
| 212 | e.ipAddress := f_inet_addr(valueof(ip)); |
| 213 | } |
| 214 | if (istemplatekind(udp_port, "?")) { |
| 215 | e.uDP_Port := ?; |
| 216 | } else { |
| 217 | e.uDP_Port := int2oct(valueof(udp_port), 2); |
| 218 | } |
| 219 | if (istemplatekind(sig_weight, "?")) { |
| 220 | e.signallingWeight := ?; |
| 221 | } else { |
| 222 | e.signallingWeight := int2oct(valueof(sig_weight), 1); |
| 223 | } |
| 224 | if (istemplatekind(data_weight, "?")) { |
| 225 | e.dataWeight := ?; |
| 226 | } else { |
| 227 | e.dataWeight := int2oct(valueof(data_weight), 1); |
| 228 | } |
| 229 | return e; |
| 230 | } |
| 231 | |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 232 | template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port, |
| 233 | uint8_t sig_weight := 1, uint8_t data_weight := 1) := { |
| 234 | ipAddress := f_inet6_addr(ip), |
| 235 | uDP_Port := int2oct(udp_port, 2), |
| 236 | signallingWeight := int2oct(sig_weight, 1), |
| 237 | dataWeight := int2oct(data_weight, 1) |
| 238 | } |
| 239 | function tr_SNS_IPv6(template charstring ip, template integer udp_port, |
| 240 | template uint8_t sig_weight := ?, template uint8_t data_weight := ?) |
| 241 | return template IP6_Element { |
| 242 | var template IP6_Element e; |
| 243 | if (istemplatekind(ip, "?")) { |
| 244 | e.ipAddress := ?; |
| 245 | } else { |
| 246 | e.ipAddress := f_inet6_addr(valueof(ip)); |
| 247 | } |
| 248 | if (istemplatekind(udp_port, "?")) { |
| 249 | e.uDP_Port := ?; |
| 250 | } else { |
| 251 | e.uDP_Port := int2oct(valueof(udp_port), 2); |
| 252 | } |
| 253 | if (istemplatekind(sig_weight, "?")) { |
| 254 | e.signallingWeight := ?; |
| 255 | } else { |
| 256 | e.signallingWeight := int2oct(valueof(sig_weight), 1); |
| 257 | } |
| 258 | if (istemplatekind(data_weight, "?")) { |
| 259 | e.dataWeight := ?; |
| 260 | } else { |
| 261 | e.dataWeight := int2oct(valueof(data_weight), 1); |
| 262 | } |
| 263 | return e; |
| 264 | } |
| 265 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 266 | |
| 267 | 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] | 268 | pDU_NS_Reset := { |
| 269 | nsPduType := '02'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 270 | causeNS := ts_NS_IE_CAUSE(cause), |
| 271 | nS_VCI := ts_NS_IE_NSVCI(nsvci), |
| 272 | nSEI_NS := ts_NS_IE_NSEI(nsei) |
| 273 | } |
| 274 | } |
| 275 | template PDU_NS tr_NS_RESET(template NsCause cause, template Nsvci nsvci, template Nsei nsei) := { |
| 276 | pDU_NS_Reset := { |
| 277 | nsPduType := '02'O, |
| 278 | causeNS := tr_NS_IE_CAUSE(cause), |
| 279 | nS_VCI := tr_NS_IE_NSVCI(nsvci), |
| 280 | nSEI_NS := tr_NS_IE_NSEI(nsei) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 284 | template (value) PDU_NS ts_NS_RESET_ACK(Nsvci nsvci, Nsei nsei) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 285 | pDU_NS_Reset_Ack := { |
| 286 | nsPduType := '03'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 287 | nS_VCI := ts_NS_IE_NSVCI(nsvci), |
| 288 | nSEI_NS := ts_NS_IE_NSEI(nsei) |
| 289 | } |
| 290 | } |
| 291 | template PDU_NS tr_NS_RESET_ACK(template Nsvci nsvci, template Nsei nsei) := { |
| 292 | pDU_NS_Reset_Ack := { |
| 293 | nsPduType := '03'O, |
| 294 | nS_VCI := tr_NS_IE_NSVCI(nsvci), |
| 295 | nSEI_NS := tr_NS_IE_NSEI(nsei) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 296 | } |
| 297 | } |
| 298 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 299 | template (value) PDU_NS ts_NS_BLOCK(NsCause cause, Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 300 | pDU_NS_Block := { |
| 301 | nsPduType := '04'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 302 | causeNS := ts_NS_IE_CAUSE(cause), |
| 303 | nS_VCI := ts_NS_IE_NSVCI(nsvci) |
| 304 | } |
| 305 | } |
| 306 | template PDU_NS tr_NS_BLOCK(template NsCause cause, template Nsvci nsvci) := { |
| 307 | pDU_NS_Block := { |
| 308 | nsPduType := '04'O, |
| 309 | causeNS := tr_NS_IE_CAUSE(cause), |
| 310 | nS_VCI := tr_NS_IE_NSVCI(nsvci) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 311 | } |
| 312 | } |
| 313 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 314 | template (value) PDU_NS ts_NS_BLOCK_ACK(Nsvci nsvci) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 315 | pDU_NS_Block_Ack := { |
| 316 | nsPduType := '05'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 317 | nS_VCI := ts_NS_IE_NSVCI(nsvci) |
| 318 | } |
| 319 | } |
| 320 | template PDU_NS tr_NS_BLOCK_ACK(template Nsvci nsvci) := { |
| 321 | pDU_NS_Block_Ack := { |
| 322 | nsPduType := '05'O, |
| 323 | nS_VCI := tr_NS_IE_NSVCI(nsvci) |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 324 | } |
| 325 | } |
| 326 | |
| 327 | template PDU_NS t_NS_UNBLOCK := { |
| 328 | pDU_NS_Unblock := { |
| 329 | nsPduType := '06'O |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | template PDU_NS t_NS_UNBLOCK_ACK := { |
| 334 | pDU_NS_Unblock_Ack := { |
| 335 | nsPduType := '07'O |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | template PDU_NS t_NS_ALIVE := { |
| 340 | pDU_NS_Alive := { |
| 341 | nsPduType := '0A'O |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | template PDU_NS t_NS_ALIVE_ACK := { |
| 346 | pDU_NS_Alive_Ack := { |
| 347 | nsPduType := '0B'O |
| 348 | } |
| 349 | } |
| 350 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 351 | template (value) PDU_NS ts_NS_STATUS(NsCause cause, PDU_NS pdu) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 352 | pDU_NS_Status := { |
| 353 | nsPduType := '08'O, |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 354 | causeNS := ts_NS_IE_CAUSE(cause), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 355 | nS_VCI := omit, |
| 356 | nS_PDU := { |
| 357 | iEI := '02'O, |
| 358 | ext := '1'B, |
| 359 | lengthIndicator := { |
| 360 | length1 := 0 /* overwritten */ |
| 361 | }, |
| 362 | ns_PDU := enc_PDU_NS(pdu) |
| 363 | }, |
| 364 | bVCI_NS := omit, |
| 365 | listofIP4Elements := omit, |
| 366 | listofIP6Elements := omit |
| 367 | } |
| 368 | } |
| 369 | |
Alexander Couzens | 9843b66 | 2020-09-07 05:20:54 +0200 | [diff] [blame] | 370 | template PDU_NS tr_NS_STATUS(template NsCause cause) := { |
| 371 | pDU_NS_Status := { |
| 372 | nsPduType := '08'O, |
| 373 | causeNS := tr_NS_IE_CAUSE(cause), |
| 374 | nS_VCI := *, |
| 375 | nS_PDU := *, |
| 376 | bVCI_NS := *, |
| 377 | listofIP4Elements := *, |
| 378 | listofIP6Elements := * |
| 379 | } |
| 380 | } |
| 381 | |
Harald Welte | 387ab37 | 2018-06-30 10:27:06 +0200 | [diff] [blame] | 382 | template (value) PDU_NS ts_NS_UNITDATA(template (value) NS_SDU_ControlBits bits, BssgpBvci bvci, octetstring sdu) := { |
| 383 | pDU_NS_Unitdata := { |
| 384 | nsPduType := '00'O, |
| 385 | nS_SDU_ControlBits := bits, |
| 386 | bVCI := int2oct(bvci, 2), |
| 387 | nS_SDU := sdu |
| 388 | } |
| 389 | } |
| 390 | 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] | 391 | octetstring sdu) := { |
| 392 | pDU_NS_Unitdata := { |
| 393 | nsPduType := '00'O, |
| 394 | nS_SDU_ControlBits := bits, |
| 395 | bVCI := f_oct_or_wc(bvci, 2), |
| 396 | nS_SDU := sdu |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 401 | |
| 402 | private function ts_num_of_ep(OCT1 iei, template (omit) uint16_t num_ep) |
| 403 | return template (omit) NumberOfIP_Endpoints { |
| 404 | var template (omit) NumberOfIP_Endpoints t; |
| 405 | if (istemplatekind(num_ep, "omit")) { |
| 406 | return omit; |
| 407 | } else { |
| 408 | t.iEI := iei; |
| 409 | t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2); |
| 410 | return t; |
| 411 | } |
| 412 | } |
| 413 | private function tr_num_of_ep(OCT1 iei, template uint16_t num_ep) |
| 414 | return template NumberOfIP_Endpoints { |
| 415 | var template NumberOfIP_Endpoints t; |
| 416 | if (istemplatekind(num_ep, "omit")) { |
| 417 | return omit; |
| 418 | } else if (istemplatekind(num_ep, "*")) { |
| 419 | return *; |
| 420 | } else if (istemplatekind(num_ep, "?")) { |
| 421 | return ?; |
| 422 | } else { |
| 423 | t.iEI := iei; |
| 424 | t.numberOfIP_Endpoints := int2oct(valueof(num_ep), 2); |
| 425 | return t; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | |
| 430 | template (value) ResetFlag ts_SNS_IE_ResetFlag(boolean rst) := { |
| 431 | iEI := '0A'O, |
| 432 | resetBIT := bool2bit(rst), |
| 433 | spare := '0000000'B |
| 434 | } |
| 435 | template ResetFlag tr_SNS_IE_ResetFlag(template boolean rst) := { |
| 436 | iEI := '0A'O, |
| 437 | resetBIT := bool2bit_tmpl(rst), |
| 438 | spare := '0000000'B |
| 439 | } |
| 440 | |
| 441 | template (value) EndFlag ts_SNS_IE_EndFlag(boolean end) := { |
| 442 | eBIT := bool2bit(end), |
| 443 | spare := '0000000'B |
| 444 | } |
| 445 | template EndFlag tr_SNS_IE_EndFlag(template boolean end) := { |
| 446 | eBIT := bool2bit_tmpl(end), |
| 447 | spare := '0000000'B |
| 448 | } |
| 449 | |
| 450 | template (value) MaxNumberOfNSVCs ts_SNS_IE_MaxNumOfNSVCs(uint16_t num) := { |
| 451 | iEI := '07'O, |
| 452 | maxNumberOfNSVCs := int2oct(num, 2) |
| 453 | } |
| 454 | template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := { |
| 455 | iEI := '07'O, |
| 456 | maxNumberOfNSVCs := f_oct_or_wc(num, 2) |
| 457 | } |
| 458 | |
| 459 | template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true, |
| 460 | uint16_t max_nsvcs := 2, |
| 461 | template (omit) uint16_t num_v4 := 1, |
| 462 | template (omit) uint16_t num_v6 := omit) := { |
| 463 | pDU_SNS_Size := { |
| 464 | nsPduType := '12'O, |
| 465 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 466 | resetFlag := ts_SNS_IE_ResetFlag(rst_flag), |
| 467 | maxNumberOfNSVCs := ts_SNS_IE_MaxNumOfNSVCs(max_nsvcs), |
| 468 | numberOfIP4_Endpoints := ts_num_of_ep('08'O, num_v4), |
| 469 | numberOfIP6_Endpoints := ts_num_of_ep('09'O, num_v6) |
| 470 | } |
| 471 | } |
| 472 | template PDU_NS tr_SNS_SIZE(template Nsei nsei, template boolean rst_flag := ?, |
| 473 | template uint16_t max_nsvcs := ?, |
| 474 | template uint16_t num_v4 := ?, |
| 475 | template uint16_t num_v6 := *) := { |
| 476 | pDU_SNS_Size := { |
| 477 | nsPduType := '12'O, |
| 478 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 479 | resetFlag := tr_SNS_IE_ResetFlag(rst_flag), |
| 480 | maxNumberOfNSVCs := tr_SNS_IE_MaxNumOfNSVCs(max_nsvcs), |
| 481 | numberOfIP4_Endpoints := tr_num_of_ep('08'O, num_v4), |
| 482 | numberOfIP6_Endpoints := tr_num_of_ep('09'O, num_v6) |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | template PDU_NS ts_SNS_SIZE_ACK(Nsei nsei, template (omit) NsCause cause) := { |
| 487 | pDU_SNS_Size_Ack := { |
| 488 | nsPduType := '13'O, |
| 489 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 490 | causeNS := ts_NS_IE_CAUSE_omit(cause) |
| 491 | } |
| 492 | } |
| 493 | template PDU_NS tr_SNS_SIZE_ACK(template Nsei nsei, template NsCause cause) := { |
| 494 | pDU_SNS_Size_Ack := { |
| 495 | nsPduType := '13'O, |
| 496 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 497 | causeNS := tr_NS_IE_CAUSE(cause) |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | private function ts_SNS_IE_ListIP4(template (omit) IP4_Elements elem) |
| 502 | return template (omit) ListofIP4Elements { |
| 503 | var template (omit) ListofIP4Elements r; |
| 504 | if (istemplatekind(elem, "omit")) { |
| 505 | return omit; |
| 506 | } else { |
| 507 | r := { |
| 508 | iEI := '05'O, |
| 509 | ext := '1'B, |
| 510 | lengthIndicator := { |
| 511 | length1 := 0 /* overwritten */ |
| 512 | }, |
| 513 | iP4_Elements := elem |
| 514 | } |
| 515 | return r; |
| 516 | } |
| 517 | } |
| 518 | private function tr_SNS_IE_ListIP4(template IP4_Elements elem) |
| 519 | return template ListofIP4Elements { |
| 520 | var template ListofIP4Elements r; |
| 521 | if (istemplatekind(elem, "omit")) { |
| 522 | return omit; |
| 523 | } else { |
| 524 | r := { |
| 525 | iEI := '05'O, |
| 526 | ext := '1'B, |
| 527 | lengthIndicator := { |
| 528 | length1 := ? /* overwritten */ |
| 529 | }, |
| 530 | iP4_Elements := elem |
| 531 | } |
| 532 | return r; |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | private function ts_SNS_IE_ListIP6(template (omit) IP6_Elements elem) |
| 537 | return template (omit) ListofIP6Elements { |
| 538 | var template (omit) ListofIP6Elements r; |
| 539 | if (istemplatekind(elem, "omit")) { |
| 540 | return omit; |
| 541 | } else { |
| 542 | r := { |
| 543 | iEI := '06'O, |
| 544 | ext := '1'B, |
| 545 | lengthIndicator := { |
| 546 | length1 := 0 /* overwritten */ |
| 547 | }, |
| 548 | iP6_Elements := elem |
| 549 | } |
| 550 | return r; |
| 551 | } |
| 552 | } |
| 553 | private function tr_SNS_IE_ListIP6(template IP6_Elements elem) |
| 554 | return template ListofIP6Elements { |
| 555 | var template ListofIP6Elements r; |
| 556 | if (istemplatekind(elem, "omit")) { |
| 557 | return omit; |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 558 | } else if (istemplatekind(elem, "*")) { |
| 559 | return *; |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 560 | } else { |
| 561 | r := { |
| 562 | iEI := '06'O, |
| 563 | ext := '1'B, |
| 564 | lengthIndicator := { |
| 565 | length1 := ? /* overwritten */ |
| 566 | }, |
| 567 | iP6_Elements := elem |
| 568 | } |
| 569 | return r; |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 574 | template (omit) IP4_Elements v4 := omit, |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 575 | template (omit) IP6_Elements v6 := omit) := { |
| 576 | pDU_SNS_Config := { |
| 577 | nsPduType := '0F'O, |
| 578 | endFlag := ts_SNS_IE_EndFlag(end_flag), |
| 579 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 580 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 581 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 582 | } |
| 583 | } |
| 584 | 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] | 585 | template IP4_Elements v4 := omit, |
Harald Welte | f4bf131 | 2018-06-30 11:05:20 +0200 | [diff] [blame] | 586 | template IP6_Elements v6 := omit) := { |
| 587 | pDU_SNS_Config := { |
| 588 | nsPduType := '0F'O, |
| 589 | endFlag := tr_SNS_IE_EndFlag(end_flag), |
| 590 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 591 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 592 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | template (value) PDU_NS ts_SNS_CONFIG_ACK(Nsei nsei, template (omit) NsCause cause) := { |
| 597 | pDU_SNS_Config_Ack := { |
| 598 | nsPduType := '10'O, |
| 599 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 600 | causeNS := ts_NS_IE_CAUSE_omit(cause) |
| 601 | } |
| 602 | } |
| 603 | template PDU_NS tr_SNS_CONFIG_ACK(template Nsei nsei, template NsCause cause) := { |
| 604 | pDU_SNS_Config_Ack := { |
| 605 | nsPduType := '10'O, |
| 606 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 607 | causeNS := tr_NS_IE_CAUSE(cause) |
| 608 | } |
| 609 | } |
| 610 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 611 | template (value) PDU_NS ts_SNS_ADD(Nsei nsei, uint8_t trans_id, |
| 612 | template (omit) IP4_Elements v4, |
| 613 | template (omit) IP6_Elements v6 := omit) := { |
| 614 | pDU_SNS_Add := { |
| 615 | nsPduType := '0D'O, |
| 616 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 617 | transactionID := trans_id, |
| 618 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 619 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 620 | } |
| 621 | } |
| 622 | template PDU_NS tr_SNS_ADD(template Nsei nsei, template uint8_t trans_id, |
| 623 | template IP4_Elements v4, |
| 624 | template IP6_Elements v6 := omit) := { |
| 625 | pDU_SNS_Add := { |
| 626 | nsPduType := '0D'O, |
| 627 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 628 | transactionID := trans_id, |
| 629 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 630 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | template (value) PDU_NS ts_SNS_DEL(Nsei nsei, uint8_t trans_id, |
| 635 | template (omit) IPAddress ip_sns, |
| 636 | template (omit) IP4_Elements v4, |
| 637 | template (omit) IP6_Elements v6 := omit) := { |
| 638 | pDU_SNS_Delete := { |
| 639 | nsPduType := '11'O, |
| 640 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 641 | transactionID := trans_id, |
| 642 | iP_Address_NS := ts_SNS_IP_ADDR(ip_sns), |
| 643 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 644 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 645 | } |
| 646 | } |
| 647 | template PDU_NS tr_SNS_DEL(template Nsei nsei, template uint8_t trans_id, |
| 648 | template IPAddress ip_sns, |
| 649 | template IP4_Elements v4, |
| 650 | template IP6_Elements v6 := omit) := { |
| 651 | pDU_SNS_Delete := { |
| 652 | nsPduType := '11'O, |
| 653 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 654 | transactionID := trans_id, |
| 655 | iP_Address_NS := tr_SNS_IP_ADDR(ip_sns), |
| 656 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 657 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 658 | } |
| 659 | } |
| 660 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 661 | template (value) PDU_NS ts_SNS_CHG_WEIGHT(Nsei nsei, uint8_t trans_id, |
| 662 | template (omit) IP4_Elements v4, |
| 663 | template (omit) IP6_Elements v6 := omit) := { |
| 664 | pDU_SNS_ChangeWeight := { |
| 665 | nsPduType := '0E'O, |
| 666 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 667 | transactionID := trans_id, |
| 668 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 669 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 670 | } |
| 671 | } |
| 672 | template PDU_NS tr_SNS_CHG_WEIGHT(template Nsei nsei, template uint8_t trans_id, |
| 673 | template IP4_Elements v4, |
| 674 | template IP6_Elements v6 := omit) := { |
| 675 | pDU_SNS_ChangeWeight := { |
| 676 | nsPduType := '0E'O, |
| 677 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 678 | transactionID := trans_id, |
| 679 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 680 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 681 | } |
| 682 | } |
| 683 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 684 | |
| 685 | template (value) PDU_NS ts_SNS_ACK(Nsei nsei, uint8_t trans_id, |
| 686 | template (omit) NsCause cause := omit, |
| 687 | template (omit) IP4_Elements v4 := omit, |
| 688 | template (omit) IP6_Elements v6 := omit) := { |
| 689 | pDU_SNS_Ack := { |
| 690 | nsPduType := '0C'O, |
| 691 | nSEI_NS := ts_NS_IE_NSEI(nsei), |
| 692 | transactionID := trans_id, |
| 693 | causeNS := ts_NS_IE_CAUSE_omit(cause), |
| 694 | iP_Address_NS := omit, |
| 695 | listofIP4Elements := ts_SNS_IE_ListIP4(v4), |
| 696 | listofIP6Elements := ts_SNS_IE_ListIP6(v6) |
| 697 | } |
| 698 | } |
| 699 | template PDU_NS tr_SNS_ACK(template Nsei nsei, template uint8_t trans_id := ?, |
| 700 | template NsCause cause := omit, |
| 701 | template IP4_Elements v4 := *, |
| 702 | template IP6_Elements v6 := *) := { |
| 703 | pDU_SNS_Ack := { |
| 704 | nsPduType := '0C'O, |
| 705 | nSEI_NS := tr_NS_IE_NSEI(nsei), |
| 706 | transactionID := trans_id, |
| 707 | causeNS := tr_NS_IE_CAUSE(cause), |
| 708 | iP_Address_NS := omit, |
| 709 | listofIP4Elements := tr_SNS_IE_ListIP4(v4), |
| 710 | listofIP6Elements := tr_SNS_IE_ListIP6(v6) |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 720 | type record BssgpCellId { |
| 721 | RoutingAreaIdentification ra_id, |
| 722 | CellIdentity cell_id |
| 723 | } with { variant "" }; |
| 724 | |
| 725 | type enumerated BssgpCause { |
| 726 | BSSGP_CAUSE_PROC_OVERLOAD ('00'H), |
| 727 | BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H), |
| 728 | BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE ('02'H), |
| 729 | BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS ('03'H), |
| 730 | BSSGP_CAUSE_UNKNOWN_MS ('04'H), |
| 731 | BSSGP_CAUSE_BVCI_UNKNOWN ('05'H), |
| 732 | BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION ('06'H), |
| 733 | BSSGP_CAUSE_SGSN_CONGESTION ('07'H), |
| 734 | BSSGP_CAUSE_OM_INTERVENTION ('08'H), |
| 735 | BSSGP_CAUSE_BVCI_BLOCKED ('09'H), |
| 736 | BSSGP_CAUSE_PFC_CREATE_FAILURE ('0a'H), |
| 737 | BSSGP_CAUSE_PFC_PREEMPTED ('0b'H), |
| 738 | BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED ('0c'H), |
| 739 | BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU ('20'H), |
| 740 | BSSGP_CAUSE_INVALID_MANDATORY_IE ('21'H), |
| 741 | BSSGP_CAUSE_MISSING_MANDATORY_IE ('22'H), |
| 742 | BSSGP_CAUSE_MISSING_CONDITIONAL_IE ('23'H), |
| 743 | BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE ('24'H), |
| 744 | BSSGP_CAUSE_CONDITIONAL_IE_ERROR ('25'H), |
| 745 | BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('26'H), |
| 746 | BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('27'H), |
| 747 | BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET ('28'H), |
| 748 | BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE ('29'H), |
| 749 | BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS ('2a'H), |
| 750 | BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY ('2b'H), |
| 751 | BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO ('2c'H), |
| 752 | BSSGP_CAUSE_PFC_QUEUING ('2d'H), |
| 753 | BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY ('2e'H), |
| 754 | BSSGP_CAUSE_T12_EXPIRY ('2f'H), |
| 755 | BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT ('30'H), |
| 756 | BSSGP_CAUSE_UPLINK_QUALITY ('31'H), |
| 757 | BSSGP_CAUSE_UPLINK_STRENGTH ('32'H), |
| 758 | BSSGP_CAUSE_DOWNLINK_QUALITY ('33'H), |
| 759 | BSSGP_CAUSE_DOWNLINK_STRENGTH ('34'H), |
| 760 | BSSGP_CAUSE_DISTANCE ('35'H), |
| 761 | BSSGP_CAUSE_BETTER_CELL ('36'H), |
| 762 | BSSGP_CAUSE_TRAFFIC ('37'H), |
| 763 | BSSGP_CAUSE_OM_INTERVENTION2 ('38'H), |
| 764 | BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL ('39'H), |
| 765 | BSSGP_CAUSE_T13_EXPIRY ('3a'H), |
| 766 | BSSGP_CAUSE_T14_EXPIRY ('3b'H), |
| 767 | BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H) |
| 768 | } with { variant "FIELDLENGTH(8)" }; |
| 769 | |
| 770 | |
| 771 | template BVCI t_BSSGP_BVCI(template BssgpBvci bvci) := { |
| 772 | iEI := '04'O, |
| 773 | ext := '1'B, |
| 774 | lengthIndicator := { |
| 775 | length1 := 2 |
| 776 | }, |
| 777 | unstructured_value := f_oct_or_wc(bvci, 2) |
| 778 | } |
| 779 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 780 | template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli tlli) := { |
| 781 | iEI := '1F'O, |
| 782 | ext := '1'B, |
| 783 | lengthIndicator := { |
| 784 | length1 := 4 |
| 785 | }, |
| 786 | tLLI_Value := tlli |
| 787 | } |
| 788 | template TLLI_BSSGP tr_BSSGP_TLLI(template GprsTlli tlli) := { |
| 789 | iEI := '1F'O, |
| 790 | ext := '1'B, |
| 791 | lengthIndicator := { |
| 792 | length1 := 4 |
| 793 | }, |
| 794 | tLLI_Value := tlli |
| 795 | } |
| 796 | |
| 797 | template (value) Suspend_Reference_Number ts_BSSGP_SUSP_REF(template (value) OCT1 susp_ref) := { |
| 798 | iEI := '1D'O, |
| 799 | ext := '1'B, |
| 800 | lengthIndicator := { |
| 801 | length1 := 1 |
| 802 | }, |
| 803 | suspend_Reference_Number_value := susp_ref |
| 804 | } |
| 805 | template Suspend_Reference_Number tr_BSSGP_SUSP_REF(template OCT1 susp_ref) := { |
| 806 | iEI := '1D'O, |
| 807 | ext := '1'B, |
| 808 | lengthIndicator := { |
| 809 | length1 := 1 |
| 810 | }, |
| 811 | suspend_Reference_Number_value := susp_ref |
| 812 | } |
| 813 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 814 | template IMSI_BSSGP tr_BSSGP_IMSI(template hexstring imsi) := { |
| 815 | iEI := '0D'O, |
| 816 | ext := '1'B, |
| 817 | lengthIndicator := ?, |
| 818 | type_of_Identity := '001'B, |
| 819 | oddevenIndicator := ?, |
| 820 | digits := imsi |
| 821 | } |
| 822 | |
| 823 | template IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := { |
| 824 | iEI := '0D'O, |
| 825 | ext := '1'B, |
| 826 | lengthIndicator := { length1 := 0 /* overwritten */ }, |
| 827 | type_of_Identity := '001'B, |
| 828 | oddevenIndicator := f_hex_is_odd_length(imsi), |
| 829 | digits := imsi |
| 830 | } |
| 831 | |
| 832 | template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := { |
| 833 | iEI := '20'O, |
| 834 | ext := '1'B, |
| 835 | lengthIndicator := { length1 := 4 }, |
| 836 | tMSI_Value := int2oct(tmsi, 4) |
| 837 | } |
| 838 | |
| 839 | function f_bssgp_length_ind(integer len) return LIN2_2a { |
| 840 | var LIN2_2a ret; |
| 841 | if (len > 255) { |
| 842 | ret := { length2 := len }; |
| 843 | } else { |
| 844 | ret := { length1 := len }; |
| 845 | } |
| 846 | return ret; |
| 847 | } |
| 848 | |
| 849 | template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := { |
| 850 | iEI := '0D'O, |
| 851 | ext := '1'B, |
| 852 | lengthIndicator := f_bssgp_length_ind(lengthof(pdu)), |
| 853 | lLC_PDU := pdu |
| 854 | } |
| 855 | |
| 856 | template LLC_PDU tr_BSSGP_LLC_PDU(template octetstring pdu := ?) := { |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 857 | iEI := '0E'O, |
| 858 | ext := ?, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 859 | lengthIndicator := ?, |
| 860 | lLC_PDU := pdu |
| 861 | } |
| 862 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 863 | function ts_BSSGP_CAUSE(template (omit) BssgpCause cause) return template (omit) Cause_BSSGP { |
| 864 | var template (omit) Cause_BSSGP ret; |
| 865 | if (istemplatekind(cause, "omit")) { |
| 866 | ret := omit; |
| 867 | } else { |
| 868 | ret.iEI := '07'O; |
| 869 | ret.ext := '1'B; |
| 870 | ret.lengthIndicator := { length1 := 1 }; |
| 871 | ret.cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 872 | } |
| 873 | return ret; |
| 874 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 875 | function t_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP { |
| 876 | var template Cause_BSSGP ret; |
Harald Welte | bacca28 | 2018-03-02 16:03:59 +0100 | [diff] [blame] | 877 | ret.iEI := '07'O; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 878 | ret.ext := '1'B; |
| 879 | ret.lengthIndicator := { length1 := 1 }; |
| 880 | if (isvalue(cause)) { |
| 881 | ret.cause_Value := int2oct(enum2int(valueof(cause)), 1); |
| 882 | } else { |
| 883 | ret.cause_Value := ? |
| 884 | } |
| 885 | return ret; |
| 886 | } |
| 887 | |
| 888 | function t_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier { |
| 889 | var template Cell_Identifier ret := { |
| 890 | iEI := '08'O, |
| 891 | ext := '1'B, |
| 892 | lengthIndicator := { length1 := 8 }, |
| 893 | mccDigit1 := ?, |
| 894 | mccDigit2 := ?, |
| 895 | mccDigit3 := ?, |
| 896 | mncDigit3 := ?, |
| 897 | mncDigit1 := ?, |
| 898 | mncDigit2 := ?, |
| 899 | lac := ?, |
| 900 | rac := ?, |
| 901 | cI_value := ? |
| 902 | } |
| 903 | if (istemplatekind(cid, "omit")) { |
| 904 | return omit; |
| 905 | } else if (istemplatekind(cid, "*")) { |
| 906 | return *; |
| 907 | } else if (istemplatekind(cid, "?")) { |
| 908 | return ?; |
| 909 | } |
| 910 | if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { |
| 911 | if (isvalue(cid.ra_id.lai.mcc_mnc)) { |
| 912 | ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; |
| 913 | ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; |
| 914 | ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; |
Harald Welte | 797ab3a | 2019-03-21 21:33:28 +0100 | [diff] [blame] | 915 | ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; |
Harald Welte | 797ab3a | 2019-03-21 21:33:28 +0100 | [diff] [blame] | 916 | ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; |
Alexander Couzens | c7dddbd | 2019-04-11 19:18:35 +0200 | [diff] [blame] | 917 | ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 918 | } |
| 919 | if (isvalue(cid.ra_id.lai.lac)) { |
| 920 | ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); |
| 921 | } |
| 922 | } |
| 923 | if (isvalue(cid) and isvalue(cid.ra_id)) { |
| 924 | ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); |
| 925 | } |
| 926 | if (isvalue(cid)) { |
| 927 | ret.cI_value := f_oct_or_wc(cid.cell_id, 2); |
| 928 | } |
| 929 | return ret; |
| 930 | } |
| 931 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 932 | template (value) Tag ts_BSSGP_IE_Tag(OCT1 tag) := { |
| 933 | iEI := '1E'O, |
| 934 | ext := '1'B, |
| 935 | lengthIndicator := { |
| 936 | length1 := 1 |
| 937 | }, |
| 938 | unstructured_Value := tag |
| 939 | } |
| 940 | |
| 941 | template (present) Tag tr_BSSGP_IE_Tag(template (present) OCT1 tag) := { |
| 942 | iEI := '1E'O, |
| 943 | ext := '1'B, |
| 944 | lengthIndicator := { |
| 945 | length1 := 1 |
| 946 | }, |
| 947 | unstructured_Value := tag |
| 948 | } |
| 949 | |
| 950 | template (value) RA_Cap_UPD_CAUSE ts_BSSGP_IE_RACU_Cause(template (value) OCT1 cause) := { |
| 951 | iEI := '1A'O, |
| 952 | ext := '1'B, |
| 953 | lengthIndicator := { |
| 954 | length1 := 1 |
| 955 | }, |
| 956 | rA_CAP_UPD_Cause_value := cause |
| 957 | } |
| 958 | |
| 959 | template (present) RA_Cap_UPD_CAUSE tr_BSSGP_IE_RACU_Cause(template (present) OCT1 cause) := { |
| 960 | iEI := '1A'O, |
| 961 | ext := '1'B, |
| 962 | lengthIndicator := { |
| 963 | length1 := 1 |
| 964 | }, |
| 965 | rA_CAP_UPD_Cause_value := cause |
| 966 | } |
| 967 | |
| 968 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 969 | template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci, |
| 970 | template BssgpCellId cell_id) := { |
| 971 | pDU_BSSGP_BVC_RESET := { |
| 972 | bssgpPduType := '22'O, |
| 973 | bVCI := t_BSSGP_BVCI(bvci), |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 974 | cause := ts_BSSGP_CAUSE(cause), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 975 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 976 | feature_bitmap := omit, |
| 977 | extended_Feature_Bitmap := omit |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci, |
| 982 | template BssgpCellId cell_id) := { |
| 983 | pDU_BSSGP_BVC_RESET := { |
| 984 | bssgpPduType := '22'O, |
| 985 | bVCI := t_BSSGP_BVCI(bvci), |
| 986 | cause := t_BSSGP_CAUSE(cause), |
| 987 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 988 | feature_bitmap := *, |
| 989 | extended_Feature_Bitmap := * |
| 990 | } |
| 991 | } |
| 992 | |
| 993 | template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template BssgpCellId cell_id) := { |
| 994 | pDU_BSSGP_BVC_RESET_ACK := { |
| 995 | bssgpPduType := '23'O, |
| 996 | bVCI := t_BSSGP_BVCI(bvci), |
| 997 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 998 | feature_bitmap := omit, |
| 999 | extended_Feature_Bitmap := omit |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := { |
| 1004 | pDU_BSSGP_BVC_RESET_ACK := { |
| 1005 | bssgpPduType := '23'O, |
| 1006 | bVCI := t_BSSGP_BVCI(bvci), |
| 1007 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1008 | feature_bitmap := *, |
| 1009 | extended_Feature_Bitmap := * |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | |
| 1014 | template PDU_BSSGP t_BVC_UNBLOCK(template BssgpBvci bvci) := { |
| 1015 | pDU_BSSGP_BVC_UNBLOCK := { |
| 1016 | bssgpPduType := '24'O, |
| 1017 | bVCI := t_BSSGP_BVCI(bvci) |
| 1018 | } |
| 1019 | } |
| 1020 | |
| 1021 | template PDU_BSSGP t_BVC_UNBLOCK_ACK(template BssgpBvci bvci) := { |
| 1022 | pDU_BSSGP_BVC_UNBLOCK_ACK := { |
| 1023 | bssgpPduType := '25'O, |
| 1024 | bVCI := t_BSSGP_BVCI(bvci) |
| 1025 | } |
| 1026 | } |
| 1027 | |
| 1028 | template PDU_BSSGP t_BVC_BLOCK(template BssgpBvci bvci, template BssgpCause cause) := { |
| 1029 | pDU_BSSGP_BVC_BLOCK := { |
| 1030 | bssgpPduType := '20'O, |
| 1031 | bVCI := t_BSSGP_BVCI(bvci), |
| 1032 | cause := t_BSSGP_CAUSE(cause) |
| 1033 | } |
| 1034 | } |
| 1035 | |
| 1036 | template PDU_BSSGP t_BVC_BLOCK_ACK(template BssgpBvci bvci) := { |
| 1037 | pDU_BSSGP_BVC_BLOCK_ACK := { |
| 1038 | bssgpPduType := '21'O, |
| 1039 | bVCI := t_BSSGP_BVCI(bvci) |
| 1040 | } |
| 1041 | } |
| 1042 | |
| 1043 | template PDU_BSSGP t_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate, |
| 1044 | uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := { |
| 1045 | pDU_BSSGP_FLOW_CONTROL_BVC := { |
| 1046 | bssgpPduType := '26'O, |
| 1047 | tag := { |
| 1048 | iEI := '1E'O, |
| 1049 | ext := '1'B, |
| 1050 | lengthIndicator := { |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1051 | length1 := 1 |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1052 | }, |
| 1053 | unstructured_Value := tag |
| 1054 | }, |
| 1055 | bVC_Bucket_Size := { |
| 1056 | iEI := '05'O, |
| 1057 | ext := '1'B, |
| 1058 | lengthIndicator := { |
| 1059 | length1 := 2 |
| 1060 | }, |
| 1061 | bmax := f_oct_or_wc(bmax, 2) |
| 1062 | }, |
| 1063 | bucket_Leak_Rate := { |
| 1064 | iEI := '03'O, |
| 1065 | ext := '1'B, |
| 1066 | lengthIndicator := { |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1067 | length1 := 2 |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1068 | }, |
| 1069 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1070 | }, |
| 1071 | bmax_default_MS := { |
| 1072 | iEI := '01'O, |
| 1073 | ext := '1'B, |
| 1074 | lengthIndicator := { |
| 1075 | length1 := 2 |
| 1076 | }, |
| 1077 | bmax := f_oct_or_wc(bmax_default_ms, 2) |
| 1078 | }, |
| 1079 | r_default_MS := { |
| 1080 | iEI := '1C'O, |
| 1081 | ext := '1'B, |
| 1082 | lengthIndicator := { |
| 1083 | length1 := 2 |
| 1084 | }, |
| 1085 | r_default_MS_value := f_oct_or_wc(r_default_ms, 2) |
| 1086 | }, |
| 1087 | bucket_Full_Ratio := omit, |
| 1088 | bVC_Measurement := omit, |
| 1089 | flow_Control_Granularity := omit |
| 1090 | } |
| 1091 | } |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 1092 | template PDU_BSSGP tr_BVC_FC_BVC(template uint16_t bmax := ?, |
| 1093 | template uint16_t bucket_leak_rate := ?, |
| 1094 | template uint16_t bmax_default_ms := ?, |
| 1095 | template uint16_t r_default_ms := ?, |
| 1096 | template OCT1 tag := ?) := { |
| 1097 | pDU_BSSGP_FLOW_CONTROL_BVC := { |
| 1098 | bssgpPduType := '26'O, |
| 1099 | tag := { |
| 1100 | iEI := '1E'O, |
| 1101 | ext := '1'B, |
| 1102 | lengthIndicator := { |
| 1103 | length1 := 1 |
| 1104 | }, |
| 1105 | unstructured_Value := tag |
| 1106 | }, |
| 1107 | bVC_Bucket_Size := { |
| 1108 | iEI := '05'O, |
| 1109 | ext := '1'B, |
| 1110 | lengthIndicator := { |
| 1111 | length1 := 2 |
| 1112 | }, |
| 1113 | bmax := f_oct_or_wc(bmax, 2) |
| 1114 | }, |
| 1115 | bucket_Leak_Rate := { |
| 1116 | iEI := '03'O, |
| 1117 | ext := '1'B, |
| 1118 | lengthIndicator := { |
| 1119 | length1 := 2 |
| 1120 | }, |
| 1121 | r_Value := f_oct_or_wc(bucket_leak_rate, 2) |
| 1122 | }, |
| 1123 | bmax_default_MS := { |
| 1124 | iEI := '01'O, |
| 1125 | ext := '1'B, |
| 1126 | lengthIndicator := { |
| 1127 | length1 := 2 |
| 1128 | }, |
| 1129 | bmax := f_oct_or_wc(bmax_default_ms, 2) |
| 1130 | }, |
| 1131 | r_default_MS := { |
| 1132 | iEI := '1C'O, |
| 1133 | ext := '1'B, |
| 1134 | lengthIndicator := { |
| 1135 | length1 := 2 |
| 1136 | }, |
| 1137 | r_default_MS_value := f_oct_or_wc(r_default_ms, 2) |
| 1138 | }, |
| 1139 | bucket_Full_Ratio := *, |
| 1140 | bVC_Measurement := *, |
| 1141 | flow_Control_Granularity := * |
| 1142 | } |
| 1143 | } |
| 1144 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1145 | template PDU_BSSGP t_BVC_FC_BVC_ACK(template OCT1 tag) := { |
| 1146 | pDU_BSSGP_FLOW_CONTROL_BVC_ACK := { |
| 1147 | bssgpPduType := '27'O, |
| 1148 | tag := { |
| 1149 | iEI := '1E'O, |
| 1150 | ext := '1'B, |
| 1151 | lengthIndicator := { |
| 1152 | length1 := 2 |
| 1153 | }, |
| 1154 | unstructured_Value := tag |
| 1155 | } |
| 1156 | } |
| 1157 | } |
| 1158 | |
| 1159 | template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause, |
| 1160 | PDU_BSSGP pdu) := { |
| 1161 | pDU_BSSGP_STATUS := { |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1162 | bssgpPduType := '41'O, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1163 | cause := t_BSSGP_CAUSE(cause), |
| 1164 | bVCI := t_BSSGP_BVCI(bvci), |
| 1165 | pDU_in_Error := { |
| 1166 | iEI := '15'O, |
| 1167 | ext := '1'B, |
| 1168 | lengthIndicator := { |
| 1169 | length1 := 0 /* overwritten */ |
| 1170 | }, |
| 1171 | erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu) |
| 1172 | } |
| 1173 | } |
| 1174 | } |
| 1175 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1176 | template PDU_BSSGP tr_BSSGP_STATUS(template BVCI bvci := ?, template BssgpCause cause := ?, |
| 1177 | template octetstring pdu := ?) := { |
| 1178 | pDU_BSSGP_STATUS := { |
| 1179 | bssgpPduType := '41'O, |
| 1180 | cause := t_BSSGP_CAUSE(cause), |
| 1181 | bVCI := bvci, |
| 1182 | pDU_in_Error := { |
| 1183 | iEI := '15'O, |
| 1184 | ext := '1'B, |
| 1185 | lengthIndicator := { |
| 1186 | length1 := ? |
| 1187 | }, |
| 1188 | erroneous_BSSGP_PDU := pdu |
| 1189 | } |
| 1190 | } |
| 1191 | } |
| 1192 | |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1193 | 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] | 1194 | if (istemplatekind(mscap_gprs, "omit")) { |
| 1195 | return '0'B; |
| 1196 | } |
| 1197 | return '1'B; |
| 1198 | } |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1199 | 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] | 1200 | if (istemplatekind(mscap_egprs, "omit")) { |
| 1201 | return '0'B; |
| 1202 | } |
| 1203 | return '1'B; |
| 1204 | } |
| 1205 | 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) := { |
| 1206 | mSRACapabilityValues := { |
| 1207 | mSRACapabilityValuesExclude1111 := { |
| 1208 | accessTechnType := att, /* E-GSM */ |
| 1209 | accessCapabilities := { |
| 1210 | lengthIndicator := 0, /* overwritten */ |
| 1211 | accessCapabilities := { |
| 1212 | rfPowerCapability := '001'B, /* FIXME */ |
| 1213 | presenceBitA5 := '0'B, |
| 1214 | a5bits := omit, |
| 1215 | esind := '1'B, |
| 1216 | psbit := '0'B, |
| 1217 | vgcs := '0'B, |
| 1218 | vbs := '0'B, |
| 1219 | presenceBitMultislot := '1'B, |
| 1220 | multislotcap := { |
| 1221 | presenceBitHscsd := '0'B, |
| 1222 | hscsdmultislotclass := omit, |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1223 | presenceBitGprs := f_presence_bit_MultislotCap_GPRS_BSSGP(mscap_gprs), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1224 | gprsmultislot := mscap_gprs, |
| 1225 | presenceBitSms := '0'B, |
| 1226 | multislotCap_SMS := omit, |
| 1227 | multislotCapAdditionsAfterRel97 := { |
| 1228 | presenceBitEcsdmulti := '0'B, |
| 1229 | ecsdmultislotclass := omit, |
Pau Espin Pedrol | 1860bf8 | 2020-04-25 16:23:35 +0200 | [diff] [blame] | 1230 | presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS_BSSGP(mscap_egprs), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1231 | multislotCap_EGPRS := mscap_egprs, |
| 1232 | presenceBitDtmGprsmulti := '0'B, |
| 1233 | multislotCapdtmgprsmultislotsubclass := omit |
| 1234 | } |
| 1235 | }, |
| 1236 | accessCapAdditionsAfterRel97 := omit |
| 1237 | }, |
| 1238 | spare_bits := omit |
| 1239 | } |
| 1240 | } |
| 1241 | }, |
| 1242 | presenceBitMSRACap := '0'B |
| 1243 | }; |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1244 | template (present) MSRACapabilityValuesRecord_BSSGP |
| 1245 | tr_RaCapRec_BSSGP(template (present) BIT4 att := '0001'B /* E-GSM */, template MultislotCap_GPRS_BSSGP mscap_gprs := *, |
| 1246 | template MultislotCap_EGPRS_BSSGP mscap_egprs := *) := { |
| 1247 | mSRACapabilityValues := { |
| 1248 | mSRACapabilityValuesExclude1111 := { |
| 1249 | accessTechnType := att, /* E-GSM */ |
| 1250 | accessCapabilities := { |
| 1251 | lengthIndicator := ?, /* overwritten */ |
| 1252 | accessCapabilities := { |
| 1253 | rfPowerCapability := '001'B, /* FIXME */ |
| 1254 | presenceBitA5 := ?, |
| 1255 | a5bits := *, |
| 1256 | esind := '1'B, |
| 1257 | psbit := '0'B, |
| 1258 | vgcs := '0'B, |
| 1259 | vbs := '0'B, |
| 1260 | presenceBitMultislot := '1'B, |
| 1261 | multislotcap := { |
| 1262 | presenceBitHscsd := '0'B, |
| 1263 | hscsdmultislotclass := omit, |
| 1264 | presenceBitGprs := ?, |
| 1265 | gprsmultislot := mscap_gprs, |
| 1266 | presenceBitSms := '0'B, |
| 1267 | multislotCap_SMS := omit, |
| 1268 | multislotCapAdditionsAfterRel97 := { |
| 1269 | presenceBitEcsdmulti := '0'B, |
| 1270 | ecsdmultislotclass := *, |
| 1271 | presenceBitEgprsmulti := ?, |
| 1272 | multislotCap_EGPRS := mscap_egprs, |
| 1273 | presenceBitDtmGprsmulti := ?, |
| 1274 | multislotCapdtmgprsmultislotsubclass := * |
| 1275 | } |
| 1276 | }, |
| 1277 | accessCapAdditionsAfterRel97 := * |
| 1278 | }, |
| 1279 | spare_bits := * |
| 1280 | } |
| 1281 | } |
| 1282 | }, |
| 1283 | presenceBitMSRACap := '0'B |
| 1284 | }; |
| 1285 | |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1286 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1287 | template QoS_Profile_V t_defaultQos := { |
| 1288 | peak_Bit_Rate := int2oct(80, 2), |
| 1289 | precedence := '000'B, |
| 1290 | a_bit := '0'B, |
| 1291 | t_bit := '0'B, |
| 1292 | c_r_bit := '0'B, |
| 1293 | peakBitRateGranularity := '00'B |
| 1294 | } |
| 1295 | |
| 1296 | template QoS_Profile ts_QoS_TLV(template QoS_Profile_V qos) := { |
| 1297 | iEI := '18'O, |
| 1298 | ext := '1'B, |
| 1299 | lengthIndicator := { length1 := 3 }, |
| 1300 | peak_Bit_Rate := qos.peak_Bit_Rate, |
| 1301 | precedence := qos.precedence, |
| 1302 | a_bit := qos.a_bit, |
| 1303 | t_bit := qos.t_bit, |
| 1304 | c_r_bit := qos.c_r_bit, |
| 1305 | peakBitRateGranularity := qos.peakBitRateGranularity |
| 1306 | } |
| 1307 | |
| 1308 | template PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := { |
| 1309 | iEI := '16'O, |
| 1310 | ext := '1'B, |
| 1311 | lengthIndicator := { |
| 1312 | length1 := 2 |
| 1313 | }, |
| 1314 | delay_Value := f_oct_or_wc(delay, 2) |
| 1315 | } |
| 1316 | |
Pau Espin Pedrol | 88bf537 | 2019-12-09 21:12:28 +0100 | [diff] [blame] | 1317 | template DRX_Parameters t_defaultDRXparam := { |
| 1318 | iEI := '0A'O, |
| 1319 | ext := '1'B, |
| 1320 | lengthIndicator := { |
| 1321 | length1 := 2 |
| 1322 | }, |
| 1323 | splitPG_CycleCode := '00'O, |
| 1324 | nonDRXTimer := '000'B, |
| 1325 | splitOnCCCH := '0'B, |
| 1326 | cnSpecificDRXCycleLength := '0000'B |
| 1327 | } |
| 1328 | |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1329 | function ts_BSSGP_IE_MSRAcap_omit(template (omit) MSRadioAccessCapabilityV_BSSGP racap) return template (omit) MS_Radio_Access_Capability { |
| 1330 | var template (omit) MS_Radio_Access_Capability ret; |
| 1331 | if (istemplatekind(racap, "omit")) { |
| 1332 | return omit; |
| 1333 | } else { |
| 1334 | ret := { |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1335 | iEI := '13'O, |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1336 | ext := '1'B, |
| 1337 | lengthIndicator := { |
| 1338 | length1 := 1 |
| 1339 | }, |
| 1340 | mSRadioAccessCapabilityV_BSSGP := racap |
| 1341 | } |
| 1342 | return ret; |
| 1343 | } |
| 1344 | } |
| 1345 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1346 | function tr_BSSGP_IE_MSRAcap(template MSRadioAccessCapabilityV_BSSGP racap) return template MS_Radio_Access_Capability { |
| 1347 | var template MS_Radio_Access_Capability ret; |
| 1348 | if (istemplatekind(racap, "omit")) { |
| 1349 | return omit; |
| 1350 | } else { |
| 1351 | ret := { |
| 1352 | iEI := '13'O, |
| 1353 | ext := ?, |
| 1354 | lengthIndicator := ?, |
| 1355 | mSRadioAccessCapabilityV_BSSGP := racap |
| 1356 | } |
| 1357 | return ret; |
| 1358 | } |
| 1359 | } |
| 1360 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1361 | template PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu, |
| 1362 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit, |
| 1363 | template (omit) IMSI_BSSGP imsi := omit) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1364 | pDU_BSSGP_DL_UNITDATA := { |
| 1365 | bssgpPduType := '00'O, |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1366 | tLLI_current := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1367 | qoS_Profile := t_defaultQos, |
| 1368 | pDU_Lifetime := t_DefaultLifetime(65535), |
Pau Espin Pedrol | 2422d1f | 2020-01-23 17:51:04 +0100 | [diff] [blame] | 1369 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1370 | priority := omit, |
| 1371 | dRX_Parameters := omit, |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 1372 | iMSI := imsi, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1373 | tLLI_old := omit, |
| 1374 | pFI := omit, |
| 1375 | lSA_Information := omit, |
| 1376 | service_UTRAN_CCO := omit, |
| 1377 | service_Class_Indicator := omit, |
| 1378 | subscriber_Profile_ID_For_RAT_Priority := omit, |
| 1379 | redirection_Indication := omit, |
| 1380 | redirection_Completed := omit, |
| 1381 | unconfirmed_Send_State_Variable := omit, |
| 1382 | sCI := omit, |
| 1383 | gGSN_PGW_Location := omit, |
| 1384 | eDRX_Paremeters := omit, |
| 1385 | old_Routing_Area_Identification := omit, |
| 1386 | attach_Indicator := omit, |
| 1387 | alignment_octets := omit, |
| 1388 | lLC_PDU := ts_BSSGP_LLC_PDU(pdu), |
| 1389 | initialLLC_PDU := omit |
| 1390 | } |
| 1391 | } |
| 1392 | |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1393 | template PDU_BSSGP tr_BSSGP_DL_UD(template (present) GprsTlli tlli, template (present) octetstring pdu, |
| 1394 | template IMSI_BSSGP imsi := omit) := { |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1395 | pDU_BSSGP_DL_UNITDATA := { |
| 1396 | bssgpPduType := '00'O, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1397 | tLLI_current := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1398 | qoS_Profile := ?, |
| 1399 | pDU_Lifetime := ?, |
| 1400 | mS_Radio_Access_Capability := *, |
| 1401 | priority := *, |
| 1402 | dRX_Parameters := *, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1403 | iMSI := imsi, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1404 | tLLI_old := *, |
| 1405 | pFI := *, |
| 1406 | lSA_Information := *, |
| 1407 | service_UTRAN_CCO := *, |
| 1408 | service_Class_Indicator := *, |
| 1409 | subscriber_Profile_ID_For_RAT_Priority := *, |
| 1410 | redirection_Indication := *, |
| 1411 | redirection_Completed := *, |
| 1412 | unconfirmed_Send_State_Variable := *, |
| 1413 | sCI := *, |
| 1414 | gGSN_PGW_Location := *, |
| 1415 | eDRX_Paremeters := *, |
| 1416 | old_Routing_Area_Identification := *, |
| 1417 | attach_Indicator := *, |
| 1418 | alignment_octets := *, |
Harald Welte | 2436fb5 | 2020-11-15 22:38:47 +0100 | [diff] [blame] | 1419 | lLC_PDU := tr_BSSGP_LLC_PDU(pdu), |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1420 | initialLLC_PDU := * |
| 1421 | } |
| 1422 | } |
| 1423 | |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1424 | 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] | 1425 | pDU_BSSGP_UL_UNITDATA := { |
| 1426 | bssgpPduType := '01'O, |
| 1427 | tLLI := tlli, |
| 1428 | qoS_Profile := t_defaultQos, |
| 1429 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1430 | pFI := omit, |
| 1431 | lSA_Identifier_List := omit, |
| 1432 | redirect_Attempt_Flag := omit, |
| 1433 | iMSI_BSSGP := omit, |
| 1434 | unconfirmed_Send_State_Variable := omit, |
| 1435 | selected_PLMN_ID := omit, |
| 1436 | selected_Operator := omit, |
| 1437 | cS_Registered_Operator := omit, |
| 1438 | alignment_octets := omit, |
| 1439 | lLC_PDU := ts_BSSGP_LLC_PDU(payload) |
| 1440 | } |
| 1441 | } |
| 1442 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1443 | template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?, |
| 1444 | template octetstring payload := ?) := { |
| 1445 | pDU_BSSGP_UL_UNITDATA := { |
| 1446 | bssgpPduType := '01'O, |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 1447 | tLLI := tlli, |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1448 | qoS_Profile := ?, |
| 1449 | cell_Identifier := t_BSSGP_IE_CellId(cell_id), |
| 1450 | pFI := *, |
| 1451 | lSA_Identifier_List := *, |
| 1452 | redirect_Attempt_Flag := *, |
| 1453 | iMSI_BSSGP := *, |
| 1454 | unconfirmed_Send_State_Variable := *, |
| 1455 | selected_PLMN_ID := *, |
| 1456 | selected_Operator := *, |
| 1457 | cS_Registered_Operator := *, |
| 1458 | alignment_octets := *, |
| 1459 | lLC_PDU := tr_BSSGP_LLC_PDU(payload) |
| 1460 | } |
| 1461 | } |
| 1462 | |
Pau Espin Pedrol | 88bf537 | 2019-12-09 21:12:28 +0100 | [diff] [blame] | 1463 | template PDU_BSSGP tr_BSSGP_CS_PAGING(BssgpBvci bvci) := { |
| 1464 | pDU_BSSGP_PAGING_CS := { |
| 1465 | bssgpPduType := '07'O, |
| 1466 | iMSI := ?, |
| 1467 | dRX_Parameters := ?, |
| 1468 | paging_Field4 := { |
| 1469 | bVCI := t_BSSGP_BVCI(bvci) |
| 1470 | }, |
| 1471 | tLLI := *, |
| 1472 | channel_needed := *, |
| 1473 | eMLPP_Priority := *, |
| 1474 | tMSI := *, |
| 1475 | global_CN_Id := * |
| 1476 | } |
| 1477 | } |
| 1478 | |
| 1479 | template PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { |
| 1480 | pDU_BSSGP_PAGING_CS := { |
| 1481 | bssgpPduType := '07'O, |
| 1482 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1483 | dRX_Parameters := t_defaultDRXparam, |
| 1484 | paging_Field4 := { |
| 1485 | bVCI := t_BSSGP_BVCI(bvci) |
| 1486 | }, |
| 1487 | tLLI := omit, |
| 1488 | channel_needed := omit, |
| 1489 | eMLPP_Priority := omit, |
| 1490 | tMSI := omit, |
| 1491 | global_CN_Id := omit |
| 1492 | } |
| 1493 | } |
| 1494 | |
Vadim Yanitskiy | 7b22421 | 2020-03-26 02:43:55 +0700 | [diff] [blame] | 1495 | template PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { |
| 1496 | pDU_BSSGP_PAGING_CS := { |
| 1497 | bssgpPduType := '07'O, |
| 1498 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1499 | dRX_Parameters := t_defaultDRXparam, |
| 1500 | paging_Field4 := { |
| 1501 | bVCI := t_BSSGP_BVCI(bvci) |
| 1502 | }, |
| 1503 | tLLI := omit, |
| 1504 | channel_needed := omit, |
| 1505 | eMLPP_Priority := omit, |
| 1506 | tMSI := ts_BSSGP_TMSI(tmsi), |
| 1507 | global_CN_Id := omit |
| 1508 | } |
| 1509 | } |
| 1510 | |
Harald Welte | a36b246 | 2020-06-17 22:11:08 +0200 | [diff] [blame] | 1511 | template PDU_BSSGP tr_BSSGP_PS_PAGING(template BssgpBvci bvci) := { |
Harald Welte | 78d9f27 | 2018-02-16 18:13:45 +0100 | [diff] [blame] | 1512 | pDU_BSSGP_PAGING_PS := { |
| 1513 | bssgpPduType := '06'O, |
| 1514 | iMSI := ?, |
| 1515 | dRX_Parameters := *, |
| 1516 | paging_Field4 := { |
| 1517 | bVCI := t_BSSGP_BVCI(bvci) |
| 1518 | }, |
| 1519 | pFI := *, |
| 1520 | aBQP := *, |
| 1521 | qoS_Profile := ?, |
| 1522 | pTMSI := *, |
| 1523 | eDRX_Paremeters := * |
| 1524 | } |
| 1525 | } |
| 1526 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1527 | template PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { |
| 1528 | pDU_BSSGP_PAGING_PS := { |
| 1529 | bssgpPduType := '06'O, |
| 1530 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1531 | dRX_Parameters := omit, |
| 1532 | paging_Field4 := { |
| 1533 | bVCI := t_BSSGP_BVCI(bvci) |
| 1534 | }, |
| 1535 | pFI := omit, |
| 1536 | aBQP := omit, |
| 1537 | qoS_Profile := ts_QoS_TLV(t_defaultQos), |
| 1538 | pTMSI := omit, |
| 1539 | eDRX_Paremeters := omit |
| 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | template PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { |
| 1544 | pDU_BSSGP_PAGING_PS := { |
| 1545 | bssgpPduType := '06'O, |
| 1546 | iMSI := ts_BSSGP_IMSI(imsi), |
| 1547 | dRX_Parameters := omit, |
| 1548 | paging_Field4 := { |
| 1549 | bVCI := t_BSSGP_BVCI(bvci) |
| 1550 | }, |
| 1551 | pFI := omit, |
| 1552 | aBQP := omit, |
| 1553 | qoS_Profile := ts_QoS_TLV(t_defaultQos), |
| 1554 | pTMSI := ts_BSSGP_TMSI(tmsi), |
| 1555 | eDRX_Paremeters := omit |
| 1556 | } |
| 1557 | } |
| 1558 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 1559 | template (value) Routeing_Area ts_BSSGP_RA_ID(RoutingAreaIdentification input) := { |
| 1560 | iEI := '1B'O, |
| 1561 | ext := '1'B, |
| 1562 | lengthIndicator := { |
| 1563 | length1 := 6 |
| 1564 | }, |
| 1565 | mccDigit1 := input.lai.mcc_mnc[0], |
| 1566 | mccDigit2 := input.lai.mcc_mnc[1], |
| 1567 | mccDigit3 := input.lai.mcc_mnc[2], |
| 1568 | mncDigit3 := input.lai.mcc_mnc[3], |
| 1569 | mncDigit1 := input.lai.mcc_mnc[4], |
| 1570 | mncDigit2 := input.lai.mcc_mnc[5], |
| 1571 | lac := int2oct(input.lai.lac, 2), |
| 1572 | rac := int2oct(input.rac, 1) |
| 1573 | } |
| 1574 | |
| 1575 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND(GprsTlli tlli, RoutingAreaIdentification ra_id) := { |
| 1576 | pDU_BSSGP_SUSPEND := { |
| 1577 | bssgpPduType := '0B'O, |
| 1578 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1579 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1580 | } |
| 1581 | } |
| 1582 | template PDU_BSSGP tr_BSSGP_SUSPEND(template GprsTlli tlli, RoutingAreaIdentification ra_id) := { |
| 1583 | pDU_BSSGP_SUSPEND := { |
| 1584 | bssgpPduType := '0B'O, |
| 1585 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1586 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1587 | } |
| 1588 | } |
| 1589 | |
| 1590 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1591 | template (value) OCT1 susp_ref) := { |
| 1592 | pDU_BSSGP_SUSPEND_ACK := { |
| 1593 | bssgpPduType := '0C'O, |
| 1594 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1595 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1596 | suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref) |
| 1597 | } |
| 1598 | } |
| 1599 | template PDU_BSSGP tr_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1600 | template OCT1 susp_ref) := { |
| 1601 | pDU_BSSGP_SUSPEND_ACK := { |
| 1602 | bssgpPduType := '0C'O, |
| 1603 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1604 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1605 | suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref) |
| 1606 | } |
| 1607 | } |
| 1608 | |
| 1609 | template (value) PDU_BSSGP ts_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1610 | template (omit) BssgpCause cause) := { |
| 1611 | pDU_BSSGP_SUSPEND_NACK := { |
| 1612 | bssgpPduType := '0D'O, |
| 1613 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1614 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1615 | cause := ts_BSSGP_CAUSE(cause) |
| 1616 | } |
| 1617 | } |
| 1618 | template PDU_BSSGP tr_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1619 | template BssgpCause cause) := { |
| 1620 | pDU_BSSGP_SUSPEND_NACK := { |
| 1621 | bssgpPduType := '0D'O, |
| 1622 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1623 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1624 | cause := t_BSSGP_CAUSE(cause) |
| 1625 | } |
| 1626 | } |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | template (value) PDU_BSSGP ts_BSSGP_RESUME(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1631 | OCT1 susp_ref) := { |
| 1632 | pDU_BSSGP_RESUME := { |
| 1633 | bssgpPduType := '0E'O, |
| 1634 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1635 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1636 | suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref) |
| 1637 | } |
| 1638 | } |
| 1639 | template PDU_BSSGP tr_BSSGP_RESUME(template GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1640 | template OCT1 susp_ref) := { |
| 1641 | pDU_BSSGP_RESUME := { |
| 1642 | bssgpPduType := '0E'O, |
| 1643 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1644 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1645 | suspend_Reference_Number := tr_BSSGP_SUSP_REF(susp_ref) |
| 1646 | } |
| 1647 | } |
| 1648 | |
| 1649 | template (value) PDU_BSSGP ts_BSSGP_RESUME_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id) |
| 1650 | := { |
| 1651 | pDU_BSSGP_RESUME_ACK := { |
| 1652 | bssgpPduType := '0F'O, |
| 1653 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1654 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1655 | } |
| 1656 | } |
| 1657 | template PDU_BSSGP tr_BSSGP_RESUME_ACK(template GprsTlli tlli, |
| 1658 | RoutingAreaIdentification ra_id) := { |
| 1659 | pDU_BSSGP_RESUME_ACK := { |
| 1660 | bssgpPduType := '0F'O, |
| 1661 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1662 | routeing_Area := ts_BSSGP_RA_ID(ra_id) |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | template (value) PDU_BSSGP ts_BSSGP_RESUME_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, |
| 1667 | template (omit) BssgpCause cause) := { |
| 1668 | pDU_BSSGP_RESUME_NACK := { |
| 1669 | bssgpPduType := '10'O, |
| 1670 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1671 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1672 | cause := ts_BSSGP_CAUSE(cause) |
| 1673 | } |
| 1674 | } |
| 1675 | template PDU_BSSGP tr_BSSGP_RESUME_NACK(template GprsTlli tlli, |
| 1676 | RoutingAreaIdentification ra_id, |
| 1677 | template BssgpCause cause) := { |
| 1678 | pDU_BSSGP_RESUME_NACK := { |
| 1679 | bssgpPduType := '10'O, |
| 1680 | tLLI := tr_BSSGP_TLLI(tlli), |
| 1681 | routeing_Area := ts_BSSGP_RA_ID(ra_id), |
| 1682 | cause := t_BSSGP_CAUSE(cause) |
| 1683 | } |
| 1684 | } |
| 1685 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1686 | /* 10.2.3 */ |
| 1687 | template (value) PDU_BSSGP ts_BSSGP_RA_CAP(GprsTlli tlli, |
| 1688 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 1689 | pDU_BSSGP_RA_CAPABILITY := { |
| 1690 | bssgpPduType := '02'O, |
| 1691 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1692 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) |
| 1693 | } |
| 1694 | } |
| 1695 | template (present) PDU_BSSGP tr_BSSGP_RA_CAP(template (present) GprsTlli tlli, |
| 1696 | template MSRadioAccessCapabilityV_BSSGP racap) := { |
| 1697 | pDU_BSSGP_RA_CAPABILITY := { |
| 1698 | bssgpPduType := '02'O, |
| 1699 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1700 | mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) |
| 1701 | } |
| 1702 | } |
| 1703 | |
| 1704 | |
| 1705 | /* 10.3.3 */ |
| 1706 | template (value) PDU_BSSGP ts_BSSGP_RA_CAP_UPD(GprsTlli tlli, OCT1 tag) := { |
| 1707 | pDU_BSSGP_RA_CAPABILITY_UPDATE := { |
| 1708 | bssgpPduType := '08'O, |
| 1709 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1710 | tag := ts_BSSGP_IE_Tag(tag) |
| 1711 | } |
| 1712 | } |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 1713 | template (present) PDU_BSSGP tr_BSSGP_RA_CAP_UPD(template (present) GprsTlli tlli, |
| 1714 | template OCT1 tag) := { |
| 1715 | pDU_BSSGP_RA_CAPABILITY_UPDATE := { |
| 1716 | bssgpPduType := '08'O, |
| 1717 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1718 | tag := tr_BSSGP_IE_Tag(tag) |
| 1719 | } |
| 1720 | } |
| 1721 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1722 | |
| 1723 | /* 10.3.4 */ |
| 1724 | template (value) PDU_BSSGP |
| 1725 | ts_BSSGP_RA_CAP_UPD_ACK(GprsTlli tlli, OCT1 tag, template (value) OCT1 cause, |
| 1726 | template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 1727 | pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { |
| 1728 | bssgpPduType := '09'O, |
| 1729 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1730 | tag := ts_BSSGP_IE_Tag(tag), |
| 1731 | iMSI := omit, |
| 1732 | rA_Cap_UPDATE_CAUSE := ts_BSSGP_IE_RACU_Cause(cause), |
| 1733 | mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) |
| 1734 | } |
| 1735 | } |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 1736 | template (present) PDU_BSSGP |
| 1737 | tr_BSSGP_RA_CAP_UPD_ACK(template (present) GprsTlli tlli, template OCT1 tag, template (present) OCT1 cause, |
| 1738 | template MSRadioAccessCapabilityV_BSSGP racap := omit) := { |
| 1739 | pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { |
| 1740 | bssgpPduType := '09'O, |
| 1741 | tLLI := ts_BSSGP_TLLI(tlli), |
| 1742 | tag := tr_BSSGP_IE_Tag(tag), |
| 1743 | iMSI := omit, |
| 1744 | rA_Cap_UPDATE_CAUSE := tr_BSSGP_IE_RACU_Cause(cause), |
| 1745 | mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) |
| 1746 | } |
| 1747 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1748 | |
| 1749 | |
| 1750 | |
| 1751 | |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 1752 | |
Harald Welte | cb14e06 | 2020-10-05 12:27:41 +0200 | [diff] [blame] | 1753 | /* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */ |
| 1754 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := ( |
| 1755 | {pDU_BSSGP_DL_UNITDATA := ?}, |
| 1756 | {pDU_BSSGP_UL_UNITDATA := ?}, |
| 1757 | {pDU_BSSGP_RA_CAPABILITY := ?}, |
| 1758 | {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?}, |
| 1759 | {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?}, |
| 1760 | {pDU_BSSGP_RADIO_STATUS := ?}, |
| 1761 | {pDU_BSSGP_FLOW_CONTROL_BVC := ?}, |
| 1762 | {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?}, |
| 1763 | {pDU_BSSGP_FLOW_CONTROL_MS := ?}, |
| 1764 | {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?}, |
| 1765 | {pDU_BSSGP_FLOW_CONTROL_PFC := ?}, |
| 1766 | {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?}, |
| 1767 | {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?}, |
| 1768 | {pDU_BSSGP_CREATE_BSS_PFC := ?}, |
| 1769 | {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?}, |
| 1770 | {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?}, |
| 1771 | {pDU_BSSGP_MODIFY_BSS_PFC := ?}, |
| 1772 | {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?}, |
| 1773 | {pDU_BSSGP_DELETE_BSS_PFC := ?}, |
| 1774 | {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?}, |
| 1775 | {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?}, |
| 1776 | {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?}, |
| 1777 | {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?}, |
| 1778 | {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?}, |
| 1779 | {pDU_BSSGP_PS_HANDOVER_REQUEST := ?}, |
| 1780 | {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?}, |
| 1781 | {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?}, |
| 1782 | {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?}, |
| 1783 | {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?}, |
| 1784 | {pDU_BSSGP_PS_HANDOVER_CANCEL := ?} |
| 1785 | ); |
| 1786 | |
| 1787 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := ( |
| 1788 | tr_BSSGP_PERMITTED_PTP_ONLY, |
| 1789 | {pDU_BSSGP_PAGING_PS := ?}, |
| 1790 | {pDU_BSSGP_PAGING_CS := ?}, |
| 1791 | {pDU_BSSGP_STATUS := ?} |
| 1792 | ); |
| 1793 | |
| 1794 | /* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */ |
| 1795 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := ( |
| 1796 | {pDU_BSSGP_SUSPEND := ?}, |
| 1797 | {pDU_BSSGP_SUSPEND_ACK := ?}, |
| 1798 | {pDU_BSSGP_SUSPEND_NACK := ?}, |
| 1799 | {pDU_BSSGP_RESUME := ?}, |
| 1800 | {pDU_BSSGP_RESUME_ACK := ?}, |
| 1801 | {pDU_BSSGP_RESUME_NACK := ?}, |
| 1802 | {pDU_BSSGP_FLUSH_LL := ?}, |
| 1803 | {pDU_BSSGP_FLUSH_LL_ACK := ?}, |
| 1804 | {pDU_BSSGP_LLC_DISCARDED := ?}, |
| 1805 | {pDU_BSSGP_BVC_BLOCK := ?}, |
| 1806 | {pDU_BSSGP_BVC_BLOCK_ACK := ?}, |
| 1807 | {pDU_BSSGP_BVC_UNBLOCK := ?}, |
| 1808 | {pDU_BSSGP_BVC_UNBLOCK_ACK := ?}, |
| 1809 | {pDU_BSSGP_BVC_RESET := ?}, |
| 1810 | {pDU_BSSGP_BVC_RESET_ACK := ?}, |
| 1811 | {pDU_BSSGP_SGSN_INVOKE_TRACE := ?}, |
| 1812 | {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?}, |
| 1813 | {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?}, |
| 1814 | {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?}, |
| 1815 | {pDU_BSSGP_POSITION_COMMAND := ?}, |
| 1816 | {pDU_BSSGP_POSITION_RESPONSE := ?}, |
| 1817 | {pDU_BSSGP_RAN_INFORMATION := ?}, |
| 1818 | {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?}, |
| 1819 | {pDU_BSSGP_RAN_INFORMATION_ACK := ?}, |
| 1820 | {pDU_BSSGP_RAN_INFORMATION_ERROR := ?}, |
| 1821 | {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?}, |
| 1822 | {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?}, |
| 1823 | {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?}, |
| 1824 | {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?}, |
| 1825 | {pDU_BSSGP_MBMS_STOP_RESPONSE := ?}, |
| 1826 | {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?}, |
| 1827 | {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?} |
| 1828 | ); |
| 1829 | |
| 1830 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := ( |
| 1831 | tr_BSSGP_PERMITTED_SIGN_ONLY, |
| 1832 | {pDU_BSSGP_PAGING_PS := ?}, |
| 1833 | {pDU_BSSGP_PAGING_CS := ?}, |
| 1834 | {pDU_BSSGP_SUSPEND := ?}, |
| 1835 | {pDU_BSSGP_STATUS := ?} |
| 1836 | ); |
| 1837 | |
| 1838 | /* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */ |
| 1839 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := ( |
| 1840 | {pDU_BSSGP_DL_MBMS_UNITDATA := ?}, |
| 1841 | {pDU_BSSGP_UL_MBMS_UNITDATA := ?} |
| 1842 | ); |
| 1843 | |
| 1844 | template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := ( |
| 1845 | tr_BSSGP_PERMITTED_PTM_ONLY, |
| 1846 | {pDU_BSSGP_STATUS := ?} |
| 1847 | ); |
| 1848 | |
| 1849 | |
| 1850 | /* Template for any PTP BVCI IE */ |
| 1851 | template (present) BVCI tr_BSSGP_IE_PtpBvci := { |
| 1852 | iEI := '04'O, |
| 1853 | ext := '1'B, |
| 1854 | lengthIndicator := { |
| 1855 | length1 := 2 |
| 1856 | }, |
| 1857 | unstructured_value := complement ('0000'O, '0001'O) |
| 1858 | } |
| 1859 | |
| 1860 | /* message on signaling PTP but containing a ptp BVC */ |
| 1861 | /* |
| 1862 | template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := ( |
| 1863 | {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}}, |
| 1864 | {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, |
| 1865 | {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, |
| 1866 | {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}}, |
| 1867 | {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 1868 | {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 1869 | {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, |
| 1870 | {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}}, |
| 1871 | {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}}, |
| 1872 | {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}}, |
| 1873 | {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}}, |
| 1874 | {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}}, |
| 1875 | {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}}, |
| 1876 | {pDU_BSSGP_POSITION_COMMAND:{ |
| 1877 | ); |
| 1878 | */ |
| 1879 | |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 1880 | /* extract the BVCI IE of given PDU + return it */ |
| 1881 | function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI { |
| 1882 | select (pdu) { |
| 1883 | case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) { |
| 1884 | return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old; |
| 1885 | } |
| 1886 | case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) { |
| 1887 | return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new; |
| 1888 | } |
| 1889 | case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) { |
| 1890 | return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI; |
| 1891 | } |
| 1892 | case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) { |
| 1893 | return pdu.pDU_BSSGP_BVC_BLOCK.bVCI; |
| 1894 | } |
| 1895 | case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) { |
| 1896 | return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI; |
| 1897 | } |
| 1898 | case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) { |
| 1899 | return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI; |
| 1900 | } |
| 1901 | case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) { |
| 1902 | return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI; |
| 1903 | } |
| 1904 | case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) { |
| 1905 | return pdu.pDU_BSSGP_BVC_RESET.bVCI; |
| 1906 | } |
| 1907 | case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) { |
| 1908 | return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI; |
| 1909 | } |
| 1910 | case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) { |
| 1911 | return pdu.pDU_BSSGP_STATUS.bVCI; |
| 1912 | } |
| 1913 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) { |
| 1914 | return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI; |
| 1915 | } |
| 1916 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) { |
| 1917 | return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI; |
| 1918 | } |
| 1919 | case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) { |
| 1920 | return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI; |
| 1921 | } |
| 1922 | case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) { |
| 1923 | return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI; |
| 1924 | } |
| 1925 | case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) { |
| 1926 | return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI; |
| 1927 | } |
| 1928 | case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) { |
| 1929 | return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI; |
| 1930 | } |
| 1931 | case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) { |
| 1932 | return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI; |
| 1933 | } |
| 1934 | case else { |
| 1935 | return omit; |
| 1936 | } |
| 1937 | } |
| 1938 | } |
| 1939 | |
| 1940 | /* extract the BVCI IE of given PDU + convert it to integer value */ |
| 1941 | function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci { |
| 1942 | var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu); |
| 1943 | if (istemplatekind(bvci_raw, "omit")) { |
| 1944 | return omit; |
| 1945 | } |
| 1946 | return oct2int(valueof(bvci_raw.unstructured_value)); |
| 1947 | } |
Harald Welte | 23989a6 | 2019-03-21 21:32:45 +0100 | [diff] [blame] | 1948 | |
Harald Welte | 8f66af1 | 2020-11-12 17:27:58 +0100 | [diff] [blame] | 1949 | /* 3GPP TS 23.003 2.6 */ |
| 1950 | type enumerated TlliType { |
| 1951 | TLLI_LOCAL, |
| 1952 | TLLI_FOREIGN, |
| 1953 | TLLI_RANDOM, |
| 1954 | TLLI_AUXILIARY, |
| 1955 | TLLI_RESERVED, |
| 1956 | TLLI_G_RNTI, |
| 1957 | TLLI_RAND_G_RNTI |
| 1958 | } |
| 1959 | |
| 1960 | /* 3GPP TS 23.003 2.6 */ |
| 1961 | function f_gprs_tlli_type(OCT4 tlli) return TlliType { |
| 1962 | var bitstring tllib := oct2bit(tlli); |
| 1963 | if (substr(tllib, 0, 2) == '11'B) { |
| 1964 | return TLLI_LOCAL; |
| 1965 | } else if (substr(tllib, 0, 2) == '10'B) { |
| 1966 | return TLLI_FOREIGN; |
| 1967 | } else if (substr(tllib, 0, 5) == '01111'B) { |
| 1968 | return TLLI_RANDOM; |
| 1969 | } else if (substr(tllib, 0, 4) == '0110'B) { |
| 1970 | return TLLI_RESERVED; |
| 1971 | } else if (substr(tllib, 0, 3) == '010'B) { |
| 1972 | return TLLI_RESERVED; |
| 1973 | } else if (substr(tllib, 0, 4) == '0000'B) { |
| 1974 | return TLLI_G_RNTI; |
| 1975 | } else if (substr(tllib, 0, 4) == '0001'B) { |
| 1976 | return TLLI_RAND_G_RNTI; |
| 1977 | } else { |
| 1978 | setverdict(fail, "Unknonw TLLI Type ", tllib); |
| 1979 | mtc.stop; |
| 1980 | } |
| 1981 | } |
| 1982 | |
| 1983 | function f_gprs_tlli_random() return OCT4 { |
| 1984 | var OCT4 tlli := f_rnd_octstring(4); |
| 1985 | return tlli or4b 'c0000000'O; |
| 1986 | } |
| 1987 | |
| 1988 | |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 1989 | |
| 1990 | } with { encode "RAW" }; |