// 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 "OSMUX_Types.hh"

namespace OSMUX__Types {

/* Literal string constants */

extern const OCTETSTRING os_0(0, NULL);
extern const CHARSTRING cs_0(16, "OSMUX_Types.ttcn"),
cs_1(9, "nth > ctr"),
cs_2(23, "osmux payload too short");
const unsigned char module_checksum[] = { 0xe9, 0x27, 0x9b, 0xe4, 0x50, 0x88, 0x2a, 0x83, 0x1a, 0x55, 0x0e, 0xd1, 0xe2, 0x86, 0xbb, 0x8d };

/* Global variable definitions */

const XERdescriptor_t       OsmuxCID_xer_ = { {"OsmuxCID>\n", "OsmuxCID>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxCID_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxCID_descr_ = { "@OSMUX_Types.OsmuxCID", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &OsmuxCID_xer_, &INTEGER_json_, &OsmuxCID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxCID_default_coding("RAW");
const TTCN_RAWdescriptor_t OsmuxFT_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 OsmuxFT
const TTCN_Typedescriptor_t OsmuxFT_descr_ = { "@OSMUX_Types.OsmuxFT", NULL, &OsmuxFT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxFT_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_marker_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_marker_xer_ = { {"marker>\n", "marker>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_marker_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_marker_descr_ = { "@OSMUX_Types.Osmux_AMR_header.marker", &BITSTRING_ber_, &Osmux__AMR__header_marker_raw_, NULL, &Osmux__AMR__header_marker_xer_, &BITSTRING_json_, &Osmux__AMR__header_marker_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_marker_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_ft_raw_ = {2,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_ft_xer_ = { {"ft>\n", "ft>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_ft_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_ft_descr_ = { "@OSMUX_Types.Osmux_AMR_header.ft", &INTEGER_ber_, &Osmux__AMR__header_ft_raw_, &INTEGER_text_, &Osmux__AMR__header_ft_xer_, &INTEGER_json_, &Osmux__AMR__header_ft_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_ft_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_ctr_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_ctr_xer_ = { {"ctr>\n", "ctr>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_ctr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_ctr_descr_ = { "@OSMUX_Types.Osmux_AMR_header.ctr", &INTEGER_ber_, &Osmux__AMR__header_ctr_raw_, &INTEGER_text_, &Osmux__AMR__header_ctr_xer_, &INTEGER_json_, &Osmux__AMR__header_ctr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_ctr_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_amr__f_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_amr__f_xer_ = { {"amr_f>\n", "amr_f>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_amr__f_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_amr__f_descr_ = { "@OSMUX_Types.Osmux_AMR_header.amr_f", &BITSTRING_ber_, &Osmux__AMR__header_amr__f_raw_, NULL, &Osmux__AMR__header_amr__f_xer_, &BITSTRING_json_, &Osmux__AMR__header_amr__f_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_amr__f_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_amr__q_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_amr__q_xer_ = { {"amr_q>\n", "amr_q>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_amr__q_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_amr__q_descr_ = { "@OSMUX_Types.Osmux_AMR_header.amr_q", &BITSTRING_ber_, &Osmux__AMR__header_amr__q_raw_, NULL, &Osmux__AMR__header_amr__q_xer_, &BITSTRING_json_, &Osmux__AMR__header_amr__q_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_amr__q_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_seq_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_seq_xer_ = { {"seq>\n", "seq>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_seq_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_seq_descr_ = { "@OSMUX_Types.Osmux_AMR_header.seq", &INTEGER_ber_, &Osmux__AMR__header_seq_raw_, &INTEGER_text_, &Osmux__AMR__header_seq_xer_, &INTEGER_json_, &Osmux__AMR__header_seq_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_seq_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_cid_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_cid_xer_ = { {"cid>\n", "cid>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_cid_descr_ = { "@OSMUX_Types.Osmux_AMR_header.cid", &INTEGER_ber_, &Osmux__AMR__header_cid_raw_, &INTEGER_text_, &Osmux__AMR__header_cid_xer_, &INTEGER_json_, &Osmux__AMR__header_cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_cid_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_amr__ft_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_amr__ft_xer_ = { {"amr_ft>\n", "amr_ft>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_amr__ft_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_amr__ft_descr_ = { "@OSMUX_Types.Osmux_AMR_header.amr_ft", &INTEGER_ber_, &Osmux__AMR__header_amr__ft_raw_, &INTEGER_text_, &Osmux__AMR__header_amr__ft_xer_, &INTEGER_json_, &Osmux__AMR__header_amr__ft_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_amr__ft_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_amr__cmr_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Osmux__AMR__header_amr__cmr_xer_ = { {"amr_cmr>\n", "amr_cmr>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Osmux__AMR__header_amr__cmr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Osmux__AMR__header_amr__cmr_descr_ = { "@OSMUX_Types.Osmux_AMR_header.amr_cmr", &INTEGER_ber_, &Osmux__AMR__header_amr__cmr_raw_, &INTEGER_text_, &Osmux__AMR__header_amr__cmr_xer_, &INTEGER_json_, &Osmux__AMR__header_amr__cmr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_amr__cmr_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__AMR__header_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Osmux__AMR__header
const TTCN_Typedescriptor_t Osmux__AMR__header_descr_ = { "@OSMUX_Types.Osmux_AMR_header", NULL, &Osmux__AMR__header_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__AMR__header_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__AMR_header_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__Osmux__AMR_header
const TTCN_Typedescriptor_t PDU__Osmux__AMR_header_descr_ = { "@OSMUX_Types.PDU_Osmux_AMR.header", NULL, &PDU__Osmux__AMR_header_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__AMR_header_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__AMR_data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__Osmux__AMR_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__Osmux__AMR_data_oer_ext_arr_[0] = {};
const int PDU__Osmux__AMR_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__Osmux__AMR_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__Osmux__AMR_data_oer_ext_arr_, 0, PDU__Osmux__AMR_data_oer_p_};
const TTCN_Typedescriptor_t PDU__Osmux__AMR_data_descr_ = { "@OSMUX_Types.PDU_Osmux_AMR.data", &OCTETSTRING_ber_, &PDU__Osmux__AMR_data_raw_, &OCTETSTRING_text_, &PDU__Osmux__AMR_data_xer_, &OCTETSTRING_json_, &PDU__Osmux__AMR_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__AMR_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__AMR_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__Osmux__AMR
const TTCN_Typedescriptor_t PDU__Osmux__AMR_descr_ = { "@OSMUX_Types.PDU_Osmux_AMR", NULL, &PDU__Osmux__AMR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__AMR_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__DUMMY_header_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__Osmux__DUMMY_header
const TTCN_Typedescriptor_t PDU__Osmux__DUMMY_header_descr_ = { "@OSMUX_Types.PDU_Osmux_DUMMY.header", NULL, &PDU__Osmux__DUMMY_header_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__DUMMY_header_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__DUMMY_data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__Osmux__DUMMY_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__Osmux__DUMMY_data_oer_ext_arr_[0] = {};
const int PDU__Osmux__DUMMY_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__Osmux__DUMMY_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__Osmux__DUMMY_data_oer_ext_arr_, 0, PDU__Osmux__DUMMY_data_oer_p_};
const TTCN_Typedescriptor_t PDU__Osmux__DUMMY_data_descr_ = { "@OSMUX_Types.PDU_Osmux_DUMMY.data", &OCTETSTRING_ber_, &PDU__Osmux__DUMMY_data_raw_, &OCTETSTRING_text_, &PDU__Osmux__DUMMY_data_xer_, &OCTETSTRING_json_, &PDU__Osmux__DUMMY_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__DUMMY_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__Osmux__DUMMY_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__Osmux__DUMMY
const TTCN_Typedescriptor_t PDU__Osmux__DUMMY_descr_ = { "@OSMUX_Types.PDU_Osmux_DUMMY", NULL, &PDU__Osmux__DUMMY_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__Osmux__DUMMY_default_coding("RAW");
const TTCN_RAWdescriptor_t Osmux__session__par_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 Osmux__session__par
const TTCN_Typedescriptor_t Osmux__session__par_descr_ = { "@OSMUX_Types.Osmux_session_par", NULL, &Osmux__session__par_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Osmux__session__par_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Osmux__session__par_id_descr_ = { "@OSMUX_Types.Osmux_session_par.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Osmux__session__par_id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__session__par_id_default_coding("RAW");
const XERdescriptor_t       Osmux__session__par_local__address_xer_ = { {"local_address>\n", "local_address>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Osmux__session__par_local__address_descr_ = { "@OSMUX_Types.Osmux_session_par.local_address", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Osmux__session__par_local__address_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__session__par_local__address_default_coding("RAW");
const XERdescriptor_t       Osmux__session__par_local__port_xer_ = { {"local_port>\n", "local_port>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Osmux__session__par_local__port_descr_ = { "@OSMUX_Types.Osmux_session_par.local_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Osmux__session__par_local__port_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__session__par_local__port_default_coding("RAW");
const XERdescriptor_t       Osmux__session__par_dest__address_xer_ = { {"dest_address>\n", "dest_address>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Osmux__session__par_dest__address_descr_ = { "@OSMUX_Types.Osmux_session_par.dest_address", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Osmux__session__par_dest__address_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__session__par_dest__address_default_coding("RAW");
const XERdescriptor_t       Osmux__session__par_dest__port_xer_ = { {"dest_port>\n", "dest_port>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Osmux__session__par_dest__port_descr_ = { "@OSMUX_Types.Osmux_session_par.dest_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Osmux__session__par_dest__port_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Osmux__session__par_dest__port_default_coding("RAW");
UNIVERSAL_CHARSTRING Osmux__session__par_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__Osmux__Open__session_session__id_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__Osmux__Open__session_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 ASP__Osmux__Open__session
const TTCN_Typedescriptor_t ASP__Osmux__Open__session_descr_ = { "@OSMUX_Types.ASP_Osmux_Open_session", NULL, &ASP__Osmux__Open__session_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__Osmux__Open__session_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__Osmux__Open__session__result_session__id_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__Osmux__Open__session__result_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 ASP__Osmux__Open__session__result
const TTCN_Typedescriptor_t ASP__Osmux__Open__session__result_descr_ = { "@OSMUX_Types.ASP_Osmux_Open_session_result", NULL, &ASP__Osmux__Open__session__result_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__Osmux__Open__session__result_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__Osmux__Close__session_session__id_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__Osmux__Close__session_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 ASP__Osmux__Close__session
const TTCN_Typedescriptor_t ASP__Osmux__Close__session_descr_ = { "@OSMUX_Types.ASP_Osmux_Close_session", NULL, &ASP__Osmux__Close__session_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__Osmux__Close__session_default_coding("RAW");
const TTCN_RAWdescriptor_t OSMUX__PDU_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 OSMUX__PDU
const TTCN_Typedescriptor_t OSMUX__PDU_descr_ = { "@OSMUX_Types.OSMUX_PDU", NULL, &OSMUX__PDU_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OSMUX__PDU_osmux__amr_default_coding("RAW");
UNIVERSAL_CHARSTRING OSMUX__PDU_osmux__dummy_default_coding("RAW");
UNIVERSAL_CHARSTRING OSMUX__PDU_default_coding("RAW");
BITSTRING_template template_tr__PDU__Osmux__AMR_marker_defval;
const BITSTRING_template& tr__PDU__Osmux__AMR_marker_defval = template_tr__PDU__Osmux__AMR_marker_defval;
INTEGER_template template_tr__PDU__Osmux__AMR_ctr_defval;
const INTEGER_template& tr__PDU__Osmux__AMR_ctr_defval = template_tr__PDU__Osmux__AMR_ctr_defval;
BITSTRING_template template_tr__PDU__Osmux__AMR_amr__f_defval;
const BITSTRING_template& tr__PDU__Osmux__AMR_amr__f_defval = template_tr__PDU__Osmux__AMR_amr__f_defval;
BITSTRING_template template_tr__PDU__Osmux__AMR_amr__q_defval;
const BITSTRING_template& tr__PDU__Osmux__AMR_amr__q_defval = template_tr__PDU__Osmux__AMR_amr__q_defval;
INTEGER_template template_tr__PDU__Osmux__AMR_seq_defval;
const INTEGER_template& tr__PDU__Osmux__AMR_seq_defval = template_tr__PDU__Osmux__AMR_seq_defval;
INTEGER_template template_tr__PDU__Osmux__AMR_cid_defval;
const INTEGER_template& tr__PDU__Osmux__AMR_cid_defval = template_tr__PDU__Osmux__AMR_cid_defval;
INTEGER_template template_tr__PDU__Osmux__AMR_amr__ft_defval;
const INTEGER_template& tr__PDU__Osmux__AMR_amr__ft_defval = template_tr__PDU__Osmux__AMR_amr__ft_defval;
INTEGER_template template_tr__PDU__Osmux__AMR_amr__cmr_defval;
const INTEGER_template& tr__PDU__Osmux__AMR_amr__cmr_defval = template_tr__PDU__Osmux__AMR_amr__cmr_defval;
OCTETSTRING_template template_tr__PDU__Osmux__AMR_payload_defval;
const OCTETSTRING_template& tr__PDU__Osmux__AMR_payload_defval = template_tr__PDU__Osmux__AMR_payload_defval;
TTCN_Module module_object("OSMUX_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 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 */

OsmuxFT::OsmuxFT()
{
enum_value = UNBOUND_VALUE;
}

OsmuxFT::OsmuxFT(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @OSMUX_Types.OsmuxFT with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

OsmuxFT::OsmuxFT(enum_type other_value)
{
enum_value = other_value;
}

OsmuxFT::OsmuxFT(const OsmuxFT& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
enum_value = other_value.enum_value;
}

OsmuxFT& OsmuxFT::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @OSMUX_Types.OsmuxFT.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

OsmuxFT& OsmuxFT::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

OsmuxFT& OsmuxFT::operator=(const OsmuxFT& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
enum_value = other_value.enum_value;
return *this;
}

boolean OsmuxFT::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @OSMUX_Types.OsmuxFT comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean OsmuxFT::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value == other_value;
}

boolean OsmuxFT::operator==(const OsmuxFT& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value == other_value.enum_value;
}

boolean OsmuxFT::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @OSMUX_Types.OsmuxFT comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean OsmuxFT::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value < other_value;
}

boolean OsmuxFT::operator<(const OsmuxFT& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value < other_value.enum_value;
}

boolean OsmuxFT::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @OSMUX_Types.OsmuxFT comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean OsmuxFT::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value > other_value;
}

boolean OsmuxFT::operator>(const OsmuxFT& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value > other_value.enum_value;
}

const char *OsmuxFT::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case OSMUX__FT__LAPD: return "OSMUX_FT_LAPD";
case OSMUX__FT__AMR: return "OSMUX_FT_AMR";
case OSMUX__FT__DUMMY: return "OSMUX_FT_DUMMY";
default:
return "<unknown>";
}
}

OsmuxFT::enum_type OsmuxFT::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "OSMUX_FT_LAPD")) return OSMUX__FT__LAPD;
if (!strcmp(str_par, "OSMUX_FT_AMR")) return OSMUX__FT__AMR;
if (!strcmp(str_par, "OSMUX_FT_DUMMY")) return OSMUX__FT__DUMMY;
}
return UNKNOWN_VALUE;
}

boolean OsmuxFT::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int OsmuxFT::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @OSMUX_Types.OsmuxFT.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int OsmuxFT::enum2int(const OsmuxFT& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @OSMUX_Types.OsmuxFT.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void OsmuxFT::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @OSMUX_Types.OsmuxFT.", int_val);
enum_value = (enum_type)int_val;
}

OsmuxFT::operator OsmuxFT::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @OSMUX_Types.OsmuxFT.");
return enum_value;
}

void OsmuxFT::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void OsmuxFT::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@OSMUX_Types.OsmuxFT");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @OSMUX_Types.OsmuxFT.");
  }
}

void OsmuxFT::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
text_buf.push_int(enum_value);
}

void OsmuxFT::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @OSMUX_Types.OsmuxFT.", enum_value);
}

void OsmuxFT::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 OsmuxFT::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 OsmuxFT::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int OsmuxFT::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void OsmuxFT_template::copy_template(const OsmuxFT_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
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 OsmuxFT_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 OsmuxFT_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxFT_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 enumerated type @OSMUX_Types.OsmuxFT.");
}
}

OsmuxFT_template::OsmuxFT_template()
{
}

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

OsmuxFT_template::OsmuxFT_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!OsmuxFT::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @OSMUX_Types.OsmuxFT with unknown numeric value %d.", other_value);
single_value = (OsmuxFT::enum_type)other_value;
}

OsmuxFT_template::OsmuxFT_template(OsmuxFT::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

OsmuxFT_template::OsmuxFT_template(const OsmuxFT& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == OsmuxFT::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @OSMUX_Types.OsmuxFT.");
single_value = other_value.enum_value;
}

OsmuxFT_template::OsmuxFT_template(const OPTIONAL<OsmuxFT>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (OsmuxFT::enum_type)(const OsmuxFT&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @OSMUX_Types.OsmuxFT from an unbound optional field.");
}
}

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

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

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

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

boolean OsmuxFT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean OsmuxFT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != OsmuxFT::UNBOUND_VALUE;
}

void OsmuxFT_template::clean_up()
{
switch (template_selection) {
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;
}

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

OsmuxFT_template& OsmuxFT_template::operator=(int other_value)
{
if (!OsmuxFT::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @OSMUX_Types.OsmuxFT.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (OsmuxFT::enum_type)other_value;
return *this;
}

OsmuxFT_template& OsmuxFT_template::operator=(OsmuxFT::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

OsmuxFT_template& OsmuxFT_template::operator=(const OsmuxFT& other_value)
{
if (other_value.enum_value == OsmuxFT::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @OSMUX_Types.OsmuxFT to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

OsmuxFT_template& OsmuxFT_template::operator=(const OPTIONAL<OsmuxFT>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (OsmuxFT::enum_type)(const OsmuxFT&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @OSMUX_Types.OsmuxFT.");
}
return *this;
}

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

boolean OsmuxFT_template::match(OsmuxFT::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
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)) 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 enumerated type @OSMUX_Types.OsmuxFT.");
}
return FALSE;
}

boolean OsmuxFT_template::match(const OsmuxFT& other_value, boolean) const
{
if (other_value.enum_value == OsmuxFT::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @OSMUX_Types.OsmuxFT with an unbound value.");
return match(other_value.enum_value);
}

OsmuxFT::enum_type OsmuxFT_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @OSMUX_Types.OsmuxFT.");
return single_value;
}

void OsmuxFT_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new OsmuxFT_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @OSMUX_Types.OsmuxFT.");
}
}

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

void OsmuxFT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(OsmuxFT::enum_to_str(single_value), single_value);
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 elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_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 OsmuxFT_template::log_match(const OsmuxFT& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void OsmuxFT_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);
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 elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @OSMUX_Types.OsmuxFT.");
}
}

void OsmuxFT_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (OsmuxFT::enum_type)text_buf.pull_int().get_val();
if (!OsmuxFT::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @OSMUX_Types.OsmuxFT.", single_value);
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 OsmuxFT_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @OSMUX_Types.OsmuxFT.");
}
}

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

boolean OsmuxFT_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 i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void OsmuxFT_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated 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: {
    OsmuxFT_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_Enumerated: {
    OsmuxFT::enum_type enum_val = OsmuxFT::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!OsmuxFT::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @OSMUX_Types.OsmuxFT.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmuxFT_template* precondition = new OsmuxFT_template;
    precondition->set_param(*m_p->get_elem(0));
    OsmuxFT_template* implied_template = new OsmuxFT_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = OsmuxFT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@OSMUX_Types.OsmuxFT");
  }
  is_ifpresent = param.get_ifpresent();
}

void OsmuxFT_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_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
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 : "@OSMUX_Types.OsmuxFT");
}

Osmux__AMR__header::Osmux__AMR__header()
{
}

Osmux__AMR__header::Osmux__AMR__header(const BITSTRING& par_marker,
    const INTEGER& par_ft,
    const INTEGER& par_ctr,
    const BITSTRING& par_amr__f,
    const BITSTRING& par_amr__q,
    const INTEGER& par_seq,
    const INTEGER& par_cid,
    const INTEGER& par_amr__ft,
    const INTEGER& par_amr__cmr)
  :   field_marker(par_marker),
  field_ft(par_ft),
  field_ctr(par_ctr),
  field_amr__f(par_amr__f),
  field_amr__q(par_amr__q),
  field_seq(par_seq),
  field_cid(par_cid),
  field_amr__ft(par_amr__ft),
  field_amr__cmr(par_amr__cmr)
{
}

Osmux__AMR__header::Osmux__AMR__header(const Osmux__AMR__header& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.Osmux_AMR_header.");
if (other_value.marker().is_bound()) field_marker = other_value.marker();
else field_marker.clean_up();
if (other_value.ft().is_bound()) field_ft = other_value.ft();
else field_ft.clean_up();
if (other_value.ctr().is_bound()) field_ctr = other_value.ctr();
else field_ctr.clean_up();
if (other_value.amr__f().is_bound()) field_amr__f = other_value.amr__f();
else field_amr__f.clean_up();
if (other_value.amr__q().is_bound()) field_amr__q = other_value.amr__q();
else field_amr__q.clean_up();
if (other_value.seq().is_bound()) field_seq = other_value.seq();
else field_seq.clean_up();
if (other_value.cid().is_bound()) field_cid = other_value.cid();
else field_cid.clean_up();
if (other_value.amr__ft().is_bound()) field_amr__ft = other_value.amr__ft();
else field_amr__ft.clean_up();
if (other_value.amr__cmr().is_bound()) field_amr__cmr = other_value.amr__cmr();
else field_amr__cmr.clean_up();
}

void Osmux__AMR__header::clean_up()
{
field_marker.clean_up();
field_ft.clean_up();
field_ctr.clean_up();
field_amr__f.clean_up();
field_amr__q.clean_up();
field_seq.clean_up();
field_cid.clean_up();
field_amr__ft.clean_up();
field_amr__cmr.clean_up();
}

const TTCN_Typedescriptor_t* Osmux__AMR__header::get_descriptor() const { return &Osmux__AMR__header_descr_; }
Osmux__AMR__header& Osmux__AMR__header::operator=(const Osmux__AMR__header& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.Osmux_AMR_header.");
  if (other_value.marker().is_bound()) field_marker = other_value.marker();
  else field_marker.clean_up();
  if (other_value.ft().is_bound()) field_ft = other_value.ft();
  else field_ft.clean_up();
  if (other_value.ctr().is_bound()) field_ctr = other_value.ctr();
  else field_ctr.clean_up();
  if (other_value.amr__f().is_bound()) field_amr__f = other_value.amr__f();
  else field_amr__f.clean_up();
  if (other_value.amr__q().is_bound()) field_amr__q = other_value.amr__q();
  else field_amr__q.clean_up();
  if (other_value.seq().is_bound()) field_seq = other_value.seq();
  else field_seq.clean_up();
  if (other_value.cid().is_bound()) field_cid = other_value.cid();
  else field_cid.clean_up();
  if (other_value.amr__ft().is_bound()) field_amr__ft = other_value.amr__ft();
  else field_amr__ft.clean_up();
  if (other_value.amr__cmr().is_bound()) field_amr__cmr = other_value.amr__cmr();
  else field_amr__cmr.clean_up();
}
return *this;
}

boolean Osmux__AMR__header::operator==(const Osmux__AMR__header& other_value) const
{
return field_marker==other_value.field_marker
  && field_ft==other_value.field_ft
  && field_ctr==other_value.field_ctr
  && field_amr__f==other_value.field_amr__f
  && field_amr__q==other_value.field_amr__q
  && field_seq==other_value.field_seq
  && field_cid==other_value.field_cid
  && field_amr__ft==other_value.field_amr__ft
  && field_amr__cmr==other_value.field_amr__cmr;
}

boolean Osmux__AMR__header::is_bound() const
{
return (field_marker.is_bound())
  || (field_ft.is_bound())
  || (field_ctr.is_bound())
  || (field_amr__f.is_bound())
  || (field_amr__q.is_bound())
  || (field_seq.is_bound())
  || (field_cid.is_bound())
  || (field_amr__ft.is_bound())
  || (field_amr__cmr.is_bound());
}
boolean Osmux__AMR__header::is_value() const
{
return field_marker.is_value()
  && field_ft.is_value()
  && field_ctr.is_value()
  && field_amr__f.is_value()
  && field_amr__q.is_value()
  && field_seq.is_value()
  && field_cid.is_value()
  && field_amr__ft.is_value()
  && field_amr__cmr.is_value();
}
void Osmux__AMR__header::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ marker := ");
field_marker.log();
TTCN_Logger::log_event_str(", ft := ");
field_ft.log();
TTCN_Logger::log_event_str(", ctr := ");
field_ctr.log();
TTCN_Logger::log_event_str(", amr_f := ");
field_amr__f.log();
TTCN_Logger::log_event_str(", amr_q := ");
field_amr__q.log();
TTCN_Logger::log_event_str(", seq := ");
field_seq.log();
TTCN_Logger::log_event_str(", cid := ");
field_cid.log();
TTCN_Logger::log_event_str(", amr_ft := ");
field_amr__ft.log();
TTCN_Logger::log_event_str(", amr_cmr := ");
field_amr__cmr.log();
TTCN_Logger::log_event_str(" }");
}

void Osmux__AMR__header::set_implicit_omit()
{
if (marker().is_bound()) marker().set_implicit_omit();
if (ft().is_bound()) ft().set_implicit_omit();
if (ctr().is_bound()) ctr().set_implicit_omit();
if (amr__f().is_bound()) amr__f().set_implicit_omit();
if (amr__q().is_bound()) amr__q().set_implicit_omit();
if (seq().is_bound()) seq().set_implicit_omit();
if (cid().is_bound()) cid().set_implicit_omit();
if (amr__ft().is_bound()) amr__ft().set_implicit_omit();
if (amr__cmr().is_bound()) amr__cmr().set_implicit_omit();
}

void Osmux__AMR__header::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 (9<param.get_size()) {
      param.error("record value of type @OSMUX_Types.Osmux_AMR_header has 9 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) marker().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ft().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ctr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) amr__f().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) amr__q().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) seq().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) amr__ft().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) amr__cmr().set_param(*param.get_elem(8));
    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(), "marker")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          marker().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(), "ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ft().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(), "ctr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ctr().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(), "amr_f")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__f().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(), "amr_q")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__q().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(), "seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "amr_ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__ft().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(), "amr_cmr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__cmr().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 @OSMUX_Types.Osmux_AMR_header: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.Osmux_AMR_header");
  }
}

void Osmux__AMR__header::encode_text(Text_Buf& text_buf) const
{
field_marker.encode_text(text_buf);
field_ft.encode_text(text_buf);
field_ctr.encode_text(text_buf);
field_amr__f.encode_text(text_buf);
field_amr__q.encode_text(text_buf);
field_seq.encode_text(text_buf);
field_cid.encode_text(text_buf);
field_amr__ft.encode_text(text_buf);
field_amr__cmr.encode_text(text_buf);
}

void Osmux__AMR__header::decode_text(Text_Buf& text_buf)
{
field_marker.decode_text(text_buf);
field_ft.decode_text(text_buf);
field_ctr.decode_text(text_buf);
field_amr__f.decode_text(text_buf);
field_amr__q.decode_text(text_buf);
field_seq.decode_text(text_buf);
field_cid.decode_text(text_buf);
field_amr__ft.decode_text(text_buf);
field_amr__cmr.decode_text(text_buf);
}

void Osmux__AMR__header::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 Osmux__AMR__header::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 Osmux__AMR__header::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, Osmux__AMR__header_marker_descr_.raw->forceomit);
  decoded_field_length = field_marker.RAW_decode(Osmux__AMR__header_marker_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, Osmux__AMR__header_ft_descr_.raw->forceomit);
  decoded_field_length = field_ft.RAW_decode(Osmux__AMR__header_ft_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());
  RAW_Force_Omit field_2_force_omit(2, force_omit, Osmux__AMR__header_ctr_descr_.raw->forceomit);
  decoded_field_length = field_ctr.RAW_decode(Osmux__AMR__header_ctr_descr_, p_buf, limit, local_top_order, no_err, -1, 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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, Osmux__AMR__header_amr__f_descr_.raw->forceomit);
  decoded_field_length = field_amr__f.RAW_decode(Osmux__AMR__header_amr__f_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_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_4_force_omit(4, force_omit, Osmux__AMR__header_amr__q_descr_.raw->forceomit);
  decoded_field_length = field_amr__q.RAW_decode(Osmux__AMR__header_amr__q_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_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_5_force_omit(5, force_omit, Osmux__AMR__header_seq_descr_.raw->forceomit);
  decoded_field_length = field_seq.RAW_decode(Osmux__AMR__header_seq_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_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_6_force_omit(6, force_omit, Osmux__AMR__header_cid_descr_.raw->forceomit);
  decoded_field_length = field_cid.RAW_decode(Osmux__AMR__header_cid_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_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_7_force_omit(7, force_omit, Osmux__AMR__header_amr__ft_descr_.raw->forceomit);
  decoded_field_length = field_amr__ft.RAW_decode(Osmux__AMR__header_amr__ft_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_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_8_force_omit(8, force_omit, Osmux__AMR__header_amr__cmr_descr_.raw->forceomit);
  decoded_field_length = field_amr__cmr.RAW_decode(Osmux__AMR__header_amr__cmr_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_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 Osmux__AMR__header::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 = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, Osmux__AMR__header_marker_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Osmux__AMR__header_ft_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Osmux__AMR__header_ctr_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Osmux__AMR__header_amr__f_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Osmux__AMR__header_amr__q_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Osmux__AMR__header_seq_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Osmux__AMR__header_cid_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Osmux__AMR__header_amr__ft_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Osmux__AMR__header_amr__cmr_descr_.raw);
  encoded_length += field_marker.RAW_encode(Osmux__AMR__header_marker_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ft.RAW_encode(Osmux__AMR__header_ft_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_ctr.RAW_encode(Osmux__AMR__header_ctr_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_amr__f.RAW_encode(Osmux__AMR__header_amr__f_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_amr__q.RAW_encode(Osmux__AMR__header_amr__q_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_seq.RAW_encode(Osmux__AMR__header_seq_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_cid.RAW_encode(Osmux__AMR__header_cid_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_amr__ft.RAW_encode(Osmux__AMR__header_amr__ft_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_amr__cmr.RAW_encode(Osmux__AMR__header_amr__cmr_descr_, *myleaf.body.node.nodes[8]);
  return myleaf.length = encoded_length;
}

struct Osmux__AMR__header_template::single_value_struct {
BITSTRING_template field_marker;
INTEGER_template field_ft;
INTEGER_template field_ctr;
BITSTRING_template field_amr__f;
BITSTRING_template field_amr__q;
INTEGER_template field_seq;
INTEGER_template field_cid;
INTEGER_template field_amr__ft;
INTEGER_template field_amr__cmr;
};

void Osmux__AMR__header_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_marker = ANY_VALUE;
single_value->field_ft = ANY_VALUE;
single_value->field_ctr = ANY_VALUE;
single_value->field_amr__f = ANY_VALUE;
single_value->field_amr__q = ANY_VALUE;
single_value->field_seq = ANY_VALUE;
single_value->field_cid = ANY_VALUE;
single_value->field_amr__ft = ANY_VALUE;
single_value->field_amr__cmr = ANY_VALUE;
}
}
}

void Osmux__AMR__header_template::copy_value(const Osmux__AMR__header& other_value)
{
single_value = new single_value_struct;
if (other_value.marker().is_bound()) {
  single_value->field_marker = other_value.marker();
} else {
  single_value->field_marker.clean_up();
}
if (other_value.ft().is_bound()) {
  single_value->field_ft = other_value.ft();
} else {
  single_value->field_ft.clean_up();
}
if (other_value.ctr().is_bound()) {
  single_value->field_ctr = other_value.ctr();
} else {
  single_value->field_ctr.clean_up();
}
if (other_value.amr__f().is_bound()) {
  single_value->field_amr__f = other_value.amr__f();
} else {
  single_value->field_amr__f.clean_up();
}
if (other_value.amr__q().is_bound()) {
  single_value->field_amr__q = other_value.amr__q();
} else {
  single_value->field_amr__q.clean_up();
}
if (other_value.seq().is_bound()) {
  single_value->field_seq = other_value.seq();
} else {
  single_value->field_seq.clean_up();
}
if (other_value.cid().is_bound()) {
  single_value->field_cid = other_value.cid();
} else {
  single_value->field_cid.clean_up();
}
if (other_value.amr__ft().is_bound()) {
  single_value->field_amr__ft = other_value.amr__ft();
} else {
  single_value->field_amr__ft.clean_up();
}
if (other_value.amr__cmr().is_bound()) {
  single_value->field_amr__cmr = other_value.amr__cmr();
} else {
  single_value->field_amr__cmr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Osmux__AMR__header_template::copy_template(const Osmux__AMR__header_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.marker().get_selection()) {
single_value->field_marker = other_value.marker();
} else {
single_value->field_marker.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ft().get_selection()) {
single_value->field_ft = other_value.ft();
} else {
single_value->field_ft.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ctr().get_selection()) {
single_value->field_ctr = other_value.ctr();
} else {
single_value->field_ctr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__f().get_selection()) {
single_value->field_amr__f = other_value.amr__f();
} else {
single_value->field_amr__f.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__q().get_selection()) {
single_value->field_amr__q = other_value.amr__q();
} else {
single_value->field_amr__q.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.seq().get_selection()) {
single_value->field_seq = other_value.seq();
} else {
single_value->field_seq.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cid().get_selection()) {
single_value->field_cid = other_value.cid();
} else {
single_value->field_cid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__ft().get_selection()) {
single_value->field_amr__ft = other_value.amr__ft();
} else {
single_value->field_amr__ft.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__cmr().get_selection()) {
single_value->field_amr__cmr = other_value.amr__cmr();
} else {
single_value->field_amr__cmr.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 Osmux__AMR__header_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 Osmux__AMR__header_template(*other_value.implication_.precondition);
implication_.implied_template = new Osmux__AMR__header_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 @OSMUX_Types.Osmux_AMR_header.");
break;
}
set_selection(other_value);
}

Osmux__AMR__header_template::Osmux__AMR__header_template()
{
}

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

Osmux__AMR__header_template::Osmux__AMR__header_template(const Osmux__AMR__header& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Osmux__AMR__header_template& Osmux__AMR__header_template::operator=(const OPTIONAL<Osmux__AMR__header>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Osmux__AMR__header&)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 @OSMUX_Types.Osmux_AMR_header.");
}
return *this;
}

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

boolean Osmux__AMR__header_template::match(const Osmux__AMR__header& 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.marker().is_bound()) return FALSE;
if(!single_value->field_marker.match(other_value.marker(), legacy))return FALSE;
if(!other_value.ft().is_bound()) return FALSE;
if(!single_value->field_ft.match(other_value.ft(), legacy))return FALSE;
if(!other_value.ctr().is_bound()) return FALSE;
if(!single_value->field_ctr.match(other_value.ctr(), legacy))return FALSE;
if(!other_value.amr__f().is_bound()) return FALSE;
if(!single_value->field_amr__f.match(other_value.amr__f(), legacy))return FALSE;
if(!other_value.amr__q().is_bound()) return FALSE;
if(!single_value->field_amr__q.match(other_value.amr__q(), legacy))return FALSE;
if(!other_value.seq().is_bound()) return FALSE;
if(!single_value->field_seq.match(other_value.seq(), legacy))return FALSE;
if(!other_value.cid().is_bound()) return FALSE;
if(!single_value->field_cid.match(other_value.cid(), legacy))return FALSE;
if(!other_value.amr__ft().is_bound()) return FALSE;
if(!single_value->field_amr__ft.match(other_value.amr__ft(), legacy))return FALSE;
if(!other_value.amr__cmr().is_bound()) return FALSE;
if(!single_value->field_amr__cmr.match(other_value.amr__cmr(), 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 @OSMUX_Types.Osmux_AMR_header.");
}
return FALSE;
}

boolean Osmux__AMR__header_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_marker.is_bound()
 || single_value->field_ft.is_bound()
 || single_value->field_ctr.is_bound()
 || single_value->field_amr__f.is_bound()
 || single_value->field_amr__q.is_bound()
 || single_value->field_seq.is_bound()
 || single_value->field_cid.is_bound()
 || single_value->field_amr__ft.is_bound()
 || single_value->field_amr__cmr.is_bound();
}

boolean Osmux__AMR__header_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_marker.is_value()
 && single_value->field_ft.is_value()
 && single_value->field_ctr.is_value()
 && single_value->field_amr__f.is_value()
 && single_value->field_amr__q.is_value()
 && single_value->field_seq.is_value()
 && single_value->field_cid.is_value()
 && single_value->field_amr__ft.is_value()
 && single_value->field_amr__cmr.is_value();
}

void Osmux__AMR__header_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;
}

Osmux__AMR__header Osmux__AMR__header_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 @OSMUX_Types.Osmux_AMR_header.");
Osmux__AMR__header ret_val;
if (single_value->field_marker.is_bound()) {
ret_val.marker() = single_value->field_marker.valueof();
}
if (single_value->field_ft.is_bound()) {
ret_val.ft() = single_value->field_ft.valueof();
}
if (single_value->field_ctr.is_bound()) {
ret_val.ctr() = single_value->field_ctr.valueof();
}
if (single_value->field_amr__f.is_bound()) {
ret_val.amr__f() = single_value->field_amr__f.valueof();
}
if (single_value->field_amr__q.is_bound()) {
ret_val.amr__q() = single_value->field_amr__q.valueof();
}
if (single_value->field_seq.is_bound()) {
ret_val.seq() = single_value->field_seq.valueof();
}
if (single_value->field_cid.is_bound()) {
ret_val.cid() = single_value->field_cid.valueof();
}
if (single_value->field_amr__ft.is_bound()) {
ret_val.amr__ft() = single_value->field_amr__ft.valueof();
}
if (single_value->field_amr__cmr.is_bound()) {
ret_val.amr__cmr() = single_value->field_amr__cmr.valueof();
}
return ret_val;
}

void Osmux__AMR__header_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 @OSMUX_Types.Osmux_AMR_header.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Osmux__AMR__header_template[list_length];
}

Osmux__AMR__header_template& Osmux__AMR__header_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 @OSMUX_Types.Osmux_AMR_header.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.Osmux_AMR_header.");
return value_list.list_value[list_index];
}

BITSTRING_template& Osmux__AMR__header_template::marker()
{
set_specific();
return single_value->field_marker;
}

const BITSTRING_template& Osmux__AMR__header_template::marker() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field marker of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_marker;
}

INTEGER_template& Osmux__AMR__header_template::ft()
{
set_specific();
return single_value->field_ft;
}

const INTEGER_template& Osmux__AMR__header_template::ft() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ft of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_ft;
}

INTEGER_template& Osmux__AMR__header_template::ctr()
{
set_specific();
return single_value->field_ctr;
}

const INTEGER_template& Osmux__AMR__header_template::ctr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ctr of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_ctr;
}

BITSTRING_template& Osmux__AMR__header_template::amr__f()
{
set_specific();
return single_value->field_amr__f;
}

const BITSTRING_template& Osmux__AMR__header_template::amr__f() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_f of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_amr__f;
}

BITSTRING_template& Osmux__AMR__header_template::amr__q()
{
set_specific();
return single_value->field_amr__q;
}

const BITSTRING_template& Osmux__AMR__header_template::amr__q() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_q of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_amr__q;
}

INTEGER_template& Osmux__AMR__header_template::seq()
{
set_specific();
return single_value->field_seq;
}

const INTEGER_template& Osmux__AMR__header_template::seq() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field seq of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_seq;
}

INTEGER_template& Osmux__AMR__header_template::cid()
{
set_specific();
return single_value->field_cid;
}

const INTEGER_template& Osmux__AMR__header_template::cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cid of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_cid;
}

INTEGER_template& Osmux__AMR__header_template::amr__ft()
{
set_specific();
return single_value->field_amr__ft;
}

const INTEGER_template& Osmux__AMR__header_template::amr__ft() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_ft of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_amr__ft;
}

INTEGER_template& Osmux__AMR__header_template::amr__cmr()
{
set_specific();
return single_value->field_amr__cmr;
}

const INTEGER_template& Osmux__AMR__header_template::amr__cmr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_cmr of a non-specific template of type @OSMUX_Types.Osmux_AMR_header.");
return single_value->field_amr__cmr;
}

int Osmux__AMR__header_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 9;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header 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 @OSMUX_Types.Osmux_AMR_header containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_AMR_header containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.Osmux_AMR_header.");
  }
  return 0;
}

void Osmux__AMR__header_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ marker := ");
single_value->field_marker.log();
TTCN_Logger::log_event_str(", ft := ");
single_value->field_ft.log();
TTCN_Logger::log_event_str(", ctr := ");
single_value->field_ctr.log();
TTCN_Logger::log_event_str(", amr_f := ");
single_value->field_amr__f.log();
TTCN_Logger::log_event_str(", amr_q := ");
single_value->field_amr__q.log();
TTCN_Logger::log_event_str(", seq := ");
single_value->field_seq.log();
TTCN_Logger::log_event_str(", cid := ");
single_value->field_cid.log();
TTCN_Logger::log_event_str(", amr_ft := ");
single_value->field_amr__ft.log();
TTCN_Logger::log_event_str(", amr_cmr := ");
single_value->field_amr__cmr.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 Osmux__AMR__header_template::log_match(const Osmux__AMR__header& 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_marker.match(match_value.marker(), legacy)){
TTCN_Logger::log_logmatch_info(".marker");
single_value->field_marker.log_match(match_value.marker(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ft.match(match_value.ft(), legacy)){
TTCN_Logger::log_logmatch_info(".ft");
single_value->field_ft.log_match(match_value.ft(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ctr.match(match_value.ctr(), legacy)){
TTCN_Logger::log_logmatch_info(".ctr");
single_value->field_ctr.log_match(match_value.ctr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__f.match(match_value.amr__f(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_f");
single_value->field_amr__f.log_match(match_value.amr__f(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__q.match(match_value.amr__q(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_q");
single_value->field_amr__q.log_match(match_value.amr__q(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_seq.match(match_value.seq(), legacy)){
TTCN_Logger::log_logmatch_info(".seq");
single_value->field_seq.log_match(match_value.seq(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cid.match(match_value.cid(), legacy)){
TTCN_Logger::log_logmatch_info(".cid");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__ft.match(match_value.amr__ft(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_ft");
single_value->field_amr__ft.log_match(match_value.amr__ft(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__cmr.match(match_value.amr__cmr(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_cmr");
single_value->field_amr__cmr.log_match(match_value.amr__cmr(), 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("{ marker := ");
single_value->field_marker.log_match(match_value.marker(), legacy);
TTCN_Logger::log_event_str(", ft := ");
single_value->field_ft.log_match(match_value.ft(), legacy);
TTCN_Logger::log_event_str(", ctr := ");
single_value->field_ctr.log_match(match_value.ctr(), legacy);
TTCN_Logger::log_event_str(", amr_f := ");
single_value->field_amr__f.log_match(match_value.amr__f(), legacy);
TTCN_Logger::log_event_str(", amr_q := ");
single_value->field_amr__q.log_match(match_value.amr__q(), legacy);
TTCN_Logger::log_event_str(", seq := ");
single_value->field_seq.log_match(match_value.seq(), legacy);
TTCN_Logger::log_event_str(", cid := ");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::log_event_str(", amr_ft := ");
single_value->field_amr__ft.log_match(match_value.amr__ft(), legacy);
TTCN_Logger::log_event_str(", amr_cmr := ");
single_value->field_amr__cmr.log_match(match_value.amr__cmr(), 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 Osmux__AMR__header_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (marker().is_bound()) marker().set_implicit_omit();
if (ft().is_bound()) ft().set_implicit_omit();
if (ctr().is_bound()) ctr().set_implicit_omit();
if (amr__f().is_bound()) amr__f().set_implicit_omit();
if (amr__q().is_bound()) amr__q().set_implicit_omit();
if (seq().is_bound()) seq().set_implicit_omit();
if (cid().is_bound()) cid().set_implicit_omit();
if (amr__ft().is_bound()) amr__ft().set_implicit_omit();
if (amr__cmr().is_bound()) amr__cmr().set_implicit_omit();
}

void Osmux__AMR__header_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_marker.encode_text(text_buf);
single_value->field_ft.encode_text(text_buf);
single_value->field_ctr.encode_text(text_buf);
single_value->field_amr__f.encode_text(text_buf);
single_value->field_amr__q.encode_text(text_buf);
single_value->field_seq.encode_text(text_buf);
single_value->field_cid.encode_text(text_buf);
single_value->field_amr__ft.encode_text(text_buf);
single_value->field_amr__cmr.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 @OSMUX_Types.Osmux_AMR_header.");
}
}

void Osmux__AMR__header_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_marker.decode_text(text_buf);
single_value->field_ft.decode_text(text_buf);
single_value->field_ctr.decode_text(text_buf);
single_value->field_amr__f.decode_text(text_buf);
single_value->field_amr__q.decode_text(text_buf);
single_value->field_seq.decode_text(text_buf);
single_value->field_cid.decode_text(text_buf);
single_value->field_amr__ft.decode_text(text_buf);
single_value->field_amr__cmr.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 Osmux__AMR__header_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 @OSMUX_Types.Osmux_AMR_header.");
}
}

void Osmux__AMR__header_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: {
    Osmux__AMR__header_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 (9<param.get_size()) {
      param.error("record template of type @OSMUX_Types.Osmux_AMR_header has 9 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) marker().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ft().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ctr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) amr__f().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) amr__q().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) seq().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) amr__ft().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) amr__cmr().set_param(*param.get_elem(8));
    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(), "marker")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          marker().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(), "ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ft().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(), "ctr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ctr().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(), "amr_f")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__f().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(), "amr_q")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__q().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(), "seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "amr_ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__ft().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(), "amr_cmr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__cmr().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 @OSMUX_Types.Osmux_AMR_header: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Osmux__AMR__header_template* precondition = new Osmux__AMR__header_template;
    precondition->set_param(*param.get_elem(0));
    Osmux__AMR__header_template* implied_template = new Osmux__AMR__header_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Osmux__AMR__header_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.Osmux_AMR_header");
  }
  is_ifpresent = param.get_ifpresent();
}

void Osmux__AMR__header_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_marker.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_ft.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_ctr.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_amr__f.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_amr__q.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_seq.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_cid.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_amr__ft.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
single_value->field_amr__cmr.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_AMR_header");
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 : "@OSMUX_Types.Osmux_AMR_header");
}

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

boolean Osmux__AMR__header_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__Osmux__AMR::PDU__Osmux__AMR()
{
}

PDU__Osmux__AMR::PDU__Osmux__AMR(const Osmux__AMR__header& par_header,
    const OCTETSTRING& par_data)
  :   field_header(par_header),
  field_data(par_data)
{
}

PDU__Osmux__AMR::PDU__Osmux__AMR(const PDU__Osmux__AMR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.PDU_Osmux_AMR.");
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__Osmux__AMR::clean_up()
{
field_header.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__Osmux__AMR::get_descriptor() const { return &PDU__Osmux__AMR_descr_; }
PDU__Osmux__AMR& PDU__Osmux__AMR::operator=(const PDU__Osmux__AMR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.PDU_Osmux_AMR.");
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__Osmux__AMR::operator==(const PDU__Osmux__AMR& other_value) const
{
return field_header==other_value.field_header
  && field_data==other_value.field_data;
}

boolean PDU__Osmux__AMR::is_bound() const
{
return (field_header.is_bound())
  || (field_data.is_bound());
}
boolean PDU__Osmux__AMR::is_value() const
{
return field_header.is_value()
  && field_data.is_value();
}
void PDU__Osmux__AMR::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ header := ");
field_header.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__Osmux__AMR::set_implicit_omit()
{
if (header().is_bound()) header().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__Osmux__AMR::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 @OSMUX_Types.PDU_Osmux_AMR 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) header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().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(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().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(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          data().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 @OSMUX_Types.PDU_Osmux_AMR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.PDU_Osmux_AMR");
  }
}

void PDU__Osmux__AMR::encode_text(Text_Buf& text_buf) const
{
field_header.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__Osmux__AMR::decode_text(Text_Buf& text_buf)
{
field_header.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void PDU__Osmux__AMR::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__Osmux__AMR::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__Osmux__AMR::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, PDU__Osmux__AMR_header_descr_.raw->forceomit);
  decoded_field_length = field_header.RAW_decode(PDU__Osmux__AMR_header_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, PDU__Osmux__AMR_data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(PDU__Osmux__AMR_data_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 PDU__Osmux__AMR::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, PDU__Osmux__AMR_header_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__Osmux__AMR_data_descr_.raw);
  encoded_length += field_header.RAW_encode(PDU__Osmux__AMR_header_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_data.RAW_encode(PDU__Osmux__AMR_data_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__Osmux__AMR_template::single_value_struct {
Osmux__AMR__header_template field_header;
OCTETSTRING_template field_data;
};

void PDU__Osmux__AMR_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_header = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__Osmux__AMR_template::copy_value(const PDU__Osmux__AMR& other_value)
{
single_value = new single_value_struct;
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__Osmux__AMR_template::copy_template(const PDU__Osmux__AMR_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.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__Osmux__AMR_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__Osmux__AMR_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR.");
break;
}
set_selection(other_value);
}

PDU__Osmux__AMR_template::PDU__Osmux__AMR_template()
{
}

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

PDU__Osmux__AMR_template::PDU__Osmux__AMR_template(const PDU__Osmux__AMR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__Osmux__AMR_template& PDU__Osmux__AMR_template::operator=(const OPTIONAL<PDU__Osmux__AMR>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__Osmux__AMR&)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 @OSMUX_Types.PDU_Osmux_AMR.");
}
return *this;
}

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

boolean PDU__Osmux__AMR_template::match(const PDU__Osmux__AMR& 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.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), 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 @OSMUX_Types.PDU_Osmux_AMR.");
}
return FALSE;
}

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

boolean PDU__Osmux__AMR_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_header.is_value()
 && single_value->field_data.is_value();
}

void PDU__Osmux__AMR_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__Osmux__AMR PDU__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR.");
PDU__Osmux__AMR ret_val;
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__Osmux__AMR_template[list_length];
}

PDU__Osmux__AMR_template& PDU__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.PDU_Osmux_AMR.");
return value_list.list_value[list_index];
}

Osmux__AMR__header_template& PDU__Osmux__AMR_template::header()
{
set_specific();
return single_value->field_header;
}

const Osmux__AMR__header_template& PDU__Osmux__AMR_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @OSMUX_Types.PDU_Osmux_AMR.");
return single_value->field_header;
}

OCTETSTRING_template& PDU__Osmux__AMR_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& PDU__Osmux__AMR_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @OSMUX_Types.PDU_Osmux_AMR.");
return single_value->field_data;
}

int PDU__Osmux__AMR_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR 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 @OSMUX_Types.PDU_Osmux_AMR 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 @OSMUX_Types.PDU_Osmux_AMR containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_AMR containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.PDU_Osmux_AMR.");
  }
  return 0;
}

void PDU__Osmux__AMR_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.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__Osmux__AMR_template::log_match(const PDU__Osmux__AMR& 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_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), 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("{ header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), 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__Osmux__AMR_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (header().is_bound()) header().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__Osmux__AMR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_header.encode_text(text_buf);
single_value->field_data.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 @OSMUX_Types.PDU_Osmux_AMR.");
}
}

void PDU__Osmux__AMR_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_header.decode_text(text_buf);
single_value->field_data.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__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR.");
}
}

void PDU__Osmux__AMR_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__Osmux__AMR_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 @OSMUX_Types.PDU_Osmux_AMR 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) header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().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(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().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(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          data().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 @OSMUX_Types.PDU_Osmux_AMR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__Osmux__AMR_template* precondition = new PDU__Osmux__AMR_template;
    precondition->set_param(*param.get_elem(0));
    PDU__Osmux__AMR_template* implied_template = new PDU__Osmux__AMR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__Osmux__AMR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.PDU_Osmux_AMR");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__Osmux__AMR_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_header.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.PDU_Osmux_AMR");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.PDU_Osmux_AMR");
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 : "@OSMUX_Types.PDU_Osmux_AMR");
}

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

boolean PDU__Osmux__AMR_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__Osmux__DUMMY::PDU__Osmux__DUMMY()
{
}

PDU__Osmux__DUMMY::PDU__Osmux__DUMMY(const Osmux__AMR__header& par_header,
    const OCTETSTRING& par_data)
  :   field_header(par_header),
  field_data(par_data)
{
}

PDU__Osmux__DUMMY::PDU__Osmux__DUMMY(const PDU__Osmux__DUMMY& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.PDU_Osmux_DUMMY.");
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__Osmux__DUMMY::clean_up()
{
field_header.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__Osmux__DUMMY::get_descriptor() const { return &PDU__Osmux__DUMMY_descr_; }
PDU__Osmux__DUMMY& PDU__Osmux__DUMMY::operator=(const PDU__Osmux__DUMMY& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.PDU_Osmux_DUMMY.");
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__Osmux__DUMMY::operator==(const PDU__Osmux__DUMMY& other_value) const
{
return field_header==other_value.field_header
  && field_data==other_value.field_data;
}

boolean PDU__Osmux__DUMMY::is_bound() const
{
return (field_header.is_bound())
  || (field_data.is_bound());
}
boolean PDU__Osmux__DUMMY::is_value() const
{
return field_header.is_value()
  && field_data.is_value();
}
void PDU__Osmux__DUMMY::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ header := ");
field_header.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__Osmux__DUMMY::set_implicit_omit()
{
if (header().is_bound()) header().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__Osmux__DUMMY::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 @OSMUX_Types.PDU_Osmux_DUMMY 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) header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().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(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().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(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          data().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 @OSMUX_Types.PDU_Osmux_DUMMY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.PDU_Osmux_DUMMY");
  }
}

void PDU__Osmux__DUMMY::encode_text(Text_Buf& text_buf) const
{
field_header.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__Osmux__DUMMY::decode_text(Text_Buf& text_buf)
{
field_header.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void PDU__Osmux__DUMMY::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__Osmux__DUMMY::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__Osmux__DUMMY::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, PDU__Osmux__DUMMY_header_descr_.raw->forceomit);
  decoded_field_length = field_header.RAW_decode(PDU__Osmux__DUMMY_header_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, PDU__Osmux__DUMMY_data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(PDU__Osmux__DUMMY_data_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 PDU__Osmux__DUMMY::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, PDU__Osmux__DUMMY_header_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__Osmux__DUMMY_data_descr_.raw);
  encoded_length += field_header.RAW_encode(PDU__Osmux__DUMMY_header_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_data.RAW_encode(PDU__Osmux__DUMMY_data_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__Osmux__DUMMY_template::single_value_struct {
Osmux__AMR__header_template field_header;
OCTETSTRING_template field_data;
};

void PDU__Osmux__DUMMY_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_header = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__Osmux__DUMMY_template::copy_value(const PDU__Osmux__DUMMY& other_value)
{
single_value = new single_value_struct;
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__Osmux__DUMMY_template::copy_template(const PDU__Osmux__DUMMY_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.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__Osmux__DUMMY_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__Osmux__DUMMY_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY.");
break;
}
set_selection(other_value);
}

PDU__Osmux__DUMMY_template::PDU__Osmux__DUMMY_template()
{
}

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

PDU__Osmux__DUMMY_template::PDU__Osmux__DUMMY_template(const PDU__Osmux__DUMMY& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__Osmux__DUMMY_template& PDU__Osmux__DUMMY_template::operator=(const OPTIONAL<PDU__Osmux__DUMMY>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__Osmux__DUMMY&)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 @OSMUX_Types.PDU_Osmux_DUMMY.");
}
return *this;
}

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

boolean PDU__Osmux__DUMMY_template::match(const PDU__Osmux__DUMMY& 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.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), 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 @OSMUX_Types.PDU_Osmux_DUMMY.");
}
return FALSE;
}

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

boolean PDU__Osmux__DUMMY_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_header.is_value()
 && single_value->field_data.is_value();
}

void PDU__Osmux__DUMMY_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__Osmux__DUMMY PDU__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY.");
PDU__Osmux__DUMMY ret_val;
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__Osmux__DUMMY_template[list_length];
}

PDU__Osmux__DUMMY_template& PDU__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.PDU_Osmux_DUMMY.");
return value_list.list_value[list_index];
}

Osmux__AMR__header_template& PDU__Osmux__DUMMY_template::header()
{
set_specific();
return single_value->field_header;
}

const Osmux__AMR__header_template& PDU__Osmux__DUMMY_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @OSMUX_Types.PDU_Osmux_DUMMY.");
return single_value->field_header;
}

OCTETSTRING_template& PDU__Osmux__DUMMY_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& PDU__Osmux__DUMMY_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @OSMUX_Types.PDU_Osmux_DUMMY.");
return single_value->field_data;
}

int PDU__Osmux__DUMMY_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY 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 @OSMUX_Types.PDU_Osmux_DUMMY 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 @OSMUX_Types.PDU_Osmux_DUMMY containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.PDU_Osmux_DUMMY containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.PDU_Osmux_DUMMY.");
  }
  return 0;
}

void PDU__Osmux__DUMMY_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.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__Osmux__DUMMY_template::log_match(const PDU__Osmux__DUMMY& 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_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), 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("{ header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), 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__Osmux__DUMMY_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (header().is_bound()) header().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__Osmux__DUMMY_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_header.encode_text(text_buf);
single_value->field_data.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 @OSMUX_Types.PDU_Osmux_DUMMY.");
}
}

void PDU__Osmux__DUMMY_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_header.decode_text(text_buf);
single_value->field_data.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__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY.");
}
}

void PDU__Osmux__DUMMY_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__Osmux__DUMMY_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 @OSMUX_Types.PDU_Osmux_DUMMY 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) header().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().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(), "header")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          header().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(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          data().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 @OSMUX_Types.PDU_Osmux_DUMMY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__Osmux__DUMMY_template* precondition = new PDU__Osmux__DUMMY_template;
    precondition->set_param(*param.get_elem(0));
    PDU__Osmux__DUMMY_template* implied_template = new PDU__Osmux__DUMMY_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__Osmux__DUMMY_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.PDU_Osmux_DUMMY");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__Osmux__DUMMY_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_header.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.PDU_Osmux_DUMMY");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.PDU_Osmux_DUMMY");
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 : "@OSMUX_Types.PDU_Osmux_DUMMY");
}

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

