Harald Welte | 9a8f503 | 2017-07-25 08:23:52 +0200 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // // |
| 3 | // Copyright Test Competence Center (TCC) ETH 2008 // |
| 4 | // // |
| 5 | // The copyright to the computer program(s) herein is the property of TCC. // |
| 6 | // The program(s) may be used and/or copied only with the written permission // |
| 7 | // of TCC or in accordance with the terms and conditions stipulated in the // |
| 8 | // agreement/contract under which the program(s) has been supplied. // |
| 9 | // // |
| 10 | /////////////////////////////////////////////////////////////////////////////// |
| 11 | // |
| 12 | // File: NS_Types.ttcn |
| 13 | // Rev: R1A01 |
| 14 | // Prodnr: CNL 113 578 |
| 15 | // Updated: 2008-01-22 |
| 16 | // Contact: http://ttcn.ericsson.se |
| 17 | // Reference: 3GPP TS 48.016 7.3.0 |
| 18 | |
| 19 | module NS_Types |
| 20 | { // beginning of module |
| 21 | |
| 22 | // This module contains the Base Station System (BSS) Serving GPRS Support |
| 23 | // Node (SGSN) interface Network Sevice protocol |
| 24 | // 48.016 v7.3.0 with attributes for RAW encoding/decoding. |
| 25 | // |
| 26 | |
| 27 | // History: |
| 28 | // ******** |
| 29 | |
| 30 | import from General_Types all; |
| 31 | |
| 32 | external function enc_PDU_NS(in PDU_NS pdu) return octetstring |
| 33 | with { extension "prototype(convert)" |
| 34 | extension "encode(RAW)" |
| 35 | } |
| 36 | |
| 37 | external function dec_PDU_NS(in octetstring stream) return PDU_NS |
| 38 | with { extension "prototype(convert)" |
| 39 | extension "decode(RAW)" |
| 40 | } |
| 41 | |
| 42 | type record CauseNS |
| 43 | { |
| 44 | OCT1 iEI, |
| 45 | BIT1 ext, |
| 46 | LIN1_2 lengthIndicator, |
| 47 | OCT1 cause |
| 48 | } with { |
| 49 | variant (lengthIndicator) "LENGTHTO (cause)"; |
| 50 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 51 | length2, ext = '0'B;)"; |
| 52 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 53 | } |
| 54 | |
| 55 | type record NS_VCI |
| 56 | { |
| 57 | OCT1 iEI, |
| 58 | BIT1 ext, |
| 59 | LIN1_2 lengthIndicator, |
| 60 | OCT2 nS_VCI |
| 61 | } with { |
| 62 | variant (lengthIndicator) "LENGTHTO (nS_VCI)"; |
| 63 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 64 | length2, ext = '0'B;)"; |
| 65 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 66 | } |
| 67 | |
| 68 | type record NS_PDU |
| 69 | { |
| 70 | OCT1 iEI, |
| 71 | BIT1 ext, |
| 72 | LIN1_2 lengthIndicator, |
| 73 | octetstring ns_PDU |
| 74 | } with { |
| 75 | variant (lengthIndicator) "LENGTHTO (ns_PDU)"; |
| 76 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 77 | length2, ext = '0'B;)"; |
| 78 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 79 | } |
| 80 | |
| 81 | type record BVCI_NS |
| 82 | { |
| 83 | OCT1 iEI, |
| 84 | BIT1 ext, |
| 85 | LIN1_2 lengthIndicator, |
| 86 | OCT2 bVCI |
| 87 | } with { |
| 88 | variant (lengthIndicator) "LENGTHTO (bVCI)"; |
| 89 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 90 | length2, ext = '0'B;)"; |
| 91 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 92 | } |
| 93 | |
| 94 | type record ListofIP4Elements |
| 95 | { |
| 96 | OCT1 iEI, |
| 97 | BIT1 ext, |
| 98 | LIN1_2 lengthIndicator, |
| 99 | IP4_Elements iP4_Elements |
| 100 | } with { |
| 101 | variant (lengthIndicator) "LENGTHTO (iP4_Elements)"; |
| 102 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 103 | length2, ext = '0'B;)"; |
| 104 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 105 | } |
| 106 | |
| 107 | type record IP4_Element |
| 108 | { |
| 109 | OCT4 ipAddress, |
| 110 | OCT2 uDP_Port, |
| 111 | OCT1 signallingWeight, |
| 112 | OCT1 dataWeight |
| 113 | } |
| 114 | |
| 115 | type record of IP4_Element IP4_Elements; |
| 116 | |
| 117 | type record ListofIP6Elements |
| 118 | { |
| 119 | OCT1 iEI, |
| 120 | BIT1 ext, |
| 121 | LIN1_2 lengthIndicator, |
| 122 | IP6_Elements iP6_Elements |
| 123 | } with { |
| 124 | variant (lengthIndicator) "LENGTHTO (iP6_Elements)"; |
| 125 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 126 | length2, ext = '0'B;)"; |
| 127 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 128 | } |
| 129 | |
| 130 | type record IP6_Element |
| 131 | { |
| 132 | OCT16 ipAddress, |
| 133 | OCT2 uDP_Port, |
| 134 | OCT1 signallingWeight, |
| 135 | OCT1 dataWeight |
| 136 | } |
| 137 | |
| 138 | type record of IP6_Element IP6_Elements; |
| 139 | |
| 140 | type record IP_Address_NS |
| 141 | { |
| 142 | OCT1 iEI, |
| 143 | OCT1 addressType, |
| 144 | IPAddress ipAddress |
| 145 | }with { |
| 146 | variant (ipAddress) "CROSSTAG |
| 147 | ( |
| 148 | ip4Address, addressType = '01'O; |
| 149 | ip6Address, addressType = '02'O; |
| 150 | )" |
| 151 | }; |
| 152 | |
| 153 | type union IPAddress |
| 154 | { |
| 155 | OCT4 ip4Address, |
| 156 | OCT16 ip6Address |
| 157 | } |
| 158 | |
| 159 | type record EndFlag |
| 160 | { |
| 161 | BIT1 eBIT, |
| 162 | BIT7 spare |
| 163 | } |
| 164 | |
| 165 | type record ResetFlag |
| 166 | { |
| 167 | OCT1 iEI, |
| 168 | BIT1 resetBIT, |
| 169 | BIT7 spare |
| 170 | } |
| 171 | |
| 172 | type record MaxNumberOfNSVCs |
| 173 | { |
| 174 | OCT1 iEI, |
| 175 | OCT2 maxNumberOfNSVCs |
| 176 | } |
| 177 | |
| 178 | type record NumberOfIP_Endpoints |
| 179 | { |
| 180 | OCT1 iEI, |
| 181 | OCT2 numberOfIP_Endpoints |
| 182 | } |
| 183 | |
| 184 | |
| 185 | type record NSEI_NS |
| 186 | { |
| 187 | OCT1 iEI, |
| 188 | BIT1 ext, |
| 189 | LIN1_2 lengthIndicator, |
| 190 | OCT2 nSEI |
| 191 | } with { |
| 192 | variant (lengthIndicator) "LENGTHTO (nSEI)"; |
| 193 | variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B; |
| 194 | length2, ext = '0'B;)"; |
| 195 | variant (ext,lengthIndicator) "FIELDORDER(msb)"; |
| 196 | } |
| 197 | |
| 198 | type record NS_SDU_ControlBits |
| 199 | { |
| 200 | BIT1 rBit, |
| 201 | BIT1 cBit, |
| 202 | BIT6 spare |
| 203 | } |
| 204 | |
| 205 | //same type def as LIN2_2a in BSSGP but named differently |
| 206 | type union LIN1_2 |
| 207 | { |
| 208 | integer length1, |
| 209 | integer length2 |
| 210 | } with { |
| 211 | variant (length1) "FIELDLENGTH(7)"; |
| 212 | variant (length2) "FIELDLENGTH(15)"; |
| 213 | variant (length2) "BYTEORDER(last)"; |
| 214 | variant (length1,length2) "FIELDORDER(msb)" |
| 215 | } |
| 216 | |
| 217 | |
| 218 | // PDUs ************************************************************ |
| 219 | |
| 220 | |
| 221 | type record PDU_NS_Alive |
| 222 | { |
| 223 | OCT1 nsPduType |
| 224 | } |
| 225 | |
| 226 | type record PDU_NS_Alive_Ack |
| 227 | { |
| 228 | OCT1 nsPduType |
| 229 | } |
| 230 | |
| 231 | type record PDU_NS_Block |
| 232 | { |
| 233 | OCT1 nsPduType, |
| 234 | CauseNS causeNS, //TLV |
| 235 | NS_VCI nS_VCI //TLV |
| 236 | } |
| 237 | |
| 238 | type record PDU_NS_Block_Ack |
| 239 | { |
| 240 | OCT1 nsPduType, |
| 241 | NS_VCI nS_VCI //TLV |
| 242 | } |
| 243 | |
| 244 | type record PDU_NS_Reset |
| 245 | { |
| 246 | OCT1 nsPduType, |
| 247 | CauseNS causeNS, //TLV |
| 248 | NS_VCI nS_VCI, //TLV |
| 249 | NSEI_NS nSEI_NS //TLV |
| 250 | } |
| 251 | |
| 252 | type record PDU_NS_Reset_Ack |
| 253 | { |
| 254 | OCT1 nsPduType, |
| 255 | NS_VCI nS_VCI, //TLV |
| 256 | NSEI_NS nSEI_NS //TLV |
| 257 | } |
| 258 | |
| 259 | type record PDU_NS_Status |
| 260 | { |
| 261 | OCT1 nsPduType, |
| 262 | CauseNS causeNS, //TLV |
| 263 | NS_VCI nS_VCI optional, //TLV |
| 264 | NS_PDU nS_PDU optional, //TLV |
| 265 | BVCI_NS bVCI_NS optional, //TLV |
| 266 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 267 | ListofIP6Elements listofIP6Elements optional //TLV |
| 268 | } with { |
| 269 | variant "TAG ( |
| 270 | nS_VCI, iEI = '01'O; |
| 271 | nS_PDU, iEI = '02'O; |
| 272 | bVCI_NS, iEI = '03'O; |
| 273 | listofIP4Elements, iEI = '05'O; |
| 274 | listofIP6Elements, iEI = '06'O |
| 275 | )" |
| 276 | } |
| 277 | |
| 278 | type record PDU_NS_Unblock |
| 279 | { |
| 280 | OCT1 nsPduType |
| 281 | } |
| 282 | |
| 283 | type record PDU_NS_Unblock_Ack |
| 284 | { |
| 285 | OCT1 nsPduType |
| 286 | } |
| 287 | |
| 288 | type record PDU_NS_Unitdata |
| 289 | { |
| 290 | OCT1 nsPduType, |
| 291 | NS_SDU_ControlBits nS_SDU_ControlBits, //V |
| 292 | OCT2 bVCI, //V |
| 293 | octetstring nS_SDU //V |
| 294 | // decoder interprets all octets after the |
| 295 | // first 4 octets as NS SDU |
| 296 | } |
| 297 | |
| 298 | type record PDU_SNS_Ack |
| 299 | { |
| 300 | OCT1 nsPduType, |
| 301 | NSEI_NS nSEI_NS, //TLV |
| 302 | integer transactionID, //V |
| 303 | CauseNS causeNS optional, //TLV |
| 304 | IP_Address_NS iP_Address_NS optional, //TV |
| 305 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 306 | ListofIP6Elements listofIP6Elements optional //TLV |
| 307 | } with { |
| 308 | variant (transactionID) "FIELDLENGTH(8)"; |
| 309 | variant "TAG ( |
| 310 | causeNS, iEI = '00'O; |
| 311 | iP_Address_NS, iEI = '0B'O; |
| 312 | listofIP4Elements, iEI = '05'O; |
| 313 | listofIP6Elements, iEI = '06'O |
| 314 | )" |
| 315 | } |
| 316 | |
| 317 | type record PDU_SNS_Add |
| 318 | { |
| 319 | OCT1 nsPduType, |
| 320 | NSEI_NS nSEI_NS, //TLV |
| 321 | integer transactionID, //V |
| 322 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 323 | ListofIP6Elements listofIP6Elements optional //TLV |
| 324 | } with { |
| 325 | variant (transactionID) "FIELDLENGTH(8)"; |
| 326 | variant "TAG ( |
| 327 | listofIP4Elements, iEI = '05'O; |
| 328 | listofIP6Elements, iEI = '06'O |
| 329 | )" |
| 330 | } |
| 331 | |
| 332 | type record PDU_SNS_ChangeWeight |
| 333 | { |
| 334 | OCT1 nsPduType, |
| 335 | NSEI_NS nSEI_NS, //TLV |
| 336 | integer transactionID, //V |
| 337 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 338 | ListofIP6Elements listofIP6Elements optional //TLV |
| 339 | } with { |
| 340 | variant (transactionID) "FIELDLENGTH(8)"; |
| 341 | variant "TAG ( |
| 342 | listofIP4Elements, iEI = '05'O; |
| 343 | listofIP6Elements, iEI = '06'O |
| 344 | )" |
| 345 | } |
| 346 | |
| 347 | type record PDU_SNS_Config |
| 348 | { |
| 349 | OCT1 nsPduType, |
| 350 | EndFlag endFlag, //V |
| 351 | NSEI_NS nSEI_NS, //TLV |
| 352 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 353 | ListofIP6Elements listofIP6Elements optional //TLV |
| 354 | } with { |
| 355 | variant "TAG ( |
| 356 | listofIP4Elements, iEI = '05'O; |
| 357 | listofIP6Elements, iEI = '06'O |
| 358 | )" |
| 359 | } |
| 360 | |
| 361 | |
| 362 | |
| 363 | type record PDU_SNS_Config_Ack |
| 364 | { |
| 365 | OCT1 nsPduType, |
| 366 | NSEI_NS nSEI_NS, //TLV |
| 367 | CauseNS causeNS optional //TLV |
| 368 | } with { |
| 369 | variant "TAG (causeNS, iEI = '00'O;)" |
| 370 | } |
| 371 | |
| 372 | |
| 373 | |
| 374 | type record PDU_SNS_Delete |
| 375 | { |
| 376 | OCT1 nsPduType, |
| 377 | NSEI_NS nSEI_NS, //TLV |
| 378 | integer transactionID, //V |
| 379 | IP_Address_NS iP_Address_NS optional, //TV |
| 380 | ListofIP4Elements listofIP4Elements optional, //TLV |
| 381 | ListofIP6Elements listofIP6Elements optional //TLV |
| 382 | } with { |
| 383 | variant (transactionID) "FIELDLENGTH(8)"; |
| 384 | variant "TAG ( |
| 385 | iP_Address_NS, iEI = '0B'O; |
| 386 | listofIP4Elements, iEI = '05'O; |
| 387 | listofIP6Elements, iEI = '06'O |
| 388 | )" |
| 389 | } |
| 390 | |
| 391 | type record PDU_SNS_Size |
| 392 | { |
| 393 | OCT1 nsPduType, |
| 394 | NSEI_NS nSEI_NS, //TLV |
| 395 | ResetFlag resetFlag, //TV |
| 396 | MaxNumberOfNSVCs maxNumberOfNSVCs, //TV |
| 397 | NumberOfIP_Endpoints numberOfIP4_Endpoints optional, //TV |
| 398 | NumberOfIP_Endpoints numberOfIP6_Endpoints optional //TV |
| 399 | } with { |
| 400 | variant "TAG ( |
| 401 | numberOfIP4_Endpoints, iEI = '08'O; |
| 402 | numberOfIP6_Endpoints, iEI = '09'O; |
| 403 | )" |
| 404 | } |
| 405 | |
| 406 | |
| 407 | type record PDU_SNS_Size_Ack |
| 408 | { |
| 409 | OCT1 nsPduType, |
| 410 | NSEI_NS nSEI_NS, |
| 411 | CauseNS causeNS optional //TLV |
| 412 | } with { |
| 413 | variant "TAG (causeNS, iEI = '00'O;)" |
| 414 | } |
| 415 | |
| 416 | |
| 417 | |
| 418 | type union PDU_NS |
| 419 | { |
| 420 | |
| 421 | PDU_NS_Alive pDU_NS_Alive, |
| 422 | PDU_NS_Alive_Ack pDU_NS_Alive_Ack, |
| 423 | PDU_NS_Block pDU_NS_Block, |
| 424 | PDU_NS_Block_Ack pDU_NS_Block_Ack, |
| 425 | PDU_NS_Reset pDU_NS_Reset, |
| 426 | PDU_NS_Reset_Ack pDU_NS_Reset_Ack, |
| 427 | PDU_NS_Status pDU_NS_Status, |
| 428 | PDU_NS_Unblock pDU_NS_Unblock, |
| 429 | PDU_NS_Unblock_Ack pDU_NS_Unblock_Ack, |
| 430 | PDU_NS_Unitdata pDU_NS_Unitdata, |
| 431 | PDU_SNS_Ack pDU_SNS_Ack, |
| 432 | PDU_SNS_Add pDU_SNS_Add, |
| 433 | PDU_SNS_ChangeWeight pDU_SNS_ChangeWeight, |
| 434 | PDU_SNS_Config pDU_SNS_Config, |
| 435 | PDU_SNS_Config_Ack pDU_SNS_Config_Ack, |
| 436 | PDU_SNS_Delete pDU_SNS_Delete, |
| 437 | PDU_SNS_Size pDU_SNS_Size, |
| 438 | PDU_SNS_Size_Ack pDU_SNS_Size_Ack |
| 439 | |
| 440 | } with { variant "TAG ( |
| 441 | |
| 442 | pDU_NS_Alive, nsPduType ='0A'O; |
| 443 | pDU_NS_Alive_Ack, nsPduType ='0B'O; |
| 444 | pDU_NS_Block, nsPduType ='04'O; |
| 445 | pDU_NS_Block_Ack, nsPduType ='05'O; |
| 446 | pDU_NS_Reset, nsPduType ='02'O; |
| 447 | pDU_NS_Reset_Ack, nsPduType ='03'O; |
| 448 | pDU_NS_Status, nsPduType ='08'O; |
| 449 | pDU_NS_Unblock, nsPduType ='06'O; |
| 450 | pDU_NS_Unblock_Ack, nsPduType ='07'O; |
| 451 | pDU_NS_Unitdata, nsPduType ='00'O; |
| 452 | pDU_SNS_Ack, nsPduType ='0C'O; |
| 453 | pDU_SNS_Add, nsPduType ='0D'O; |
| 454 | pDU_SNS_ChangeWeight, nsPduType ='0E'O; |
| 455 | pDU_SNS_Config, nsPduType ='0F'O; |
| 456 | pDU_SNS_Config_Ack, nsPduType ='10'O; |
| 457 | pDU_SNS_Delete, nsPduType ='11'O; |
| 458 | pDU_SNS_Size, nsPduType ='12'O; |
| 459 | pDU_SNS_Size_Ack, nsPduType ='13'O |
| 460 | |
| 461 | )" |
| 462 | } |
| 463 | |
| 464 | |
| 465 | }with{ encode "RAW"} // end of module |