Harald Welte | a814f26 | 2017-07-24 13:21:35 +0200 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // // |
| 3 | // Copyright Test Competence Center (TCC) ETH 2016 // |
| 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: GTPU_Types.ttcn |
| 13 | // Rev: R1B |
| 14 | // Prodnr: CNL 113 843 |
| 15 | // Contact: http://ttcn.ericsson.se |
| 16 | // Reference: 3GPP TS 29.060 v13.5.0, 3GPP TS 29.281 v13.2.0 |
| 17 | // |
| 18 | // This module contains the GTP-U (General Packet Radio Servive Protocol |
| 19 | // Tunnelling Protocol - User Plane) |
| 20 | |
| 21 | module GTPU_Types { |
| 22 | |
| 23 | import from General_Types all; |
| 24 | |
| 25 | // external encoding/decoding functions |
| 26 | external function enc_PDU_GTPU(in PDU_GTPU gtpu_pdu) return octetstring |
| 27 | with { extension "prototype(convert)" |
| 28 | extension "encode(RAW)" |
| 29 | } |
| 30 | |
| 31 | external function dec_PDU_GTPU(in octetstring udp_pdu) return PDU_GTPU |
| 32 | |
| 33 | external function dec_PDU_GTPU_ext(in octetstring udp_pdu) return PDU_GTPU_ext |
| 34 | with { extension "prototype(convert)" |
| 35 | extension "decode(RAW)" |
| 36 | } |
| 37 | |
| 38 | |
| 39 | |
| 40 | ////////////////////////// |
| 41 | // IE definition |
| 42 | ////////////////////////// |
| 43 | //Private Extension - 7.7.46 |
| 44 | type record of PrivateExtension_gtpu PrivateExtension_gtpu_List; |
| 45 | |
| 46 | type record PrivateExtension_gtpu { |
| 47 | OCT1 type_gtpu, |
| 48 | LIN2_BO_LAST lengthf, |
| 49 | OCT2 extensionID, |
| 50 | octetstring extensionValue |
| 51 | } with { variant "PRESENCE( type_gtpu = 'FF'O)"; |
| 52 | variant (lengthf) "LENGTHTO(extensionID, extensionValue)";}; |
| 53 | |
| 54 | //Recovery - 7.7.11 |
| 55 | type record Recovery_gtpu { |
| 56 | OCT1 type_gtpu, |
| 57 | OCT1 restartCounter |
| 58 | }; |
| 59 | |
| 60 | //Extension Header Type List - 7.7.40 |
| 61 | type record ExtensionHeaderTypeList_gtpu { |
| 62 | OCT1 type_gtpu, |
| 63 | integer lengthf, |
| 64 | octetstring extensionTypesList |
| 65 | } with { variant (lengthf) "LENGTHTO(extensionTypesList)"; } |
| 66 | |
| 67 | //Tunnel Endpoint Identifier Data I - 7.7.13 |
| 68 | type record TeidDataI_gtpu { |
| 69 | OCT1 type_gtpu, |
| 70 | OCT4 teidDataI |
| 71 | }; |
| 72 | |
| 73 | //GSN Address - 7.7.32 |
| 74 | type record GSNAddress_gtpu |
| 75 | { |
| 76 | OCT1 type_gtpu, |
| 77 | LIN2_BO_LAST lengthf, |
| 78 | octetstring gSNAddressValue |
| 79 | } with {variant (lengthf) "LENGTHTO(gSNAddressValue)";}; |
| 80 | |
| 81 | ////////////////////////// |
| 82 | // Message definition |
| 83 | ////////////////////////// |
| 84 | // Echo Request - 7.2.1 |
| 85 | type record EchoRequest_IEs { |
| 86 | PrivateExtension_gtpu_List private_extension_gtpu optional |
| 87 | } |
| 88 | |
| 89 | // Echo Response - 7.2.2 |
| 90 | type record EchoResponse_IEs { |
| 91 | Recovery_gtpu recovery_gtpu, |
| 92 | PrivateExtension_gtpu_List private_extension_gtpu optional |
| 93 | } |
| 94 | |
| 95 | //Error Indication - 3GPP TS 29.281 v13.2.0 - 7.3.1 |
| 96 | type record ErrorIndication_IEs { |
| 97 | TeidDataI_gtpu teidDataI_gtpu, |
| 98 | GSNAddress_gtpu gSNAddress_gtpu, |
| 99 | PrivateExtension_gtpu_List private_extension_gtpu optional |
| 100 | } |
| 101 | |
| 102 | //Supported Extension Headers Notification - 7.2.4 |
| 103 | type record SupportedExtensionHeadersNotification_IEs { |
| 104 | ExtensionHeaderTypeList_gtpu extensionHeaderTypeList_gtpu |
| 105 | }; |
| 106 | |
| 107 | // 3GPP TS 29.281 v9.3.0 - 7.3.2 |
| 108 | type record EndMarker_IEs{ |
| 109 | PrivateExtension_gtpu_List private_extension_gtpu optional |
| 110 | } |
| 111 | |
| 112 | //G PDU - 9.3.1 |
| 113 | type record G_PDU_IEs { |
| 114 | octetstring data |
| 115 | }; |
| 116 | |
| 117 | |
| 118 | type union GTPU_IEs { |
| 119 | EchoRequest_IEs echoRequest_IEs, |
| 120 | EchoResponse_IEs echoResponse_IEs, |
| 121 | ErrorIndication_IEs errorIndication_IEs, |
| 122 | SupportedExtensionHeadersNotification_IEs suppExtHeadersNotif_IEs, |
| 123 | EndMarker_IEs endMarker_IEs, |
| 124 | G_PDU_IEs g_PDU_IEs |
| 125 | }; |
| 126 | |
| 127 | |
| 128 | ////////////////////////// |
| 129 | // Extension Header definition |
| 130 | ////////////////////////// |
| 131 | type record GTPU_ExtensionHeader { |
| 132 | integer lengthfield, |
| 133 | octetstring content, |
| 134 | OCT1 nextExtHeader |
| 135 | } with { |
| 136 | variant (lengthfield) "LENGTHTO(lengthfield,content,nextExtHeader)"; |
| 137 | variant (lengthfield) "UNIT(32)"; |
| 138 | } |
| 139 | |
| 140 | type record of GTPU_ExtensionHeader GTPU_ExtensionHeader_List; |
| 141 | |
| 142 | type record GTPU_Header_optional_part { |
| 143 | OCT2 sequenceNumber, |
| 144 | OCT1 npduNumber, |
| 145 | OCT1 nextExtHeader, |
| 146 | GTPU_ExtensionHeader_List gTPU_extensionHeader_List optional |
| 147 | } |
| 148 | |
| 149 | |
| 150 | ////////////////////////// |
| 151 | // PDU definition |
| 152 | ////////////////////////// |
| 153 | type record PDU_GTPU { |
| 154 | BIT1 pn_bit, |
| 155 | BIT1 s_bit, |
| 156 | BIT1 e_bit, |
| 157 | BIT1 spare, |
| 158 | BIT1 pt, |
| 159 | BIT3 version, |
| 160 | OCT1 messageType, |
| 161 | LIN2_BO_LAST lengthf, |
| 162 | OCT4 teid, |
| 163 | GTPU_Header_optional_part opt_part optional, |
| 164 | GTPU_IEs gtpu_IEs |
| 165 | } with { |
| 166 | variant (lengthf) "LENGTHTO(opt_part, gtpu_IEs)"; |
| 167 | variant (opt_part) "PRESENCE({pn_bit = '1'B, s_bit = '1'B, e_bit = '1'B})"; |
| 168 | variant (gtpu_IEs) "CROSSTAG( echoRequest_IEs, messageType = '01'O; |
| 169 | echoResponse_IEs, messageType = '02'O; |
| 170 | errorIndication_IEs, messageType = '1A'O; |
| 171 | suppExtHeadersNotif_IEs, messageType = '1F'O; |
| 172 | endMarker_IEs, messageType = 'FE'O; |
| 173 | g_PDU_IEs, messageType = 'FF'O)"; |
| 174 | }; |
| 175 | |
| 176 | |
| 177 | type record PDU_GTPU_ext { |
| 178 | PDU_GTPU gtpu_pdu, |
| 179 | octetstring extraOctets |
| 180 | } with { |
| 181 | variant "" ; |
| 182 | }; |
| 183 | |
| 184 | }//end of module |
| 185 | with { |
| 186 | extension "version R1B" |
| 187 | encode "RAW" |
| 188 | } |
| 189 | |