boolean PDU__Osmux__DUMMY_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;
}

Osmux__session__par::Osmux__session__par()
{
}

Osmux__session__par::Osmux__session__par(const OPTIONAL< INTEGER >& par_id,
    const OPTIONAL< CHARSTRING >& par_local__address,
    const OPTIONAL< INTEGER >& par_local__port,
    const OPTIONAL< CHARSTRING >& par_dest__address,
    const OPTIONAL< INTEGER >& par_dest__port)
  :   field_id(par_id),
  field_local__address(par_local__address),
  field_local__port(par_local__port),
  field_dest__address(par_dest__address),
  field_dest__port(par_dest__port)
{
}

Osmux__session__par::Osmux__session__par(const Osmux__session__par& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.Osmux_session_par.");
if (other_value.id().is_bound()) field_id = other_value.id();
else field_id.clean_up();
if (other_value.local__address().is_bound()) field_local__address = other_value.local__address();
else field_local__address.clean_up();
if (other_value.local__port().is_bound()) field_local__port = other_value.local__port();
else field_local__port.clean_up();
if (other_value.dest__address().is_bound()) field_dest__address = other_value.dest__address();
else field_dest__address.clean_up();
if (other_value.dest__port().is_bound()) field_dest__port = other_value.dest__port();
else field_dest__port.clean_up();
}

