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: MobileL3_Types.ttcn |
| 13 | // Rev: R1B |
| 14 | // Prodnr: CNL 113 832 |
| 15 | // Contact: http://ttcn.ericsson.se |
| 16 | // Reference: 3GPP TS 24.008 v13.4.0 |
| 17 | |
| 18 | module MobileL3_Types |
| 19 | { |
| 20 | |
| 21 | import from General_Types all; |
| 22 | import from MobileL3_CommonIE_Types all; |
| 23 | import from MobileL3_GMM_SM_Types all; |
| 24 | import from MobileL3_MM_Types all; |
| 25 | import from MobileL3_CC_Types all; |
| 26 | import from MobileL3_RRM_Types all; |
| 27 | import from MobileL3_SMS_Types all; |
| 28 | import from MobileL3_SS_Types all; |
| 29 | |
| 30 | external function enc_PDU_L3_MS_SGSN(in PDU_L3_MS_SGSN pdu) return octetstring |
| 31 | with { extension "prototype(convert)" extension "encode(RAW)" } |
| 32 | external function enc_PDU_L3_MS_SGSN_fast(in PDU_L3_MS_SGSN pdu, out octetstring stream) |
| 33 | with { extension "prototype(fast)" extension "encode(RAW)" } |
| 34 | |
| 35 | // new external function for decoding MS -> SGSN |
| 36 | external function dec_PDU_L3_MS_SGSN(in octetstring stream) return PDU_L3_MS_SGSN |
| 37 | with { extension "prototype(convert)" extension "decode(RAW)" } |
| 38 | external function dec_PDU_L3_MS_SGSN_backtrack(in octetstring stream, out PDU_L3_MS_SGSN pdu) return integer |
| 39 | with { extension "prototype(backtrack)" extension "decode(RAW)" } |
| 40 | |
| 41 | // new external function for encoding SGSN -> MS |
| 42 | external function enc_PDU_L3_SGSN_MS(in PDU_L3_SGSN_MS pdu) return octetstring |
| 43 | with { extension "prototype(convert)" extension "encode(RAW)" } |
| 44 | external function enc_PDU_L3_SGSN_MS_fast(in PDU_L3_SGSN_MS pdu, out octetstring stream) |
| 45 | with { extension "prototype(fast)" extension "encode(RAW)" } |
| 46 | |
| 47 | external function dec_PDU_L3_SGSN_MS(in octetstring stream) return PDU_L3_SGSN_MS |
| 48 | with { extension "prototype(convert)" extension "decode(RAW)" } |
| 49 | external function dec_PDU_L3_SGSN_MS_backtrack(in octetstring stream, out PDU_L3_SGSN_MS pdu) return integer |
| 50 | with { extension "prototype(backtrack)" extension "decode(RAW)" } |
| 51 | |
| 52 | external function enc_PDU_ML3_NW_MS(in PDU_ML3_NW_MS pdu) return octetstring |
| 53 | with { extension "prototype(convert)" extension " encode(RAW)" } |
| 54 | external function enc_PDU_ML3_NW_MS_fast(in PDU_ML3_NW_MS pdu, out octetstring stream) |
| 55 | with { extension "prototype(fast)" extension " encode(RAW)" } |
| 56 | |
| 57 | external function dec_PDU_ML3_NW_MS(in octetstring stream) return PDU_ML3_NW_MS |
| 58 | with { extension "prototype(convert)" extension " decode(RAW)" } |
| 59 | external function dec_PDU_ML3_NW_MS_backtrack(in octetstring stream, out PDU_ML3_NW_MS pdu) return integer |
| 60 | with { extension "prototype(backtrack)" extension " decode(RAW)" } |
| 61 | |
| 62 | external function enc_PDU_ML3_MS_NW(in PDU_ML3_MS_NW pdu) return octetstring |
| 63 | with { extension "prototype(convert)" extension " encode(RAW)" } |
| 64 | external function enc_PDU_ML3_MS_NW_fast(in PDU_ML3_MS_NW pdu, out octetstring stream) |
| 65 | with { extension "prototype(fast)" extension " encode(RAW)" } |
| 66 | |
| 67 | external function dec_PDU_ML3_MS_NW(in octetstring stream) return PDU_ML3_MS_NW |
| 68 | with { extension "prototype(convert)" extension " decode(RAW)" } |
| 69 | external function dec_PDU_ML3_MS_NW_backtrack(in octetstring stream, out PDU_ML3_MS_NW pdu) return integer |
| 70 | with { extension "prototype(backtrack)" extension " decode(RAW)" } |
| 71 | |
| 72 | // *************************************************************************** |
| 73 | // * The container types of all L3_PDU |
| 74 | // *************************************************************************** |
| 75 | type record L3_TransactionId |
| 76 | { |
| 77 | BIT3 tio, |
| 78 | BIT1 tiFlag , |
| 79 | TI_Extension tIExtension optional |
| 80 | // an extension octet (TI) can be used for session management messages |
| 81 | // not yet implemented (see 24.008 clause 10.3.2 for more detail |
| 82 | } with { variant (tIExtension) "PRESENCE(tio = '111'B)" }; |
| 83 | |
| 84 | type record L3_TransactionId_not_extended |
| 85 | { |
| 86 | BIT3 tio, |
| 87 | BIT1 tiFlag |
| 88 | }; |
| 89 | |
| 90 | type union TiOrSkip_not_extended |
| 91 | { |
| 92 | BIT4 skipIndicator, |
| 93 | L3_TransactionId_not_extended transactionId |
| 94 | }; |
| 95 | |
| 96 | |
| 97 | type union TiOrSkip |
| 98 | { |
| 99 | BIT4 skipIndicator, |
| 100 | L3_TransactionId transactionId |
| 101 | }; |
| 102 | |
| 103 | type union L3_Discr_SGSN_MS |
| 104 | { |
| 105 | octetstring gcc, //group call control |
| 106 | octetstring bcc, // broadcast call control |
| 107 | octetstring cc, // call control; call related SS messages PDU_ypes_CC_MSC_MS |
| 108 | octetstring gttp, // GPRS Transparent Transport Protocol |
| 109 | octetstring mm, // mobility management messages PDU_DTAP_MM |
| 110 | octetstring rrm, // radio resource management messages PDU_DTAP_RRM |
| 111 | L3_GMM_SGSN_MS gprs_mm, // GPRS mobility management messages |
| 112 | octetstring sms, // SMS messages |
| 113 | L3_GSM_SGSN_MS gprs_sm, // GPRS session management messages |
| 114 | octetstring ss, // non call related SS messages |
| 115 | octetstring loc, // Location services |
| 116 | octetstring reserved |
| 117 | }; |
| 118 | |
| 119 | |
| 120 | type record PDU_L3_SGSN_MS_unextended_ti |
| 121 | { |
| 122 | BIT4 discriminator, |
| 123 | TiOrSkip_not_extended tiOrSkip, |
| 124 | L3_Discr_SGSN_MS msgs |
| 125 | } with { variant (msgs)"CROSSTAG( |
| 126 | gcc, discriminator='0000'B; |
| 127 | bcc, discriminator='0001'B; |
| 128 | cc, discriminator='0011'B; |
| 129 | gttp, discriminator='0100'B; |
| 130 | mm, discriminator='0101'B; |
| 131 | rrm, discriminator='0110'B; |
| 132 | gprs_mm, discriminator='1000'B; |
| 133 | sms, discriminator='1001'B; |
| 134 | gprs_sm, discriminator='1010'B; |
| 135 | ss, discriminator='1011'B; |
| 136 | loc, discriminator='1100'B; |
| 137 | reserved, { discriminator='0010'B, |
| 138 | discriminator='0111'B, |
| 139 | discriminator='1101'B, |
| 140 | discriminator='1110'B, |
| 141 | discriminator='1111'B } |
| 142 | )"; |
| 143 | variant (tiOrSkip)"CROSSTAG( |
| 144 | skipIndicator, { discriminator='0000'B, |
| 145 | discriminator='0001'B, |
| 146 | discriminator='0010'B, |
| 147 | discriminator='0100'B, |
| 148 | discriminator='0101'B, |
| 149 | discriminator='0110'B, |
| 150 | discriminator='0111'B, |
| 151 | discriminator='1000'B, |
| 152 | discriminator='1100'B, |
| 153 | discriminator='1101'B, |
| 154 | discriminator='1110'B, |
| 155 | discriminator='1111'B }; |
| 156 | transactionId, { discriminator='0011'B, |
| 157 | discriminator='1001'B, |
| 158 | discriminator='1011'B, |
| 159 | discriminator='1010'B } |
| 160 | )"; |
| 161 | }; |
| 162 | |
| 163 | |
| 164 | type record PDU_L3_SGSN_MS |
| 165 | { |
| 166 | BIT4 discriminator, |
| 167 | TiOrSkip tiOrSkip, |
| 168 | L3_Discr_SGSN_MS msgs |
| 169 | } with { variant (msgs)"CROSSTAG( |
| 170 | gcc, discriminator='0000'B; |
| 171 | bcc, discriminator='0001'B; |
| 172 | cc, discriminator='0011'B; |
| 173 | gttp, discriminator='0100'B; |
| 174 | mm, discriminator='0101'B; |
| 175 | rrm, discriminator='0110'B; |
| 176 | gprs_mm, discriminator='1000'B; |
| 177 | sms, discriminator='1001'B; |
| 178 | gprs_sm, discriminator='1010'B; |
| 179 | ss, discriminator='1011'B; |
| 180 | loc, discriminator='1100'B; |
| 181 | reserved, { discriminator='0010'B, |
| 182 | discriminator='0111'B, |
| 183 | discriminator='1101'B, |
| 184 | discriminator='1110'B, |
| 185 | discriminator='1111'B } |
| 186 | )"; |
| 187 | variant (tiOrSkip)"CROSSTAG( |
| 188 | skipIndicator, { discriminator='0000'B, |
| 189 | discriminator='0001'B, |
| 190 | discriminator='0010'B, |
| 191 | discriminator='0100'B, |
| 192 | discriminator='0101'B, |
| 193 | discriminator='0110'B, |
| 194 | discriminator='0111'B, |
| 195 | discriminator='1000'B, |
| 196 | discriminator='1100'B, |
| 197 | discriminator='1101'B, |
| 198 | discriminator='1110'B, |
| 199 | discriminator='1111'B }; |
| 200 | transactionId, { discriminator='0011'B, |
| 201 | discriminator='1011'B, |
| 202 | discriminator='1001'B, |
| 203 | discriminator='1010'B } |
| 204 | )"; |
| 205 | }; |
| 206 | |
| 207 | |
| 208 | type union L3_Discr_MS_SGSN |
| 209 | { |
| 210 | octetstring gcc, //group call control |
| 211 | octetstring bcc, // broadcast call control |
| 212 | octetstring cc, // call control; call related SS messages PDU_DTAP_CC_MS_MSC |
| 213 | octetstring gttp, // GPRS Transparent Transport Protocol |
| 214 | octetstring mm, // mobility management messages PDU_DTAP_MM |
| 215 | octetstring rrm, // radio resource management messages PDU_DTAP_RRM |
| 216 | L3_GMM_MS_SGSN gprs_mm, // GPRS mobility management messages |
| 217 | octetstring sms, // SMS messages |
| 218 | L3_GSM_MS_SGSN gprs_sm, // GPRS session management messages |
| 219 | octetstring ss, // non call related SS messages |
| 220 | octetstring loc, // Location services |
| 221 | octetstring reserved |
| 222 | }; |
| 223 | |
| 224 | |
| 225 | type record PDU_L3_MS_SGSN |
| 226 | { |
| 227 | BIT4 discriminator, |
| 228 | TiOrSkip tiOrSkip, |
| 229 | L3_Discr_MS_SGSN msgs |
| 230 | } with { variant (msgs)"CROSSTAG( |
| 231 | gcc, discriminator='0000'B; |
| 232 | bcc, discriminator='0001'B; |
| 233 | cc, discriminator='0011'B; |
| 234 | gttp, discriminator='0100'B; |
| 235 | mm, discriminator='0101'B; |
| 236 | rrm, discriminator='0110'B; |
| 237 | gprs_mm, discriminator='1000'B; |
| 238 | sms, discriminator='1001'B; |
| 239 | gprs_sm, discriminator='1010'B; |
| 240 | ss, discriminator='1011'B; |
| 241 | loc, discriminator='1100'B; |
| 242 | reserved, { discriminator='0010'B, |
| 243 | discriminator='0111'B, |
| 244 | discriminator='1101'B, |
| 245 | discriminator='1110'B, |
| 246 | discriminator='1111'B } |
| 247 | )"; |
| 248 | variant (tiOrSkip)"CROSSTAG( |
| 249 | skipIndicator, { discriminator='0000'B, |
| 250 | discriminator='0001'B, |
| 251 | discriminator='0010'B, |
| 252 | discriminator='0100'B, |
| 253 | discriminator='0101'B, |
| 254 | discriminator='0110'B, |
| 255 | discriminator='0111'B, |
| 256 | discriminator='1000'B, |
| 257 | discriminator='1100'B, |
| 258 | discriminator='1101'B, |
| 259 | discriminator='1110'B, |
| 260 | discriminator='1111'B }; |
| 261 | transactionId, { discriminator='0011'B, |
| 262 | discriminator='1001'B, |
| 263 | discriminator='1011'B, |
| 264 | discriminator='1010'B } |
| 265 | )"; |
| 266 | }; |
| 267 | |
| 268 | |
| 269 | //*************************************************************************** |
| 270 | // 24.007/11.2.3.1.1 and 24.008/10.2 Protocol Discriminator NW->MS |
| 271 | //*************************************************************************** |
| 272 | type union ML3_Discr_NW_MS |
| 273 | { |
| 274 | octetstring gcc, // group call control <- 24.068 WITHDRAWN |
| 275 | octetstring bcc, // broadcast call control <- 24.069 WITHDRAWN |
| 276 | PDU_ML3_CC_NW_MS cc, // call control; call related SS messages <-24.008, implemented |
| 277 | octetstring gttp, // GPRS Transparent Transport Protocol <- not required in MSC |
| 278 | PDU_ML3_MM mm, // mobility management messages <- 24.008, |
| 279 | PDU_RRM_NW_MS rrm, // radio resource management messages <- 24.008, 24.018 |
| 280 | octetstring gprs_mm, // GPRS mobility management messages <- Not required in MSC |
| 281 | // but implemented as L3_GMM_SGSN_MS in L3_Types (SGSN) |
| 282 | L3_SMS_SGSN_MS sms, // SMS messages |
| 283 | //<-24.011, imported from L3_SMS_Types |
| 284 | octetstring gprs_sm, // GPRS session management messages <- not required in MSC |
| 285 | // but impl. as L3_GMM_MS_SGSN in L3_GSM_SGSN_MS_Types |
| 286 | PDU_ML3_SS_NW_MS ss, // non call related SS messages |
| 287 | //<- 24.080 ASN1 or implemented by ethgbh |
| 288 | octetstring loc, // Location services(LCS) <- 24.030 |
| 289 | octetstring reserved |
| 290 | }; |
| 291 | |
| 292 | |
| 293 | // ref: 24.007/11.2.3.1.1 "Protocol discriminator" and |
| 294 | // Table 11.2 "Protocol dicriminator values" |
| 295 | type record PDU_ML3_NW_MS |
| 296 | { |
| 297 | BIT4 discriminator, //24.008/10.2 |
| 298 | TiOrSkip tiOrSkip, //24.008/10.3 |
| 299 | ML3_Discr_NW_MS msgs |
| 300 | } with { variant (msgs)"CROSSTAG( |
| 301 | gcc, discriminator='0000'B; |
| 302 | bcc, discriminator='0001'B; |
| 303 | cc, discriminator='0011'B; |
| 304 | gttp, discriminator='0100'B; |
| 305 | mm, discriminator='0101'B; |
| 306 | rrm, discriminator='0110'B; |
| 307 | gprs_mm, discriminator='1000'B; |
| 308 | sms, discriminator='1001'B; |
| 309 | gprs_sm, discriminator='1010'B; |
| 310 | ss, discriminator='1011'B; |
| 311 | loc, discriminator='1100'B; |
| 312 | reserved, { discriminator='0010'B, |
| 313 | discriminator='0111'B, |
| 314 | discriminator='1101'B, |
| 315 | discriminator='1110'B, |
| 316 | discriminator='1111'B } |
| 317 | )"; |
| 318 | variant (tiOrSkip)"CROSSTAG( |
| 319 | skipIndicator, { discriminator='0000'B, |
| 320 | discriminator='0001'B, |
| 321 | discriminator='0010'B, |
| 322 | discriminator='0100'B, |
| 323 | discriminator='0101'B, |
| 324 | discriminator='0110'B, |
| 325 | discriminator='0111'B, |
| 326 | discriminator='1000'B, |
| 327 | discriminator='1100'B, |
| 328 | discriminator='1101'B, |
| 329 | discriminator='1110'B, |
| 330 | discriminator='1111'B }; |
| 331 | transactionId, { discriminator='0011'B, |
| 332 | discriminator='1001'B, |
| 333 | discriminator='1011'B, |
| 334 | discriminator='1010'B } |
| 335 | )"; |
| 336 | }; |
| 337 | |
| 338 | |
| 339 | type union ML3_Discr_MS_NW |
| 340 | { |
| 341 | octetstring gcc, //group call control |
| 342 | octetstring bcc, // broadcast call control |
| 343 | PDU_ML3_CC_MS_NW cc, // call control; call related SS messages |
| 344 | octetstring gttp, // GPRS Transparent Transport Protocol |
| 345 | PDU_ML3_MM mm, // mobility management messages |
| 346 | PDU_RRM_MS_NW rrm, // radio resource management messages |
| 347 | octetstring gprs_mm, // GPRS mobility management messages |
| 348 | L3_SMS_MS_SGSN sms, // SMS messages |
| 349 | octetstring gprs_sm, // GPRS session management messages |
| 350 | PDU_ML3_SS_MS_NW ss, // non call related SS messages |
| 351 | octetstring loc, // Location services |
| 352 | octetstring reserved |
| 353 | }; |
| 354 | |
| 355 | type record PDU_ML3_MS_NW |
| 356 | { |
| 357 | BIT4 discriminator, |
| 358 | TiOrSkip tiOrSkip, |
| 359 | ML3_Discr_MS_NW msgs |
| 360 | } with { variant (msgs)"CROSSTAG( |
| 361 | gcc, discriminator='0000'B; |
| 362 | bcc, discriminator='0001'B; |
| 363 | cc, discriminator='0011'B; |
| 364 | gttp, discriminator='0100'B; |
| 365 | mm, discriminator='0101'B; |
| 366 | rrm, discriminator='0110'B; |
| 367 | gprs_mm, discriminator='1000'B; |
| 368 | sms, discriminator='1001'B; |
| 369 | gprs_sm, discriminator='1010'B; |
| 370 | ss, discriminator='1011'B; |
| 371 | loc, discriminator='1100'B; |
| 372 | reserved, { discriminator='0010'B, |
| 373 | discriminator='0111'B, |
| 374 | discriminator='1101'B, |
| 375 | discriminator='1110'B, |
| 376 | discriminator='1111'B } |
| 377 | )"; |
| 378 | variant (tiOrSkip)"CROSSTAG( |
| 379 | skipIndicator, { discriminator='0000'B, |
| 380 | discriminator='0001'B, |
| 381 | discriminator='0010'B, |
| 382 | discriminator='0100'B, |
| 383 | discriminator='0101'B, |
| 384 | discriminator='0110'B, |
| 385 | discriminator='0111'B, |
| 386 | discriminator='1000'B, |
| 387 | discriminator='1100'B, |
| 388 | discriminator='1101'B, |
| 389 | discriminator='1110'B, |
| 390 | discriminator='1111'B }; |
| 391 | transactionId, { discriminator='0011'B, //24.008/10.3.2 |
| 392 | discriminator='1001'B, |
| 393 | discriminator='1011'B, |
| 394 | discriminator='1010'B } //24.008/10.3.2 |
| 395 | )"; |
| 396 | }; |
| 397 | |
| 398 | }//end of module |
| 399 | with { |
| 400 | extension "version R1B" |
| 401 | encode "RAW" |
| 402 | } |
| 403 | |