// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 11.1.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2025 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "MobileL3_Types.hh"

namespace MobileL3__Types {

/* Literal string constants */

const unsigned char bs_1_bits[] = { 0 },
bs_2_bits[] = { 8 },
bs_12_bits[] = { 4 },
bs_3_bits[] = { 12 },
bs_4_bits[] = { 2 },
bs_5_bits[] = { 10 },
bs_6_bits[] = { 6 },
bs_13_bits[] = { 14 },
bs_7_bits[] = { 1 },
bs_8_bits[] = { 9 },
bs_9_bits[] = { 5 },
bs_10_bits[] = { 13 },
bs_11_bits[] = { 3 },
bs_14_bits[] = { 11 },
bs_0_bits[] = { 7 },
bs_15_bits[] = { 7 },
bs_16_bits[] = { 15 };
extern const BITSTRING bs_1(4, bs_1_bits),
bs_2(4, bs_2_bits),
bs_12(4, bs_12_bits),
bs_3(4, bs_3_bits),
bs_4(4, bs_4_bits),
bs_5(4, bs_5_bits),
bs_6(4, bs_6_bits),
bs_13(4, bs_13_bits),
bs_7(4, bs_7_bits),
bs_8(4, bs_8_bits),
bs_9(4, bs_9_bits),
bs_10(4, bs_10_bits),
bs_11(4, bs_11_bits),
bs_14(4, bs_14_bits),
bs_0(3, bs_0_bits),
bs_15(4, bs_15_bits),
bs_16(4, bs_16_bits);
const unsigned char module_checksum[] = { 0xa0, 0xf4, 0x75, 0x8f, 0xdf, 0x45, 0x95, 0xa4, 0x9c, 0x8f, 0xdc, 0x3e, 0x00, 0xcd, 0xd4, 0x4f };

/* Global variable definitions */

const XERdescriptor_t       L3__TransactionId_tio_xer_ = { {"tio>\n", "tio>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t L3__TransactionId_tio_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t L3__TransactionId_tio_descr_ = { "@MobileL3_Types.L3_TransactionId.tio", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &L3__TransactionId_tio_xer_, &BITSTRING_json_, &L3__TransactionId_tio_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId_tio_default_coding("RAW");
const XERdescriptor_t       L3__TransactionId_tiFlag_xer_ = { {"tiFlag>\n", "tiFlag>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t L3__TransactionId_tiFlag_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t L3__TransactionId_tiFlag_descr_ = { "@MobileL3_Types.L3_TransactionId.tiFlag", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &L3__TransactionId_tiFlag_xer_, &BITSTRING_json_, &L3__TransactionId_tiFlag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId_tiFlag_default_coding("RAW");
const TTCN_RAWdescriptor_t L3__TransactionId_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__TransactionId
const TTCN_Typedescriptor_t L3__TransactionId_descr_ = { "@MobileL3_Types.L3_TransactionId", NULL, &L3__TransactionId_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t L3__TransactionId_tIExtension_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__TransactionId_tIExtension
const TTCN_Typedescriptor_t L3__TransactionId_tIExtension_descr_ = { "@MobileL3_Types.L3_TransactionId.tIExtension", NULL, &L3__TransactionId_tIExtension_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId_tIExtension_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__TransactionId_default_coding("RAW");
const XERdescriptor_t       L3__TransactionId__not__extended_tio_xer_ = { {"tio>\n", "tio>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t L3__TransactionId__not__extended_tio_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t L3__TransactionId__not__extended_tio_descr_ = { "@MobileL3_Types.L3_TransactionId_not_extended.tio", &BITSTRING_ber_, &General__Types::BIT3_raw_, NULL, &L3__TransactionId__not__extended_tio_xer_, &BITSTRING_json_, &L3__TransactionId__not__extended_tio_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId__not__extended_tio_default_coding("RAW");
const XERdescriptor_t       L3__TransactionId__not__extended_tiFlag_xer_ = { {"tiFlag>\n", "tiFlag>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t L3__TransactionId__not__extended_tiFlag_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t L3__TransactionId__not__extended_tiFlag_descr_ = { "@MobileL3_Types.L3_TransactionId_not_extended.tiFlag", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &L3__TransactionId__not__extended_tiFlag_xer_, &BITSTRING_json_, &L3__TransactionId__not__extended_tiFlag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId__not__extended_tiFlag_default_coding("RAW");
const TTCN_RAWdescriptor_t L3__TransactionId__not__extended_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__TransactionId__not__extended
const TTCN_Typedescriptor_t L3__TransactionId__not__extended_descr_ = { "@MobileL3_Types.L3_TransactionId_not_extended", NULL, &L3__TransactionId__not__extended_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__TransactionId__not__extended_default_coding("RAW");
const TTCN_RAWdescriptor_t TiOrSkip__not__extended_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TiOrSkip__not__extended
const TTCN_Typedescriptor_t TiOrSkip__not__extended_descr_ = { "@MobileL3_Types.TiOrSkip_not_extended", NULL, &TiOrSkip__not__extended_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       TiOrSkip__not__extended_skipIndicator_xer_ = { {"skipIndicator>\n", "skipIndicator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TiOrSkip__not__extended_skipIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TiOrSkip__not__extended_skipIndicator_descr_ = { "@MobileL3_Types.TiOrSkip_not_extended.skipIndicator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TiOrSkip__not__extended_skipIndicator_xer_, &BITSTRING_json_, &TiOrSkip__not__extended_skipIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TiOrSkip__not__extended_skipIndicator_default_coding("RAW");
UNIVERSAL_CHARSTRING TiOrSkip__not__extended_transactionId_default_coding("RAW");
UNIVERSAL_CHARSTRING TiOrSkip__not__extended_default_coding("RAW");
const TTCN_RAWdescriptor_t TiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TiOrSkip
const TTCN_Typedescriptor_t TiOrSkip_descr_ = { "@MobileL3_Types.TiOrSkip", NULL, &TiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       TiOrSkip_skipIndicator_xer_ = { {"skipIndicator>\n", "skipIndicator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TiOrSkip_skipIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TiOrSkip_skipIndicator_descr_ = { "@MobileL3_Types.TiOrSkip.skipIndicator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &TiOrSkip_skipIndicator_xer_, &BITSTRING_json_, &TiOrSkip_skipIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TiOrSkip_skipIndicator_default_coding("RAW");
UNIVERSAL_CHARSTRING TiOrSkip_transactionId_default_coding("RAW");
UNIVERSAL_CHARSTRING TiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t L3__Discr__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__Discr__SGSN__MS
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS", NULL, &L3__Discr__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       L3__Discr__SGSN__MS_gcc_xer_ = { {"gcc>\n", "gcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_gcc_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_gcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_gcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_gcc_oer_ext_arr_, 0, L3__Discr__SGSN__MS_gcc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_gcc_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.gcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_gcc_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_gcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_gcc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_bcc_xer_ = { {"bcc>\n", "bcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_bcc_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_bcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_bcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_bcc_oer_ext_arr_, 0, L3__Discr__SGSN__MS_bcc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_bcc_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.bcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_bcc_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_bcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_bcc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_cc_xer_ = { {"cc>\n", "cc>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_cc_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_cc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_cc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_cc_oer_ext_arr_, 0, L3__Discr__SGSN__MS_cc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_cc_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.cc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_cc_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_cc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_cc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_gttp_xer_ = { {"gttp>\n", "gttp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_gttp_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_gttp_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_gttp_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_gttp_oer_ext_arr_, 0, L3__Discr__SGSN__MS_gttp_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_gttp_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.gttp", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_gttp_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_gttp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_gttp_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_mm_xer_ = { {"mm>\n", "mm>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_mm_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_mm_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_mm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_mm_oer_ext_arr_, 0, L3__Discr__SGSN__MS_mm_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_mm_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.mm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_mm_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_mm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_mm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_rrm_xer_ = { {"rrm>\n", "rrm>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_rrm_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_rrm_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_rrm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_rrm_oer_ext_arr_, 0, L3__Discr__SGSN__MS_rrm_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_rrm_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.rrm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_rrm_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_rrm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_rrm_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_gprs__mm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_sms_xer_ = { {"sms>\n", "sms>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_sms_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_sms_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_sms_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_sms_oer_ext_arr_, 0, L3__Discr__SGSN__MS_sms_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_sms_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.sms", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_sms_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_sms_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_sms_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_gprs__sm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_ss_xer_ = { {"ss>\n", "ss>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_ss_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_ss_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_ss_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_ss_oer_ext_arr_, 0, L3__Discr__SGSN__MS_ss_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_ss_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.ss", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_ss_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_ss_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_ss_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_loc_xer_ = { {"loc>\n", "loc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_loc_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_loc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_loc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_loc_oer_ext_arr_, 0, L3__Discr__SGSN__MS_loc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_loc_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.loc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_loc_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_loc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_loc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__SGSN__MS_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__SGSN__MS_reserved_oer_ext_arr_[0] = {};
const int L3__Discr__SGSN__MS_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__SGSN__MS_reserved_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__SGSN__MS_reserved_oer_ext_arr_, 0, L3__Discr__SGSN__MS_reserved_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__SGSN__MS_reserved_descr_ = { "@MobileL3_Types.L3_Discr_SGSN_MS.reserved", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__SGSN__MS_reserved_xer_, &OCTETSTRING_json_, &L3__Discr__SGSN__MS_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_reserved_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__SGSN__MS_default_coding("RAW");
const XERdescriptor_t       PDU__L3__SGSN__MS__unextended__ti_discriminator_xer_ = { {"discriminator>\n", "discriminator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__L3__SGSN__MS__unextended__ti_discriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS__unextended__ti_discriminator_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.discriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__L3__SGSN__MS__unextended__ti_discriminator_xer_, &BITSTRING_json_, &PDU__L3__SGSN__MS__unextended__ti_discriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS__unextended__ti_discriminator_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS__unextended__ti_tiOrSkip
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.tiOrSkip", NULL, &PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS__unextended__ti_msgs_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS__unextended__ti_msgs
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS__unextended__ti_msgs_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.msgs", NULL, &PDU__L3__SGSN__MS__unextended__ti_msgs_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS__unextended__ti_msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS__unextended__ti_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS__unextended__ti
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS__unextended__ti_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti", NULL, &PDU__L3__SGSN__MS__unextended__ti_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS__unextended__ti_default_coding("RAW");
const XERdescriptor_t       PDU__L3__SGSN__MS_discriminator_xer_ = { {"discriminator>\n", "discriminator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__L3__SGSN__MS_discriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS_discriminator_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS.discriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__L3__SGSN__MS_discriminator_xer_, &BITSTRING_json_, &PDU__L3__SGSN__MS_discriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS_discriminator_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS_tiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS_tiOrSkip
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS_tiOrSkip_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS.tiOrSkip", NULL, &PDU__L3__SGSN__MS_tiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS_tiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS_msgs_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS_msgs
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS_msgs_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS.msgs", NULL, &PDU__L3__SGSN__MS_msgs_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS_msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__SGSN__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__SGSN__MS
const TTCN_Typedescriptor_t PDU__L3__SGSN__MS_descr_ = { "@MobileL3_Types.PDU_L3_SGSN_MS", NULL, &PDU__L3__SGSN__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__SGSN__MS_default_coding("RAW");
const TTCN_RAWdescriptor_t L3__Discr__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for L3__Discr__MS__SGSN
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN", NULL, &L3__Discr__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       L3__Discr__MS__SGSN_gcc_xer_ = { {"gcc>\n", "gcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_gcc_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_gcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_gcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_gcc_oer_ext_arr_, 0, L3__Discr__MS__SGSN_gcc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_gcc_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.gcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_gcc_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_gcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_gcc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_bcc_xer_ = { {"bcc>\n", "bcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_bcc_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_bcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_bcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_bcc_oer_ext_arr_, 0, L3__Discr__MS__SGSN_bcc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_bcc_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.bcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_bcc_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_bcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_bcc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_cc_xer_ = { {"cc>\n", "cc>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_cc_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_cc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_cc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_cc_oer_ext_arr_, 0, L3__Discr__MS__SGSN_cc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_cc_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.cc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_cc_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_cc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_cc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_gttp_xer_ = { {"gttp>\n", "gttp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_gttp_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_gttp_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_gttp_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_gttp_oer_ext_arr_, 0, L3__Discr__MS__SGSN_gttp_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_gttp_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.gttp", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_gttp_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_gttp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_gttp_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_mm_xer_ = { {"mm>\n", "mm>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_mm_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_mm_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_mm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_mm_oer_ext_arr_, 0, L3__Discr__MS__SGSN_mm_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_mm_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.mm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_mm_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_mm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_mm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_rrm_xer_ = { {"rrm>\n", "rrm>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_rrm_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_rrm_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_rrm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_rrm_oer_ext_arr_, 0, L3__Discr__MS__SGSN_rrm_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_rrm_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.rrm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_rrm_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_rrm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_rrm_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_gprs__mm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_sms_xer_ = { {"sms>\n", "sms>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_sms_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_sms_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_sms_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_sms_oer_ext_arr_, 0, L3__Discr__MS__SGSN_sms_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_sms_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.sms", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_sms_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_sms_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_sms_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_gprs__sm_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_ss_xer_ = { {"ss>\n", "ss>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_ss_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_ss_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_ss_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_ss_oer_ext_arr_, 0, L3__Discr__MS__SGSN_ss_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_ss_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.ss", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_ss_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_ss_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_ss_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_loc_xer_ = { {"loc>\n", "loc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_loc_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_loc_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_loc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_loc_oer_ext_arr_, 0, L3__Discr__MS__SGSN_loc_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_loc_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.loc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_loc_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_loc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_loc_default_coding("RAW");
const XERdescriptor_t       L3__Discr__MS__SGSN_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int L3__Discr__MS__SGSN_reserved_oer_ext_arr_[0] = {};
const int L3__Discr__MS__SGSN_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t L3__Discr__MS__SGSN_reserved_oer_ = { -1, TRUE, -1, FALSE, 0, 0, L3__Discr__MS__SGSN_reserved_oer_ext_arr_, 0, L3__Discr__MS__SGSN_reserved_oer_p_};
const TTCN_Typedescriptor_t L3__Discr__MS__SGSN_reserved_descr_ = { "@MobileL3_Types.L3_Discr_MS_SGSN.reserved", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &L3__Discr__MS__SGSN_reserved_xer_, &OCTETSTRING_json_, &L3__Discr__MS__SGSN_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_reserved_default_coding("RAW");
UNIVERSAL_CHARSTRING L3__Discr__MS__SGSN_default_coding("RAW");
const XERdescriptor_t       PDU__L3__MS__SGSN_discriminator_xer_ = { {"discriminator>\n", "discriminator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__L3__MS__SGSN_discriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__L3__MS__SGSN_discriminator_descr_ = { "@MobileL3_Types.PDU_L3_MS_SGSN.discriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__L3__MS__SGSN_discriminator_xer_, &BITSTRING_json_, &PDU__L3__MS__SGSN_discriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__MS__SGSN_discriminator_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__MS__SGSN_tiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__MS__SGSN_tiOrSkip
const TTCN_Typedescriptor_t PDU__L3__MS__SGSN_tiOrSkip_descr_ = { "@MobileL3_Types.PDU_L3_MS_SGSN.tiOrSkip", NULL, &PDU__L3__MS__SGSN_tiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__MS__SGSN_tiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__MS__SGSN_msgs_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__MS__SGSN_msgs
const TTCN_Typedescriptor_t PDU__L3__MS__SGSN_msgs_descr_ = { "@MobileL3_Types.PDU_L3_MS_SGSN.msgs", NULL, &PDU__L3__MS__SGSN_msgs_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__MS__SGSN_msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__L3__MS__SGSN_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__L3__MS__SGSN
const TTCN_Typedescriptor_t PDU__L3__MS__SGSN_descr_ = { "@MobileL3_Types.PDU_L3_MS_SGSN", NULL, &PDU__L3__MS__SGSN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__L3__MS__SGSN_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Discr__NW__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ML3__Discr__NW__MS
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS", NULL, &ML3__Discr__NW__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ML3__Discr__NW__MS_gcc_xer_ = { {"gcc>\n", "gcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_gcc_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_gcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_gcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_gcc_oer_ext_arr_, 0, ML3__Discr__NW__MS_gcc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_gcc_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.gcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_gcc_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_gcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_gcc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_bcc_xer_ = { {"bcc>\n", "bcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_bcc_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_bcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_bcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_bcc_oer_ext_arr_, 0, ML3__Discr__NW__MS_bcc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_bcc_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.bcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_bcc_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_bcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_bcc_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_cc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_gttp_xer_ = { {"gttp>\n", "gttp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_gttp_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_gttp_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_gttp_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_gttp_oer_ext_arr_, 0, ML3__Discr__NW__MS_gttp_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_gttp_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.gttp", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_gttp_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_gttp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_gttp_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_mm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_rrm_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_gprs__mm_xer_ = { {"gprs_mm>\n", "gprs_mm>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_gprs__mm_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_gprs__mm_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_gprs__mm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_gprs__mm_oer_ext_arr_, 0, ML3__Discr__NW__MS_gprs__mm_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_gprs__mm_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.gprs_mm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_gprs__mm_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_gprs__mm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_gprs__mm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_sms_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_gprs__sm_xer_ = { {"gprs_sm>\n", "gprs_sm>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_gprs__sm_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_gprs__sm_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_gprs__sm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_gprs__sm_oer_ext_arr_, 0, ML3__Discr__NW__MS_gprs__sm_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_gprs__sm_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.gprs_sm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_gprs__sm_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_gprs__sm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_gprs__sm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_ss_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_loc_xer_ = { {"loc>\n", "loc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_loc_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_loc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_loc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_loc_oer_ext_arr_, 0, ML3__Discr__NW__MS_loc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_loc_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.loc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_loc_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_loc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_loc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__NW__MS_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__NW__MS_reserved_oer_ext_arr_[0] = {};
const int ML3__Discr__NW__MS_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__NW__MS_reserved_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__NW__MS_reserved_oer_ext_arr_, 0, ML3__Discr__NW__MS_reserved_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__NW__MS_reserved_descr_ = { "@MobileL3_Types.ML3_Discr_NW_MS.reserved", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__NW__MS_reserved_xer_, &OCTETSTRING_json_, &ML3__Discr__NW__MS_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_reserved_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__NW__MS_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__NW__MS_discriminator_xer_ = { {"discriminator>\n", "discriminator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__NW__MS_discriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__NW__MS_discriminator_descr_ = { "@MobileL3_Types.PDU_ML3_NW_MS.discriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__ML3__NW__MS_discriminator_xer_, &BITSTRING_json_, &PDU__ML3__NW__MS_discriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__NW__MS_discriminator_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__NW__MS_tiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__NW__MS_tiOrSkip
const TTCN_Typedescriptor_t PDU__ML3__NW__MS_tiOrSkip_descr_ = { "@MobileL3_Types.PDU_ML3_NW_MS.tiOrSkip", NULL, &PDU__ML3__NW__MS_tiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__NW__MS_tiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__NW__MS_msgs_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__NW__MS_msgs
const TTCN_Typedescriptor_t PDU__ML3__NW__MS_msgs_descr_ = { "@MobileL3_Types.PDU_ML3_NW_MS.msgs", NULL, &PDU__ML3__NW__MS_msgs_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__NW__MS_msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__NW__MS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__NW__MS
const TTCN_Typedescriptor_t PDU__ML3__NW__MS_descr_ = { "@MobileL3_Types.PDU_ML3_NW_MS", NULL, &PDU__ML3__NW__MS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__NW__MS_default_coding("RAW");
const TTCN_RAWdescriptor_t ML3__Discr__MS__NW_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ML3__Discr__MS__NW
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW", NULL, &ML3__Discr__MS__NW_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ML3__Discr__MS__NW_gcc_xer_ = { {"gcc>\n", "gcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_gcc_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_gcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_gcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_gcc_oer_ext_arr_, 0, ML3__Discr__MS__NW_gcc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_gcc_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.gcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_gcc_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_gcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_gcc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_bcc_xer_ = { {"bcc>\n", "bcc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_bcc_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_bcc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_bcc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_bcc_oer_ext_arr_, 0, ML3__Discr__MS__NW_bcc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_bcc_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.bcc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_bcc_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_bcc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_bcc_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_cc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_gttp_xer_ = { {"gttp>\n", "gttp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_gttp_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_gttp_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_gttp_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_gttp_oer_ext_arr_, 0, ML3__Discr__MS__NW_gttp_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_gttp_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.gttp", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_gttp_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_gttp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_gttp_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_mm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_rrm_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_gprs__mm_xer_ = { {"gprs_mm>\n", "gprs_mm>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_gprs__mm_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_gprs__mm_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_gprs__mm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_gprs__mm_oer_ext_arr_, 0, ML3__Discr__MS__NW_gprs__mm_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_gprs__mm_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.gprs_mm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_gprs__mm_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_gprs__mm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_gprs__mm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_sms_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_gprs__sm_xer_ = { {"gprs_sm>\n", "gprs_sm>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_gprs__sm_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_gprs__sm_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_gprs__sm_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_gprs__sm_oer_ext_arr_, 0, ML3__Discr__MS__NW_gprs__sm_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_gprs__sm_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.gprs_sm", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_gprs__sm_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_gprs__sm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_gprs__sm_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_ss_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_loc_xer_ = { {"loc>\n", "loc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_loc_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_loc_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_loc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_loc_oer_ext_arr_, 0, ML3__Discr__MS__NW_loc_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_loc_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.loc", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_loc_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_loc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_loc_default_coding("RAW");
const XERdescriptor_t       ML3__Discr__MS__NW_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ML3__Discr__MS__NW_reserved_oer_ext_arr_[0] = {};
const int ML3__Discr__MS__NW_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t ML3__Discr__MS__NW_reserved_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ML3__Discr__MS__NW_reserved_oer_ext_arr_, 0, ML3__Discr__MS__NW_reserved_oer_p_};
const TTCN_Typedescriptor_t ML3__Discr__MS__NW_reserved_descr_ = { "@MobileL3_Types.ML3_Discr_MS_NW.reserved", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ML3__Discr__MS__NW_reserved_xer_, &OCTETSTRING_json_, &ML3__Discr__MS__NW_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_reserved_default_coding("RAW");
UNIVERSAL_CHARSTRING ML3__Discr__MS__NW_default_coding("RAW");
const XERdescriptor_t       PDU__ML3__MS__NW_discriminator_xer_ = { {"discriminator>\n", "discriminator>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__ML3__MS__NW_discriminator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__ML3__MS__NW_discriminator_descr_ = { "@MobileL3_Types.PDU_ML3_MS_NW.discriminator", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &PDU__ML3__MS__NW_discriminator_xer_, &BITSTRING_json_, &PDU__ML3__MS__NW_discriminator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MS__NW_discriminator_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MS__NW_tiOrSkip_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__MS__NW_tiOrSkip
const TTCN_Typedescriptor_t PDU__ML3__MS__NW_tiOrSkip_descr_ = { "@MobileL3_Types.PDU_ML3_MS_NW.tiOrSkip", NULL, &PDU__ML3__MS__NW_tiOrSkip_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MS__NW_tiOrSkip_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MS__NW_msgs_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__MS__NW_msgs
const TTCN_Typedescriptor_t PDU__ML3__MS__NW_msgs_descr_ = { "@MobileL3_Types.PDU_ML3_MS_NW.msgs", NULL, &PDU__ML3__MS__NW_msgs_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MS__NW_msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__ML3__MS__NW_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__ML3__MS__NW
const TTCN_Typedescriptor_t PDU__ML3__MS__NW_descr_ = { "@MobileL3_Types.PDU_ML3_MS_NW", NULL, &PDU__ML3__MS__NW_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__ML3__MS__NW_default_coding("RAW");
TTCN_Module module_object("MobileL3_Types", __DATE__, __TIME__, module_checksum, pre_init_module, "", 0U, 2U, 0U, 99U, "", 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_11,
  current_runtime_version.requires_minor_version_1,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

L3__TransactionId::L3__TransactionId()
{
}

L3__TransactionId::L3__TransactionId(const BITSTRING& par_tio,
    const BITSTRING& par_tiFlag,
    const OPTIONAL< MobileL3__GMM__SM__Types::TI__Extension >& par_tIExtension)
  :   field_tio(par_tio),
  field_tiFlag(par_tiFlag),
  field_tIExtension(par_tIExtension)
{
}

L3__TransactionId::L3__TransactionId(const L3__TransactionId& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.L3_TransactionId.");
if (other_value.tio().is_bound()) field_tio = other_value.tio();
else field_tio.clean_up();
if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
else field_tiFlag.clean_up();
if (other_value.tIExtension().is_bound()) field_tIExtension = other_value.tIExtension();
else field_tIExtension.clean_up();
}

void L3__TransactionId::clean_up()
{
field_tio.clean_up();
field_tiFlag.clean_up();
field_tIExtension.clean_up();
}

const TTCN_Typedescriptor_t* L3__TransactionId::get_descriptor() const { return &L3__TransactionId_descr_; }
L3__TransactionId& L3__TransactionId::operator=(const L3__TransactionId& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.L3_TransactionId.");
  if (other_value.tio().is_bound()) field_tio = other_value.tio();
  else field_tio.clean_up();
  if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
  else field_tiFlag.clean_up();
  if (other_value.tIExtension().is_bound()) field_tIExtension = other_value.tIExtension();
  else field_tIExtension.clean_up();
}
return *this;
}

boolean L3__TransactionId::operator==(const L3__TransactionId& other_value) const
{
return field_tio==other_value.field_tio
  && field_tiFlag==other_value.field_tiFlag
  && field_tIExtension==other_value.field_tIExtension;
}

boolean L3__TransactionId::is_bound() const
{
return (field_tio.is_bound())
  || (field_tiFlag.is_bound())
  || (OPTIONAL_OMIT == field_tIExtension.get_selection() || field_tIExtension.is_bound());
}
boolean L3__TransactionId::is_value() const
{
return field_tio.is_value()
  && field_tiFlag.is_value()
  && (OPTIONAL_OMIT == field_tIExtension.get_selection() || field_tIExtension.is_value());
}
int L3__TransactionId::size_of() const
{
  int ret_val = 2;
  if (field_tIExtension.ispresent()) ret_val++;
  return ret_val;
}

void L3__TransactionId::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tio := ");
field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
field_tiFlag.log();
TTCN_Logger::log_event_str(", tIExtension := ");
field_tIExtension.log();
TTCN_Logger::log_event_str(" }");
}

void L3__TransactionId::set_implicit_omit()
{
if (tio().is_bound()) tio().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
if (!tIExtension().is_bound()) tIExtension() = OMIT_VALUE;
else tIExtension().set_implicit_omit();
}

void L3__TransactionId::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.L3_TransactionId has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tio().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiFlag().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tIExtension().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tIExtension")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIExtension().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.L3_TransactionId: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.L3_TransactionId");
  }
}

void L3__TransactionId::encode_text(Text_Buf& text_buf) const
{
field_tio.encode_text(text_buf);
field_tiFlag.encode_text(text_buf);
field_tIExtension.encode_text(text_buf);
}

void L3__TransactionId::decode_text(Text_Buf& text_buf)
{
field_tio.decode_text(text_buf);
field_tiFlag.decode_text(text_buf);
field_tIExtension.decode_text(text_buf);
}

void L3__TransactionId::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void L3__TransactionId::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int L3__TransactionId::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tio.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tiFlag.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_tio ==  bs_0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_tIExtension = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, L3__TransactionId_tIExtension_descr_.raw->forceomit);
  decoded_field_length = field_tIExtension().RAW_decode(L3__TransactionId_tIExtension_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_tIExtension = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tIExtension=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int L3__TransactionId::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  if (field_tIExtension.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, L3__TransactionId_tIExtension_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_tio.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiFlag.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  if (field_tIExtension.ispresent()) {
  encoded_length += field_tIExtension().RAW_encode(L3__TransactionId_tIExtension_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_tIExtension.ispresent() && (field_tio !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct L3__TransactionId_template::single_value_struct {
BITSTRING_template field_tio;
BITSTRING_template field_tiFlag;
MobileL3__GMM__SM__Types::TI__Extension_template field_tIExtension;
};

void L3__TransactionId_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_tio = ANY_VALUE;
single_value->field_tiFlag = ANY_VALUE;
single_value->field_tIExtension = ANY_OR_OMIT;
}
}
}

void L3__TransactionId_template::copy_value(const L3__TransactionId& other_value)
{
single_value = new single_value_struct;
if (other_value.tio().is_bound()) {
  single_value->field_tio = other_value.tio();
} else {
  single_value->field_tio.clean_up();
}
if (other_value.tiFlag().is_bound()) {
  single_value->field_tiFlag = other_value.tiFlag();
} else {
  single_value->field_tiFlag.clean_up();
}
if (other_value.tIExtension().is_bound()) {
  if (other_value.tIExtension().ispresent()) single_value->field_tIExtension = other_value.tIExtension()();
  else single_value->field_tIExtension = OMIT_VALUE;
} else {
  single_value->field_tIExtension.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void L3__TransactionId_template::copy_template(const L3__TransactionId_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tio().get_selection()) {
single_value->field_tio = other_value.tio();
} else {
single_value->field_tio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiFlag().get_selection()) {
single_value->field_tiFlag = other_value.tiFlag();
} else {
single_value->field_tiFlag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tIExtension().get_selection()) {
single_value->field_tIExtension = other_value.tIExtension();
} else {
single_value->field_tIExtension.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new L3__TransactionId_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L3__TransactionId_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__TransactionId_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId.");
break;
}
set_selection(other_value);
}

L3__TransactionId_template::L3__TransactionId_template()
{
}

L3__TransactionId_template::L3__TransactionId_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

L3__TransactionId_template::L3__TransactionId_template(const L3__TransactionId& other_value)
{
copy_value(other_value);
}

L3__TransactionId_template::L3__TransactionId_template(const OPTIONAL<L3__TransactionId>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__TransactionId&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.L3_TransactionId from an unbound optional field.");
}
}

L3__TransactionId_template::L3__TransactionId_template(L3__TransactionId_template* p_precondition, L3__TransactionId_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

L3__TransactionId_template::L3__TransactionId_template(Dynamic_Match_Interface<L3__TransactionId>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<L3__TransactionId>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

L3__TransactionId_template::L3__TransactionId_template(const L3__TransactionId_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

L3__TransactionId_template::~L3__TransactionId_template()
{
clean_up();
}

L3__TransactionId_template& L3__TransactionId_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

L3__TransactionId_template& L3__TransactionId_template::operator=(const L3__TransactionId& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

L3__TransactionId_template& L3__TransactionId_template::operator=(const OPTIONAL<L3__TransactionId>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__TransactionId&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.L3_TransactionId.");
}
return *this;
}

L3__TransactionId_template& L3__TransactionId_template::operator=(const L3__TransactionId_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean L3__TransactionId_template::match(const L3__TransactionId& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.tio().is_bound()) return FALSE;
if(!single_value->field_tio.match(other_value.tio(), legacy))return FALSE;
if(!other_value.tiFlag().is_bound()) return FALSE;
if(!single_value->field_tiFlag.match(other_value.tiFlag(), legacy))return FALSE;
if(!other_value.tIExtension().is_bound()) return FALSE;
if((other_value.tIExtension().ispresent() ? !single_value->field_tIExtension.match((const MobileL3__GMM__SM__Types::TI__Extension&)other_value.tIExtension(), legacy) : !single_value->field_tIExtension.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId.");
}
return FALSE;
}

boolean L3__TransactionId_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tio.is_bound()
 || single_value->field_tiFlag.is_bound()
 || (single_value->field_tIExtension.is_omit() || single_value->field_tIExtension.is_bound());
}

boolean L3__TransactionId_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tio.is_value()
 && single_value->field_tiFlag.is_value()
 && (single_value->field_tIExtension.is_omit() || single_value->field_tIExtension.is_value());
}

void L3__TransactionId_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

L3__TransactionId L3__TransactionId_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.L3_TransactionId.");
L3__TransactionId ret_val;
if (single_value->field_tio.is_bound()) {
ret_val.tio() = single_value->field_tio.valueof();
}
if (single_value->field_tiFlag.is_bound()) {
ret_val.tiFlag() = single_value->field_tiFlag.valueof();
}
if (single_value->field_tIExtension.is_omit()) ret_val.tIExtension() = OMIT_VALUE;
else if (single_value->field_tIExtension.is_bound()) {
ret_val.tIExtension() = single_value->field_tIExtension.valueof();
}
return ret_val;
}

void L3__TransactionId_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.L3_TransactionId.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new L3__TransactionId_template[list_length];
}

L3__TransactionId_template& L3__TransactionId_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.L3_TransactionId.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.L3_TransactionId.");
return value_list.list_value[list_index];
}

BITSTRING_template& L3__TransactionId_template::tio()
{
set_specific();
return single_value->field_tio;
}

const BITSTRING_template& L3__TransactionId_template::tio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tio of a non-specific template of type @MobileL3_Types.L3_TransactionId.");
return single_value->field_tio;
}

BITSTRING_template& L3__TransactionId_template::tiFlag()
{
set_specific();
return single_value->field_tiFlag;
}

const BITSTRING_template& L3__TransactionId_template::tiFlag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiFlag of a non-specific template of type @MobileL3_Types.L3_TransactionId.");
return single_value->field_tiFlag;
}

MobileL3__GMM__SM__Types::TI__Extension_template& L3__TransactionId_template::tIExtension()
{
set_specific();
return single_value->field_tIExtension;
}

const MobileL3__GMM__SM__Types::TI__Extension_template& L3__TransactionId_template::tIExtension() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tIExtension of a non-specific template of type @MobileL3_Types.L3_TransactionId.");
return single_value->field_tIExtension;
}

int L3__TransactionId_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_tIExtension.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId.");
  }
  return 0;
}

void L3__TransactionId_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tio := ");
single_value->field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log();
TTCN_Logger::log_event_str(", tIExtension := ");
single_value->field_tIExtension.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void L3__TransactionId_template::log_match(const L3__TransactionId& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_tio.match(match_value.tio(), legacy)){
TTCN_Logger::log_logmatch_info(".tio");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiFlag.match(match_value.tiFlag(), legacy)){
TTCN_Logger::log_logmatch_info(".tiFlag");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tIExtension().ispresent()){
if(!single_value->field_tIExtension.match(match_value.tIExtension(), legacy)){
TTCN_Logger::log_logmatch_info(".tIExtension");
single_value->field_tIExtension.log_match(match_value.tIExtension(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tIExtension.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tIExtension := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tIExtension.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ tio := ");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::log_event_str(", tIExtension := ");
if (match_value.tIExtension().ispresent()) {
single_value->field_tIExtension.log_match(match_value.tIExtension(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tIExtension.log();
if (single_value->field_tIExtension.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void L3__TransactionId_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tio().is_bound()) tio().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
if (!tIExtension().is_bound()) tIExtension() = OMIT_VALUE;
else tIExtension().set_implicit_omit();
}

void L3__TransactionId_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tio.encode_text(text_buf);
single_value->field_tiFlag.encode_text(text_buf);
single_value->field_tIExtension.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId.");
}
}

void L3__TransactionId_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_tio.decode_text(text_buf);
single_value->field_tiFlag.decode_text(text_buf);
single_value->field_tIExtension.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new L3__TransactionId_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.L3_TransactionId.");
}
}

void L3__TransactionId_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L3__TransactionId_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.L3_TransactionId has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tio().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiFlag().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tIExtension().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tIExtension")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIExtension().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.L3_TransactionId: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__TransactionId_template* precondition = new L3__TransactionId_template;
    precondition->set_param(*param.get_elem(0));
    L3__TransactionId_template* implied_template = new L3__TransactionId_template;
    implied_template->set_param(*param.get_elem(1));
    *this = L3__TransactionId_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.L3_TransactionId");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__TransactionId_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_tio.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_TransactionId");
single_value->field_tiFlag.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_TransactionId");
single_value->field_tIExtension.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_TransactionId");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.L3_TransactionId");
}

boolean L3__TransactionId_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean L3__TransactionId_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

L3__TransactionId__not__extended::L3__TransactionId__not__extended()
{
}

L3__TransactionId__not__extended::L3__TransactionId__not__extended(const BITSTRING& par_tio,
    const BITSTRING& par_tiFlag)
  :   field_tio(par_tio),
  field_tiFlag(par_tiFlag)
{
}

L3__TransactionId__not__extended::L3__TransactionId__not__extended(const L3__TransactionId__not__extended& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.L3_TransactionId_not_extended.");
if (other_value.tio().is_bound()) field_tio = other_value.tio();
else field_tio.clean_up();
if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
else field_tiFlag.clean_up();
}

void L3__TransactionId__not__extended::clean_up()
{
field_tio.clean_up();
field_tiFlag.clean_up();
}

const TTCN_Typedescriptor_t* L3__TransactionId__not__extended::get_descriptor() const { return &L3__TransactionId__not__extended_descr_; }
L3__TransactionId__not__extended& L3__TransactionId__not__extended::operator=(const L3__TransactionId__not__extended& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.L3_TransactionId_not_extended.");
  if (other_value.tio().is_bound()) field_tio = other_value.tio();
  else field_tio.clean_up();
  if (other_value.tiFlag().is_bound()) field_tiFlag = other_value.tiFlag();
  else field_tiFlag.clean_up();
}
return *this;
}

boolean L3__TransactionId__not__extended::operator==(const L3__TransactionId__not__extended& other_value) const
{
return field_tio==other_value.field_tio
  && field_tiFlag==other_value.field_tiFlag;
}

boolean L3__TransactionId__not__extended::is_bound() const
{
return (field_tio.is_bound())
  || (field_tiFlag.is_bound());
}
boolean L3__TransactionId__not__extended::is_value() const
{
return field_tio.is_value()
  && field_tiFlag.is_value();
}
void L3__TransactionId__not__extended::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tio := ");
field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
field_tiFlag.log();
TTCN_Logger::log_event_str(" }");
}

void L3__TransactionId__not__extended::set_implicit_omit()
{
if (tio().is_bound()) tio().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
}

void L3__TransactionId__not__extended::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_Types.L3_TransactionId_not_extended has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tio().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiFlag().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.L3_TransactionId_not_extended: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.L3_TransactionId_not_extended");
  }
}

void L3__TransactionId__not__extended::encode_text(Text_Buf& text_buf) const
{
field_tio.encode_text(text_buf);
field_tiFlag.encode_text(text_buf);
}

void L3__TransactionId__not__extended::decode_text(Text_Buf& text_buf)
{
field_tio.decode_text(text_buf);
field_tiFlag.decode_text(text_buf);
}

void L3__TransactionId__not__extended::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void L3__TransactionId__not__extended::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int L3__TransactionId__not__extended::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_tio.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_tiFlag.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int L3__TransactionId__not__extended::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_tio.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiFlag.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct L3__TransactionId__not__extended_template::single_value_struct {
BITSTRING_template field_tio;
BITSTRING_template field_tiFlag;
};

void L3__TransactionId__not__extended_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_tio = ANY_VALUE;
single_value->field_tiFlag = ANY_VALUE;
}
}
}

void L3__TransactionId__not__extended_template::copy_value(const L3__TransactionId__not__extended& other_value)
{
single_value = new single_value_struct;
if (other_value.tio().is_bound()) {
  single_value->field_tio = other_value.tio();
} else {
  single_value->field_tio.clean_up();
}
if (other_value.tiFlag().is_bound()) {
  single_value->field_tiFlag = other_value.tiFlag();
} else {
  single_value->field_tiFlag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void L3__TransactionId__not__extended_template::copy_template(const L3__TransactionId__not__extended_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tio().get_selection()) {
single_value->field_tio = other_value.tio();
} else {
single_value->field_tio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiFlag().get_selection()) {
single_value->field_tiFlag = other_value.tiFlag();
} else {
single_value->field_tiFlag.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new L3__TransactionId__not__extended_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L3__TransactionId__not__extended_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__TransactionId__not__extended_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId_not_extended.");
break;
}
set_selection(other_value);
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template()
{
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(const L3__TransactionId__not__extended& other_value)
{
copy_value(other_value);
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(const OPTIONAL<L3__TransactionId__not__extended>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__TransactionId__not__extended&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.L3_TransactionId_not_extended from an unbound optional field.");
}
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(L3__TransactionId__not__extended_template* p_precondition, L3__TransactionId__not__extended_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(Dynamic_Match_Interface<L3__TransactionId__not__extended>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<L3__TransactionId__not__extended>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

L3__TransactionId__not__extended_template::L3__TransactionId__not__extended_template(const L3__TransactionId__not__extended_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

L3__TransactionId__not__extended_template::~L3__TransactionId__not__extended_template()
{
clean_up();
}

L3__TransactionId__not__extended_template& L3__TransactionId__not__extended_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

L3__TransactionId__not__extended_template& L3__TransactionId__not__extended_template::operator=(const L3__TransactionId__not__extended& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

L3__TransactionId__not__extended_template& L3__TransactionId__not__extended_template::operator=(const OPTIONAL<L3__TransactionId__not__extended>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__TransactionId__not__extended&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.L3_TransactionId_not_extended.");
}
return *this;
}

L3__TransactionId__not__extended_template& L3__TransactionId__not__extended_template::operator=(const L3__TransactionId__not__extended_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean L3__TransactionId__not__extended_template::match(const L3__TransactionId__not__extended& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.tio().is_bound()) return FALSE;
if(!single_value->field_tio.match(other_value.tio(), legacy))return FALSE;
if(!other_value.tiFlag().is_bound()) return FALSE;
if(!single_value->field_tiFlag.match(other_value.tiFlag(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId_not_extended.");
}
return FALSE;
}

boolean L3__TransactionId__not__extended_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tio.is_bound()
 || single_value->field_tiFlag.is_bound();
}

boolean L3__TransactionId__not__extended_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tio.is_value()
 && single_value->field_tiFlag.is_value();
}

void L3__TransactionId__not__extended_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

L3__TransactionId__not__extended L3__TransactionId__not__extended_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.L3_TransactionId_not_extended.");
L3__TransactionId__not__extended ret_val;
if (single_value->field_tio.is_bound()) {
ret_val.tio() = single_value->field_tio.valueof();
}
if (single_value->field_tiFlag.is_bound()) {
ret_val.tiFlag() = single_value->field_tiFlag.valueof();
}
return ret_val;
}

void L3__TransactionId__not__extended_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.L3_TransactionId_not_extended.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new L3__TransactionId__not__extended_template[list_length];
}

L3__TransactionId__not__extended_template& L3__TransactionId__not__extended_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.L3_TransactionId_not_extended.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.L3_TransactionId_not_extended.");
return value_list.list_value[list_index];
}

BITSTRING_template& L3__TransactionId__not__extended_template::tio()
{
set_specific();
return single_value->field_tio;
}

const BITSTRING_template& L3__TransactionId__not__extended_template::tio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tio of a non-specific template of type @MobileL3_Types.L3_TransactionId_not_extended.");
return single_value->field_tio;
}

BITSTRING_template& L3__TransactionId__not__extended_template::tiFlag()
{
set_specific();
return single_value->field_tiFlag;
}

const BITSTRING_template& L3__TransactionId__not__extended_template::tiFlag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiFlag of a non-specific template of type @MobileL3_Types.L3_TransactionId_not_extended.");
return single_value->field_tiFlag;
}

int L3__TransactionId__not__extended_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.L3_TransactionId_not_extended containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId_not_extended.");
  }
  return 0;
}

void L3__TransactionId__not__extended_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tio := ");
single_value->field_tio.log();
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void L3__TransactionId__not__extended_template::log_match(const L3__TransactionId__not__extended& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_tio.match(match_value.tio(), legacy)){
TTCN_Logger::log_logmatch_info(".tio");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiFlag.match(match_value.tiFlag(), legacy)){
TTCN_Logger::log_logmatch_info(".tiFlag");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ tio := ");
single_value->field_tio.log_match(match_value.tio(), legacy);
TTCN_Logger::log_event_str(", tiFlag := ");
single_value->field_tiFlag.log_match(match_value.tiFlag(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void L3__TransactionId__not__extended_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tio().is_bound()) tio().set_implicit_omit();
if (tiFlag().is_bound()) tiFlag().set_implicit_omit();
}

void L3__TransactionId__not__extended_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tio.encode_text(text_buf);
single_value->field_tiFlag.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.L3_TransactionId_not_extended.");
}
}

void L3__TransactionId__not__extended_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_tio.decode_text(text_buf);
single_value->field_tiFlag.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new L3__TransactionId__not__extended_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.L3_TransactionId_not_extended.");
}
}

void L3__TransactionId__not__extended_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L3__TransactionId__not__extended_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_Types.L3_TransactionId_not_extended has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tio().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiFlag().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiFlag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiFlag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.L3_TransactionId_not_extended: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__TransactionId__not__extended_template* precondition = new L3__TransactionId__not__extended_template;
    precondition->set_param(*param.get_elem(0));
    L3__TransactionId__not__extended_template* implied_template = new L3__TransactionId__not__extended_template;
    implied_template->set_param(*param.get_elem(1));
    *this = L3__TransactionId__not__extended_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.L3_TransactionId_not_extended");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__TransactionId__not__extended_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_tio.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_TransactionId_not_extended");
single_value->field_tiFlag.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_TransactionId_not_extended");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.L3_TransactionId_not_extended");
}

boolean L3__TransactionId__not__extended_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean L3__TransactionId__not__extended_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TiOrSkip__not__extended::copy_value(const TiOrSkip__not__extended& other_value)
{
switch (other_value.union_selection) {
case ALT_skipIndicator:
field_skipIndicator = new BITSTRING(*other_value.field_skipIndicator);
break;
case ALT_transactionId:
field_transactionId = new L3__TransactionId__not__extended(*other_value.field_transactionId);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.TiOrSkip_not_extended.");
}
union_selection = other_value.union_selection;
}

TiOrSkip__not__extended::TiOrSkip__not__extended()
{
union_selection = UNBOUND_VALUE;
}

TiOrSkip__not__extended::TiOrSkip__not__extended(const TiOrSkip__not__extended& other_value)
: Base_Type(){
copy_value(other_value);
}

TiOrSkip__not__extended::~TiOrSkip__not__extended()
{
clean_up();
}

TiOrSkip__not__extended& TiOrSkip__not__extended::operator=(const TiOrSkip__not__extended& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean TiOrSkip__not__extended::operator==(const TiOrSkip__not__extended& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.TiOrSkip_not_extended.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.TiOrSkip_not_extended.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_skipIndicator:
return *field_skipIndicator == *other_value.field_skipIndicator;
case ALT_transactionId:
return *field_transactionId == *other_value.field_transactionId;
default:
return FALSE;
}
}

BITSTRING& TiOrSkip__not__extended::skipIndicator()
{
if (union_selection != ALT_skipIndicator) {
clean_up();
field_skipIndicator = new BITSTRING;
union_selection = ALT_skipIndicator;
}
return *field_skipIndicator;
}

const BITSTRING& TiOrSkip__not__extended::skipIndicator() const
{
if (union_selection != ALT_skipIndicator) TTCN_error("Using non-selected field skipIndicator in a value of union type @MobileL3_Types.TiOrSkip_not_extended.");
return *field_skipIndicator;
}

L3__TransactionId__not__extended& TiOrSkip__not__extended::transactionId()
{
if (union_selection != ALT_transactionId) {
clean_up();
field_transactionId = new L3__TransactionId__not__extended;
union_selection = ALT_transactionId;
}
return *field_transactionId;
}

const L3__TransactionId__not__extended& TiOrSkip__not__extended::transactionId() const
{
if (union_selection != ALT_transactionId) TTCN_error("Using non-selected field transactionId in a value of union type @MobileL3_Types.TiOrSkip_not_extended.");
return *field_transactionId;
}

boolean TiOrSkip__not__extended::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.TiOrSkip_not_extended.");
return union_selection == checked_selection;
}

boolean TiOrSkip__not__extended::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean TiOrSkip__not__extended::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_skipIndicator: return field_skipIndicator->is_value();
case ALT_transactionId: return field_transactionId->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TiOrSkip__not__extended::clean_up()
{
switch (union_selection) {
case ALT_skipIndicator:
  delete field_skipIndicator;
  break;
case ALT_transactionId:
  delete field_transactionId;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TiOrSkip__not__extended::log() const
{
switch (union_selection) {
case ALT_skipIndicator:
TTCN_Logger::log_event_str("{ skipIndicator := ");
field_skipIndicator->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_transactionId:
TTCN_Logger::log_event_str("{ transactionId := ");
field_transactionId->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TiOrSkip__not__extended::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "skipIndicator")) {
    skipIndicator().set_param(*mp_last);
    if (!skipIndicator().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "transactionId")) {
    transactionId().set_param(*mp_last);
    if (!transactionId().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.TiOrSkip_not_extended.", last_name);
}

void TiOrSkip__not__extended::set_implicit_omit()
{
switch (union_selection) {
case ALT_skipIndicator:
field_skipIndicator->set_implicit_omit(); break;
case ALT_transactionId:
field_transactionId->set_implicit_omit(); break;
default: break;
}
}

void TiOrSkip__not__extended::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_skipIndicator:
field_skipIndicator->encode_text(text_buf);
break;
case ALT_transactionId:
field_transactionId->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
}

void TiOrSkip__not__extended::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_skipIndicator:
skipIndicator().decode_text(text_buf);
break;
case ALT_transactionId:
transactionId().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.TiOrSkip_not_extended.");
}
}

void TiOrSkip__not__extended::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void TiOrSkip__not__extended::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int TiOrSkip__not__extended::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
      decoded_length = skipIndicator().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, L3__TransactionId__not__extended_descr_.raw->forceomit);
      decoded_length = transactionId().RAW_decode(L3__TransactionId__not__extended_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
      decoded_length = skipIndicator().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, L3__TransactionId__not__extended_descr_.raw->forceomit);
      decoded_length = transactionId().RAW_decode(L3__TransactionId__not__extended_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int TiOrSkip__not__extended::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_skipIndicator:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, General__Types::BIT4_descr_.raw);
    encoded_length = field_skipIndicator->RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &General__Types::BIT4_descr_;
    break;
  case ALT_transactionId:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, L3__TransactionId__not__extended_descr_.raw);
    encoded_length = field_transactionId->RAW_encode(L3__TransactionId__not__extended_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &L3__TransactionId__not__extended_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TiOrSkip__not__extended_template::copy_value(const TiOrSkip__not__extended& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template(other_value.skipIndicator());
break;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId__not__extended_template(other_value.transactionId());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.TiOrSkip_not_extended.");
}
set_selection(SPECIFIC_VALUE);
}

void TiOrSkip__not__extended_template::copy_template(const TiOrSkip__not__extended_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template(*other_value.single_value.field_skipIndicator);
break;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId__not__extended_template(*other_value.single_value.field_transactionId);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.TiOrSkip_not_extended.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TiOrSkip__not__extended_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TiOrSkip__not__extended_template(*other_value.implication_.precondition);
implication_.implied_template = new TiOrSkip__not__extended_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
set_selection(other_value);
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template()
{
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(const TiOrSkip__not__extended& other_value)
{
copy_value(other_value);
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(const OPTIONAL<TiOrSkip__not__extended>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TiOrSkip__not__extended&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.TiOrSkip_not_extended from an unbound optional field.");
}
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(TiOrSkip__not__extended_template* p_precondition, TiOrSkip__not__extended_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(Dynamic_Match_Interface<TiOrSkip__not__extended>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TiOrSkip__not__extended>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TiOrSkip__not__extended_template::TiOrSkip__not__extended_template(const TiOrSkip__not__extended_template& other_value)
: Base_Template(){
copy_template(other_value);
}

TiOrSkip__not__extended_template::~TiOrSkip__not__extended_template()
{
clean_up();
}

void TiOrSkip__not__extended_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
delete single_value.field_skipIndicator;
break;
case TiOrSkip__not__extended::ALT_transactionId:
delete single_value.field_transactionId;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TiOrSkip__not__extended_template& TiOrSkip__not__extended_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TiOrSkip__not__extended_template& TiOrSkip__not__extended_template::operator=(const TiOrSkip__not__extended& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TiOrSkip__not__extended_template& TiOrSkip__not__extended_template::operator=(const OPTIONAL<TiOrSkip__not__extended>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TiOrSkip__not__extended&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
return *this;
}

TiOrSkip__not__extended_template& TiOrSkip__not__extended_template::operator=(const TiOrSkip__not__extended_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TiOrSkip__not__extended_template::match(const TiOrSkip__not__extended& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TiOrSkip__not__extended::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TiOrSkip__not__extended::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
return single_value.field_skipIndicator->match(other_value.skipIndicator(), legacy);
case TiOrSkip__not__extended::ALT_transactionId:
return single_value.field_transactionId->match(other_value.transactionId(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
return FALSE;
}

boolean TiOrSkip__not__extended_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
return single_value.field_skipIndicator->is_value();
case TiOrSkip__not__extended::ALT_transactionId:
return single_value.field_transactionId->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
}

TiOrSkip__not__extended TiOrSkip__not__extended_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.TiOrSkip_not_extended.");
TiOrSkip__not__extended ret_val;
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
ret_val.skipIndicator() = single_value.field_skipIndicator->valueof();
break;
case TiOrSkip__not__extended::ALT_transactionId:
ret_val.transactionId() = single_value.field_transactionId->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
return ret_val;
}

TiOrSkip__not__extended_template& TiOrSkip__not__extended_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.TiOrSkip_not_extended.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.TiOrSkip_not_extended.");
return value_list.list_value[list_index];
}
void TiOrSkip__not__extended_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TiOrSkip__not__extended_template[list_length];
}

BITSTRING_template& TiOrSkip__not__extended_template::skipIndicator()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TiOrSkip__not__extended::ALT_skipIndicator) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_skipIndicator = new BITSTRING_template(ANY_VALUE);
else single_value.field_skipIndicator = new BITSTRING_template;
single_value.union_selection = TiOrSkip__not__extended::ALT_skipIndicator;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_skipIndicator;
}

const BITSTRING_template& TiOrSkip__not__extended_template::skipIndicator() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field skipIndicator in a non-specific template of union type @MobileL3_Types.TiOrSkip_not_extended.");
if (single_value.union_selection != TiOrSkip__not__extended::ALT_skipIndicator) TTCN_error("Accessing non-selected field skipIndicator in a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
return *single_value.field_skipIndicator;
}

L3__TransactionId__not__extended_template& TiOrSkip__not__extended_template::transactionId()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TiOrSkip__not__extended::ALT_transactionId) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_transactionId = new L3__TransactionId__not__extended_template(ANY_VALUE);
else single_value.field_transactionId = new L3__TransactionId__not__extended_template;
single_value.union_selection = TiOrSkip__not__extended::ALT_transactionId;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_transactionId;
}

const L3__TransactionId__not__extended_template& TiOrSkip__not__extended_template::transactionId() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transactionId in a non-specific template of union type @MobileL3_Types.TiOrSkip_not_extended.");
if (single_value.union_selection != TiOrSkip__not__extended::ALT_transactionId) TTCN_error("Accessing non-selected field transactionId in a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
return *single_value.field_transactionId;
}

boolean TiOrSkip__not__extended_template::ischosen(TiOrSkip__not__extended::union_selection_type checked_selection) const
{
if (checked_selection == TiOrSkip__not__extended::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.TiOrSkip_not_extended.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TiOrSkip__not__extended::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.TiOrSkip_not_extended containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void TiOrSkip__not__extended_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
TTCN_Logger::log_event_str("{ skipIndicator := ");
single_value.field_skipIndicator->log();
TTCN_Logger::log_event_str(" }");
break;
case TiOrSkip__not__extended::ALT_transactionId:
TTCN_Logger::log_event_str("{ transactionId := ");
single_value.field_transactionId->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TiOrSkip__not__extended_template::log_match(const TiOrSkip__not__extended& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".skipIndicator");
single_value.field_skipIndicator->log_match(match_value.skipIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ skipIndicator := ");
single_value.field_skipIndicator->log_match(match_value.skipIndicator(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TiOrSkip__not__extended::ALT_transactionId:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".transactionId");
single_value.field_transactionId->log_match(match_value.transactionId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ transactionId := ");
single_value.field_transactionId->log_match(match_value.transactionId(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TiOrSkip__not__extended_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator->set_implicit_omit(); break;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId->set_implicit_omit(); break;
default: break;
}
}

void TiOrSkip__not__extended_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator->encode_text(text_buf);
break;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.TiOrSkip_not_extended.");
}
}

void TiOrSkip__not__extended_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TiOrSkip__not__extended::UNBOUND_VALUE;
TiOrSkip__not__extended::union_selection_type new_selection = (TiOrSkip__not__extended::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template;
single_value.field_skipIndicator->decode_text(text_buf);
break;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId__not__extended_template;
single_value.field_transactionId->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.TiOrSkip_not_extended.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TiOrSkip__not__extended_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.TiOrSkip_not_extended.");
}
}

boolean TiOrSkip__not__extended_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TiOrSkip__not__extended_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TiOrSkip__not__extended_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.TiOrSkip_not_extended'");
    }
    if (strcmp("skipIndicator", param_field) == 0) {
      skipIndicator().set_param(param);
      return;
    } else if (strcmp("transactionId", param_field) == 0) {
      transactionId().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.TiOrSkip_not_extended'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TiOrSkip__not__extended_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.TiOrSkip_not_extended");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "skipIndicator")) {
      skipIndicator().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "transactionId")) {
      transactionId().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.TiOrSkip_not_extended.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TiOrSkip__not__extended_template* precondition = new TiOrSkip__not__extended_template;
    precondition->set_param(*m_p->get_elem(0));
    TiOrSkip__not__extended_template* implied_template = new TiOrSkip__not__extended_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TiOrSkip__not__extended_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.TiOrSkip_not_extended");
  }
  is_ifpresent = param.get_ifpresent();
}

void TiOrSkip__not__extended_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TiOrSkip__not__extended::ALT_skipIndicator:
single_value.field_skipIndicator->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.TiOrSkip_not_extended");
return;
case TiOrSkip__not__extended::ALT_transactionId:
single_value.field_transactionId->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.TiOrSkip_not_extended");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.TiOrSkip_not_extended.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.TiOrSkip_not_extended");
}

void TiOrSkip::copy_value(const TiOrSkip& other_value)
{
switch (other_value.union_selection) {
case ALT_skipIndicator:
field_skipIndicator = new BITSTRING(*other_value.field_skipIndicator);
break;
case ALT_transactionId:
field_transactionId = new L3__TransactionId(*other_value.field_transactionId);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.TiOrSkip.");
}
union_selection = other_value.union_selection;
}

TiOrSkip::TiOrSkip()
{
union_selection = UNBOUND_VALUE;
}

TiOrSkip::TiOrSkip(const TiOrSkip& other_value)
: Base_Type(){
copy_value(other_value);
}

TiOrSkip::~TiOrSkip()
{
clean_up();
}

TiOrSkip& TiOrSkip::operator=(const TiOrSkip& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean TiOrSkip::operator==(const TiOrSkip& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.TiOrSkip.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.TiOrSkip.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_skipIndicator:
return *field_skipIndicator == *other_value.field_skipIndicator;
case ALT_transactionId:
return *field_transactionId == *other_value.field_transactionId;
default:
return FALSE;
}
}

BITSTRING& TiOrSkip::skipIndicator()
{
if (union_selection != ALT_skipIndicator) {
clean_up();
field_skipIndicator = new BITSTRING;
union_selection = ALT_skipIndicator;
}
return *field_skipIndicator;
}

const BITSTRING& TiOrSkip::skipIndicator() const
{
if (union_selection != ALT_skipIndicator) TTCN_error("Using non-selected field skipIndicator in a value of union type @MobileL3_Types.TiOrSkip.");
return *field_skipIndicator;
}

L3__TransactionId& TiOrSkip::transactionId()
{
if (union_selection != ALT_transactionId) {
clean_up();
field_transactionId = new L3__TransactionId;
union_selection = ALT_transactionId;
}
return *field_transactionId;
}

const L3__TransactionId& TiOrSkip::transactionId() const
{
if (union_selection != ALT_transactionId) TTCN_error("Using non-selected field transactionId in a value of union type @MobileL3_Types.TiOrSkip.");
return *field_transactionId;
}

boolean TiOrSkip::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.TiOrSkip.");
return union_selection == checked_selection;
}

boolean TiOrSkip::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean TiOrSkip::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_skipIndicator: return field_skipIndicator->is_value();
case ALT_transactionId: return field_transactionId->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TiOrSkip::clean_up()
{
switch (union_selection) {
case ALT_skipIndicator:
  delete field_skipIndicator;
  break;
case ALT_transactionId:
  delete field_transactionId;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TiOrSkip::log() const
{
switch (union_selection) {
case ALT_skipIndicator:
TTCN_Logger::log_event_str("{ skipIndicator := ");
field_skipIndicator->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_transactionId:
TTCN_Logger::log_event_str("{ transactionId := ");
field_transactionId->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TiOrSkip::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "skipIndicator")) {
    skipIndicator().set_param(*mp_last);
    if (!skipIndicator().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "transactionId")) {
    transactionId().set_param(*mp_last);
    if (!transactionId().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.TiOrSkip.", last_name);
}

void TiOrSkip::set_implicit_omit()
{
switch (union_selection) {
case ALT_skipIndicator:
field_skipIndicator->set_implicit_omit(); break;
case ALT_transactionId:
field_transactionId->set_implicit_omit(); break;
default: break;
}
}

void TiOrSkip::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_skipIndicator:
field_skipIndicator->encode_text(text_buf);
break;
case ALT_transactionId:
field_transactionId->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.TiOrSkip.");
}
}

void TiOrSkip::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_skipIndicator:
skipIndicator().decode_text(text_buf);
break;
case ALT_transactionId:
transactionId().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.TiOrSkip.");
}
}

void TiOrSkip::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void TiOrSkip::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int TiOrSkip::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
      decoded_length = skipIndicator().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, L3__TransactionId_descr_.raw->forceomit);
      decoded_length = transactionId().RAW_decode(L3__TransactionId_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
      decoded_length = skipIndicator().RAW_decode(General__Types::BIT4_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, L3__TransactionId_descr_.raw->forceomit);
      decoded_length = transactionId().RAW_decode(L3__TransactionId_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int TiOrSkip::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_skipIndicator:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, General__Types::BIT4_descr_.raw);
    encoded_length = field_skipIndicator->RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &General__Types::BIT4_descr_;
    break;
  case ALT_transactionId:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, L3__TransactionId_descr_.raw);
    encoded_length = field_transactionId->RAW_encode(L3__TransactionId_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &L3__TransactionId_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void TiOrSkip_template::copy_value(const TiOrSkip& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template(other_value.skipIndicator());
break;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId_template(other_value.transactionId());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.TiOrSkip.");
}
set_selection(SPECIFIC_VALUE);
}

void TiOrSkip_template::copy_template(const TiOrSkip_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template(*other_value.single_value.field_skipIndicator);
break;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId_template(*other_value.single_value.field_transactionId);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.TiOrSkip.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TiOrSkip_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TiOrSkip_template(*other_value.implication_.precondition);
implication_.implied_template = new TiOrSkip_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.TiOrSkip.");
}
set_selection(other_value);
}

TiOrSkip_template::TiOrSkip_template()
{
}

TiOrSkip_template::TiOrSkip_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TiOrSkip_template::TiOrSkip_template(const TiOrSkip& other_value)
{
copy_value(other_value);
}

TiOrSkip_template::TiOrSkip_template(const OPTIONAL<TiOrSkip>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TiOrSkip&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.TiOrSkip from an unbound optional field.");
}
}

TiOrSkip_template::TiOrSkip_template(TiOrSkip_template* p_precondition, TiOrSkip_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TiOrSkip_template::TiOrSkip_template(Dynamic_Match_Interface<TiOrSkip>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TiOrSkip>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TiOrSkip_template::TiOrSkip_template(const TiOrSkip_template& other_value)
: Base_Template(){
copy_template(other_value);
}

TiOrSkip_template::~TiOrSkip_template()
{
clean_up();
}

void TiOrSkip_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
delete single_value.field_skipIndicator;
break;
case TiOrSkip::ALT_transactionId:
delete single_value.field_transactionId;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TiOrSkip_template& TiOrSkip_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TiOrSkip_template& TiOrSkip_template::operator=(const TiOrSkip& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TiOrSkip_template& TiOrSkip_template::operator=(const OPTIONAL<TiOrSkip>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TiOrSkip&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.TiOrSkip.");
}
return *this;
}

TiOrSkip_template& TiOrSkip_template::operator=(const TiOrSkip_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TiOrSkip_template::match(const TiOrSkip& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TiOrSkip::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TiOrSkip::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TiOrSkip::ALT_skipIndicator:
return single_value.field_skipIndicator->match(other_value.skipIndicator(), legacy);
case TiOrSkip::ALT_transactionId:
return single_value.field_transactionId->match(other_value.transactionId(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.TiOrSkip.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.TiOrSkip.");
}
return FALSE;
}

boolean TiOrSkip_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
return single_value.field_skipIndicator->is_value();
case TiOrSkip::ALT_transactionId:
return single_value.field_transactionId->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.TiOrSkip.");
}
}

TiOrSkip TiOrSkip_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.TiOrSkip.");
TiOrSkip ret_val;
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
ret_val.skipIndicator() = single_value.field_skipIndicator->valueof();
break;
case TiOrSkip::ALT_transactionId:
ret_val.transactionId() = single_value.field_transactionId->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.TiOrSkip.");
}
return ret_val;
}

TiOrSkip_template& TiOrSkip_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.TiOrSkip.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.TiOrSkip.");
return value_list.list_value[list_index];
}
void TiOrSkip_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.TiOrSkip.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TiOrSkip_template[list_length];
}

BITSTRING_template& TiOrSkip_template::skipIndicator()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TiOrSkip::ALT_skipIndicator) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_skipIndicator = new BITSTRING_template(ANY_VALUE);
else single_value.field_skipIndicator = new BITSTRING_template;
single_value.union_selection = TiOrSkip::ALT_skipIndicator;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_skipIndicator;
}

const BITSTRING_template& TiOrSkip_template::skipIndicator() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field skipIndicator in a non-specific template of union type @MobileL3_Types.TiOrSkip.");
if (single_value.union_selection != TiOrSkip::ALT_skipIndicator) TTCN_error("Accessing non-selected field skipIndicator in a template of union type @MobileL3_Types.TiOrSkip.");
return *single_value.field_skipIndicator;
}

L3__TransactionId_template& TiOrSkip_template::transactionId()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TiOrSkip::ALT_transactionId) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_transactionId = new L3__TransactionId_template(ANY_VALUE);
else single_value.field_transactionId = new L3__TransactionId_template;
single_value.union_selection = TiOrSkip::ALT_transactionId;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_transactionId;
}

const L3__TransactionId_template& TiOrSkip_template::transactionId() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transactionId in a non-specific template of union type @MobileL3_Types.TiOrSkip.");
if (single_value.union_selection != TiOrSkip::ALT_transactionId) TTCN_error("Accessing non-selected field transactionId in a template of union type @MobileL3_Types.TiOrSkip.");
return *single_value.field_transactionId;
}

boolean TiOrSkip_template::ischosen(TiOrSkip::union_selection_type checked_selection) const
{
if (checked_selection == TiOrSkip::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.TiOrSkip.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TiOrSkip::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.TiOrSkip.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.TiOrSkip containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void TiOrSkip_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
TTCN_Logger::log_event_str("{ skipIndicator := ");
single_value.field_skipIndicator->log();
TTCN_Logger::log_event_str(" }");
break;
case TiOrSkip::ALT_transactionId:
TTCN_Logger::log_event_str("{ transactionId := ");
single_value.field_transactionId->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TiOrSkip_template::log_match(const TiOrSkip& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".skipIndicator");
single_value.field_skipIndicator->log_match(match_value.skipIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ skipIndicator := ");
single_value.field_skipIndicator->log_match(match_value.skipIndicator(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TiOrSkip::ALT_transactionId:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".transactionId");
single_value.field_transactionId->log_match(match_value.transactionId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ transactionId := ");
single_value.field_transactionId->log_match(match_value.transactionId(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TiOrSkip_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator->set_implicit_omit(); break;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId->set_implicit_omit(); break;
default: break;
}
}

void TiOrSkip_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator->encode_text(text_buf);
break;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.TiOrSkip.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.TiOrSkip.");
}
}

void TiOrSkip_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TiOrSkip::UNBOUND_VALUE;
TiOrSkip::union_selection_type new_selection = (TiOrSkip::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator = new BITSTRING_template;
single_value.field_skipIndicator->decode_text(text_buf);
break;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId = new L3__TransactionId_template;
single_value.field_transactionId->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.TiOrSkip.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TiOrSkip_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.TiOrSkip.");
}
}

boolean TiOrSkip_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TiOrSkip_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TiOrSkip_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.TiOrSkip'");
    }
    if (strcmp("skipIndicator", param_field) == 0) {
      skipIndicator().set_param(param);
      return;
    } else if (strcmp("transactionId", param_field) == 0) {
      transactionId().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.TiOrSkip'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TiOrSkip_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.TiOrSkip");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "skipIndicator")) {
      skipIndicator().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "transactionId")) {
      transactionId().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.TiOrSkip.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TiOrSkip_template* precondition = new TiOrSkip_template;
    precondition->set_param(*m_p->get_elem(0));
    TiOrSkip_template* implied_template = new TiOrSkip_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TiOrSkip_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.TiOrSkip");
  }
  is_ifpresent = param.get_ifpresent();
}

void TiOrSkip_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TiOrSkip::ALT_skipIndicator:
single_value.field_skipIndicator->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.TiOrSkip");
return;
case TiOrSkip::ALT_transactionId:
single_value.field_transactionId->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.TiOrSkip");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.TiOrSkip.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.TiOrSkip");
}

void L3__Discr__SGSN__MS::copy_value(const L3__Discr__SGSN__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_gcc:
field_gcc = new OCTETSTRING(*other_value.field_gcc);
break;
case ALT_bcc:
field_bcc = new OCTETSTRING(*other_value.field_bcc);
break;
case ALT_cc:
field_cc = new OCTETSTRING(*other_value.field_cc);
break;
case ALT_gttp:
field_gttp = new OCTETSTRING(*other_value.field_gttp);
break;
case ALT_mm:
field_mm = new OCTETSTRING(*other_value.field_mm);
break;
case ALT_rrm:
field_rrm = new OCTETSTRING(*other_value.field_rrm);
break;
case ALT_gprs__mm:
field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS(*other_value.field_gprs__mm);
break;
case ALT_sms:
field_sms = new OCTETSTRING(*other_value.field_sms);
break;
case ALT_gprs__sm:
field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS(*other_value.field_gprs__sm);
break;
case ALT_ss:
field_ss = new OCTETSTRING(*other_value.field_ss);
break;
case ALT_loc:
field_loc = new OCTETSTRING(*other_value.field_loc);
break;
case ALT_reserved:
field_reserved = new OCTETSTRING(*other_value.field_reserved);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
union_selection = other_value.union_selection;
}

L3__Discr__SGSN__MS::L3__Discr__SGSN__MS()
{
union_selection = UNBOUND_VALUE;
}

L3__Discr__SGSN__MS::L3__Discr__SGSN__MS(const L3__Discr__SGSN__MS& other_value)
: Base_Type(){
copy_value(other_value);
}

L3__Discr__SGSN__MS::~L3__Discr__SGSN__MS()
{
clean_up();
}

L3__Discr__SGSN__MS& L3__Discr__SGSN__MS::operator=(const L3__Discr__SGSN__MS& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean L3__Discr__SGSN__MS::operator==(const L3__Discr__SGSN__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gcc:
return *field_gcc == *other_value.field_gcc;
case ALT_bcc:
return *field_bcc == *other_value.field_bcc;
case ALT_cc:
return *field_cc == *other_value.field_cc;
case ALT_gttp:
return *field_gttp == *other_value.field_gttp;
case ALT_mm:
return *field_mm == *other_value.field_mm;
case ALT_rrm:
return *field_rrm == *other_value.field_rrm;
case ALT_gprs__mm:
return *field_gprs__mm == *other_value.field_gprs__mm;
case ALT_sms:
return *field_sms == *other_value.field_sms;
case ALT_gprs__sm:
return *field_gprs__sm == *other_value.field_gprs__sm;
case ALT_ss:
return *field_ss == *other_value.field_ss;
case ALT_loc:
return *field_loc == *other_value.field_loc;
case ALT_reserved:
return *field_reserved == *other_value.field_reserved;
default:
return FALSE;
}
}

OCTETSTRING& L3__Discr__SGSN__MS::gcc()
{
if (union_selection != ALT_gcc) {
clean_up();
field_gcc = new OCTETSTRING;
union_selection = ALT_gcc;
}
return *field_gcc;
}

const OCTETSTRING& L3__Discr__SGSN__MS::gcc() const
{
if (union_selection != ALT_gcc) TTCN_error("Using non-selected field gcc in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_gcc;
}

OCTETSTRING& L3__Discr__SGSN__MS::bcc()
{
if (union_selection != ALT_bcc) {
clean_up();
field_bcc = new OCTETSTRING;
union_selection = ALT_bcc;
}
return *field_bcc;
}

const OCTETSTRING& L3__Discr__SGSN__MS::bcc() const
{
if (union_selection != ALT_bcc) TTCN_error("Using non-selected field bcc in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_bcc;
}

OCTETSTRING& L3__Discr__SGSN__MS::cc()
{
if (union_selection != ALT_cc) {
clean_up();
field_cc = new OCTETSTRING;
union_selection = ALT_cc;
}
return *field_cc;
}

const OCTETSTRING& L3__Discr__SGSN__MS::cc() const
{
if (union_selection != ALT_cc) TTCN_error("Using non-selected field cc in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_cc;
}

OCTETSTRING& L3__Discr__SGSN__MS::gttp()
{
if (union_selection != ALT_gttp) {
clean_up();
field_gttp = new OCTETSTRING;
union_selection = ALT_gttp;
}
return *field_gttp;
}

const OCTETSTRING& L3__Discr__SGSN__MS::gttp() const
{
if (union_selection != ALT_gttp) TTCN_error("Using non-selected field gttp in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_gttp;
}

OCTETSTRING& L3__Discr__SGSN__MS::mm()
{
if (union_selection != ALT_mm) {
clean_up();
field_mm = new OCTETSTRING;
union_selection = ALT_mm;
}
return *field_mm;
}

const OCTETSTRING& L3__Discr__SGSN__MS::mm() const
{
if (union_selection != ALT_mm) TTCN_error("Using non-selected field mm in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_mm;
}

OCTETSTRING& L3__Discr__SGSN__MS::rrm()
{
if (union_selection != ALT_rrm) {
clean_up();
field_rrm = new OCTETSTRING;
union_selection = ALT_rrm;
}
return *field_rrm;
}

const OCTETSTRING& L3__Discr__SGSN__MS::rrm() const
{
if (union_selection != ALT_rrm) TTCN_error("Using non-selected field rrm in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_rrm;
}

MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS& L3__Discr__SGSN__MS::gprs__mm()
{
if (union_selection != ALT_gprs__mm) {
clean_up();
field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS;
union_selection = ALT_gprs__mm;
}
return *field_gprs__mm;
}

const MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS& L3__Discr__SGSN__MS::gprs__mm() const
{
if (union_selection != ALT_gprs__mm) TTCN_error("Using non-selected field gprs_mm in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_gprs__mm;
}

OCTETSTRING& L3__Discr__SGSN__MS::sms()
{
if (union_selection != ALT_sms) {
clean_up();
field_sms = new OCTETSTRING;
union_selection = ALT_sms;
}
return *field_sms;
}

const OCTETSTRING& L3__Discr__SGSN__MS::sms() const
{
if (union_selection != ALT_sms) TTCN_error("Using non-selected field sms in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_sms;
}

MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS& L3__Discr__SGSN__MS::gprs__sm()
{
if (union_selection != ALT_gprs__sm) {
clean_up();
field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS;
union_selection = ALT_gprs__sm;
}
return *field_gprs__sm;
}

const MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS& L3__Discr__SGSN__MS::gprs__sm() const
{
if (union_selection != ALT_gprs__sm) TTCN_error("Using non-selected field gprs_sm in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_gprs__sm;
}

OCTETSTRING& L3__Discr__SGSN__MS::ss()
{
if (union_selection != ALT_ss) {
clean_up();
field_ss = new OCTETSTRING;
union_selection = ALT_ss;
}
return *field_ss;
}

const OCTETSTRING& L3__Discr__SGSN__MS::ss() const
{
if (union_selection != ALT_ss) TTCN_error("Using non-selected field ss in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_ss;
}

OCTETSTRING& L3__Discr__SGSN__MS::loc()
{
if (union_selection != ALT_loc) {
clean_up();
field_loc = new OCTETSTRING;
union_selection = ALT_loc;
}
return *field_loc;
}

const OCTETSTRING& L3__Discr__SGSN__MS::loc() const
{
if (union_selection != ALT_loc) TTCN_error("Using non-selected field loc in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_loc;
}

OCTETSTRING& L3__Discr__SGSN__MS::reserved()
{
if (union_selection != ALT_reserved) {
clean_up();
field_reserved = new OCTETSTRING;
union_selection = ALT_reserved;
}
return *field_reserved;
}

const OCTETSTRING& L3__Discr__SGSN__MS::reserved() const
{
if (union_selection != ALT_reserved) TTCN_error("Using non-selected field reserved in a value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *field_reserved;
}

boolean L3__Discr__SGSN__MS::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return union_selection == checked_selection;
}

boolean L3__Discr__SGSN__MS::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean L3__Discr__SGSN__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gcc: return field_gcc->is_value();
case ALT_bcc: return field_bcc->is_value();
case ALT_cc: return field_cc->is_value();
case ALT_gttp: return field_gttp->is_value();
case ALT_mm: return field_mm->is_value();
case ALT_rrm: return field_rrm->is_value();
case ALT_gprs__mm: return field_gprs__mm->is_value();
case ALT_sms: return field_sms->is_value();
case ALT_gprs__sm: return field_gprs__sm->is_value();
case ALT_ss: return field_ss->is_value();
case ALT_loc: return field_loc->is_value();
case ALT_reserved: return field_reserved->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void L3__Discr__SGSN__MS::clean_up()
{
switch (union_selection) {
case ALT_gcc:
  delete field_gcc;
  break;
case ALT_bcc:
  delete field_bcc;
  break;
case ALT_cc:
  delete field_cc;
  break;
case ALT_gttp:
  delete field_gttp;
  break;
case ALT_mm:
  delete field_mm;
  break;
case ALT_rrm:
  delete field_rrm;
  break;
case ALT_gprs__mm:
  delete field_gprs__mm;
  break;
case ALT_sms:
  delete field_sms;
  break;
case ALT_gprs__sm:
  delete field_gprs__sm;
  break;
case ALT_ss:
  delete field_ss;
  break;
case ALT_loc:
  delete field_loc;
  break;
case ALT_reserved:
  delete field_reserved;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void L3__Discr__SGSN__MS::log() const
{
switch (union_selection) {
case ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void L3__Discr__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gcc")) {
    gcc().set_param(*mp_last);
    if (!gcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "bcc")) {
    bcc().set_param(*mp_last);
    if (!bcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cc")) {
    cc().set_param(*mp_last);
    if (!cc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gttp")) {
    gttp().set_param(*mp_last);
    if (!gttp().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mm")) {
    mm().set_param(*mp_last);
    if (!mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rrm")) {
    rrm().set_param(*mp_last);
    if (!rrm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_mm")) {
    gprs__mm().set_param(*mp_last);
    if (!gprs__mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sms")) {
    sms().set_param(*mp_last);
    if (!sms().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_sm")) {
    gprs__sm().set_param(*mp_last);
    if (!gprs__sm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "ss")) {
    ss().set_param(*mp_last);
    if (!ss().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "loc")) {
    loc().set_param(*mp_last);
    if (!loc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "reserved")) {
    reserved().set_param(*mp_last);
    if (!reserved().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.L3_Discr_SGSN_MS.", last_name);
}

void L3__Discr__SGSN__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_gcc:
field_gcc->set_implicit_omit(); break;
case ALT_bcc:
field_bcc->set_implicit_omit(); break;
case ALT_cc:
field_cc->set_implicit_omit(); break;
case ALT_gttp:
field_gttp->set_implicit_omit(); break;
case ALT_mm:
field_mm->set_implicit_omit(); break;
case ALT_rrm:
field_rrm->set_implicit_omit(); break;
case ALT_gprs__mm:
field_gprs__mm->set_implicit_omit(); break;
case ALT_sms:
field_sms->set_implicit_omit(); break;
case ALT_gprs__sm:
field_gprs__sm->set_implicit_omit(); break;
case ALT_ss:
field_ss->set_implicit_omit(); break;
case ALT_loc:
field_loc->set_implicit_omit(); break;
case ALT_reserved:
field_reserved->set_implicit_omit(); break;
default: break;
}
}

void L3__Discr__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gcc:
field_gcc->encode_text(text_buf);
break;
case ALT_bcc:
field_bcc->encode_text(text_buf);
break;
case ALT_cc:
field_cc->encode_text(text_buf);
break;
case ALT_gttp:
field_gttp->encode_text(text_buf);
break;
case ALT_mm:
field_mm->encode_text(text_buf);
break;
case ALT_rrm:
field_rrm->encode_text(text_buf);
break;
case ALT_gprs__mm:
field_gprs__mm->encode_text(text_buf);
break;
case ALT_sms:
field_sms->encode_text(text_buf);
break;
case ALT_gprs__sm:
field_gprs__sm->encode_text(text_buf);
break;
case ALT_ss:
field_ss->encode_text(text_buf);
break;
case ALT_loc:
field_loc->encode_text(text_buf);
break;
case ALT_reserved:
field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}

void L3__Discr__SGSN__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gcc:
gcc().decode_text(text_buf);
break;
case ALT_bcc:
bcc().decode_text(text_buf);
break;
case ALT_cc:
cc().decode_text(text_buf);
break;
case ALT_gttp:
gttp().decode_text(text_buf);
break;
case ALT_mm:
mm().decode_text(text_buf);
break;
case ALT_rrm:
rrm().decode_text(text_buf);
break;
case ALT_gprs__mm:
gprs__mm().decode_text(text_buf);
break;
case ALT_sms:
sms().decode_text(text_buf);
break;
case ALT_gprs__sm:
gprs__sm().decode_text(text_buf);
break;
case ALT_ss:
ss().decode_text(text_buf);
break;
case ALT_loc:
loc().decode_text(text_buf);
break;
case ALT_reserved:
reserved().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}

void L3__Discr__SGSN__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void L3__Discr__SGSN__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int L3__Discr__SGSN__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_8_force_omit(8, force_omit, MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_9_force_omit(9, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_9_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_10_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_10_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_11_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_11_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int L3__Discr__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  memset(myleaf.body.node.nodes, 0, 12 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gcc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, OCTETSTRING_descr_.raw);
    encoded_length = field_gcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_bcc:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, OCTETSTRING_descr_.raw);
    encoded_length = field_bcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_cc:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, OCTETSTRING_descr_.raw);
    encoded_length = field_cc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gttp:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, OCTETSTRING_descr_.raw);
    encoded_length = field_gttp->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_mm:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, OCTETSTRING_descr_.raw);
    encoded_length = field_mm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_rrm:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, OCTETSTRING_descr_.raw);
    encoded_length = field_rrm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gprs__mm:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_.raw);
    encoded_length = field_gprs__mm->RAW_encode(MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_descr_;
    break;
  case ALT_sms:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, OCTETSTRING_descr_.raw);
    encoded_length = field_sms->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gprs__sm:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_.raw);
    encoded_length = field_gprs__sm->RAW_encode(MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_descr_;
    break;
  case ALT_ss:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, OCTETSTRING_descr_.raw);
    encoded_length = field_ss->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_loc:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, OCTETSTRING_descr_.raw);
    encoded_length = field_loc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_reserved:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, OCTETSTRING_descr_.raw);
    encoded_length = field_reserved->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void L3__Discr__SGSN__MS_template::copy_value(const L3__Discr__SGSN__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(other_value.gcc());
break;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(other_value.bcc());
break;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc = new OCTETSTRING_template(other_value.cc());
break;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(other_value.gttp());
break;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm = new OCTETSTRING_template(other_value.mm());
break;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template(other_value.rrm());
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template(other_value.gprs__mm());
break;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms = new OCTETSTRING_template(other_value.sms());
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template(other_value.gprs__sm());
break;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss = new OCTETSTRING_template(other_value.ss());
break;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(other_value.loc());
break;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(other_value.reserved());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void L3__Discr__SGSN__MS_template::copy_template(const L3__Discr__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(*other_value.single_value.field_gcc);
break;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(*other_value.single_value.field_bcc);
break;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc = new OCTETSTRING_template(*other_value.single_value.field_cc);
break;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(*other_value.single_value.field_gttp);
break;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm = new OCTETSTRING_template(*other_value.single_value.field_mm);
break;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template(*other_value.single_value.field_rrm);
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template(*other_value.single_value.field_gprs__mm);
break;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms = new OCTETSTRING_template(*other_value.single_value.field_sms);
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template(*other_value.single_value.field_gprs__sm);
break;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss = new OCTETSTRING_template(*other_value.single_value.field_ss);
break;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(*other_value.single_value.field_loc);
break;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(*other_value.single_value.field_reserved);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new L3__Discr__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L3__Discr__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__Discr__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
set_selection(other_value);
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template()
{
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(const L3__Discr__SGSN__MS& other_value)
{
copy_value(other_value);
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(const OPTIONAL<L3__Discr__SGSN__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__Discr__SGSN__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.L3_Discr_SGSN_MS from an unbound optional field.");
}
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(L3__Discr__SGSN__MS_template* p_precondition, L3__Discr__SGSN__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(Dynamic_Match_Interface<L3__Discr__SGSN__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<L3__Discr__SGSN__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

L3__Discr__SGSN__MS_template::L3__Discr__SGSN__MS_template(const L3__Discr__SGSN__MS_template& other_value)
: Base_Template(){
copy_template(other_value);
}

L3__Discr__SGSN__MS_template::~L3__Discr__SGSN__MS_template()
{
clean_up();
}

void L3__Discr__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
delete single_value.field_gcc;
break;
case L3__Discr__SGSN__MS::ALT_bcc:
delete single_value.field_bcc;
break;
case L3__Discr__SGSN__MS::ALT_cc:
delete single_value.field_cc;
break;
case L3__Discr__SGSN__MS::ALT_gttp:
delete single_value.field_gttp;
break;
case L3__Discr__SGSN__MS::ALT_mm:
delete single_value.field_mm;
break;
case L3__Discr__SGSN__MS::ALT_rrm:
delete single_value.field_rrm;
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
delete single_value.field_gprs__mm;
break;
case L3__Discr__SGSN__MS::ALT_sms:
delete single_value.field_sms;
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
delete single_value.field_gprs__sm;
break;
case L3__Discr__SGSN__MS::ALT_ss:
delete single_value.field_ss;
break;
case L3__Discr__SGSN__MS::ALT_loc:
delete single_value.field_loc;
break;
case L3__Discr__SGSN__MS::ALT_reserved:
delete single_value.field_reserved;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

L3__Discr__SGSN__MS_template& L3__Discr__SGSN__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

L3__Discr__SGSN__MS_template& L3__Discr__SGSN__MS_template::operator=(const L3__Discr__SGSN__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

L3__Discr__SGSN__MS_template& L3__Discr__SGSN__MS_template::operator=(const OPTIONAL<L3__Discr__SGSN__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__Discr__SGSN__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
return *this;
}

L3__Discr__SGSN__MS_template& L3__Discr__SGSN__MS_template::operator=(const L3__Discr__SGSN__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean L3__Discr__SGSN__MS_template::match(const L3__Discr__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
L3__Discr__SGSN__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == L3__Discr__SGSN__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
return single_value.field_gcc->match(other_value.gcc(), legacy);
case L3__Discr__SGSN__MS::ALT_bcc:
return single_value.field_bcc->match(other_value.bcc(), legacy);
case L3__Discr__SGSN__MS::ALT_cc:
return single_value.field_cc->match(other_value.cc(), legacy);
case L3__Discr__SGSN__MS::ALT_gttp:
return single_value.field_gttp->match(other_value.gttp(), legacy);
case L3__Discr__SGSN__MS::ALT_mm:
return single_value.field_mm->match(other_value.mm(), legacy);
case L3__Discr__SGSN__MS::ALT_rrm:
return single_value.field_rrm->match(other_value.rrm(), legacy);
case L3__Discr__SGSN__MS::ALT_gprs__mm:
return single_value.field_gprs__mm->match(other_value.gprs__mm(), legacy);
case L3__Discr__SGSN__MS::ALT_sms:
return single_value.field_sms->match(other_value.sms(), legacy);
case L3__Discr__SGSN__MS::ALT_gprs__sm:
return single_value.field_gprs__sm->match(other_value.gprs__sm(), legacy);
case L3__Discr__SGSN__MS::ALT_ss:
return single_value.field_ss->match(other_value.ss(), legacy);
case L3__Discr__SGSN__MS::ALT_loc:
return single_value.field_loc->match(other_value.loc(), legacy);
case L3__Discr__SGSN__MS::ALT_reserved:
return single_value.field_reserved->match(other_value.reserved(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
return FALSE;
}

boolean L3__Discr__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
return single_value.field_gcc->is_value();
case L3__Discr__SGSN__MS::ALT_bcc:
return single_value.field_bcc->is_value();
case L3__Discr__SGSN__MS::ALT_cc:
return single_value.field_cc->is_value();
case L3__Discr__SGSN__MS::ALT_gttp:
return single_value.field_gttp->is_value();
case L3__Discr__SGSN__MS::ALT_mm:
return single_value.field_mm->is_value();
case L3__Discr__SGSN__MS::ALT_rrm:
return single_value.field_rrm->is_value();
case L3__Discr__SGSN__MS::ALT_gprs__mm:
return single_value.field_gprs__mm->is_value();
case L3__Discr__SGSN__MS::ALT_sms:
return single_value.field_sms->is_value();
case L3__Discr__SGSN__MS::ALT_gprs__sm:
return single_value.field_gprs__sm->is_value();
case L3__Discr__SGSN__MS::ALT_ss:
return single_value.field_ss->is_value();
case L3__Discr__SGSN__MS::ALT_loc:
return single_value.field_loc->is_value();
case L3__Discr__SGSN__MS::ALT_reserved:
return single_value.field_reserved->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}

L3__Discr__SGSN__MS L3__Discr__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
L3__Discr__SGSN__MS ret_val;
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
ret_val.gcc() = single_value.field_gcc->valueof();
break;
case L3__Discr__SGSN__MS::ALT_bcc:
ret_val.bcc() = single_value.field_bcc->valueof();
break;
case L3__Discr__SGSN__MS::ALT_cc:
ret_val.cc() = single_value.field_cc->valueof();
break;
case L3__Discr__SGSN__MS::ALT_gttp:
ret_val.gttp() = single_value.field_gttp->valueof();
break;
case L3__Discr__SGSN__MS::ALT_mm:
ret_val.mm() = single_value.field_mm->valueof();
break;
case L3__Discr__SGSN__MS::ALT_rrm:
ret_val.rrm() = single_value.field_rrm->valueof();
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
ret_val.gprs__mm() = single_value.field_gprs__mm->valueof();
break;
case L3__Discr__SGSN__MS::ALT_sms:
ret_val.sms() = single_value.field_sms->valueof();
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
ret_val.gprs__sm() = single_value.field_gprs__sm->valueof();
break;
case L3__Discr__SGSN__MS::ALT_ss:
ret_val.ss() = single_value.field_ss->valueof();
break;
case L3__Discr__SGSN__MS::ALT_loc:
ret_val.loc() = single_value.field_loc->valueof();
break;
case L3__Discr__SGSN__MS::ALT_reserved:
ret_val.reserved() = single_value.field_reserved->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
return ret_val;
}

L3__Discr__SGSN__MS_template& L3__Discr__SGSN__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return value_list.list_value[list_index];
}
void L3__Discr__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new L3__Discr__SGSN__MS_template[list_length];
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::gcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_gcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gcc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_gcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gcc;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::gcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gcc in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_gcc) TTCN_error("Accessing non-selected field gcc in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_gcc;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::bcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_bcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_bcc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_bcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bcc;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::bcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bcc in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_bcc) TTCN_error("Accessing non-selected field bcc in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_bcc;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::cc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_cc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_cc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_cc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cc;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::cc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cc in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_cc) TTCN_error("Accessing non-selected field cc in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_cc;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::gttp()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_gttp) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gttp = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gttp = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_gttp;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gttp;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::gttp() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gttp in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_gttp) TTCN_error("Accessing non-selected field gttp in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_gttp;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_mm = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mm;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mm in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_mm) TTCN_error("Accessing non-selected field mm in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_mm;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::rrm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_rrm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rrm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_rrm = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_rrm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rrm;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::rrm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rrm in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_rrm) TTCN_error("Accessing non-selected field rrm in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_rrm;
}

MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template& L3__Discr__SGSN__MS_template::gprs__mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_gprs__mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template(ANY_VALUE);
else single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_gprs__mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__mm;
}

const MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template& L3__Discr__SGSN__MS_template::gprs__mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_mm in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_gprs__mm) TTCN_error("Accessing non-selected field gprs_mm in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_gprs__mm;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::sms()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_sms) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sms = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_sms = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_sms;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sms;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::sms() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sms in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_sms) TTCN_error("Accessing non-selected field sms in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_sms;
}

MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template& L3__Discr__SGSN__MS_template::gprs__sm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_gprs__sm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template(ANY_VALUE);
else single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_gprs__sm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__sm;
}

const MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template& L3__Discr__SGSN__MS_template::gprs__sm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_sm in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_gprs__sm) TTCN_error("Accessing non-selected field gprs_sm in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_gprs__sm;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::ss()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_ss) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ss = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_ss = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_ss;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_ss;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::ss() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ss in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_ss) TTCN_error("Accessing non-selected field ss in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_ss;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::loc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_loc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_loc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_loc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_loc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_loc;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::loc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field loc in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_loc) TTCN_error("Accessing non-selected field loc in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_loc;
}

OCTETSTRING_template& L3__Discr__SGSN__MS_template::reserved()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__SGSN__MS::ALT_reserved) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_reserved = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_reserved = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__SGSN__MS::ALT_reserved;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_reserved;
}

const OCTETSTRING_template& L3__Discr__SGSN__MS_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field reserved in a non-specific template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
if (single_value.union_selection != L3__Discr__SGSN__MS::ALT_reserved) TTCN_error("Accessing non-selected field reserved in a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return *single_value.field_reserved;
}

boolean L3__Discr__SGSN__MS_template::ischosen(L3__Discr__SGSN__MS::union_selection_type checked_selection) const
{
if (checked_selection == L3__Discr__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == L3__Discr__SGSN__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.L3_Discr_SGSN_MS containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void L3__Discr__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__SGSN__MS::ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void L3__Discr__SGSN__MS_template::log_match(const L3__Discr__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gcc");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_bcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bcc");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_cc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cc");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_gttp:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gttp");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mm");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_rrm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rrm");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_mm");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_sms:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sms");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_sm");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_ss:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".ss");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_loc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".loc");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__SGSN__MS::ALT_reserved:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".reserved");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void L3__Discr__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc->set_implicit_omit(); break;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved->set_implicit_omit(); break;
default: break;
}
}

void L3__Discr__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc->encode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}

void L3__Discr__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = L3__Discr__SGSN__MS::UNBOUND_VALUE;
L3__Discr__SGSN__MS::union_selection_type new_selection = (L3__Discr__SGSN__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template;
single_value.field_gcc->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template;
single_value.field_bcc->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc = new OCTETSTRING_template;
single_value.field_cc->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template;
single_value.field_gttp->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm = new OCTETSTRING_template;
single_value.field_mm->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template;
single_value.field_rrm->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__SGSN__MS_template;
single_value.field_gprs__mm->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms = new OCTETSTRING_template;
single_value.field_sms->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__SGSN__MS_template;
single_value.field_gprs__sm->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss = new OCTETSTRING_template;
single_value.field_ss->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template;
single_value.field_loc->decode_text(text_buf);
break;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template;
single_value.field_reserved->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new L3__Discr__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
}

boolean L3__Discr__SGSN__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean L3__Discr__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void L3__Discr__SGSN__MS_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.L3_Discr_SGSN_MS'");
    }
    if (strcmp("gcc", param_field) == 0) {
      gcc().set_param(param);
      return;
    } else if (strcmp("bcc", param_field) == 0) {
      bcc().set_param(param);
      return;
    } else if (strcmp("cc", param_field) == 0) {
      cc().set_param(param);
      return;
    } else if (strcmp("gttp", param_field) == 0) {
      gttp().set_param(param);
      return;
    } else if (strcmp("mm", param_field) == 0) {
      mm().set_param(param);
      return;
    } else if (strcmp("rrm", param_field) == 0) {
      rrm().set_param(param);
      return;
    } else if (strcmp("gprs_mm", param_field) == 0) {
      gprs__mm().set_param(param);
      return;
    } else if (strcmp("sms", param_field) == 0) {
      sms().set_param(param);
      return;
    } else if (strcmp("gprs_sm", param_field) == 0) {
      gprs__sm().set_param(param);
      return;
    } else if (strcmp("ss", param_field) == 0) {
      ss().set_param(param);
      return;
    } else if (strcmp("loc", param_field) == 0) {
      loc().set_param(param);
      return;
    } else if (strcmp("reserved", param_field) == 0) {
      reserved().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.L3_Discr_SGSN_MS'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L3__Discr__SGSN__MS_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.L3_Discr_SGSN_MS");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "gcc")) {
      gcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "bcc")) {
      bcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cc")) {
      cc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gttp")) {
      gttp().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mm")) {
      mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rrm")) {
      rrm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_mm")) {
      gprs__mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sms")) {
      sms().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_sm")) {
      gprs__sm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "ss")) {
      ss().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "loc")) {
      loc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "reserved")) {
      reserved().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.L3_Discr_SGSN_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__Discr__SGSN__MS_template* precondition = new L3__Discr__SGSN__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    L3__Discr__SGSN__MS_template* implied_template = new L3__Discr__SGSN__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = L3__Discr__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.L3_Discr_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__Discr__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case L3__Discr__SGSN__MS::ALT_gcc:
single_value.field_gcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_bcc:
single_value.field_bcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_cc:
single_value.field_cc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_gttp:
single_value.field_gttp->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_mm:
single_value.field_mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_rrm:
single_value.field_rrm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_gprs__mm:
single_value.field_gprs__mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_sms:
single_value.field_sms->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_gprs__sm:
single_value.field_gprs__sm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_ss:
single_value.field_ss->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_loc:
single_value.field_loc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
case L3__Discr__SGSN__MS::ALT_reserved:
single_value.field_reserved->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.L3_Discr_SGSN_MS.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.L3_Discr_SGSN_MS");
}

PDU__L3__SGSN__MS__unextended__ti::PDU__L3__SGSN__MS__unextended__ti()
{
}

PDU__L3__SGSN__MS__unextended__ti::PDU__L3__SGSN__MS__unextended__ti(const BITSTRING& par_discriminator,
    const TiOrSkip__not__extended& par_tiOrSkip,
    const L3__Discr__SGSN__MS& par_msgs)
  :   field_discriminator(par_discriminator),
  field_tiOrSkip(par_tiOrSkip),
  field_msgs(par_msgs)
{
}

PDU__L3__SGSN__MS__unextended__ti::PDU__L3__SGSN__MS__unextended__ti(const PDU__L3__SGSN__MS__unextended__ti& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
else field_discriminator.clean_up();
if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
else field_tiOrSkip.clean_up();
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
}

void PDU__L3__SGSN__MS__unextended__ti::clean_up()
{
field_discriminator.clean_up();
field_tiOrSkip.clean_up();
field_msgs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__L3__SGSN__MS__unextended__ti::get_descriptor() const { return &PDU__L3__SGSN__MS__unextended__ti_descr_; }
PDU__L3__SGSN__MS__unextended__ti& PDU__L3__SGSN__MS__unextended__ti::operator=(const PDU__L3__SGSN__MS__unextended__ti& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
  if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
  else field_discriminator.clean_up();
  if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
  else field_tiOrSkip.clean_up();
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
}
return *this;
}

boolean PDU__L3__SGSN__MS__unextended__ti::operator==(const PDU__L3__SGSN__MS__unextended__ti& other_value) const
{
return field_discriminator==other_value.field_discriminator
  && field_tiOrSkip==other_value.field_tiOrSkip
  && field_msgs==other_value.field_msgs;
}

boolean PDU__L3__SGSN__MS__unextended__ti::is_bound() const
{
return (field_discriminator.is_bound())
  || (field_tiOrSkip.is_bound())
  || (field_msgs.is_bound());
}
boolean PDU__L3__SGSN__MS__unextended__ti::is_value() const
{
return field_discriminator.is_value()
  && field_tiOrSkip.is_value()
  && field_msgs.is_value();
}
void PDU__L3__SGSN__MS__unextended__ti::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ discriminator := ");
field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__L3__SGSN__MS__unextended__ti::set_implicit_omit()
{
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__SGSN__MS__unextended__ti::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
  }
}

void PDU__L3__SGSN__MS__unextended__ti::encode_text(Text_Buf& text_buf) const
{
field_discriminator.encode_text(text_buf);
field_tiOrSkip.encode_text(text_buf);
field_msgs.encode_text(text_buf);
}

void PDU__L3__SGSN__MS__unextended__ti::decode_text(Text_Buf& text_buf)
{
field_discriminator.decode_text(text_buf);
field_tiOrSkip.decode_text(text_buf);
field_msgs.decode_text(text_buf);
}

void PDU__L3__SGSN__MS__unextended__ti::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__L3__SGSN__MS__unextended__ti::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__L3__SGSN__MS__unextended__ti::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_12 || field_discriminator ==  bs_4 || field_discriminator ==  bs_5 || field_discriminator ==  bs_6 || field_discriminator ==  bs_13 || field_discriminator ==  bs_7 || field_discriminator ==  bs_11 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 0;
  else if (field_discriminator ==  bs_1 || field_discriminator ==  bs_2 || field_discriminator ==  bs_3 || field_discriminator ==  bs_8 || field_discriminator ==  bs_10 || field_discriminator ==  bs_9) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_.raw->forceomit);
  decoded_field_length = field_tiOrSkip.RAW_decode(PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_1) selected_field = 0;
  else if (field_discriminator ==  bs_2) selected_field = 1;
  else if (field_discriminator ==  bs_3) selected_field = 2;
  else if (field_discriminator ==  bs_4) selected_field = 3;
  else if (field_discriminator ==  bs_5) selected_field = 4;
  else if (field_discriminator ==  bs_6) selected_field = 5;
  else if (field_discriminator ==  bs_7) selected_field = 6;
  else if (field_discriminator ==  bs_8) selected_field = 7;
  else if (field_discriminator ==  bs_9) selected_field = 8;
  else if (field_discriminator ==  bs_10) selected_field = 9;
  else if (field_discriminator ==  bs_11) selected_field = 10;
  else if (field_discriminator ==  bs_12 || field_discriminator ==  bs_13 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 11;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__L3__SGSN__MS__unextended__ti_msgs_descr_.raw->forceomit);
  decoded_field_length = field_msgs.RAW_decode(PDU__L3__SGSN__MS__unextended__ti_msgs_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__L3__SGSN__MS__unextended__ti::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__L3__SGSN__MS__unextended__ti_msgs_descr_.raw);
  encoded_length += field_discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiOrSkip.RAW_encode(PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msgs.RAW_encode(PDU__L3__SGSN__MS__unextended__ti_msgs_descr_, *myleaf.body.node.nodes[2]);
  switch (field_tiOrSkip.get_selection()) {
  case TiOrSkip__not__extended::ALT_skipIndicator:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_4 && field_discriminator !=  bs_5 && field_discriminator !=  bs_6 && field_discriminator !=  bs_13 && field_discriminator !=  bs_7 && field_discriminator !=  bs_11 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case TiOrSkip__not__extended::ALT_transactionId:
  if (field_discriminator !=  bs_1 && field_discriminator !=  bs_2 && field_discriminator !=  bs_3 && field_discriminator !=  bs_8 && field_discriminator !=  bs_10 && field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  switch (field_msgs.get_selection()) {
  case L3__Discr__SGSN__MS::ALT_gcc:
  if (field_discriminator !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_bcc:
  if (field_discriminator !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_cc:
  if (field_discriminator !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gttp:
  if (field_discriminator !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_mm:
  if (field_discriminator !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_rrm:
  if (field_discriminator !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gprs__mm:
  if (field_discriminator !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_sms:
  if (field_discriminator !=  bs_8) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_8.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gprs__sm:
  if (field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_9.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_ss:
  if (field_discriminator !=  bs_10) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_10.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_loc:
  if (field_discriminator !=  bs_11) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_reserved:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_13 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct PDU__L3__SGSN__MS__unextended__ti_template::single_value_struct {
BITSTRING_template field_discriminator;
TiOrSkip__not__extended_template field_tiOrSkip;
L3__Discr__SGSN__MS_template field_msgs;
};

void PDU__L3__SGSN__MS__unextended__ti_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_discriminator = ANY_VALUE;
single_value->field_tiOrSkip = ANY_VALUE;
single_value->field_msgs = ANY_VALUE;
}
}
}

void PDU__L3__SGSN__MS__unextended__ti_template::copy_value(const PDU__L3__SGSN__MS__unextended__ti& other_value)
{
single_value = new single_value_struct;
if (other_value.discriminator().is_bound()) {
  single_value->field_discriminator = other_value.discriminator();
} else {
  single_value->field_discriminator.clean_up();
}
if (other_value.tiOrSkip().is_bound()) {
  single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
  single_value->field_tiOrSkip.clean_up();
}
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__L3__SGSN__MS__unextended__ti_template::copy_template(const PDU__L3__SGSN__MS__unextended__ti_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.discriminator().get_selection()) {
single_value->field_discriminator = other_value.discriminator();
} else {
single_value->field_discriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiOrSkip().get_selection()) {
single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
single_value->field_tiOrSkip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__L3__SGSN__MS__unextended__ti_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__L3__SGSN__MS__unextended__ti_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__L3__SGSN__MS__unextended__ti_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
break;
}
set_selection(other_value);
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template()
{
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(const PDU__L3__SGSN__MS__unextended__ti& other_value)
{
copy_value(other_value);
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(const OPTIONAL<PDU__L3__SGSN__MS__unextended__ti>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__SGSN__MS__unextended__ti&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti from an unbound optional field.");
}
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(PDU__L3__SGSN__MS__unextended__ti_template* p_precondition, PDU__L3__SGSN__MS__unextended__ti_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(Dynamic_Match_Interface<PDU__L3__SGSN__MS__unextended__ti>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__L3__SGSN__MS__unextended__ti>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__L3__SGSN__MS__unextended__ti_template::PDU__L3__SGSN__MS__unextended__ti_template(const PDU__L3__SGSN__MS__unextended__ti_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__L3__SGSN__MS__unextended__ti_template::~PDU__L3__SGSN__MS__unextended__ti_template()
{
clean_up();
}

PDU__L3__SGSN__MS__unextended__ti_template& PDU__L3__SGSN__MS__unextended__ti_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__L3__SGSN__MS__unextended__ti_template& PDU__L3__SGSN__MS__unextended__ti_template::operator=(const PDU__L3__SGSN__MS__unextended__ti& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__L3__SGSN__MS__unextended__ti_template& PDU__L3__SGSN__MS__unextended__ti_template::operator=(const OPTIONAL<PDU__L3__SGSN__MS__unextended__ti>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__SGSN__MS__unextended__ti&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
}
return *this;
}

PDU__L3__SGSN__MS__unextended__ti_template& PDU__L3__SGSN__MS__unextended__ti_template::operator=(const PDU__L3__SGSN__MS__unextended__ti_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__L3__SGSN__MS__unextended__ti_template::match(const PDU__L3__SGSN__MS__unextended__ti& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.discriminator().is_bound()) return FALSE;
if(!single_value->field_discriminator.match(other_value.discriminator(), legacy))return FALSE;
if(!other_value.tiOrSkip().is_bound()) return FALSE;
if(!single_value->field_tiOrSkip.match(other_value.tiOrSkip(), legacy))return FALSE;
if(!other_value.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
}
return FALSE;
}

boolean PDU__L3__SGSN__MS__unextended__ti_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_discriminator.is_bound()
 || single_value->field_tiOrSkip.is_bound()
 || single_value->field_msgs.is_bound();
}

boolean PDU__L3__SGSN__MS__unextended__ti_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_discriminator.is_value()
 && single_value->field_tiOrSkip.is_value()
 && single_value->field_msgs.is_value();
}

void PDU__L3__SGSN__MS__unextended__ti_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__L3__SGSN__MS__unextended__ti PDU__L3__SGSN__MS__unextended__ti_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
PDU__L3__SGSN__MS__unextended__ti ret_val;
if (single_value->field_discriminator.is_bound()) {
ret_val.discriminator() = single_value->field_discriminator.valueof();
}
if (single_value->field_tiOrSkip.is_bound()) {
ret_val.tiOrSkip() = single_value->field_tiOrSkip.valueof();
}
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
return ret_val;
}

void PDU__L3__SGSN__MS__unextended__ti_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__L3__SGSN__MS__unextended__ti_template[list_length];
}

PDU__L3__SGSN__MS__unextended__ti_template& PDU__L3__SGSN__MS__unextended__ti_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__L3__SGSN__MS__unextended__ti_template::discriminator()
{
set_specific();
return single_value->field_discriminator;
}

const BITSTRING_template& PDU__L3__SGSN__MS__unextended__ti_template::discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field discriminator of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
return single_value->field_discriminator;
}

TiOrSkip__not__extended_template& PDU__L3__SGSN__MS__unextended__ti_template::tiOrSkip()
{
set_specific();
return single_value->field_tiOrSkip;
}

const TiOrSkip__not__extended_template& PDU__L3__SGSN__MS__unextended__ti_template::tiOrSkip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiOrSkip of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
return single_value->field_tiOrSkip;
}

L3__Discr__SGSN__MS_template& PDU__L3__SGSN__MS__unextended__ti_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const L3__Discr__SGSN__MS_template& PDU__L3__SGSN__MS__unextended__ti_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
return single_value->field_msgs;
}

int PDU__L3__SGSN__MS__unextended__ti_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
  }
  return 0;
}

void PDU__L3__SGSN__MS__unextended__ti_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__L3__SGSN__MS__unextended__ti_template::log_match(const PDU__L3__SGSN__MS__unextended__ti& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_discriminator.match(match_value.discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".discriminator");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiOrSkip.match(match_value.tiOrSkip(), legacy)){
TTCN_Logger::log_logmatch_info(".tiOrSkip");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__L3__SGSN__MS__unextended__ti_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__SGSN__MS__unextended__ti_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_discriminator.encode_text(text_buf);
single_value->field_tiOrSkip.encode_text(text_buf);
single_value->field_msgs.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
}
}

void PDU__L3__SGSN__MS__unextended__ti_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_discriminator.decode_text(text_buf);
single_value->field_tiOrSkip.decode_text(text_buf);
single_value->field_msgs.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__L3__SGSN__MS__unextended__ti_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti.");
}
}

void PDU__L3__SGSN__MS__unextended__ti_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__L3__SGSN__MS__unextended__ti_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__L3__SGSN__MS__unextended__ti_template* precondition = new PDU__L3__SGSN__MS__unextended__ti_template;
    precondition->set_param(*param.get_elem(0));
    PDU__L3__SGSN__MS__unextended__ti_template* implied_template = new PDU__L3__SGSN__MS__unextended__ti_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__L3__SGSN__MS__unextended__ti_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__L3__SGSN__MS__unextended__ti_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_discriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
single_value->field_tiOrSkip.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
single_value->field_msgs.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti");
}

boolean PDU__L3__SGSN__MS__unextended__ti_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__L3__SGSN__MS__unextended__ti_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__L3__SGSN__MS::PDU__L3__SGSN__MS()
{
}

PDU__L3__SGSN__MS::PDU__L3__SGSN__MS(const BITSTRING& par_discriminator,
    const TiOrSkip& par_tiOrSkip,
    const L3__Discr__SGSN__MS& par_msgs)
  :   field_discriminator(par_discriminator),
  field_tiOrSkip(par_tiOrSkip),
  field_msgs(par_msgs)
{
}

PDU__L3__SGSN__MS::PDU__L3__SGSN__MS(const PDU__L3__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.PDU_L3_SGSN_MS.");
if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
else field_discriminator.clean_up();
if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
else field_tiOrSkip.clean_up();
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
}

void PDU__L3__SGSN__MS::clean_up()
{
field_discriminator.clean_up();
field_tiOrSkip.clean_up();
field_msgs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__L3__SGSN__MS::get_descriptor() const { return &PDU__L3__SGSN__MS_descr_; }
PDU__L3__SGSN__MS& PDU__L3__SGSN__MS::operator=(const PDU__L3__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.PDU_L3_SGSN_MS.");
  if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
  else field_discriminator.clean_up();
  if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
  else field_tiOrSkip.clean_up();
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
}
return *this;
}

boolean PDU__L3__SGSN__MS::operator==(const PDU__L3__SGSN__MS& other_value) const
{
return field_discriminator==other_value.field_discriminator
  && field_tiOrSkip==other_value.field_tiOrSkip
  && field_msgs==other_value.field_msgs;
}

boolean PDU__L3__SGSN__MS::is_bound() const
{
return (field_discriminator.is_bound())
  || (field_tiOrSkip.is_bound())
  || (field_msgs.is_bound());
}
boolean PDU__L3__SGSN__MS::is_value() const
{
return field_discriminator.is_value()
  && field_tiOrSkip.is_value()
  && field_msgs.is_value();
}
void PDU__L3__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ discriminator := ");
field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__L3__SGSN__MS::set_implicit_omit()
{
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.PDU_L3_SGSN_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.PDU_L3_SGSN_MS");
  }
}

void PDU__L3__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_discriminator.encode_text(text_buf);
field_tiOrSkip.encode_text(text_buf);
field_msgs.encode_text(text_buf);
}

void PDU__L3__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_discriminator.decode_text(text_buf);
field_tiOrSkip.decode_text(text_buf);
field_msgs.decode_text(text_buf);
}

void PDU__L3__SGSN__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__L3__SGSN__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__L3__SGSN__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_12 || field_discriminator ==  bs_4 || field_discriminator ==  bs_5 || field_discriminator ==  bs_6 || field_discriminator ==  bs_13 || field_discriminator ==  bs_7 || field_discriminator ==  bs_11 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 0;
  else if (field_discriminator ==  bs_1 || field_discriminator ==  bs_2 || field_discriminator ==  bs_3 || field_discriminator ==  bs_10 || field_discriminator ==  bs_8 || field_discriminator ==  bs_9) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__L3__SGSN__MS_tiOrSkip_descr_.raw->forceomit);
  decoded_field_length = field_tiOrSkip.RAW_decode(PDU__L3__SGSN__MS_tiOrSkip_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_1) selected_field = 0;
  else if (field_discriminator ==  bs_2) selected_field = 1;
  else if (field_discriminator ==  bs_3) selected_field = 2;
  else if (field_discriminator ==  bs_4) selected_field = 3;
  else if (field_discriminator ==  bs_5) selected_field = 4;
  else if (field_discriminator ==  bs_6) selected_field = 5;
  else if (field_discriminator ==  bs_7) selected_field = 6;
  else if (field_discriminator ==  bs_8) selected_field = 7;
  else if (field_discriminator ==  bs_9) selected_field = 8;
  else if (field_discriminator ==  bs_10) selected_field = 9;
  else if (field_discriminator ==  bs_11) selected_field = 10;
  else if (field_discriminator ==  bs_12 || field_discriminator ==  bs_13 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 11;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__L3__SGSN__MS_msgs_descr_.raw->forceomit);
  decoded_field_length = field_msgs.RAW_decode(PDU__L3__SGSN__MS_msgs_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__L3__SGSN__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__L3__SGSN__MS_tiOrSkip_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__L3__SGSN__MS_msgs_descr_.raw);
  encoded_length += field_discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiOrSkip.RAW_encode(PDU__L3__SGSN__MS_tiOrSkip_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msgs.RAW_encode(PDU__L3__SGSN__MS_msgs_descr_, *myleaf.body.node.nodes[2]);
  switch (field_tiOrSkip.get_selection()) {
  case TiOrSkip::ALT_skipIndicator:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_4 && field_discriminator !=  bs_5 && field_discriminator !=  bs_6 && field_discriminator !=  bs_13 && field_discriminator !=  bs_7 && field_discriminator !=  bs_11 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case TiOrSkip::ALT_transactionId:
  if (field_discriminator !=  bs_1 && field_discriminator !=  bs_2 && field_discriminator !=  bs_3 && field_discriminator !=  bs_10 && field_discriminator !=  bs_8 && field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  switch (field_msgs.get_selection()) {
  case L3__Discr__SGSN__MS::ALT_gcc:
  if (field_discriminator !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_bcc:
  if (field_discriminator !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_cc:
  if (field_discriminator !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gttp:
  if (field_discriminator !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_mm:
  if (field_discriminator !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_rrm:
  if (field_discriminator !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gprs__mm:
  if (field_discriminator !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_sms:
  if (field_discriminator !=  bs_8) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_8.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_gprs__sm:
  if (field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_9.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_ss:
  if (field_discriminator !=  bs_10) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_10.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_loc:
  if (field_discriminator !=  bs_11) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__SGSN__MS::ALT_reserved:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_13 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct PDU__L3__SGSN__MS_template::single_value_struct {
BITSTRING_template field_discriminator;
TiOrSkip_template field_tiOrSkip;
L3__Discr__SGSN__MS_template field_msgs;
};

void PDU__L3__SGSN__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_discriminator = ANY_VALUE;
single_value->field_tiOrSkip = ANY_VALUE;
single_value->field_msgs = ANY_VALUE;
}
}
}

void PDU__L3__SGSN__MS_template::copy_value(const PDU__L3__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.discriminator().is_bound()) {
  single_value->field_discriminator = other_value.discriminator();
} else {
  single_value->field_discriminator.clean_up();
}
if (other_value.tiOrSkip().is_bound()) {
  single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
  single_value->field_tiOrSkip.clean_up();
}
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__L3__SGSN__MS_template::copy_template(const PDU__L3__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.discriminator().get_selection()) {
single_value->field_discriminator = other_value.discriminator();
} else {
single_value->field_discriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiOrSkip().get_selection()) {
single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
single_value->field_tiOrSkip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__L3__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__L3__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__L3__SGSN__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
break;
}
set_selection(other_value);
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template()
{
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(const PDU__L3__SGSN__MS& other_value)
{
copy_value(other_value);
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(const OPTIONAL<PDU__L3__SGSN__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__SGSN__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.PDU_L3_SGSN_MS from an unbound optional field.");
}
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(PDU__L3__SGSN__MS_template* p_precondition, PDU__L3__SGSN__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(Dynamic_Match_Interface<PDU__L3__SGSN__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__L3__SGSN__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__L3__SGSN__MS_template::PDU__L3__SGSN__MS_template(const PDU__L3__SGSN__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__L3__SGSN__MS_template::~PDU__L3__SGSN__MS_template()
{
clean_up();
}

PDU__L3__SGSN__MS_template& PDU__L3__SGSN__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__L3__SGSN__MS_template& PDU__L3__SGSN__MS_template::operator=(const PDU__L3__SGSN__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__L3__SGSN__MS_template& PDU__L3__SGSN__MS_template::operator=(const OPTIONAL<PDU__L3__SGSN__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__SGSN__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
}
return *this;
}

PDU__L3__SGSN__MS_template& PDU__L3__SGSN__MS_template::operator=(const PDU__L3__SGSN__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__L3__SGSN__MS_template::match(const PDU__L3__SGSN__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.discriminator().is_bound()) return FALSE;
if(!single_value->field_discriminator.match(other_value.discriminator(), legacy))return FALSE;
if(!other_value.tiOrSkip().is_bound()) return FALSE;
if(!single_value->field_tiOrSkip.match(other_value.tiOrSkip(), legacy))return FALSE;
if(!other_value.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
}
return FALSE;
}

boolean PDU__L3__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_discriminator.is_bound()
 || single_value->field_tiOrSkip.is_bound()
 || single_value->field_msgs.is_bound();
}

boolean PDU__L3__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_discriminator.is_value()
 && single_value->field_tiOrSkip.is_value()
 && single_value->field_msgs.is_value();
}

void PDU__L3__SGSN__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__L3__SGSN__MS PDU__L3__SGSN__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
PDU__L3__SGSN__MS ret_val;
if (single_value->field_discriminator.is_bound()) {
ret_val.discriminator() = single_value->field_discriminator.valueof();
}
if (single_value->field_tiOrSkip.is_bound()) {
ret_val.tiOrSkip() = single_value->field_tiOrSkip.valueof();
}
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
return ret_val;
}

void PDU__L3__SGSN__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__L3__SGSN__MS_template[list_length];
}

PDU__L3__SGSN__MS_template& PDU__L3__SGSN__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__L3__SGSN__MS_template::discriminator()
{
set_specific();
return single_value->field_discriminator;
}

const BITSTRING_template& PDU__L3__SGSN__MS_template::discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field discriminator of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
return single_value->field_discriminator;
}

TiOrSkip_template& PDU__L3__SGSN__MS_template::tiOrSkip()
{
set_specific();
return single_value->field_tiOrSkip;
}

const TiOrSkip_template& PDU__L3__SGSN__MS_template::tiOrSkip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiOrSkip of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
return single_value->field_tiOrSkip;
}

L3__Discr__SGSN__MS_template& PDU__L3__SGSN__MS_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const L3__Discr__SGSN__MS_template& PDU__L3__SGSN__MS_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
return single_value->field_msgs;
}

int PDU__L3__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
  }
  return 0;
}

void PDU__L3__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__L3__SGSN__MS_template::log_match(const PDU__L3__SGSN__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_discriminator.match(match_value.discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".discriminator");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiOrSkip.match(match_value.tiOrSkip(), legacy)){
TTCN_Logger::log_logmatch_info(".tiOrSkip");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__L3__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_discriminator.encode_text(text_buf);
single_value->field_tiOrSkip.encode_text(text_buf);
single_value->field_msgs.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
}
}

void PDU__L3__SGSN__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_discriminator.decode_text(text_buf);
single_value->field_tiOrSkip.decode_text(text_buf);
single_value->field_msgs.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__L3__SGSN__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.PDU_L3_SGSN_MS.");
}
}

void PDU__L3__SGSN__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__L3__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.PDU_L3_SGSN_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__L3__SGSN__MS_template* precondition = new PDU__L3__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__L3__SGSN__MS_template* implied_template = new PDU__L3__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__L3__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.PDU_L3_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__L3__SGSN__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_discriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS");
single_value->field_tiOrSkip.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS");
single_value->field_msgs.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.PDU_L3_SGSN_MS");
}

boolean PDU__L3__SGSN__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__L3__SGSN__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void L3__Discr__MS__SGSN::copy_value(const L3__Discr__MS__SGSN& other_value)
{
switch (other_value.union_selection) {
case ALT_gcc:
field_gcc = new OCTETSTRING(*other_value.field_gcc);
break;
case ALT_bcc:
field_bcc = new OCTETSTRING(*other_value.field_bcc);
break;
case ALT_cc:
field_cc = new OCTETSTRING(*other_value.field_cc);
break;
case ALT_gttp:
field_gttp = new OCTETSTRING(*other_value.field_gttp);
break;
case ALT_mm:
field_mm = new OCTETSTRING(*other_value.field_mm);
break;
case ALT_rrm:
field_rrm = new OCTETSTRING(*other_value.field_rrm);
break;
case ALT_gprs__mm:
field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN(*other_value.field_gprs__mm);
break;
case ALT_sms:
field_sms = new OCTETSTRING(*other_value.field_sms);
break;
case ALT_gprs__sm:
field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN(*other_value.field_gprs__sm);
break;
case ALT_ss:
field_ss = new OCTETSTRING(*other_value.field_ss);
break;
case ALT_loc:
field_loc = new OCTETSTRING(*other_value.field_loc);
break;
case ALT_reserved:
field_reserved = new OCTETSTRING(*other_value.field_reserved);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
union_selection = other_value.union_selection;
}

L3__Discr__MS__SGSN::L3__Discr__MS__SGSN()
{
union_selection = UNBOUND_VALUE;
}

L3__Discr__MS__SGSN::L3__Discr__MS__SGSN(const L3__Discr__MS__SGSN& other_value)
: Base_Type(){
copy_value(other_value);
}

L3__Discr__MS__SGSN::~L3__Discr__MS__SGSN()
{
clean_up();
}

L3__Discr__MS__SGSN& L3__Discr__MS__SGSN::operator=(const L3__Discr__MS__SGSN& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean L3__Discr__MS__SGSN::operator==(const L3__Discr__MS__SGSN& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gcc:
return *field_gcc == *other_value.field_gcc;
case ALT_bcc:
return *field_bcc == *other_value.field_bcc;
case ALT_cc:
return *field_cc == *other_value.field_cc;
case ALT_gttp:
return *field_gttp == *other_value.field_gttp;
case ALT_mm:
return *field_mm == *other_value.field_mm;
case ALT_rrm:
return *field_rrm == *other_value.field_rrm;
case ALT_gprs__mm:
return *field_gprs__mm == *other_value.field_gprs__mm;
case ALT_sms:
return *field_sms == *other_value.field_sms;
case ALT_gprs__sm:
return *field_gprs__sm == *other_value.field_gprs__sm;
case ALT_ss:
return *field_ss == *other_value.field_ss;
case ALT_loc:
return *field_loc == *other_value.field_loc;
case ALT_reserved:
return *field_reserved == *other_value.field_reserved;
default:
return FALSE;
}
}

OCTETSTRING& L3__Discr__MS__SGSN::gcc()
{
if (union_selection != ALT_gcc) {
clean_up();
field_gcc = new OCTETSTRING;
union_selection = ALT_gcc;
}
return *field_gcc;
}

const OCTETSTRING& L3__Discr__MS__SGSN::gcc() const
{
if (union_selection != ALT_gcc) TTCN_error("Using non-selected field gcc in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_gcc;
}

OCTETSTRING& L3__Discr__MS__SGSN::bcc()
{
if (union_selection != ALT_bcc) {
clean_up();
field_bcc = new OCTETSTRING;
union_selection = ALT_bcc;
}
return *field_bcc;
}

const OCTETSTRING& L3__Discr__MS__SGSN::bcc() const
{
if (union_selection != ALT_bcc) TTCN_error("Using non-selected field bcc in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_bcc;
}

OCTETSTRING& L3__Discr__MS__SGSN::cc()
{
if (union_selection != ALT_cc) {
clean_up();
field_cc = new OCTETSTRING;
union_selection = ALT_cc;
}
return *field_cc;
}

const OCTETSTRING& L3__Discr__MS__SGSN::cc() const
{
if (union_selection != ALT_cc) TTCN_error("Using non-selected field cc in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_cc;
}

OCTETSTRING& L3__Discr__MS__SGSN::gttp()
{
if (union_selection != ALT_gttp) {
clean_up();
field_gttp = new OCTETSTRING;
union_selection = ALT_gttp;
}
return *field_gttp;
}

const OCTETSTRING& L3__Discr__MS__SGSN::gttp() const
{
if (union_selection != ALT_gttp) TTCN_error("Using non-selected field gttp in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_gttp;
}

OCTETSTRING& L3__Discr__MS__SGSN::mm()
{
if (union_selection != ALT_mm) {
clean_up();
field_mm = new OCTETSTRING;
union_selection = ALT_mm;
}
return *field_mm;
}

const OCTETSTRING& L3__Discr__MS__SGSN::mm() const
{
if (union_selection != ALT_mm) TTCN_error("Using non-selected field mm in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_mm;
}

OCTETSTRING& L3__Discr__MS__SGSN::rrm()
{
if (union_selection != ALT_rrm) {
clean_up();
field_rrm = new OCTETSTRING;
union_selection = ALT_rrm;
}
return *field_rrm;
}

const OCTETSTRING& L3__Discr__MS__SGSN::rrm() const
{
if (union_selection != ALT_rrm) TTCN_error("Using non-selected field rrm in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_rrm;
}

MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN& L3__Discr__MS__SGSN::gprs__mm()
{
if (union_selection != ALT_gprs__mm) {
clean_up();
field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN;
union_selection = ALT_gprs__mm;
}
return *field_gprs__mm;
}

const MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN& L3__Discr__MS__SGSN::gprs__mm() const
{
if (union_selection != ALT_gprs__mm) TTCN_error("Using non-selected field gprs_mm in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_gprs__mm;
}

OCTETSTRING& L3__Discr__MS__SGSN::sms()
{
if (union_selection != ALT_sms) {
clean_up();
field_sms = new OCTETSTRING;
union_selection = ALT_sms;
}
return *field_sms;
}

const OCTETSTRING& L3__Discr__MS__SGSN::sms() const
{
if (union_selection != ALT_sms) TTCN_error("Using non-selected field sms in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_sms;
}

MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN& L3__Discr__MS__SGSN::gprs__sm()
{
if (union_selection != ALT_gprs__sm) {
clean_up();
field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN;
union_selection = ALT_gprs__sm;
}
return *field_gprs__sm;
}

const MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN& L3__Discr__MS__SGSN::gprs__sm() const
{
if (union_selection != ALT_gprs__sm) TTCN_error("Using non-selected field gprs_sm in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_gprs__sm;
}

OCTETSTRING& L3__Discr__MS__SGSN::ss()
{
if (union_selection != ALT_ss) {
clean_up();
field_ss = new OCTETSTRING;
union_selection = ALT_ss;
}
return *field_ss;
}

const OCTETSTRING& L3__Discr__MS__SGSN::ss() const
{
if (union_selection != ALT_ss) TTCN_error("Using non-selected field ss in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_ss;
}

OCTETSTRING& L3__Discr__MS__SGSN::loc()
{
if (union_selection != ALT_loc) {
clean_up();
field_loc = new OCTETSTRING;
union_selection = ALT_loc;
}
return *field_loc;
}

const OCTETSTRING& L3__Discr__MS__SGSN::loc() const
{
if (union_selection != ALT_loc) TTCN_error("Using non-selected field loc in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_loc;
}

OCTETSTRING& L3__Discr__MS__SGSN::reserved()
{
if (union_selection != ALT_reserved) {
clean_up();
field_reserved = new OCTETSTRING;
union_selection = ALT_reserved;
}
return *field_reserved;
}

const OCTETSTRING& L3__Discr__MS__SGSN::reserved() const
{
if (union_selection != ALT_reserved) TTCN_error("Using non-selected field reserved in a value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *field_reserved;
}

boolean L3__Discr__MS__SGSN::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return union_selection == checked_selection;
}

boolean L3__Discr__MS__SGSN::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean L3__Discr__MS__SGSN::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gcc: return field_gcc->is_value();
case ALT_bcc: return field_bcc->is_value();
case ALT_cc: return field_cc->is_value();
case ALT_gttp: return field_gttp->is_value();
case ALT_mm: return field_mm->is_value();
case ALT_rrm: return field_rrm->is_value();
case ALT_gprs__mm: return field_gprs__mm->is_value();
case ALT_sms: return field_sms->is_value();
case ALT_gprs__sm: return field_gprs__sm->is_value();
case ALT_ss: return field_ss->is_value();
case ALT_loc: return field_loc->is_value();
case ALT_reserved: return field_reserved->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void L3__Discr__MS__SGSN::clean_up()
{
switch (union_selection) {
case ALT_gcc:
  delete field_gcc;
  break;
case ALT_bcc:
  delete field_bcc;
  break;
case ALT_cc:
  delete field_cc;
  break;
case ALT_gttp:
  delete field_gttp;
  break;
case ALT_mm:
  delete field_mm;
  break;
case ALT_rrm:
  delete field_rrm;
  break;
case ALT_gprs__mm:
  delete field_gprs__mm;
  break;
case ALT_sms:
  delete field_sms;
  break;
case ALT_gprs__sm:
  delete field_gprs__sm;
  break;
case ALT_ss:
  delete field_ss;
  break;
case ALT_loc:
  delete field_loc;
  break;
case ALT_reserved:
  delete field_reserved;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void L3__Discr__MS__SGSN::log() const
{
switch (union_selection) {
case ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void L3__Discr__MS__SGSN::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gcc")) {
    gcc().set_param(*mp_last);
    if (!gcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "bcc")) {
    bcc().set_param(*mp_last);
    if (!bcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cc")) {
    cc().set_param(*mp_last);
    if (!cc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gttp")) {
    gttp().set_param(*mp_last);
    if (!gttp().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mm")) {
    mm().set_param(*mp_last);
    if (!mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rrm")) {
    rrm().set_param(*mp_last);
    if (!rrm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_mm")) {
    gprs__mm().set_param(*mp_last);
    if (!gprs__mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sms")) {
    sms().set_param(*mp_last);
    if (!sms().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_sm")) {
    gprs__sm().set_param(*mp_last);
    if (!gprs__sm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "ss")) {
    ss().set_param(*mp_last);
    if (!ss().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "loc")) {
    loc().set_param(*mp_last);
    if (!loc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "reserved")) {
    reserved().set_param(*mp_last);
    if (!reserved().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.L3_Discr_MS_SGSN.", last_name);
}

void L3__Discr__MS__SGSN::set_implicit_omit()
{
switch (union_selection) {
case ALT_gcc:
field_gcc->set_implicit_omit(); break;
case ALT_bcc:
field_bcc->set_implicit_omit(); break;
case ALT_cc:
field_cc->set_implicit_omit(); break;
case ALT_gttp:
field_gttp->set_implicit_omit(); break;
case ALT_mm:
field_mm->set_implicit_omit(); break;
case ALT_rrm:
field_rrm->set_implicit_omit(); break;
case ALT_gprs__mm:
field_gprs__mm->set_implicit_omit(); break;
case ALT_sms:
field_sms->set_implicit_omit(); break;
case ALT_gprs__sm:
field_gprs__sm->set_implicit_omit(); break;
case ALT_ss:
field_ss->set_implicit_omit(); break;
case ALT_loc:
field_loc->set_implicit_omit(); break;
case ALT_reserved:
field_reserved->set_implicit_omit(); break;
default: break;
}
}

void L3__Discr__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gcc:
field_gcc->encode_text(text_buf);
break;
case ALT_bcc:
field_bcc->encode_text(text_buf);
break;
case ALT_cc:
field_cc->encode_text(text_buf);
break;
case ALT_gttp:
field_gttp->encode_text(text_buf);
break;
case ALT_mm:
field_mm->encode_text(text_buf);
break;
case ALT_rrm:
field_rrm->encode_text(text_buf);
break;
case ALT_gprs__mm:
field_gprs__mm->encode_text(text_buf);
break;
case ALT_sms:
field_sms->encode_text(text_buf);
break;
case ALT_gprs__sm:
field_gprs__sm->encode_text(text_buf);
break;
case ALT_ss:
field_ss->encode_text(text_buf);
break;
case ALT_loc:
field_loc->encode_text(text_buf);
break;
case ALT_reserved:
field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}

void L3__Discr__MS__SGSN::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gcc:
gcc().decode_text(text_buf);
break;
case ALT_bcc:
bcc().decode_text(text_buf);
break;
case ALT_cc:
cc().decode_text(text_buf);
break;
case ALT_gttp:
gttp().decode_text(text_buf);
break;
case ALT_mm:
mm().decode_text(text_buf);
break;
case ALT_rrm:
rrm().decode_text(text_buf);
break;
case ALT_gprs__mm:
gprs__mm().decode_text(text_buf);
break;
case ALT_sms:
sms().decode_text(text_buf);
break;
case ALT_gprs__sm:
gprs__sm().decode_text(text_buf);
break;
case ALT_ss:
ss().decode_text(text_buf);
break;
case ALT_loc:
loc().decode_text(text_buf);
break;
case ALT_reserved:
reserved().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}

void L3__Discr__MS__SGSN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void L3__Discr__MS__SGSN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int L3__Discr__MS__SGSN::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_8_force_omit(8, force_omit, MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_9_force_omit(9, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_9_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_10_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_10_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_11_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_11_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int L3__Discr__MS__SGSN::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  memset(myleaf.body.node.nodes, 0, 12 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gcc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, OCTETSTRING_descr_.raw);
    encoded_length = field_gcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_bcc:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, OCTETSTRING_descr_.raw);
    encoded_length = field_bcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_cc:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, OCTETSTRING_descr_.raw);
    encoded_length = field_cc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gttp:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, OCTETSTRING_descr_.raw);
    encoded_length = field_gttp->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_mm:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, OCTETSTRING_descr_.raw);
    encoded_length = field_mm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_rrm:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, OCTETSTRING_descr_.raw);
    encoded_length = field_rrm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gprs__mm:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_.raw);
    encoded_length = field_gprs__mm->RAW_encode(MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_descr_;
    break;
  case ALT_sms:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, OCTETSTRING_descr_.raw);
    encoded_length = field_sms->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_gprs__sm:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_.raw);
    encoded_length = field_gprs__sm->RAW_encode(MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_descr_;
    break;
  case ALT_ss:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, OCTETSTRING_descr_.raw);
    encoded_length = field_ss->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_loc:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, OCTETSTRING_descr_.raw);
    encoded_length = field_loc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_reserved:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, OCTETSTRING_descr_.raw);
    encoded_length = field_reserved->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void L3__Discr__MS__SGSN_template::copy_value(const L3__Discr__MS__SGSN& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(other_value.gcc());
break;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(other_value.bcc());
break;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc = new OCTETSTRING_template(other_value.cc());
break;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(other_value.gttp());
break;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm = new OCTETSTRING_template(other_value.mm());
break;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template(other_value.rrm());
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template(other_value.gprs__mm());
break;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms = new OCTETSTRING_template(other_value.sms());
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template(other_value.gprs__sm());
break;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss = new OCTETSTRING_template(other_value.ss());
break;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(other_value.loc());
break;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(other_value.reserved());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
set_selection(SPECIFIC_VALUE);
}

void L3__Discr__MS__SGSN_template::copy_template(const L3__Discr__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(*other_value.single_value.field_gcc);
break;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(*other_value.single_value.field_bcc);
break;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc = new OCTETSTRING_template(*other_value.single_value.field_cc);
break;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(*other_value.single_value.field_gttp);
break;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm = new OCTETSTRING_template(*other_value.single_value.field_mm);
break;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template(*other_value.single_value.field_rrm);
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template(*other_value.single_value.field_gprs__mm);
break;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms = new OCTETSTRING_template(*other_value.single_value.field_sms);
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template(*other_value.single_value.field_gprs__sm);
break;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss = new OCTETSTRING_template(*other_value.single_value.field_ss);
break;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(*other_value.single_value.field_loc);
break;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(*other_value.single_value.field_reserved);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new L3__Discr__MS__SGSN_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L3__Discr__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new L3__Discr__MS__SGSN_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
set_selection(other_value);
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template()
{
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(const L3__Discr__MS__SGSN& other_value)
{
copy_value(other_value);
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(const OPTIONAL<L3__Discr__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__Discr__MS__SGSN&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.L3_Discr_MS_SGSN from an unbound optional field.");
}
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(L3__Discr__MS__SGSN_template* p_precondition, L3__Discr__MS__SGSN_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(Dynamic_Match_Interface<L3__Discr__MS__SGSN>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<L3__Discr__MS__SGSN>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

L3__Discr__MS__SGSN_template::L3__Discr__MS__SGSN_template(const L3__Discr__MS__SGSN_template& other_value)
: Base_Template(){
copy_template(other_value);
}

L3__Discr__MS__SGSN_template::~L3__Discr__MS__SGSN_template()
{
clean_up();
}

void L3__Discr__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
delete single_value.field_gcc;
break;
case L3__Discr__MS__SGSN::ALT_bcc:
delete single_value.field_bcc;
break;
case L3__Discr__MS__SGSN::ALT_cc:
delete single_value.field_cc;
break;
case L3__Discr__MS__SGSN::ALT_gttp:
delete single_value.field_gttp;
break;
case L3__Discr__MS__SGSN::ALT_mm:
delete single_value.field_mm;
break;
case L3__Discr__MS__SGSN::ALT_rrm:
delete single_value.field_rrm;
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
delete single_value.field_gprs__mm;
break;
case L3__Discr__MS__SGSN::ALT_sms:
delete single_value.field_sms;
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
delete single_value.field_gprs__sm;
break;
case L3__Discr__MS__SGSN::ALT_ss:
delete single_value.field_ss;
break;
case L3__Discr__MS__SGSN::ALT_loc:
delete single_value.field_loc;
break;
case L3__Discr__MS__SGSN::ALT_reserved:
delete single_value.field_reserved;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

L3__Discr__MS__SGSN_template& L3__Discr__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

L3__Discr__MS__SGSN_template& L3__Discr__MS__SGSN_template::operator=(const L3__Discr__MS__SGSN& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

L3__Discr__MS__SGSN_template& L3__Discr__MS__SGSN_template::operator=(const OPTIONAL<L3__Discr__MS__SGSN>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const L3__Discr__MS__SGSN&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
return *this;
}

L3__Discr__MS__SGSN_template& L3__Discr__MS__SGSN_template::operator=(const L3__Discr__MS__SGSN_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean L3__Discr__MS__SGSN_template::match(const L3__Discr__MS__SGSN& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
L3__Discr__MS__SGSN::union_selection_type value_selection = other_value.get_selection();
if (value_selection == L3__Discr__MS__SGSN::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
return single_value.field_gcc->match(other_value.gcc(), legacy);
case L3__Discr__MS__SGSN::ALT_bcc:
return single_value.field_bcc->match(other_value.bcc(), legacy);
case L3__Discr__MS__SGSN::ALT_cc:
return single_value.field_cc->match(other_value.cc(), legacy);
case L3__Discr__MS__SGSN::ALT_gttp:
return single_value.field_gttp->match(other_value.gttp(), legacy);
case L3__Discr__MS__SGSN::ALT_mm:
return single_value.field_mm->match(other_value.mm(), legacy);
case L3__Discr__MS__SGSN::ALT_rrm:
return single_value.field_rrm->match(other_value.rrm(), legacy);
case L3__Discr__MS__SGSN::ALT_gprs__mm:
return single_value.field_gprs__mm->match(other_value.gprs__mm(), legacy);
case L3__Discr__MS__SGSN::ALT_sms:
return single_value.field_sms->match(other_value.sms(), legacy);
case L3__Discr__MS__SGSN::ALT_gprs__sm:
return single_value.field_gprs__sm->match(other_value.gprs__sm(), legacy);
case L3__Discr__MS__SGSN::ALT_ss:
return single_value.field_ss->match(other_value.ss(), legacy);
case L3__Discr__MS__SGSN::ALT_loc:
return single_value.field_loc->match(other_value.loc(), legacy);
case L3__Discr__MS__SGSN::ALT_reserved:
return single_value.field_reserved->match(other_value.reserved(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
return FALSE;
}

boolean L3__Discr__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
return single_value.field_gcc->is_value();
case L3__Discr__MS__SGSN::ALT_bcc:
return single_value.field_bcc->is_value();
case L3__Discr__MS__SGSN::ALT_cc:
return single_value.field_cc->is_value();
case L3__Discr__MS__SGSN::ALT_gttp:
return single_value.field_gttp->is_value();
case L3__Discr__MS__SGSN::ALT_mm:
return single_value.field_mm->is_value();
case L3__Discr__MS__SGSN::ALT_rrm:
return single_value.field_rrm->is_value();
case L3__Discr__MS__SGSN::ALT_gprs__mm:
return single_value.field_gprs__mm->is_value();
case L3__Discr__MS__SGSN::ALT_sms:
return single_value.field_sms->is_value();
case L3__Discr__MS__SGSN::ALT_gprs__sm:
return single_value.field_gprs__sm->is_value();
case L3__Discr__MS__SGSN::ALT_ss:
return single_value.field_ss->is_value();
case L3__Discr__MS__SGSN::ALT_loc:
return single_value.field_loc->is_value();
case L3__Discr__MS__SGSN::ALT_reserved:
return single_value.field_reserved->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}

L3__Discr__MS__SGSN L3__Discr__MS__SGSN_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
L3__Discr__MS__SGSN ret_val;
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
ret_val.gcc() = single_value.field_gcc->valueof();
break;
case L3__Discr__MS__SGSN::ALT_bcc:
ret_val.bcc() = single_value.field_bcc->valueof();
break;
case L3__Discr__MS__SGSN::ALT_cc:
ret_val.cc() = single_value.field_cc->valueof();
break;
case L3__Discr__MS__SGSN::ALT_gttp:
ret_val.gttp() = single_value.field_gttp->valueof();
break;
case L3__Discr__MS__SGSN::ALT_mm:
ret_val.mm() = single_value.field_mm->valueof();
break;
case L3__Discr__MS__SGSN::ALT_rrm:
ret_val.rrm() = single_value.field_rrm->valueof();
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
ret_val.gprs__mm() = single_value.field_gprs__mm->valueof();
break;
case L3__Discr__MS__SGSN::ALT_sms:
ret_val.sms() = single_value.field_sms->valueof();
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
ret_val.gprs__sm() = single_value.field_gprs__sm->valueof();
break;
case L3__Discr__MS__SGSN::ALT_ss:
ret_val.ss() = single_value.field_ss->valueof();
break;
case L3__Discr__MS__SGSN::ALT_loc:
ret_val.loc() = single_value.field_loc->valueof();
break;
case L3__Discr__MS__SGSN::ALT_reserved:
ret_val.reserved() = single_value.field_reserved->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
return ret_val;
}

L3__Discr__MS__SGSN_template& L3__Discr__MS__SGSN_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return value_list.list_value[list_index];
}
void L3__Discr__MS__SGSN_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new L3__Discr__MS__SGSN_template[list_length];
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::gcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_gcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gcc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_gcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gcc;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::gcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gcc in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_gcc) TTCN_error("Accessing non-selected field gcc in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_gcc;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::bcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_bcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_bcc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_bcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bcc;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::bcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bcc in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_bcc) TTCN_error("Accessing non-selected field bcc in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_bcc;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::cc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_cc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_cc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_cc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cc;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::cc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cc in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_cc) TTCN_error("Accessing non-selected field cc in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_cc;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::gttp()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_gttp) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gttp = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gttp = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_gttp;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gttp;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::gttp() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gttp in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_gttp) TTCN_error("Accessing non-selected field gttp in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_gttp;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_mm = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mm;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mm in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_mm) TTCN_error("Accessing non-selected field mm in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_mm;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::rrm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_rrm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rrm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_rrm = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_rrm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rrm;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::rrm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rrm in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_rrm) TTCN_error("Accessing non-selected field rrm in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_rrm;
}

MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template& L3__Discr__MS__SGSN_template::gprs__mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_gprs__mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template(ANY_VALUE);
else single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_gprs__mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__mm;
}

const MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template& L3__Discr__MS__SGSN_template::gprs__mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_mm in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_gprs__mm) TTCN_error("Accessing non-selected field gprs_mm in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_gprs__mm;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::sms()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_sms) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sms = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_sms = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_sms;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sms;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::sms() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sms in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_sms) TTCN_error("Accessing non-selected field sms in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_sms;
}

MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template& L3__Discr__MS__SGSN_template::gprs__sm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_gprs__sm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template(ANY_VALUE);
else single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_gprs__sm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__sm;
}

const MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template& L3__Discr__MS__SGSN_template::gprs__sm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_sm in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_gprs__sm) TTCN_error("Accessing non-selected field gprs_sm in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_gprs__sm;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::ss()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_ss) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ss = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_ss = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_ss;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_ss;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::ss() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ss in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_ss) TTCN_error("Accessing non-selected field ss in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_ss;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::loc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_loc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_loc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_loc = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_loc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_loc;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::loc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field loc in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_loc) TTCN_error("Accessing non-selected field loc in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_loc;
}

OCTETSTRING_template& L3__Discr__MS__SGSN_template::reserved()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != L3__Discr__MS__SGSN::ALT_reserved) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_reserved = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_reserved = new OCTETSTRING_template;
single_value.union_selection = L3__Discr__MS__SGSN::ALT_reserved;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_reserved;
}

const OCTETSTRING_template& L3__Discr__MS__SGSN_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field reserved in a non-specific template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
if (single_value.union_selection != L3__Discr__MS__SGSN::ALT_reserved) TTCN_error("Accessing non-selected field reserved in a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return *single_value.field_reserved;
}

boolean L3__Discr__MS__SGSN_template::ischosen(L3__Discr__MS__SGSN::union_selection_type checked_selection) const
{
if (checked_selection == L3__Discr__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == L3__Discr__MS__SGSN::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.L3_Discr_MS_SGSN containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void L3__Discr__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case L3__Discr__MS__SGSN::ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void L3__Discr__MS__SGSN_template::log_match(const L3__Discr__MS__SGSN& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gcc");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_bcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bcc");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_cc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cc");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_gttp:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gttp");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mm");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_rrm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rrm");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_mm");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_sms:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sms");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_sm");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_ss:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".ss");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_loc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".loc");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case L3__Discr__MS__SGSN::ALT_reserved:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".reserved");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void L3__Discr__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc->set_implicit_omit(); break;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved->set_implicit_omit(); break;
default: break;
}
}

void L3__Discr__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc->encode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}

void L3__Discr__MS__SGSN_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = L3__Discr__MS__SGSN::UNBOUND_VALUE;
L3__Discr__MS__SGSN::union_selection_type new_selection = (L3__Discr__MS__SGSN::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template;
single_value.field_gcc->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template;
single_value.field_bcc->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc = new OCTETSTRING_template;
single_value.field_cc->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template;
single_value.field_gttp->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm = new OCTETSTRING_template;
single_value.field_mm->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm = new OCTETSTRING_template;
single_value.field_rrm->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm = new MobileL3__GMM__SM__Types::L3__GMM__MS__SGSN_template;
single_value.field_gprs__mm->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms = new OCTETSTRING_template;
single_value.field_sms->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm = new MobileL3__GMM__SM__Types::L3__GSM__MS__SGSN_template;
single_value.field_gprs__sm->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss = new OCTETSTRING_template;
single_value.field_ss->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc = new OCTETSTRING_template;
single_value.field_loc->decode_text(text_buf);
break;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template;
single_value.field_reserved->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new L3__Discr__MS__SGSN_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
}

boolean L3__Discr__MS__SGSN_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean L3__Discr__MS__SGSN_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void L3__Discr__MS__SGSN_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.L3_Discr_MS_SGSN'");
    }
    if (strcmp("gcc", param_field) == 0) {
      gcc().set_param(param);
      return;
    } else if (strcmp("bcc", param_field) == 0) {
      bcc().set_param(param);
      return;
    } else if (strcmp("cc", param_field) == 0) {
      cc().set_param(param);
      return;
    } else if (strcmp("gttp", param_field) == 0) {
      gttp().set_param(param);
      return;
    } else if (strcmp("mm", param_field) == 0) {
      mm().set_param(param);
      return;
    } else if (strcmp("rrm", param_field) == 0) {
      rrm().set_param(param);
      return;
    } else if (strcmp("gprs_mm", param_field) == 0) {
      gprs__mm().set_param(param);
      return;
    } else if (strcmp("sms", param_field) == 0) {
      sms().set_param(param);
      return;
    } else if (strcmp("gprs_sm", param_field) == 0) {
      gprs__sm().set_param(param);
      return;
    } else if (strcmp("ss", param_field) == 0) {
      ss().set_param(param);
      return;
    } else if (strcmp("loc", param_field) == 0) {
      loc().set_param(param);
      return;
    } else if (strcmp("reserved", param_field) == 0) {
      reserved().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.L3_Discr_MS_SGSN'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L3__Discr__MS__SGSN_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.L3_Discr_MS_SGSN");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "gcc")) {
      gcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "bcc")) {
      bcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cc")) {
      cc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gttp")) {
      gttp().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mm")) {
      mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rrm")) {
      rrm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_mm")) {
      gprs__mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sms")) {
      sms().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_sm")) {
      gprs__sm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "ss")) {
      ss().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "loc")) {
      loc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "reserved")) {
      reserved().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.L3_Discr_MS_SGSN.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    L3__Discr__MS__SGSN_template* precondition = new L3__Discr__MS__SGSN_template;
    precondition->set_param(*m_p->get_elem(0));
    L3__Discr__MS__SGSN_template* implied_template = new L3__Discr__MS__SGSN_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = L3__Discr__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.L3_Discr_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void L3__Discr__MS__SGSN_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case L3__Discr__MS__SGSN::ALT_gcc:
single_value.field_gcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_bcc:
single_value.field_bcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_cc:
single_value.field_cc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_gttp:
single_value.field_gttp->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_mm:
single_value.field_mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_rrm:
single_value.field_rrm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_gprs__mm:
single_value.field_gprs__mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_sms:
single_value.field_sms->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_gprs__sm:
single_value.field_gprs__sm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_ss:
single_value.field_ss->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_loc:
single_value.field_loc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
case L3__Discr__MS__SGSN::ALT_reserved:
single_value.field_reserved->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.L3_Discr_MS_SGSN.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.L3_Discr_MS_SGSN");
}

PDU__L3__MS__SGSN::PDU__L3__MS__SGSN()
{
}

PDU__L3__MS__SGSN::PDU__L3__MS__SGSN(const BITSTRING& par_discriminator,
    const TiOrSkip& par_tiOrSkip,
    const L3__Discr__MS__SGSN& par_msgs)
  :   field_discriminator(par_discriminator),
  field_tiOrSkip(par_tiOrSkip),
  field_msgs(par_msgs)
{
}

PDU__L3__MS__SGSN::PDU__L3__MS__SGSN(const PDU__L3__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.PDU_L3_MS_SGSN.");
if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
else field_discriminator.clean_up();
if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
else field_tiOrSkip.clean_up();
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
}

void PDU__L3__MS__SGSN::clean_up()
{
field_discriminator.clean_up();
field_tiOrSkip.clean_up();
field_msgs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__L3__MS__SGSN::get_descriptor() const { return &PDU__L3__MS__SGSN_descr_; }
PDU__L3__MS__SGSN& PDU__L3__MS__SGSN::operator=(const PDU__L3__MS__SGSN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.PDU_L3_MS_SGSN.");
  if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
  else field_discriminator.clean_up();
  if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
  else field_tiOrSkip.clean_up();
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
}
return *this;
}

boolean PDU__L3__MS__SGSN::operator==(const PDU__L3__MS__SGSN& other_value) const
{
return field_discriminator==other_value.field_discriminator
  && field_tiOrSkip==other_value.field_tiOrSkip
  && field_msgs==other_value.field_msgs;
}

boolean PDU__L3__MS__SGSN::is_bound() const
{
return (field_discriminator.is_bound())
  || (field_tiOrSkip.is_bound())
  || (field_msgs.is_bound());
}
boolean PDU__L3__MS__SGSN::is_value() const
{
return field_discriminator.is_value()
  && field_tiOrSkip.is_value()
  && field_msgs.is_value();
}
void PDU__L3__MS__SGSN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ discriminator := ");
field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__L3__MS__SGSN::set_implicit_omit()
{
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__MS__SGSN::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.PDU_L3_MS_SGSN has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.PDU_L3_MS_SGSN");
  }
}

void PDU__L3__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_discriminator.encode_text(text_buf);
field_tiOrSkip.encode_text(text_buf);
field_msgs.encode_text(text_buf);
}

void PDU__L3__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_discriminator.decode_text(text_buf);
field_tiOrSkip.decode_text(text_buf);
field_msgs.decode_text(text_buf);
}

void PDU__L3__MS__SGSN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__L3__MS__SGSN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__L3__MS__SGSN::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_12 || field_discriminator ==  bs_4 || field_discriminator ==  bs_5 || field_discriminator ==  bs_6 || field_discriminator ==  bs_13 || field_discriminator ==  bs_7 || field_discriminator ==  bs_11 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 0;
  else if (field_discriminator ==  bs_1 || field_discriminator ==  bs_2 || field_discriminator ==  bs_3 || field_discriminator ==  bs_8 || field_discriminator ==  bs_10 || field_discriminator ==  bs_9) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__L3__MS__SGSN_tiOrSkip_descr_.raw->forceomit);
  decoded_field_length = field_tiOrSkip.RAW_decode(PDU__L3__MS__SGSN_tiOrSkip_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_1) selected_field = 0;
  else if (field_discriminator ==  bs_2) selected_field = 1;
  else if (field_discriminator ==  bs_3) selected_field = 2;
  else if (field_discriminator ==  bs_4) selected_field = 3;
  else if (field_discriminator ==  bs_5) selected_field = 4;
  else if (field_discriminator ==  bs_6) selected_field = 5;
  else if (field_discriminator ==  bs_7) selected_field = 6;
  else if (field_discriminator ==  bs_8) selected_field = 7;
  else if (field_discriminator ==  bs_9) selected_field = 8;
  else if (field_discriminator ==  bs_10) selected_field = 9;
  else if (field_discriminator ==  bs_11) selected_field = 10;
  else if (field_discriminator ==  bs_12 || field_discriminator ==  bs_13 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 11;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__L3__MS__SGSN_msgs_descr_.raw->forceomit);
  decoded_field_length = field_msgs.RAW_decode(PDU__L3__MS__SGSN_msgs_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__L3__MS__SGSN::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__L3__MS__SGSN_tiOrSkip_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__L3__MS__SGSN_msgs_descr_.raw);
  encoded_length += field_discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiOrSkip.RAW_encode(PDU__L3__MS__SGSN_tiOrSkip_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msgs.RAW_encode(PDU__L3__MS__SGSN_msgs_descr_, *myleaf.body.node.nodes[2]);
  switch (field_tiOrSkip.get_selection()) {
  case TiOrSkip::ALT_skipIndicator:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_4 && field_discriminator !=  bs_5 && field_discriminator !=  bs_6 && field_discriminator !=  bs_13 && field_discriminator !=  bs_7 && field_discriminator !=  bs_11 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case TiOrSkip::ALT_transactionId:
  if (field_discriminator !=  bs_1 && field_discriminator !=  bs_2 && field_discriminator !=  bs_3 && field_discriminator !=  bs_8 && field_discriminator !=  bs_10 && field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  switch (field_msgs.get_selection()) {
  case L3__Discr__MS__SGSN::ALT_gcc:
  if (field_discriminator !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_bcc:
  if (field_discriminator !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_cc:
  if (field_discriminator !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_gttp:
  if (field_discriminator !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_mm:
  if (field_discriminator !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_rrm:
  if (field_discriminator !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_gprs__mm:
  if (field_discriminator !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_sms:
  if (field_discriminator !=  bs_8) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_8.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_gprs__sm:
  if (field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_9.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_ss:
  if (field_discriminator !=  bs_10) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_10.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_loc:
  if (field_discriminator !=  bs_11) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case L3__Discr__MS__SGSN::ALT_reserved:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_13 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct PDU__L3__MS__SGSN_template::single_value_struct {
BITSTRING_template field_discriminator;
TiOrSkip_template field_tiOrSkip;
L3__Discr__MS__SGSN_template field_msgs;
};

void PDU__L3__MS__SGSN_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_discriminator = ANY_VALUE;
single_value->field_tiOrSkip = ANY_VALUE;
single_value->field_msgs = ANY_VALUE;
}
}
}

void PDU__L3__MS__SGSN_template::copy_value(const PDU__L3__MS__SGSN& other_value)
{
single_value = new single_value_struct;
if (other_value.discriminator().is_bound()) {
  single_value->field_discriminator = other_value.discriminator();
} else {
  single_value->field_discriminator.clean_up();
}
if (other_value.tiOrSkip().is_bound()) {
  single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
  single_value->field_tiOrSkip.clean_up();
}
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__L3__MS__SGSN_template::copy_template(const PDU__L3__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.discriminator().get_selection()) {
single_value->field_discriminator = other_value.discriminator();
} else {
single_value->field_discriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiOrSkip().get_selection()) {
single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
single_value->field_tiOrSkip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__L3__MS__SGSN_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__L3__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__L3__MS__SGSN_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
break;
}
set_selection(other_value);
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template()
{
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(const PDU__L3__MS__SGSN& other_value)
{
copy_value(other_value);
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(const OPTIONAL<PDU__L3__MS__SGSN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__MS__SGSN&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.PDU_L3_MS_SGSN from an unbound optional field.");
}
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(PDU__L3__MS__SGSN_template* p_precondition, PDU__L3__MS__SGSN_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(Dynamic_Match_Interface<PDU__L3__MS__SGSN>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__L3__MS__SGSN>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__L3__MS__SGSN_template::PDU__L3__MS__SGSN_template(const PDU__L3__MS__SGSN_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__L3__MS__SGSN_template::~PDU__L3__MS__SGSN_template()
{
clean_up();
}

PDU__L3__MS__SGSN_template& PDU__L3__MS__SGSN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__L3__MS__SGSN_template& PDU__L3__MS__SGSN_template::operator=(const PDU__L3__MS__SGSN& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__L3__MS__SGSN_template& PDU__L3__MS__SGSN_template::operator=(const OPTIONAL<PDU__L3__MS__SGSN>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__L3__MS__SGSN&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
}
return *this;
}

PDU__L3__MS__SGSN_template& PDU__L3__MS__SGSN_template::operator=(const PDU__L3__MS__SGSN_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__L3__MS__SGSN_template::match(const PDU__L3__MS__SGSN& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.discriminator().is_bound()) return FALSE;
if(!single_value->field_discriminator.match(other_value.discriminator(), legacy))return FALSE;
if(!other_value.tiOrSkip().is_bound()) return FALSE;
if(!single_value->field_tiOrSkip.match(other_value.tiOrSkip(), legacy))return FALSE;
if(!other_value.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
}
return FALSE;
}

boolean PDU__L3__MS__SGSN_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_discriminator.is_bound()
 || single_value->field_tiOrSkip.is_bound()
 || single_value->field_msgs.is_bound();
}

boolean PDU__L3__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_discriminator.is_value()
 && single_value->field_tiOrSkip.is_value()
 && single_value->field_msgs.is_value();
}

void PDU__L3__MS__SGSN_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__L3__MS__SGSN PDU__L3__MS__SGSN_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
PDU__L3__MS__SGSN ret_val;
if (single_value->field_discriminator.is_bound()) {
ret_val.discriminator() = single_value->field_discriminator.valueof();
}
if (single_value->field_tiOrSkip.is_bound()) {
ret_val.tiOrSkip() = single_value->field_tiOrSkip.valueof();
}
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
return ret_val;
}

void PDU__L3__MS__SGSN_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__L3__MS__SGSN_template[list_length];
}

PDU__L3__MS__SGSN_template& PDU__L3__MS__SGSN_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__L3__MS__SGSN_template::discriminator()
{
set_specific();
return single_value->field_discriminator;
}

const BITSTRING_template& PDU__L3__MS__SGSN_template::discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field discriminator of a non-specific template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
return single_value->field_discriminator;
}

TiOrSkip_template& PDU__L3__MS__SGSN_template::tiOrSkip()
{
set_specific();
return single_value->field_tiOrSkip;
}

const TiOrSkip_template& PDU__L3__MS__SGSN_template::tiOrSkip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiOrSkip of a non-specific template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
return single_value->field_tiOrSkip;
}

L3__Discr__MS__SGSN_template& PDU__L3__MS__SGSN_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const L3__Discr__MS__SGSN_template& PDU__L3__MS__SGSN_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
return single_value->field_msgs;
}

int PDU__L3__MS__SGSN_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_L3_MS_SGSN containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
  }
  return 0;
}

void PDU__L3__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__L3__MS__SGSN_template::log_match(const PDU__L3__MS__SGSN& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_discriminator.match(match_value.discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".discriminator");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiOrSkip.match(match_value.tiOrSkip(), legacy)){
TTCN_Logger::log_logmatch_info(".tiOrSkip");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__L3__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__L3__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_discriminator.encode_text(text_buf);
single_value->field_tiOrSkip.encode_text(text_buf);
single_value->field_msgs.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
}
}

void PDU__L3__MS__SGSN_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_discriminator.decode_text(text_buf);
single_value->field_tiOrSkip.decode_text(text_buf);
single_value->field_msgs.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__L3__MS__SGSN_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.PDU_L3_MS_SGSN.");
}
}

void PDU__L3__MS__SGSN_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__L3__MS__SGSN_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.PDU_L3_MS_SGSN has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_L3_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__L3__MS__SGSN_template* precondition = new PDU__L3__MS__SGSN_template;
    precondition->set_param(*param.get_elem(0));
    PDU__L3__MS__SGSN_template* implied_template = new PDU__L3__MS__SGSN_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__L3__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.PDU_L3_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__L3__MS__SGSN_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_discriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_MS_SGSN");
single_value->field_tiOrSkip.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_MS_SGSN");
single_value->field_msgs.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_L3_MS_SGSN");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.PDU_L3_MS_SGSN");
}

boolean PDU__L3__MS__SGSN_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__L3__MS__SGSN_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__NW__MS::copy_value(const ML3__Discr__NW__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_gcc:
field_gcc = new OCTETSTRING(*other_value.field_gcc);
break;
case ALT_bcc:
field_bcc = new OCTETSTRING(*other_value.field_bcc);
break;
case ALT_cc:
field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS(*other_value.field_cc);
break;
case ALT_gttp:
field_gttp = new OCTETSTRING(*other_value.field_gttp);
break;
case ALT_mm:
field_mm = new MobileL3__MM__Types::PDU__ML3__MM(*other_value.field_mm);
break;
case ALT_rrm:
field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS(*other_value.field_rrm);
break;
case ALT_gprs__mm:
field_gprs__mm = new OCTETSTRING(*other_value.field_gprs__mm);
break;
case ALT_sms:
field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS(*other_value.field_sms);
break;
case ALT_gprs__sm:
field_gprs__sm = new OCTETSTRING(*other_value.field_gprs__sm);
break;
case ALT_ss:
field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS(*other_value.field_ss);
break;
case ALT_loc:
field_loc = new OCTETSTRING(*other_value.field_loc);
break;
case ALT_reserved:
field_reserved = new OCTETSTRING(*other_value.field_reserved);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
union_selection = other_value.union_selection;
}

ML3__Discr__NW__MS::ML3__Discr__NW__MS()
{
union_selection = UNBOUND_VALUE;
}

ML3__Discr__NW__MS::ML3__Discr__NW__MS(const ML3__Discr__NW__MS& other_value)
: Base_Type(){
copy_value(other_value);
}

ML3__Discr__NW__MS::~ML3__Discr__NW__MS()
{
clean_up();
}

ML3__Discr__NW__MS& ML3__Discr__NW__MS::operator=(const ML3__Discr__NW__MS& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean ML3__Discr__NW__MS::operator==(const ML3__Discr__NW__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gcc:
return *field_gcc == *other_value.field_gcc;
case ALT_bcc:
return *field_bcc == *other_value.field_bcc;
case ALT_cc:
return *field_cc == *other_value.field_cc;
case ALT_gttp:
return *field_gttp == *other_value.field_gttp;
case ALT_mm:
return *field_mm == *other_value.field_mm;
case ALT_rrm:
return *field_rrm == *other_value.field_rrm;
case ALT_gprs__mm:
return *field_gprs__mm == *other_value.field_gprs__mm;
case ALT_sms:
return *field_sms == *other_value.field_sms;
case ALT_gprs__sm:
return *field_gprs__sm == *other_value.field_gprs__sm;
case ALT_ss:
return *field_ss == *other_value.field_ss;
case ALT_loc:
return *field_loc == *other_value.field_loc;
case ALT_reserved:
return *field_reserved == *other_value.field_reserved;
default:
return FALSE;
}
}

OCTETSTRING& ML3__Discr__NW__MS::gcc()
{
if (union_selection != ALT_gcc) {
clean_up();
field_gcc = new OCTETSTRING;
union_selection = ALT_gcc;
}
return *field_gcc;
}

const OCTETSTRING& ML3__Discr__NW__MS::gcc() const
{
if (union_selection != ALT_gcc) TTCN_error("Using non-selected field gcc in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_gcc;
}

OCTETSTRING& ML3__Discr__NW__MS::bcc()
{
if (union_selection != ALT_bcc) {
clean_up();
field_bcc = new OCTETSTRING;
union_selection = ALT_bcc;
}
return *field_bcc;
}

const OCTETSTRING& ML3__Discr__NW__MS::bcc() const
{
if (union_selection != ALT_bcc) TTCN_error("Using non-selected field bcc in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_bcc;
}

MobileL3__CC__Types::PDU__ML3__CC__NW__MS& ML3__Discr__NW__MS::cc()
{
if (union_selection != ALT_cc) {
clean_up();
field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS;
union_selection = ALT_cc;
}
return *field_cc;
}

const MobileL3__CC__Types::PDU__ML3__CC__NW__MS& ML3__Discr__NW__MS::cc() const
{
if (union_selection != ALT_cc) TTCN_error("Using non-selected field cc in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_cc;
}

OCTETSTRING& ML3__Discr__NW__MS::gttp()
{
if (union_selection != ALT_gttp) {
clean_up();
field_gttp = new OCTETSTRING;
union_selection = ALT_gttp;
}
return *field_gttp;
}

const OCTETSTRING& ML3__Discr__NW__MS::gttp() const
{
if (union_selection != ALT_gttp) TTCN_error("Using non-selected field gttp in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_gttp;
}

MobileL3__MM__Types::PDU__ML3__MM& ML3__Discr__NW__MS::mm()
{
if (union_selection != ALT_mm) {
clean_up();
field_mm = new MobileL3__MM__Types::PDU__ML3__MM;
union_selection = ALT_mm;
}
return *field_mm;
}

const MobileL3__MM__Types::PDU__ML3__MM& ML3__Discr__NW__MS::mm() const
{
if (union_selection != ALT_mm) TTCN_error("Using non-selected field mm in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_mm;
}

MobileL3__RRM__Types::PDU__RRM__NW__MS& ML3__Discr__NW__MS::rrm()
{
if (union_selection != ALT_rrm) {
clean_up();
field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS;
union_selection = ALT_rrm;
}
return *field_rrm;
}

const MobileL3__RRM__Types::PDU__RRM__NW__MS& ML3__Discr__NW__MS::rrm() const
{
if (union_selection != ALT_rrm) TTCN_error("Using non-selected field rrm in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_rrm;
}

OCTETSTRING& ML3__Discr__NW__MS::gprs__mm()
{
if (union_selection != ALT_gprs__mm) {
clean_up();
field_gprs__mm = new OCTETSTRING;
union_selection = ALT_gprs__mm;
}
return *field_gprs__mm;
}

const OCTETSTRING& ML3__Discr__NW__MS::gprs__mm() const
{
if (union_selection != ALT_gprs__mm) TTCN_error("Using non-selected field gprs_mm in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_gprs__mm;
}

MobileL3__SMS__Types::L3__SMS__SGSN__MS& ML3__Discr__NW__MS::sms()
{
if (union_selection != ALT_sms) {
clean_up();
field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS;
union_selection = ALT_sms;
}
return *field_sms;
}

const MobileL3__SMS__Types::L3__SMS__SGSN__MS& ML3__Discr__NW__MS::sms() const
{
if (union_selection != ALT_sms) TTCN_error("Using non-selected field sms in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_sms;
}

OCTETSTRING& ML3__Discr__NW__MS::gprs__sm()
{
if (union_selection != ALT_gprs__sm) {
clean_up();
field_gprs__sm = new OCTETSTRING;
union_selection = ALT_gprs__sm;
}
return *field_gprs__sm;
}

const OCTETSTRING& ML3__Discr__NW__MS::gprs__sm() const
{
if (union_selection != ALT_gprs__sm) TTCN_error("Using non-selected field gprs_sm in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_gprs__sm;
}

MobileL3__SS__Types::PDU__ML3__SS__NW__MS& ML3__Discr__NW__MS::ss()
{
if (union_selection != ALT_ss) {
clean_up();
field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS;
union_selection = ALT_ss;
}
return *field_ss;
}

const MobileL3__SS__Types::PDU__ML3__SS__NW__MS& ML3__Discr__NW__MS::ss() const
{
if (union_selection != ALT_ss) TTCN_error("Using non-selected field ss in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_ss;
}

OCTETSTRING& ML3__Discr__NW__MS::loc()
{
if (union_selection != ALT_loc) {
clean_up();
field_loc = new OCTETSTRING;
union_selection = ALT_loc;
}
return *field_loc;
}

const OCTETSTRING& ML3__Discr__NW__MS::loc() const
{
if (union_selection != ALT_loc) TTCN_error("Using non-selected field loc in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_loc;
}

OCTETSTRING& ML3__Discr__NW__MS::reserved()
{
if (union_selection != ALT_reserved) {
clean_up();
field_reserved = new OCTETSTRING;
union_selection = ALT_reserved;
}
return *field_reserved;
}

const OCTETSTRING& ML3__Discr__NW__MS::reserved() const
{
if (union_selection != ALT_reserved) TTCN_error("Using non-selected field reserved in a value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *field_reserved;
}

boolean ML3__Discr__NW__MS::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return union_selection == checked_selection;
}

boolean ML3__Discr__NW__MS::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean ML3__Discr__NW__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gcc: return field_gcc->is_value();
case ALT_bcc: return field_bcc->is_value();
case ALT_cc: return field_cc->is_value();
case ALT_gttp: return field_gttp->is_value();
case ALT_mm: return field_mm->is_value();
case ALT_rrm: return field_rrm->is_value();
case ALT_gprs__mm: return field_gprs__mm->is_value();
case ALT_sms: return field_sms->is_value();
case ALT_gprs__sm: return field_gprs__sm->is_value();
case ALT_ss: return field_ss->is_value();
case ALT_loc: return field_loc->is_value();
case ALT_reserved: return field_reserved->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ML3__Discr__NW__MS::clean_up()
{
switch (union_selection) {
case ALT_gcc:
  delete field_gcc;
  break;
case ALT_bcc:
  delete field_bcc;
  break;
case ALT_cc:
  delete field_cc;
  break;
case ALT_gttp:
  delete field_gttp;
  break;
case ALT_mm:
  delete field_mm;
  break;
case ALT_rrm:
  delete field_rrm;
  break;
case ALT_gprs__mm:
  delete field_gprs__mm;
  break;
case ALT_sms:
  delete field_sms;
  break;
case ALT_gprs__sm:
  delete field_gprs__sm;
  break;
case ALT_ss:
  delete field_ss;
  break;
case ALT_loc:
  delete field_loc;
  break;
case ALT_reserved:
  delete field_reserved;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ML3__Discr__NW__MS::log() const
{
switch (union_selection) {
case ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ML3__Discr__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gcc")) {
    gcc().set_param(*mp_last);
    if (!gcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "bcc")) {
    bcc().set_param(*mp_last);
    if (!bcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cc")) {
    cc().set_param(*mp_last);
    if (!cc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gttp")) {
    gttp().set_param(*mp_last);
    if (!gttp().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mm")) {
    mm().set_param(*mp_last);
    if (!mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rrm")) {
    rrm().set_param(*mp_last);
    if (!rrm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_mm")) {
    gprs__mm().set_param(*mp_last);
    if (!gprs__mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sms")) {
    sms().set_param(*mp_last);
    if (!sms().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_sm")) {
    gprs__sm().set_param(*mp_last);
    if (!gprs__sm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "ss")) {
    ss().set_param(*mp_last);
    if (!ss().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "loc")) {
    loc().set_param(*mp_last);
    if (!loc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "reserved")) {
    reserved().set_param(*mp_last);
    if (!reserved().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.ML3_Discr_NW_MS.", last_name);
}

void ML3__Discr__NW__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_gcc:
field_gcc->set_implicit_omit(); break;
case ALT_bcc:
field_bcc->set_implicit_omit(); break;
case ALT_cc:
field_cc->set_implicit_omit(); break;
case ALT_gttp:
field_gttp->set_implicit_omit(); break;
case ALT_mm:
field_mm->set_implicit_omit(); break;
case ALT_rrm:
field_rrm->set_implicit_omit(); break;
case ALT_gprs__mm:
field_gprs__mm->set_implicit_omit(); break;
case ALT_sms:
field_sms->set_implicit_omit(); break;
case ALT_gprs__sm:
field_gprs__sm->set_implicit_omit(); break;
case ALT_ss:
field_ss->set_implicit_omit(); break;
case ALT_loc:
field_loc->set_implicit_omit(); break;
case ALT_reserved:
field_reserved->set_implicit_omit(); break;
default: break;
}
}

void ML3__Discr__NW__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gcc:
field_gcc->encode_text(text_buf);
break;
case ALT_bcc:
field_bcc->encode_text(text_buf);
break;
case ALT_cc:
field_cc->encode_text(text_buf);
break;
case ALT_gttp:
field_gttp->encode_text(text_buf);
break;
case ALT_mm:
field_mm->encode_text(text_buf);
break;
case ALT_rrm:
field_rrm->encode_text(text_buf);
break;
case ALT_gprs__mm:
field_gprs__mm->encode_text(text_buf);
break;
case ALT_sms:
field_sms->encode_text(text_buf);
break;
case ALT_gprs__sm:
field_gprs__sm->encode_text(text_buf);
break;
case ALT_ss:
field_ss->encode_text(text_buf);
break;
case ALT_loc:
field_loc->encode_text(text_buf);
break;
case ALT_reserved:
field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}

void ML3__Discr__NW__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gcc:
gcc().decode_text(text_buf);
break;
case ALT_bcc:
bcc().decode_text(text_buf);
break;
case ALT_cc:
cc().decode_text(text_buf);
break;
case ALT_gttp:
gttp().decode_text(text_buf);
break;
case ALT_mm:
mm().decode_text(text_buf);
break;
case ALT_rrm:
rrm().decode_text(text_buf);
break;
case ALT_gprs__mm:
gprs__mm().decode_text(text_buf);
break;
case ALT_sms:
sms().decode_text(text_buf);
break;
case ALT_gprs__sm:
gprs__sm().decode_text(text_buf);
break;
case ALT_ss:
ss().decode_text(text_buf);
break;
case ALT_loc:
loc().decode_text(text_buf);
break;
case ALT_reserved:
reserved().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}

void ML3__Discr__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ML3__Discr__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ML3__Discr__NW__MS::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(MobileL3__MM__Types::PDU__ML3__MM_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(MobileL3__MM__Types::PDU__ML3__MM_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_8_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_9_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_10_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_10_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_11_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_11_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int ML3__Discr__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  memset(myleaf.body.node.nodes, 0, 12 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gcc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, OCTETSTRING_descr_.raw);
    encoded_length = field_gcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_bcc:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, OCTETSTRING_descr_.raw);
    encoded_length = field_bcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_cc:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_.raw);
    encoded_length = field_cc->RAW_encode(MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &MobileL3__CC__Types::PDU__ML3__CC__NW__MS_descr_;
    break;
  case ALT_gttp:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, OCTETSTRING_descr_.raw);
    encoded_length = field_gttp->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_mm:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw);
    encoded_length = field_mm->RAW_encode(MobileL3__MM__Types::PDU__ML3__MM_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &MobileL3__MM__Types::PDU__ML3__MM_descr_;
    break;
  case ALT_rrm:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_.raw);
    encoded_length = field_rrm->RAW_encode(MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &MobileL3__RRM__Types::PDU__RRM__NW__MS_descr_;
    break;
  case ALT_gprs__mm:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, OCTETSTRING_descr_.raw);
    encoded_length = field_gprs__mm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_sms:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_.raw);
    encoded_length = field_sms->RAW_encode(MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &MobileL3__SMS__Types::L3__SMS__SGSN__MS_descr_;
    break;
  case ALT_gprs__sm:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, OCTETSTRING_descr_.raw);
    encoded_length = field_gprs__sm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_ss:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_.raw);
    encoded_length = field_ss->RAW_encode(MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &MobileL3__SS__Types::PDU__ML3__SS__NW__MS_descr_;
    break;
  case ALT_loc:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, OCTETSTRING_descr_.raw);
    encoded_length = field_loc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_reserved:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, OCTETSTRING_descr_.raw);
    encoded_length = field_reserved->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ML3__Discr__NW__MS_template::copy_value(const ML3__Discr__NW__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(other_value.gcc());
break;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(other_value.bcc());
break;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template(other_value.cc());
break;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(other_value.gttp());
break;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(other_value.mm());
break;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS_template(other_value.rrm());
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template(other_value.gprs__mm());
break;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS_template(other_value.sms());
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template(other_value.gprs__sm());
break;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template(other_value.ss());
break;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(other_value.loc());
break;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(other_value.reserved());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void ML3__Discr__NW__MS_template::copy_template(const ML3__Discr__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(*other_value.single_value.field_gcc);
break;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(*other_value.single_value.field_bcc);
break;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template(*other_value.single_value.field_cc);
break;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(*other_value.single_value.field_gttp);
break;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(*other_value.single_value.field_mm);
break;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS_template(*other_value.single_value.field_rrm);
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template(*other_value.single_value.field_gprs__mm);
break;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS_template(*other_value.single_value.field_sms);
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template(*other_value.single_value.field_gprs__sm);
break;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template(*other_value.single_value.field_ss);
break;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(*other_value.single_value.field_loc);
break;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(*other_value.single_value.field_reserved);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ML3__Discr__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ML3__Discr__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new ML3__Discr__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
set_selection(other_value);
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template()
{
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(const ML3__Discr__NW__MS& other_value)
{
copy_value(other_value);
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(const OPTIONAL<ML3__Discr__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ML3__Discr__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.ML3_Discr_NW_MS from an unbound optional field.");
}
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(ML3__Discr__NW__MS_template* p_precondition, ML3__Discr__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(Dynamic_Match_Interface<ML3__Discr__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ML3__Discr__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ML3__Discr__NW__MS_template::ML3__Discr__NW__MS_template(const ML3__Discr__NW__MS_template& other_value)
: Base_Template(){
copy_template(other_value);
}

ML3__Discr__NW__MS_template::~ML3__Discr__NW__MS_template()
{
clean_up();
}

void ML3__Discr__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
delete single_value.field_gcc;
break;
case ML3__Discr__NW__MS::ALT_bcc:
delete single_value.field_bcc;
break;
case ML3__Discr__NW__MS::ALT_cc:
delete single_value.field_cc;
break;
case ML3__Discr__NW__MS::ALT_gttp:
delete single_value.field_gttp;
break;
case ML3__Discr__NW__MS::ALT_mm:
delete single_value.field_mm;
break;
case ML3__Discr__NW__MS::ALT_rrm:
delete single_value.field_rrm;
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
delete single_value.field_gprs__mm;
break;
case ML3__Discr__NW__MS::ALT_sms:
delete single_value.field_sms;
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
delete single_value.field_gprs__sm;
break;
case ML3__Discr__NW__MS::ALT_ss:
delete single_value.field_ss;
break;
case ML3__Discr__NW__MS::ALT_loc:
delete single_value.field_loc;
break;
case ML3__Discr__NW__MS::ALT_reserved:
delete single_value.field_reserved;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ML3__Discr__NW__MS_template& ML3__Discr__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ML3__Discr__NW__MS_template& ML3__Discr__NW__MS_template::operator=(const ML3__Discr__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ML3__Discr__NW__MS_template& ML3__Discr__NW__MS_template::operator=(const OPTIONAL<ML3__Discr__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ML3__Discr__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
return *this;
}

ML3__Discr__NW__MS_template& ML3__Discr__NW__MS_template::operator=(const ML3__Discr__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ML3__Discr__NW__MS_template::match(const ML3__Discr__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
ML3__Discr__NW__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ML3__Discr__NW__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
return single_value.field_gcc->match(other_value.gcc(), legacy);
case ML3__Discr__NW__MS::ALT_bcc:
return single_value.field_bcc->match(other_value.bcc(), legacy);
case ML3__Discr__NW__MS::ALT_cc:
return single_value.field_cc->match(other_value.cc(), legacy);
case ML3__Discr__NW__MS::ALT_gttp:
return single_value.field_gttp->match(other_value.gttp(), legacy);
case ML3__Discr__NW__MS::ALT_mm:
return single_value.field_mm->match(other_value.mm(), legacy);
case ML3__Discr__NW__MS::ALT_rrm:
return single_value.field_rrm->match(other_value.rrm(), legacy);
case ML3__Discr__NW__MS::ALT_gprs__mm:
return single_value.field_gprs__mm->match(other_value.gprs__mm(), legacy);
case ML3__Discr__NW__MS::ALT_sms:
return single_value.field_sms->match(other_value.sms(), legacy);
case ML3__Discr__NW__MS::ALT_gprs__sm:
return single_value.field_gprs__sm->match(other_value.gprs__sm(), legacy);
case ML3__Discr__NW__MS::ALT_ss:
return single_value.field_ss->match(other_value.ss(), legacy);
case ML3__Discr__NW__MS::ALT_loc:
return single_value.field_loc->match(other_value.loc(), legacy);
case ML3__Discr__NW__MS::ALT_reserved:
return single_value.field_reserved->match(other_value.reserved(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
return FALSE;
}

boolean ML3__Discr__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
return single_value.field_gcc->is_value();
case ML3__Discr__NW__MS::ALT_bcc:
return single_value.field_bcc->is_value();
case ML3__Discr__NW__MS::ALT_cc:
return single_value.field_cc->is_value();
case ML3__Discr__NW__MS::ALT_gttp:
return single_value.field_gttp->is_value();
case ML3__Discr__NW__MS::ALT_mm:
return single_value.field_mm->is_value();
case ML3__Discr__NW__MS::ALT_rrm:
return single_value.field_rrm->is_value();
case ML3__Discr__NW__MS::ALT_gprs__mm:
return single_value.field_gprs__mm->is_value();
case ML3__Discr__NW__MS::ALT_sms:
return single_value.field_sms->is_value();
case ML3__Discr__NW__MS::ALT_gprs__sm:
return single_value.field_gprs__sm->is_value();
case ML3__Discr__NW__MS::ALT_ss:
return single_value.field_ss->is_value();
case ML3__Discr__NW__MS::ALT_loc:
return single_value.field_loc->is_value();
case ML3__Discr__NW__MS::ALT_reserved:
return single_value.field_reserved->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}

ML3__Discr__NW__MS ML3__Discr__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
ML3__Discr__NW__MS ret_val;
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
ret_val.gcc() = single_value.field_gcc->valueof();
break;
case ML3__Discr__NW__MS::ALT_bcc:
ret_val.bcc() = single_value.field_bcc->valueof();
break;
case ML3__Discr__NW__MS::ALT_cc:
ret_val.cc() = single_value.field_cc->valueof();
break;
case ML3__Discr__NW__MS::ALT_gttp:
ret_val.gttp() = single_value.field_gttp->valueof();
break;
case ML3__Discr__NW__MS::ALT_mm:
ret_val.mm() = single_value.field_mm->valueof();
break;
case ML3__Discr__NW__MS::ALT_rrm:
ret_val.rrm() = single_value.field_rrm->valueof();
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
ret_val.gprs__mm() = single_value.field_gprs__mm->valueof();
break;
case ML3__Discr__NW__MS::ALT_sms:
ret_val.sms() = single_value.field_sms->valueof();
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
ret_val.gprs__sm() = single_value.field_gprs__sm->valueof();
break;
case ML3__Discr__NW__MS::ALT_ss:
ret_val.ss() = single_value.field_ss->valueof();
break;
case ML3__Discr__NW__MS::ALT_loc:
ret_val.loc() = single_value.field_loc->valueof();
break;
case ML3__Discr__NW__MS::ALT_reserved:
ret_val.reserved() = single_value.field_reserved->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
return ret_val;
}

ML3__Discr__NW__MS_template& ML3__Discr__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return value_list.list_value[list_index];
}
void ML3__Discr__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ML3__Discr__NW__MS_template[list_length];
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::gcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_gcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gcc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_gcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gcc;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::gcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gcc in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_gcc) TTCN_error("Accessing non-selected field gcc in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_gcc;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::bcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_bcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_bcc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_bcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bcc;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::bcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bcc in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_bcc) TTCN_error("Accessing non-selected field bcc in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_bcc;
}

MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template& ML3__Discr__NW__MS_template::cc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_cc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template(ANY_VALUE);
else single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_cc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cc;
}

const MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template& ML3__Discr__NW__MS_template::cc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cc in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_cc) TTCN_error("Accessing non-selected field cc in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_cc;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::gttp()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_gttp) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gttp = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gttp = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_gttp;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gttp;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::gttp() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gttp in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_gttp) TTCN_error("Accessing non-selected field gttp in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_gttp;
}

MobileL3__MM__Types::PDU__ML3__MM_template& ML3__Discr__NW__MS_template::mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(ANY_VALUE);
else single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mm;
}

const MobileL3__MM__Types::PDU__ML3__MM_template& ML3__Discr__NW__MS_template::mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mm in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_mm) TTCN_error("Accessing non-selected field mm in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_mm;
}

MobileL3__RRM__Types::PDU__RRM__NW__MS_template& ML3__Discr__NW__MS_template::rrm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_rrm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS_template(ANY_VALUE);
else single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_rrm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rrm;
}

const MobileL3__RRM__Types::PDU__RRM__NW__MS_template& ML3__Discr__NW__MS_template::rrm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rrm in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_rrm) TTCN_error("Accessing non-selected field rrm in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_rrm;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::gprs__mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_gprs__mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__mm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gprs__mm = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_gprs__mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__mm;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::gprs__mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_mm in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_gprs__mm) TTCN_error("Accessing non-selected field gprs_mm in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_gprs__mm;
}

MobileL3__SMS__Types::L3__SMS__SGSN__MS_template& ML3__Discr__NW__MS_template::sms()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_sms) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS_template(ANY_VALUE);
else single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_sms;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sms;
}

const MobileL3__SMS__Types::L3__SMS__SGSN__MS_template& ML3__Discr__NW__MS_template::sms() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sms in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_sms) TTCN_error("Accessing non-selected field sms in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_sms;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::gprs__sm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_gprs__sm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__sm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gprs__sm = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_gprs__sm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__sm;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::gprs__sm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_sm in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_gprs__sm) TTCN_error("Accessing non-selected field gprs_sm in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_gprs__sm;
}

MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template& ML3__Discr__NW__MS_template::ss()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_ss) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template(ANY_VALUE);
else single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_ss;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_ss;
}

const MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template& ML3__Discr__NW__MS_template::ss() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ss in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_ss) TTCN_error("Accessing non-selected field ss in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_ss;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::loc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_loc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_loc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_loc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_loc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_loc;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::loc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field loc in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_loc) TTCN_error("Accessing non-selected field loc in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_loc;
}

OCTETSTRING_template& ML3__Discr__NW__MS_template::reserved()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__NW__MS::ALT_reserved) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_reserved = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_reserved = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__NW__MS::ALT_reserved;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_reserved;
}

const OCTETSTRING_template& ML3__Discr__NW__MS_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field reserved in a non-specific template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
if (single_value.union_selection != ML3__Discr__NW__MS::ALT_reserved) TTCN_error("Accessing non-selected field reserved in a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return *single_value.field_reserved;
}

boolean ML3__Discr__NW__MS_template::ischosen(ML3__Discr__NW__MS::union_selection_type checked_selection) const
{
if (checked_selection == ML3__Discr__NW__MS::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.ML3_Discr_NW_MS.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ML3__Discr__NW__MS::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.ML3_Discr_NW_MS containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__NW__MS::ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ML3__Discr__NW__MS_template::log_match(const ML3__Discr__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gcc");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_bcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bcc");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_cc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cc");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_gttp:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gttp");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mm");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_rrm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rrm");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_mm");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_sms:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sms");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_sm");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_ss:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".ss");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_loc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".loc");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__NW__MS::ALT_reserved:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".reserved");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ML3__Discr__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc->set_implicit_omit(); break;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved->set_implicit_omit(); break;
default: break;
}
}

void ML3__Discr__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc->encode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}

void ML3__Discr__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ML3__Discr__NW__MS::UNBOUND_VALUE;
ML3__Discr__NW__MS::union_selection_type new_selection = (ML3__Discr__NW__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template;
single_value.field_gcc->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template;
single_value.field_bcc->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__NW__MS_template;
single_value.field_cc->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template;
single_value.field_gttp->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template;
single_value.field_mm->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__NW__MS_template;
single_value.field_rrm->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template;
single_value.field_gprs__mm->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__SGSN__MS_template;
single_value.field_sms->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template;
single_value.field_gprs__sm->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__NW__MS_template;
single_value.field_ss->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc = new OCTETSTRING_template;
single_value.field_loc->decode_text(text_buf);
break;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template;
single_value.field_reserved->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ML3__Discr__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.ML3_Discr_NW_MS.");
}
}

boolean ML3__Discr__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ML3__Discr__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__NW__MS_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.ML3_Discr_NW_MS'");
    }
    if (strcmp("gcc", param_field) == 0) {
      gcc().set_param(param);
      return;
    } else if (strcmp("bcc", param_field) == 0) {
      bcc().set_param(param);
      return;
    } else if (strcmp("cc", param_field) == 0) {
      cc().set_param(param);
      return;
    } else if (strcmp("gttp", param_field) == 0) {
      gttp().set_param(param);
      return;
    } else if (strcmp("mm", param_field) == 0) {
      mm().set_param(param);
      return;
    } else if (strcmp("rrm", param_field) == 0) {
      rrm().set_param(param);
      return;
    } else if (strcmp("gprs_mm", param_field) == 0) {
      gprs__mm().set_param(param);
      return;
    } else if (strcmp("sms", param_field) == 0) {
      sms().set_param(param);
      return;
    } else if (strcmp("gprs_sm", param_field) == 0) {
      gprs__sm().set_param(param);
      return;
    } else if (strcmp("ss", param_field) == 0) {
      ss().set_param(param);
      return;
    } else if (strcmp("loc", param_field) == 0) {
      loc().set_param(param);
      return;
    } else if (strcmp("reserved", param_field) == 0) {
      reserved().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.ML3_Discr_NW_MS'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ML3__Discr__NW__MS_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.ML3_Discr_NW_MS");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "gcc")) {
      gcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "bcc")) {
      bcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cc")) {
      cc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gttp")) {
      gttp().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mm")) {
      mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rrm")) {
      rrm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_mm")) {
      gprs__mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sms")) {
      sms().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_sm")) {
      gprs__sm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "ss")) {
      ss().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "loc")) {
      loc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "reserved")) {
      reserved().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.ML3_Discr_NW_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ML3__Discr__NW__MS_template* precondition = new ML3__Discr__NW__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    ML3__Discr__NW__MS_template* implied_template = new ML3__Discr__NW__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ML3__Discr__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.ML3_Discr_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void ML3__Discr__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case ML3__Discr__NW__MS::ALT_gcc:
single_value.field_gcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_bcc:
single_value.field_bcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_cc:
single_value.field_cc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_gttp:
single_value.field_gttp->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_mm:
single_value.field_mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_rrm:
single_value.field_rrm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_gprs__mm:
single_value.field_gprs__mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_sms:
single_value.field_sms->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_gprs__sm:
single_value.field_gprs__sm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_ss:
single_value.field_ss->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_loc:
single_value.field_loc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
case ML3__Discr__NW__MS::ALT_reserved:
single_value.field_reserved->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.ML3_Discr_NW_MS.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.ML3_Discr_NW_MS");
}

PDU__ML3__NW__MS::PDU__ML3__NW__MS()
{
}

PDU__ML3__NW__MS::PDU__ML3__NW__MS(const BITSTRING& par_discriminator,
    const TiOrSkip& par_tiOrSkip,
    const ML3__Discr__NW__MS& par_msgs)
  :   field_discriminator(par_discriminator),
  field_tiOrSkip(par_tiOrSkip),
  field_msgs(par_msgs)
{
}

PDU__ML3__NW__MS::PDU__ML3__NW__MS(const PDU__ML3__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.PDU_ML3_NW_MS.");
if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
else field_discriminator.clean_up();
if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
else field_tiOrSkip.clean_up();
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
}

void PDU__ML3__NW__MS::clean_up()
{
field_discriminator.clean_up();
field_tiOrSkip.clean_up();
field_msgs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__NW__MS::get_descriptor() const { return &PDU__ML3__NW__MS_descr_; }
PDU__ML3__NW__MS& PDU__ML3__NW__MS::operator=(const PDU__ML3__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.PDU_ML3_NW_MS.");
  if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
  else field_discriminator.clean_up();
  if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
  else field_tiOrSkip.clean_up();
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
}
return *this;
}

boolean PDU__ML3__NW__MS::operator==(const PDU__ML3__NW__MS& other_value) const
{
return field_discriminator==other_value.field_discriminator
  && field_tiOrSkip==other_value.field_tiOrSkip
  && field_msgs==other_value.field_msgs;
}

boolean PDU__ML3__NW__MS::is_bound() const
{
return (field_discriminator.is_bound())
  || (field_tiOrSkip.is_bound())
  || (field_msgs.is_bound());
}
boolean PDU__ML3__NW__MS::is_value() const
{
return field_discriminator.is_value()
  && field_tiOrSkip.is_value()
  && field_msgs.is_value();
}
void PDU__ML3__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ discriminator := ");
field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__NW__MS::set_implicit_omit()
{
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__ML3__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.PDU_ML3_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_ML3_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.PDU_ML3_NW_MS");
  }
}

void PDU__ML3__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_discriminator.encode_text(text_buf);
field_tiOrSkip.encode_text(text_buf);
field_msgs.encode_text(text_buf);
}

void PDU__ML3__NW__MS::decode_text(Text_Buf& text_buf)
{
field_discriminator.decode_text(text_buf);
field_tiOrSkip.decode_text(text_buf);
field_msgs.decode_text(text_buf);
}

void PDU__ML3__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__ML3__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__ML3__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_12 || field_discriminator ==  bs_4 || field_discriminator ==  bs_5 || field_discriminator ==  bs_6 || field_discriminator ==  bs_13 || field_discriminator ==  bs_7 || field_discriminator ==  bs_11 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 0;
  else if (field_discriminator ==  bs_1 || field_discriminator ==  bs_2 || field_discriminator ==  bs_3 || field_discriminator ==  bs_8 || field_discriminator ==  bs_10 || field_discriminator ==  bs_9) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__ML3__NW__MS_tiOrSkip_descr_.raw->forceomit);
  decoded_field_length = field_tiOrSkip.RAW_decode(PDU__ML3__NW__MS_tiOrSkip_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_1) selected_field = 0;
  else if (field_discriminator ==  bs_2) selected_field = 1;
  else if (field_discriminator ==  bs_3) selected_field = 2;
  else if (field_discriminator ==  bs_4) selected_field = 3;
  else if (field_discriminator ==  bs_5) selected_field = 4;
  else if (field_discriminator ==  bs_6) selected_field = 5;
  else if (field_discriminator ==  bs_7) selected_field = 6;
  else if (field_discriminator ==  bs_8) selected_field = 7;
  else if (field_discriminator ==  bs_9) selected_field = 8;
  else if (field_discriminator ==  bs_10) selected_field = 9;
  else if (field_discriminator ==  bs_11) selected_field = 10;
  else if (field_discriminator ==  bs_12 || field_discriminator ==  bs_13 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 11;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__ML3__NW__MS_msgs_descr_.raw->forceomit);
  decoded_field_length = field_msgs.RAW_decode(PDU__ML3__NW__MS_msgs_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__ML3__NW__MS_tiOrSkip_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__ML3__NW__MS_msgs_descr_.raw);
  encoded_length += field_discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiOrSkip.RAW_encode(PDU__ML3__NW__MS_tiOrSkip_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msgs.RAW_encode(PDU__ML3__NW__MS_msgs_descr_, *myleaf.body.node.nodes[2]);
  switch (field_tiOrSkip.get_selection()) {
  case TiOrSkip::ALT_skipIndicator:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_4 && field_discriminator !=  bs_5 && field_discriminator !=  bs_6 && field_discriminator !=  bs_13 && field_discriminator !=  bs_7 && field_discriminator !=  bs_11 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case TiOrSkip::ALT_transactionId:
  if (field_discriminator !=  bs_1 && field_discriminator !=  bs_2 && field_discriminator !=  bs_3 && field_discriminator !=  bs_8 && field_discriminator !=  bs_10 && field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  switch (field_msgs.get_selection()) {
  case ML3__Discr__NW__MS::ALT_gcc:
  if (field_discriminator !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_bcc:
  if (field_discriminator !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_cc:
  if (field_discriminator !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_gttp:
  if (field_discriminator !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_mm:
  if (field_discriminator !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_rrm:
  if (field_discriminator !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_gprs__mm:
  if (field_discriminator !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_sms:
  if (field_discriminator !=  bs_8) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_8.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_gprs__sm:
  if (field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_9.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_ss:
  if (field_discriminator !=  bs_10) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_10.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_loc:
  if (field_discriminator !=  bs_11) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__NW__MS::ALT_reserved:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_13 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__NW__MS_template::single_value_struct {
BITSTRING_template field_discriminator;
TiOrSkip_template field_tiOrSkip;
ML3__Discr__NW__MS_template field_msgs;
};

void PDU__ML3__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_discriminator = ANY_VALUE;
single_value->field_tiOrSkip = ANY_VALUE;
single_value->field_msgs = ANY_VALUE;
}
}
}

void PDU__ML3__NW__MS_template::copy_value(const PDU__ML3__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.discriminator().is_bound()) {
  single_value->field_discriminator = other_value.discriminator();
} else {
  single_value->field_discriminator.clean_up();
}
if (other_value.tiOrSkip().is_bound()) {
  single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
  single_value->field_tiOrSkip.clean_up();
}
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__NW__MS_template::copy_template(const PDU__ML3__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.discriminator().get_selection()) {
single_value->field_discriminator = other_value.discriminator();
} else {
single_value->field_discriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiOrSkip().get_selection()) {
single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
single_value->field_tiOrSkip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template()
{
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(const PDU__ML3__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(const OPTIONAL<PDU__ML3__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.PDU_ML3_NW_MS from an unbound optional field.");
}
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(PDU__ML3__NW__MS_template* p_precondition, PDU__ML3__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(Dynamic_Match_Interface<PDU__ML3__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__NW__MS_template::PDU__ML3__NW__MS_template(const PDU__ML3__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__NW__MS_template::~PDU__ML3__NW__MS_template()
{
clean_up();
}

PDU__ML3__NW__MS_template& PDU__ML3__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__NW__MS_template& PDU__ML3__NW__MS_template::operator=(const PDU__ML3__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__NW__MS_template& PDU__ML3__NW__MS_template::operator=(const OPTIONAL<PDU__ML3__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.PDU_ML3_NW_MS.");
}
return *this;
}

PDU__ML3__NW__MS_template& PDU__ML3__NW__MS_template::operator=(const PDU__ML3__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__NW__MS_template::match(const PDU__ML3__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.discriminator().is_bound()) return FALSE;
if(!single_value->field_discriminator.match(other_value.discriminator(), legacy))return FALSE;
if(!other_value.tiOrSkip().is_bound()) return FALSE;
if(!single_value->field_tiOrSkip.match(other_value.tiOrSkip(), legacy))return FALSE;
if(!other_value.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_discriminator.is_bound()
 || single_value->field_tiOrSkip.is_bound()
 || single_value->field_msgs.is_bound();
}

boolean PDU__ML3__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_discriminator.is_value()
 && single_value->field_tiOrSkip.is_value()
 && single_value->field_msgs.is_value();
}

void PDU__ML3__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__NW__MS PDU__ML3__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.PDU_ML3_NW_MS.");
PDU__ML3__NW__MS ret_val;
if (single_value->field_discriminator.is_bound()) {
ret_val.discriminator() = single_value->field_discriminator.valueof();
}
if (single_value->field_tiOrSkip.is_bound()) {
ret_val.tiOrSkip() = single_value->field_tiOrSkip.valueof();
}
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
return ret_val;
}

void PDU__ML3__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.PDU_ML3_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__NW__MS_template[list_length];
}

PDU__ML3__NW__MS_template& PDU__ML3__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.PDU_ML3_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.PDU_ML3_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__NW__MS_template::discriminator()
{
set_specific();
return single_value->field_discriminator;
}

const BITSTRING_template& PDU__ML3__NW__MS_template::discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field discriminator of a non-specific template of type @MobileL3_Types.PDU_ML3_NW_MS.");
return single_value->field_discriminator;
}

TiOrSkip_template& PDU__ML3__NW__MS_template::tiOrSkip()
{
set_specific();
return single_value->field_tiOrSkip;
}

const TiOrSkip_template& PDU__ML3__NW__MS_template::tiOrSkip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiOrSkip of a non-specific template of type @MobileL3_Types.PDU_ML3_NW_MS.");
return single_value->field_tiOrSkip;
}

ML3__Discr__NW__MS_template& PDU__ML3__NW__MS_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const ML3__Discr__NW__MS_template& PDU__ML3__NW__MS_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @MobileL3_Types.PDU_ML3_NW_MS.");
return single_value->field_msgs;
}

int PDU__ML3__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_NW_MS.");
  }
  return 0;
}

void PDU__ML3__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__NW__MS_template::log_match(const PDU__ML3__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_discriminator.match(match_value.discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".discriminator");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiOrSkip.match(match_value.tiOrSkip(), legacy)){
TTCN_Logger::log_logmatch_info(".tiOrSkip");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__ML3__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_discriminator.encode_text(text_buf);
single_value->field_tiOrSkip.encode_text(text_buf);
single_value->field_msgs.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_NW_MS.");
}
}

void PDU__ML3__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_discriminator.decode_text(text_buf);
single_value->field_tiOrSkip.decode_text(text_buf);
single_value->field_msgs.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.PDU_ML3_NW_MS.");
}
}

void PDU__ML3__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.PDU_ML3_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_ML3_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__NW__MS_template* precondition = new PDU__ML3__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__NW__MS_template* implied_template = new PDU__ML3__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.PDU_ML3_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_discriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_NW_MS");
single_value->field_tiOrSkip.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_NW_MS");
single_value->field_msgs.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.PDU_ML3_NW_MS");
}

boolean PDU__ML3__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__MS__NW::copy_value(const ML3__Discr__MS__NW& other_value)
{
switch (other_value.union_selection) {
case ALT_gcc:
field_gcc = new OCTETSTRING(*other_value.field_gcc);
break;
case ALT_bcc:
field_bcc = new OCTETSTRING(*other_value.field_bcc);
break;
case ALT_cc:
field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW(*other_value.field_cc);
break;
case ALT_gttp:
field_gttp = new OCTETSTRING(*other_value.field_gttp);
break;
case ALT_mm:
field_mm = new MobileL3__MM__Types::PDU__ML3__MM(*other_value.field_mm);
break;
case ALT_rrm:
field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW(*other_value.field_rrm);
break;
case ALT_gprs__mm:
field_gprs__mm = new OCTETSTRING(*other_value.field_gprs__mm);
break;
case ALT_sms:
field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN(*other_value.field_sms);
break;
case ALT_gprs__sm:
field_gprs__sm = new OCTETSTRING(*other_value.field_gprs__sm);
break;
case ALT_ss:
field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW(*other_value.field_ss);
break;
case ALT_loc:
field_loc = new OCTETSTRING(*other_value.field_loc);
break;
case ALT_reserved:
field_reserved = new OCTETSTRING(*other_value.field_reserved);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
union_selection = other_value.union_selection;
}

ML3__Discr__MS__NW::ML3__Discr__MS__NW()
{
union_selection = UNBOUND_VALUE;
}

ML3__Discr__MS__NW::ML3__Discr__MS__NW(const ML3__Discr__MS__NW& other_value)
: Base_Type(){
copy_value(other_value);
}

ML3__Discr__MS__NW::~ML3__Discr__MS__NW()
{
clean_up();
}

ML3__Discr__MS__NW& ML3__Discr__MS__NW::operator=(const ML3__Discr__MS__NW& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean ML3__Discr__MS__NW::operator==(const ML3__Discr__MS__NW& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gcc:
return *field_gcc == *other_value.field_gcc;
case ALT_bcc:
return *field_bcc == *other_value.field_bcc;
case ALT_cc:
return *field_cc == *other_value.field_cc;
case ALT_gttp:
return *field_gttp == *other_value.field_gttp;
case ALT_mm:
return *field_mm == *other_value.field_mm;
case ALT_rrm:
return *field_rrm == *other_value.field_rrm;
case ALT_gprs__mm:
return *field_gprs__mm == *other_value.field_gprs__mm;
case ALT_sms:
return *field_sms == *other_value.field_sms;
case ALT_gprs__sm:
return *field_gprs__sm == *other_value.field_gprs__sm;
case ALT_ss:
return *field_ss == *other_value.field_ss;
case ALT_loc:
return *field_loc == *other_value.field_loc;
case ALT_reserved:
return *field_reserved == *other_value.field_reserved;
default:
return FALSE;
}
}

OCTETSTRING& ML3__Discr__MS__NW::gcc()
{
if (union_selection != ALT_gcc) {
clean_up();
field_gcc = new OCTETSTRING;
union_selection = ALT_gcc;
}
return *field_gcc;
}

const OCTETSTRING& ML3__Discr__MS__NW::gcc() const
{
if (union_selection != ALT_gcc) TTCN_error("Using non-selected field gcc in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_gcc;
}

OCTETSTRING& ML3__Discr__MS__NW::bcc()
{
if (union_selection != ALT_bcc) {
clean_up();
field_bcc = new OCTETSTRING;
union_selection = ALT_bcc;
}
return *field_bcc;
}

const OCTETSTRING& ML3__Discr__MS__NW::bcc() const
{
if (union_selection != ALT_bcc) TTCN_error("Using non-selected field bcc in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_bcc;
}

MobileL3__CC__Types::PDU__ML3__CC__MS__NW& ML3__Discr__MS__NW::cc()
{
if (union_selection != ALT_cc) {
clean_up();
field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW;
union_selection = ALT_cc;
}
return *field_cc;
}

const MobileL3__CC__Types::PDU__ML3__CC__MS__NW& ML3__Discr__MS__NW::cc() const
{
if (union_selection != ALT_cc) TTCN_error("Using non-selected field cc in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_cc;
}

OCTETSTRING& ML3__Discr__MS__NW::gttp()
{
if (union_selection != ALT_gttp) {
clean_up();
field_gttp = new OCTETSTRING;
union_selection = ALT_gttp;
}
return *field_gttp;
}

const OCTETSTRING& ML3__Discr__MS__NW::gttp() const
{
if (union_selection != ALT_gttp) TTCN_error("Using non-selected field gttp in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_gttp;
}

MobileL3__MM__Types::PDU__ML3__MM& ML3__Discr__MS__NW::mm()
{
if (union_selection != ALT_mm) {
clean_up();
field_mm = new MobileL3__MM__Types::PDU__ML3__MM;
union_selection = ALT_mm;
}
return *field_mm;
}

const MobileL3__MM__Types::PDU__ML3__MM& ML3__Discr__MS__NW::mm() const
{
if (union_selection != ALT_mm) TTCN_error("Using non-selected field mm in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_mm;
}

MobileL3__RRM__Types::PDU__RRM__MS__NW& ML3__Discr__MS__NW::rrm()
{
if (union_selection != ALT_rrm) {
clean_up();
field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW;
union_selection = ALT_rrm;
}
return *field_rrm;
}

const MobileL3__RRM__Types::PDU__RRM__MS__NW& ML3__Discr__MS__NW::rrm() const
{
if (union_selection != ALT_rrm) TTCN_error("Using non-selected field rrm in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_rrm;
}

OCTETSTRING& ML3__Discr__MS__NW::gprs__mm()
{
if (union_selection != ALT_gprs__mm) {
clean_up();
field_gprs__mm = new OCTETSTRING;
union_selection = ALT_gprs__mm;
}
return *field_gprs__mm;
}

const OCTETSTRING& ML3__Discr__MS__NW::gprs__mm() const
{
if (union_selection != ALT_gprs__mm) TTCN_error("Using non-selected field gprs_mm in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_gprs__mm;
}

MobileL3__SMS__Types::L3__SMS__MS__SGSN& ML3__Discr__MS__NW::sms()
{
if (union_selection != ALT_sms) {
clean_up();
field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN;
union_selection = ALT_sms;
}
return *field_sms;
}

const MobileL3__SMS__Types::L3__SMS__MS__SGSN& ML3__Discr__MS__NW::sms() const
{
if (union_selection != ALT_sms) TTCN_error("Using non-selected field sms in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_sms;
}

OCTETSTRING& ML3__Discr__MS__NW::gprs__sm()
{
if (union_selection != ALT_gprs__sm) {
clean_up();
field_gprs__sm = new OCTETSTRING;
union_selection = ALT_gprs__sm;
}
return *field_gprs__sm;
}

const OCTETSTRING& ML3__Discr__MS__NW::gprs__sm() const
{
if (union_selection != ALT_gprs__sm) TTCN_error("Using non-selected field gprs_sm in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_gprs__sm;
}

MobileL3__SS__Types::PDU__ML3__SS__MS__NW& ML3__Discr__MS__NW::ss()
{
if (union_selection != ALT_ss) {
clean_up();
field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW;
union_selection = ALT_ss;
}
return *field_ss;
}

const MobileL3__SS__Types::PDU__ML3__SS__MS__NW& ML3__Discr__MS__NW::ss() const
{
if (union_selection != ALT_ss) TTCN_error("Using non-selected field ss in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_ss;
}

OCTETSTRING& ML3__Discr__MS__NW::loc()
{
if (union_selection != ALT_loc) {
clean_up();
field_loc = new OCTETSTRING;
union_selection = ALT_loc;
}
return *field_loc;
}

const OCTETSTRING& ML3__Discr__MS__NW::loc() const
{
if (union_selection != ALT_loc) TTCN_error("Using non-selected field loc in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_loc;
}

OCTETSTRING& ML3__Discr__MS__NW::reserved()
{
if (union_selection != ALT_reserved) {
clean_up();
field_reserved = new OCTETSTRING;
union_selection = ALT_reserved;
}
return *field_reserved;
}

const OCTETSTRING& ML3__Discr__MS__NW::reserved() const
{
if (union_selection != ALT_reserved) TTCN_error("Using non-selected field reserved in a value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *field_reserved;
}

boolean ML3__Discr__MS__NW::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return union_selection == checked_selection;
}

boolean ML3__Discr__MS__NW::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean ML3__Discr__MS__NW::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gcc: return field_gcc->is_value();
case ALT_bcc: return field_bcc->is_value();
case ALT_cc: return field_cc->is_value();
case ALT_gttp: return field_gttp->is_value();
case ALT_mm: return field_mm->is_value();
case ALT_rrm: return field_rrm->is_value();
case ALT_gprs__mm: return field_gprs__mm->is_value();
case ALT_sms: return field_sms->is_value();
case ALT_gprs__sm: return field_gprs__sm->is_value();
case ALT_ss: return field_ss->is_value();
case ALT_loc: return field_loc->is_value();
case ALT_reserved: return field_reserved->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ML3__Discr__MS__NW::clean_up()
{
switch (union_selection) {
case ALT_gcc:
  delete field_gcc;
  break;
case ALT_bcc:
  delete field_bcc;
  break;
case ALT_cc:
  delete field_cc;
  break;
case ALT_gttp:
  delete field_gttp;
  break;
case ALT_mm:
  delete field_mm;
  break;
case ALT_rrm:
  delete field_rrm;
  break;
case ALT_gprs__mm:
  delete field_gprs__mm;
  break;
case ALT_sms:
  delete field_sms;
  break;
case ALT_gprs__sm:
  delete field_gprs__sm;
  break;
case ALT_ss:
  delete field_ss;
  break;
case ALT_loc:
  delete field_loc;
  break;
case ALT_reserved:
  delete field_reserved;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ML3__Discr__MS__NW::log() const
{
switch (union_selection) {
case ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ML3__Discr__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gcc")) {
    gcc().set_param(*mp_last);
    if (!gcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "bcc")) {
    bcc().set_param(*mp_last);
    if (!bcc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cc")) {
    cc().set_param(*mp_last);
    if (!cc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gttp")) {
    gttp().set_param(*mp_last);
    if (!gttp().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mm")) {
    mm().set_param(*mp_last);
    if (!mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rrm")) {
    rrm().set_param(*mp_last);
    if (!rrm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_mm")) {
    gprs__mm().set_param(*mp_last);
    if (!gprs__mm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "sms")) {
    sms().set_param(*mp_last);
    if (!sms().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gprs_sm")) {
    gprs__sm().set_param(*mp_last);
    if (!gprs__sm().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "ss")) {
    ss().set_param(*mp_last);
    if (!ss().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "loc")) {
    loc().set_param(*mp_last);
    if (!loc().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "reserved")) {
    reserved().set_param(*mp_last);
    if (!reserved().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_Types.ML3_Discr_MS_NW.", last_name);
}

void ML3__Discr__MS__NW::set_implicit_omit()
{
switch (union_selection) {
case ALT_gcc:
field_gcc->set_implicit_omit(); break;
case ALT_bcc:
field_bcc->set_implicit_omit(); break;
case ALT_cc:
field_cc->set_implicit_omit(); break;
case ALT_gttp:
field_gttp->set_implicit_omit(); break;
case ALT_mm:
field_mm->set_implicit_omit(); break;
case ALT_rrm:
field_rrm->set_implicit_omit(); break;
case ALT_gprs__mm:
field_gprs__mm->set_implicit_omit(); break;
case ALT_sms:
field_sms->set_implicit_omit(); break;
case ALT_gprs__sm:
field_gprs__sm->set_implicit_omit(); break;
case ALT_ss:
field_ss->set_implicit_omit(); break;
case ALT_loc:
field_loc->set_implicit_omit(); break;
case ALT_reserved:
field_reserved->set_implicit_omit(); break;
default: break;
}
}

void ML3__Discr__MS__NW::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gcc:
field_gcc->encode_text(text_buf);
break;
case ALT_bcc:
field_bcc->encode_text(text_buf);
break;
case ALT_cc:
field_cc->encode_text(text_buf);
break;
case ALT_gttp:
field_gttp->encode_text(text_buf);
break;
case ALT_mm:
field_mm->encode_text(text_buf);
break;
case ALT_rrm:
field_rrm->encode_text(text_buf);
break;
case ALT_gprs__mm:
field_gprs__mm->encode_text(text_buf);
break;
case ALT_sms:
field_sms->encode_text(text_buf);
break;
case ALT_gprs__sm:
field_gprs__sm->encode_text(text_buf);
break;
case ALT_ss:
field_ss->encode_text(text_buf);
break;
case ALT_loc:
field_loc->encode_text(text_buf);
break;
case ALT_reserved:
field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}

void ML3__Discr__MS__NW::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gcc:
gcc().decode_text(text_buf);
break;
case ALT_bcc:
bcc().decode_text(text_buf);
break;
case ALT_cc:
cc().decode_text(text_buf);
break;
case ALT_gttp:
gttp().decode_text(text_buf);
break;
case ALT_mm:
mm().decode_text(text_buf);
break;
case ALT_rrm:
rrm().decode_text(text_buf);
break;
case ALT_gprs__mm:
gprs__mm().decode_text(text_buf);
break;
case ALT_sms:
sms().decode_text(text_buf);
break;
case ALT_gprs__sm:
gprs__sm().decode_text(text_buf);
break;
case ALT_ss:
ss().decode_text(text_buf);
break;
case ALT_loc:
loc().decode_text(text_buf);
break;
case ALT_reserved:
reserved().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}

void ML3__Discr__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ML3__Discr__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ML3__Discr__MS__NW::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(MobileL3__MM__Types::PDU__ML3__MM_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = bcc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_.raw->forceomit);
      decoded_length = cc().RAW_decode(MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gttp().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw->forceomit);
      decoded_length = mm().RAW_decode(MobileL3__MM__Types::PDU__ML3__MM_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_.raw->forceomit);
      decoded_length = rrm().RAW_decode(MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__mm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_.raw->forceomit);
      decoded_length = sms().RAW_decode(MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_8_force_omit(8, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = gprs__sm().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_.raw->forceomit);
      decoded_length = ss().RAW_decode(MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_9_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_10_force_omit(10, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = loc().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_10_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_11_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
      decoded_length = reserved().RAW_decode(OCTETSTRING_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_11_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int ML3__Discr__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  memset(myleaf.body.node.nodes, 0, 12 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gcc:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, OCTETSTRING_descr_.raw);
    encoded_length = field_gcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_bcc:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, OCTETSTRING_descr_.raw);
    encoded_length = field_bcc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_cc:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_.raw);
    encoded_length = field_cc->RAW_encode(MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &MobileL3__CC__Types::PDU__ML3__CC__MS__NW_descr_;
    break;
  case ALT_gttp:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, OCTETSTRING_descr_.raw);
    encoded_length = field_gttp->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_mm:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, MobileL3__MM__Types::PDU__ML3__MM_descr_.raw);
    encoded_length = field_mm->RAW_encode(MobileL3__MM__Types::PDU__ML3__MM_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &MobileL3__MM__Types::PDU__ML3__MM_descr_;
    break;
  case ALT_rrm:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_.raw);
    encoded_length = field_rrm->RAW_encode(MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &MobileL3__RRM__Types::PDU__RRM__MS__NW_descr_;
    break;
  case ALT_gprs__mm:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, OCTETSTRING_descr_.raw);
    encoded_length = field_gprs__mm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_sms:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_.raw);
    encoded_length = field_sms->RAW_encode(MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &MobileL3__SMS__Types::L3__SMS__MS__SGSN_descr_;
    break;
  case ALT_gprs__sm:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, OCTETSTRING_descr_.raw);
    encoded_length = field_gprs__sm->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_ss:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_.raw);
    encoded_length = field_ss->RAW_encode(MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &MobileL3__SS__Types::PDU__ML3__SS__MS__NW_descr_;
    break;
  case ALT_loc:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, OCTETSTRING_descr_.raw);
    encoded_length = field_loc->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &OCTETSTRING_descr_;
    break;
  case ALT_reserved:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, OCTETSTRING_descr_.raw);
    encoded_length = field_reserved->RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &OCTETSTRING_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ML3__Discr__MS__NW_template::copy_value(const ML3__Discr__MS__NW& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(other_value.gcc());
break;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(other_value.bcc());
break;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template(other_value.cc());
break;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(other_value.gttp());
break;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(other_value.mm());
break;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW_template(other_value.rrm());
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template(other_value.gprs__mm());
break;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN_template(other_value.sms());
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template(other_value.gprs__sm());
break;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template(other_value.ss());
break;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(other_value.loc());
break;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(other_value.reserved());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
set_selection(SPECIFIC_VALUE);
}

void ML3__Discr__MS__NW_template::copy_template(const ML3__Discr__MS__NW_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template(*other_value.single_value.field_gcc);
break;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template(*other_value.single_value.field_bcc);
break;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template(*other_value.single_value.field_cc);
break;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template(*other_value.single_value.field_gttp);
break;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(*other_value.single_value.field_mm);
break;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW_template(*other_value.single_value.field_rrm);
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template(*other_value.single_value.field_gprs__mm);
break;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN_template(*other_value.single_value.field_sms);
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template(*other_value.single_value.field_gprs__sm);
break;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template(*other_value.single_value.field_ss);
break;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc = new OCTETSTRING_template(*other_value.single_value.field_loc);
break;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template(*other_value.single_value.field_reserved);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ML3__Discr__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ML3__Discr__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new ML3__Discr__MS__NW_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
set_selection(other_value);
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template()
{
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(const ML3__Discr__MS__NW& other_value)
{
copy_value(other_value);
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(const OPTIONAL<ML3__Discr__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ML3__Discr__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @MobileL3_Types.ML3_Discr_MS_NW from an unbound optional field.");
}
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(ML3__Discr__MS__NW_template* p_precondition, ML3__Discr__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(Dynamic_Match_Interface<ML3__Discr__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ML3__Discr__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ML3__Discr__MS__NW_template::ML3__Discr__MS__NW_template(const ML3__Discr__MS__NW_template& other_value)
: Base_Template(){
copy_template(other_value);
}

ML3__Discr__MS__NW_template::~ML3__Discr__MS__NW_template()
{
clean_up();
}

void ML3__Discr__MS__NW_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
delete single_value.field_gcc;
break;
case ML3__Discr__MS__NW::ALT_bcc:
delete single_value.field_bcc;
break;
case ML3__Discr__MS__NW::ALT_cc:
delete single_value.field_cc;
break;
case ML3__Discr__MS__NW::ALT_gttp:
delete single_value.field_gttp;
break;
case ML3__Discr__MS__NW::ALT_mm:
delete single_value.field_mm;
break;
case ML3__Discr__MS__NW::ALT_rrm:
delete single_value.field_rrm;
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
delete single_value.field_gprs__mm;
break;
case ML3__Discr__MS__NW::ALT_sms:
delete single_value.field_sms;
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
delete single_value.field_gprs__sm;
break;
case ML3__Discr__MS__NW::ALT_ss:
delete single_value.field_ss;
break;
case ML3__Discr__MS__NW::ALT_loc:
delete single_value.field_loc;
break;
case ML3__Discr__MS__NW::ALT_reserved:
delete single_value.field_reserved;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ML3__Discr__MS__NW_template& ML3__Discr__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ML3__Discr__MS__NW_template& ML3__Discr__MS__NW_template::operator=(const ML3__Discr__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ML3__Discr__MS__NW_template& ML3__Discr__MS__NW_template::operator=(const OPTIONAL<ML3__Discr__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ML3__Discr__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
return *this;
}

ML3__Discr__MS__NW_template& ML3__Discr__MS__NW_template::operator=(const ML3__Discr__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ML3__Discr__MS__NW_template::match(const ML3__Discr__MS__NW& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
ML3__Discr__MS__NW::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ML3__Discr__MS__NW::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
return single_value.field_gcc->match(other_value.gcc(), legacy);
case ML3__Discr__MS__NW::ALT_bcc:
return single_value.field_bcc->match(other_value.bcc(), legacy);
case ML3__Discr__MS__NW::ALT_cc:
return single_value.field_cc->match(other_value.cc(), legacy);
case ML3__Discr__MS__NW::ALT_gttp:
return single_value.field_gttp->match(other_value.gttp(), legacy);
case ML3__Discr__MS__NW::ALT_mm:
return single_value.field_mm->match(other_value.mm(), legacy);
case ML3__Discr__MS__NW::ALT_rrm:
return single_value.field_rrm->match(other_value.rrm(), legacy);
case ML3__Discr__MS__NW::ALT_gprs__mm:
return single_value.field_gprs__mm->match(other_value.gprs__mm(), legacy);
case ML3__Discr__MS__NW::ALT_sms:
return single_value.field_sms->match(other_value.sms(), legacy);
case ML3__Discr__MS__NW::ALT_gprs__sm:
return single_value.field_gprs__sm->match(other_value.gprs__sm(), legacy);
case ML3__Discr__MS__NW::ALT_ss:
return single_value.field_ss->match(other_value.ss(), legacy);
case ML3__Discr__MS__NW::ALT_loc:
return single_value.field_loc->match(other_value.loc(), legacy);
case ML3__Discr__MS__NW::ALT_reserved:
return single_value.field_reserved->match(other_value.reserved(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
return FALSE;
}

boolean ML3__Discr__MS__NW_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
return single_value.field_gcc->is_value();
case ML3__Discr__MS__NW::ALT_bcc:
return single_value.field_bcc->is_value();
case ML3__Discr__MS__NW::ALT_cc:
return single_value.field_cc->is_value();
case ML3__Discr__MS__NW::ALT_gttp:
return single_value.field_gttp->is_value();
case ML3__Discr__MS__NW::ALT_mm:
return single_value.field_mm->is_value();
case ML3__Discr__MS__NW::ALT_rrm:
return single_value.field_rrm->is_value();
case ML3__Discr__MS__NW::ALT_gprs__mm:
return single_value.field_gprs__mm->is_value();
case ML3__Discr__MS__NW::ALT_sms:
return single_value.field_sms->is_value();
case ML3__Discr__MS__NW::ALT_gprs__sm:
return single_value.field_gprs__sm->is_value();
case ML3__Discr__MS__NW::ALT_ss:
return single_value.field_ss->is_value();
case ML3__Discr__MS__NW::ALT_loc:
return single_value.field_loc->is_value();
case ML3__Discr__MS__NW::ALT_reserved:
return single_value.field_reserved->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}

ML3__Discr__MS__NW ML3__Discr__MS__NW_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
ML3__Discr__MS__NW ret_val;
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
ret_val.gcc() = single_value.field_gcc->valueof();
break;
case ML3__Discr__MS__NW::ALT_bcc:
ret_val.bcc() = single_value.field_bcc->valueof();
break;
case ML3__Discr__MS__NW::ALT_cc:
ret_val.cc() = single_value.field_cc->valueof();
break;
case ML3__Discr__MS__NW::ALT_gttp:
ret_val.gttp() = single_value.field_gttp->valueof();
break;
case ML3__Discr__MS__NW::ALT_mm:
ret_val.mm() = single_value.field_mm->valueof();
break;
case ML3__Discr__MS__NW::ALT_rrm:
ret_val.rrm() = single_value.field_rrm->valueof();
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
ret_val.gprs__mm() = single_value.field_gprs__mm->valueof();
break;
case ML3__Discr__MS__NW::ALT_sms:
ret_val.sms() = single_value.field_sms->valueof();
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
ret_val.gprs__sm() = single_value.field_gprs__sm->valueof();
break;
case ML3__Discr__MS__NW::ALT_ss:
ret_val.ss() = single_value.field_ss->valueof();
break;
case ML3__Discr__MS__NW::ALT_loc:
ret_val.loc() = single_value.field_loc->valueof();
break;
case ML3__Discr__MS__NW::ALT_reserved:
ret_val.reserved() = single_value.field_reserved->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
return ret_val;
}

ML3__Discr__MS__NW_template& ML3__Discr__MS__NW_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return value_list.list_value[list_index];
}
void ML3__Discr__MS__NW_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ML3__Discr__MS__NW_template[list_length];
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::gcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_gcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gcc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_gcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gcc;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::gcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gcc in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_gcc) TTCN_error("Accessing non-selected field gcc in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_gcc;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::bcc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_bcc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bcc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_bcc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_bcc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bcc;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::bcc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bcc in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_bcc) TTCN_error("Accessing non-selected field bcc in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_bcc;
}

MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template& ML3__Discr__MS__NW_template::cc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_cc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template(ANY_VALUE);
else single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_cc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cc;
}

const MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template& ML3__Discr__MS__NW_template::cc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cc in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_cc) TTCN_error("Accessing non-selected field cc in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_cc;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::gttp()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_gttp) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gttp = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gttp = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_gttp;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gttp;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::gttp() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gttp in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_gttp) TTCN_error("Accessing non-selected field gttp in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_gttp;
}

MobileL3__MM__Types::PDU__ML3__MM_template& ML3__Discr__MS__NW_template::mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template(ANY_VALUE);
else single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mm;
}

const MobileL3__MM__Types::PDU__ML3__MM_template& ML3__Discr__MS__NW_template::mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mm in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_mm) TTCN_error("Accessing non-selected field mm in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_mm;
}

MobileL3__RRM__Types::PDU__RRM__MS__NW_template& ML3__Discr__MS__NW_template::rrm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_rrm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW_template(ANY_VALUE);
else single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_rrm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rrm;
}

const MobileL3__RRM__Types::PDU__RRM__MS__NW_template& ML3__Discr__MS__NW_template::rrm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rrm in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_rrm) TTCN_error("Accessing non-selected field rrm in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_rrm;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::gprs__mm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_gprs__mm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__mm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gprs__mm = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_gprs__mm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__mm;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::gprs__mm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_mm in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_gprs__mm) TTCN_error("Accessing non-selected field gprs_mm in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_gprs__mm;
}

MobileL3__SMS__Types::L3__SMS__MS__SGSN_template& ML3__Discr__MS__NW_template::sms()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_sms) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN_template(ANY_VALUE);
else single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_sms;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sms;
}

const MobileL3__SMS__Types::L3__SMS__MS__SGSN_template& ML3__Discr__MS__NW_template::sms() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sms in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_sms) TTCN_error("Accessing non-selected field sms in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_sms;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::gprs__sm()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_gprs__sm) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gprs__sm = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_gprs__sm = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_gprs__sm;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gprs__sm;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::gprs__sm() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprs_sm in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_gprs__sm) TTCN_error("Accessing non-selected field gprs_sm in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_gprs__sm;
}

MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template& ML3__Discr__MS__NW_template::ss()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_ss) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template(ANY_VALUE);
else single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_ss;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_ss;
}

const MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template& ML3__Discr__MS__NW_template::ss() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ss in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_ss) TTCN_error("Accessing non-selected field ss in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_ss;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::loc()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_loc) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_loc = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_loc = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_loc;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_loc;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::loc() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field loc in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_loc) TTCN_error("Accessing non-selected field loc in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_loc;
}

OCTETSTRING_template& ML3__Discr__MS__NW_template::reserved()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ML3__Discr__MS__NW::ALT_reserved) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_reserved = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_reserved = new OCTETSTRING_template;
single_value.union_selection = ML3__Discr__MS__NW::ALT_reserved;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_reserved;
}

const OCTETSTRING_template& ML3__Discr__MS__NW_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field reserved in a non-specific template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
if (single_value.union_selection != ML3__Discr__MS__NW::ALT_reserved) TTCN_error("Accessing non-selected field reserved in a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return *single_value.field_reserved;
}

boolean ML3__Discr__MS__NW_template::ischosen(ML3__Discr__MS__NW::union_selection_type checked_selection) const
{
if (checked_selection == ML3__Discr__MS__NW::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MobileL3_Types.ML3_Discr_MS_NW.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ML3__Discr__MS__NW::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @MobileL3_Types.ML3_Discr_MS_NW containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__MS__NW_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_bcc:
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_cc:
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_gttp:
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_mm:
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_rrm:
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_sms:
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_ss:
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_loc:
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log();
TTCN_Logger::log_event_str(" }");
break;
case ML3__Discr__MS__NW::ALT_reserved:
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ML3__Discr__MS__NW_template::log_match(const ML3__Discr__MS__NW& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gcc");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gcc := ");
single_value.field_gcc->log_match(match_value.gcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_bcc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bcc");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bcc := ");
single_value.field_bcc->log_match(match_value.bcc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_cc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cc");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cc := ");
single_value.field_cc->log_match(match_value.cc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_gttp:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gttp");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gttp := ");
single_value.field_gttp->log_match(match_value.gttp(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mm");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mm := ");
single_value.field_mm->log_match(match_value.mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_rrm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rrm");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rrm := ");
single_value.field_rrm->log_match(match_value.rrm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_mm");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_mm := ");
single_value.field_gprs__mm->log_match(match_value.gprs__mm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_sms:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sms");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sms := ");
single_value.field_sms->log_match(match_value.sms(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gprs_sm");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gprs_sm := ");
single_value.field_gprs__sm->log_match(match_value.gprs__sm(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_ss:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".ss");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ ss := ");
single_value.field_ss->log_match(match_value.ss(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_loc:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".loc");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ loc := ");
single_value.field_loc->log_match(match_value.loc(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ML3__Discr__MS__NW::ALT_reserved:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".reserved");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ reserved := ");
single_value.field_reserved->log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ML3__Discr__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc->set_implicit_omit(); break;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved->set_implicit_omit(); break;
default: break;
}
}

void ML3__Discr__MS__NW_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc->encode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}

void ML3__Discr__MS__NW_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ML3__Discr__MS__NW::UNBOUND_VALUE;
ML3__Discr__MS__NW::union_selection_type new_selection = (ML3__Discr__MS__NW::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc = new OCTETSTRING_template;
single_value.field_gcc->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc = new OCTETSTRING_template;
single_value.field_bcc->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc = new MobileL3__CC__Types::PDU__ML3__CC__MS__NW_template;
single_value.field_cc->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp = new OCTETSTRING_template;
single_value.field_gttp->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm = new MobileL3__MM__Types::PDU__ML3__MM_template;
single_value.field_mm->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm = new MobileL3__RRM__Types::PDU__RRM__MS__NW_template;
single_value.field_rrm->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm = new OCTETSTRING_template;
single_value.field_gprs__mm->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms = new MobileL3__SMS__Types::L3__SMS__MS__SGSN_template;
single_value.field_sms->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm = new OCTETSTRING_template;
single_value.field_gprs__sm->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss = new MobileL3__SS__Types::PDU__ML3__SS__MS__NW_template;
single_value.field_ss->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc = new OCTETSTRING_template;
single_value.field_loc->decode_text(text_buf);
break;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved = new OCTETSTRING_template;
single_value.field_reserved->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ML3__Discr__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_Types.ML3_Discr_MS_NW.");
}
}

boolean ML3__Discr__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ML3__Discr__MS__NW_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void ML3__Discr__MS__NW_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_Types.ML3_Discr_MS_NW'");
    }
    if (strcmp("gcc", param_field) == 0) {
      gcc().set_param(param);
      return;
    } else if (strcmp("bcc", param_field) == 0) {
      bcc().set_param(param);
      return;
    } else if (strcmp("cc", param_field) == 0) {
      cc().set_param(param);
      return;
    } else if (strcmp("gttp", param_field) == 0) {
      gttp().set_param(param);
      return;
    } else if (strcmp("mm", param_field) == 0) {
      mm().set_param(param);
      return;
    } else if (strcmp("rrm", param_field) == 0) {
      rrm().set_param(param);
      return;
    } else if (strcmp("gprs_mm", param_field) == 0) {
      gprs__mm().set_param(param);
      return;
    } else if (strcmp("sms", param_field) == 0) {
      sms().set_param(param);
      return;
    } else if (strcmp("gprs_sm", param_field) == 0) {
      gprs__sm().set_param(param);
      return;
    } else if (strcmp("ss", param_field) == 0) {
      ss().set_param(param);
      return;
    } else if (strcmp("loc", param_field) == 0) {
      loc().set_param(param);
      return;
    } else if (strcmp("reserved", param_field) == 0) {
      reserved().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_Types.ML3_Discr_MS_NW'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ML3__Discr__MS__NW_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_Types.ML3_Discr_MS_NW");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "gcc")) {
      gcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "bcc")) {
      bcc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cc")) {
      cc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gttp")) {
      gttp().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mm")) {
      mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rrm")) {
      rrm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_mm")) {
      gprs__mm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "sms")) {
      sms().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gprs_sm")) {
      gprs__sm().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "ss")) {
      ss().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "loc")) {
      loc().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "reserved")) {
      reserved().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_Types.ML3_Discr_MS_NW.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ML3__Discr__MS__NW_template* precondition = new ML3__Discr__MS__NW_template;
    precondition->set_param(*m_p->get_elem(0));
    ML3__Discr__MS__NW_template* implied_template = new ML3__Discr__MS__NW_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ML3__Discr__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_Types.ML3_Discr_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void ML3__Discr__MS__NW_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case ML3__Discr__MS__NW::ALT_gcc:
single_value.field_gcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_bcc:
single_value.field_bcc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_cc:
single_value.field_cc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_gttp:
single_value.field_gttp->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_mm:
single_value.field_mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_rrm:
single_value.field_rrm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_gprs__mm:
single_value.field_gprs__mm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_sms:
single_value.field_sms->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_gprs__sm:
single_value.field_gprs__sm->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_ss:
single_value.field_ss->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_loc:
single_value.field_loc->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
case ML3__Discr__MS__NW::ALT_reserved:
single_value.field_reserved->check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_Types.ML3_Discr_MS_NW.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.ML3_Discr_MS_NW");
}

PDU__ML3__MS__NW::PDU__ML3__MS__NW()
{
}

PDU__ML3__MS__NW::PDU__ML3__MS__NW(const BITSTRING& par_discriminator,
    const TiOrSkip& par_tiOrSkip,
    const ML3__Discr__MS__NW& par_msgs)
  :   field_discriminator(par_discriminator),
  field_tiOrSkip(par_tiOrSkip),
  field_msgs(par_msgs)
{
}

PDU__ML3__MS__NW::PDU__ML3__MS__NW(const PDU__ML3__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_Types.PDU_ML3_MS_NW.");
if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
else field_discriminator.clean_up();
if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
else field_tiOrSkip.clean_up();
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
}

void PDU__ML3__MS__NW::clean_up()
{
field_discriminator.clean_up();
field_tiOrSkip.clean_up();
field_msgs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__MS__NW::get_descriptor() const { return &PDU__ML3__MS__NW_descr_; }
PDU__ML3__MS__NW& PDU__ML3__MS__NW::operator=(const PDU__ML3__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_Types.PDU_ML3_MS_NW.");
  if (other_value.discriminator().is_bound()) field_discriminator = other_value.discriminator();
  else field_discriminator.clean_up();
  if (other_value.tiOrSkip().is_bound()) field_tiOrSkip = other_value.tiOrSkip();
  else field_tiOrSkip.clean_up();
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
}
return *this;
}

boolean PDU__ML3__MS__NW::operator==(const PDU__ML3__MS__NW& other_value) const
{
return field_discriminator==other_value.field_discriminator
  && field_tiOrSkip==other_value.field_tiOrSkip
  && field_msgs==other_value.field_msgs;
}

boolean PDU__ML3__MS__NW::is_bound() const
{
return (field_discriminator.is_bound())
  || (field_tiOrSkip.is_bound())
  || (field_msgs.is_bound());
}
boolean PDU__ML3__MS__NW::is_value() const
{
return field_discriminator.is_value()
  && field_tiOrSkip.is_value()
  && field_msgs.is_value();
}
void PDU__ML3__MS__NW::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ discriminator := ");
field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__MS__NW::set_implicit_omit()
{
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__ML3__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_Types.PDU_ML3_MS_NW has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_ML3_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_Types.PDU_ML3_MS_NW");
  }
}

void PDU__ML3__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_discriminator.encode_text(text_buf);
field_tiOrSkip.encode_text(text_buf);
field_msgs.encode_text(text_buf);
}

void PDU__ML3__MS__NW::decode_text(Text_Buf& text_buf)
{
field_discriminator.decode_text(text_buf);
field_tiOrSkip.decode_text(text_buf);
field_msgs.decode_text(text_buf);
}

void PDU__ML3__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__ML3__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__ML3__MS__NW::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_discriminator.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_12 || field_discriminator ==  bs_4 || field_discriminator ==  bs_5 || field_discriminator ==  bs_6 || field_discriminator ==  bs_13 || field_discriminator ==  bs_7 || field_discriminator ==  bs_11 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 0;
  else if (field_discriminator ==  bs_1 || field_discriminator ==  bs_2 || field_discriminator ==  bs_3 || field_discriminator ==  bs_8 || field_discriminator ==  bs_10 || field_discriminator ==  bs_9) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__ML3__MS__NW_tiOrSkip_descr_.raw->forceomit);
  decoded_field_length = field_tiOrSkip.RAW_decode(PDU__ML3__MS__NW_tiOrSkip_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_discriminator ==  bs_1) selected_field = 0;
  else if (field_discriminator ==  bs_2) selected_field = 1;
  else if (field_discriminator ==  bs_3) selected_field = 2;
  else if (field_discriminator ==  bs_4) selected_field = 3;
  else if (field_discriminator ==  bs_5) selected_field = 4;
  else if (field_discriminator ==  bs_6) selected_field = 5;
  else if (field_discriminator ==  bs_7) selected_field = 6;
  else if (field_discriminator ==  bs_8) selected_field = 7;
  else if (field_discriminator ==  bs_9) selected_field = 8;
  else if (field_discriminator ==  bs_10) selected_field = 9;
  else if (field_discriminator ==  bs_11) selected_field = 10;
  else if (field_discriminator ==  bs_12 || field_discriminator ==  bs_13 || field_discriminator ==  bs_14 || field_discriminator ==  bs_15 || field_discriminator ==  bs_16) selected_field = 11;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__ML3__MS__NW_msgs_descr_.raw->forceomit);
  decoded_field_length = field_msgs.RAW_decode(PDU__ML3__MS__NW_msgs_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__ML3__MS__NW_tiOrSkip_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__ML3__MS__NW_msgs_descr_.raw);
  encoded_length += field_discriminator.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tiOrSkip.RAW_encode(PDU__ML3__MS__NW_tiOrSkip_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msgs.RAW_encode(PDU__ML3__MS__NW_msgs_descr_, *myleaf.body.node.nodes[2]);
  switch (field_tiOrSkip.get_selection()) {
  case TiOrSkip::ALT_skipIndicator:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_4 && field_discriminator !=  bs_5 && field_discriminator !=  bs_6 && field_discriminator !=  bs_13 && field_discriminator !=  bs_7 && field_discriminator !=  bs_11 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case TiOrSkip::ALT_transactionId:
  if (field_discriminator !=  bs_1 && field_discriminator !=  bs_2 && field_discriminator !=  bs_3 && field_discriminator !=  bs_8 && field_discriminator !=  bs_10 && field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  switch (field_msgs.get_selection()) {
  case ML3__Discr__MS__NW::ALT_gcc:
  if (field_discriminator !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_bcc:
  if (field_discriminator !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_cc:
  if (field_discriminator !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_gttp:
  if (field_discriminator !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_mm:
  if (field_discriminator !=  bs_5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_5.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_rrm:
  if (field_discriminator !=  bs_6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_6.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_gprs__mm:
  if (field_discriminator !=  bs_7) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_7.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_sms:
  if (field_discriminator !=  bs_8) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_8.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_gprs__sm:
  if (field_discriminator !=  bs_9) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_9.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_ss:
  if (field_discriminator !=  bs_10) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_10.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_loc:
  if (field_discriminator !=  bs_11) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_11.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case ML3__Discr__MS__NW::ALT_reserved:
  if (field_discriminator !=  bs_12 && field_discriminator !=  bs_13 && field_discriminator !=  bs_14 && field_discriminator !=  bs_15 && field_discriminator !=  bs_16) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_12.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__MS__NW_template::single_value_struct {
BITSTRING_template field_discriminator;
TiOrSkip_template field_tiOrSkip;
ML3__Discr__MS__NW_template field_msgs;
};

void PDU__ML3__MS__NW_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_discriminator = ANY_VALUE;
single_value->field_tiOrSkip = ANY_VALUE;
single_value->field_msgs = ANY_VALUE;
}
}
}

void PDU__ML3__MS__NW_template::copy_value(const PDU__ML3__MS__NW& other_value)
{
single_value = new single_value_struct;
if (other_value.discriminator().is_bound()) {
  single_value->field_discriminator = other_value.discriminator();
} else {
  single_value->field_discriminator.clean_up();
}
if (other_value.tiOrSkip().is_bound()) {
  single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
  single_value->field_tiOrSkip.clean_up();
}
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__MS__NW_template::copy_template(const PDU__ML3__MS__NW_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.discriminator().get_selection()) {
single_value->field_discriminator = other_value.discriminator();
} else {
single_value->field_discriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tiOrSkip().get_selection()) {
single_value->field_tiOrSkip = other_value.tiOrSkip();
} else {
single_value->field_tiOrSkip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__MS__NW_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template()
{
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(const PDU__ML3__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(const OPTIONAL<PDU__ML3__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_Types.PDU_ML3_MS_NW from an unbound optional field.");
}
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(PDU__ML3__MS__NW_template* p_precondition, PDU__ML3__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(Dynamic_Match_Interface<PDU__ML3__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__MS__NW_template::PDU__ML3__MS__NW_template(const PDU__ML3__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__MS__NW_template::~PDU__ML3__MS__NW_template()
{
clean_up();
}

PDU__ML3__MS__NW_template& PDU__ML3__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__MS__NW_template& PDU__ML3__MS__NW_template::operator=(const PDU__ML3__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__MS__NW_template& PDU__ML3__MS__NW_template::operator=(const OPTIONAL<PDU__ML3__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_Types.PDU_ML3_MS_NW.");
}
return *this;
}

PDU__ML3__MS__NW_template& PDU__ML3__MS__NW_template::operator=(const PDU__ML3__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__MS__NW_template::match(const PDU__ML3__MS__NW& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.discriminator().is_bound()) return FALSE;
if(!single_value->field_discriminator.match(other_value.discriminator(), legacy))return FALSE;
if(!other_value.tiOrSkip().is_bound()) return FALSE;
if(!single_value->field_tiOrSkip.match(other_value.tiOrSkip(), legacy))return FALSE;
if(!other_value.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__MS__NW_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_discriminator.is_bound()
 || single_value->field_tiOrSkip.is_bound()
 || single_value->field_msgs.is_bound();
}

boolean PDU__ML3__MS__NW_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_discriminator.is_value()
 && single_value->field_tiOrSkip.is_value()
 && single_value->field_msgs.is_value();
}

void PDU__ML3__MS__NW_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__MS__NW PDU__ML3__MS__NW_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_Types.PDU_ML3_MS_NW.");
PDU__ML3__MS__NW ret_val;
if (single_value->field_discriminator.is_bound()) {
ret_val.discriminator() = single_value->field_discriminator.valueof();
}
if (single_value->field_tiOrSkip.is_bound()) {
ret_val.tiOrSkip() = single_value->field_tiOrSkip.valueof();
}
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
return ret_val;
}

void PDU__ML3__MS__NW_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_Types.PDU_ML3_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__MS__NW_template[list_length];
}

PDU__ML3__MS__NW_template& PDU__ML3__MS__NW_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_Types.PDU_ML3_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_Types.PDU_ML3_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__MS__NW_template::discriminator()
{
set_specific();
return single_value->field_discriminator;
}

const BITSTRING_template& PDU__ML3__MS__NW_template::discriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field discriminator of a non-specific template of type @MobileL3_Types.PDU_ML3_MS_NW.");
return single_value->field_discriminator;
}

TiOrSkip_template& PDU__ML3__MS__NW_template::tiOrSkip()
{
set_specific();
return single_value->field_tiOrSkip;
}

const TiOrSkip_template& PDU__ML3__MS__NW_template::tiOrSkip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tiOrSkip of a non-specific template of type @MobileL3_Types.PDU_ML3_MS_NW.");
return single_value->field_tiOrSkip;
}

ML3__Discr__MS__NW_template& PDU__ML3__MS__NW_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const ML3__Discr__MS__NW_template& PDU__ML3__MS__NW_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @MobileL3_Types.PDU_ML3_MS_NW.");
return single_value->field_msgs;
}

int PDU__ML3__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_Types.PDU_ML3_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_MS_NW.");
  }
  return 0;
}

void PDU__ML3__MS__NW_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log();
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log();
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__MS__NW_template::log_match(const PDU__ML3__MS__NW& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_discriminator.match(match_value.discriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".discriminator");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tiOrSkip.match(match_value.tiOrSkip(), legacy)){
TTCN_Logger::log_logmatch_info(".tiOrSkip");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ discriminator := ");
single_value->field_discriminator.log_match(match_value.discriminator(), legacy);
TTCN_Logger::log_event_str(", tiOrSkip := ");
single_value->field_tiOrSkip.log_match(match_value.tiOrSkip(), legacy);
TTCN_Logger::log_event_str(", msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__ML3__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (discriminator().is_bound()) discriminator().set_implicit_omit();
if (tiOrSkip().is_bound()) tiOrSkip().set_implicit_omit();
if (msgs().is_bound()) msgs().set_implicit_omit();
}

void PDU__ML3__MS__NW_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_discriminator.encode_text(text_buf);
single_value->field_tiOrSkip.encode_text(text_buf);
single_value->field_msgs.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_Types.PDU_ML3_MS_NW.");
}
}

void PDU__ML3__MS__NW_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_discriminator.decode_text(text_buf);
single_value->field_tiOrSkip.decode_text(text_buf);
single_value->field_msgs.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_Types.PDU_ML3_MS_NW.");
}
}

void PDU__ML3__MS__NW_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_Types.PDU_ML3_MS_NW has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) discriminator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tiOrSkip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msgs().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "discriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          discriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tiOrSkip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tiOrSkip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_Types.PDU_ML3_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__MS__NW_template* precondition = new PDU__ML3__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__MS__NW_template* implied_template = new PDU__ML3__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_Types.PDU_ML3_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__MS__NW_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_discriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_MS_NW");
single_value->field_tiOrSkip.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_MS_NW");
single_value->field_msgs.check_restriction(t_res, t_name ? t_name : "@MobileL3_Types.PDU_ML3_MS_NW");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_Types.PDU_ML3_MS_NW");
}

boolean PDU__ML3__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__MS__NW_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


/* Bodies of functions, altsteps and testcases */

OCTETSTRING enc__PDU__L3__MS__SGSN(const PDU__L3__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_MS_SGSN(): Encoding @MobileL3_Types.PDU_L3_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__L3__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
OCTETSTRING ret_val;
ttcn_buffer.get_string(ret_val);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_MS_SGSN(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

void enc__PDU__L3__MS__SGSN__fast(const PDU__L3__MS__SGSN& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_MS_SGSN_fast(): Encoding @MobileL3_Types.PDU_L3_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__L3__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_MS_SGSN_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

PDU__L3__MS__SGSN dec__PDU__L3__MS__SGSN(const OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_MS_SGSN(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
PDU__L3__MS__SGSN ret_val;
ret_val.decode(PDU__L3__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_MS_SGSN(): Decoded @MobileL3_Types.PDU_L3_MS_SGSN: ");
ret_val.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_L3_MS_SGSN(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

INTEGER dec__PDU__L3__MS__SGSN__backtrack(const OCTETSTRING& stream, PDU__L3__MS__SGSN& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_MS_SGSN_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(PDU__L3__MS__SGSN_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_MS_SGSN_backtrack(): Decoded @MobileL3_Types.PDU_L3_MS_SGSN: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_L3_MS_SGSN_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

OCTETSTRING enc__PDU__L3__SGSN__MS(const PDU__L3__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_SGSN_MS(): Encoding @MobileL3_Types.PDU_L3_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__L3__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
OCTETSTRING ret_val;
ttcn_buffer.get_string(ret_val);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_SGSN_MS(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

void enc__PDU__L3__SGSN__MS__fast(const PDU__L3__SGSN__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_SGSN_MS_fast(): Encoding @MobileL3_Types.PDU_L3_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__L3__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_L3_SGSN_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

PDU__L3__SGSN__MS dec__PDU__L3__SGSN__MS(const OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_SGSN_MS(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
PDU__L3__SGSN__MS ret_val;
ret_val.decode(PDU__L3__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_SGSN_MS(): Decoded @MobileL3_Types.PDU_L3_SGSN_MS: ");
ret_val.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_L3_SGSN_MS(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

INTEGER dec__PDU__L3__SGSN__MS__backtrack(const OCTETSTRING& stream, PDU__L3__SGSN__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_SGSN_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(PDU__L3__SGSN__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_L3_SGSN_MS_backtrack(): Decoded @MobileL3_Types.PDU_L3_SGSN_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_L3_SGSN_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

OCTETSTRING enc__PDU__ML3__NW__MS(const PDU__ML3__NW__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_NW_MS(): Encoding @MobileL3_Types.PDU_ML3_NW_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__ML3__NW__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
OCTETSTRING ret_val;
ttcn_buffer.get_string(ret_val);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_NW_MS(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

void enc__PDU__ML3__NW__MS__fast(const PDU__ML3__NW__MS& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_NW_MS_fast(): Encoding @MobileL3_Types.PDU_ML3_NW_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__ML3__NW__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_NW_MS_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

PDU__ML3__NW__MS dec__PDU__ML3__NW__MS(const OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_NW_MS(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
PDU__ML3__NW__MS ret_val;
ret_val.decode(PDU__ML3__NW__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_NW_MS(): Decoded @MobileL3_Types.PDU_ML3_NW_MS: ");
ret_val.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_ML3_NW_MS(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

INTEGER dec__PDU__ML3__NW__MS__backtrack(const OCTETSTRING& stream, PDU__ML3__NW__MS& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_NW_MS_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(PDU__ML3__NW__MS_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_NW_MS_backtrack(): Decoded @MobileL3_Types.PDU_ML3_NW_MS: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_ML3_NW_MS_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

OCTETSTRING enc__PDU__ML3__MS__NW(const PDU__ML3__MS__NW& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_MS_NW(): Encoding @MobileL3_Types.PDU_ML3_MS_NW: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__ML3__MS__NW_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
OCTETSTRING ret_val;
ttcn_buffer.get_string(ret_val);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_MS_NW(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

void enc__PDU__ML3__MS__NW__fast(const PDU__ML3__MS__NW& pdu, OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_MS_NW_fast(): Encoding @MobileL3_Types.PDU_ML3_MS_NW: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(PDU__ML3__MS__NW_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
ttcn_buffer.get_string(stream);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_PDU_ML3_MS_NW_fast(): Stream after encoding: ");
stream.log();
TTCN_Logger::end_event();
}
}

PDU__ML3__MS__NW dec__PDU__ML3__MS__NW(const OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_MS_NW(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
PDU__ML3__MS__NW ret_val;
ret_val.decode(PDU__ML3__MS__NW_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_MS_NW(): Decoded @MobileL3_Types.PDU_ML3_MS_NW: ");
ret_val.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_ML3_MS_NW(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

INTEGER dec__PDU__ML3__MS__NW__backtrack(const OCTETSTRING& stream, PDU__ML3__MS__NW& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_MS_NW_backtrack(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
pdu.decode(PDU__ML3__MS__NW_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_PDU_ML3_MS_NW_backtrack(): Decoded @MobileL3_Types.PDU_ML3_MS_NW: ");
pdu.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_PDU_ML3_MS_NW_backtrack(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

void L3__TransactionId_tIExtension_encoder(const MobileL3__GMM__SM__Types::TI__Extension& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_GMM_SM_Types.TI_Extension' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__TransactionId_tIExtension_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__TransactionId_tIExtension_decoder(OCTETSTRING& input_stream, MobileL3__GMM__SM__Types::TI__Extension& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_GMM_SM_Types.TI_Extension' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__TransactionId_tIExtension_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__TransactionId_encoder(const L3__TransactionId& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_TransactionId' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__TransactionId_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__TransactionId_decoder(OCTETSTRING& input_stream, L3__TransactionId& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_TransactionId' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__TransactionId_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__TransactionId__not__extended_encoder(const L3__TransactionId__not__extended& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_TransactionId_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__TransactionId__not__extended_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__TransactionId__not__extended_decoder(OCTETSTRING& input_stream, L3__TransactionId__not__extended& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_TransactionId_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__TransactionId__not__extended_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TiOrSkip__not__extended_encoder(const TiOrSkip__not__extended& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TiOrSkip__not__extended_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TiOrSkip__not__extended_decoder(OCTETSTRING& input_stream, TiOrSkip__not__extended& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TiOrSkip__not__extended_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void TiOrSkip_encoder(const TiOrSkip& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_gcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_gcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_bcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_bcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_cc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_cc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_gttp_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_gttp_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_mm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_mm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_rrm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_rrm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_sms_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_sms_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_ss_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_ss_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_loc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_loc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_reserved_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_reserved_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__SGSN__MS_encoder(const L3__Discr__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__Discr__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__SGSN__MS_decoder(OCTETSTRING& input_stream, L3__Discr__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__Discr__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_encoder(const TiOrSkip__not__extended& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip__not__extended& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip_not_extended' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS__unextended__ti_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS__unextended__ti_msgs_encoder(const L3__Discr__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS__unextended__ti_msgs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS__unextended__ti_msgs_decoder(OCTETSTRING& input_stream, L3__Discr__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS__unextended__ti_msgs_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS__unextended__ti_encoder(const PDU__L3__SGSN__MS__unextended__ti& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS__unextended__ti_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS__unextended__ti_decoder(OCTETSTRING& input_stream, PDU__L3__SGSN__MS__unextended__ti& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_SGSN_MS_unextended_ti' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS__unextended__ti_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS_tiOrSkip_encoder(const TiOrSkip& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS_tiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS_msgs_encoder(const L3__Discr__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS_msgs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS_msgs_decoder(OCTETSTRING& input_stream, L3__Discr__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS_msgs_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__SGSN__MS_encoder(const PDU__L3__SGSN__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__SGSN__MS_decoder(OCTETSTRING& input_stream, PDU__L3__SGSN__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_SGSN_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__SGSN__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_gcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_gcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_bcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_bcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_cc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_cc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_gttp_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_gttp_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_mm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_mm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_rrm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_rrm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_sms_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_sms_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_ss_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_ss_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_loc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_loc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_reserved_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_reserved_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void L3__Discr__MS__SGSN_encoder(const L3__Discr__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(L3__Discr__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER L3__Discr__MS__SGSN_decoder(OCTETSTRING& input_stream, L3__Discr__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(L3__Discr__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__MS__SGSN_tiOrSkip_encoder(const TiOrSkip& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__MS__SGSN_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__MS__SGSN_tiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__MS__SGSN_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__MS__SGSN_msgs_encoder(const L3__Discr__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__MS__SGSN_msgs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__MS__SGSN_msgs_decoder(OCTETSTRING& input_stream, L3__Discr__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.L3_Discr_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__MS__SGSN_msgs_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__L3__MS__SGSN_encoder(const PDU__L3__MS__SGSN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__L3__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__L3__MS__SGSN_decoder(OCTETSTRING& input_stream, PDU__L3__MS__SGSN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_L3_MS_SGSN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__L3__MS__SGSN_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_gcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_gcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_bcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_bcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_gttp_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_gttp_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_gprs__mm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_gprs__mm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_gprs__sm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_gprs__sm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_loc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_loc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_reserved_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_reserved_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__NW__MS_encoder(const ML3__Discr__NW__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ML3__Discr__NW__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__NW__MS_decoder(OCTETSTRING& input_stream, ML3__Discr__NW__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ML3__Discr__NW__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__NW__MS_tiOrSkip_encoder(const TiOrSkip& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__NW__MS_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__NW__MS_tiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__NW__MS_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__NW__MS_msgs_encoder(const ML3__Discr__NW__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__NW__MS_msgs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__NW__MS_msgs_decoder(OCTETSTRING& input_stream, ML3__Discr__NW__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__NW__MS_msgs_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__NW__MS_encoder(const PDU__ML3__NW__MS& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_ML3_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__NW__MS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__NW__MS_decoder(OCTETSTRING& input_stream, PDU__ML3__NW__MS& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_ML3_NW_MS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__NW__MS_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_gcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_gcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_bcc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_bcc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_gttp_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_gttp_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_gprs__mm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_gprs__mm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_gprs__sm_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_gprs__sm_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_loc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_loc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_reserved_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_reserved_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void ML3__Discr__MS__NW_encoder(const ML3__Discr__MS__NW& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ML3__Discr__MS__NW_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ML3__Discr__MS__NW_decoder(OCTETSTRING& input_stream, ML3__Discr__MS__NW& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ML3__Discr__MS__NW_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MS__NW_tiOrSkip_encoder(const TiOrSkip& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MS__NW_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MS__NW_tiOrSkip_decoder(OCTETSTRING& input_stream, TiOrSkip& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.TiOrSkip' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MS__NW_tiOrSkip_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MS__NW_msgs_encoder(const ML3__Discr__MS__NW& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MS__NW_msgs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MS__NW_msgs_decoder(OCTETSTRING& input_stream, ML3__Discr__MS__NW& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.ML3_Discr_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MS__NW_msgs_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void PDU__ML3__MS__NW_encoder(const PDU__ML3__MS__NW& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_ML3_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__ML3__MS__NW_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__ML3__MS__NW_decoder(OCTETSTRING& input_stream, PDU__ML3__MS__NW& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@MobileL3_Types.PDU_ML3_MS_NW' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__ML3__MS__NW_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("MobileL3_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_Types");
MobileL3__CC__Types::module_object.pre_init_module();
MobileL3__RRM__Types::module_object.pre_init_module();
MobileL3__SMS__Types::module_object.pre_init_module();
MobileL3__SS__Types::module_object.pre_init_module();
module_object.add_function("enc_PDU_L3_MS_SGSN", (genericfunc_t)&enc__PDU__L3__MS__SGSN, NULL);
module_object.add_function("enc_PDU_L3_MS_SGSN_fast", (genericfunc_t)&enc__PDU__L3__MS__SGSN__fast, NULL);
module_object.add_function("dec_PDU_L3_MS_SGSN", (genericfunc_t)&dec__PDU__L3__MS__SGSN, NULL);
module_object.add_function("dec_PDU_L3_MS_SGSN_backtrack", (genericfunc_t)&dec__PDU__L3__MS__SGSN__backtrack, NULL);
module_object.add_function("enc_PDU_L3_SGSN_MS", (genericfunc_t)&enc__PDU__L3__SGSN__MS, NULL);
module_object.add_function("enc_PDU_L3_SGSN_MS_fast", (genericfunc_t)&enc__PDU__L3__SGSN__MS__fast, NULL);
module_object.add_function("dec_PDU_L3_SGSN_MS", (genericfunc_t)&dec__PDU__L3__SGSN__MS, NULL);
module_object.add_function("dec_PDU_L3_SGSN_MS_backtrack", (genericfunc_t)&dec__PDU__L3__SGSN__MS__backtrack, NULL);
module_object.add_function("enc_PDU_ML3_NW_MS", (genericfunc_t)&enc__PDU__ML3__NW__MS, NULL);
module_object.add_function("enc_PDU_ML3_NW_MS_fast", (genericfunc_t)&enc__PDU__ML3__NW__MS__fast, NULL);
module_object.add_function("dec_PDU_ML3_NW_MS", (genericfunc_t)&dec__PDU__ML3__NW__MS, NULL);
module_object.add_function("dec_PDU_ML3_NW_MS_backtrack", (genericfunc_t)&dec__PDU__ML3__NW__MS__backtrack, NULL);
module_object.add_function("enc_PDU_ML3_MS_NW", (genericfunc_t)&enc__PDU__ML3__MS__NW, NULL);
module_object.add_function("enc_PDU_ML3_MS_NW_fast", (genericfunc_t)&enc__PDU__ML3__MS__NW__fast, NULL);
module_object.add_function("dec_PDU_ML3_MS_NW", (genericfunc_t)&dec__PDU__ML3__MS__NW, NULL);
module_object.add_function("dec_PDU_ML3_MS_NW_backtrack", (genericfunc_t)&dec__PDU__ML3__MS__NW__backtrack, NULL);
}

void post_init_module()
{
TTCN_Location current_location("MobileL3_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MobileL3_Types");
MobileL3__CC__Types::module_object.post_init_module();
MobileL3__RRM__Types::module_object.post_init_module();
MobileL3__SMS__Types::module_object.post_init_module();
MobileL3__SS__Types::module_object.post_init_module();
}


} /* end of namespace */