void Osmux__session__par::clean_up()
{
field_id.clean_up();
field_local__address.clean_up();
field_local__port.clean_up();
field_dest__address.clean_up();
field_dest__port.clean_up();
}

const TTCN_Typedescriptor_t* Osmux__session__par::get_descriptor() const { return &Osmux__session__par_descr_; }
Osmux__session__par& Osmux__session__par::operator=(const Osmux__session__par& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.Osmux_session_par.");
  if (other_value.id().is_bound()) field_id = other_value.id();
  else field_id.clean_up();
  if (other_value.local__address().is_bound()) field_local__address = other_value.local__address();
  else field_local__address.clean_up();
  if (other_value.local__port().is_bound()) field_local__port = other_value.local__port();
  else field_local__port.clean_up();
  if (other_value.dest__address().is_bound()) field_dest__address = other_value.dest__address();
  else field_dest__address.clean_up();
  if (other_value.dest__port().is_bound()) field_dest__port = other_value.dest__port();
  else field_dest__port.clean_up();
}
return *this;
}

boolean Osmux__session__par::operator==(const Osmux__session__par& other_value) const
{
return field_id==other_value.field_id
  && field_local__address==other_value.field_local__address
  && field_local__port==other_value.field_local__port
  && field_dest__address==other_value.field_dest__address
  && field_dest__port==other_value.field_dest__port;
}

