Harald Welte | 3b8bdd6 | 2017-07-19 19:57:26 +0200 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * Copyright (c) 2000-2017 Ericsson Telecom AB |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Contributors: |
| 9 | * Balasko, Jeno |
| 10 | * Baranyi, Botond |
| 11 | * |
| 12 | ******************************************************************************/ |
| 13 | // |
| 14 | // File: General_Types.ttcn |
| 15 | // Rev: <RnXnn> |
| 16 | // Prodnr: CNL 113 368 |
| 17 | // Updated: 2012-11-06 |
| 18 | // Contact: http://ttcn.ericsson.se |
| 19 | // Reference: |
| 20 | |
| 21 | |
| 22 | module General_Types |
| 23 | { |
| 24 | |
| 25 | group SimpleNativeTypes { |
| 26 | |
| 27 | //**************************************************** |
| 28 | // Bitstrings |
| 29 | //**************************************************** |
| 30 | |
| 31 | //bitstring with fixed length |
| 32 | type bitstring BIT1n length(1) with { variant "" }; |
| 33 | type bitstring BIT2n length(2) with { variant "" }; |
| 34 | type bitstring BIT3n length(3) with { variant "" }; |
| 35 | type bitstring BIT4n length(4) with { variant "" }; |
| 36 | type bitstring BIT5n length(5) with { variant "" }; |
| 37 | type bitstring BIT6n length(6) with { variant "" }; |
| 38 | type bitstring BIT7n length(7) with { variant "" }; |
| 39 | type bitstring BIT8n length(8) with { variant "" }; |
| 40 | type bitstring BIT9n length(9) with { variant "" }; |
| 41 | type bitstring BIT12n length(12) with { variant "" }; |
| 42 | type bitstring BIT14n length(14) with { variant "" }; |
| 43 | type bitstring BIT15n length(15) with { variant "" }; |
| 44 | type bitstring BIT16n length(16) with { variant "" }; |
| 45 | type bitstring BIT56n length(56) with { variant "" }; |
| 46 | |
| 47 | //bitstring with length interval |
| 48 | type bitstring BIT14_24n length(14..24) with { variant "" }; |
| 49 | |
| 50 | //bitstring to be padded with fixed length |
| 51 | type bitstring BIT1np length(1) with { variant "" }; |
| 52 | type bitstring BIT2np length(2) with { variant "" }; |
| 53 | type bitstring BIT3np length(3) with { variant "" }; |
| 54 | type bitstring BIT4np length(4) with { variant "" }; |
| 55 | type bitstring BIT5np length(5) with { variant "" }; |
| 56 | type bitstring BIT6np length(6) with { variant "" }; |
| 57 | type bitstring BIT7np length(7) with { variant "" }; |
| 58 | type bitstring BIT15np length(15) with { variant "" }; |
| 59 | |
| 60 | //bitstring with fixed length |
| 61 | type bitstring BIT1 length(1) with { variant "FIELDLENGTH(1)" }; |
| 62 | type bitstring BIT2 length(2) with { variant "FIELDLENGTH(2)" }; |
| 63 | type bitstring BIT3 length(3) with { variant "FIELDLENGTH(3)" }; |
| 64 | type bitstring BIT4 length(4) with { variant "FIELDLENGTH(4)" }; |
| 65 | type bitstring BIT5 length(5) with { variant "FIELDLENGTH(5)" }; |
| 66 | type bitstring BIT6 length(6) with { variant "FIELDLENGTH(6)" }; |
| 67 | type bitstring BIT7 length(7) with { variant "FIELDLENGTH(7)" }; |
| 68 | type bitstring BIT8 length(8) with { variant "FIELDLENGTH(8)" }; |
| 69 | type bitstring BIT9 length(9) with { variant "FIELDLENGTH(9)" }; |
| 70 | type bitstring BIT10 length(10) with { variant "FIELDLENGTH(10)" }; |
| 71 | type bitstring BIT11 length(11) with { variant "FIELDLENGTH(11)" }; |
| 72 | type bitstring BIT12 length(12) with { variant "FIELDLENGTH(12)" }; |
| 73 | type bitstring BIT14 length(14) with { variant "FIELDLENGTH(14)" }; |
| 74 | type bitstring BIT15 length(15) with { variant "FIELDLENGTH(15)" }; |
| 75 | type bitstring BIT16 length(16) with { variant "FIELDLENGTH(16)" }; |
| 76 | type bitstring BIT24 length(24) with { variant "FIELDLENGTH(24)" }; |
| 77 | type bitstring BIT31 length(31) with { variant "FIELDLENGTH(31)" }; |
| 78 | type bitstring BIT56 length(56) with { variant "FIELDLENGTH(56)" }; |
| 79 | |
| 80 | //**************************************************** |
| 81 | // Octetstrings |
| 82 | //**************************************************** |
| 83 | |
| 84 | //octetstring with fixed length |
| 85 | type octetstring OCT0n length(0) with { variant "" }; |
| 86 | type octetstring OCT1n length(1) with { variant "" }; |
| 87 | type octetstring OCT2n length(2) with { variant "" }; |
| 88 | type octetstring OCT3n length(3) with { variant "" }; |
| 89 | type octetstring OCT4n length(4) with { variant "" }; |
| 90 | type octetstring OCT5n length(5) with { variant "" }; |
| 91 | type octetstring OCT6n length(6) with { variant "" }; |
| 92 | type octetstring OCT7n length(7) with { variant "" }; |
| 93 | type octetstring OCT8n length(8) with { variant "" }; |
| 94 | type octetstring OCT9n length(9) with { variant "" }; |
| 95 | type octetstring OCT10n length(10) with { variant "" }; |
| 96 | type octetstring OCT11n length(11) with { variant "" }; |
| 97 | type octetstring OCT12n length(12) with { variant "" }; |
| 98 | type octetstring OCT13n length(13) with { variant "" }; |
| 99 | type octetstring OCT14n length(14) with { variant "" }; |
| 100 | type octetstring OCT15n length(15) with { variant "" }; |
| 101 | type octetstring OCT16n length(16) with { variant "" }; |
| 102 | type octetstring OCT17n length(17) with { variant "" }; |
| 103 | type octetstring OCT18n length(18) with { variant "" }; |
| 104 | type octetstring OCT19n length(19) with { variant "" }; |
| 105 | type octetstring OCT20n length(20) with { variant "" }; |
| 106 | type octetstring OCT28n length(28) with { variant "" }; |
| 107 | type octetstring OCT32n length(32) with { variant "" }; |
| 108 | type octetstring OCT34n length(34) with { variant "" }; |
| 109 | type octetstring OCT46n length(46) with { variant "" }; |
| 110 | type octetstring OCT50n length(50) with { variant "" }; |
| 111 | type octetstring OCT69n length(69) with { variant "" }; |
| 112 | type octetstring OCT100n length(100) with { variant "" }; |
| 113 | type octetstring OCT128n length(128) with { variant "" }; |
| 114 | type octetstring OCT500n length(500) with { variant "" }; |
| 115 | type octetstring OCTNn with { variant "" }; |
| 116 | |
| 117 | //octetstring with length interval |
| 118 | type octetstring OCT1_3n length(1..3) with { variant "" }; |
| 119 | type octetstring OCT1_4n length(1..4) with { variant "" }; |
| 120 | type octetstring OCT1_5n length(1..5) with { variant "" }; |
| 121 | type octetstring OCT1_6n length(1..6) with { variant "" }; |
| 122 | type octetstring OCT1_7n length(1..7) with { variant "" }; |
| 123 | type octetstring OCT1_8n length(1..8) with { variant "" }; |
| 124 | type octetstring OCT1_12n length(1..12) with { variant "" }; |
| 125 | type octetstring OCT1_15n length(1..15) with { variant "" }; |
| 126 | type octetstring OCT1_16n length(1..16) with { variant "" }; |
| 127 | type octetstring OCT1_18n length(1..18) with { variant "" }; |
| 128 | type octetstring OCT1_20n length(1..20) with { variant "" }; |
| 129 | type octetstring OCT1_24n length(1..24) with { variant "" }; |
| 130 | type octetstring OCT1_32n length(1..32) with { variant "" }; |
| 131 | type octetstring OCT1_34n length(1..34) with { variant "" }; |
| 132 | type octetstring OCT1_46n length(1..46) with { variant "" }; |
| 133 | type octetstring OCT1_50n length(1..50) with { variant "" }; |
| 134 | type octetstring OCT1_112n length(1..112) with { variant "" }; |
| 135 | type octetstring OCT1_127n length(1..127) with { variant "" }; |
| 136 | type octetstring OCT1_128n length(1..128) with { variant "" }; |
| 137 | type octetstring OCT1_172n length(1..172) with { variant "" }; |
| 138 | type octetstring OCT3_5n length(3..5) with { variant "" }; |
| 139 | type octetstring OCT3_7n length(3..7) with { variant "" }; |
| 140 | type octetstring OCT3_8n length(3..8) with { variant "" }; |
| 141 | type octetstring OCT3_14n length(3..14) with { variant "" }; |
| 142 | type octetstring OCT3_17n length(3..17) with { variant "" }; |
| 143 | type octetstring OCT4_8n length(4..8) with { variant "" }; |
| 144 | |
| 145 | |
| 146 | //**************************************************** |
| 147 | // Charstrings |
| 148 | //**************************************************** |
| 149 | |
| 150 | //charstring with fixed length |
| 151 | type charstring CHAR4 length (4); |
| 152 | |
| 153 | //**************************************************** |
| 154 | // Hexstrings |
| 155 | //**************************************************** |
| 156 | |
| 157 | //hexstring with fixed length |
| 158 | type hexstring HEX4n length(4) with { variant "" }; |
| 159 | type hexstring HEX6n length(6) with { variant "" }; |
| 160 | type hexstring HEX8n length(8) with { variant "" }; |
| 161 | type hexstring HEX15n length(15) with { variant "" }; |
| 162 | type hexstring HEX16n length(16) with { variant "" }; |
| 163 | type hexstring HEX24n length(24) with { variant "" }; |
| 164 | |
| 165 | //hexstring with length interval |
| 166 | type hexstring HEX0_18n length(0..18) with { variant "" }; |
| 167 | type hexstring HEX1_20n length(1..20) with { variant "" }; |
| 168 | type hexstring HEX1_34n length(1..34) with { variant "" }; |
| 169 | |
| 170 | //**************************************************** |
| 171 | // Integers |
| 172 | //**************************************************** |
| 173 | |
| 174 | //integer with fixed bit number |
| 175 | type integer INT3nb (0..7) with { variant "" }; |
| 176 | type integer INT4nb (0..15) with { variant "" }; |
| 177 | type integer INT5nb (0..31) with { variant "" }; |
| 178 | type integer INT8nb (0..255) with { variant "" }; |
| 179 | |
| 180 | //integer with fixed bit number and with padding |
| 181 | type integer INT2nbp (0..3) with { variant "" }; |
| 182 | type integer INT1nbp (0..1) with { variant "" }; |
| 183 | type integer INT3nbp (0..7) with { variant "" }; |
| 184 | type integer INT5nbp (0..31) with { variant "" }; |
| 185 | type integer INT9nbp (0..511) with { variant "" }; |
| 186 | type integer INT13nbp (0..8191) with { variant "" }; |
| 187 | type integer INT15nbp (0..32767) with { variant "" }; |
| 188 | |
| 189 | } // end group NativeTypes |
| 190 | |
| 191 | //**************************************************** |
| 192 | //**************************************************** |
| 193 | // RAW Encoded Types |
| 194 | //**************************************************** |
| 195 | //**************************************************** |
| 196 | |
| 197 | group SimpleRAWEncodedTypes { |
| 198 | |
| 199 | //**************************************************** |
| 200 | // Bitstrings |
| 201 | //**************************************************** |
| 202 | |
| 203 | //bitstring with fixed length |
| 204 | type bitstring BIT6_BO_LAST length (6) with {variant "BYTEORDER(last)"}; |
| 205 | type bitstring BIT16_BO_LAST length (16) with {variant "BYTEORDER(last)"}; |
| 206 | type bitstring BIT32_BO_LAST length (32) with {variant "BYTEORDER(last)"}; |
| 207 | |
| 208 | //**************************************************** |
| 209 | // Octetstrings |
| 210 | //**************************************************** |
| 211 | //octetstring with fixed length |
| 212 | type octetstring Dummy length(0) with { variant "FIELDLENGTH(0)" }; |
| 213 | type octetstring OCT0 length(0) with { variant "FIELDLENGTH(0)" }; |
| 214 | type octetstring OCT1 length(1) with { variant "FIELDLENGTH(1)" }; |
| 215 | type octetstring OCT2 length(2) with { variant "FIELDLENGTH(2)" }; |
| 216 | type octetstring OCT3 length(3) with { variant "FIELDLENGTH(3)" }; |
| 217 | type octetstring OCT4 length(4) with { variant "FIELDLENGTH(4)" }; |
| 218 | type octetstring OCT5 length(5) with { variant "FIELDLENGTH(5)" }; |
| 219 | type octetstring OCT6 length(6) with { variant "FIELDLENGTH(6)" }; |
| 220 | type octetstring OCT7 length(7) with { variant "FIELDLENGTH(7)" }; |
| 221 | type octetstring OCT8 length(8) with { variant "FIELDLENGTH(8)" }; |
| 222 | type octetstring OCT9 length(9) with { variant "FIELDLENGTH(9)" }; |
| 223 | type octetstring OCT10 length(10) with { variant "FIELDLENGTH(10)" }; |
| 224 | type octetstring OCT11 length(11) with { variant "FIELDLENGTH(11)" }; |
| 225 | type octetstring OCT12 length(12) with { variant "FIELDLENGTH(12)" }; |
| 226 | type octetstring OCT13 length(13) with { variant "FIELDLENGTH(13)" }; |
| 227 | type octetstring OCT14 length(14) with { variant "FIELDLENGTH(14)" }; |
| 228 | type octetstring OCT15 length(15) with { variant "FIELDLENGTH(15)" }; |
| 229 | type octetstring OCT16 length(16) with { variant "FIELDLENGTH(16)" }; |
| 230 | type octetstring OCT17 length(17) with { variant "FIELDLENGTH(17)" }; |
| 231 | type octetstring OCT18 length(18) with { variant "FIELDLENGTH(18)" }; |
| 232 | type octetstring OCT19 length(19) with { variant "FIELDLENGTH(19)" }; |
| 233 | type octetstring OCT20 length(20) with { variant "FIELDLENGTH(20)" }; |
| 234 | type octetstring OCT32 length(32) with { variant "FIELDLENGTH(32)" }; |
| 235 | type octetstring OCT34 length(34) with { variant "FIELDLENGTH(34)" }; |
| 236 | type octetstring OCT46 length(46) with { variant "FIELDLENGTH(46)" }; |
| 237 | |
| 238 | //octetstring with length interval |
| 239 | type octetstring OCT1_260 length(1..260) with { variant "" }; |
| 240 | type octetstring OCT1_8 length(1..8) with { variant "" }; |
| 241 | type octetstring OCT1_12 length(1..12) with { variant "" }; |
| 242 | type octetstring OCT1_32 length(1..32) with { variant "" }; |
| 243 | type octetstring OCT1_50 length(1..50) with { variant "" }; |
| 244 | type octetstring OCT3_8 length(3..8) with { variant "" }; |
| 245 | |
| 246 | type octetstring OCTN with { variant "" }; |
| 247 | |
| 248 | //**************************************************** |
| 249 | // Hexstrings |
| 250 | //**************************************************** |
| 251 | |
| 252 | //hexstring with fixed length |
| 253 | type hexstring HEX1 length(1) with {variant "FIELDLENGTH(1)"}; |
| 254 | |
| 255 | //hexstring with length interval |
| 256 | type hexstring HEX0_16 length(0..16) with { variant "" }; |
| 257 | type hexstring HEX5_16 length(5..16) with { variant "" }; |
| 258 | type hexstring HEX1_32 length(1..32) with { variant "" }; |
| 259 | |
| 260 | |
| 261 | //**************************************************** |
| 262 | // Integers |
| 263 | //**************************************************** |
| 264 | |
| 265 | //integer with fixed octet number |
| 266 | type integer INT1 (0..255) with { variant "FIELDLENGTH(8)" }; |
| 267 | type integer LIN1 (0..255) with { variant "FIELDLENGTH(8)" }; |
| 268 | type integer LIN2 (0..65535) with { variant "FIELDLENGTH(16)" }; |
| 269 | type integer LIN2_BO_LAST (0..65535) with { variant "FIELDLENGTH(16), COMP(nosign), BYTEORDER(last)" }; |
| 270 | type integer LIN3_BO_LAST (0..16777215) with { variant "FIELDLENGTH(24), COMP(nosign), BYTEORDER(last)" }; |
| 271 | type integer LIN4_BO_LAST (0..4294967295) with { variant "FIELDLENGTH(32), COMP(nosign), BYTEORDER(last)" }; |
| 272 | |
| 273 | //integer with fixed bit number |
| 274 | type integer INT1b (0..1) with { variant "FIELDLENGTH(1)" }; |
| 275 | type integer INT2b (0..3) with { variant "FIELDLENGTH(2)" }; |
| 276 | type integer INT3b (0..7) with { variant "FIELDLENGTH(3)" }; |
| 277 | type integer INT4b (0..15) with { variant "FIELDLENGTH(4)" }; |
| 278 | type integer INT5b (0..31) with { variant "FIELDLENGTH(5)" }; |
| 279 | type integer INT6b (0..63) with { variant "FIELDLENGTH(6)" }; |
| 280 | type integer INT7b (0..127) with { variant "FIELDLENGTH(7)" }; |
| 281 | type integer INT11b_BO_LAST ( 0 .. 2047 ) with { variant "FIELDLENGTH(11), COMP(nosign), BYTEORDER(last)" }; |
| 282 | type integer INT12b_BO_LAST ( 0 .. 4095 ) with { variant "FIELDLENGTH(12), COMP(nosign), BYTEORDER(last)" }; |
| 283 | type integer INT13b_BO_LAST ( 0 .. 8191 ) with { variant "FIELDLENGTH(13), COMP(nosign), BYTEORDER(last)" }; |
| 284 | type integer INT14b_BO_LAST ( 0 .. 16383 ) with { variant "FIELDLENGTH(14), COMP(nosign), BYTEORDER(last)" }; |
Harald Welte | 7348940 | 2018-02-05 09:15:17 +0100 | [diff] [blame] | 285 | type integer INT18b_BO_LAST ( 0 .. 262143 ) with { variant "FIELDLENGTH(18), COMP(nosign), BYTEORDER(last)" }; |
Harald Welte | 3b8bdd6 | 2017-07-19 19:57:26 +0200 | [diff] [blame] | 286 | type integer INT20b_BO_LAST ( 0 .. 1048575 ) with { variant "FIELDLENGTH(20), COMP(nosign), BYTEORDER(last)" }; |
| 287 | type integer INT31b_BO_LAST ( 0 .. 2147483647 ) with { variant "FIELDLENGTH(31), COMP(nosign), BYTEORDER(last)" }; |
| 288 | |
| 289 | //**************************************************** |
| 290 | // Structures |
| 291 | //**************************************************** |
| 292 | |
| 293 | //integer record |
| 294 | type record of integer Integers with { variant "" }; |
| 295 | type record of Integers Integer_array with { variant "" }; |
| 296 | |
| 297 | } // end group SimpleRAWEncodedTypes |
| 298 | |
| 299 | group ComponentTypes { |
| 300 | type component Dummy_comptype {} |
| 301 | type component Dummy_CT {} |
| 302 | } // end group ComponentTypes |
| 303 | |
| 304 | group CompositeTypes { |
| 305 | type enumerated Protocols |
| 306 | { mtp3, sccp, isup, bicc, qaal2, gcp, bssap, bssmap, ranap, dtap } |
| 307 | |
| 308 | type record of OCT1 OCT1List with { variant "" }; |
| 309 | type record of OCT2 OCT2List with { variant "" }; |
| 310 | type record of OCT3 OCT3List with { variant "" }; |
| 311 | type record of OCT4 OCT4List with { variant "" }; |
| 312 | type record of OCT5 OCT5List with { variant "" }; |
| 313 | type record of OCT6 OCT6List with { variant "" }; |
| 314 | type record of OCT7 OCT7List with { variant "" }; |
| 315 | |
Harald Welte | 9c0bddf | 2017-12-08 13:58:08 +0100 | [diff] [blame] | 316 | type record of Dummy_comptype ListOfDummy_comptype; |
| 317 | type record of Dummy_CT ListOfDummy_CT; |
Harald Welte | 3b8bdd6 | 2017-07-19 19:57:26 +0200 | [diff] [blame] | 318 | type record of Protocols ProtocolList with { variant "" }; |
| 319 | } // end group CompositeTypes |
| 320 | |
Harald Welte | 9c0bddf | 2017-12-08 13:58:08 +0100 | [diff] [blame] | 321 | } with { encode "RAW" } /* End of module General_Types */ |
Harald Welte | 3b8bdd6 | 2017-07-19 19:57:26 +0200 | [diff] [blame] | 322 | |