Harald Welte | 9a8f503 | 2017-07-25 08:23:52 +0200 | [diff] [blame] | 1 | /* |
| 2 | /////////////////////////////////////////////////////////////////////////////// |
| 3 | // // |
| 4 | // Copyright Test Competence Center (TCC) ETH 2008 // |
| 5 | // // |
| 6 | // The copyright to the computer program(s) herein is the property of TCC. // |
| 7 | // The program(s) may be used and/or copied only with the written permission // |
| 8 | // of TCC or in accordance with the terms and conditions stipulated in the // |
| 9 | // agreement/contract under which the program(s) has been supplied. // |
| 10 | // // |
| 11 | /////////////////////////////////////////////////////////////////////////////// |
| 12 | // |
| 13 | // File: SNDCP_Types.ttcn |
| 14 | // Rev: R1A01 |
| 15 | // Prodnr: CNL 113 576 |
| 16 | // Updated: 2008-01-21 |
| 17 | // Contact: http://ttcn.ericsson.se |
| 18 | // Reference: 3GPP TS 44.065 7.0.0 |
| 19 | */ |
| 20 | module SNDCP_Types |
| 21 | { |
| 22 | |
| 23 | // This module contains the Subnetwork Dependent Convergence Protocol |
| 24 | // 44.065 v7.0.0 with attributes for RAW encoding/decoding. |
| 25 | |
| 26 | // According to 3GPP 04.64 - the maximum(!) length of the PDU_SN_UNITDATA and PDU_SN_DATA |
| 27 | // is minimum 140 and maximum 520 octets. |
| 28 | // The actual length of the PDU_SN_UNITDATA and PDU_SN_DATA is given in LLC ASPs or set to a parameter value. |
| 29 | // The possible maximum length of dataSegmentSnUnitdataPdu or dataSegmentSnDataPdu is therefore variable and |
| 30 | // will depend on this setting. |
| 31 | // The RAW decoder should have no problem decoding these fields when they are simply defined as octetstrings |
| 32 | // and stand at the end of the SNDPC PDUs. |
| 33 | // |
| 34 | |
| 35 | // |
| 36 | |
| 37 | import from General_Types all; |
| 38 | |
| 39 | external function enc_PDU_SN(in PDU_SN pdu ) return octetstring |
| 40 | with { extension "prototype(convert)" |
| 41 | extension "encode(RAW)" |
| 42 | } |
| 43 | |
| 44 | external function dec_PDU_SN(in octetstring stream) return PDU_SN |
| 45 | with { extension "prototype(convert)" |
| 46 | extension "decode(RAW)" |
| 47 | } |
| 48 | |
| 49 | type union PDU_SN |
| 50 | { |
| 51 | PDU_SN_UNITDATA pDU_SN_UNITDATA, |
| 52 | PDU_SN_DATA pDU_SN_DATA |
| 53 | } with { variant "TAG ( |
| 54 | pDU_SN_UNITDATA, snPduType ='1'B; |
| 55 | pDU_SN_DATA, snPduType ='0'B |
| 56 | )" |
| 57 | }; |
| 58 | |
| 59 | |
| 60 | type record PDU_SN_UNITDATA |
| 61 | { |
| 62 | BIT4 nsapi, |
| 63 | BIT1 moreBit, |
| 64 | BIT1 snPduType, |
| 65 | BIT1 firstSegmentIndicator, |
| 66 | BIT1 spareBit, // set to '0'B |
| 67 | BIT4 pcomp optional, |
| 68 | BIT4 dcomp optional, |
| 69 | BIT4 npduNumber, |
| 70 | BIT4 segmentNumber, |
| 71 | OCT1 npduNumberContinued, |
| 72 | octetstring dataSegmentSnUnitdataPdu |
| 73 | } with { variant (pcomp) "PRESENCE(firstSegmentIndicator = '1'B)"; |
| 74 | variant (dcomp) "PRESENCE(firstSegmentIndicator = '1'B)" |
| 75 | }; |
| 76 | |
| 77 | |
| 78 | type record PDU_SN_DATA |
| 79 | { |
| 80 | BIT4 nsapi, |
| 81 | BIT1 moreBit, |
| 82 | BIT1 snPduType, |
| 83 | BIT1 firstSegmentIndicator, |
| 84 | BIT1 spareBit, // set to '0'B |
| 85 | BIT4 pcomp optional, |
| 86 | BIT4 dcomp optional, |
| 87 | OCT1 npduNumberAck optional, |
| 88 | octetstring dataSegmentSnDataPdu |
| 89 | |
| 90 | } with { variant (pcomp) "PRESENCE(firstSegmentIndicator = '1'B)"; |
| 91 | variant (dcomp) "PRESENCE(firstSegmentIndicator = '1'B)"; |
| 92 | variant (npduNumberAck) "PRESENCE(firstSegmentIndicator = '1'B)" |
| 93 | }; |
| 94 | |
| 95 | |
| 96 | }with{ encode "RAW"} // end of module |