boolean Osmux__session__par::is_bound() const
{
return (OPTIONAL_OMIT == field_id.get_selection() || field_id.is_bound())
  || (OPTIONAL_OMIT == field_local__address.get_selection() || field_local__address.is_bound())
  || (OPTIONAL_OMIT == field_local__port.get_selection() || field_local__port.is_bound())
  || (OPTIONAL_OMIT == field_dest__address.get_selection() || field_dest__address.is_bound())
  || (OPTIONAL_OMIT == field_dest__port.get_selection() || field_dest__port.is_bound());
}
boolean Osmux__session__par::is_value() const
{
return (OPTIONAL_OMIT == field_id.get_selection() || field_id.is_value())
  && (OPTIONAL_OMIT == field_local__address.get_selection() || field_local__address.is_value())
  && (OPTIONAL_OMIT == field_local__port.get_selection() || field_local__port.is_value())
  && (OPTIONAL_OMIT == field_dest__address.get_selection() || field_dest__address.is_value())
  && (OPTIONAL_OMIT == field_dest__port.get_selection() || field_dest__port.is_value());
}
int Osmux__session__par::size_of() const
{
  int ret_val = 0;
  if (field_id.ispresent()) ret_val++;
  if (field_local__address.ispresent()) ret_val++;
  if (field_local__port.ispresent()) ret_val++;
  if (field_dest__address.ispresent()) ret_val++;
  if (field_dest__port.ispresent()) ret_val++;
  return ret_val;
}

void Osmux__session__par::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ id := ");
field_id.log();
TTCN_Logger::log_event_str(", local_address := ");
field_local__address.log();
TTCN_Logger::log_event_str(", local_port := ");
field_local__port.log();
TTCN_Logger::log_event_str(", dest_address := ");
field_dest__address.log();
TTCN_Logger::log_event_str(", dest_port := ");
field_dest__port.log();
TTCN_Logger::log_event_str(" }");
}

void Osmux__session__par::set_implicit_omit()
{
if (!id().is_bound()) id() = OMIT_VALUE;
else id().set_implicit_omit();
if (!local__address().is_bound()) local__address() = OMIT_VALUE;
else local__address().set_implicit_omit();
if (!local__port().is_bound()) local__port() = OMIT_VALUE;
else local__port().set_implicit_omit();
if (!dest__address().is_bound()) dest__address() = OMIT_VALUE;
else dest__address().set_implicit_omit();
if (!dest__port().is_bound()) dest__port() = OMIT_VALUE;
else dest__port().set_implicit_omit();
}

void Osmux__session__par::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 (5<param.get_size()) {
      param.error("record value of type @OSMUX_Types.Osmux_session_par has 5 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) id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__address().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__port().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dest__address().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dest__port().set_param(*param.get_elem(4));
    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(), "id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          id().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(), "local_address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__address().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(), "local_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__port().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(), "dest_address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dest__address().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(), "dest_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dest__port().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 @OSMUX_Types.Osmux_session_par: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.Osmux_session_par");
  }
}

void Osmux__session__par::encode_text(Text_Buf& text_buf) const
{
field_id.encode_text(text_buf);
field_local__address.encode_text(text_buf);
field_local__port.encode_text(text_buf);
field_dest__address.encode_text(text_buf);
field_dest__port.encode_text(text_buf);
}

void Osmux__session__par::decode_text(Text_Buf& text_buf)
{
field_id.decode_text(text_buf);
field_local__address.decode_text(text_buf);
field_local__port.decode_text(text_buf);
field_dest__address.decode_text(text_buf);
field_dest__port.decode_text(text_buf);
}

void Osmux__session__par::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 Osmux__session__par::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 Osmux__session__par::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;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(0)) {
    field_id = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_0_force_omit(0, force_omit, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_id().RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 1) {
  field_id = 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_id=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_local__address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, CHARSTRING_descr_.raw->forceomit);
  decoded_field_length = field_local__address().RAW_decode(CHARSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_local__address = 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_local__address=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_local__port = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_local__port().RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_local__port = 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_local__port=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_dest__address = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, CHARSTRING_descr_.raw->forceomit);
  decoded_field_length = field_dest__address().RAW_decode(CHARSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_dest__address = 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_dest__address=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_dest__port = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_dest__port().RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_dest__port = 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_dest__port=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Osmux__session__par::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 = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  if (field_id.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, INTEGER_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_local__address.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CHARSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_local__port.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, INTEGER_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_dest__address.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, CHARSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_dest__port.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, INTEGER_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_id.ispresent()) {
  encoded_length += field_id().RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_local__address.ispresent()) {
  encoded_length += field_local__address().RAW_encode(CHARSTRING_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_local__port.ispresent()) {
  encoded_length += field_local__port().RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_dest__address.ispresent()) {
  encoded_length += field_dest__address().RAW_encode(CHARSTRING_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_dest__port.ispresent()) {
  encoded_length += field_dest__port().RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[4]);
  }
  return myleaf.length = encoded_length;
}

struct Osmux__session__par_template::single_value_struct {
INTEGER_template field_id;
CHARSTRING_template field_local__address;
INTEGER_template field_local__port;
CHARSTRING_template field_dest__address;
INTEGER_template field_dest__port;
};

void Osmux__session__par_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_id = ANY_OR_OMIT;
single_value->field_local__address = ANY_OR_OMIT;
single_value->field_local__port = ANY_OR_OMIT;
single_value->field_dest__address = ANY_OR_OMIT;
single_value->field_dest__port = ANY_OR_OMIT;
}
}
}

void Osmux__session__par_template::copy_value(const Osmux__session__par& other_value)
{
single_value = new single_value_struct;
if (other_value.id().is_bound()) {
  if (other_value.id().ispresent()) single_value->field_id = other_value.id()();
  else single_value->field_id = OMIT_VALUE;
} else {
  single_value->field_id.clean_up();
}
if (other_value.local__address().is_bound()) {
  if (other_value.local__address().ispresent()) single_value->field_local__address = other_value.local__address()();
  else single_value->field_local__address = OMIT_VALUE;
} else {
  single_value->field_local__address.clean_up();
}
if (other_value.local__port().is_bound()) {
  if (other_value.local__port().ispresent()) single_value->field_local__port = other_value.local__port()();
  else single_value->field_local__port = OMIT_VALUE;
} else {
  single_value->field_local__port.clean_up();
}
if (other_value.dest__address().is_bound()) {
  if (other_value.dest__address().ispresent()) single_value->field_dest__address = other_value.dest__address()();
  else single_value->field_dest__address = OMIT_VALUE;
} else {
  single_value->field_dest__address.clean_up();
}
if (other_value.dest__port().is_bound()) {
  if (other_value.dest__port().ispresent()) single_value->field_dest__port = other_value.dest__port()();
  else single_value->field_dest__port = OMIT_VALUE;
} else {
  single_value->field_dest__port.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Osmux__session__par_template::copy_template(const Osmux__session__par_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.id().get_selection()) {
single_value->field_id = other_value.id();
} else {
single_value->field_id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__address().get_selection()) {
single_value->field_local__address = other_value.local__address();
} else {
single_value->field_local__address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__port().get_selection()) {
single_value->field_local__port = other_value.local__port();
} else {
single_value->field_local__port.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dest__address().get_selection()) {
single_value->field_dest__address = other_value.dest__address();
} else {
single_value->field_dest__address.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dest__port().get_selection()) {
single_value->field_dest__port = other_value.dest__port();
} else {
single_value->field_dest__port.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 Osmux__session__par_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 Osmux__session__par_template(*other_value.implication_.precondition);
implication_.implied_template = new Osmux__session__par_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 @OSMUX_Types.Osmux_session_par.");
break;
}
set_selection(other_value);
}

Osmux__session__par_template::Osmux__session__par_template()
{
}

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

Osmux__session__par_template::Osmux__session__par_template(const Osmux__session__par& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Osmux__session__par_template& Osmux__session__par_template::operator=(const OPTIONAL<Osmux__session__par>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Osmux__session__par&)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 @OSMUX_Types.Osmux_session_par.");
}
return *this;
}

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

boolean Osmux__session__par_template::match(const Osmux__session__par& 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.id().is_bound()) return FALSE;
if((other_value.id().ispresent() ? !single_value->field_id.match((const INTEGER&)other_value.id(), legacy) : !single_value->field_id.match_omit(legacy)))return FALSE;
if(!other_value.local__address().is_bound()) return FALSE;
if((other_value.local__address().ispresent() ? !single_value->field_local__address.match((const CHARSTRING&)other_value.local__address(), legacy) : !single_value->field_local__address.match_omit(legacy)))return FALSE;
if(!other_value.local__port().is_bound()) return FALSE;
if((other_value.local__port().ispresent() ? !single_value->field_local__port.match((const INTEGER&)other_value.local__port(), legacy) : !single_value->field_local__port.match_omit(legacy)))return FALSE;
if(!other_value.dest__address().is_bound()) return FALSE;
if((other_value.dest__address().ispresent() ? !single_value->field_dest__address.match((const CHARSTRING&)other_value.dest__address(), legacy) : !single_value->field_dest__address.match_omit(legacy)))return FALSE;
if(!other_value.dest__port().is_bound()) return FALSE;
if((other_value.dest__port().ispresent() ? !single_value->field_dest__port.match((const INTEGER&)other_value.dest__port(), legacy) : !single_value->field_dest__port.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 @OSMUX_Types.Osmux_session_par.");
}
return FALSE;
}

boolean Osmux__session__par_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_id.is_omit() || single_value->field_id.is_bound())
 || (single_value->field_local__address.is_omit() || single_value->field_local__address.is_bound())
 || (single_value->field_local__port.is_omit() || single_value->field_local__port.is_bound())
 || (single_value->field_dest__address.is_omit() || single_value->field_dest__address.is_bound())
 || (single_value->field_dest__port.is_omit() || single_value->field_dest__port.is_bound());
}

boolean Osmux__session__par_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_id.is_omit() || single_value->field_id.is_value())
 && (single_value->field_local__address.is_omit() || single_value->field_local__address.is_value())
 && (single_value->field_local__port.is_omit() || single_value->field_local__port.is_value())
 && (single_value->field_dest__address.is_omit() || single_value->field_dest__address.is_value())
 && (single_value->field_dest__port.is_omit() || single_value->field_dest__port.is_value());
}

void Osmux__session__par_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;
}

Osmux__session__par Osmux__session__par_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 @OSMUX_Types.Osmux_session_par.");
Osmux__session__par ret_val;
if (single_value->field_id.is_omit()) ret_val.id() = OMIT_VALUE;
else if (single_value->field_id.is_bound()) {
ret_val.id() = single_value->field_id.valueof();
}
if (single_value->field_local__address.is_omit()) ret_val.local__address() = OMIT_VALUE;
else if (single_value->field_local__address.is_bound()) {
ret_val.local__address() = single_value->field_local__address.valueof();
}
if (single_value->field_local__port.is_omit()) ret_val.local__port() = OMIT_VALUE;
else if (single_value->field_local__port.is_bound()) {
ret_val.local__port() = single_value->field_local__port.valueof();
}
if (single_value->field_dest__address.is_omit()) ret_val.dest__address() = OMIT_VALUE;
else if (single_value->field_dest__address.is_bound()) {
ret_val.dest__address() = single_value->field_dest__address.valueof();
}
if (single_value->field_dest__port.is_omit()) ret_val.dest__port() = OMIT_VALUE;
else if (single_value->field_dest__port.is_bound()) {
ret_val.dest__port() = single_value->field_dest__port.valueof();
}
return ret_val;
}

void Osmux__session__par_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 @OSMUX_Types.Osmux_session_par.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Osmux__session__par_template[list_length];
}

Osmux__session__par_template& Osmux__session__par_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 @OSMUX_Types.Osmux_session_par.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.Osmux_session_par.");
return value_list.list_value[list_index];
}

INTEGER_template& Osmux__session__par_template::id()
{
set_specific();
return single_value->field_id;
}

const INTEGER_template& Osmux__session__par_template::id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field id of a non-specific template of type @OSMUX_Types.Osmux_session_par.");
return single_value->field_id;
}

CHARSTRING_template& Osmux__session__par_template::local__address()
{
set_specific();
return single_value->field_local__address;
}

const CHARSTRING_template& Osmux__session__par_template::local__address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_address of a non-specific template of type @OSMUX_Types.Osmux_session_par.");
return single_value->field_local__address;
}

INTEGER_template& Osmux__session__par_template::local__port()
{
set_specific();
return single_value->field_local__port;
}

const INTEGER_template& Osmux__session__par_template::local__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_port of a non-specific template of type @OSMUX_Types.Osmux_session_par.");
return single_value->field_local__port;
}

CHARSTRING_template& Osmux__session__par_template::dest__address()
{
set_specific();
return single_value->field_dest__address;
}

const CHARSTRING_template& Osmux__session__par_template::dest__address() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dest_address of a non-specific template of type @OSMUX_Types.Osmux_session_par.");
return single_value->field_dest__address;
}

INTEGER_template& Osmux__session__par_template::dest__port()
{
set_specific();
return single_value->field_dest__port;
}

const INTEGER_template& Osmux__session__par_template::dest__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dest_port of a non-specific template of type @OSMUX_Types.Osmux_session_par.");
return single_value->field_dest__port;
}

int Osmux__session__par_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_id.is_present()) ret_val++;
      if (single_value->field_local__address.is_present()) ret_val++;
      if (single_value->field_local__port.is_present()) ret_val++;
      if (single_value->field_dest__address.is_present()) ret_val++;
      if (single_value->field_dest__port.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 @OSMUX_Types.Osmux_session_par 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 @OSMUX_Types.Osmux_session_par containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.Osmux_session_par containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.Osmux_session_par.");
  }
  return 0;
}

void Osmux__session__par_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ id := ");
single_value->field_id.log();
TTCN_Logger::log_event_str(", local_address := ");
single_value->field_local__address.log();
TTCN_Logger::log_event_str(", local_port := ");
single_value->field_local__port.log();
TTCN_Logger::log_event_str(", dest_address := ");
single_value->field_dest__address.log();
TTCN_Logger::log_event_str(", dest_port := ");
single_value->field_dest__port.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 Osmux__session__par_template::log_match(const Osmux__session__par& 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 (match_value.id().ispresent()){
if(!single_value->field_id.match(match_value.id(), legacy)){
TTCN_Logger::log_logmatch_info(".id");
single_value->field_id.log_match(match_value.id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.local__address().ispresent()){
if(!single_value->field_local__address.match(match_value.local__address(), legacy)){
TTCN_Logger::log_logmatch_info(".local_address");
single_value->field_local__address.log_match(match_value.local__address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_local__address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".local_address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_local__address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.local__port().ispresent()){
if(!single_value->field_local__port.match(match_value.local__port(), legacy)){
TTCN_Logger::log_logmatch_info(".local_port");
single_value->field_local__port.log_match(match_value.local__port(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_local__port.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".local_port := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_local__port.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dest__address().ispresent()){
if(!single_value->field_dest__address.match(match_value.dest__address(), legacy)){
TTCN_Logger::log_logmatch_info(".dest_address");
single_value->field_dest__address.log_match(match_value.dest__address(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dest__address.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dest_address := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dest__address.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dest__port().ispresent()){
if(!single_value->field_dest__port.match(match_value.dest__port(), legacy)){
TTCN_Logger::log_logmatch_info(".dest_port");
single_value->field_dest__port.log_match(match_value.dest__port(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dest__port.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dest_port := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dest__port.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("{ id := ");
if (match_value.id().ispresent()) {
single_value->field_id.log_match(match_value.id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_id.log();
if (single_value->field_id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", local_address := ");
if (match_value.local__address().ispresent()) {
single_value->field_local__address.log_match(match_value.local__address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_local__address.log();
if (single_value->field_local__address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", local_port := ");
if (match_value.local__port().ispresent()) {
single_value->field_local__port.log_match(match_value.local__port(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_local__port.log();
if (single_value->field_local__port.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dest_address := ");
if (match_value.dest__address().ispresent()) {
single_value->field_dest__address.log_match(match_value.dest__address(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dest__address.log();
if (single_value->field_dest__address.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dest_port := ");
if (match_value.dest__port().ispresent()) {
single_value->field_dest__port.log_match(match_value.dest__port(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dest__port.log();
if (single_value->field_dest__port.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 Osmux__session__par_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!id().is_bound()) id() = OMIT_VALUE;
else id().set_implicit_omit();
if (!local__address().is_bound()) local__address() = OMIT_VALUE;
else local__address().set_implicit_omit();
if (!local__port().is_bound()) local__port() = OMIT_VALUE;
else local__port().set_implicit_omit();
if (!dest__address().is_bound()) dest__address() = OMIT_VALUE;
else dest__address().set_implicit_omit();
if (!dest__port().is_bound()) dest__port() = OMIT_VALUE;
else dest__port().set_implicit_omit();
}

void Osmux__session__par_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_id.encode_text(text_buf);
single_value->field_local__address.encode_text(text_buf);
single_value->field_local__port.encode_text(text_buf);
single_value->field_dest__address.encode_text(text_buf);
single_value->field_dest__port.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 @OSMUX_Types.Osmux_session_par.");
}
}

void Osmux__session__par_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_id.decode_text(text_buf);
single_value->field_local__address.decode_text(text_buf);
single_value->field_local__port.decode_text(text_buf);
single_value->field_dest__address.decode_text(text_buf);
single_value->field_dest__port.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 Osmux__session__par_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 @OSMUX_Types.Osmux_session_par.");
}
}

void Osmux__session__par_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: {
    Osmux__session__par_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 (5<param.get_size()) {
      param.error("record template of type @OSMUX_Types.Osmux_session_par has 5 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) id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__address().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__port().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dest__address().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dest__port().set_param(*param.get_elem(4));
    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(), "id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          id().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(), "local_address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__address().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(), "local_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__port().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(), "dest_address")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dest__address().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(), "dest_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dest__port().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 @OSMUX_Types.Osmux_session_par: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Osmux__session__par_template* precondition = new Osmux__session__par_template;
    precondition->set_param(*param.get_elem(0));
    Osmux__session__par_template* implied_template = new Osmux__session__par_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Osmux__session__par_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.Osmux_session_par");
  }
  is_ifpresent = param.get_ifpresent();
}

void Osmux__session__par_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_id.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_session_par");
single_value->field_local__address.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_session_par");
single_value->field_local__port.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_session_par");
single_value->field_dest__address.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_session_par");
single_value->field_dest__port.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.Osmux_session_par");
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 : "@OSMUX_Types.Osmux_session_par");
}

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

boolean Osmux__session__par_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;
}

ASP__Osmux__Open__session::ASP__Osmux__Open__session()
{
}

ASP__Osmux__Open__session::ASP__Osmux__Open__session(const Osmux__session__par& par_session__id)
  :   field_session__id(par_session__id)
{
}

ASP__Osmux__Open__session::ASP__Osmux__Open__session(const ASP__Osmux__Open__session& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.ASP_Osmux_Open_session.");
if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
else field_session__id.clean_up();
}

void ASP__Osmux__Open__session::clean_up()
{
field_session__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__Osmux__Open__session::get_descriptor() const { return &ASP__Osmux__Open__session_descr_; }
ASP__Osmux__Open__session& ASP__Osmux__Open__session::operator=(const ASP__Osmux__Open__session& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.ASP_Osmux_Open_session.");
  if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
  else field_session__id.clean_up();
}
return *this;
}

boolean ASP__Osmux__Open__session::operator==(const ASP__Osmux__Open__session& other_value) const
{
return field_session__id==other_value.field_session__id;
}

boolean ASP__Osmux__Open__session::is_bound() const
{
return (field_session__id.is_bound());
}
boolean ASP__Osmux__Open__session::is_value() const
{
return field_session__id.is_value();
}
void ASP__Osmux__Open__session::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ session_id := ");
field_session__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__Osmux__Open__session::set_implicit_omit()
{
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Open__session::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 (1<param.get_size()) {
      param.error("record value of type @OSMUX_Types.ASP_Osmux_Open_session has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Open_session: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.ASP_Osmux_Open_session");
  }
}

void ASP__Osmux__Open__session::encode_text(Text_Buf& text_buf) const
{
field_session__id.encode_text(text_buf);
}

void ASP__Osmux__Open__session::decode_text(Text_Buf& text_buf)
{
field_session__id.decode_text(text_buf);
}

void ASP__Osmux__Open__session::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 ASP__Osmux__Open__session::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 ASP__Osmux__Open__session::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, Osmux__session__par_descr_.raw->forceomit);
  decoded_field_length = field_session__id.RAW_decode(Osmux__session__par_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__Osmux__Open__session::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, Osmux__session__par_descr_.raw);
  encoded_length += field_session__id.RAW_encode(Osmux__session__par_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct ASP__Osmux__Open__session_template::single_value_struct {
Osmux__session__par_template field_session__id;
};

void ASP__Osmux__Open__session_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_session__id = ANY_VALUE;
}
}
}

void ASP__Osmux__Open__session_template::copy_value(const ASP__Osmux__Open__session& other_value)
{
single_value = new single_value_struct;
if (other_value.session__id().is_bound()) {
  single_value->field_session__id = other_value.session__id();
} else {
  single_value->field_session__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__Osmux__Open__session_template::copy_template(const ASP__Osmux__Open__session_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.session__id().get_selection()) {
single_value->field_session__id = other_value.session__id();
} else {
single_value->field_session__id.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 ASP__Osmux__Open__session_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 ASP__Osmux__Open__session_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__Osmux__Open__session_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 @OSMUX_Types.ASP_Osmux_Open_session.");
break;
}
set_selection(other_value);
}

ASP__Osmux__Open__session_template::ASP__Osmux__Open__session_template()
{
}

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

ASP__Osmux__Open__session_template::ASP__Osmux__Open__session_template(const ASP__Osmux__Open__session& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ASP__Osmux__Open__session_template& ASP__Osmux__Open__session_template::operator=(const OPTIONAL<ASP__Osmux__Open__session>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ASP__Osmux__Open__session&)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 @OSMUX_Types.ASP_Osmux_Open_session.");
}
return *this;
}

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

boolean ASP__Osmux__Open__session_template::match(const ASP__Osmux__Open__session& 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.session__id().is_bound()) return FALSE;
if(!single_value->field_session__id.match(other_value.session__id(), 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 @OSMUX_Types.ASP_Osmux_Open_session.");
}
return FALSE;
}

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

boolean ASP__Osmux__Open__session_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_session__id.is_value();
}

void ASP__Osmux__Open__session_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;
}

ASP__Osmux__Open__session ASP__Osmux__Open__session_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 @OSMUX_Types.ASP_Osmux_Open_session.");
ASP__Osmux__Open__session ret_val;
if (single_value->field_session__id.is_bound()) {
ret_val.session__id() = single_value->field_session__id.valueof();
}
return ret_val;
}

void ASP__Osmux__Open__session_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 @OSMUX_Types.ASP_Osmux_Open_session.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__Osmux__Open__session_template[list_length];
}

ASP__Osmux__Open__session_template& ASP__Osmux__Open__session_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 @OSMUX_Types.ASP_Osmux_Open_session.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.ASP_Osmux_Open_session.");
return value_list.list_value[list_index];
}

Osmux__session__par_template& ASP__Osmux__Open__session_template::session__id()
{
set_specific();
return single_value->field_session__id;
}

const Osmux__session__par_template& ASP__Osmux__Open__session_template::session__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field session_id of a non-specific template of type @OSMUX_Types.ASP_Osmux_Open_session.");
return single_value->field_session__id;
}

int ASP__Osmux__Open__session_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session 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 @OSMUX_Types.ASP_Osmux_Open_session containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.ASP_Osmux_Open_session.");
  }
  return 0;
}

void ASP__Osmux__Open__session_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ session_id := ");
single_value->field_session__id.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 ASP__Osmux__Open__session_template::log_match(const ASP__Osmux__Open__session& 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_session__id.match(match_value.session__id(), legacy)){
TTCN_Logger::log_logmatch_info(".session_id");
single_value->field_session__id.log_match(match_value.session__id(), 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("{ session_id := ");
single_value->field_session__id.log_match(match_value.session__id(), 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 ASP__Osmux__Open__session_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Open__session_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_session__id.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 @OSMUX_Types.ASP_Osmux_Open_session.");
}
}

void ASP__Osmux__Open__session_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_session__id.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 ASP__Osmux__Open__session_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 @OSMUX_Types.ASP_Osmux_Open_session.");
}
}

void ASP__Osmux__Open__session_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: {
    ASP__Osmux__Open__session_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 (1<param.get_size()) {
      param.error("record template of type @OSMUX_Types.ASP_Osmux_Open_session has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Open_session: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__Osmux__Open__session_template* precondition = new ASP__Osmux__Open__session_template;
    precondition->set_param(*param.get_elem(0));
    ASP__Osmux__Open__session_template* implied_template = new ASP__Osmux__Open__session_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__Osmux__Open__session_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.ASP_Osmux_Open_session");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__Osmux__Open__session_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_session__id.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.ASP_Osmux_Open_session");
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 : "@OSMUX_Types.ASP_Osmux_Open_session");
}

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

boolean ASP__Osmux__Open__session_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;
}

ASP__Osmux__Open__session__result::ASP__Osmux__Open__session__result()
{
}

ASP__Osmux__Open__session__result::ASP__Osmux__Open__session__result(const Osmux__session__par& par_session__id)
  :   field_session__id(par_session__id)
{
}

ASP__Osmux__Open__session__result::ASP__Osmux__Open__session__result(const ASP__Osmux__Open__session__result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.ASP_Osmux_Open_session_result.");
if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
else field_session__id.clean_up();
}

void ASP__Osmux__Open__session__result::clean_up()
{
field_session__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__Osmux__Open__session__result::get_descriptor() const { return &ASP__Osmux__Open__session__result_descr_; }
ASP__Osmux__Open__session__result& ASP__Osmux__Open__session__result::operator=(const ASP__Osmux__Open__session__result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.ASP_Osmux_Open_session_result.");
  if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
  else field_session__id.clean_up();
}
return *this;
}

boolean ASP__Osmux__Open__session__result::operator==(const ASP__Osmux__Open__session__result& other_value) const
{
return field_session__id==other_value.field_session__id;
}

boolean ASP__Osmux__Open__session__result::is_bound() const
{
return (field_session__id.is_bound());
}
boolean ASP__Osmux__Open__session__result::is_value() const
{
return field_session__id.is_value();
}
void ASP__Osmux__Open__session__result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ session_id := ");
field_session__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__Osmux__Open__session__result::set_implicit_omit()
{
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Open__session__result::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 (1<param.get_size()) {
      param.error("record value of type @OSMUX_Types.ASP_Osmux_Open_session_result has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Open_session_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.ASP_Osmux_Open_session_result");
  }
}

void ASP__Osmux__Open__session__result::encode_text(Text_Buf& text_buf) const
{
field_session__id.encode_text(text_buf);
}

void ASP__Osmux__Open__session__result::decode_text(Text_Buf& text_buf)
{
field_session__id.decode_text(text_buf);
}

void ASP__Osmux__Open__session__result::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 ASP__Osmux__Open__session__result::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 ASP__Osmux__Open__session__result::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, Osmux__session__par_descr_.raw->forceomit);
  decoded_field_length = field_session__id.RAW_decode(Osmux__session__par_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__Osmux__Open__session__result::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, Osmux__session__par_descr_.raw);
  encoded_length += field_session__id.RAW_encode(Osmux__session__par_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct ASP__Osmux__Open__session__result_template::single_value_struct {
Osmux__session__par_template field_session__id;
};

void ASP__Osmux__Open__session__result_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_session__id = ANY_VALUE;
}
}
}

void ASP__Osmux__Open__session__result_template::copy_value(const ASP__Osmux__Open__session__result& other_value)
{
single_value = new single_value_struct;
if (other_value.session__id().is_bound()) {
  single_value->field_session__id = other_value.session__id();
} else {
  single_value->field_session__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__Osmux__Open__session__result_template::copy_template(const ASP__Osmux__Open__session__result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.session__id().get_selection()) {
single_value->field_session__id = other_value.session__id();
} else {
single_value->field_session__id.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 ASP__Osmux__Open__session__result_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 ASP__Osmux__Open__session__result_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__Osmux__Open__session__result_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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
break;
}
set_selection(other_value);
}

ASP__Osmux__Open__session__result_template::ASP__Osmux__Open__session__result_template()
{
}

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

ASP__Osmux__Open__session__result_template::ASP__Osmux__Open__session__result_template(const ASP__Osmux__Open__session__result& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ASP__Osmux__Open__session__result_template& ASP__Osmux__Open__session__result_template::operator=(const OPTIONAL<ASP__Osmux__Open__session__result>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ASP__Osmux__Open__session__result&)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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
}
return *this;
}

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

boolean ASP__Osmux__Open__session__result_template::match(const ASP__Osmux__Open__session__result& 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.session__id().is_bound()) return FALSE;
if(!single_value->field_session__id.match(other_value.session__id(), 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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
}
return FALSE;
}

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

boolean ASP__Osmux__Open__session__result_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_session__id.is_value();
}

void ASP__Osmux__Open__session__result_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;
}

ASP__Osmux__Open__session__result ASP__Osmux__Open__session__result_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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
ASP__Osmux__Open__session__result ret_val;
if (single_value->field_session__id.is_bound()) {
ret_val.session__id() = single_value->field_session__id.valueof();
}
return ret_val;
}

void ASP__Osmux__Open__session__result_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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__Osmux__Open__session__result_template[list_length];
}

ASP__Osmux__Open__session__result_template& ASP__Osmux__Open__session__result_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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.ASP_Osmux_Open_session_result.");
return value_list.list_value[list_index];
}

Osmux__session__par_template& ASP__Osmux__Open__session__result_template::session__id()
{
set_specific();
return single_value->field_session__id;
}

const Osmux__session__par_template& ASP__Osmux__Open__session__result_template::session__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field session_id of a non-specific template of type @OSMUX_Types.ASP_Osmux_Open_session_result.");
return single_value->field_session__id;
}

int ASP__Osmux__Open__session__result_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result 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 @OSMUX_Types.ASP_Osmux_Open_session_result containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Open_session_result containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.ASP_Osmux_Open_session_result.");
  }
  return 0;
}

void ASP__Osmux__Open__session__result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ session_id := ");
single_value->field_session__id.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 ASP__Osmux__Open__session__result_template::log_match(const ASP__Osmux__Open__session__result& 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_session__id.match(match_value.session__id(), legacy)){
TTCN_Logger::log_logmatch_info(".session_id");
single_value->field_session__id.log_match(match_value.session__id(), 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("{ session_id := ");
single_value->field_session__id.log_match(match_value.session__id(), 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 ASP__Osmux__Open__session__result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Open__session__result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_session__id.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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
}
}

void ASP__Osmux__Open__session__result_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_session__id.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 ASP__Osmux__Open__session__result_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 @OSMUX_Types.ASP_Osmux_Open_session_result.");
}
}

void ASP__Osmux__Open__session__result_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: {
    ASP__Osmux__Open__session__result_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 (1<param.get_size()) {
      param.error("record template of type @OSMUX_Types.ASP_Osmux_Open_session_result has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Open_session_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__Osmux__Open__session__result_template* precondition = new ASP__Osmux__Open__session__result_template;
    precondition->set_param(*param.get_elem(0));
    ASP__Osmux__Open__session__result_template* implied_template = new ASP__Osmux__Open__session__result_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__Osmux__Open__session__result_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.ASP_Osmux_Open_session_result");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__Osmux__Open__session__result_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_session__id.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.ASP_Osmux_Open_session_result");
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 : "@OSMUX_Types.ASP_Osmux_Open_session_result");
}

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

boolean ASP__Osmux__Open__session__result_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;
}

ASP__Osmux__Close__session::ASP__Osmux__Close__session()
{
}

ASP__Osmux__Close__session::ASP__Osmux__Close__session(const Osmux__session__par& par_session__id)
  :   field_session__id(par_session__id)
{
}

ASP__Osmux__Close__session::ASP__Osmux__Close__session(const ASP__Osmux__Close__session& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Types.ASP_Osmux_Close_session.");
if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
else field_session__id.clean_up();
}

void ASP__Osmux__Close__session::clean_up()
{
field_session__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__Osmux__Close__session::get_descriptor() const { return &ASP__Osmux__Close__session_descr_; }
ASP__Osmux__Close__session& ASP__Osmux__Close__session::operator=(const ASP__Osmux__Close__session& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Types.ASP_Osmux_Close_session.");
  if (other_value.session__id().is_bound()) field_session__id = other_value.session__id();
  else field_session__id.clean_up();
}
return *this;
}

boolean ASP__Osmux__Close__session::operator==(const ASP__Osmux__Close__session& other_value) const
{
return field_session__id==other_value.field_session__id;
}

boolean ASP__Osmux__Close__session::is_bound() const
{
return (field_session__id.is_bound());
}
boolean ASP__Osmux__Close__session::is_value() const
{
return field_session__id.is_value();
}
void ASP__Osmux__Close__session::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ session_id := ");
field_session__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__Osmux__Close__session::set_implicit_omit()
{
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Close__session::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 (1<param.get_size()) {
      param.error("record value of type @OSMUX_Types.ASP_Osmux_Close_session has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Close_session: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Types.ASP_Osmux_Close_session");
  }
}

void ASP__Osmux__Close__session::encode_text(Text_Buf& text_buf) const
{
field_session__id.encode_text(text_buf);
}

void ASP__Osmux__Close__session::decode_text(Text_Buf& text_buf)
{
field_session__id.decode_text(text_buf);
}

void ASP__Osmux__Close__session::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 ASP__Osmux__Close__session::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 ASP__Osmux__Close__session::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, Osmux__session__par_descr_.raw->forceomit);
  decoded_field_length = field_session__id.RAW_decode(Osmux__session__par_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__Osmux__Close__session::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 = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, Osmux__session__par_descr_.raw);
  encoded_length += field_session__id.RAW_encode(Osmux__session__par_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct ASP__Osmux__Close__session_template::single_value_struct {
Osmux__session__par_template field_session__id;
};

void ASP__Osmux__Close__session_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_session__id = ANY_VALUE;
}
}
}

void ASP__Osmux__Close__session_template::copy_value(const ASP__Osmux__Close__session& other_value)
{
single_value = new single_value_struct;
if (other_value.session__id().is_bound()) {
  single_value->field_session__id = other_value.session__id();
} else {
  single_value->field_session__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__Osmux__Close__session_template::copy_template(const ASP__Osmux__Close__session_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.session__id().get_selection()) {
single_value->field_session__id = other_value.session__id();
} else {
single_value->field_session__id.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 ASP__Osmux__Close__session_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 ASP__Osmux__Close__session_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__Osmux__Close__session_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 @OSMUX_Types.ASP_Osmux_Close_session.");
break;
}
set_selection(other_value);
}

ASP__Osmux__Close__session_template::ASP__Osmux__Close__session_template()
{
}

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

ASP__Osmux__Close__session_template::ASP__Osmux__Close__session_template(const ASP__Osmux__Close__session& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ASP__Osmux__Close__session_template& ASP__Osmux__Close__session_template::operator=(const OPTIONAL<ASP__Osmux__Close__session>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ASP__Osmux__Close__session&)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 @OSMUX_Types.ASP_Osmux_Close_session.");
}
return *this;
}

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

boolean ASP__Osmux__Close__session_template::match(const ASP__Osmux__Close__session& 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.session__id().is_bound()) return FALSE;
if(!single_value->field_session__id.match(other_value.session__id(), 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 @OSMUX_Types.ASP_Osmux_Close_session.");
}
return FALSE;
}

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

boolean ASP__Osmux__Close__session_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_session__id.is_value();
}

void ASP__Osmux__Close__session_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;
}

ASP__Osmux__Close__session ASP__Osmux__Close__session_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 @OSMUX_Types.ASP_Osmux_Close_session.");
ASP__Osmux__Close__session ret_val;
if (single_value->field_session__id.is_bound()) {
ret_val.session__id() = single_value->field_session__id.valueof();
}
return ret_val;
}

void ASP__Osmux__Close__session_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 @OSMUX_Types.ASP_Osmux_Close_session.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__Osmux__Close__session_template[list_length];
}

ASP__Osmux__Close__session_template& ASP__Osmux__Close__session_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 @OSMUX_Types.ASP_Osmux_Close_session.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @OSMUX_Types.ASP_Osmux_Close_session.");
return value_list.list_value[list_index];
}

Osmux__session__par_template& ASP__Osmux__Close__session_template::session__id()
{
set_specific();
return single_value->field_session__id;
}

const Osmux__session__par_template& ASP__Osmux__Close__session_template::session__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field session_id of a non-specific template of type @OSMUX_Types.ASP_Osmux_Close_session.");
return single_value->field_session__id;
}

int ASP__Osmux__Close__session_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session 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 @OSMUX_Types.ASP_Osmux_Close_session containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Types.ASP_Osmux_Close_session containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Types.ASP_Osmux_Close_session.");
  }
  return 0;
}

void ASP__Osmux__Close__session_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ session_id := ");
single_value->field_session__id.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 ASP__Osmux__Close__session_template::log_match(const ASP__Osmux__Close__session& 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_session__id.match(match_value.session__id(), legacy)){
TTCN_Logger::log_logmatch_info(".session_id");
single_value->field_session__id.log_match(match_value.session__id(), 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("{ session_id := ");
single_value->field_session__id.log_match(match_value.session__id(), 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 ASP__Osmux__Close__session_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (session__id().is_bound()) session__id().set_implicit_omit();
}

void ASP__Osmux__Close__session_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_session__id.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 @OSMUX_Types.ASP_Osmux_Close_session.");
}
}

void ASP__Osmux__Close__session_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_session__id.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 ASP__Osmux__Close__session_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 @OSMUX_Types.ASP_Osmux_Close_session.");
}
}

void ASP__Osmux__Close__session_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: {
    ASP__Osmux__Close__session_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 (1<param.get_size()) {
      param.error("record template of type @OSMUX_Types.ASP_Osmux_Close_session has 1 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) session__id().set_param(*param.get_elem(0));
    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(), "session_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          session__id().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 @OSMUX_Types.ASP_Osmux_Close_session: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__Osmux__Close__session_template* precondition = new ASP__Osmux__Close__session_template;
    precondition->set_param(*param.get_elem(0));
    ASP__Osmux__Close__session_template* implied_template = new ASP__Osmux__Close__session_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__Osmux__Close__session_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Types.ASP_Osmux_Close_session");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__Osmux__Close__session_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_session__id.check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.ASP_Osmux_Close_session");
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 : "@OSMUX_Types.ASP_Osmux_Close_session");
}

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

boolean ASP__Osmux__Close__session_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 OSMUX__PDU::copy_value(const OSMUX__PDU& other_value)
{
switch (other_value.union_selection) {
case ALT_osmux__amr:
field_osmux__amr = new PDU__Osmux__AMR(*other_value.field_osmux__amr);
break;
case ALT_osmux__dummy:
field_osmux__dummy = new PDU__Osmux__DUMMY(*other_value.field_osmux__dummy);
break;
default:
TTCN_error("Assignment of an unbound union value of type @OSMUX_Types.OSMUX_PDU.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean OSMUX__PDU::operator==(const OSMUX__PDU& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @OSMUX_Types.OSMUX_PDU.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @OSMUX_Types.OSMUX_PDU.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_osmux__amr:
return *field_osmux__amr == *other_value.field_osmux__amr;
case ALT_osmux__dummy:
return *field_osmux__dummy == *other_value.field_osmux__dummy;
default:
return FALSE;
}
}

PDU__Osmux__AMR& OSMUX__PDU::osmux__amr()
{
if (union_selection != ALT_osmux__amr) {
clean_up();
field_osmux__amr = new PDU__Osmux__AMR;
union_selection = ALT_osmux__amr;
}
return *field_osmux__amr;
}

const PDU__Osmux__AMR& OSMUX__PDU::osmux__amr() const
{
if (union_selection != ALT_osmux__amr) TTCN_error("Using non-selected field osmux_amr in a value of union type @OSMUX_Types.OSMUX_PDU.");
return *field_osmux__amr;
}

PDU__Osmux__DUMMY& OSMUX__PDU::osmux__dummy()
{
if (union_selection != ALT_osmux__dummy) {
clean_up();
field_osmux__dummy = new PDU__Osmux__DUMMY;
union_selection = ALT_osmux__dummy;
}
return *field_osmux__dummy;
}

const PDU__Osmux__DUMMY& OSMUX__PDU::osmux__dummy() const
{
if (union_selection != ALT_osmux__dummy) TTCN_error("Using non-selected field osmux_dummy in a value of union type @OSMUX_Types.OSMUX_PDU.");
return *field_osmux__dummy;
}

boolean OSMUX__PDU::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 @OSMUX_Types.OSMUX_PDU.");
return union_selection == checked_selection;
}

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

boolean OSMUX__PDU::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_osmux__amr: return field_osmux__amr->is_value();
case ALT_osmux__dummy: return field_osmux__dummy->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void OSMUX__PDU::clean_up()
{
switch (union_selection) {
case ALT_osmux__amr:
  delete field_osmux__amr;
  break;
case ALT_osmux__dummy:
  delete field_osmux__dummy;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void OSMUX__PDU::log() const
{
switch (union_selection) {
case ALT_osmux__amr:
TTCN_Logger::log_event_str("{ osmux_amr := ");
field_osmux__amr->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_osmux__dummy:
TTCN_Logger::log_event_str("{ osmux_dummy := ");
field_osmux__dummy->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void OSMUX__PDU::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, "osmux_amr")) {
    osmux__amr().set_param(*mp_last);
    if (!osmux__amr().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "osmux_dummy")) {
    osmux__dummy().set_param(*mp_last);
    if (!osmux__dummy().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @OSMUX_Types.OSMUX_PDU.", last_name);
}

void OSMUX__PDU::set_implicit_omit()
{
switch (union_selection) {
case ALT_osmux__amr:
field_osmux__amr->set_implicit_omit(); break;
case ALT_osmux__dummy:
field_osmux__dummy->set_implicit_omit(); break;
default: break;
}
}

void OSMUX__PDU::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_osmux__amr:
field_osmux__amr->encode_text(text_buf);
break;
case ALT_osmux__dummy:
field_osmux__dummy->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @OSMUX_Types.OSMUX_PDU.");
}
}

void OSMUX__PDU::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_osmux__amr:
osmux__amr().decode_text(text_buf);
break;
case ALT_osmux__dummy:
osmux__dummy().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @OSMUX_Types.OSMUX_PDU.");
}
}

void OSMUX__PDU::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 OSMUX__PDU::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 OSMUX__PDU::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, PDU__Osmux__AMR_descr_.raw->forceomit);
      decoded_length = osmux__amr().RAW_decode(PDU__Osmux__AMR_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, PDU__Osmux__DUMMY_descr_.raw->forceomit);
      decoded_length = osmux__dummy().RAW_decode(PDU__Osmux__DUMMY_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 {
    boolean already_failed = FALSE;
    INTEGER temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 1);
      decoded_0_length = temporal_0.RAW_decode(Osmux__AMR__header_ft_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 == 1) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, PDU__Osmux__AMR_descr_.raw->forceomit);
          decoded_length = osmux__amr().RAW_decode(PDU__Osmux__AMR_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_osmux__amr).header().ft() == 1) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 == 2) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, PDU__Osmux__DUMMY_descr_.raw->forceomit);
          decoded_length = osmux__dummy().RAW_decode(PDU__Osmux__DUMMY_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_osmux__dummy).header().ft() == 2) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int OSMUX__PDU::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_osmux__amr:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, PDU__Osmux__AMR_descr_.raw);
    encoded_length = field_osmux__amr->RAW_encode(PDU__Osmux__AMR_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &PDU__Osmux__AMR_descr_;
    if ((*field_osmux__amr).header().ft() != 1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+3;
  int new_pos0[]={0,0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,3,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
  INTEGER new_val = 1;
  new_val.RAW_encode(Osmux__AMR__header_ft_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);
  }
    }
    break;
  case ALT_osmux__dummy:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, PDU__Osmux__DUMMY_descr_.raw);
    encoded_length = field_osmux__dummy->RAW_encode(PDU__Osmux__DUMMY_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &PDU__Osmux__DUMMY_descr_;
    if ((*field_osmux__dummy).header().ft() != 2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+3;
  int new_pos0[]={1,0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,3,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
  INTEGER new_val = 2;
  new_val.RAW_encode(Osmux__AMR__header_ft_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);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void OSMUX__PDU_template::copy_value(const OSMUX__PDU& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr = new PDU__Osmux__AMR_template(other_value.osmux__amr());
break;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy = new PDU__Osmux__DUMMY_template(other_value.osmux__dummy());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @OSMUX_Types.OSMUX_PDU.");
}
set_selection(SPECIFIC_VALUE);
}

void OSMUX__PDU_template::copy_template(const OSMUX__PDU_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 OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr = new PDU__Osmux__AMR_template(*other_value.single_value.field_osmux__amr);
break;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy = new PDU__Osmux__DUMMY_template(*other_value.single_value.field_osmux__dummy);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @OSMUX_Types.OSMUX_PDU.");
}
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 OSMUX__PDU_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 OSMUX__PDU_template(*other_value.implication_.precondition);
implication_.implied_template = new OSMUX__PDU_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 @OSMUX_Types.OSMUX_PDU.");
}
set_selection(other_value);
}

OSMUX__PDU_template::OSMUX__PDU_template()
{
}

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

OSMUX__PDU_template::OSMUX__PDU_template(const OSMUX__PDU& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void OSMUX__PDU_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
delete single_value.field_osmux__amr;
break;
case OSMUX__PDU::ALT_osmux__dummy:
delete single_value.field_osmux__dummy;
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;
}

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

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

OSMUX__PDU_template& OSMUX__PDU_template::operator=(const OPTIONAL<OSMUX__PDU>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const OSMUX__PDU&)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 @OSMUX_Types.OSMUX_PDU.");
}
return *this;
}

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

boolean OSMUX__PDU_template::match(const OSMUX__PDU& 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:
{
OSMUX__PDU::union_selection_type value_selection = other_value.get_selection();
if (value_selection == OSMUX__PDU::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case OSMUX__PDU::ALT_osmux__amr:
return single_value.field_osmux__amr->match(other_value.osmux__amr(), legacy);
case OSMUX__PDU::ALT_osmux__dummy:
return single_value.field_osmux__dummy->match(other_value.osmux__dummy(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @OSMUX_Types.OSMUX_PDU.");
}
}
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 @OSMUX_Types.OSMUX_PDU.");
}
return FALSE;
}

boolean OSMUX__PDU_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
return single_value.field_osmux__amr->is_value();
case OSMUX__PDU::ALT_osmux__dummy:
return single_value.field_osmux__dummy->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @OSMUX_Types.OSMUX_PDU.");
}
}

OSMUX__PDU OSMUX__PDU_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 @OSMUX_Types.OSMUX_PDU.");
OSMUX__PDU ret_val;
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
ret_val.osmux__amr() = single_value.field_osmux__amr->valueof();
break;
case OSMUX__PDU::ALT_osmux__dummy:
ret_val.osmux__dummy() = single_value.field_osmux__dummy->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @OSMUX_Types.OSMUX_PDU.");
}
return ret_val;
}

OSMUX__PDU_template& OSMUX__PDU_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 @OSMUX_Types.OSMUX_PDU.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @OSMUX_Types.OSMUX_PDU.");
return value_list.list_value[list_index];
}
void OSMUX__PDU_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 @OSMUX_Types.OSMUX_PDU.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new OSMUX__PDU_template[list_length];
}

PDU__Osmux__AMR_template& OSMUX__PDU_template::osmux__amr()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OSMUX__PDU::ALT_osmux__amr) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_osmux__amr = new PDU__Osmux__AMR_template(ANY_VALUE);
else single_value.field_osmux__amr = new PDU__Osmux__AMR_template;
single_value.union_selection = OSMUX__PDU::ALT_osmux__amr;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_osmux__amr;
}

const PDU__Osmux__AMR_template& OSMUX__PDU_template::osmux__amr() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field osmux_amr in a non-specific template of union type @OSMUX_Types.OSMUX_PDU.");
if (single_value.union_selection != OSMUX__PDU::ALT_osmux__amr) TTCN_error("Accessing non-selected field osmux_amr in a template of union type @OSMUX_Types.OSMUX_PDU.");
return *single_value.field_osmux__amr;
}

PDU__Osmux__DUMMY_template& OSMUX__PDU_template::osmux__dummy()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != OSMUX__PDU::ALT_osmux__dummy) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_osmux__dummy = new PDU__Osmux__DUMMY_template(ANY_VALUE);
else single_value.field_osmux__dummy = new PDU__Osmux__DUMMY_template;
single_value.union_selection = OSMUX__PDU::ALT_osmux__dummy;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_osmux__dummy;
}

const PDU__Osmux__DUMMY_template& OSMUX__PDU_template::osmux__dummy() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field osmux_dummy in a non-specific template of union type @OSMUX_Types.OSMUX_PDU.");
if (single_value.union_selection != OSMUX__PDU::ALT_osmux__dummy) TTCN_error("Accessing non-selected field osmux_dummy in a template of union type @OSMUX_Types.OSMUX_PDU.");
return *single_value.field_osmux__dummy;
}

boolean OSMUX__PDU_template::ischosen(OSMUX__PDU::union_selection_type checked_selection) const
{
if (checked_selection == OSMUX__PDU::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @OSMUX_Types.OSMUX_PDU.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == OSMUX__PDU::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @OSMUX_Types.OSMUX_PDU.");
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 @OSMUX_Types.OSMUX_PDU 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 OSMUX__PDU_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
TTCN_Logger::log_event_str("{ osmux_amr := ");
single_value.field_osmux__amr->log();
TTCN_Logger::log_event_str(" }");
break;
case OSMUX__PDU::ALT_osmux__dummy:
TTCN_Logger::log_event_str("{ osmux_dummy := ");
single_value.field_osmux__dummy->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 OSMUX__PDU_template::log_match(const OSMUX__PDU& 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 OSMUX__PDU::ALT_osmux__amr:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".osmux_amr");
single_value.field_osmux__amr->log_match(match_value.osmux__amr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ osmux_amr := ");
single_value.field_osmux__amr->log_match(match_value.osmux__amr(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case OSMUX__PDU::ALT_osmux__dummy:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".osmux_dummy");
single_value.field_osmux__dummy->log_match(match_value.osmux__dummy(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ osmux_dummy := ");
single_value.field_osmux__dummy->log_match(match_value.osmux__dummy(), 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 OSMUX__PDU_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr->set_implicit_omit(); break;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy->set_implicit_omit(); break;
default: break;
}
}

void OSMUX__PDU_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 OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr->encode_text(text_buf);
break;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @OSMUX_Types.OSMUX_PDU.");
}
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 @OSMUX_Types.OSMUX_PDU.");
}
}

void OSMUX__PDU_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = OSMUX__PDU::UNBOUND_VALUE;
OSMUX__PDU::union_selection_type new_selection = (OSMUX__PDU::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr = new PDU__Osmux__AMR_template;
single_value.field_osmux__amr->decode_text(text_buf);
break;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy = new PDU__Osmux__DUMMY_template;
single_value.field_osmux__dummy->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @OSMUX_Types.OSMUX_PDU.");
}
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 OSMUX__PDU_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 @OSMUX_Types.OSMUX_PDU.");
}
}

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

boolean OSMUX__PDU_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 OSMUX__PDU_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 `@OSMUX_Types.OSMUX_PDU'");
    }
    if (strcmp("osmux_amr", param_field) == 0) {
      osmux__amr().set_param(param);
      return;
    } else if (strcmp("osmux_dummy", param_field) == 0) {
      osmux__dummy().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@OSMUX_Types.OSMUX_PDU'", 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: {
    OSMUX__PDU_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", "@OSMUX_Types.OSMUX_PDU");
    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, "osmux_amr")) {
      osmux__amr().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "osmux_dummy")) {
      osmux__dummy().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @OSMUX_Types.OSMUX_PDU.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    OSMUX__PDU_template* precondition = new OSMUX__PDU_template;
    precondition->set_param(*m_p->get_elem(0));
    OSMUX__PDU_template* implied_template = new OSMUX__PDU_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = OSMUX__PDU_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@OSMUX_Types.OSMUX_PDU");
  }
  is_ifpresent = param.get_ifpresent();
}

void OSMUX__PDU_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 OSMUX__PDU::ALT_osmux__amr:
single_value.field_osmux__amr->check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.OSMUX_PDU");
return;
case OSMUX__PDU::ALT_osmux__dummy:
single_value.field_osmux__dummy->check_restriction(t_res, t_name ? t_name : "@OSMUX_Types.OSMUX_PDU");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @OSMUX_Types.OSMUX_PDU.");
}
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 : "@OSMUX_Types.OSMUX_PDU");
}


/* Bodies of functions, altsteps and testcases */

OCTETSTRING enc__OSMUX__PDU(const OSMUX__PDU& msg)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_OSMUX_PDU(): Encoding @OSMUX_Types.OSMUX_PDU: ");
msg.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
msg.encode(OSMUX__PDU_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_OSMUX_PDU(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

OSMUX__PDU dec__OSMUX__PDU(const OCTETSTRING& msg)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_OSMUX_PDU(): Stream before decoding: ");
msg.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(msg);
OSMUX__PDU ret_val;
ret_val.decode(OSMUX__PDU_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_OSMUX_PDU(): Decoded @OSMUX_Types.OSMUX_PDU: ");
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_OSMUX_PDU(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

void OsmuxFT_encoder(const OsmuxFT& 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 `@OSMUX_Types.OsmuxFT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OsmuxFT_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER OsmuxFT_decoder(OCTETSTRING& input_stream, OsmuxFT& 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 `@OSMUX_Types.OsmuxFT' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OsmuxFT_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 Osmux__AMR__header_marker_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_marker_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_marker_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_marker_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 Osmux__AMR__header_ft_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_ft_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_ft_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_ft_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 Osmux__AMR__header_ctr_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_ctr_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_ctr_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_ctr_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 Osmux__AMR__header_amr__f_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_amr__f_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_amr__f_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_amr__f_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 Osmux__AMR__header_amr__q_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_amr__q_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_amr__q_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_amr__q_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 Osmux__AMR__header_seq_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_seq_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_seq_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_seq_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 Osmux__AMR__header_cid_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_cid_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_cid_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_cid_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 Osmux__AMR__header_amr__ft_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_amr__ft_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_amr__ft_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_amr__ft_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 Osmux__AMR__header_amr__cmr_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_amr__cmr_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_amr__cmr_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_amr__cmr_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 Osmux__AMR__header_encoder(const Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__AMR__header_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__AMR__header_decoder(OCTETSTRING& input_stream, Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__AMR__header_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__Osmux__AMR_header_encoder(const Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__Osmux__AMR_header_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__AMR_header_decoder(OCTETSTRING& input_stream, Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__Osmux__AMR_header_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__Osmux__AMR_data_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(PDU__Osmux__AMR_data_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__AMR_data_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(PDU__Osmux__AMR_data_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__Osmux__AMR_encoder(const PDU__Osmux__AMR& 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 `@OSMUX_Types.PDU_Osmux_AMR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__Osmux__AMR_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__AMR_decoder(OCTETSTRING& input_stream, PDU__Osmux__AMR& 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 `@OSMUX_Types.PDU_Osmux_AMR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__Osmux__AMR_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__Osmux__DUMMY_header_encoder(const Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__Osmux__DUMMY_header_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__DUMMY_header_decoder(OCTETSTRING& input_stream, Osmux__AMR__header& 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 `@OSMUX_Types.Osmux_AMR_header' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__Osmux__DUMMY_header_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__Osmux__DUMMY_data_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(PDU__Osmux__DUMMY_data_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__DUMMY_data_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(PDU__Osmux__DUMMY_data_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__Osmux__DUMMY_encoder(const PDU__Osmux__DUMMY& 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 `@OSMUX_Types.PDU_Osmux_DUMMY' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(PDU__Osmux__DUMMY_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER PDU__Osmux__DUMMY_decoder(OCTETSTRING& input_stream, PDU__Osmux__DUMMY& 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 `@OSMUX_Types.PDU_Osmux_DUMMY' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(PDU__Osmux__DUMMY_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 Osmux__session__par_id_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_id_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(INTEGER_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 Osmux__session__par_local__address_encoder(const CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CHARSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_local__address_decoder(OCTETSTRING& input_stream, CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CHARSTRING_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 Osmux__session__par_local__port_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_local__port_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(INTEGER_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 Osmux__session__par_dest__address_encoder(const CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CHARSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_dest__address_decoder(OCTETSTRING& input_stream, CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CHARSTRING_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 Osmux__session__par_dest__port_encoder(const INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_dest__port_decoder(OCTETSTRING& input_stream, INTEGER& 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 `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(INTEGER_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 Osmux__session__par_encoder(const Osmux__session__par& 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 `@OSMUX_Types.Osmux_session_par' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Osmux__session__par_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Osmux__session__par_decoder(OCTETSTRING& input_stream, Osmux__session__par& 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 `@OSMUX_Types.Osmux_session_par' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Osmux__session__par_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 ASP__Osmux__Open__session_encoder(const ASP__Osmux__Open__session& 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 `@OSMUX_Types.ASP_Osmux_Open_session' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__Osmux__Open__session_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__Osmux__Open__session_decoder(OCTETSTRING& input_stream, ASP__Osmux__Open__session& 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 `@OSMUX_Types.ASP_Osmux_Open_session' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__Osmux__Open__session_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 ASP__Osmux__Open__session__result_encoder(const ASP__Osmux__Open__session__result& 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 `@OSMUX_Types.ASP_Osmux_Open_session_result' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__Osmux__Open__session__result_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__Osmux__Open__session__result_decoder(OCTETSTRING& input_stream, ASP__Osmux__Open__session__result& 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 `@OSMUX_Types.ASP_Osmux_Open_session_result' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__Osmux__Open__session__result_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 ASP__Osmux__Close__session_encoder(const ASP__Osmux__Close__session& 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 `@OSMUX_Types.ASP_Osmux_Close_session' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__Osmux__Close__session_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__Osmux__Close__session_decoder(OCTETSTRING& input_stream, ASP__Osmux__Close__session& 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 `@OSMUX_Types.ASP_Osmux_Close_session' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__Osmux__Close__session_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 OSMUX__PDU_encoder(const OSMUX__PDU& 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 `@OSMUX_Types.OSMUX_PDU' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OSMUX__PDU_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER OSMUX__PDU_decoder(OCTETSTRING& input_stream, OSMUX__PDU& 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 `@OSMUX_Types.OSMUX_PDU' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OSMUX__PDU_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;
}
}

OSMUX__PDU_template tr__PDU__Osmux__AMR(const BITSTRING_template& marker, const INTEGER_template& ctr, const BITSTRING_template& amr__f, const BITSTRING_template& amr__q, const INTEGER_template& seq, const INTEGER_template& cid, const INTEGER_template& amr__ft, const INTEGER_template& amr__cmr, const OCTETSTRING_template& payload)
{
TTCN_Location current_location("OSMUX_Types.ttcn", 89, TTCN_Location::LOCATION_TEMPLATE, "tr_PDU_Osmux_AMR");
OSMUX__PDU_template ret_val;
{
PDU__Osmux__AMR_template& tmp_0 = ret_val.osmux__amr();
{
Osmux__AMR__header_template& tmp_1 = tmp_0.header();
tmp_1.marker() = marker;
tmp_1.ft() = 1;
tmp_1.ctr() = ctr;
tmp_1.amr__f() = amr__f;
tmp_1.amr__q() = amr__q;
tmp_1.seq() = seq;
tmp_1.cid() = cid;
tmp_1.amr__ft() = amr__ft;
tmp_1.amr__cmr() = amr__cmr;
}
tmp_0.data() = payload;
}
return ret_val;
}

OCTETSTRING f__osmux__amr__get__nth__amr__payload(const PDU__Osmux__AMR& osmux__amr, const INTEGER& nth)
{
TTCN_Location current_location("OSMUX_Types.ttcn", 115, TTCN_Location::LOCATION_FUNCTION, "f_osmux_amr_get_nth_amr_payload");
current_location.update_lineno(117);
/* OSMUX_Types.ttcn, line 117 */
INTEGER amr__pl__len(AMR__Types::f__amrft__payload__len(const_cast< const PDU__Osmux__AMR&>(osmux__amr).header().amr__ft()));
current_location.update_lineno(118);
/* OSMUX_Types.ttcn, line 118 */
if ((nth > const_cast< const PDU__Osmux__AMR&>(osmux__amr).header().ctr())) {
current_location.update_lineno(119);
/* OSMUX_Types.ttcn, line 119 */
Misc__Helpers::f__shutdown(cs_0, 119, FAIL, cs_1);
current_location.update_lineno(120);
/* OSMUX_Types.ttcn, line 120 */
return os_0;
}
current_location.update_lineno(122);
/* OSMUX_Types.ttcn, line 122 */
if (((amr__pl__len * (nth + 1)) > const_cast< const PDU__Osmux__AMR&>(osmux__amr).data().lengthof())) {
current_location.update_lineno(123);
/* OSMUX_Types.ttcn, line 123 */
Misc__Helpers::f__shutdown(cs_0, 123, FAIL, cs_2);
}
current_location.update_lineno(125);
/* OSMUX_Types.ttcn, line 125 */
OCTETSTRING pl(substr(const_cast< const PDU__Osmux__AMR&>(osmux__amr).data(), (amr__pl__len * nth), amr__pl__len));
current_location.update_lineno(126);
/* OSMUX_Types.ttcn, line 126 */
return pl;
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("OSMUX_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "OSMUX_Types");
Misc__Helpers::module_object.pre_init_module();
AMR__Types::module_object.pre_init_module();
module_object.add_function("enc_OSMUX_PDU", (genericfunc_t)&enc__OSMUX__PDU, NULL);
module_object.add_function("dec_OSMUX_PDU", (genericfunc_t)&dec__OSMUX__PDU, NULL);
module_object.add_function("f_osmux_amr_get_nth_amr_payload", (genericfunc_t)&f__osmux__amr__get__nth__amr__payload, NULL);
}

void post_init_module()
{
TTCN_Location current_location("OSMUX_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "OSMUX_Types");
Misc__Helpers::module_object.post_init_module();
AMR__Types::module_object.post_init_module();
current_location.update_lineno(89);
/* OSMUX_Types.ttcn, line 89 */
template_tr__PDU__Osmux__AMR_marker_defval = ANY_VALUE;
current_location.update_lineno(90);
/* OSMUX_Types.ttcn, line 90 */
template_tr__PDU__Osmux__AMR_ctr_defval = ANY_VALUE;
current_location.update_lineno(91);
/* OSMUX_Types.ttcn, line 91 */
template_tr__PDU__Osmux__AMR_amr__f_defval = ANY_VALUE;
current_location.update_lineno(92);
/* OSMUX_Types.ttcn, line 92 */
template_tr__PDU__Osmux__AMR_amr__q_defval = ANY_VALUE;
current_location.update_lineno(93);
/* OSMUX_Types.ttcn, line 93 */
template_tr__PDU__Osmux__AMR_seq_defval = ANY_VALUE;
current_location.update_lineno(94);
/* OSMUX_Types.ttcn, line 94 */
template_tr__PDU__Osmux__AMR_cid_defval = ANY_VALUE;
current_location.update_lineno(95);
/* OSMUX_Types.ttcn, line 95 */
template_tr__PDU__Osmux__AMR_amr__ft_defval = ANY_VALUE;
current_location.update_lineno(96);
/* OSMUX_Types.ttcn, line 96 */
template_tr__PDU__Osmux__AMR_amr__cmr_defval = ANY_VALUE;
current_location.update_lineno(97);
/* OSMUX_Types.ttcn, line 97 */
template_tr__PDU__Osmux__AMR_payload_defval = ANY_VALUE;
}


} /* end of namespace */
