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

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

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

/* Including header files */

#include "SCTPasp_Types.hh"

namespace SCTPasp__Types {

/* Literal string constants */

const unsigned char module_checksum[] = { 0xb1, 0xc6, 0x83, 0x8b, 0xc2, 0x92, 0x94, 0x17, 0x5d, 0x1e, 0x34, 0xd4, 0x4c, 0x01, 0x7e, 0xcd };

/* Global variable definitions */

const XERdescriptor_t       PDU__SCTP_xer_ = { {"PDU_SCTP>\n", "PDU_SCTP>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCTP_oer_ext_arr_[0] = {};
const int PDU__SCTP_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCTP_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCTP_oer_ext_arr_, 0, PDU__SCTP_oer_p_};
const TTCN_Typedescriptor_t PDU__SCTP_descr_ = { "@SCTPasp_Types.PDU_SCTP", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &PDU__SCTP_xer_, &OCTETSTRING_json_, &PDU__SCTP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP_sinfo__stream_xer_ = { {"sinfo_stream>\n", "sinfo_stream>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP_sinfo__stream_descr_ = { "@SCTPasp_Types.ASP_SCTP.sinfo_stream", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP_sinfo__stream_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP_sinfo__ppid_xer_ = { {"sinfo_ppid>\n", "sinfo_ppid>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP_sinfo__ppid_descr_ = { "@SCTPasp_Types.ASP_SCTP.sinfo_ppid", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP_sinfo__ppid_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP_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 ASP__SCTP_data_oer_ext_arr_[0] = {};
const int ASP__SCTP_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__SCTP_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ASP__SCTP_data_oer_ext_arr_, 0, ASP__SCTP_data_oer_p_};
const TTCN_Typedescriptor_t ASP__SCTP_data_descr_ = { "@SCTPasp_Types.ASP_SCTP.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ASP__SCTP_data_xer_, &OCTETSTRING_json_, &ASP__SCTP_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP
const TTCN_Typedescriptor_t ASP__SCTP_descr_ = { "@SCTPasp_Types.ASP_SCTP", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__Connect
const TTCN_Typedescriptor_t ASP__SCTP__Connect_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connect", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connect_peer__hostname_xer_ = { {"peer_hostname>\n", "peer_hostname>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connect_peer__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connect.peer_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__Connect_peer__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connect_peer__portnumber_xer_ = { {"peer_portnumber>\n", "peer_portnumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connect_peer__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connect.peer_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Connect_peer__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ConnectFrom_local__portnumber_xer_ = { {"local_portnumber>\n", "local_portnumber>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ConnectFrom_local__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_ConnectFrom.local_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__ConnectFrom_local__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__ConnectFrom
const TTCN_Typedescriptor_t ASP__SCTP__ConnectFrom_descr_ = { "@SCTPasp_Types.ASP_SCTP_ConnectFrom", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ConnectFrom_local__hostname_xer_ = { {"local_hostname>\n", "local_hostname>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ConnectFrom_local__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_ConnectFrom.local_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__ConnectFrom_local__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ConnectFrom_peer__hostname_xer_ = { {"peer_hostname>\n", "peer_hostname>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ConnectFrom_peer__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_ConnectFrom.peer_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__ConnectFrom_peer__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ConnectFrom_peer__portnumber_xer_ = { {"peer_portnumber>\n", "peer_portnumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ConnectFrom_peer__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_ConnectFrom.peer_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__ConnectFrom_peer__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Listen_local__portnumber_xer_ = { {"local_portnumber>\n", "local_portnumber>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Listen_local__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_Listen.local_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Listen_local__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__Listen
const TTCN_Typedescriptor_t ASP__SCTP__Listen_descr_ = { "@SCTPasp_Types.ASP_SCTP_Listen", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Listen_local__hostname_xer_ = { {"local_hostname>\n", "local_hostname>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Listen_local__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_Listen.local_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__Listen_local__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__INIT_sinit__num__ostreams_xer_ = { {"sinit_num_ostreams>\n", "sinit_num_ostreams>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__INIT_sinit__num__ostreams_descr_ = { "@SCTPasp_Types.SCTP_INIT.sinit_num_ostreams", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__INIT_sinit__num__ostreams_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__INIT_sinit__max__instreams_xer_ = { {"sinit_max_instreams>\n", "sinit_max_instreams>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__INIT_sinit__max__instreams_descr_ = { "@SCTPasp_Types.SCTP_INIT.sinit_max_instreams", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__INIT_sinit__max__instreams_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__INIT_sinit__max__attempts_xer_ = { {"sinit_max_attempts>\n", "sinit_max_attempts>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__INIT_sinit__max__attempts_descr_ = { "@SCTPasp_Types.SCTP_INIT.sinit_max_attempts", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__INIT_sinit__max__attempts_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__INIT_sinit__max__init__timeo_xer_ = { {"sinit_max_init_timeo>\n", "sinit_max_init_timeo>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__INIT_sinit__max__init__timeo_descr_ = { "@SCTPasp_Types.SCTP_INIT.sinit_max_init_timeo", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__INIT_sinit__max__init__timeo_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SCTP__INIT
const TTCN_Typedescriptor_t SCTP__INIT_descr_ = { "@SCTPasp_Types.SCTP_INIT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__data__io__event_xer_ = { {"sctp_data_io_event>\n", "sctp_data_io_event>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__data__io__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__data__io__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__data__io__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__data__io__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__data__io__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__data__io__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_data_io_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__data__io__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__data__io__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__association__event_xer_ = { {"sctp_association_event>\n", "sctp_association_event>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__association__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__association__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__association__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__association__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__association__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__association__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_association_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__association__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__association__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__address__event_xer_ = { {"sctp_address_event>\n", "sctp_address_event>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__address__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__address__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__address__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__address__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__address__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__address__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_address_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__address__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__address__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__send__failure__event_xer_ = { {"sctp_send_failure_event>\n", "sctp_send_failure_event>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__send__failure__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__send__failure__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__send__failure__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__send__failure__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__send__failure__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__send__failure__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_send_failure_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__send__failure__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__send__failure__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__peer__error__event_xer_ = { {"sctp_peer_error_event>\n", "sctp_peer_error_event>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__peer__error__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__peer__error__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__peer__error__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__peer__error__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__peer__error__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__peer__error__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_peer_error_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__peer__error__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__peer__error__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__shutdown__event_xer_ = { {"sctp_shutdown_event>\n", "sctp_shutdown_event>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__shutdown__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__shutdown__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__shutdown__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__shutdown__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__shutdown__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__shutdown__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_shutdown_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__shutdown__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__shutdown__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__partial__delivery__event_xer_ = { {"sctp_partial_delivery_event>\n", "sctp_partial_delivery_event>\n"}, {29, 29}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__partial__delivery__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__partial__delivery__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__partial__delivery__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__partial__delivery__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__partial__delivery__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__partial__delivery__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_partial_delivery_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__partial__delivery__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__partial__delivery__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__EVENTS_sctp__adaption__layer__event_xer_ = { {"sctp_adaption_layer_event>\n", "sctp_adaption_layer_event>\n"}, {27, 27}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCTP__EVENTS_sctp__adaption__layer__event_oer_ext_arr_[0] = {};
const int SCTP__EVENTS_sctp__adaption__layer__event_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCTP__EVENTS_sctp__adaption__layer__event_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCTP__EVENTS_sctp__adaption__layer__event_oer_ext_arr_, 0, SCTP__EVENTS_sctp__adaption__layer__event_oer_p_};
const TTCN_Typedescriptor_t SCTP__EVENTS_sctp__adaption__layer__event_descr_ = { "@SCTPasp_Types.SCTP_EVENTS.sctp_adaption_layer_event", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SCTP__EVENTS_sctp__adaption__layer__event_xer_, &BOOLEAN_json_, &SCTP__EVENTS_sctp__adaption__layer__event_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SCTP__EVENTS
const TTCN_Typedescriptor_t SCTP__EVENTS_descr_ = { "@SCTPasp_Types.SCTP_EVENTS", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SO__LINGER_l__onoff_xer_ = { {"l_onoff>\n", "l_onoff>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SO__LINGER_l__onoff_descr_ = { "@SCTPasp_Types.SO_LINGER.l_onoff", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SO__LINGER_l__onoff_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SO__LINGER_l__linger_xer_ = { {"l_linger>\n", "l_linger>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SO__LINGER_l__linger_descr_ = { "@SCTPasp_Types.SO_LINGER.l_linger", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SO__LINGER_l__linger_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SO__LINGER
const TTCN_Typedescriptor_t SO__LINGER_descr_ = { "@SCTPasp_Types.SO_LINGER", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__RTOINFO_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__RTOINFO_client__id_descr_ = { "@SCTPasp_Types.SCTP_RTOINFO.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__RTOINFO_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__RTOINFO_srto__initial_xer_ = { {"srto_initial>\n", "srto_initial>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__RTOINFO_srto__initial_descr_ = { "@SCTPasp_Types.SCTP_RTOINFO.srto_initial", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__RTOINFO_srto__initial_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__RTOINFO_srto__max_xer_ = { {"srto_max>\n", "srto_max>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__RTOINFO_srto__max_descr_ = { "@SCTPasp_Types.SCTP_RTOINFO.srto_max", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__RTOINFO_srto__max_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SCTP__RTOINFO_srto__min_xer_ = { {"srto_min>\n", "srto_min>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCTP__RTOINFO_srto__min_descr_ = { "@SCTPasp_Types.SCTP_RTOINFO.srto_min", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SCTP__RTOINFO_srto__min_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SCTP__RTOINFO
const TTCN_Typedescriptor_t SCTP__RTOINFO_descr_ = { "@SCTPasp_Types.SCTP_RTOINFO", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__SetSocketOptions
const TTCN_Typedescriptor_t ASP__SCTP__SetSocketOptions_descr_ = { "@SCTPasp_Types.ASP_SCTP_SetSocketOptions", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__Close
const TTCN_Typedescriptor_t ASP__SCTP__Close_descr_ = { "@SCTPasp_Types.ASP_SCTP_Close", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Close_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Close_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_Close.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Close_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SAC__STATE
const TTCN_Typedescriptor_t SAC__STATE_descr_ = { "@SCTPasp_Types.SAC_STATE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ASSOC__CHANGE_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ASSOC__CHANGE_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__ASSOC__CHANGE_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__ASSOC__CHANGE
const TTCN_Typedescriptor_t ASP__SCTP__ASSOC__CHANGE_descr_ = { "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SPC__STATE
const TTCN_Typedescriptor_t SPC__STATE_descr_ = { "@SCTPasp_Types.SPC_STATE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__PEER__ADDR__CHANGE_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__PEER__ADDR__CHANGE_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__PEER__ADDR__CHANGE_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__PEER__ADDR__CHANGE
const TTCN_Typedescriptor_t ASP__SCTP__PEER__ADDR__CHANGE_descr_ = { "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SEND__FAILED_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__SEND__FAILED_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_SEND_FAILED.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__SEND__FAILED_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__SEND__FAILED
const TTCN_Typedescriptor_t ASP__SCTP__SEND__FAILED_descr_ = { "@SCTPasp_Types.ASP_SCTP_SEND_FAILED", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__REMOTE__ERROR_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__REMOTE__ERROR_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__REMOTE__ERROR_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__REMOTE__ERROR
const TTCN_Typedescriptor_t ASP__SCTP__REMOTE__ERROR_descr_ = { "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SHUTDOWN__EVENT_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__SHUTDOWN__EVENT_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__SHUTDOWN__EVENT_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__SHUTDOWN__EVENT
const TTCN_Typedescriptor_t ASP__SCTP__SHUTDOWN__EVENT_descr_ = { "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__PARTIAL__DELIVERY__EVENT_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__PARTIAL__DELIVERY__EVENT_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__PARTIAL__DELIVERY__EVENT_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__PARTIAL__DELIVERY__EVENT
const TTCN_Typedescriptor_t ASP__SCTP__PARTIAL__DELIVERY__EVENT_descr_ = { "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__ADAPTION__INDICATION_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__ADAPTION__INDICATION_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__ADAPTION__INDICATION_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__ADAPTION__INDICATION
const TTCN_Typedescriptor_t ASP__SCTP__ADAPTION__INDICATION_descr_ = { "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connected_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connected_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Connected_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connected_local__hostname_xer_ = { {"local_hostname>\n", "local_hostname>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connected_local__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected.local_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__Connected_local__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connected_local__portnumber_xer_ = { {"local_portnumber>\n", "local_portnumber>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connected_local__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected.local_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Connected_local__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connected_peer__hostname_xer_ = { {"peer_hostname>\n", "peer_hostname>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connected_peer__hostname_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected.peer_hostname", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__Connected_peer__hostname_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__Connected_peer__portnumber_xer_ = { {"peer_portnumber>\n", "peer_portnumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__Connected_peer__portnumber_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected.peer_portnumber", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__Connected_peer__portnumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__Connected
const TTCN_Typedescriptor_t ASP__SCTP__Connected_descr_ = { "@SCTPasp_Types.ASP_SCTP_Connected", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SENDMSG__ERROR_sinfo__stream_xer_ = { {"sinfo_stream>\n", "sinfo_stream>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__SENDMSG__ERROR_sinfo__stream_descr_ = { "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.sinfo_stream", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__SENDMSG__ERROR_sinfo__stream_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SENDMSG__ERROR_sinfo__ppid_xer_ = { {"sinfo_ppid>\n", "sinfo_ppid>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__SENDMSG__ERROR_sinfo__ppid_descr_ = { "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.sinfo_ppid", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__SENDMSG__ERROR_sinfo__ppid_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SENDMSG__ERROR_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 ASP__SCTP__SENDMSG__ERROR_data_oer_ext_arr_[0] = {};
const int ASP__SCTP__SENDMSG__ERROR_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__SCTP__SENDMSG__ERROR_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ASP__SCTP__SENDMSG__ERROR_data_oer_ext_arr_, 0, ASP__SCTP__SENDMSG__ERROR_data_oer_p_};
const TTCN_Typedescriptor_t ASP__SCTP__SENDMSG__ERROR_data_descr_ = { "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ASP__SCTP__SENDMSG__ERROR_data_xer_, &OCTETSTRING_json_, &ASP__SCTP__SENDMSG__ERROR_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__SENDMSG__ERROR
const TTCN_Typedescriptor_t ASP__SCTP__SENDMSG__ERROR_descr_ = { "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__SENDMSG__ERROR_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__SENDMSG__ERROR_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__SENDMSG__ERROR_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__RESULT_error__status_xer_ = { {"error_status>\n", "error_status>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ASP__SCTP__RESULT_error__status_oer_ext_arr_[0] = {};
const int ASP__SCTP__RESULT_error__status_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__SCTP__RESULT_error__status_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ASP__SCTP__RESULT_error__status_oer_ext_arr_, 0, ASP__SCTP__RESULT_error__status_oer_p_};
const TTCN_Typedescriptor_t ASP__SCTP__RESULT_error__status_descr_ = { "@SCTPasp_Types.ASP_SCTP_RESULT.error_status", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &ASP__SCTP__RESULT_error__status_xer_, &BOOLEAN_json_, &ASP__SCTP__RESULT_error__status_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ASP__SCTP__RESULT
const TTCN_Typedescriptor_t ASP__SCTP__RESULT_descr_ = { "@SCTPasp_Types.ASP_SCTP_RESULT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__RESULT_client__id_xer_ = { {"client_id>\n", "client_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__RESULT_client__id_descr_ = { "@SCTPasp_Types.ASP_SCTP_RESULT.client_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__SCTP__RESULT_client__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ASP__SCTP__RESULT_error__message_xer_ = { {"error_message>\n", "error_message>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__SCTP__RESULT_error__message_descr_ = { "@SCTPasp_Types.ASP_SCTP_RESULT.error_message", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__SCTP__RESULT_error__message_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("SCTPasp_Types", __DATE__, __TIME__, module_checksum, NULL, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_9,
  current_runtime_version.requires_minor_version_0,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

ASP__SCTP::ASP__SCTP()
{
}

ASP__SCTP::ASP__SCTP(const OPTIONAL< INTEGER >& par_client__id,
    const INTEGER& par_sinfo__stream,
    const INTEGER& par_sinfo__ppid,
    const OCTETSTRING& par_data)
  :   field_client__id(par_client__id),
  field_sinfo__stream(par_sinfo__stream),
  field_sinfo__ppid(par_sinfo__ppid),
  field_data(par_data)
{
}

ASP__SCTP::ASP__SCTP(const ASP__SCTP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.sinfo__stream().is_bound()) field_sinfo__stream = other_value.sinfo__stream();
else field_sinfo__stream.clean_up();
if (other_value.sinfo__ppid().is_bound()) field_sinfo__ppid = other_value.sinfo__ppid();
else field_sinfo__ppid.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void ASP__SCTP::clean_up()
{
field_client__id.clean_up();
field_sinfo__stream.clean_up();
field_sinfo__ppid.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP::get_descriptor() const { return &ASP__SCTP_descr_; }
ASP__SCTP& ASP__SCTP::operator=(const ASP__SCTP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.sinfo__stream().is_bound()) field_sinfo__stream = other_value.sinfo__stream();
  else field_sinfo__stream.clean_up();
  if (other_value.sinfo__ppid().is_bound()) field_sinfo__ppid = other_value.sinfo__ppid();
  else field_sinfo__ppid.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean ASP__SCTP::operator==(const ASP__SCTP& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_sinfo__stream==other_value.field_sinfo__stream
  && field_sinfo__ppid==other_value.field_sinfo__ppid
  && field_data==other_value.field_data;
}

boolean ASP__SCTP::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_sinfo__stream.is_bound())
  || (field_sinfo__ppid.is_bound())
  || (field_data.is_bound());
}
boolean ASP__SCTP::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_sinfo__stream.is_value()
  && field_sinfo__ppid.is_value()
  && field_data.is_value();
}
int ASP__SCTP::size_of() const
{
  int ret_val = 3;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", sinfo_stream := ");
field_sinfo__stream.log();
TTCN_Logger::log_event_str(", sinfo_ppid := ");
field_sinfo__ppid.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (sinfo__stream().is_bound()) sinfo__stream().set_implicit_omit();
if (sinfo__ppid().is_bound()) sinfo__ppid().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void ASP__SCTP::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 (4<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.ASP_SCTP has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinfo__stream().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinfo__ppid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sinfo_stream")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__stream().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(), "sinfo_ppid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__ppid().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 @SCTPasp_Types.ASP_SCTP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP");
  }
}

void ASP__SCTP::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_sinfo__stream.encode_text(text_buf);
field_sinfo__ppid.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void ASP__SCTP::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_sinfo__stream.decode_text(text_buf);
field_sinfo__ppid.decode_text(text_buf);
field_data.decode_text(text_buf);
}

struct ASP__SCTP_template::single_value_struct {
INTEGER_template field_client__id;
INTEGER_template field_sinfo__stream;
INTEGER_template field_sinfo__ppid;
OCTETSTRING_template field_data;
};

void ASP__SCTP_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_client__id = ANY_OR_OMIT;
single_value->field_sinfo__stream = ANY_VALUE;
single_value->field_sinfo__ppid = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void ASP__SCTP_template::copy_value(const ASP__SCTP& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.sinfo__stream().is_bound()) {
  single_value->field_sinfo__stream = other_value.sinfo__stream();
} else {
  single_value->field_sinfo__stream.clean_up();
}
if (other_value.sinfo__ppid().is_bound()) {
  single_value->field_sinfo__ppid = other_value.sinfo__ppid();
} else {
  single_value->field_sinfo__ppid.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 ASP__SCTP_template::copy_template(const ASP__SCTP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinfo__stream().get_selection()) {
single_value->field_sinfo__stream = other_value.sinfo__stream();
} else {
single_value->field_sinfo__stream.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinfo__ppid().get_selection()) {
single_value->field_sinfo__ppid = other_value.sinfo__ppid();
} else {
single_value->field_sinfo__ppid.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 ASP__SCTP_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__SCTP_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP_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 @SCTPasp_Types.ASP_SCTP.");
break;
}
set_selection(other_value);
}

ASP__SCTP_template::ASP__SCTP_template()
{
}

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

ASP__SCTP_template::ASP__SCTP_template(const ASP__SCTP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP_template::match(const ASP__SCTP& 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.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.sinfo__stream().is_bound()) return FALSE;
if(!single_value->field_sinfo__stream.match(other_value.sinfo__stream(), legacy))return FALSE;
if(!other_value.sinfo__ppid().is_bound()) return FALSE;
if(!single_value->field_sinfo__ppid.match(other_value.sinfo__ppid(), 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 @SCTPasp_Types.ASP_SCTP.");
}
return FALSE;
}

boolean ASP__SCTP_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_sinfo__stream.is_bound()
 || single_value->field_sinfo__ppid.is_bound()
 || single_value->field_data.is_bound();
}

boolean ASP__SCTP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_sinfo__stream.is_value()
 && single_value->field_sinfo__ppid.is_value()
 && single_value->field_data.is_value();
}

void ASP__SCTP_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__SCTP ASP__SCTP_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 @SCTPasp_Types.ASP_SCTP.");
ASP__SCTP ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_sinfo__stream.is_bound()) {
ret_val.sinfo__stream() = single_value->field_sinfo__stream.valueof();
}
if (single_value->field_sinfo__ppid.is_bound()) {
ret_val.sinfo__ppid() = single_value->field_sinfo__ppid.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void ASP__SCTP_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 @SCTPasp_Types.ASP_SCTP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP_template[list_length];
}

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

INTEGER_template& ASP__SCTP_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP.");
return single_value->field_client__id;
}

INTEGER_template& ASP__SCTP_template::sinfo__stream()
{
set_specific();
return single_value->field_sinfo__stream;
}

const INTEGER_template& ASP__SCTP_template::sinfo__stream() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinfo_stream of a non-specific template of type @SCTPasp_Types.ASP_SCTP.");
return single_value->field_sinfo__stream;
}

INTEGER_template& ASP__SCTP_template::sinfo__ppid()
{
set_specific();
return single_value->field_sinfo__ppid;
}

const INTEGER_template& ASP__SCTP_template::sinfo__ppid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinfo_ppid of a non-specific template of type @SCTPasp_Types.ASP_SCTP.");
return single_value->field_sinfo__ppid;
}

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

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

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

void ASP__SCTP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", sinfo_stream := ");
single_value->field_sinfo__stream.log();
TTCN_Logger::log_event_str(", sinfo_ppid := ");
single_value->field_sinfo__ppid.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 ASP__SCTP_template::log_match(const ASP__SCTP& 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.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_sinfo__stream.match(match_value.sinfo__stream(), legacy)){
TTCN_Logger::log_logmatch_info(".sinfo_stream");
single_value->field_sinfo__stream.log_match(match_value.sinfo__stream(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sinfo__ppid.match(match_value.sinfo__ppid(), legacy)){
TTCN_Logger::log_logmatch_info(".sinfo_ppid");
single_value->field_sinfo__ppid.log_match(match_value.sinfo__ppid(), 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("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sinfo_stream := ");
single_value->field_sinfo__stream.log_match(match_value.sinfo__stream(), legacy);
TTCN_Logger::log_event_str(", sinfo_ppid := ");
single_value->field_sinfo__ppid.log_match(match_value.sinfo__ppid(), 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 ASP__SCTP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_sinfo__stream.encode_text(text_buf);
single_value->field_sinfo__ppid.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 @SCTPasp_Types.ASP_SCTP.");
}
}

void ASP__SCTP_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_client__id.decode_text(text_buf);
single_value->field_sinfo__stream.decode_text(text_buf);
single_value->field_sinfo__ppid.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 ASP__SCTP_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 @SCTPasp_Types.ASP_SCTP.");
}
}

void ASP__SCTP_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__SCTP_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 (4<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.ASP_SCTP has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinfo__stream().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinfo__ppid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sinfo_stream")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__stream().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(), "sinfo_ppid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__ppid().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 @SCTPasp_Types.ASP_SCTP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP_template* precondition = new ASP__SCTP_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP_template* implied_template = new ASP__SCTP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP");
single_value->field_sinfo__stream.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP");
single_value->field_sinfo__ppid.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP");
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 : "@SCTPasp_Types.ASP_SCTP");
}

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

boolean ASP__SCTP_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__SCTP__Connect::ASP__SCTP__Connect()
{
}

ASP__SCTP__Connect::ASP__SCTP__Connect(const OPTIONAL< CHARSTRING >& par_peer__hostname,
    const OPTIONAL< INTEGER >& par_peer__portnumber)
  :   field_peer__hostname(par_peer__hostname),
  field_peer__portnumber(par_peer__portnumber)
{
}

ASP__SCTP__Connect::ASP__SCTP__Connect(const ASP__SCTP__Connect& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_Connect.");
if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
else field_peer__hostname.clean_up();
if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
else field_peer__portnumber.clean_up();
}

void ASP__SCTP__Connect::clean_up()
{
field_peer__hostname.clean_up();
field_peer__portnumber.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__Connect::get_descriptor() const { return &ASP__SCTP__Connect_descr_; }
ASP__SCTP__Connect& ASP__SCTP__Connect::operator=(const ASP__SCTP__Connect& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_Connect.");
  if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
  else field_peer__hostname.clean_up();
  if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
  else field_peer__portnumber.clean_up();
}
return *this;
}

boolean ASP__SCTP__Connect::operator==(const ASP__SCTP__Connect& other_value) const
{
return field_peer__hostname==other_value.field_peer__hostname
  && field_peer__portnumber==other_value.field_peer__portnumber;
}

boolean ASP__SCTP__Connect::is_bound() const
{
return (OPTIONAL_OMIT == field_peer__hostname.get_selection() || field_peer__hostname.is_bound())
  || (OPTIONAL_OMIT == field_peer__portnumber.get_selection() || field_peer__portnumber.is_bound());
}
boolean ASP__SCTP__Connect::is_value() const
{
return (OPTIONAL_OMIT == field_peer__hostname.get_selection() || field_peer__hostname.is_value())
  && (OPTIONAL_OMIT == field_peer__portnumber.get_selection() || field_peer__portnumber.is_value());
}
int ASP__SCTP__Connect::size_of() const
{
  int ret_val = 0;
  if (field_peer__hostname.ispresent()) ret_val++;
  if (field_peer__portnumber.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__Connect::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ peer_hostname := ");
field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
field_peer__portnumber.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__Connect::set_implicit_omit()
{
if (!peer__hostname().is_bound()) peer__hostname() = OMIT_VALUE;
else peer__hostname().set_implicit_omit();
if (!peer__portnumber().is_bound()) peer__portnumber() = OMIT_VALUE;
else peer__portnumber().set_implicit_omit();
}

void ASP__SCTP__Connect::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 @SCTPasp_Types.ASP_SCTP_Connect 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) peer__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_Connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_Connect");
  }
}

void ASP__SCTP__Connect::encode_text(Text_Buf& text_buf) const
{
field_peer__hostname.encode_text(text_buf);
field_peer__portnumber.encode_text(text_buf);
}

void ASP__SCTP__Connect::decode_text(Text_Buf& text_buf)
{
field_peer__hostname.decode_text(text_buf);
field_peer__portnumber.decode_text(text_buf);
}

struct ASP__SCTP__Connect_template::single_value_struct {
CHARSTRING_template field_peer__hostname;
INTEGER_template field_peer__portnumber;
};

void ASP__SCTP__Connect_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_peer__hostname = ANY_OR_OMIT;
single_value->field_peer__portnumber = ANY_OR_OMIT;
}
}
}

void ASP__SCTP__Connect_template::copy_value(const ASP__SCTP__Connect& other_value)
{
single_value = new single_value_struct;
if (other_value.peer__hostname().is_bound()) {
  if (other_value.peer__hostname().ispresent()) single_value->field_peer__hostname = other_value.peer__hostname()();
  else single_value->field_peer__hostname = OMIT_VALUE;
} else {
  single_value->field_peer__hostname.clean_up();
}
if (other_value.peer__portnumber().is_bound()) {
  if (other_value.peer__portnumber().ispresent()) single_value->field_peer__portnumber = other_value.peer__portnumber()();
  else single_value->field_peer__portnumber = OMIT_VALUE;
} else {
  single_value->field_peer__portnumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__Connect_template::copy_template(const ASP__SCTP__Connect_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.peer__hostname().get_selection()) {
single_value->field_peer__hostname = other_value.peer__hostname();
} else {
single_value->field_peer__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peer__portnumber().get_selection()) {
single_value->field_peer__portnumber = other_value.peer__portnumber();
} else {
single_value->field_peer__portnumber.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__SCTP__Connect_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__SCTP__Connect_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__Connect_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 @SCTPasp_Types.ASP_SCTP_Connect.");
break;
}
set_selection(other_value);
}

ASP__SCTP__Connect_template::ASP__SCTP__Connect_template()
{
}

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

ASP__SCTP__Connect_template::ASP__SCTP__Connect_template(const ASP__SCTP__Connect& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__Connect_template::match(const ASP__SCTP__Connect& 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.peer__hostname().is_bound()) return FALSE;
if((other_value.peer__hostname().ispresent() ? !single_value->field_peer__hostname.match((const CHARSTRING&)other_value.peer__hostname(), legacy) : !single_value->field_peer__hostname.match_omit(legacy)))return FALSE;
if(!other_value.peer__portnumber().is_bound()) return FALSE;
if((other_value.peer__portnumber().ispresent() ? !single_value->field_peer__portnumber.match((const INTEGER&)other_value.peer__portnumber(), legacy) : !single_value->field_peer__portnumber.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 @SCTPasp_Types.ASP_SCTP_Connect.");
}
return FALSE;
}

boolean ASP__SCTP__Connect_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_peer__hostname.is_omit() || single_value->field_peer__hostname.is_bound())
 || (single_value->field_peer__portnumber.is_omit() || single_value->field_peer__portnumber.is_bound());
}

boolean ASP__SCTP__Connect_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_peer__hostname.is_omit() || single_value->field_peer__hostname.is_value())
 && (single_value->field_peer__portnumber.is_omit() || single_value->field_peer__portnumber.is_value());
}

void ASP__SCTP__Connect_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__SCTP__Connect ASP__SCTP__Connect_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 @SCTPasp_Types.ASP_SCTP_Connect.");
ASP__SCTP__Connect ret_val;
if (single_value->field_peer__hostname.is_omit()) ret_val.peer__hostname() = OMIT_VALUE;
else if (single_value->field_peer__hostname.is_bound()) {
ret_val.peer__hostname() = single_value->field_peer__hostname.valueof();
}
if (single_value->field_peer__portnumber.is_omit()) ret_val.peer__portnumber() = OMIT_VALUE;
else if (single_value->field_peer__portnumber.is_bound()) {
ret_val.peer__portnumber() = single_value->field_peer__portnumber.valueof();
}
return ret_val;
}

void ASP__SCTP__Connect_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 @SCTPasp_Types.ASP_SCTP_Connect.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__Connect_template[list_length];
}

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

CHARSTRING_template& ASP__SCTP__Connect_template::peer__hostname()
{
set_specific();
return single_value->field_peer__hostname;
}

const CHARSTRING_template& ASP__SCTP__Connect_template::peer__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connect.");
return single_value->field_peer__hostname;
}

INTEGER_template& ASP__SCTP__Connect_template::peer__portnumber()
{
set_specific();
return single_value->field_peer__portnumber;
}

const INTEGER_template& ASP__SCTP__Connect_template::peer__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connect.");
return single_value->field_peer__portnumber;
}

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

void ASP__SCTP__Connect_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ peer_hostname := ");
single_value->field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
single_value->field_peer__portnumber.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__SCTP__Connect_template::log_match(const ASP__SCTP__Connect& 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.peer__hostname().ispresent()){
if(!single_value->field_peer__hostname.match(match_value.peer__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_hostname");
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_peer__hostname.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".peer_hostname := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_peer__hostname.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.peer__portnumber().ispresent()){
if(!single_value->field_peer__portnumber.match(match_value.peer__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_portnumber");
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_peer__portnumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".peer_portnumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_peer__portnumber.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("{ peer_hostname := ");
if (match_value.peer__hostname().ispresent()) {
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_peer__hostname.log();
if (single_value->field_peer__hostname.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", peer_portnumber := ");
if (match_value.peer__portnumber().ispresent()) {
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_peer__portnumber.log();
if (single_value->field_peer__portnumber.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 ASP__SCTP__Connect_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_peer__hostname.encode_text(text_buf);
single_value->field_peer__portnumber.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 @SCTPasp_Types.ASP_SCTP_Connect.");
}
}

void ASP__SCTP__Connect_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_peer__hostname.decode_text(text_buf);
single_value->field_peer__portnumber.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__SCTP__Connect_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 @SCTPasp_Types.ASP_SCTP_Connect.");
}
}

void ASP__SCTP__Connect_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__SCTP__Connect_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 @SCTPasp_Types.ASP_SCTP_Connect 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) peer__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_Connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__Connect_template* precondition = new ASP__SCTP__Connect_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__Connect_template* implied_template = new ASP__SCTP__Connect_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__Connect_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_Connect");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__Connect_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_peer__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connect");
single_value->field_peer__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connect");
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 : "@SCTPasp_Types.ASP_SCTP_Connect");
}

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

boolean ASP__SCTP__Connect_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__SCTP__ConnectFrom::ASP__SCTP__ConnectFrom()
{
}

ASP__SCTP__ConnectFrom::ASP__SCTP__ConnectFrom(const OPTIONAL< CHARSTRING >& par_local__hostname,
    const INTEGER& par_local__portnumber,
    const OPTIONAL< CHARSTRING >& par_peer__hostname,
    const OPTIONAL< INTEGER >& par_peer__portnumber)
  :   field_local__hostname(par_local__hostname),
  field_local__portnumber(par_local__portnumber),
  field_peer__hostname(par_peer__hostname),
  field_peer__portnumber(par_peer__portnumber)
{
}

ASP__SCTP__ConnectFrom::ASP__SCTP__ConnectFrom(const ASP__SCTP__ConnectFrom& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
else field_local__hostname.clean_up();
if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
else field_local__portnumber.clean_up();
if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
else field_peer__hostname.clean_up();
if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
else field_peer__portnumber.clean_up();
}

void ASP__SCTP__ConnectFrom::clean_up()
{
field_local__hostname.clean_up();
field_local__portnumber.clean_up();
field_peer__hostname.clean_up();
field_peer__portnumber.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__ConnectFrom::get_descriptor() const { return &ASP__SCTP__ConnectFrom_descr_; }
ASP__SCTP__ConnectFrom& ASP__SCTP__ConnectFrom::operator=(const ASP__SCTP__ConnectFrom& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
  if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
  else field_local__hostname.clean_up();
  if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
  else field_local__portnumber.clean_up();
  if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
  else field_peer__hostname.clean_up();
  if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
  else field_peer__portnumber.clean_up();
}
return *this;
}

boolean ASP__SCTP__ConnectFrom::operator==(const ASP__SCTP__ConnectFrom& other_value) const
{
return field_local__hostname==other_value.field_local__hostname
  && field_local__portnumber==other_value.field_local__portnumber
  && field_peer__hostname==other_value.field_peer__hostname
  && field_peer__portnumber==other_value.field_peer__portnumber;
}

boolean ASP__SCTP__ConnectFrom::is_bound() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_bound())
  || (field_local__portnumber.is_bound())
  || (OPTIONAL_OMIT == field_peer__hostname.get_selection() || field_peer__hostname.is_bound())
  || (OPTIONAL_OMIT == field_peer__portnumber.get_selection() || field_peer__portnumber.is_bound());
}
boolean ASP__SCTP__ConnectFrom::is_value() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_value())
  && field_local__portnumber.is_value()
  && (OPTIONAL_OMIT == field_peer__hostname.get_selection() || field_peer__hostname.is_value())
  && (OPTIONAL_OMIT == field_peer__portnumber.get_selection() || field_peer__portnumber.is_value());
}
int ASP__SCTP__ConnectFrom::size_of() const
{
  int ret_val = 1;
  if (field_local__hostname.ispresent()) ret_val++;
  if (field_peer__hostname.ispresent()) ret_val++;
  if (field_peer__portnumber.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__ConnectFrom::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ local_hostname := ");
field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
field_local__portnumber.log();
TTCN_Logger::log_event_str(", peer_hostname := ");
field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
field_peer__portnumber.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__ConnectFrom::set_implicit_omit()
{
if (!local__hostname().is_bound()) local__hostname() = OMIT_VALUE;
else local__hostname().set_implicit_omit();
if (local__portnumber().is_bound()) local__portnumber().set_implicit_omit();
if (!peer__hostname().is_bound()) peer__hostname() = OMIT_VALUE;
else peer__hostname().set_implicit_omit();
if (!peer__portnumber().is_bound()) peer__portnumber() = OMIT_VALUE;
else peer__portnumber().set_implicit_omit();
}

void ASP__SCTP__ConnectFrom::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 (4<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.ASP_SCTP_ConnectFrom has 4 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) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) peer__hostname().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().set_param(*param.get_elem(3));
    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(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_ConnectFrom: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
  }
}

void ASP__SCTP__ConnectFrom::encode_text(Text_Buf& text_buf) const
{
field_local__hostname.encode_text(text_buf);
field_local__portnumber.encode_text(text_buf);
field_peer__hostname.encode_text(text_buf);
field_peer__portnumber.encode_text(text_buf);
}

void ASP__SCTP__ConnectFrom::decode_text(Text_Buf& text_buf)
{
field_local__hostname.decode_text(text_buf);
field_local__portnumber.decode_text(text_buf);
field_peer__hostname.decode_text(text_buf);
field_peer__portnumber.decode_text(text_buf);
}

struct ASP__SCTP__ConnectFrom_template::single_value_struct {
CHARSTRING_template field_local__hostname;
INTEGER_template field_local__portnumber;
CHARSTRING_template field_peer__hostname;
INTEGER_template field_peer__portnumber;
};

void ASP__SCTP__ConnectFrom_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_local__hostname = ANY_OR_OMIT;
single_value->field_local__portnumber = ANY_VALUE;
single_value->field_peer__hostname = ANY_OR_OMIT;
single_value->field_peer__portnumber = ANY_OR_OMIT;
}
}
}

void ASP__SCTP__ConnectFrom_template::copy_value(const ASP__SCTP__ConnectFrom& other_value)
{
single_value = new single_value_struct;
if (other_value.local__hostname().is_bound()) {
  if (other_value.local__hostname().ispresent()) single_value->field_local__hostname = other_value.local__hostname()();
  else single_value->field_local__hostname = OMIT_VALUE;
} else {
  single_value->field_local__hostname.clean_up();
}
if (other_value.local__portnumber().is_bound()) {
  single_value->field_local__portnumber = other_value.local__portnumber();
} else {
  single_value->field_local__portnumber.clean_up();
}
if (other_value.peer__hostname().is_bound()) {
  if (other_value.peer__hostname().ispresent()) single_value->field_peer__hostname = other_value.peer__hostname()();
  else single_value->field_peer__hostname = OMIT_VALUE;
} else {
  single_value->field_peer__hostname.clean_up();
}
if (other_value.peer__portnumber().is_bound()) {
  if (other_value.peer__portnumber().ispresent()) single_value->field_peer__portnumber = other_value.peer__portnumber()();
  else single_value->field_peer__portnumber = OMIT_VALUE;
} else {
  single_value->field_peer__portnumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__ConnectFrom_template::copy_template(const ASP__SCTP__ConnectFrom_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.local__hostname().get_selection()) {
single_value->field_local__hostname = other_value.local__hostname();
} else {
single_value->field_local__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__portnumber().get_selection()) {
single_value->field_local__portnumber = other_value.local__portnumber();
} else {
single_value->field_local__portnumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peer__hostname().get_selection()) {
single_value->field_peer__hostname = other_value.peer__hostname();
} else {
single_value->field_peer__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peer__portnumber().get_selection()) {
single_value->field_peer__portnumber = other_value.peer__portnumber();
} else {
single_value->field_peer__portnumber.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__SCTP__ConnectFrom_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__SCTP__ConnectFrom_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__ConnectFrom_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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
break;
}
set_selection(other_value);
}

ASP__SCTP__ConnectFrom_template::ASP__SCTP__ConnectFrom_template()
{
}

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

ASP__SCTP__ConnectFrom_template::ASP__SCTP__ConnectFrom_template(const ASP__SCTP__ConnectFrom& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__ConnectFrom_template::match(const ASP__SCTP__ConnectFrom& 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.local__hostname().is_bound()) return FALSE;
if((other_value.local__hostname().ispresent() ? !single_value->field_local__hostname.match((const CHARSTRING&)other_value.local__hostname(), legacy) : !single_value->field_local__hostname.match_omit(legacy)))return FALSE;
if(!other_value.local__portnumber().is_bound()) return FALSE;
if(!single_value->field_local__portnumber.match(other_value.local__portnumber(), legacy))return FALSE;
if(!other_value.peer__hostname().is_bound()) return FALSE;
if((other_value.peer__hostname().ispresent() ? !single_value->field_peer__hostname.match((const CHARSTRING&)other_value.peer__hostname(), legacy) : !single_value->field_peer__hostname.match_omit(legacy)))return FALSE;
if(!other_value.peer__portnumber().is_bound()) return FALSE;
if((other_value.peer__portnumber().ispresent() ? !single_value->field_peer__portnumber.match((const INTEGER&)other_value.peer__portnumber(), legacy) : !single_value->field_peer__portnumber.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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
}
return FALSE;
}

boolean ASP__SCTP__ConnectFrom_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_bound())
 || single_value->field_local__portnumber.is_bound()
 || (single_value->field_peer__hostname.is_omit() || single_value->field_peer__hostname.is_bound())
 || (single_value->field_peer__portnumber.is_omit() || single_value->field_peer__portnumber.is_bound());
}

boolean ASP__SCTP__ConnectFrom_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_value())
 && single_value->field_local__portnumber.is_value()
 && (single_value->field_peer__hostname.is_omit() || single_value->field_peer__hostname.is_value())
 && (single_value->field_peer__portnumber.is_omit() || single_value->field_peer__portnumber.is_value());
}

void ASP__SCTP__ConnectFrom_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__SCTP__ConnectFrom ASP__SCTP__ConnectFrom_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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
ASP__SCTP__ConnectFrom ret_val;
if (single_value->field_local__hostname.is_omit()) ret_val.local__hostname() = OMIT_VALUE;
else if (single_value->field_local__hostname.is_bound()) {
ret_val.local__hostname() = single_value->field_local__hostname.valueof();
}
if (single_value->field_local__portnumber.is_bound()) {
ret_val.local__portnumber() = single_value->field_local__portnumber.valueof();
}
if (single_value->field_peer__hostname.is_omit()) ret_val.peer__hostname() = OMIT_VALUE;
else if (single_value->field_peer__hostname.is_bound()) {
ret_val.peer__hostname() = single_value->field_peer__hostname.valueof();
}
if (single_value->field_peer__portnumber.is_omit()) ret_val.peer__portnumber() = OMIT_VALUE;
else if (single_value->field_peer__portnumber.is_bound()) {
ret_val.peer__portnumber() = single_value->field_peer__portnumber.valueof();
}
return ret_val;
}

void ASP__SCTP__ConnectFrom_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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__ConnectFrom_template[list_length];
}

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

CHARSTRING_template& ASP__SCTP__ConnectFrom_template::local__hostname()
{
set_specific();
return single_value->field_local__hostname;
}

const CHARSTRING_template& ASP__SCTP__ConnectFrom_template::local__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
return single_value->field_local__hostname;
}

INTEGER_template& ASP__SCTP__ConnectFrom_template::local__portnumber()
{
set_specific();
return single_value->field_local__portnumber;
}

const INTEGER_template& ASP__SCTP__ConnectFrom_template::local__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
return single_value->field_local__portnumber;
}

CHARSTRING_template& ASP__SCTP__ConnectFrom_template::peer__hostname()
{
set_specific();
return single_value->field_peer__hostname;
}

const CHARSTRING_template& ASP__SCTP__ConnectFrom_template::peer__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
return single_value->field_peer__hostname;
}

INTEGER_template& ASP__SCTP__ConnectFrom_template::peer__portnumber()
{
set_specific();
return single_value->field_peer__portnumber;
}

const INTEGER_template& ASP__SCTP__ConnectFrom_template::peer__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
return single_value->field_peer__portnumber;
}

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

void ASP__SCTP__ConnectFrom_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ local_hostname := ");
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.log();
TTCN_Logger::log_event_str(", peer_hostname := ");
single_value->field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
single_value->field_peer__portnumber.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__SCTP__ConnectFrom_template::log_match(const ASP__SCTP__ConnectFrom& 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.local__hostname().ispresent()){
if(!single_value->field_local__hostname.match(match_value.local__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".local_hostname");
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_local__hostname.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".local_hostname := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_local__portnumber.match(match_value.local__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".local_portnumber");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.peer__hostname().ispresent()){
if(!single_value->field_peer__hostname.match(match_value.peer__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_hostname");
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_peer__hostname.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".peer_hostname := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_peer__hostname.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.peer__portnumber().ispresent()){
if(!single_value->field_peer__portnumber.match(match_value.peer__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_portnumber");
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_peer__portnumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".peer_portnumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_peer__portnumber.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("{ local_hostname := ");
if (match_value.local__hostname().ispresent()) {
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_local__hostname.log();
if (single_value->field_local__hostname.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), legacy);
TTCN_Logger::log_event_str(", peer_hostname := ");
if (match_value.peer__hostname().ispresent()) {
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_peer__hostname.log();
if (single_value->field_peer__hostname.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", peer_portnumber := ");
if (match_value.peer__portnumber().ispresent()) {
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_peer__portnumber.log();
if (single_value->field_peer__portnumber.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 ASP__SCTP__ConnectFrom_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_local__hostname.encode_text(text_buf);
single_value->field_local__portnumber.encode_text(text_buf);
single_value->field_peer__hostname.encode_text(text_buf);
single_value->field_peer__portnumber.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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
}
}

void ASP__SCTP__ConnectFrom_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_local__hostname.decode_text(text_buf);
single_value->field_local__portnumber.decode_text(text_buf);
single_value->field_peer__hostname.decode_text(text_buf);
single_value->field_peer__portnumber.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__SCTP__ConnectFrom_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 @SCTPasp_Types.ASP_SCTP_ConnectFrom.");
}
}

void ASP__SCTP__ConnectFrom_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__SCTP__ConnectFrom_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 (4<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.ASP_SCTP_ConnectFrom has 4 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) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) peer__hostname().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().set_param(*param.get_elem(3));
    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(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_ConnectFrom: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__ConnectFrom_template* precondition = new ASP__SCTP__ConnectFrom_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__ConnectFrom_template* implied_template = new ASP__SCTP__ConnectFrom_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__ConnectFrom_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__ConnectFrom_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_local__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
single_value->field_local__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
single_value->field_peer__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
single_value->field_peer__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
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 : "@SCTPasp_Types.ASP_SCTP_ConnectFrom");
}

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

boolean ASP__SCTP__ConnectFrom_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__SCTP__Listen::ASP__SCTP__Listen()
{
}

ASP__SCTP__Listen::ASP__SCTP__Listen(const OPTIONAL< CHARSTRING >& par_local__hostname,
    const INTEGER& par_local__portnumber)
  :   field_local__hostname(par_local__hostname),
  field_local__portnumber(par_local__portnumber)
{
}

ASP__SCTP__Listen::ASP__SCTP__Listen(const ASP__SCTP__Listen& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_Listen.");
if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
else field_local__hostname.clean_up();
if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
else field_local__portnumber.clean_up();
}

void ASP__SCTP__Listen::clean_up()
{
field_local__hostname.clean_up();
field_local__portnumber.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__Listen::get_descriptor() const { return &ASP__SCTP__Listen_descr_; }
ASP__SCTP__Listen& ASP__SCTP__Listen::operator=(const ASP__SCTP__Listen& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_Listen.");
  if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
  else field_local__hostname.clean_up();
  if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
  else field_local__portnumber.clean_up();
}
return *this;
}

boolean ASP__SCTP__Listen::operator==(const ASP__SCTP__Listen& other_value) const
{
return field_local__hostname==other_value.field_local__hostname
  && field_local__portnumber==other_value.field_local__portnumber;
}

boolean ASP__SCTP__Listen::is_bound() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_bound())
  || (field_local__portnumber.is_bound());
}
boolean ASP__SCTP__Listen::is_value() const
{
return (OPTIONAL_OMIT == field_local__hostname.get_selection() || field_local__hostname.is_value())
  && field_local__portnumber.is_value();
}
int ASP__SCTP__Listen::size_of() const
{
  int ret_val = 1;
  if (field_local__hostname.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__Listen::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ local_hostname := ");
field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
field_local__portnumber.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__Listen::set_implicit_omit()
{
if (!local__hostname().is_bound()) local__hostname() = OMIT_VALUE;
else local__hostname().set_implicit_omit();
if (local__portnumber().is_bound()) local__portnumber().set_implicit_omit();
}

void ASP__SCTP__Listen::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 @SCTPasp_Types.ASP_SCTP_Listen 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) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().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(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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 @SCTPasp_Types.ASP_SCTP_Listen: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_Listen");
  }
}

void ASP__SCTP__Listen::encode_text(Text_Buf& text_buf) const
{
field_local__hostname.encode_text(text_buf);
field_local__portnumber.encode_text(text_buf);
}

void ASP__SCTP__Listen::decode_text(Text_Buf& text_buf)
{
field_local__hostname.decode_text(text_buf);
field_local__portnumber.decode_text(text_buf);
}

struct ASP__SCTP__Listen_template::single_value_struct {
CHARSTRING_template field_local__hostname;
INTEGER_template field_local__portnumber;
};

void ASP__SCTP__Listen_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_local__hostname = ANY_OR_OMIT;
single_value->field_local__portnumber = ANY_VALUE;
}
}
}

void ASP__SCTP__Listen_template::copy_value(const ASP__SCTP__Listen& other_value)
{
single_value = new single_value_struct;
if (other_value.local__hostname().is_bound()) {
  if (other_value.local__hostname().ispresent()) single_value->field_local__hostname = other_value.local__hostname()();
  else single_value->field_local__hostname = OMIT_VALUE;
} else {
  single_value->field_local__hostname.clean_up();
}
if (other_value.local__portnumber().is_bound()) {
  single_value->field_local__portnumber = other_value.local__portnumber();
} else {
  single_value->field_local__portnumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__Listen_template::copy_template(const ASP__SCTP__Listen_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.local__hostname().get_selection()) {
single_value->field_local__hostname = other_value.local__hostname();
} else {
single_value->field_local__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__portnumber().get_selection()) {
single_value->field_local__portnumber = other_value.local__portnumber();
} else {
single_value->field_local__portnumber.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__SCTP__Listen_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__SCTP__Listen_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__Listen_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 @SCTPasp_Types.ASP_SCTP_Listen.");
break;
}
set_selection(other_value);
}

ASP__SCTP__Listen_template::ASP__SCTP__Listen_template()
{
}

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

ASP__SCTP__Listen_template::ASP__SCTP__Listen_template(const ASP__SCTP__Listen& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__Listen_template::match(const ASP__SCTP__Listen& 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.local__hostname().is_bound()) return FALSE;
if((other_value.local__hostname().ispresent() ? !single_value->field_local__hostname.match((const CHARSTRING&)other_value.local__hostname(), legacy) : !single_value->field_local__hostname.match_omit(legacy)))return FALSE;
if(!other_value.local__portnumber().is_bound()) return FALSE;
if(!single_value->field_local__portnumber.match(other_value.local__portnumber(), 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 @SCTPasp_Types.ASP_SCTP_Listen.");
}
return FALSE;
}

boolean ASP__SCTP__Listen_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_bound())
 || single_value->field_local__portnumber.is_bound();
}

boolean ASP__SCTP__Listen_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_local__hostname.is_omit() || single_value->field_local__hostname.is_value())
 && single_value->field_local__portnumber.is_value();
}

void ASP__SCTP__Listen_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__SCTP__Listen ASP__SCTP__Listen_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 @SCTPasp_Types.ASP_SCTP_Listen.");
ASP__SCTP__Listen ret_val;
if (single_value->field_local__hostname.is_omit()) ret_val.local__hostname() = OMIT_VALUE;
else if (single_value->field_local__hostname.is_bound()) {
ret_val.local__hostname() = single_value->field_local__hostname.valueof();
}
if (single_value->field_local__portnumber.is_bound()) {
ret_val.local__portnumber() = single_value->field_local__portnumber.valueof();
}
return ret_val;
}

void ASP__SCTP__Listen_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 @SCTPasp_Types.ASP_SCTP_Listen.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__Listen_template[list_length];
}

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

CHARSTRING_template& ASP__SCTP__Listen_template::local__hostname()
{
set_specific();
return single_value->field_local__hostname;
}

const CHARSTRING_template& ASP__SCTP__Listen_template::local__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Listen.");
return single_value->field_local__hostname;
}

INTEGER_template& ASP__SCTP__Listen_template::local__portnumber()
{
set_specific();
return single_value->field_local__portnumber;
}

const INTEGER_template& ASP__SCTP__Listen_template::local__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Listen.");
return single_value->field_local__portnumber;
}

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

void ASP__SCTP__Listen_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ local_hostname := ");
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.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__SCTP__Listen_template::log_match(const ASP__SCTP__Listen& 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.local__hostname().ispresent()){
if(!single_value->field_local__hostname.match(match_value.local__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".local_hostname");
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_local__hostname.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".local_hostname := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_local__portnumber.match(match_value.local__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".local_portnumber");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), 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("{ local_hostname := ");
if (match_value.local__hostname().ispresent()) {
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_local__hostname.log();
if (single_value->field_local__hostname.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), 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__SCTP__Listen_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_local__hostname.encode_text(text_buf);
single_value->field_local__portnumber.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 @SCTPasp_Types.ASP_SCTP_Listen.");
}
}

void ASP__SCTP__Listen_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_local__hostname.decode_text(text_buf);
single_value->field_local__portnumber.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__SCTP__Listen_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 @SCTPasp_Types.ASP_SCTP_Listen.");
}
}

void ASP__SCTP__Listen_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__SCTP__Listen_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 @SCTPasp_Types.ASP_SCTP_Listen 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) local__hostname().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().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(), "local_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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 @SCTPasp_Types.ASP_SCTP_Listen: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__Listen_template* precondition = new ASP__SCTP__Listen_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__Listen_template* implied_template = new ASP__SCTP__Listen_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__Listen_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_Listen");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__Listen_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_local__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Listen");
single_value->field_local__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Listen");
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 : "@SCTPasp_Types.ASP_SCTP_Listen");
}

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

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

SCTP__INIT::SCTP__INIT()
{
}

SCTP__INIT::SCTP__INIT(const INTEGER& par_sinit__num__ostreams,
    const INTEGER& par_sinit__max__instreams,
    const INTEGER& par_sinit__max__attempts,
    const INTEGER& par_sinit__max__init__timeo)
  :   field_sinit__num__ostreams(par_sinit__num__ostreams),
  field_sinit__max__instreams(par_sinit__max__instreams),
  field_sinit__max__attempts(par_sinit__max__attempts),
  field_sinit__max__init__timeo(par_sinit__max__init__timeo)
{
}

SCTP__INIT::SCTP__INIT(const SCTP__INIT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.SCTP_INIT.");
if (other_value.sinit__num__ostreams().is_bound()) field_sinit__num__ostreams = other_value.sinit__num__ostreams();
else field_sinit__num__ostreams.clean_up();
if (other_value.sinit__max__instreams().is_bound()) field_sinit__max__instreams = other_value.sinit__max__instreams();
else field_sinit__max__instreams.clean_up();
if (other_value.sinit__max__attempts().is_bound()) field_sinit__max__attempts = other_value.sinit__max__attempts();
else field_sinit__max__attempts.clean_up();
if (other_value.sinit__max__init__timeo().is_bound()) field_sinit__max__init__timeo = other_value.sinit__max__init__timeo();
else field_sinit__max__init__timeo.clean_up();
}

void SCTP__INIT::clean_up()
{
field_sinit__num__ostreams.clean_up();
field_sinit__max__instreams.clean_up();
field_sinit__max__attempts.clean_up();
field_sinit__max__init__timeo.clean_up();
}

const TTCN_Typedescriptor_t* SCTP__INIT::get_descriptor() const { return &SCTP__INIT_descr_; }
SCTP__INIT& SCTP__INIT::operator=(const SCTP__INIT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.SCTP_INIT.");
  if (other_value.sinit__num__ostreams().is_bound()) field_sinit__num__ostreams = other_value.sinit__num__ostreams();
  else field_sinit__num__ostreams.clean_up();
  if (other_value.sinit__max__instreams().is_bound()) field_sinit__max__instreams = other_value.sinit__max__instreams();
  else field_sinit__max__instreams.clean_up();
  if (other_value.sinit__max__attempts().is_bound()) field_sinit__max__attempts = other_value.sinit__max__attempts();
  else field_sinit__max__attempts.clean_up();
  if (other_value.sinit__max__init__timeo().is_bound()) field_sinit__max__init__timeo = other_value.sinit__max__init__timeo();
  else field_sinit__max__init__timeo.clean_up();
}
return *this;
}

boolean SCTP__INIT::operator==(const SCTP__INIT& other_value) const
{
return field_sinit__num__ostreams==other_value.field_sinit__num__ostreams
  && field_sinit__max__instreams==other_value.field_sinit__max__instreams
  && field_sinit__max__attempts==other_value.field_sinit__max__attempts
  && field_sinit__max__init__timeo==other_value.field_sinit__max__init__timeo;
}

boolean SCTP__INIT::is_bound() const
{
return (field_sinit__num__ostreams.is_bound())
  || (field_sinit__max__instreams.is_bound())
  || (field_sinit__max__attempts.is_bound())
  || (field_sinit__max__init__timeo.is_bound());
}
boolean SCTP__INIT::is_value() const
{
return field_sinit__num__ostreams.is_value()
  && field_sinit__max__instreams.is_value()
  && field_sinit__max__attempts.is_value()
  && field_sinit__max__init__timeo.is_value();
}
void SCTP__INIT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sinit_num_ostreams := ");
field_sinit__num__ostreams.log();
TTCN_Logger::log_event_str(", sinit_max_instreams := ");
field_sinit__max__instreams.log();
TTCN_Logger::log_event_str(", sinit_max_attempts := ");
field_sinit__max__attempts.log();
TTCN_Logger::log_event_str(", sinit_max_init_timeo := ");
field_sinit__max__init__timeo.log();
TTCN_Logger::log_event_str(" }");
}

void SCTP__INIT::set_implicit_omit()
{
if (sinit__num__ostreams().is_bound()) sinit__num__ostreams().set_implicit_omit();
if (sinit__max__instreams().is_bound()) sinit__max__instreams().set_implicit_omit();
if (sinit__max__attempts().is_bound()) sinit__max__attempts().set_implicit_omit();
if (sinit__max__init__timeo().is_bound()) sinit__max__init__timeo().set_implicit_omit();
}

void SCTP__INIT::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 (4<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.SCTP_INIT has 4 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) sinit__num__ostreams().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinit__max__instreams().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinit__max__attempts().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sinit__max__init__timeo().set_param(*param.get_elem(3));
    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(), "sinit_num_ostreams")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__num__ostreams().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(), "sinit_max_instreams")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__instreams().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(), "sinit_max_attempts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__attempts().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(), "sinit_max_init_timeo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__init__timeo().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 @SCTPasp_Types.SCTP_INIT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.SCTP_INIT");
  }
}

void SCTP__INIT::encode_text(Text_Buf& text_buf) const
{
field_sinit__num__ostreams.encode_text(text_buf);
field_sinit__max__instreams.encode_text(text_buf);
field_sinit__max__attempts.encode_text(text_buf);
field_sinit__max__init__timeo.encode_text(text_buf);
}

void SCTP__INIT::decode_text(Text_Buf& text_buf)
{
field_sinit__num__ostreams.decode_text(text_buf);
field_sinit__max__instreams.decode_text(text_buf);
field_sinit__max__attempts.decode_text(text_buf);
field_sinit__max__init__timeo.decode_text(text_buf);
}

struct SCTP__INIT_template::single_value_struct {
INTEGER_template field_sinit__num__ostreams;
INTEGER_template field_sinit__max__instreams;
INTEGER_template field_sinit__max__attempts;
INTEGER_template field_sinit__max__init__timeo;
};

void SCTP__INIT_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_sinit__num__ostreams = ANY_VALUE;
single_value->field_sinit__max__instreams = ANY_VALUE;
single_value->field_sinit__max__attempts = ANY_VALUE;
single_value->field_sinit__max__init__timeo = ANY_VALUE;
}
}
}

void SCTP__INIT_template::copy_value(const SCTP__INIT& other_value)
{
single_value = new single_value_struct;
if (other_value.sinit__num__ostreams().is_bound()) {
  single_value->field_sinit__num__ostreams = other_value.sinit__num__ostreams();
} else {
  single_value->field_sinit__num__ostreams.clean_up();
}
if (other_value.sinit__max__instreams().is_bound()) {
  single_value->field_sinit__max__instreams = other_value.sinit__max__instreams();
} else {
  single_value->field_sinit__max__instreams.clean_up();
}
if (other_value.sinit__max__attempts().is_bound()) {
  single_value->field_sinit__max__attempts = other_value.sinit__max__attempts();
} else {
  single_value->field_sinit__max__attempts.clean_up();
}
if (other_value.sinit__max__init__timeo().is_bound()) {
  single_value->field_sinit__max__init__timeo = other_value.sinit__max__init__timeo();
} else {
  single_value->field_sinit__max__init__timeo.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCTP__INIT_template::copy_template(const SCTP__INIT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sinit__num__ostreams().get_selection()) {
single_value->field_sinit__num__ostreams = other_value.sinit__num__ostreams();
} else {
single_value->field_sinit__num__ostreams.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinit__max__instreams().get_selection()) {
single_value->field_sinit__max__instreams = other_value.sinit__max__instreams();
} else {
single_value->field_sinit__max__instreams.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinit__max__attempts().get_selection()) {
single_value->field_sinit__max__attempts = other_value.sinit__max__attempts();
} else {
single_value->field_sinit__max__attempts.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinit__max__init__timeo().get_selection()) {
single_value->field_sinit__max__init__timeo = other_value.sinit__max__init__timeo();
} else {
single_value->field_sinit__max__init__timeo.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 SCTP__INIT_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 SCTP__INIT_template(*other_value.implication_.precondition);
implication_.implied_template = new SCTP__INIT_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 @SCTPasp_Types.SCTP_INIT.");
break;
}
set_selection(other_value);
}

SCTP__INIT_template::SCTP__INIT_template()
{
}

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

SCTP__INIT_template::SCTP__INIT_template(const SCTP__INIT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCTP__INIT_template::match(const SCTP__INIT& 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.sinit__num__ostreams().is_bound()) return FALSE;
if(!single_value->field_sinit__num__ostreams.match(other_value.sinit__num__ostreams(), legacy))return FALSE;
if(!other_value.sinit__max__instreams().is_bound()) return FALSE;
if(!single_value->field_sinit__max__instreams.match(other_value.sinit__max__instreams(), legacy))return FALSE;
if(!other_value.sinit__max__attempts().is_bound()) return FALSE;
if(!single_value->field_sinit__max__attempts.match(other_value.sinit__max__attempts(), legacy))return FALSE;
if(!other_value.sinit__max__init__timeo().is_bound()) return FALSE;
if(!single_value->field_sinit__max__init__timeo.match(other_value.sinit__max__init__timeo(), 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 @SCTPasp_Types.SCTP_INIT.");
}
return FALSE;
}

boolean SCTP__INIT_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sinit__num__ostreams.is_bound()
 || single_value->field_sinit__max__instreams.is_bound()
 || single_value->field_sinit__max__attempts.is_bound()
 || single_value->field_sinit__max__init__timeo.is_bound();
}

boolean SCTP__INIT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sinit__num__ostreams.is_value()
 && single_value->field_sinit__max__instreams.is_value()
 && single_value->field_sinit__max__attempts.is_value()
 && single_value->field_sinit__max__init__timeo.is_value();
}

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

SCTP__INIT SCTP__INIT_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 @SCTPasp_Types.SCTP_INIT.");
SCTP__INIT ret_val;
if (single_value->field_sinit__num__ostreams.is_bound()) {
ret_val.sinit__num__ostreams() = single_value->field_sinit__num__ostreams.valueof();
}
if (single_value->field_sinit__max__instreams.is_bound()) {
ret_val.sinit__max__instreams() = single_value->field_sinit__max__instreams.valueof();
}
if (single_value->field_sinit__max__attempts.is_bound()) {
ret_val.sinit__max__attempts() = single_value->field_sinit__max__attempts.valueof();
}
if (single_value->field_sinit__max__init__timeo.is_bound()) {
ret_val.sinit__max__init__timeo() = single_value->field_sinit__max__init__timeo.valueof();
}
return ret_val;
}

void SCTP__INIT_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 @SCTPasp_Types.SCTP_INIT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCTP__INIT_template[list_length];
}

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

INTEGER_template& SCTP__INIT_template::sinit__num__ostreams()
{
set_specific();
return single_value->field_sinit__num__ostreams;
}

const INTEGER_template& SCTP__INIT_template::sinit__num__ostreams() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinit_num_ostreams of a non-specific template of type @SCTPasp_Types.SCTP_INIT.");
return single_value->field_sinit__num__ostreams;
}

INTEGER_template& SCTP__INIT_template::sinit__max__instreams()
{
set_specific();
return single_value->field_sinit__max__instreams;
}

const INTEGER_template& SCTP__INIT_template::sinit__max__instreams() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinit_max_instreams of a non-specific template of type @SCTPasp_Types.SCTP_INIT.");
return single_value->field_sinit__max__instreams;
}

INTEGER_template& SCTP__INIT_template::sinit__max__attempts()
{
set_specific();
return single_value->field_sinit__max__attempts;
}

const INTEGER_template& SCTP__INIT_template::sinit__max__attempts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinit_max_attempts of a non-specific template of type @SCTPasp_Types.SCTP_INIT.");
return single_value->field_sinit__max__attempts;
}

INTEGER_template& SCTP__INIT_template::sinit__max__init__timeo()
{
set_specific();
return single_value->field_sinit__max__init__timeo;
}

const INTEGER_template& SCTP__INIT_template::sinit__max__init__timeo() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinit_max_init_timeo of a non-specific template of type @SCTPasp_Types.SCTP_INIT.");
return single_value->field_sinit__max__init__timeo;
}

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

void SCTP__INIT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sinit_num_ostreams := ");
single_value->field_sinit__num__ostreams.log();
TTCN_Logger::log_event_str(", sinit_max_instreams := ");
single_value->field_sinit__max__instreams.log();
TTCN_Logger::log_event_str(", sinit_max_attempts := ");
single_value->field_sinit__max__attempts.log();
TTCN_Logger::log_event_str(", sinit_max_init_timeo := ");
single_value->field_sinit__max__init__timeo.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 SCTP__INIT_template::log_match(const SCTP__INIT& 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_sinit__num__ostreams.match(match_value.sinit__num__ostreams(), legacy)){
TTCN_Logger::log_logmatch_info(".sinit_num_ostreams");
single_value->field_sinit__num__ostreams.log_match(match_value.sinit__num__ostreams(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sinit__max__instreams.match(match_value.sinit__max__instreams(), legacy)){
TTCN_Logger::log_logmatch_info(".sinit_max_instreams");
single_value->field_sinit__max__instreams.log_match(match_value.sinit__max__instreams(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sinit__max__attempts.match(match_value.sinit__max__attempts(), legacy)){
TTCN_Logger::log_logmatch_info(".sinit_max_attempts");
single_value->field_sinit__max__attempts.log_match(match_value.sinit__max__attempts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sinit__max__init__timeo.match(match_value.sinit__max__init__timeo(), legacy)){
TTCN_Logger::log_logmatch_info(".sinit_max_init_timeo");
single_value->field_sinit__max__init__timeo.log_match(match_value.sinit__max__init__timeo(), 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("{ sinit_num_ostreams := ");
single_value->field_sinit__num__ostreams.log_match(match_value.sinit__num__ostreams(), legacy);
TTCN_Logger::log_event_str(", sinit_max_instreams := ");
single_value->field_sinit__max__instreams.log_match(match_value.sinit__max__instreams(), legacy);
TTCN_Logger::log_event_str(", sinit_max_attempts := ");
single_value->field_sinit__max__attempts.log_match(match_value.sinit__max__attempts(), legacy);
TTCN_Logger::log_event_str(", sinit_max_init_timeo := ");
single_value->field_sinit__max__init__timeo.log_match(match_value.sinit__max__init__timeo(), 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 SCTP__INIT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sinit__num__ostreams.encode_text(text_buf);
single_value->field_sinit__max__instreams.encode_text(text_buf);
single_value->field_sinit__max__attempts.encode_text(text_buf);
single_value->field_sinit__max__init__timeo.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 @SCTPasp_Types.SCTP_INIT.");
}
}

void SCTP__INIT_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_sinit__num__ostreams.decode_text(text_buf);
single_value->field_sinit__max__instreams.decode_text(text_buf);
single_value->field_sinit__max__attempts.decode_text(text_buf);
single_value->field_sinit__max__init__timeo.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 SCTP__INIT_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 @SCTPasp_Types.SCTP_INIT.");
}
}

void SCTP__INIT_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: {
    SCTP__INIT_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 (4<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.SCTP_INIT has 4 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) sinit__num__ostreams().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinit__max__instreams().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinit__max__attempts().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sinit__max__init__timeo().set_param(*param.get_elem(3));
    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(), "sinit_num_ostreams")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__num__ostreams().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(), "sinit_max_instreams")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__instreams().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(), "sinit_max_attempts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__attempts().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(), "sinit_max_init_timeo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinit__max__init__timeo().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 @SCTPasp_Types.SCTP_INIT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCTP__INIT_template* precondition = new SCTP__INIT_template;
    precondition->set_param(*param.get_elem(0));
    SCTP__INIT_template* implied_template = new SCTP__INIT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCTP__INIT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.SCTP_INIT");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCTP__INIT_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_sinit__num__ostreams.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_INIT");
single_value->field_sinit__max__instreams.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_INIT");
single_value->field_sinit__max__attempts.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_INIT");
single_value->field_sinit__max__init__timeo.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_INIT");
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 : "@SCTPasp_Types.SCTP_INIT");
}

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

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

SCTP__EVENTS::SCTP__EVENTS()
{
}

SCTP__EVENTS::SCTP__EVENTS(const BOOLEAN& par_sctp__data__io__event,
    const BOOLEAN& par_sctp__association__event,
    const BOOLEAN& par_sctp__address__event,
    const BOOLEAN& par_sctp__send__failure__event,
    const BOOLEAN& par_sctp__peer__error__event,
    const BOOLEAN& par_sctp__shutdown__event,
    const BOOLEAN& par_sctp__partial__delivery__event,
    const BOOLEAN& par_sctp__adaption__layer__event)
  :   field_sctp__data__io__event(par_sctp__data__io__event),
  field_sctp__association__event(par_sctp__association__event),
  field_sctp__address__event(par_sctp__address__event),
  field_sctp__send__failure__event(par_sctp__send__failure__event),
  field_sctp__peer__error__event(par_sctp__peer__error__event),
  field_sctp__shutdown__event(par_sctp__shutdown__event),
  field_sctp__partial__delivery__event(par_sctp__partial__delivery__event),
  field_sctp__adaption__layer__event(par_sctp__adaption__layer__event)
{
}

SCTP__EVENTS::SCTP__EVENTS(const SCTP__EVENTS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.SCTP_EVENTS.");
if (other_value.sctp__data__io__event().is_bound()) field_sctp__data__io__event = other_value.sctp__data__io__event();
else field_sctp__data__io__event.clean_up();
if (other_value.sctp__association__event().is_bound()) field_sctp__association__event = other_value.sctp__association__event();
else field_sctp__association__event.clean_up();
if (other_value.sctp__address__event().is_bound()) field_sctp__address__event = other_value.sctp__address__event();
else field_sctp__address__event.clean_up();
if (other_value.sctp__send__failure__event().is_bound()) field_sctp__send__failure__event = other_value.sctp__send__failure__event();
else field_sctp__send__failure__event.clean_up();
if (other_value.sctp__peer__error__event().is_bound()) field_sctp__peer__error__event = other_value.sctp__peer__error__event();
else field_sctp__peer__error__event.clean_up();
if (other_value.sctp__shutdown__event().is_bound()) field_sctp__shutdown__event = other_value.sctp__shutdown__event();
else field_sctp__shutdown__event.clean_up();
if (other_value.sctp__partial__delivery__event().is_bound()) field_sctp__partial__delivery__event = other_value.sctp__partial__delivery__event();
else field_sctp__partial__delivery__event.clean_up();
if (other_value.sctp__adaption__layer__event().is_bound()) field_sctp__adaption__layer__event = other_value.sctp__adaption__layer__event();
else field_sctp__adaption__layer__event.clean_up();
}

void SCTP__EVENTS::clean_up()
{
field_sctp__data__io__event.clean_up();
field_sctp__association__event.clean_up();
field_sctp__address__event.clean_up();
field_sctp__send__failure__event.clean_up();
field_sctp__peer__error__event.clean_up();
field_sctp__shutdown__event.clean_up();
field_sctp__partial__delivery__event.clean_up();
field_sctp__adaption__layer__event.clean_up();
}

const TTCN_Typedescriptor_t* SCTP__EVENTS::get_descriptor() const { return &SCTP__EVENTS_descr_; }
SCTP__EVENTS& SCTP__EVENTS::operator=(const SCTP__EVENTS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.SCTP_EVENTS.");
  if (other_value.sctp__data__io__event().is_bound()) field_sctp__data__io__event = other_value.sctp__data__io__event();
  else field_sctp__data__io__event.clean_up();
  if (other_value.sctp__association__event().is_bound()) field_sctp__association__event = other_value.sctp__association__event();
  else field_sctp__association__event.clean_up();
  if (other_value.sctp__address__event().is_bound()) field_sctp__address__event = other_value.sctp__address__event();
  else field_sctp__address__event.clean_up();
  if (other_value.sctp__send__failure__event().is_bound()) field_sctp__send__failure__event = other_value.sctp__send__failure__event();
  else field_sctp__send__failure__event.clean_up();
  if (other_value.sctp__peer__error__event().is_bound()) field_sctp__peer__error__event = other_value.sctp__peer__error__event();
  else field_sctp__peer__error__event.clean_up();
  if (other_value.sctp__shutdown__event().is_bound()) field_sctp__shutdown__event = other_value.sctp__shutdown__event();
  else field_sctp__shutdown__event.clean_up();
  if (other_value.sctp__partial__delivery__event().is_bound()) field_sctp__partial__delivery__event = other_value.sctp__partial__delivery__event();
  else field_sctp__partial__delivery__event.clean_up();
  if (other_value.sctp__adaption__layer__event().is_bound()) field_sctp__adaption__layer__event = other_value.sctp__adaption__layer__event();
  else field_sctp__adaption__layer__event.clean_up();
}
return *this;
}

boolean SCTP__EVENTS::operator==(const SCTP__EVENTS& other_value) const
{
return field_sctp__data__io__event==other_value.field_sctp__data__io__event
  && field_sctp__association__event==other_value.field_sctp__association__event
  && field_sctp__address__event==other_value.field_sctp__address__event
  && field_sctp__send__failure__event==other_value.field_sctp__send__failure__event
  && field_sctp__peer__error__event==other_value.field_sctp__peer__error__event
  && field_sctp__shutdown__event==other_value.field_sctp__shutdown__event
  && field_sctp__partial__delivery__event==other_value.field_sctp__partial__delivery__event
  && field_sctp__adaption__layer__event==other_value.field_sctp__adaption__layer__event;
}

boolean SCTP__EVENTS::is_bound() const
{
return (field_sctp__data__io__event.is_bound())
  || (field_sctp__association__event.is_bound())
  || (field_sctp__address__event.is_bound())
  || (field_sctp__send__failure__event.is_bound())
  || (field_sctp__peer__error__event.is_bound())
  || (field_sctp__shutdown__event.is_bound())
  || (field_sctp__partial__delivery__event.is_bound())
  || (field_sctp__adaption__layer__event.is_bound());
}
boolean SCTP__EVENTS::is_value() const
{
return field_sctp__data__io__event.is_value()
  && field_sctp__association__event.is_value()
  && field_sctp__address__event.is_value()
  && field_sctp__send__failure__event.is_value()
  && field_sctp__peer__error__event.is_value()
  && field_sctp__shutdown__event.is_value()
  && field_sctp__partial__delivery__event.is_value()
  && field_sctp__adaption__layer__event.is_value();
}
void SCTP__EVENTS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sctp_data_io_event := ");
field_sctp__data__io__event.log();
TTCN_Logger::log_event_str(", sctp_association_event := ");
field_sctp__association__event.log();
TTCN_Logger::log_event_str(", sctp_address_event := ");
field_sctp__address__event.log();
TTCN_Logger::log_event_str(", sctp_send_failure_event := ");
field_sctp__send__failure__event.log();
TTCN_Logger::log_event_str(", sctp_peer_error_event := ");
field_sctp__peer__error__event.log();
TTCN_Logger::log_event_str(", sctp_shutdown_event := ");
field_sctp__shutdown__event.log();
TTCN_Logger::log_event_str(", sctp_partial_delivery_event := ");
field_sctp__partial__delivery__event.log();
TTCN_Logger::log_event_str(", sctp_adaption_layer_event := ");
field_sctp__adaption__layer__event.log();
TTCN_Logger::log_event_str(" }");
}

void SCTP__EVENTS::set_implicit_omit()
{
if (sctp__data__io__event().is_bound()) sctp__data__io__event().set_implicit_omit();
if (sctp__association__event().is_bound()) sctp__association__event().set_implicit_omit();
if (sctp__address__event().is_bound()) sctp__address__event().set_implicit_omit();
if (sctp__send__failure__event().is_bound()) sctp__send__failure__event().set_implicit_omit();
if (sctp__peer__error__event().is_bound()) sctp__peer__error__event().set_implicit_omit();
if (sctp__shutdown__event().is_bound()) sctp__shutdown__event().set_implicit_omit();
if (sctp__partial__delivery__event().is_bound()) sctp__partial__delivery__event().set_implicit_omit();
if (sctp__adaption__layer__event().is_bound()) sctp__adaption__layer__event().set_implicit_omit();
}

void SCTP__EVENTS::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 (8<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.SCTP_EVENTS has 8 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) sctp__data__io__event().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sctp__association__event().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sctp__address__event().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sctp__send__failure__event().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sctp__peer__error__event().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) sctp__shutdown__event().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sctp__partial__delivery__event().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sctp__adaption__layer__event().set_param(*param.get_elem(7));
    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(), "sctp_data_io_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__data__io__event().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(), "sctp_association_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__association__event().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(), "sctp_address_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__address__event().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(), "sctp_send_failure_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__send__failure__event().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(), "sctp_peer_error_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__peer__error__event().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(), "sctp_shutdown_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__shutdown__event().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(), "sctp_partial_delivery_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__partial__delivery__event().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(), "sctp_adaption_layer_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__adaption__layer__event().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 @SCTPasp_Types.SCTP_EVENTS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.SCTP_EVENTS");
  }
}

void SCTP__EVENTS::encode_text(Text_Buf& text_buf) const
{
field_sctp__data__io__event.encode_text(text_buf);
field_sctp__association__event.encode_text(text_buf);
field_sctp__address__event.encode_text(text_buf);
field_sctp__send__failure__event.encode_text(text_buf);
field_sctp__peer__error__event.encode_text(text_buf);
field_sctp__shutdown__event.encode_text(text_buf);
field_sctp__partial__delivery__event.encode_text(text_buf);
field_sctp__adaption__layer__event.encode_text(text_buf);
}

void SCTP__EVENTS::decode_text(Text_Buf& text_buf)
{
field_sctp__data__io__event.decode_text(text_buf);
field_sctp__association__event.decode_text(text_buf);
field_sctp__address__event.decode_text(text_buf);
field_sctp__send__failure__event.decode_text(text_buf);
field_sctp__peer__error__event.decode_text(text_buf);
field_sctp__shutdown__event.decode_text(text_buf);
field_sctp__partial__delivery__event.decode_text(text_buf);
field_sctp__adaption__layer__event.decode_text(text_buf);
}

struct SCTP__EVENTS_template::single_value_struct {
BOOLEAN_template field_sctp__data__io__event;
BOOLEAN_template field_sctp__association__event;
BOOLEAN_template field_sctp__address__event;
BOOLEAN_template field_sctp__send__failure__event;
BOOLEAN_template field_sctp__peer__error__event;
BOOLEAN_template field_sctp__shutdown__event;
BOOLEAN_template field_sctp__partial__delivery__event;
BOOLEAN_template field_sctp__adaption__layer__event;
};

void SCTP__EVENTS_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_sctp__data__io__event = ANY_VALUE;
single_value->field_sctp__association__event = ANY_VALUE;
single_value->field_sctp__address__event = ANY_VALUE;
single_value->field_sctp__send__failure__event = ANY_VALUE;
single_value->field_sctp__peer__error__event = ANY_VALUE;
single_value->field_sctp__shutdown__event = ANY_VALUE;
single_value->field_sctp__partial__delivery__event = ANY_VALUE;
single_value->field_sctp__adaption__layer__event = ANY_VALUE;
}
}
}

void SCTP__EVENTS_template::copy_value(const SCTP__EVENTS& other_value)
{
single_value = new single_value_struct;
if (other_value.sctp__data__io__event().is_bound()) {
  single_value->field_sctp__data__io__event = other_value.sctp__data__io__event();
} else {
  single_value->field_sctp__data__io__event.clean_up();
}
if (other_value.sctp__association__event().is_bound()) {
  single_value->field_sctp__association__event = other_value.sctp__association__event();
} else {
  single_value->field_sctp__association__event.clean_up();
}
if (other_value.sctp__address__event().is_bound()) {
  single_value->field_sctp__address__event = other_value.sctp__address__event();
} else {
  single_value->field_sctp__address__event.clean_up();
}
if (other_value.sctp__send__failure__event().is_bound()) {
  single_value->field_sctp__send__failure__event = other_value.sctp__send__failure__event();
} else {
  single_value->field_sctp__send__failure__event.clean_up();
}
if (other_value.sctp__peer__error__event().is_bound()) {
  single_value->field_sctp__peer__error__event = other_value.sctp__peer__error__event();
} else {
  single_value->field_sctp__peer__error__event.clean_up();
}
if (other_value.sctp__shutdown__event().is_bound()) {
  single_value->field_sctp__shutdown__event = other_value.sctp__shutdown__event();
} else {
  single_value->field_sctp__shutdown__event.clean_up();
}
if (other_value.sctp__partial__delivery__event().is_bound()) {
  single_value->field_sctp__partial__delivery__event = other_value.sctp__partial__delivery__event();
} else {
  single_value->field_sctp__partial__delivery__event.clean_up();
}
if (other_value.sctp__adaption__layer__event().is_bound()) {
  single_value->field_sctp__adaption__layer__event = other_value.sctp__adaption__layer__event();
} else {
  single_value->field_sctp__adaption__layer__event.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCTP__EVENTS_template::copy_template(const SCTP__EVENTS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sctp__data__io__event().get_selection()) {
single_value->field_sctp__data__io__event = other_value.sctp__data__io__event();
} else {
single_value->field_sctp__data__io__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__association__event().get_selection()) {
single_value->field_sctp__association__event = other_value.sctp__association__event();
} else {
single_value->field_sctp__association__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__address__event().get_selection()) {
single_value->field_sctp__address__event = other_value.sctp__address__event();
} else {
single_value->field_sctp__address__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__send__failure__event().get_selection()) {
single_value->field_sctp__send__failure__event = other_value.sctp__send__failure__event();
} else {
single_value->field_sctp__send__failure__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__peer__error__event().get_selection()) {
single_value->field_sctp__peer__error__event = other_value.sctp__peer__error__event();
} else {
single_value->field_sctp__peer__error__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__shutdown__event().get_selection()) {
single_value->field_sctp__shutdown__event = other_value.sctp__shutdown__event();
} else {
single_value->field_sctp__shutdown__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__partial__delivery__event().get_selection()) {
single_value->field_sctp__partial__delivery__event = other_value.sctp__partial__delivery__event();
} else {
single_value->field_sctp__partial__delivery__event.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sctp__adaption__layer__event().get_selection()) {
single_value->field_sctp__adaption__layer__event = other_value.sctp__adaption__layer__event();
} else {
single_value->field_sctp__adaption__layer__event.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 SCTP__EVENTS_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 SCTP__EVENTS_template(*other_value.implication_.precondition);
implication_.implied_template = new SCTP__EVENTS_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 @SCTPasp_Types.SCTP_EVENTS.");
break;
}
set_selection(other_value);
}

SCTP__EVENTS_template::SCTP__EVENTS_template()
{
}

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

SCTP__EVENTS_template::SCTP__EVENTS_template(const SCTP__EVENTS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCTP__EVENTS_template::match(const SCTP__EVENTS& 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.sctp__data__io__event().is_bound()) return FALSE;
if(!single_value->field_sctp__data__io__event.match(other_value.sctp__data__io__event(), legacy))return FALSE;
if(!other_value.sctp__association__event().is_bound()) return FALSE;
if(!single_value->field_sctp__association__event.match(other_value.sctp__association__event(), legacy))return FALSE;
if(!other_value.sctp__address__event().is_bound()) return FALSE;
if(!single_value->field_sctp__address__event.match(other_value.sctp__address__event(), legacy))return FALSE;
if(!other_value.sctp__send__failure__event().is_bound()) return FALSE;
if(!single_value->field_sctp__send__failure__event.match(other_value.sctp__send__failure__event(), legacy))return FALSE;
if(!other_value.sctp__peer__error__event().is_bound()) return FALSE;
if(!single_value->field_sctp__peer__error__event.match(other_value.sctp__peer__error__event(), legacy))return FALSE;
if(!other_value.sctp__shutdown__event().is_bound()) return FALSE;
if(!single_value->field_sctp__shutdown__event.match(other_value.sctp__shutdown__event(), legacy))return FALSE;
if(!other_value.sctp__partial__delivery__event().is_bound()) return FALSE;
if(!single_value->field_sctp__partial__delivery__event.match(other_value.sctp__partial__delivery__event(), legacy))return FALSE;
if(!other_value.sctp__adaption__layer__event().is_bound()) return FALSE;
if(!single_value->field_sctp__adaption__layer__event.match(other_value.sctp__adaption__layer__event(), 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 @SCTPasp_Types.SCTP_EVENTS.");
}
return FALSE;
}

boolean SCTP__EVENTS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sctp__data__io__event.is_bound()
 || single_value->field_sctp__association__event.is_bound()
 || single_value->field_sctp__address__event.is_bound()
 || single_value->field_sctp__send__failure__event.is_bound()
 || single_value->field_sctp__peer__error__event.is_bound()
 || single_value->field_sctp__shutdown__event.is_bound()
 || single_value->field_sctp__partial__delivery__event.is_bound()
 || single_value->field_sctp__adaption__layer__event.is_bound();
}

boolean SCTP__EVENTS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sctp__data__io__event.is_value()
 && single_value->field_sctp__association__event.is_value()
 && single_value->field_sctp__address__event.is_value()
 && single_value->field_sctp__send__failure__event.is_value()
 && single_value->field_sctp__peer__error__event.is_value()
 && single_value->field_sctp__shutdown__event.is_value()
 && single_value->field_sctp__partial__delivery__event.is_value()
 && single_value->field_sctp__adaption__layer__event.is_value();
}

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

SCTP__EVENTS SCTP__EVENTS_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 @SCTPasp_Types.SCTP_EVENTS.");
SCTP__EVENTS ret_val;
if (single_value->field_sctp__data__io__event.is_bound()) {
ret_val.sctp__data__io__event() = single_value->field_sctp__data__io__event.valueof();
}
if (single_value->field_sctp__association__event.is_bound()) {
ret_val.sctp__association__event() = single_value->field_sctp__association__event.valueof();
}
if (single_value->field_sctp__address__event.is_bound()) {
ret_val.sctp__address__event() = single_value->field_sctp__address__event.valueof();
}
if (single_value->field_sctp__send__failure__event.is_bound()) {
ret_val.sctp__send__failure__event() = single_value->field_sctp__send__failure__event.valueof();
}
if (single_value->field_sctp__peer__error__event.is_bound()) {
ret_val.sctp__peer__error__event() = single_value->field_sctp__peer__error__event.valueof();
}
if (single_value->field_sctp__shutdown__event.is_bound()) {
ret_val.sctp__shutdown__event() = single_value->field_sctp__shutdown__event.valueof();
}
if (single_value->field_sctp__partial__delivery__event.is_bound()) {
ret_val.sctp__partial__delivery__event() = single_value->field_sctp__partial__delivery__event.valueof();
}
if (single_value->field_sctp__adaption__layer__event.is_bound()) {
ret_val.sctp__adaption__layer__event() = single_value->field_sctp__adaption__layer__event.valueof();
}
return ret_val;
}

void SCTP__EVENTS_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 @SCTPasp_Types.SCTP_EVENTS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCTP__EVENTS_template[list_length];
}

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

BOOLEAN_template& SCTP__EVENTS_template::sctp__data__io__event()
{
set_specific();
return single_value->field_sctp__data__io__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__data__io__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_data_io_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__data__io__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__association__event()
{
set_specific();
return single_value->field_sctp__association__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__association__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_association_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__association__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__address__event()
{
set_specific();
return single_value->field_sctp__address__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__address__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_address_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__address__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__send__failure__event()
{
set_specific();
return single_value->field_sctp__send__failure__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__send__failure__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_send_failure_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__send__failure__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__peer__error__event()
{
set_specific();
return single_value->field_sctp__peer__error__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__peer__error__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_peer_error_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__peer__error__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__shutdown__event()
{
set_specific();
return single_value->field_sctp__shutdown__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__shutdown__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_shutdown_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__shutdown__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__partial__delivery__event()
{
set_specific();
return single_value->field_sctp__partial__delivery__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__partial__delivery__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_partial_delivery_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__partial__delivery__event;
}

BOOLEAN_template& SCTP__EVENTS_template::sctp__adaption__layer__event()
{
set_specific();
return single_value->field_sctp__adaption__layer__event;
}

const BOOLEAN_template& SCTP__EVENTS_template::sctp__adaption__layer__event() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sctp_adaption_layer_event of a non-specific template of type @SCTPasp_Types.SCTP_EVENTS.");
return single_value->field_sctp__adaption__layer__event;
}

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

void SCTP__EVENTS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sctp_data_io_event := ");
single_value->field_sctp__data__io__event.log();
TTCN_Logger::log_event_str(", sctp_association_event := ");
single_value->field_sctp__association__event.log();
TTCN_Logger::log_event_str(", sctp_address_event := ");
single_value->field_sctp__address__event.log();
TTCN_Logger::log_event_str(", sctp_send_failure_event := ");
single_value->field_sctp__send__failure__event.log();
TTCN_Logger::log_event_str(", sctp_peer_error_event := ");
single_value->field_sctp__peer__error__event.log();
TTCN_Logger::log_event_str(", sctp_shutdown_event := ");
single_value->field_sctp__shutdown__event.log();
TTCN_Logger::log_event_str(", sctp_partial_delivery_event := ");
single_value->field_sctp__partial__delivery__event.log();
TTCN_Logger::log_event_str(", sctp_adaption_layer_event := ");
single_value->field_sctp__adaption__layer__event.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 SCTP__EVENTS_template::log_match(const SCTP__EVENTS& 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_sctp__data__io__event.match(match_value.sctp__data__io__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_data_io_event");
single_value->field_sctp__data__io__event.log_match(match_value.sctp__data__io__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__association__event.match(match_value.sctp__association__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_association_event");
single_value->field_sctp__association__event.log_match(match_value.sctp__association__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__address__event.match(match_value.sctp__address__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_address_event");
single_value->field_sctp__address__event.log_match(match_value.sctp__address__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__send__failure__event.match(match_value.sctp__send__failure__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_send_failure_event");
single_value->field_sctp__send__failure__event.log_match(match_value.sctp__send__failure__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__peer__error__event.match(match_value.sctp__peer__error__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_peer_error_event");
single_value->field_sctp__peer__error__event.log_match(match_value.sctp__peer__error__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__shutdown__event.match(match_value.sctp__shutdown__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_shutdown_event");
single_value->field_sctp__shutdown__event.log_match(match_value.sctp__shutdown__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__partial__delivery__event.match(match_value.sctp__partial__delivery__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_partial_delivery_event");
single_value->field_sctp__partial__delivery__event.log_match(match_value.sctp__partial__delivery__event(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sctp__adaption__layer__event.match(match_value.sctp__adaption__layer__event(), legacy)){
TTCN_Logger::log_logmatch_info(".sctp_adaption_layer_event");
single_value->field_sctp__adaption__layer__event.log_match(match_value.sctp__adaption__layer__event(), 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("{ sctp_data_io_event := ");
single_value->field_sctp__data__io__event.log_match(match_value.sctp__data__io__event(), legacy);
TTCN_Logger::log_event_str(", sctp_association_event := ");
single_value->field_sctp__association__event.log_match(match_value.sctp__association__event(), legacy);
TTCN_Logger::log_event_str(", sctp_address_event := ");
single_value->field_sctp__address__event.log_match(match_value.sctp__address__event(), legacy);
TTCN_Logger::log_event_str(", sctp_send_failure_event := ");
single_value->field_sctp__send__failure__event.log_match(match_value.sctp__send__failure__event(), legacy);
TTCN_Logger::log_event_str(", sctp_peer_error_event := ");
single_value->field_sctp__peer__error__event.log_match(match_value.sctp__peer__error__event(), legacy);
TTCN_Logger::log_event_str(", sctp_shutdown_event := ");
single_value->field_sctp__shutdown__event.log_match(match_value.sctp__shutdown__event(), legacy);
TTCN_Logger::log_event_str(", sctp_partial_delivery_event := ");
single_value->field_sctp__partial__delivery__event.log_match(match_value.sctp__partial__delivery__event(), legacy);
TTCN_Logger::log_event_str(", sctp_adaption_layer_event := ");
single_value->field_sctp__adaption__layer__event.log_match(match_value.sctp__adaption__layer__event(), 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 SCTP__EVENTS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sctp__data__io__event.encode_text(text_buf);
single_value->field_sctp__association__event.encode_text(text_buf);
single_value->field_sctp__address__event.encode_text(text_buf);
single_value->field_sctp__send__failure__event.encode_text(text_buf);
single_value->field_sctp__peer__error__event.encode_text(text_buf);
single_value->field_sctp__shutdown__event.encode_text(text_buf);
single_value->field_sctp__partial__delivery__event.encode_text(text_buf);
single_value->field_sctp__adaption__layer__event.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 @SCTPasp_Types.SCTP_EVENTS.");
}
}

void SCTP__EVENTS_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_sctp__data__io__event.decode_text(text_buf);
single_value->field_sctp__association__event.decode_text(text_buf);
single_value->field_sctp__address__event.decode_text(text_buf);
single_value->field_sctp__send__failure__event.decode_text(text_buf);
single_value->field_sctp__peer__error__event.decode_text(text_buf);
single_value->field_sctp__shutdown__event.decode_text(text_buf);
single_value->field_sctp__partial__delivery__event.decode_text(text_buf);
single_value->field_sctp__adaption__layer__event.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 SCTP__EVENTS_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 @SCTPasp_Types.SCTP_EVENTS.");
}
}

void SCTP__EVENTS_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: {
    SCTP__EVENTS_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 (8<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.SCTP_EVENTS has 8 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) sctp__data__io__event().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sctp__association__event().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sctp__address__event().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) sctp__send__failure__event().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sctp__peer__error__event().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) sctp__shutdown__event().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) sctp__partial__delivery__event().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sctp__adaption__layer__event().set_param(*param.get_elem(7));
    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(), "sctp_data_io_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__data__io__event().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(), "sctp_association_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__association__event().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(), "sctp_address_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__address__event().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(), "sctp_send_failure_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__send__failure__event().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(), "sctp_peer_error_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__peer__error__event().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(), "sctp_shutdown_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__shutdown__event().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(), "sctp_partial_delivery_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__partial__delivery__event().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(), "sctp_adaption_layer_event")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sctp__adaption__layer__event().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 @SCTPasp_Types.SCTP_EVENTS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCTP__EVENTS_template* precondition = new SCTP__EVENTS_template;
    precondition->set_param(*param.get_elem(0));
    SCTP__EVENTS_template* implied_template = new SCTP__EVENTS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCTP__EVENTS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.SCTP_EVENTS");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCTP__EVENTS_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_sctp__data__io__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__association__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__address__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__send__failure__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__peer__error__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__shutdown__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__partial__delivery__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
single_value->field_sctp__adaption__layer__event.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_EVENTS");
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 : "@SCTPasp_Types.SCTP_EVENTS");
}

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

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

SO__LINGER::SO__LINGER()
{
}

SO__LINGER::SO__LINGER(const INTEGER& par_l__onoff,
    const INTEGER& par_l__linger)
  :   field_l__onoff(par_l__onoff),
  field_l__linger(par_l__linger)
{
}

SO__LINGER::SO__LINGER(const SO__LINGER& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.SO_LINGER.");
if (other_value.l__onoff().is_bound()) field_l__onoff = other_value.l__onoff();
else field_l__onoff.clean_up();
if (other_value.l__linger().is_bound()) field_l__linger = other_value.l__linger();
else field_l__linger.clean_up();
}

void SO__LINGER::clean_up()
{
field_l__onoff.clean_up();
field_l__linger.clean_up();
}

const TTCN_Typedescriptor_t* SO__LINGER::get_descriptor() const { return &SO__LINGER_descr_; }
SO__LINGER& SO__LINGER::operator=(const SO__LINGER& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.SO_LINGER.");
  if (other_value.l__onoff().is_bound()) field_l__onoff = other_value.l__onoff();
  else field_l__onoff.clean_up();
  if (other_value.l__linger().is_bound()) field_l__linger = other_value.l__linger();
  else field_l__linger.clean_up();
}
return *this;
}

boolean SO__LINGER::operator==(const SO__LINGER& other_value) const
{
return field_l__onoff==other_value.field_l__onoff
  && field_l__linger==other_value.field_l__linger;
}

boolean SO__LINGER::is_bound() const
{
return (field_l__onoff.is_bound())
  || (field_l__linger.is_bound());
}
boolean SO__LINGER::is_value() const
{
return field_l__onoff.is_value()
  && field_l__linger.is_value();
}
void SO__LINGER::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ l_onoff := ");
field_l__onoff.log();
TTCN_Logger::log_event_str(", l_linger := ");
field_l__linger.log();
TTCN_Logger::log_event_str(" }");
}

void SO__LINGER::set_implicit_omit()
{
if (l__onoff().is_bound()) l__onoff().set_implicit_omit();
if (l__linger().is_bound()) l__linger().set_implicit_omit();
}

void SO__LINGER::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 @SCTPasp_Types.SO_LINGER 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) l__onoff().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) l__linger().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(), "l_onoff")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l__onoff().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(), "l_linger")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l__linger().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 @SCTPasp_Types.SO_LINGER: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.SO_LINGER");
  }
}

void SO__LINGER::encode_text(Text_Buf& text_buf) const
{
field_l__onoff.encode_text(text_buf);
field_l__linger.encode_text(text_buf);
}

void SO__LINGER::decode_text(Text_Buf& text_buf)
{
field_l__onoff.decode_text(text_buf);
field_l__linger.decode_text(text_buf);
}

struct SO__LINGER_template::single_value_struct {
INTEGER_template field_l__onoff;
INTEGER_template field_l__linger;
};

void SO__LINGER_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_l__onoff = ANY_VALUE;
single_value->field_l__linger = ANY_VALUE;
}
}
}

void SO__LINGER_template::copy_value(const SO__LINGER& other_value)
{
single_value = new single_value_struct;
if (other_value.l__onoff().is_bound()) {
  single_value->field_l__onoff = other_value.l__onoff();
} else {
  single_value->field_l__onoff.clean_up();
}
if (other_value.l__linger().is_bound()) {
  single_value->field_l__linger = other_value.l__linger();
} else {
  single_value->field_l__linger.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SO__LINGER_template::copy_template(const SO__LINGER_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.l__onoff().get_selection()) {
single_value->field_l__onoff = other_value.l__onoff();
} else {
single_value->field_l__onoff.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.l__linger().get_selection()) {
single_value->field_l__linger = other_value.l__linger();
} else {
single_value->field_l__linger.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 SO__LINGER_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 SO__LINGER_template(*other_value.implication_.precondition);
implication_.implied_template = new SO__LINGER_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 @SCTPasp_Types.SO_LINGER.");
break;
}
set_selection(other_value);
}

SO__LINGER_template::SO__LINGER_template()
{
}

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

SO__LINGER_template::SO__LINGER_template(const SO__LINGER& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SO__LINGER_template::match(const SO__LINGER& 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.l__onoff().is_bound()) return FALSE;
if(!single_value->field_l__onoff.match(other_value.l__onoff(), legacy))return FALSE;
if(!other_value.l__linger().is_bound()) return FALSE;
if(!single_value->field_l__linger.match(other_value.l__linger(), 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 @SCTPasp_Types.SO_LINGER.");
}
return FALSE;
}

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

boolean SO__LINGER_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_l__onoff.is_value()
 && single_value->field_l__linger.is_value();
}

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

SO__LINGER SO__LINGER_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 @SCTPasp_Types.SO_LINGER.");
SO__LINGER ret_val;
if (single_value->field_l__onoff.is_bound()) {
ret_val.l__onoff() = single_value->field_l__onoff.valueof();
}
if (single_value->field_l__linger.is_bound()) {
ret_val.l__linger() = single_value->field_l__linger.valueof();
}
return ret_val;
}

void SO__LINGER_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 @SCTPasp_Types.SO_LINGER.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SO__LINGER_template[list_length];
}

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

INTEGER_template& SO__LINGER_template::l__onoff()
{
set_specific();
return single_value->field_l__onoff;
}

const INTEGER_template& SO__LINGER_template::l__onoff() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l_onoff of a non-specific template of type @SCTPasp_Types.SO_LINGER.");
return single_value->field_l__onoff;
}

INTEGER_template& SO__LINGER_template::l__linger()
{
set_specific();
return single_value->field_l__linger;
}

const INTEGER_template& SO__LINGER_template::l__linger() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l_linger of a non-specific template of type @SCTPasp_Types.SO_LINGER.");
return single_value->field_l__linger;
}

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

void SO__LINGER_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ l_onoff := ");
single_value->field_l__onoff.log();
TTCN_Logger::log_event_str(", l_linger := ");
single_value->field_l__linger.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 SO__LINGER_template::log_match(const SO__LINGER& 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_l__onoff.match(match_value.l__onoff(), legacy)){
TTCN_Logger::log_logmatch_info(".l_onoff");
single_value->field_l__onoff.log_match(match_value.l__onoff(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_l__linger.match(match_value.l__linger(), legacy)){
TTCN_Logger::log_logmatch_info(".l_linger");
single_value->field_l__linger.log_match(match_value.l__linger(), 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("{ l_onoff := ");
single_value->field_l__onoff.log_match(match_value.l__onoff(), legacy);
TTCN_Logger::log_event_str(", l_linger := ");
single_value->field_l__linger.log_match(match_value.l__linger(), 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 SO__LINGER_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_l__onoff.encode_text(text_buf);
single_value->field_l__linger.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 @SCTPasp_Types.SO_LINGER.");
}
}

void SO__LINGER_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_l__onoff.decode_text(text_buf);
single_value->field_l__linger.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 SO__LINGER_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 @SCTPasp_Types.SO_LINGER.");
}
}

void SO__LINGER_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: {
    SO__LINGER_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 @SCTPasp_Types.SO_LINGER 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) l__onoff().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) l__linger().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(), "l_onoff")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l__onoff().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(), "l_linger")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l__linger().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 @SCTPasp_Types.SO_LINGER: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SO__LINGER_template* precondition = new SO__LINGER_template;
    precondition->set_param(*param.get_elem(0));
    SO__LINGER_template* implied_template = new SO__LINGER_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SO__LINGER_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.SO_LINGER");
  }
  is_ifpresent = param.get_ifpresent();
}

void SO__LINGER_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_l__onoff.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SO_LINGER");
single_value->field_l__linger.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SO_LINGER");
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 : "@SCTPasp_Types.SO_LINGER");
}

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

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

SCTP__RTOINFO::SCTP__RTOINFO()
{
}

SCTP__RTOINFO::SCTP__RTOINFO(const INTEGER& par_client__id,
    const INTEGER& par_srto__initial,
    const INTEGER& par_srto__max,
    const INTEGER& par_srto__min)
  :   field_client__id(par_client__id),
  field_srto__initial(par_srto__initial),
  field_srto__max(par_srto__max),
  field_srto__min(par_srto__min)
{
}

SCTP__RTOINFO::SCTP__RTOINFO(const SCTP__RTOINFO& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.SCTP_RTOINFO.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.srto__initial().is_bound()) field_srto__initial = other_value.srto__initial();
else field_srto__initial.clean_up();
if (other_value.srto__max().is_bound()) field_srto__max = other_value.srto__max();
else field_srto__max.clean_up();
if (other_value.srto__min().is_bound()) field_srto__min = other_value.srto__min();
else field_srto__min.clean_up();
}

void SCTP__RTOINFO::clean_up()
{
field_client__id.clean_up();
field_srto__initial.clean_up();
field_srto__max.clean_up();
field_srto__min.clean_up();
}

const TTCN_Typedescriptor_t* SCTP__RTOINFO::get_descriptor() const { return &SCTP__RTOINFO_descr_; }
SCTP__RTOINFO& SCTP__RTOINFO::operator=(const SCTP__RTOINFO& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.SCTP_RTOINFO.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.srto__initial().is_bound()) field_srto__initial = other_value.srto__initial();
  else field_srto__initial.clean_up();
  if (other_value.srto__max().is_bound()) field_srto__max = other_value.srto__max();
  else field_srto__max.clean_up();
  if (other_value.srto__min().is_bound()) field_srto__min = other_value.srto__min();
  else field_srto__min.clean_up();
}
return *this;
}

boolean SCTP__RTOINFO::operator==(const SCTP__RTOINFO& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_srto__initial==other_value.field_srto__initial
  && field_srto__max==other_value.field_srto__max
  && field_srto__min==other_value.field_srto__min;
}

boolean SCTP__RTOINFO::is_bound() const
{
return (field_client__id.is_bound())
  || (field_srto__initial.is_bound())
  || (field_srto__max.is_bound())
  || (field_srto__min.is_bound());
}
boolean SCTP__RTOINFO::is_value() const
{
return field_client__id.is_value()
  && field_srto__initial.is_value()
  && field_srto__max.is_value()
  && field_srto__min.is_value();
}
void SCTP__RTOINFO::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", srto_initial := ");
field_srto__initial.log();
TTCN_Logger::log_event_str(", srto_max := ");
field_srto__max.log();
TTCN_Logger::log_event_str(", srto_min := ");
field_srto__min.log();
TTCN_Logger::log_event_str(" }");
}

void SCTP__RTOINFO::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
if (srto__initial().is_bound()) srto__initial().set_implicit_omit();
if (srto__max().is_bound()) srto__max().set_implicit_omit();
if (srto__min().is_bound()) srto__min().set_implicit_omit();
}

void SCTP__RTOINFO::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 (4<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.SCTP_RTOINFO has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) srto__initial().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) srto__max().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) srto__min().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "srto_initial")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__initial().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(), "srto_max")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__max().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(), "srto_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__min().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 @SCTPasp_Types.SCTP_RTOINFO: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.SCTP_RTOINFO");
  }
}

void SCTP__RTOINFO::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_srto__initial.encode_text(text_buf);
field_srto__max.encode_text(text_buf);
field_srto__min.encode_text(text_buf);
}

void SCTP__RTOINFO::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_srto__initial.decode_text(text_buf);
field_srto__max.decode_text(text_buf);
field_srto__min.decode_text(text_buf);
}

struct SCTP__RTOINFO_template::single_value_struct {
INTEGER_template field_client__id;
INTEGER_template field_srto__initial;
INTEGER_template field_srto__max;
INTEGER_template field_srto__min;
};

void SCTP__RTOINFO_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_client__id = ANY_VALUE;
single_value->field_srto__initial = ANY_VALUE;
single_value->field_srto__max = ANY_VALUE;
single_value->field_srto__min = ANY_VALUE;
}
}
}

void SCTP__RTOINFO_template::copy_value(const SCTP__RTOINFO& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.srto__initial().is_bound()) {
  single_value->field_srto__initial = other_value.srto__initial();
} else {
  single_value->field_srto__initial.clean_up();
}
if (other_value.srto__max().is_bound()) {
  single_value->field_srto__max = other_value.srto__max();
} else {
  single_value->field_srto__max.clean_up();
}
if (other_value.srto__min().is_bound()) {
  single_value->field_srto__min = other_value.srto__min();
} else {
  single_value->field_srto__min.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCTP__RTOINFO_template::copy_template(const SCTP__RTOINFO_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.srto__initial().get_selection()) {
single_value->field_srto__initial = other_value.srto__initial();
} else {
single_value->field_srto__initial.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.srto__max().get_selection()) {
single_value->field_srto__max = other_value.srto__max();
} else {
single_value->field_srto__max.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.srto__min().get_selection()) {
single_value->field_srto__min = other_value.srto__min();
} else {
single_value->field_srto__min.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 SCTP__RTOINFO_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 SCTP__RTOINFO_template(*other_value.implication_.precondition);
implication_.implied_template = new SCTP__RTOINFO_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 @SCTPasp_Types.SCTP_RTOINFO.");
break;
}
set_selection(other_value);
}

SCTP__RTOINFO_template::SCTP__RTOINFO_template()
{
}

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

SCTP__RTOINFO_template::SCTP__RTOINFO_template(const SCTP__RTOINFO& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCTP__RTOINFO_template::match(const SCTP__RTOINFO& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
if(!other_value.srto__initial().is_bound()) return FALSE;
if(!single_value->field_srto__initial.match(other_value.srto__initial(), legacy))return FALSE;
if(!other_value.srto__max().is_bound()) return FALSE;
if(!single_value->field_srto__max.match(other_value.srto__max(), legacy))return FALSE;
if(!other_value.srto__min().is_bound()) return FALSE;
if(!single_value->field_srto__min.match(other_value.srto__min(), 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 @SCTPasp_Types.SCTP_RTOINFO.");
}
return FALSE;
}

boolean SCTP__RTOINFO_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_client__id.is_bound()
 || single_value->field_srto__initial.is_bound()
 || single_value->field_srto__max.is_bound()
 || single_value->field_srto__min.is_bound();
}

boolean SCTP__RTOINFO_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_client__id.is_value()
 && single_value->field_srto__initial.is_value()
 && single_value->field_srto__max.is_value()
 && single_value->field_srto__min.is_value();
}

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

SCTP__RTOINFO SCTP__RTOINFO_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 @SCTPasp_Types.SCTP_RTOINFO.");
SCTP__RTOINFO ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_srto__initial.is_bound()) {
ret_val.srto__initial() = single_value->field_srto__initial.valueof();
}
if (single_value->field_srto__max.is_bound()) {
ret_val.srto__max() = single_value->field_srto__max.valueof();
}
if (single_value->field_srto__min.is_bound()) {
ret_val.srto__min() = single_value->field_srto__min.valueof();
}
return ret_val;
}

void SCTP__RTOINFO_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 @SCTPasp_Types.SCTP_RTOINFO.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCTP__RTOINFO_template[list_length];
}

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

INTEGER_template& SCTP__RTOINFO_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& SCTP__RTOINFO_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.SCTP_RTOINFO.");
return single_value->field_client__id;
}

INTEGER_template& SCTP__RTOINFO_template::srto__initial()
{
set_specific();
return single_value->field_srto__initial;
}

const INTEGER_template& SCTP__RTOINFO_template::srto__initial() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field srto_initial of a non-specific template of type @SCTPasp_Types.SCTP_RTOINFO.");
return single_value->field_srto__initial;
}

INTEGER_template& SCTP__RTOINFO_template::srto__max()
{
set_specific();
return single_value->field_srto__max;
}

const INTEGER_template& SCTP__RTOINFO_template::srto__max() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field srto_max of a non-specific template of type @SCTPasp_Types.SCTP_RTOINFO.");
return single_value->field_srto__max;
}

INTEGER_template& SCTP__RTOINFO_template::srto__min()
{
set_specific();
return single_value->field_srto__min;
}

const INTEGER_template& SCTP__RTOINFO_template::srto__min() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field srto_min of a non-specific template of type @SCTPasp_Types.SCTP_RTOINFO.");
return single_value->field_srto__min;
}

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

void SCTP__RTOINFO_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", srto_initial := ");
single_value->field_srto__initial.log();
TTCN_Logger::log_event_str(", srto_max := ");
single_value->field_srto__max.log();
TTCN_Logger::log_event_str(", srto_min := ");
single_value->field_srto__min.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 SCTP__RTOINFO_template::log_match(const SCTP__RTOINFO& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_srto__initial.match(match_value.srto__initial(), legacy)){
TTCN_Logger::log_logmatch_info(".srto_initial");
single_value->field_srto__initial.log_match(match_value.srto__initial(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_srto__max.match(match_value.srto__max(), legacy)){
TTCN_Logger::log_logmatch_info(".srto_max");
single_value->field_srto__max.log_match(match_value.srto__max(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_srto__min.match(match_value.srto__min(), legacy)){
TTCN_Logger::log_logmatch_info(".srto_min");
single_value->field_srto__min.log_match(match_value.srto__min(), 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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(", srto_initial := ");
single_value->field_srto__initial.log_match(match_value.srto__initial(), legacy);
TTCN_Logger::log_event_str(", srto_max := ");
single_value->field_srto__max.log_match(match_value.srto__max(), legacy);
TTCN_Logger::log_event_str(", srto_min := ");
single_value->field_srto__min.log_match(match_value.srto__min(), 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 SCTP__RTOINFO_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_srto__initial.encode_text(text_buf);
single_value->field_srto__max.encode_text(text_buf);
single_value->field_srto__min.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 @SCTPasp_Types.SCTP_RTOINFO.");
}
}

void SCTP__RTOINFO_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_client__id.decode_text(text_buf);
single_value->field_srto__initial.decode_text(text_buf);
single_value->field_srto__max.decode_text(text_buf);
single_value->field_srto__min.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 SCTP__RTOINFO_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 @SCTPasp_Types.SCTP_RTOINFO.");
}
}

void SCTP__RTOINFO_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: {
    SCTP__RTOINFO_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 (4<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.SCTP_RTOINFO has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) srto__initial().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) srto__max().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) srto__min().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "srto_initial")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__initial().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(), "srto_max")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__max().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(), "srto_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          srto__min().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 @SCTPasp_Types.SCTP_RTOINFO: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCTP__RTOINFO_template* precondition = new SCTP__RTOINFO_template;
    precondition->set_param(*param.get_elem(0));
    SCTP__RTOINFO_template* implied_template = new SCTP__RTOINFO_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCTP__RTOINFO_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.SCTP_RTOINFO");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCTP__RTOINFO_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_RTOINFO");
single_value->field_srto__initial.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_RTOINFO");
single_value->field_srto__max.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_RTOINFO");
single_value->field_srto__min.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.SCTP_RTOINFO");
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 : "@SCTPasp_Types.SCTP_RTOINFO");
}

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

boolean SCTP__RTOINFO_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 ASP__SCTP__SetSocketOptions::copy_value(const ASP__SCTP__SetSocketOptions& other_value)
{
switch (other_value.union_selection) {
case ALT_Sctp__init:
field_Sctp__init = new SCTP__INIT(*other_value.field_Sctp__init);
break;
case ALT_Sctp__events:
field_Sctp__events = new SCTP__EVENTS(*other_value.field_Sctp__events);
break;
case ALT_So__linger:
field_So__linger = new SO__LINGER(*other_value.field_So__linger);
break;
case ALT_Sctp__rtoinfo:
field_Sctp__rtoinfo = new SCTP__RTOINFO(*other_value.field_Sctp__rtoinfo);
break;
default:
TTCN_error("Assignment of an unbound union value of type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ASP__SCTP__SetSocketOptions::operator==(const ASP__SCTP__SetSocketOptions& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_Sctp__init:
return *field_Sctp__init == *other_value.field_Sctp__init;
case ALT_Sctp__events:
return *field_Sctp__events == *other_value.field_Sctp__events;
case ALT_So__linger:
return *field_So__linger == *other_value.field_So__linger;
case ALT_Sctp__rtoinfo:
return *field_Sctp__rtoinfo == *other_value.field_Sctp__rtoinfo;
default:
return FALSE;
}
}

SCTP__INIT& ASP__SCTP__SetSocketOptions::Sctp__init()
{
if (union_selection != ALT_Sctp__init) {
clean_up();
field_Sctp__init = new SCTP__INIT;
union_selection = ALT_Sctp__init;
}
return *field_Sctp__init;
}

const SCTP__INIT& ASP__SCTP__SetSocketOptions::Sctp__init() const
{
if (union_selection != ALT_Sctp__init) TTCN_error("Using non-selected field Sctp_init in a value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *field_Sctp__init;
}

SCTP__EVENTS& ASP__SCTP__SetSocketOptions::Sctp__events()
{
if (union_selection != ALT_Sctp__events) {
clean_up();
field_Sctp__events = new SCTP__EVENTS;
union_selection = ALT_Sctp__events;
}
return *field_Sctp__events;
}

const SCTP__EVENTS& ASP__SCTP__SetSocketOptions::Sctp__events() const
{
if (union_selection != ALT_Sctp__events) TTCN_error("Using non-selected field Sctp_events in a value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *field_Sctp__events;
}

SO__LINGER& ASP__SCTP__SetSocketOptions::So__linger()
{
if (union_selection != ALT_So__linger) {
clean_up();
field_So__linger = new SO__LINGER;
union_selection = ALT_So__linger;
}
return *field_So__linger;
}

const SO__LINGER& ASP__SCTP__SetSocketOptions::So__linger() const
{
if (union_selection != ALT_So__linger) TTCN_error("Using non-selected field So_linger in a value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *field_So__linger;
}

SCTP__RTOINFO& ASP__SCTP__SetSocketOptions::Sctp__rtoinfo()
{
if (union_selection != ALT_Sctp__rtoinfo) {
clean_up();
field_Sctp__rtoinfo = new SCTP__RTOINFO;
union_selection = ALT_Sctp__rtoinfo;
}
return *field_Sctp__rtoinfo;
}

const SCTP__RTOINFO& ASP__SCTP__SetSocketOptions::Sctp__rtoinfo() const
{
if (union_selection != ALT_Sctp__rtoinfo) TTCN_error("Using non-selected field Sctp_rtoinfo in a value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *field_Sctp__rtoinfo;
}

boolean ASP__SCTP__SetSocketOptions::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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return union_selection == checked_selection;
}

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

boolean ASP__SCTP__SetSocketOptions::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_Sctp__init: return field_Sctp__init->is_value();
case ALT_Sctp__events: return field_Sctp__events->is_value();
case ALT_So__linger: return field_So__linger->is_value();
case ALT_Sctp__rtoinfo: return field_Sctp__rtoinfo->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ASP__SCTP__SetSocketOptions::clean_up()
{
switch (union_selection) {
case ALT_Sctp__init:
  delete field_Sctp__init;
  break;
case ALT_Sctp__events:
  delete field_Sctp__events;
  break;
case ALT_So__linger:
  delete field_So__linger;
  break;
case ALT_Sctp__rtoinfo:
  delete field_Sctp__rtoinfo;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ASP__SCTP__SetSocketOptions::log() const
{
switch (union_selection) {
case ALT_Sctp__init:
TTCN_Logger::log_event_str("{ Sctp_init := ");
field_Sctp__init->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_Sctp__events:
TTCN_Logger::log_event_str("{ Sctp_events := ");
field_Sctp__events->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_So__linger:
TTCN_Logger::log_event_str("{ So_linger := ");
field_So__linger->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_Sctp__rtoinfo:
TTCN_Logger::log_event_str("{ Sctp_rtoinfo := ");
field_Sctp__rtoinfo->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ASP__SCTP__SetSocketOptions::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, "Sctp_init")) {
    Sctp__init().set_param(*mp_last);
    if (!Sctp__init().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "Sctp_events")) {
    Sctp__events().set_param(*mp_last);
    if (!Sctp__events().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "So_linger")) {
    So__linger().set_param(*mp_last);
    if (!So__linger().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "Sctp_rtoinfo")) {
    Sctp__rtoinfo().set_param(*mp_last);
    if (!Sctp__rtoinfo().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.", last_name);
}

void ASP__SCTP__SetSocketOptions::set_implicit_omit()
{
switch (union_selection) {
case ALT_Sctp__init:
field_Sctp__init->set_implicit_omit(); break;
case ALT_Sctp__events:
field_Sctp__events->set_implicit_omit(); break;
case ALT_So__linger:
field_So__linger->set_implicit_omit(); break;
case ALT_Sctp__rtoinfo:
field_Sctp__rtoinfo->set_implicit_omit(); break;
default: break;
}
}

void ASP__SCTP__SetSocketOptions::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_Sctp__init:
field_Sctp__init->encode_text(text_buf);
break;
case ALT_Sctp__events:
field_Sctp__events->encode_text(text_buf);
break;
case ALT_So__linger:
field_So__linger->encode_text(text_buf);
break;
case ALT_Sctp__rtoinfo:
field_Sctp__rtoinfo->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}

void ASP__SCTP__SetSocketOptions::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_Sctp__init:
Sctp__init().decode_text(text_buf);
break;
case ALT_Sctp__events:
Sctp__events().decode_text(text_buf);
break;
case ALT_So__linger:
So__linger().decode_text(text_buf);
break;
case ALT_Sctp__rtoinfo:
Sctp__rtoinfo().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}

void ASP__SCTP__SetSocketOptions_template::copy_value(const ASP__SCTP__SetSocketOptions& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
single_value.field_Sctp__init = new SCTP__INIT_template(other_value.Sctp__init());
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
single_value.field_Sctp__events = new SCTP__EVENTS_template(other_value.Sctp__events());
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
single_value.field_So__linger = new SO__LINGER_template(other_value.So__linger());
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
single_value.field_Sctp__rtoinfo = new SCTP__RTOINFO_template(other_value.Sctp__rtoinfo());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__SetSocketOptions_template::copy_template(const ASP__SCTP__SetSocketOptions_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 ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
single_value.field_Sctp__init = new SCTP__INIT_template(*other_value.single_value.field_Sctp__init);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
single_value.field_Sctp__events = new SCTP__EVENTS_template(*other_value.single_value.field_Sctp__events);
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
single_value.field_So__linger = new SO__LINGER_template(*other_value.single_value.field_So__linger);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
single_value.field_Sctp__rtoinfo = new SCTP__RTOINFO_template(*other_value.single_value.field_Sctp__rtoinfo);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
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__SCTP__SetSocketOptions_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__SCTP__SetSocketOptions_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__SetSocketOptions_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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
set_selection(other_value);
}

ASP__SCTP__SetSocketOptions_template::ASP__SCTP__SetSocketOptions_template()
{
}

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

ASP__SCTP__SetSocketOptions_template::ASP__SCTP__SetSocketOptions_template(const ASP__SCTP__SetSocketOptions& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ASP__SCTP__SetSocketOptions_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
delete single_value.field_Sctp__init;
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
delete single_value.field_Sctp__events;
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
delete single_value.field_So__linger;
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
delete single_value.field_Sctp__rtoinfo;
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;
}

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

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

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

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

boolean ASP__SCTP__SetSocketOptions_template::match(const ASP__SCTP__SetSocketOptions& 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:
{
ASP__SCTP__SetSocketOptions::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ASP__SCTP__SetSocketOptions::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
return single_value.field_Sctp__init->match(other_value.Sctp__init(), legacy);
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
return single_value.field_Sctp__events->match(other_value.Sctp__events(), legacy);
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
return single_value.field_So__linger->match(other_value.So__linger(), legacy);
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
return single_value.field_Sctp__rtoinfo->match(other_value.Sctp__rtoinfo(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}
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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
return FALSE;
}

boolean ASP__SCTP__SetSocketOptions_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
return single_value.field_Sctp__init->is_value();
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
return single_value.field_Sctp__events->is_value();
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
return single_value.field_So__linger->is_value();
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
return single_value.field_Sctp__rtoinfo->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}

ASP__SCTP__SetSocketOptions ASP__SCTP__SetSocketOptions_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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
ASP__SCTP__SetSocketOptions ret_val;
switch (single_value.union_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
ret_val.Sctp__init() = single_value.field_Sctp__init->valueof();
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
ret_val.Sctp__events() = single_value.field_Sctp__events->valueof();
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
ret_val.So__linger() = single_value.field_So__linger->valueof();
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
ret_val.Sctp__rtoinfo() = single_value.field_Sctp__rtoinfo->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
return ret_val;
}

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

SCTP__INIT_template& ASP__SCTP__SetSocketOptions_template::Sctp__init()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__init) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_Sctp__init = new SCTP__INIT_template(ANY_VALUE);
else single_value.field_Sctp__init = new SCTP__INIT_template;
single_value.union_selection = ASP__SCTP__SetSocketOptions::ALT_Sctp__init;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_Sctp__init;
}

const SCTP__INIT_template& ASP__SCTP__SetSocketOptions_template::Sctp__init() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field Sctp_init in a non-specific template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__init) TTCN_error("Accessing non-selected field Sctp_init in a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *single_value.field_Sctp__init;
}

SCTP__EVENTS_template& ASP__SCTP__SetSocketOptions_template::Sctp__events()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__events) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_Sctp__events = new SCTP__EVENTS_template(ANY_VALUE);
else single_value.field_Sctp__events = new SCTP__EVENTS_template;
single_value.union_selection = ASP__SCTP__SetSocketOptions::ALT_Sctp__events;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_Sctp__events;
}

const SCTP__EVENTS_template& ASP__SCTP__SetSocketOptions_template::Sctp__events() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field Sctp_events in a non-specific template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__events) TTCN_error("Accessing non-selected field Sctp_events in a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *single_value.field_Sctp__events;
}

SO__LINGER_template& ASP__SCTP__SetSocketOptions_template::So__linger()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_So__linger) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_So__linger = new SO__LINGER_template(ANY_VALUE);
else single_value.field_So__linger = new SO__LINGER_template;
single_value.union_selection = ASP__SCTP__SetSocketOptions::ALT_So__linger;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_So__linger;
}

const SO__LINGER_template& ASP__SCTP__SetSocketOptions_template::So__linger() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field So_linger in a non-specific template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_So__linger) TTCN_error("Accessing non-selected field So_linger in a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *single_value.field_So__linger;
}

SCTP__RTOINFO_template& ASP__SCTP__SetSocketOptions_template::Sctp__rtoinfo()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_Sctp__rtoinfo = new SCTP__RTOINFO_template(ANY_VALUE);
else single_value.field_Sctp__rtoinfo = new SCTP__RTOINFO_template;
single_value.union_selection = ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_Sctp__rtoinfo;
}

const SCTP__RTOINFO_template& ASP__SCTP__SetSocketOptions_template::Sctp__rtoinfo() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field Sctp_rtoinfo in a non-specific template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
if (single_value.union_selection != ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo) TTCN_error("Accessing non-selected field Sctp_rtoinfo in a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
return *single_value.field_Sctp__rtoinfo;
}

boolean ASP__SCTP__SetSocketOptions_template::ischosen(ASP__SCTP__SetSocketOptions::union_selection_type checked_selection) const
{
if (checked_selection == ASP__SCTP__SetSocketOptions::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ASP__SCTP__SetSocketOptions::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions 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 ASP__SCTP__SetSocketOptions_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
TTCN_Logger::log_event_str("{ Sctp_init := ");
single_value.field_Sctp__init->log();
TTCN_Logger::log_event_str(" }");
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
TTCN_Logger::log_event_str("{ Sctp_events := ");
single_value.field_Sctp__events->log();
TTCN_Logger::log_event_str(" }");
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
TTCN_Logger::log_event_str("{ So_linger := ");
single_value.field_So__linger->log();
TTCN_Logger::log_event_str(" }");
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
TTCN_Logger::log_event_str("{ Sctp_rtoinfo := ");
single_value.field_Sctp__rtoinfo->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 ASP__SCTP__SetSocketOptions_template::log_match(const ASP__SCTP__SetSocketOptions& 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 ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".Sctp_init");
single_value.field_Sctp__init->log_match(match_value.Sctp__init(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ Sctp_init := ");
single_value.field_Sctp__init->log_match(match_value.Sctp__init(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".Sctp_events");
single_value.field_Sctp__events->log_match(match_value.Sctp__events(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ Sctp_events := ");
single_value.field_Sctp__events->log_match(match_value.Sctp__events(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".So_linger");
single_value.field_So__linger->log_match(match_value.So__linger(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ So_linger := ");
single_value.field_So__linger->log_match(match_value.So__linger(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".Sctp_rtoinfo");
single_value.field_Sctp__rtoinfo->log_match(match_value.Sctp__rtoinfo(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ Sctp_rtoinfo := ");
single_value.field_Sctp__rtoinfo->log_match(match_value.Sctp__rtoinfo(), 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 ASP__SCTP__SetSocketOptions_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 ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
single_value.field_Sctp__init->encode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
single_value.field_Sctp__events->encode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
single_value.field_So__linger->encode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
single_value.field_Sctp__rtoinfo->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}

void ASP__SCTP__SetSocketOptions_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ASP__SCTP__SetSocketOptions::UNBOUND_VALUE;
ASP__SCTP__SetSocketOptions::union_selection_type new_selection = (ASP__SCTP__SetSocketOptions::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
single_value.field_Sctp__init = new SCTP__INIT_template;
single_value.field_Sctp__init->decode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
single_value.field_Sctp__events = new SCTP__EVENTS_template;
single_value.field_Sctp__events->decode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
single_value.field_So__linger = new SO__LINGER_template;
single_value.field_So__linger->decode_text(text_buf);
break;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
single_value.field_Sctp__rtoinfo = new SCTP__RTOINFO_template;
single_value.field_Sctp__rtoinfo->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
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 ASP__SCTP__SetSocketOptions_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 @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
}

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

boolean ASP__SCTP__SetSocketOptions_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 ASP__SCTP__SetSocketOptions_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 `@SCTPasp_Types.ASP_SCTP_SetSocketOptions'");
    }
    if (strcmp("Sctp_init", param_field) == 0) {
      Sctp__init().set_param(param);
      return;
    } else if (strcmp("Sctp_events", param_field) == 0) {
      Sctp__events().set_param(param);
      return;
    } else if (strcmp("So_linger", param_field) == 0) {
      So__linger().set_param(param);
      return;
    } else if (strcmp("Sctp_rtoinfo", param_field) == 0) {
      Sctp__rtoinfo().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@SCTPasp_Types.ASP_SCTP_SetSocketOptions'", 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: {
    ASP__SCTP__SetSocketOptions_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", "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
    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, "Sctp_init")) {
      Sctp__init().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "Sctp_events")) {
      Sctp__events().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "So_linger")) {
      So__linger().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "Sctp_rtoinfo")) {
      Sctp__rtoinfo().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__SetSocketOptions_template* precondition = new ASP__SCTP__SetSocketOptions_template;
    precondition->set_param(*m_p->get_elem(0));
    ASP__SCTP__SetSocketOptions_template* implied_template = new ASP__SCTP__SetSocketOptions_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = ASP__SCTP__SetSocketOptions_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__SetSocketOptions_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 ASP__SCTP__SetSocketOptions::ALT_Sctp__init:
single_value.field_Sctp__init->check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
return;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__events:
single_value.field_Sctp__events->check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
return;
case ASP__SCTP__SetSocketOptions::ALT_So__linger:
single_value.field_So__linger->check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
return;
case ASP__SCTP__SetSocketOptions::ALT_Sctp__rtoinfo:
single_value.field_Sctp__rtoinfo->check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @SCTPasp_Types.ASP_SCTP_SetSocketOptions.");
}
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 : "@SCTPasp_Types.ASP_SCTP_SetSocketOptions");
}

ASP__SCTP__Close::ASP__SCTP__Close()
{
}

ASP__SCTP__Close::ASP__SCTP__Close(const OPTIONAL< INTEGER >& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__Close::ASP__SCTP__Close(const ASP__SCTP__Close& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_Close.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__Close::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__Close::get_descriptor() const { return &ASP__SCTP__Close_descr_; }
ASP__SCTP__Close& ASP__SCTP__Close::operator=(const ASP__SCTP__Close& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_Close.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__Close::operator==(const ASP__SCTP__Close& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__Close::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound());
}
boolean ASP__SCTP__Close::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value());
}
int ASP__SCTP__Close::size_of() const
{
  int ret_val = 0;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__Close::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__Close::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
}

void ASP__SCTP__Close::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 @SCTPasp_Types.ASP_SCTP_Close 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_Close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_Close");
  }
}

void ASP__SCTP__Close::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__Close::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__Close_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__Close_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_client__id = ANY_OR_OMIT;
}
}
}

void ASP__SCTP__Close_template::copy_value(const ASP__SCTP__Close& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__Close_template::copy_template(const ASP__SCTP__Close_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__Close_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__SCTP__Close_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__Close_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 @SCTPasp_Types.ASP_SCTP_Close.");
break;
}
set_selection(other_value);
}

ASP__SCTP__Close_template::ASP__SCTP__Close_template()
{
}

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

ASP__SCTP__Close_template::ASP__SCTP__Close_template(const ASP__SCTP__Close& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__Close_template::match(const ASP__SCTP__Close& 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.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.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 @SCTPasp_Types.ASP_SCTP_Close.");
}
return FALSE;
}

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

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

void ASP__SCTP__Close_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__SCTP__Close ASP__SCTP__Close_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 @SCTPasp_Types.ASP_SCTP_Close.");
ASP__SCTP__Close ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__Close_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 @SCTPasp_Types.ASP_SCTP_Close.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__Close_template[list_length];
}

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

INTEGER_template& ASP__SCTP__Close_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__Close_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Close.");
return single_value->field_client__id;
}

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

void ASP__SCTP__Close_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__Close_template::log_match(const ASP__SCTP__Close& 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.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.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("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.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 ASP__SCTP__Close_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_Close.");
}
}

void ASP__SCTP__Close_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_client__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__SCTP__Close_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 @SCTPasp_Types.ASP_SCTP_Close.");
}
}

void ASP__SCTP__Close_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__SCTP__Close_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 @SCTPasp_Types.ASP_SCTP_Close 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_Close: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__Close_template* precondition = new ASP__SCTP__Close_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__Close_template* implied_template = new ASP__SCTP__Close_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__Close_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_Close");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__Close_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Close");
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 : "@SCTPasp_Types.ASP_SCTP_Close");
}

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

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

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

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

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

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

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

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

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

boolean SAC__STATE::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 @SCTPasp_Types.SAC_STATE.");
return enum_value == other_value;
}

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

boolean SAC__STATE::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 @SCTPasp_Types.SAC_STATE.");
return enum_value < other_value;
}

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

boolean SAC__STATE::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 @SCTPasp_Types.SAC_STATE.");
return enum_value > other_value;
}

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

const char *SAC__STATE::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SCTP__COMM__UP: return "SCTP_COMM_UP";
case SCTP__COMM__LOST: return "SCTP_COMM_LOST";
case SCTP__RESTART: return "SCTP_RESTART";
case SCTP__SHUTDOWN__COMP: return "SCTP_SHUTDOWN_COMP";
case SCTP__CANT__STR__ASSOC: return "SCTP_CANT_STR_ASSOC";
case SCTP__UNKNOWN__SAC__STATE: return "SCTP_UNKNOWN_SAC_STATE";
default: return "<unknown>";
}
}

SAC__STATE::enum_type SAC__STATE::str_to_enum(const char *str_par)
{
if (!strcmp(str_par, "SCTP_COMM_UP")) return SCTP__COMM__UP;
else if (!strcmp(str_par, "SCTP_COMM_LOST")) return SCTP__COMM__LOST;
else if (!strcmp(str_par, "SCTP_RESTART")) return SCTP__RESTART;
else if (!strcmp(str_par, "SCTP_SHUTDOWN_COMP")) return SCTP__SHUTDOWN__COMP;
else if (!strcmp(str_par, "SCTP_CANT_STR_ASSOC")) return SCTP__CANT__STR__ASSOC;
else if (!strcmp(str_par, "SCTP_UNKNOWN_SAC_STATE")) return SCTP__UNKNOWN__SAC__STATE;
else return UNKNOWN_VALUE;
}

boolean SAC__STATE::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return TRUE;
default:
return FALSE;
}
}

int SAC__STATE::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 @SCTPasp_Types.SAC_STATE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int SAC__STATE::enum2int(const SAC__STATE& 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 @SCTPasp_Types.SAC_STATE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void SAC__STATE::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 SAC__STATE::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", "@SCTPasp_Types.SAC_STATE");
  enum_value = str_to_enum(param.get_enumerated());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @SCTPasp_Types.SAC_STATE.");
  }
}

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

void SAC__STATE::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 @SCTPasp_Types.SAC_STATE.", enum_value);
}

void SAC__STATE_template::copy_template(const SAC__STATE_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 SAC__STATE_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 SAC__STATE_template(*other_value.implication_.precondition);
implication_.implied_template = new SAC__STATE_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 @SCTPasp_Types.SAC_STATE.");
}
}

SAC__STATE_template::SAC__STATE_template()
{
}

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

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

SAC__STATE_template::SAC__STATE_template(SAC__STATE::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

SAC__STATE_template& SAC__STATE_template::operator=(const OPTIONAL<SAC__STATE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (SAC__STATE::enum_type)(const SAC__STATE&)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 @SCTPasp_Types.SAC_STATE.");
}
return *this;
}

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

boolean SAC__STATE_template::match(SAC__STATE::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 @SCTPasp_Types.SAC_STATE.");
}
return FALSE;
}

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

SAC__STATE::enum_type SAC__STATE_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 @SCTPasp_Types.SAC_STATE.");
return single_value;
}

void SAC__STATE_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 type for a template of enumerated type @SCTPasp_Types.SAC_STATE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SAC__STATE_template[list_length];
}

SAC__STATE_template& SAC__STATE_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 @SCTPasp_Types.SAC_STATE.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @SCTPasp_Types.SAC_STATE.");
return value_list.list_value[list_index];
}

void SAC__STATE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(SAC__STATE::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 SAC__STATE_template::log_match(const SAC__STATE& 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 SAC__STATE_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 @SCTPasp_Types.SAC_STATE.");
}
}

void SAC__STATE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (SAC__STATE::enum_type)text_buf.pull_int().get_val();
if (!SAC__STATE::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @SCTPasp_Types.SAC_STATE.", 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 SAC__STATE_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 @SCTPasp_Types.SAC_STATE.");
}
}

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

boolean SAC__STATE_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 SAC__STATE_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: {
    SAC__STATE_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: {
    SAC__STATE::enum_type enum_val = SAC__STATE::str_to_enum(m_p->get_enumerated());
    if (!SAC__STATE::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @SCTPasp_Types.SAC_STATE.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    SAC__STATE_template* precondition = new SAC__STATE_template;
    precondition->set_param(*m_p->get_elem(0));
    SAC__STATE_template* implied_template = new SAC__STATE_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = SAC__STATE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@SCTPasp_Types.SAC_STATE");
  }
  is_ifpresent = param.get_ifpresent();
}

void SAC__STATE_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 : "@SCTPasp_Types.SAC_STATE");
}

ASP__SCTP__ASSOC__CHANGE::ASP__SCTP__ASSOC__CHANGE()
{
}

ASP__SCTP__ASSOC__CHANGE::ASP__SCTP__ASSOC__CHANGE(const INTEGER& par_client__id,
    const SAC__STATE& par_sac__state)
  :   field_client__id(par_client__id),
  field_sac__state(par_sac__state)
{
}

ASP__SCTP__ASSOC__CHANGE::ASP__SCTP__ASSOC__CHANGE(const ASP__SCTP__ASSOC__CHANGE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.sac__state().is_bound()) field_sac__state = other_value.sac__state();
else field_sac__state.clean_up();
}

void ASP__SCTP__ASSOC__CHANGE::clean_up()
{
field_client__id.clean_up();
field_sac__state.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__ASSOC__CHANGE::get_descriptor() const { return &ASP__SCTP__ASSOC__CHANGE_descr_; }
ASP__SCTP__ASSOC__CHANGE& ASP__SCTP__ASSOC__CHANGE::operator=(const ASP__SCTP__ASSOC__CHANGE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.sac__state().is_bound()) field_sac__state = other_value.sac__state();
  else field_sac__state.clean_up();
}
return *this;
}

boolean ASP__SCTP__ASSOC__CHANGE::operator==(const ASP__SCTP__ASSOC__CHANGE& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_sac__state==other_value.field_sac__state;
}

boolean ASP__SCTP__ASSOC__CHANGE::is_bound() const
{
return (field_client__id.is_bound())
  || (field_sac__state.is_bound());
}
boolean ASP__SCTP__ASSOC__CHANGE::is_value() const
{
return field_client__id.is_value()
  && field_sac__state.is_value();
}
void ASP__SCTP__ASSOC__CHANGE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", sac_state := ");
field_sac__state.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__ASSOC__CHANGE::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
if (sac__state().is_bound()) sac__state().set_implicit_omit();
}

void ASP__SCTP__ASSOC__CHANGE::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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sac__state().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sac_state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sac__state().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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE");
  }
}

void ASP__SCTP__ASSOC__CHANGE::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_sac__state.encode_text(text_buf);
}

void ASP__SCTP__ASSOC__CHANGE::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_sac__state.decode_text(text_buf);
}

struct ASP__SCTP__ASSOC__CHANGE_template::single_value_struct {
INTEGER_template field_client__id;
SAC__STATE_template field_sac__state;
};

void ASP__SCTP__ASSOC__CHANGE_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_client__id = ANY_VALUE;
single_value->field_sac__state = ANY_VALUE;
}
}
}

void ASP__SCTP__ASSOC__CHANGE_template::copy_value(const ASP__SCTP__ASSOC__CHANGE& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.sac__state().is_bound()) {
  single_value->field_sac__state = other_value.sac__state();
} else {
  single_value->field_sac__state.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__ASSOC__CHANGE_template::copy_template(const ASP__SCTP__ASSOC__CHANGE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sac__state().get_selection()) {
single_value->field_sac__state = other_value.sac__state();
} else {
single_value->field_sac__state.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__SCTP__ASSOC__CHANGE_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__SCTP__ASSOC__CHANGE_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__ASSOC__CHANGE_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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
break;
}
set_selection(other_value);
}

ASP__SCTP__ASSOC__CHANGE_template::ASP__SCTP__ASSOC__CHANGE_template()
{
}

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

ASP__SCTP__ASSOC__CHANGE_template::ASP__SCTP__ASSOC__CHANGE_template(const ASP__SCTP__ASSOC__CHANGE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__ASSOC__CHANGE_template::match(const ASP__SCTP__ASSOC__CHANGE& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
if(!other_value.sac__state().is_bound()) return FALSE;
if(!single_value->field_sac__state.match(other_value.sac__state(), 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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
}
return FALSE;
}

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

boolean ASP__SCTP__ASSOC__CHANGE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_client__id.is_value()
 && single_value->field_sac__state.is_value();
}

void ASP__SCTP__ASSOC__CHANGE_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__SCTP__ASSOC__CHANGE ASP__SCTP__ASSOC__CHANGE_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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
ASP__SCTP__ASSOC__CHANGE ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_sac__state.is_bound()) {
ret_val.sac__state() = single_value->field_sac__state.valueof();
}
return ret_val;
}

void ASP__SCTP__ASSOC__CHANGE_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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__ASSOC__CHANGE_template[list_length];
}

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

INTEGER_template& ASP__SCTP__ASSOC__CHANGE_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__ASSOC__CHANGE_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
return single_value->field_client__id;
}

SAC__STATE_template& ASP__SCTP__ASSOC__CHANGE_template::sac__state()
{
set_specific();
return single_value->field_sac__state;
}

const SAC__STATE_template& ASP__SCTP__ASSOC__CHANGE_template::sac__state() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sac_state of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
return single_value->field_sac__state;
}

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

void ASP__SCTP__ASSOC__CHANGE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", sac_state := ");
single_value->field_sac__state.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__SCTP__ASSOC__CHANGE_template::log_match(const ASP__SCTP__ASSOC__CHANGE& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sac__state.match(match_value.sac__state(), legacy)){
TTCN_Logger::log_logmatch_info(".sac_state");
single_value->field_sac__state.log_match(match_value.sac__state(), 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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(", sac_state := ");
single_value->field_sac__state.log_match(match_value.sac__state(), 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__SCTP__ASSOC__CHANGE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_sac__state.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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
}
}

void ASP__SCTP__ASSOC__CHANGE_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_client__id.decode_text(text_buf);
single_value->field_sac__state.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__SCTP__ASSOC__CHANGE_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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE.");
}
}

void ASP__SCTP__ASSOC__CHANGE_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__SCTP__ASSOC__CHANGE_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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sac__state().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sac_state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sac__state().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 @SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__ASSOC__CHANGE_template* precondition = new ASP__SCTP__ASSOC__CHANGE_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__ASSOC__CHANGE_template* implied_template = new ASP__SCTP__ASSOC__CHANGE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__ASSOC__CHANGE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__ASSOC__CHANGE_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE");
single_value->field_sac__state.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE");
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 : "@SCTPasp_Types.ASP_SCTP_ASSOC_CHANGE");
}

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

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

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

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

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

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

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

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

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

boolean SPC__STATE::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 @SCTPasp_Types.SPC_STATE.");
return enum_value == other_value;
}

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

boolean SPC__STATE::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 @SCTPasp_Types.SPC_STATE.");
return enum_value < other_value;
}

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

boolean SPC__STATE::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 @SCTPasp_Types.SPC_STATE.");
return enum_value > other_value;
}

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

const char *SPC__STATE::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SCTP__ADDR__AVAILABLE: return "SCTP_ADDR_AVAILABLE";
case SCTP__ADDR__UNREACHABLE: return "SCTP_ADDR_UNREACHABLE";
case SCTP__ADDR__REMOVED: return "SCTP_ADDR_REMOVED";
case SCTP__ADDR__ADDED: return "SCTP_ADDR_ADDED";
case SCTP__ADDR__MADE__PRIM: return "SCTP_ADDR_MADE_PRIM";
case SCTP__ADDR__CONFIRMED: return "SCTP_ADDR_CONFIRMED";
case SCTP__UNKNOWN__SPC__STATE: return "SCTP_UNKNOWN_SPC_STATE";
default: return "<unknown>";
}
}

SPC__STATE::enum_type SPC__STATE::str_to_enum(const char *str_par)
{
if (!strcmp(str_par, "SCTP_ADDR_AVAILABLE")) return SCTP__ADDR__AVAILABLE;
else if (!strcmp(str_par, "SCTP_ADDR_UNREACHABLE")) return SCTP__ADDR__UNREACHABLE;
else if (!strcmp(str_par, "SCTP_ADDR_REMOVED")) return SCTP__ADDR__REMOVED;
else if (!strcmp(str_par, "SCTP_ADDR_ADDED")) return SCTP__ADDR__ADDED;
else if (!strcmp(str_par, "SCTP_ADDR_MADE_PRIM")) return SCTP__ADDR__MADE__PRIM;
else if (!strcmp(str_par, "SCTP_ADDR_CONFIRMED")) return SCTP__ADDR__CONFIRMED;
else if (!strcmp(str_par, "SCTP_UNKNOWN_SPC_STATE")) return SCTP__UNKNOWN__SPC__STATE;
else return UNKNOWN_VALUE;
}

boolean SPC__STATE::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return TRUE;
default:
return FALSE;
}
}

int SPC__STATE::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 @SCTPasp_Types.SPC_STATE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int SPC__STATE::enum2int(const SPC__STATE& 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 @SCTPasp_Types.SPC_STATE.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void SPC__STATE::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 SPC__STATE::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", "@SCTPasp_Types.SPC_STATE");
  enum_value = str_to_enum(param.get_enumerated());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @SCTPasp_Types.SPC_STATE.");
  }
}

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

void SPC__STATE::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 @SCTPasp_Types.SPC_STATE.", enum_value);
}

void SPC__STATE_template::copy_template(const SPC__STATE_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 SPC__STATE_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 SPC__STATE_template(*other_value.implication_.precondition);
implication_.implied_template = new SPC__STATE_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 @SCTPasp_Types.SPC_STATE.");
}
}

SPC__STATE_template::SPC__STATE_template()
{
}

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

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

SPC__STATE_template::SPC__STATE_template(SPC__STATE::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

SPC__STATE_template& SPC__STATE_template::operator=(const OPTIONAL<SPC__STATE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (SPC__STATE::enum_type)(const SPC__STATE&)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 @SCTPasp_Types.SPC_STATE.");
}
return *this;
}

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

boolean SPC__STATE_template::match(SPC__STATE::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 @SCTPasp_Types.SPC_STATE.");
}
return FALSE;
}

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

SPC__STATE::enum_type SPC__STATE_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 @SCTPasp_Types.SPC_STATE.");
return single_value;
}

void SPC__STATE_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 type for a template of enumerated type @SCTPasp_Types.SPC_STATE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SPC__STATE_template[list_length];
}

SPC__STATE_template& SPC__STATE_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 @SCTPasp_Types.SPC_STATE.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @SCTPasp_Types.SPC_STATE.");
return value_list.list_value[list_index];
}

void SPC__STATE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(SPC__STATE::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 SPC__STATE_template::log_match(const SPC__STATE& 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 SPC__STATE_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 @SCTPasp_Types.SPC_STATE.");
}
}

void SPC__STATE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (SPC__STATE::enum_type)text_buf.pull_int().get_val();
if (!SPC__STATE::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @SCTPasp_Types.SPC_STATE.", 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 SPC__STATE_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 @SCTPasp_Types.SPC_STATE.");
}
}

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

boolean SPC__STATE_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 SPC__STATE_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: {
    SPC__STATE_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: {
    SPC__STATE::enum_type enum_val = SPC__STATE::str_to_enum(m_p->get_enumerated());
    if (!SPC__STATE::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @SCTPasp_Types.SPC_STATE.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    SPC__STATE_template* precondition = new SPC__STATE_template;
    precondition->set_param(*m_p->get_elem(0));
    SPC__STATE_template* implied_template = new SPC__STATE_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = SPC__STATE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@SCTPasp_Types.SPC_STATE");
  }
  is_ifpresent = param.get_ifpresent();
}

void SPC__STATE_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 : "@SCTPasp_Types.SPC_STATE");
}

ASP__SCTP__PEER__ADDR__CHANGE::ASP__SCTP__PEER__ADDR__CHANGE()
{
}

ASP__SCTP__PEER__ADDR__CHANGE::ASP__SCTP__PEER__ADDR__CHANGE(const INTEGER& par_client__id,
    const SPC__STATE& par_spc__state)
  :   field_client__id(par_client__id),
  field_spc__state(par_spc__state)
{
}

ASP__SCTP__PEER__ADDR__CHANGE::ASP__SCTP__PEER__ADDR__CHANGE(const ASP__SCTP__PEER__ADDR__CHANGE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.spc__state().is_bound()) field_spc__state = other_value.spc__state();
else field_spc__state.clean_up();
}

void ASP__SCTP__PEER__ADDR__CHANGE::clean_up()
{
field_client__id.clean_up();
field_spc__state.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__PEER__ADDR__CHANGE::get_descriptor() const { return &ASP__SCTP__PEER__ADDR__CHANGE_descr_; }
ASP__SCTP__PEER__ADDR__CHANGE& ASP__SCTP__PEER__ADDR__CHANGE::operator=(const ASP__SCTP__PEER__ADDR__CHANGE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.spc__state().is_bound()) field_spc__state = other_value.spc__state();
  else field_spc__state.clean_up();
}
return *this;
}

boolean ASP__SCTP__PEER__ADDR__CHANGE::operator==(const ASP__SCTP__PEER__ADDR__CHANGE& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_spc__state==other_value.field_spc__state;
}

boolean ASP__SCTP__PEER__ADDR__CHANGE::is_bound() const
{
return (field_client__id.is_bound())
  || (field_spc__state.is_bound());
}
boolean ASP__SCTP__PEER__ADDR__CHANGE::is_value() const
{
return field_client__id.is_value()
  && field_spc__state.is_value();
}
void ASP__SCTP__PEER__ADDR__CHANGE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", spc_state := ");
field_spc__state.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__PEER__ADDR__CHANGE::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
if (spc__state().is_bound()) spc__state().set_implicit_omit();
}

void ASP__SCTP__PEER__ADDR__CHANGE::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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spc__state().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "spc_state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spc__state().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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE");
  }
}

void ASP__SCTP__PEER__ADDR__CHANGE::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_spc__state.encode_text(text_buf);
}

void ASP__SCTP__PEER__ADDR__CHANGE::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_spc__state.decode_text(text_buf);
}

struct ASP__SCTP__PEER__ADDR__CHANGE_template::single_value_struct {
INTEGER_template field_client__id;
SPC__STATE_template field_spc__state;
};

void ASP__SCTP__PEER__ADDR__CHANGE_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_client__id = ANY_VALUE;
single_value->field_spc__state = ANY_VALUE;
}
}
}

void ASP__SCTP__PEER__ADDR__CHANGE_template::copy_value(const ASP__SCTP__PEER__ADDR__CHANGE& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.spc__state().is_bound()) {
  single_value->field_spc__state = other_value.spc__state();
} else {
  single_value->field_spc__state.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__PEER__ADDR__CHANGE_template::copy_template(const ASP__SCTP__PEER__ADDR__CHANGE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spc__state().get_selection()) {
single_value->field_spc__state = other_value.spc__state();
} else {
single_value->field_spc__state.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__SCTP__PEER__ADDR__CHANGE_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__SCTP__PEER__ADDR__CHANGE_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__PEER__ADDR__CHANGE_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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
break;
}
set_selection(other_value);
}

ASP__SCTP__PEER__ADDR__CHANGE_template::ASP__SCTP__PEER__ADDR__CHANGE_template()
{
}

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

ASP__SCTP__PEER__ADDR__CHANGE_template::ASP__SCTP__PEER__ADDR__CHANGE_template(const ASP__SCTP__PEER__ADDR__CHANGE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__PEER__ADDR__CHANGE_template::match(const ASP__SCTP__PEER__ADDR__CHANGE& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
if(!other_value.spc__state().is_bound()) return FALSE;
if(!single_value->field_spc__state.match(other_value.spc__state(), 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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
}
return FALSE;
}

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

boolean ASP__SCTP__PEER__ADDR__CHANGE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_client__id.is_value()
 && single_value->field_spc__state.is_value();
}

void ASP__SCTP__PEER__ADDR__CHANGE_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__SCTP__PEER__ADDR__CHANGE ASP__SCTP__PEER__ADDR__CHANGE_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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
ASP__SCTP__PEER__ADDR__CHANGE ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_spc__state.is_bound()) {
ret_val.spc__state() = single_value->field_spc__state.valueof();
}
return ret_val;
}

void ASP__SCTP__PEER__ADDR__CHANGE_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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__PEER__ADDR__CHANGE_template[list_length];
}

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

INTEGER_template& ASP__SCTP__PEER__ADDR__CHANGE_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__PEER__ADDR__CHANGE_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
return single_value->field_client__id;
}

SPC__STATE_template& ASP__SCTP__PEER__ADDR__CHANGE_template::spc__state()
{
set_specific();
return single_value->field_spc__state;
}

const SPC__STATE_template& ASP__SCTP__PEER__ADDR__CHANGE_template::spc__state() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spc_state of a non-specific template of type @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
return single_value->field_spc__state;
}

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

void ASP__SCTP__PEER__ADDR__CHANGE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", spc_state := ");
single_value->field_spc__state.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__SCTP__PEER__ADDR__CHANGE_template::log_match(const ASP__SCTP__PEER__ADDR__CHANGE& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spc__state.match(match_value.spc__state(), legacy)){
TTCN_Logger::log_logmatch_info(".spc_state");
single_value->field_spc__state.log_match(match_value.spc__state(), 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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(", spc_state := ");
single_value->field_spc__state.log_match(match_value.spc__state(), 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__SCTP__PEER__ADDR__CHANGE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_spc__state.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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
}
}

void ASP__SCTP__PEER__ADDR__CHANGE_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_client__id.decode_text(text_buf);
single_value->field_spc__state.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__SCTP__PEER__ADDR__CHANGE_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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE.");
}
}

void ASP__SCTP__PEER__ADDR__CHANGE_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__SCTP__PEER__ADDR__CHANGE_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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spc__state().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "spc_state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spc__state().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 @SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__PEER__ADDR__CHANGE_template* precondition = new ASP__SCTP__PEER__ADDR__CHANGE_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__PEER__ADDR__CHANGE_template* implied_template = new ASP__SCTP__PEER__ADDR__CHANGE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__PEER__ADDR__CHANGE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__PEER__ADDR__CHANGE_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE");
single_value->field_spc__state.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE");
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 : "@SCTPasp_Types.ASP_SCTP_PEER_ADDR_CHANGE");
}

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

boolean ASP__SCTP__PEER__ADDR__CHANGE_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__SCTP__SEND__FAILED::ASP__SCTP__SEND__FAILED()
{
}

ASP__SCTP__SEND__FAILED::ASP__SCTP__SEND__FAILED(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__SEND__FAILED::ASP__SCTP__SEND__FAILED(const ASP__SCTP__SEND__FAILED& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__SEND__FAILED::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__SEND__FAILED::get_descriptor() const { return &ASP__SCTP__SEND__FAILED_descr_; }
ASP__SCTP__SEND__FAILED& ASP__SCTP__SEND__FAILED::operator=(const ASP__SCTP__SEND__FAILED& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__SEND__FAILED::operator==(const ASP__SCTP__SEND__FAILED& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__SEND__FAILED::is_bound() const
{
return (field_client__id.is_bound());
}
boolean ASP__SCTP__SEND__FAILED::is_value() const
{
return field_client__id.is_value();
}
void ASP__SCTP__SEND__FAILED::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__SEND__FAILED::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void ASP__SCTP__SEND__FAILED::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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_SEND_FAILED");
  }
}

void ASP__SCTP__SEND__FAILED::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__SEND__FAILED::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__SEND__FAILED_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__SEND__FAILED_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_client__id = ANY_VALUE;
}
}
}

void ASP__SCTP__SEND__FAILED_template::copy_value(const ASP__SCTP__SEND__FAILED& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__SEND__FAILED_template::copy_template(const ASP__SCTP__SEND__FAILED_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__SEND__FAILED_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__SCTP__SEND__FAILED_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__SEND__FAILED_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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
break;
}
set_selection(other_value);
}

ASP__SCTP__SEND__FAILED_template::ASP__SCTP__SEND__FAILED_template()
{
}

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

ASP__SCTP__SEND__FAILED_template::ASP__SCTP__SEND__FAILED_template(const ASP__SCTP__SEND__FAILED& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__SEND__FAILED_template::match(const ASP__SCTP__SEND__FAILED& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
}
return FALSE;
}

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

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

void ASP__SCTP__SEND__FAILED_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__SCTP__SEND__FAILED ASP__SCTP__SEND__FAILED_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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
ASP__SCTP__SEND__FAILED ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__SEND__FAILED_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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__SEND__FAILED_template[list_length];
}

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

INTEGER_template& ASP__SCTP__SEND__FAILED_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__SEND__FAILED_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
return single_value->field_client__id;
}

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

void ASP__SCTP__SEND__FAILED_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__SEND__FAILED_template::log_match(const ASP__SCTP__SEND__FAILED& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__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__SCTP__SEND__FAILED_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
}
}

void ASP__SCTP__SEND__FAILED_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_client__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__SCTP__SEND__FAILED_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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED.");
}
}

void ASP__SCTP__SEND__FAILED_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__SCTP__SEND__FAILED_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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_SEND_FAILED: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__SEND__FAILED_template* precondition = new ASP__SCTP__SEND__FAILED_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__SEND__FAILED_template* implied_template = new ASP__SCTP__SEND__FAILED_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__SEND__FAILED_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_SEND_FAILED");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__SEND__FAILED_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SEND_FAILED");
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 : "@SCTPasp_Types.ASP_SCTP_SEND_FAILED");
}

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

boolean ASP__SCTP__SEND__FAILED_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__SCTP__REMOTE__ERROR::ASP__SCTP__REMOTE__ERROR()
{
}

ASP__SCTP__REMOTE__ERROR::ASP__SCTP__REMOTE__ERROR(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__REMOTE__ERROR::ASP__SCTP__REMOTE__ERROR(const ASP__SCTP__REMOTE__ERROR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__REMOTE__ERROR::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__REMOTE__ERROR::get_descriptor() const { return &ASP__SCTP__REMOTE__ERROR_descr_; }
ASP__SCTP__REMOTE__ERROR& ASP__SCTP__REMOTE__ERROR::operator=(const ASP__SCTP__REMOTE__ERROR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__REMOTE__ERROR::operator==(const ASP__SCTP__REMOTE__ERROR& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__REMOTE__ERROR::is_bound() const
{
return (field_client__id.is_bound());
}
boolean ASP__SCTP__REMOTE__ERROR::is_value() const
{
return field_client__id.is_value();
}
void ASP__SCTP__REMOTE__ERROR::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__REMOTE__ERROR::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void ASP__SCTP__REMOTE__ERROR::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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR");
  }
}

void ASP__SCTP__REMOTE__ERROR::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__REMOTE__ERROR::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__REMOTE__ERROR_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__REMOTE__ERROR_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_client__id = ANY_VALUE;
}
}
}

void ASP__SCTP__REMOTE__ERROR_template::copy_value(const ASP__SCTP__REMOTE__ERROR& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__REMOTE__ERROR_template::copy_template(const ASP__SCTP__REMOTE__ERROR_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__REMOTE__ERROR_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__SCTP__REMOTE__ERROR_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__REMOTE__ERROR_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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
break;
}
set_selection(other_value);
}

ASP__SCTP__REMOTE__ERROR_template::ASP__SCTP__REMOTE__ERROR_template()
{
}

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

ASP__SCTP__REMOTE__ERROR_template::ASP__SCTP__REMOTE__ERROR_template(const ASP__SCTP__REMOTE__ERROR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__REMOTE__ERROR_template::match(const ASP__SCTP__REMOTE__ERROR& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
}
return FALSE;
}

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

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

void ASP__SCTP__REMOTE__ERROR_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__SCTP__REMOTE__ERROR ASP__SCTP__REMOTE__ERROR_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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
ASP__SCTP__REMOTE__ERROR ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__REMOTE__ERROR_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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__REMOTE__ERROR_template[list_length];
}

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

INTEGER_template& ASP__SCTP__REMOTE__ERROR_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__REMOTE__ERROR_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
return single_value->field_client__id;
}

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

void ASP__SCTP__REMOTE__ERROR_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__REMOTE__ERROR_template::log_match(const ASP__SCTP__REMOTE__ERROR& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__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__SCTP__REMOTE__ERROR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
}
}

void ASP__SCTP__REMOTE__ERROR_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_client__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__SCTP__REMOTE__ERROR_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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR.");
}
}

void ASP__SCTP__REMOTE__ERROR_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__SCTP__REMOTE__ERROR_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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_REMOTE_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__REMOTE__ERROR_template* precondition = new ASP__SCTP__REMOTE__ERROR_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__REMOTE__ERROR_template* implied_template = new ASP__SCTP__REMOTE__ERROR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__REMOTE__ERROR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__REMOTE__ERROR_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR");
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 : "@SCTPasp_Types.ASP_SCTP_REMOTE_ERROR");
}

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

boolean ASP__SCTP__REMOTE__ERROR_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__SCTP__SHUTDOWN__EVENT::ASP__SCTP__SHUTDOWN__EVENT()
{
}

ASP__SCTP__SHUTDOWN__EVENT::ASP__SCTP__SHUTDOWN__EVENT(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__SHUTDOWN__EVENT::ASP__SCTP__SHUTDOWN__EVENT(const ASP__SCTP__SHUTDOWN__EVENT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__SHUTDOWN__EVENT::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__SHUTDOWN__EVENT::get_descriptor() const { return &ASP__SCTP__SHUTDOWN__EVENT_descr_; }
ASP__SCTP__SHUTDOWN__EVENT& ASP__SCTP__SHUTDOWN__EVENT::operator=(const ASP__SCTP__SHUTDOWN__EVENT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__SHUTDOWN__EVENT::operator==(const ASP__SCTP__SHUTDOWN__EVENT& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__SHUTDOWN__EVENT::is_bound() const
{
return (field_client__id.is_bound());
}
boolean ASP__SCTP__SHUTDOWN__EVENT::is_value() const
{
return field_client__id.is_value();
}
void ASP__SCTP__SHUTDOWN__EVENT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__SHUTDOWN__EVENT::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void ASP__SCTP__SHUTDOWN__EVENT::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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT");
  }
}

void ASP__SCTP__SHUTDOWN__EVENT::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__SHUTDOWN__EVENT::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__SHUTDOWN__EVENT_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__SHUTDOWN__EVENT_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_client__id = ANY_VALUE;
}
}
}

void ASP__SCTP__SHUTDOWN__EVENT_template::copy_value(const ASP__SCTP__SHUTDOWN__EVENT& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__SHUTDOWN__EVENT_template::copy_template(const ASP__SCTP__SHUTDOWN__EVENT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__SHUTDOWN__EVENT_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__SCTP__SHUTDOWN__EVENT_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__SHUTDOWN__EVENT_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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
break;
}
set_selection(other_value);
}

ASP__SCTP__SHUTDOWN__EVENT_template::ASP__SCTP__SHUTDOWN__EVENT_template()
{
}

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

ASP__SCTP__SHUTDOWN__EVENT_template::ASP__SCTP__SHUTDOWN__EVENT_template(const ASP__SCTP__SHUTDOWN__EVENT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__SHUTDOWN__EVENT_template::match(const ASP__SCTP__SHUTDOWN__EVENT& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
}
return FALSE;
}

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

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

void ASP__SCTP__SHUTDOWN__EVENT_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__SCTP__SHUTDOWN__EVENT ASP__SCTP__SHUTDOWN__EVENT_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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
ASP__SCTP__SHUTDOWN__EVENT ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__SHUTDOWN__EVENT_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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__SHUTDOWN__EVENT_template[list_length];
}

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

INTEGER_template& ASP__SCTP__SHUTDOWN__EVENT_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__SHUTDOWN__EVENT_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
return single_value->field_client__id;
}

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

void ASP__SCTP__SHUTDOWN__EVENT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__SHUTDOWN__EVENT_template::log_match(const ASP__SCTP__SHUTDOWN__EVENT& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__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__SCTP__SHUTDOWN__EVENT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
}
}

void ASP__SCTP__SHUTDOWN__EVENT_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_client__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__SCTP__SHUTDOWN__EVENT_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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT.");
}
}

void ASP__SCTP__SHUTDOWN__EVENT_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__SCTP__SHUTDOWN__EVENT_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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__SHUTDOWN__EVENT_template* precondition = new ASP__SCTP__SHUTDOWN__EVENT_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__SHUTDOWN__EVENT_template* implied_template = new ASP__SCTP__SHUTDOWN__EVENT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__SHUTDOWN__EVENT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__SHUTDOWN__EVENT_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT");
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 : "@SCTPasp_Types.ASP_SCTP_SHUTDOWN_EVENT");
}

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

boolean ASP__SCTP__SHUTDOWN__EVENT_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__SCTP__PARTIAL__DELIVERY__EVENT::ASP__SCTP__PARTIAL__DELIVERY__EVENT()
{
}

ASP__SCTP__PARTIAL__DELIVERY__EVENT::ASP__SCTP__PARTIAL__DELIVERY__EVENT(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__PARTIAL__DELIVERY__EVENT::ASP__SCTP__PARTIAL__DELIVERY__EVENT(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__PARTIAL__DELIVERY__EVENT::get_descriptor() const { return &ASP__SCTP__PARTIAL__DELIVERY__EVENT_descr_; }
ASP__SCTP__PARTIAL__DELIVERY__EVENT& ASP__SCTP__PARTIAL__DELIVERY__EVENT::operator=(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__PARTIAL__DELIVERY__EVENT::operator==(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__PARTIAL__DELIVERY__EVENT::is_bound() const
{
return (field_client__id.is_bound());
}
boolean ASP__SCTP__PARTIAL__DELIVERY__EVENT::is_value() const
{
return field_client__id.is_value();
}
void ASP__SCTP__PARTIAL__DELIVERY__EVENT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT::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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT");
  }
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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_client__id = ANY_VALUE;
}
}
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::copy_value(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::copy_template(const ASP__SCTP__PARTIAL__DELIVERY__EVENT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__PARTIAL__DELIVERY__EVENT_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__SCTP__PARTIAL__DELIVERY__EVENT_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__PARTIAL__DELIVERY__EVENT_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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
break;
}
set_selection(other_value);
}

ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::ASP__SCTP__PARTIAL__DELIVERY__EVENT_template()
{
}

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

ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::ASP__SCTP__PARTIAL__DELIVERY__EVENT_template(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::match(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
}
return FALSE;
}

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

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

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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__SCTP__PARTIAL__DELIVERY__EVENT ASP__SCTP__PARTIAL__DELIVERY__EVENT_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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
ASP__SCTP__PARTIAL__DELIVERY__EVENT ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__PARTIAL__DELIVERY__EVENT_template[list_length];
}

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

INTEGER_template& ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
return single_value->field_client__id;
}

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

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__PARTIAL__DELIVERY__EVENT_template::log_match(const ASP__SCTP__PARTIAL__DELIVERY__EVENT& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__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__SCTP__PARTIAL__DELIVERY__EVENT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
}
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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_client__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__SCTP__PARTIAL__DELIVERY__EVENT_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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT.");
}
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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__SCTP__PARTIAL__DELIVERY__EVENT_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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__PARTIAL__DELIVERY__EVENT_template* precondition = new ASP__SCTP__PARTIAL__DELIVERY__EVENT_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__PARTIAL__DELIVERY__EVENT_template* implied_template = new ASP__SCTP__PARTIAL__DELIVERY__EVENT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__PARTIAL__DELIVERY__EVENT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__PARTIAL__DELIVERY__EVENT_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT");
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 : "@SCTPasp_Types.ASP_SCTP_PARTIAL_DELIVERY_EVENT");
}

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

boolean ASP__SCTP__PARTIAL__DELIVERY__EVENT_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__SCTP__ADAPTION__INDICATION::ASP__SCTP__ADAPTION__INDICATION()
{
}

ASP__SCTP__ADAPTION__INDICATION::ASP__SCTP__ADAPTION__INDICATION(const INTEGER& par_client__id)
  :   field_client__id(par_client__id)
{
}

ASP__SCTP__ADAPTION__INDICATION::ASP__SCTP__ADAPTION__INDICATION(const ASP__SCTP__ADAPTION__INDICATION& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
}

void ASP__SCTP__ADAPTION__INDICATION::clean_up()
{
field_client__id.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__ADAPTION__INDICATION::get_descriptor() const { return &ASP__SCTP__ADAPTION__INDICATION_descr_; }
ASP__SCTP__ADAPTION__INDICATION& ASP__SCTP__ADAPTION__INDICATION::operator=(const ASP__SCTP__ADAPTION__INDICATION& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
}
return *this;
}

boolean ASP__SCTP__ADAPTION__INDICATION::operator==(const ASP__SCTP__ADAPTION__INDICATION& other_value) const
{
return field_client__id==other_value.field_client__id;
}

boolean ASP__SCTP__ADAPTION__INDICATION::is_bound() const
{
return (field_client__id.is_bound());
}
boolean ASP__SCTP__ADAPTION__INDICATION::is_value() const
{
return field_client__id.is_value();
}
void ASP__SCTP__ADAPTION__INDICATION::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__ADAPTION__INDICATION::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
}

void ASP__SCTP__ADAPTION__INDICATION::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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION");
  }
}

void ASP__SCTP__ADAPTION__INDICATION::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
}

void ASP__SCTP__ADAPTION__INDICATION::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
}

struct ASP__SCTP__ADAPTION__INDICATION_template::single_value_struct {
INTEGER_template field_client__id;
};

void ASP__SCTP__ADAPTION__INDICATION_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_client__id = ANY_VALUE;
}
}
}

void ASP__SCTP__ADAPTION__INDICATION_template::copy_value(const ASP__SCTP__ADAPTION__INDICATION& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__ADAPTION__INDICATION_template::copy_template(const ASP__SCTP__ADAPTION__INDICATION_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__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__SCTP__ADAPTION__INDICATION_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__SCTP__ADAPTION__INDICATION_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__ADAPTION__INDICATION_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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
break;
}
set_selection(other_value);
}

ASP__SCTP__ADAPTION__INDICATION_template::ASP__SCTP__ADAPTION__INDICATION_template()
{
}

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

ASP__SCTP__ADAPTION__INDICATION_template::ASP__SCTP__ADAPTION__INDICATION_template(const ASP__SCTP__ADAPTION__INDICATION& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__ADAPTION__INDICATION_template::match(const ASP__SCTP__ADAPTION__INDICATION& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
}
return FALSE;
}

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

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

void ASP__SCTP__ADAPTION__INDICATION_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__SCTP__ADAPTION__INDICATION ASP__SCTP__ADAPTION__INDICATION_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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
ASP__SCTP__ADAPTION__INDICATION ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
return ret_val;
}

void ASP__SCTP__ADAPTION__INDICATION_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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__ADAPTION__INDICATION_template[list_length];
}

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

INTEGER_template& ASP__SCTP__ADAPTION__INDICATION_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__ADAPTION__INDICATION_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
return single_value->field_client__id;
}

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

void ASP__SCTP__ADAPTION__INDICATION_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__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__SCTP__ADAPTION__INDICATION_template::log_match(const ASP__SCTP__ADAPTION__INDICATION& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__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__SCTP__ADAPTION__INDICATION_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
}
}

void ASP__SCTP__ADAPTION__INDICATION_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_client__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__SCTP__ADAPTION__INDICATION_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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION.");
}
}

void ASP__SCTP__ADAPTION__INDICATION_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__SCTP__ADAPTION__INDICATION_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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION 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) client__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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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 @SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__ADAPTION__INDICATION_template* precondition = new ASP__SCTP__ADAPTION__INDICATION_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__ADAPTION__INDICATION_template* implied_template = new ASP__SCTP__ADAPTION__INDICATION_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__ADAPTION__INDICATION_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__ADAPTION__INDICATION_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION");
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 : "@SCTPasp_Types.ASP_SCTP_ADAPTION_INDICATION");
}

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

boolean ASP__SCTP__ADAPTION__INDICATION_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__SCTP__Connected::ASP__SCTP__Connected()
{
}

ASP__SCTP__Connected::ASP__SCTP__Connected(const INTEGER& par_client__id,
    const CHARSTRING& par_local__hostname,
    const INTEGER& par_local__portnumber,
    const CHARSTRING& par_peer__hostname,
    const INTEGER& par_peer__portnumber)
  :   field_client__id(par_client__id),
  field_local__hostname(par_local__hostname),
  field_local__portnumber(par_local__portnumber),
  field_peer__hostname(par_peer__hostname),
  field_peer__portnumber(par_peer__portnumber)
{
}

ASP__SCTP__Connected::ASP__SCTP__Connected(const ASP__SCTP__Connected& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_Connected.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
else field_local__hostname.clean_up();
if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
else field_local__portnumber.clean_up();
if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
else field_peer__hostname.clean_up();
if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
else field_peer__portnumber.clean_up();
}

void ASP__SCTP__Connected::clean_up()
{
field_client__id.clean_up();
field_local__hostname.clean_up();
field_local__portnumber.clean_up();
field_peer__hostname.clean_up();
field_peer__portnumber.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__Connected::get_descriptor() const { return &ASP__SCTP__Connected_descr_; }
ASP__SCTP__Connected& ASP__SCTP__Connected::operator=(const ASP__SCTP__Connected& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_Connected.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.local__hostname().is_bound()) field_local__hostname = other_value.local__hostname();
  else field_local__hostname.clean_up();
  if (other_value.local__portnumber().is_bound()) field_local__portnumber = other_value.local__portnumber();
  else field_local__portnumber.clean_up();
  if (other_value.peer__hostname().is_bound()) field_peer__hostname = other_value.peer__hostname();
  else field_peer__hostname.clean_up();
  if (other_value.peer__portnumber().is_bound()) field_peer__portnumber = other_value.peer__portnumber();
  else field_peer__portnumber.clean_up();
}
return *this;
}

boolean ASP__SCTP__Connected::operator==(const ASP__SCTP__Connected& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_local__hostname==other_value.field_local__hostname
  && field_local__portnumber==other_value.field_local__portnumber
  && field_peer__hostname==other_value.field_peer__hostname
  && field_peer__portnumber==other_value.field_peer__portnumber;
}

boolean ASP__SCTP__Connected::is_bound() const
{
return (field_client__id.is_bound())
  || (field_local__hostname.is_bound())
  || (field_local__portnumber.is_bound())
  || (field_peer__hostname.is_bound())
  || (field_peer__portnumber.is_bound());
}
boolean ASP__SCTP__Connected::is_value() const
{
return field_client__id.is_value()
  && field_local__hostname.is_value()
  && field_local__portnumber.is_value()
  && field_peer__hostname.is_value()
  && field_peer__portnumber.is_value();
}
void ASP__SCTP__Connected::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", local_hostname := ");
field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
field_local__portnumber.log();
TTCN_Logger::log_event_str(", peer_hostname := ");
field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
field_peer__portnumber.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__Connected::set_implicit_omit()
{
if (client__id().is_bound()) client__id().set_implicit_omit();
if (local__hostname().is_bound()) local__hostname().set_implicit_omit();
if (local__portnumber().is_bound()) local__portnumber().set_implicit_omit();
if (peer__hostname().is_bound()) peer__hostname().set_implicit_omit();
if (peer__portnumber().is_bound()) peer__portnumber().set_implicit_omit();
}

void ASP__SCTP__Connected::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 @SCTPasp_Types.ASP_SCTP_Connected 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__hostname().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peer__hostname().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_Connected: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_Connected");
  }
}

void ASP__SCTP__Connected::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_local__hostname.encode_text(text_buf);
field_local__portnumber.encode_text(text_buf);
field_peer__hostname.encode_text(text_buf);
field_peer__portnumber.encode_text(text_buf);
}

void ASP__SCTP__Connected::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_local__hostname.decode_text(text_buf);
field_local__portnumber.decode_text(text_buf);
field_peer__hostname.decode_text(text_buf);
field_peer__portnumber.decode_text(text_buf);
}

struct ASP__SCTP__Connected_template::single_value_struct {
INTEGER_template field_client__id;
CHARSTRING_template field_local__hostname;
INTEGER_template field_local__portnumber;
CHARSTRING_template field_peer__hostname;
INTEGER_template field_peer__portnumber;
};

void ASP__SCTP__Connected_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_client__id = ANY_VALUE;
single_value->field_local__hostname = ANY_VALUE;
single_value->field_local__portnumber = ANY_VALUE;
single_value->field_peer__hostname = ANY_VALUE;
single_value->field_peer__portnumber = ANY_VALUE;
}
}
}

void ASP__SCTP__Connected_template::copy_value(const ASP__SCTP__Connected& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  single_value->field_client__id = other_value.client__id();
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.local__hostname().is_bound()) {
  single_value->field_local__hostname = other_value.local__hostname();
} else {
  single_value->field_local__hostname.clean_up();
}
if (other_value.local__portnumber().is_bound()) {
  single_value->field_local__portnumber = other_value.local__portnumber();
} else {
  single_value->field_local__portnumber.clean_up();
}
if (other_value.peer__hostname().is_bound()) {
  single_value->field_peer__hostname = other_value.peer__hostname();
} else {
  single_value->field_peer__hostname.clean_up();
}
if (other_value.peer__portnumber().is_bound()) {
  single_value->field_peer__portnumber = other_value.peer__portnumber();
} else {
  single_value->field_peer__portnumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__Connected_template::copy_template(const ASP__SCTP__Connected_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__hostname().get_selection()) {
single_value->field_local__hostname = other_value.local__hostname();
} else {
single_value->field_local__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__portnumber().get_selection()) {
single_value->field_local__portnumber = other_value.local__portnumber();
} else {
single_value->field_local__portnumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peer__hostname().get_selection()) {
single_value->field_peer__hostname = other_value.peer__hostname();
} else {
single_value->field_peer__hostname.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.peer__portnumber().get_selection()) {
single_value->field_peer__portnumber = other_value.peer__portnumber();
} else {
single_value->field_peer__portnumber.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__SCTP__Connected_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__SCTP__Connected_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__Connected_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 @SCTPasp_Types.ASP_SCTP_Connected.");
break;
}
set_selection(other_value);
}

ASP__SCTP__Connected_template::ASP__SCTP__Connected_template()
{
}

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

ASP__SCTP__Connected_template::ASP__SCTP__Connected_template(const ASP__SCTP__Connected& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__Connected_template::match(const ASP__SCTP__Connected& 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.client__id().is_bound()) return FALSE;
if(!single_value->field_client__id.match(other_value.client__id(), legacy))return FALSE;
if(!other_value.local__hostname().is_bound()) return FALSE;
if(!single_value->field_local__hostname.match(other_value.local__hostname(), legacy))return FALSE;
if(!other_value.local__portnumber().is_bound()) return FALSE;
if(!single_value->field_local__portnumber.match(other_value.local__portnumber(), legacy))return FALSE;
if(!other_value.peer__hostname().is_bound()) return FALSE;
if(!single_value->field_peer__hostname.match(other_value.peer__hostname(), legacy))return FALSE;
if(!other_value.peer__portnumber().is_bound()) return FALSE;
if(!single_value->field_peer__portnumber.match(other_value.peer__portnumber(), 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 @SCTPasp_Types.ASP_SCTP_Connected.");
}
return FALSE;
}

boolean ASP__SCTP__Connected_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_client__id.is_bound()
 || single_value->field_local__hostname.is_bound()
 || single_value->field_local__portnumber.is_bound()
 || single_value->field_peer__hostname.is_bound()
 || single_value->field_peer__portnumber.is_bound();
}

boolean ASP__SCTP__Connected_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_client__id.is_value()
 && single_value->field_local__hostname.is_value()
 && single_value->field_local__portnumber.is_value()
 && single_value->field_peer__hostname.is_value()
 && single_value->field_peer__portnumber.is_value();
}

void ASP__SCTP__Connected_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__SCTP__Connected ASP__SCTP__Connected_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 @SCTPasp_Types.ASP_SCTP_Connected.");
ASP__SCTP__Connected ret_val;
if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_local__hostname.is_bound()) {
ret_val.local__hostname() = single_value->field_local__hostname.valueof();
}
if (single_value->field_local__portnumber.is_bound()) {
ret_val.local__portnumber() = single_value->field_local__portnumber.valueof();
}
if (single_value->field_peer__hostname.is_bound()) {
ret_val.peer__hostname() = single_value->field_peer__hostname.valueof();
}
if (single_value->field_peer__portnumber.is_bound()) {
ret_val.peer__portnumber() = single_value->field_peer__portnumber.valueof();
}
return ret_val;
}

void ASP__SCTP__Connected_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 @SCTPasp_Types.ASP_SCTP_Connected.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__Connected_template[list_length];
}

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

INTEGER_template& ASP__SCTP__Connected_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__Connected_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connected.");
return single_value->field_client__id;
}

CHARSTRING_template& ASP__SCTP__Connected_template::local__hostname()
{
set_specific();
return single_value->field_local__hostname;
}

const CHARSTRING_template& ASP__SCTP__Connected_template::local__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connected.");
return single_value->field_local__hostname;
}

INTEGER_template& ASP__SCTP__Connected_template::local__portnumber()
{
set_specific();
return single_value->field_local__portnumber;
}

const INTEGER_template& ASP__SCTP__Connected_template::local__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connected.");
return single_value->field_local__portnumber;
}

CHARSTRING_template& ASP__SCTP__Connected_template::peer__hostname()
{
set_specific();
return single_value->field_peer__hostname;
}

const CHARSTRING_template& ASP__SCTP__Connected_template::peer__hostname() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_hostname of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connected.");
return single_value->field_peer__hostname;
}

INTEGER_template& ASP__SCTP__Connected_template::peer__portnumber()
{
set_specific();
return single_value->field_peer__portnumber;
}

const INTEGER_template& ASP__SCTP__Connected_template::peer__portnumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field peer_portnumber of a non-specific template of type @SCTPasp_Types.ASP_SCTP_Connected.");
return single_value->field_peer__portnumber;
}

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

void ASP__SCTP__Connected_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", local_hostname := ");
single_value->field_local__hostname.log();
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.log();
TTCN_Logger::log_event_str(", peer_hostname := ");
single_value->field_peer__hostname.log();
TTCN_Logger::log_event_str(", peer_portnumber := ");
single_value->field_peer__portnumber.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__SCTP__Connected_template::log_match(const ASP__SCTP__Connected& 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_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__hostname.match(match_value.local__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".local_hostname");
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__portnumber.match(match_value.local__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".local_portnumber");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_peer__hostname.match(match_value.peer__hostname(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_hostname");
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_peer__portnumber.match(match_value.peer__portnumber(), legacy)){
TTCN_Logger::log_logmatch_info(".peer_portnumber");
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), 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("{ client_id := ");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::log_event_str(", local_hostname := ");
single_value->field_local__hostname.log_match(match_value.local__hostname(), legacy);
TTCN_Logger::log_event_str(", local_portnumber := ");
single_value->field_local__portnumber.log_match(match_value.local__portnumber(), legacy);
TTCN_Logger::log_event_str(", peer_hostname := ");
single_value->field_peer__hostname.log_match(match_value.peer__hostname(), legacy);
TTCN_Logger::log_event_str(", peer_portnumber := ");
single_value->field_peer__portnumber.log_match(match_value.peer__portnumber(), 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__SCTP__Connected_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_local__hostname.encode_text(text_buf);
single_value->field_local__portnumber.encode_text(text_buf);
single_value->field_peer__hostname.encode_text(text_buf);
single_value->field_peer__portnumber.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 @SCTPasp_Types.ASP_SCTP_Connected.");
}
}

void ASP__SCTP__Connected_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_client__id.decode_text(text_buf);
single_value->field_local__hostname.decode_text(text_buf);
single_value->field_local__portnumber.decode_text(text_buf);
single_value->field_peer__hostname.decode_text(text_buf);
single_value->field_peer__portnumber.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__SCTP__Connected_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 @SCTPasp_Types.ASP_SCTP_Connected.");
}
}

void ASP__SCTP__Connected_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__SCTP__Connected_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 @SCTPasp_Types.ASP_SCTP_Connected 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__hostname().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__portnumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peer__hostname().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) peer__portnumber().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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__hostname().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_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__portnumber().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(), "peer_hostname")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__hostname().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(), "peer_portnumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          peer__portnumber().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 @SCTPasp_Types.ASP_SCTP_Connected: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__Connected_template* precondition = new ASP__SCTP__Connected_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__Connected_template* implied_template = new ASP__SCTP__Connected_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__Connected_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_Connected");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__Connected_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connected");
single_value->field_local__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connected");
single_value->field_local__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connected");
single_value->field_peer__hostname.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connected");
single_value->field_peer__portnumber.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_Connected");
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 : "@SCTPasp_Types.ASP_SCTP_Connected");
}

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

boolean ASP__SCTP__Connected_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__SCTP__SENDMSG__ERROR::ASP__SCTP__SENDMSG__ERROR()
{
}

ASP__SCTP__SENDMSG__ERROR::ASP__SCTP__SENDMSG__ERROR(const OPTIONAL< INTEGER >& par_client__id,
    const INTEGER& par_sinfo__stream,
    const INTEGER& par_sinfo__ppid,
    const OCTETSTRING& par_data)
  :   field_client__id(par_client__id),
  field_sinfo__stream(par_sinfo__stream),
  field_sinfo__ppid(par_sinfo__ppid),
  field_data(par_data)
{
}

ASP__SCTP__SENDMSG__ERROR::ASP__SCTP__SENDMSG__ERROR(const ASP__SCTP__SENDMSG__ERROR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.sinfo__stream().is_bound()) field_sinfo__stream = other_value.sinfo__stream();
else field_sinfo__stream.clean_up();
if (other_value.sinfo__ppid().is_bound()) field_sinfo__ppid = other_value.sinfo__ppid();
else field_sinfo__ppid.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void ASP__SCTP__SENDMSG__ERROR::clean_up()
{
field_client__id.clean_up();
field_sinfo__stream.clean_up();
field_sinfo__ppid.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__SENDMSG__ERROR::get_descriptor() const { return &ASP__SCTP__SENDMSG__ERROR_descr_; }
ASP__SCTP__SENDMSG__ERROR& ASP__SCTP__SENDMSG__ERROR::operator=(const ASP__SCTP__SENDMSG__ERROR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.sinfo__stream().is_bound()) field_sinfo__stream = other_value.sinfo__stream();
  else field_sinfo__stream.clean_up();
  if (other_value.sinfo__ppid().is_bound()) field_sinfo__ppid = other_value.sinfo__ppid();
  else field_sinfo__ppid.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean ASP__SCTP__SENDMSG__ERROR::operator==(const ASP__SCTP__SENDMSG__ERROR& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_sinfo__stream==other_value.field_sinfo__stream
  && field_sinfo__ppid==other_value.field_sinfo__ppid
  && field_data==other_value.field_data;
}

boolean ASP__SCTP__SENDMSG__ERROR::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_sinfo__stream.is_bound())
  || (field_sinfo__ppid.is_bound())
  || (field_data.is_bound());
}
boolean ASP__SCTP__SENDMSG__ERROR::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_sinfo__stream.is_value()
  && field_sinfo__ppid.is_value()
  && field_data.is_value();
}
int ASP__SCTP__SENDMSG__ERROR::size_of() const
{
  int ret_val = 3;
  if (field_client__id.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__SENDMSG__ERROR::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", sinfo_stream := ");
field_sinfo__stream.log();
TTCN_Logger::log_event_str(", sinfo_ppid := ");
field_sinfo__ppid.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__SENDMSG__ERROR::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (sinfo__stream().is_bound()) sinfo__stream().set_implicit_omit();
if (sinfo__ppid().is_bound()) sinfo__ppid().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void ASP__SCTP__SENDMSG__ERROR::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 (4<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinfo__stream().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinfo__ppid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sinfo_stream")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__stream().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(), "sinfo_ppid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__ppid().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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
  }
}

void ASP__SCTP__SENDMSG__ERROR::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_sinfo__stream.encode_text(text_buf);
field_sinfo__ppid.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void ASP__SCTP__SENDMSG__ERROR::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_sinfo__stream.decode_text(text_buf);
field_sinfo__ppid.decode_text(text_buf);
field_data.decode_text(text_buf);
}

struct ASP__SCTP__SENDMSG__ERROR_template::single_value_struct {
INTEGER_template field_client__id;
INTEGER_template field_sinfo__stream;
INTEGER_template field_sinfo__ppid;
OCTETSTRING_template field_data;
};

void ASP__SCTP__SENDMSG__ERROR_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_client__id = ANY_OR_OMIT;
single_value->field_sinfo__stream = ANY_VALUE;
single_value->field_sinfo__ppid = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void ASP__SCTP__SENDMSG__ERROR_template::copy_value(const ASP__SCTP__SENDMSG__ERROR& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.sinfo__stream().is_bound()) {
  single_value->field_sinfo__stream = other_value.sinfo__stream();
} else {
  single_value->field_sinfo__stream.clean_up();
}
if (other_value.sinfo__ppid().is_bound()) {
  single_value->field_sinfo__ppid = other_value.sinfo__ppid();
} else {
  single_value->field_sinfo__ppid.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 ASP__SCTP__SENDMSG__ERROR_template::copy_template(const ASP__SCTP__SENDMSG__ERROR_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinfo__stream().get_selection()) {
single_value->field_sinfo__stream = other_value.sinfo__stream();
} else {
single_value->field_sinfo__stream.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sinfo__ppid().get_selection()) {
single_value->field_sinfo__ppid = other_value.sinfo__ppid();
} else {
single_value->field_sinfo__ppid.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 ASP__SCTP__SENDMSG__ERROR_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__SCTP__SENDMSG__ERROR_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__SENDMSG__ERROR_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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
break;
}
set_selection(other_value);
}

ASP__SCTP__SENDMSG__ERROR_template::ASP__SCTP__SENDMSG__ERROR_template()
{
}

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

ASP__SCTP__SENDMSG__ERROR_template::ASP__SCTP__SENDMSG__ERROR_template(const ASP__SCTP__SENDMSG__ERROR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__SCTP__SENDMSG__ERROR_template::match(const ASP__SCTP__SENDMSG__ERROR& 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.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.sinfo__stream().is_bound()) return FALSE;
if(!single_value->field_sinfo__stream.match(other_value.sinfo__stream(), legacy))return FALSE;
if(!other_value.sinfo__ppid().is_bound()) return FALSE;
if(!single_value->field_sinfo__ppid.match(other_value.sinfo__ppid(), 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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
}
return FALSE;
}

boolean ASP__SCTP__SENDMSG__ERROR_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_sinfo__stream.is_bound()
 || single_value->field_sinfo__ppid.is_bound()
 || single_value->field_data.is_bound();
}

boolean ASP__SCTP__SENDMSG__ERROR_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_sinfo__stream.is_value()
 && single_value->field_sinfo__ppid.is_value()
 && single_value->field_data.is_value();
}

void ASP__SCTP__SENDMSG__ERROR_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__SCTP__SENDMSG__ERROR ASP__SCTP__SENDMSG__ERROR_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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
ASP__SCTP__SENDMSG__ERROR ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_sinfo__stream.is_bound()) {
ret_val.sinfo__stream() = single_value->field_sinfo__stream.valueof();
}
if (single_value->field_sinfo__ppid.is_bound()) {
ret_val.sinfo__ppid() = single_value->field_sinfo__ppid.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void ASP__SCTP__SENDMSG__ERROR_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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__SENDMSG__ERROR_template[list_length];
}

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

INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
return single_value->field_client__id;
}

INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::sinfo__stream()
{
set_specific();
return single_value->field_sinfo__stream;
}

const INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::sinfo__stream() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinfo_stream of a non-specific template of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
return single_value->field_sinfo__stream;
}

INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::sinfo__ppid()
{
set_specific();
return single_value->field_sinfo__ppid;
}

const INTEGER_template& ASP__SCTP__SENDMSG__ERROR_template::sinfo__ppid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sinfo_ppid of a non-specific template of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
return single_value->field_sinfo__ppid;
}

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

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

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

void ASP__SCTP__SENDMSG__ERROR_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", sinfo_stream := ");
single_value->field_sinfo__stream.log();
TTCN_Logger::log_event_str(", sinfo_ppid := ");
single_value->field_sinfo__ppid.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 ASP__SCTP__SENDMSG__ERROR_template::log_match(const ASP__SCTP__SENDMSG__ERROR& 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.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_sinfo__stream.match(match_value.sinfo__stream(), legacy)){
TTCN_Logger::log_logmatch_info(".sinfo_stream");
single_value->field_sinfo__stream.log_match(match_value.sinfo__stream(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sinfo__ppid.match(match_value.sinfo__ppid(), legacy)){
TTCN_Logger::log_logmatch_info(".sinfo_ppid");
single_value->field_sinfo__ppid.log_match(match_value.sinfo__ppid(), 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("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sinfo_stream := ");
single_value->field_sinfo__stream.log_match(match_value.sinfo__stream(), legacy);
TTCN_Logger::log_event_str(", sinfo_ppid := ");
single_value->field_sinfo__ppid.log_match(match_value.sinfo__ppid(), 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 ASP__SCTP__SENDMSG__ERROR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_sinfo__stream.encode_text(text_buf);
single_value->field_sinfo__ppid.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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
}
}

void ASP__SCTP__SENDMSG__ERROR_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_client__id.decode_text(text_buf);
single_value->field_sinfo__stream.decode_text(text_buf);
single_value->field_sinfo__ppid.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 ASP__SCTP__SENDMSG__ERROR_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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR.");
}
}

void ASP__SCTP__SENDMSG__ERROR_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__SCTP__SENDMSG__ERROR_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 (4<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR has 4 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) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sinfo__stream().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sinfo__ppid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(3));
    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(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "sinfo_stream")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__stream().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(), "sinfo_ppid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sinfo__ppid().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 @SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__SENDMSG__ERROR_template* precondition = new ASP__SCTP__SENDMSG__ERROR_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__SENDMSG__ERROR_template* implied_template = new ASP__SCTP__SENDMSG__ERROR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__SENDMSG__ERROR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__SENDMSG__ERROR_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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
single_value->field_sinfo__stream.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
single_value->field_sinfo__ppid.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
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 : "@SCTPasp_Types.ASP_SCTP_SENDMSG_ERROR");
}

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

boolean ASP__SCTP__SENDMSG__ERROR_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__SCTP__RESULT::ASP__SCTP__RESULT()
{
}

ASP__SCTP__RESULT::ASP__SCTP__RESULT(const OPTIONAL< INTEGER >& par_client__id,
    const BOOLEAN& par_error__status,
    const OPTIONAL< CHARSTRING >& par_error__message)
  :   field_client__id(par_client__id),
  field_error__status(par_error__status),
  field_error__message(par_error__message)
{
}

ASP__SCTP__RESULT::ASP__SCTP__RESULT(const ASP__SCTP__RESULT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCTPasp_Types.ASP_SCTP_RESULT.");
if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
else field_client__id.clean_up();
if (other_value.error__status().is_bound()) field_error__status = other_value.error__status();
else field_error__status.clean_up();
if (other_value.error__message().is_bound()) field_error__message = other_value.error__message();
else field_error__message.clean_up();
}

void ASP__SCTP__RESULT::clean_up()
{
field_client__id.clean_up();
field_error__status.clean_up();
field_error__message.clean_up();
}

const TTCN_Typedescriptor_t* ASP__SCTP__RESULT::get_descriptor() const { return &ASP__SCTP__RESULT_descr_; }
ASP__SCTP__RESULT& ASP__SCTP__RESULT::operator=(const ASP__SCTP__RESULT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCTPasp_Types.ASP_SCTP_RESULT.");
  if (other_value.client__id().is_bound()) field_client__id = other_value.client__id();
  else field_client__id.clean_up();
  if (other_value.error__status().is_bound()) field_error__status = other_value.error__status();
  else field_error__status.clean_up();
  if (other_value.error__message().is_bound()) field_error__message = other_value.error__message();
  else field_error__message.clean_up();
}
return *this;
}

boolean ASP__SCTP__RESULT::operator==(const ASP__SCTP__RESULT& other_value) const
{
return field_client__id==other_value.field_client__id
  && field_error__status==other_value.field_error__status
  && field_error__message==other_value.field_error__message;
}

boolean ASP__SCTP__RESULT::is_bound() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_bound())
  || (field_error__status.is_bound())
  || (OPTIONAL_OMIT == field_error__message.get_selection() || field_error__message.is_bound());
}
boolean ASP__SCTP__RESULT::is_value() const
{
return (OPTIONAL_OMIT == field_client__id.get_selection() || field_client__id.is_value())
  && field_error__status.is_value()
  && (OPTIONAL_OMIT == field_error__message.get_selection() || field_error__message.is_value());
}
int ASP__SCTP__RESULT::size_of() const
{
  int ret_val = 1;
  if (field_client__id.ispresent()) ret_val++;
  if (field_error__message.ispresent()) ret_val++;
  return ret_val;
}

void ASP__SCTP__RESULT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ client_id := ");
field_client__id.log();
TTCN_Logger::log_event_str(", error_status := ");
field_error__status.log();
TTCN_Logger::log_event_str(", error_message := ");
field_error__message.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__SCTP__RESULT::set_implicit_omit()
{
if (!client__id().is_bound()) client__id() = OMIT_VALUE;
else client__id().set_implicit_omit();
if (error__status().is_bound()) error__status().set_implicit_omit();
if (!error__message().is_bound()) error__message() = OMIT_VALUE;
else error__message().set_implicit_omit();
}

void ASP__SCTP__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 (3<param.get_size()) {
      param.error("record value of type @SCTPasp_Types.ASP_SCTP_RESULT has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) error__status().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) error__message().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "error_status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__status().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(), "error_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__message().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 @SCTPasp_Types.ASP_SCTP_RESULT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCTPasp_Types.ASP_SCTP_RESULT");
  }
}

void ASP__SCTP__RESULT::encode_text(Text_Buf& text_buf) const
{
field_client__id.encode_text(text_buf);
field_error__status.encode_text(text_buf);
field_error__message.encode_text(text_buf);
}

void ASP__SCTP__RESULT::decode_text(Text_Buf& text_buf)
{
field_client__id.decode_text(text_buf);
field_error__status.decode_text(text_buf);
field_error__message.decode_text(text_buf);
}

struct ASP__SCTP__RESULT_template::single_value_struct {
INTEGER_template field_client__id;
BOOLEAN_template field_error__status;
CHARSTRING_template field_error__message;
};

void ASP__SCTP__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_client__id = ANY_OR_OMIT;
single_value->field_error__status = ANY_VALUE;
single_value->field_error__message = ANY_OR_OMIT;
}
}
}

void ASP__SCTP__RESULT_template::copy_value(const ASP__SCTP__RESULT& other_value)
{
single_value = new single_value_struct;
if (other_value.client__id().is_bound()) {
  if (other_value.client__id().ispresent()) single_value->field_client__id = other_value.client__id()();
  else single_value->field_client__id = OMIT_VALUE;
} else {
  single_value->field_client__id.clean_up();
}
if (other_value.error__status().is_bound()) {
  single_value->field_error__status = other_value.error__status();
} else {
  single_value->field_error__status.clean_up();
}
if (other_value.error__message().is_bound()) {
  if (other_value.error__message().ispresent()) single_value->field_error__message = other_value.error__message()();
  else single_value->field_error__message = OMIT_VALUE;
} else {
  single_value->field_error__message.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__SCTP__RESULT_template::copy_template(const ASP__SCTP__RESULT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.client__id().get_selection()) {
single_value->field_client__id = other_value.client__id();
} else {
single_value->field_client__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.error__status().get_selection()) {
single_value->field_error__status = other_value.error__status();
} else {
single_value->field_error__status.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.error__message().get_selection()) {
single_value->field_error__message = other_value.error__message();
} else {
single_value->field_error__message.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__SCTP__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__SCTP__RESULT_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__SCTP__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 @SCTPasp_Types.ASP_SCTP_RESULT.");
break;
}
set_selection(other_value);
}

ASP__SCTP__RESULT_template::ASP__SCTP__RESULT_template()
{
}

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

ASP__SCTP__RESULT_template::ASP__SCTP__RESULT_template(const ASP__SCTP__RESULT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ASP__SCTP__RESULT_template& ASP__SCTP__RESULT_template::operator=(const OPTIONAL<ASP__SCTP__RESULT>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ASP__SCTP__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 @SCTPasp_Types.ASP_SCTP_RESULT.");
}
return *this;
}

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

boolean ASP__SCTP__RESULT_template::match(const ASP__SCTP__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.client__id().is_bound()) return FALSE;
if((other_value.client__id().ispresent() ? !single_value->field_client__id.match((const INTEGER&)other_value.client__id(), legacy) : !single_value->field_client__id.match_omit(legacy)))return FALSE;
if(!other_value.error__status().is_bound()) return FALSE;
if(!single_value->field_error__status.match(other_value.error__status(), legacy))return FALSE;
if(!other_value.error__message().is_bound()) return FALSE;
if((other_value.error__message().ispresent() ? !single_value->field_error__message.match((const CHARSTRING&)other_value.error__message(), legacy) : !single_value->field_error__message.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 @SCTPasp_Types.ASP_SCTP_RESULT.");
}
return FALSE;
}

boolean ASP__SCTP__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_client__id.is_omit() || single_value->field_client__id.is_bound())
 || single_value->field_error__status.is_bound()
 || (single_value->field_error__message.is_omit() || single_value->field_error__message.is_bound());
}

boolean ASP__SCTP__RESULT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_client__id.is_omit() || single_value->field_client__id.is_value())
 && single_value->field_error__status.is_value()
 && (single_value->field_error__message.is_omit() || single_value->field_error__message.is_value());
}

void ASP__SCTP__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__SCTP__RESULT ASP__SCTP__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 @SCTPasp_Types.ASP_SCTP_RESULT.");
ASP__SCTP__RESULT ret_val;
if (single_value->field_client__id.is_omit()) ret_val.client__id() = OMIT_VALUE;
else if (single_value->field_client__id.is_bound()) {
ret_val.client__id() = single_value->field_client__id.valueof();
}
if (single_value->field_error__status.is_bound()) {
ret_val.error__status() = single_value->field_error__status.valueof();
}
if (single_value->field_error__message.is_omit()) ret_val.error__message() = OMIT_VALUE;
else if (single_value->field_error__message.is_bound()) {
ret_val.error__message() = single_value->field_error__message.valueof();
}
return ret_val;
}

void ASP__SCTP__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 @SCTPasp_Types.ASP_SCTP_RESULT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__SCTP__RESULT_template[list_length];
}

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

INTEGER_template& ASP__SCTP__RESULT_template::client__id()
{
set_specific();
return single_value->field_client__id;
}

const INTEGER_template& ASP__SCTP__RESULT_template::client__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field client_id of a non-specific template of type @SCTPasp_Types.ASP_SCTP_RESULT.");
return single_value->field_client__id;
}

BOOLEAN_template& ASP__SCTP__RESULT_template::error__status()
{
set_specific();
return single_value->field_error__status;
}

const BOOLEAN_template& ASP__SCTP__RESULT_template::error__status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field error_status of a non-specific template of type @SCTPasp_Types.ASP_SCTP_RESULT.");
return single_value->field_error__status;
}

CHARSTRING_template& ASP__SCTP__RESULT_template::error__message()
{
set_specific();
return single_value->field_error__message;
}

const CHARSTRING_template& ASP__SCTP__RESULT_template::error__message() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field error_message of a non-specific template of type @SCTPasp_Types.ASP_SCTP_RESULT.");
return single_value->field_error__message;
}

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

void ASP__SCTP__RESULT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ client_id := ");
single_value->field_client__id.log();
TTCN_Logger::log_event_str(", error_status := ");
single_value->field_error__status.log();
TTCN_Logger::log_event_str(", error_message := ");
single_value->field_error__message.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__SCTP__RESULT_template::log_match(const ASP__SCTP__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 (match_value.client__id().ispresent()){
if(!single_value->field_client__id.match(match_value.client__id(), legacy)){
TTCN_Logger::log_logmatch_info(".client_id");
single_value->field_client__id.log_match(match_value.client__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_client__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".client_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_client__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_error__status.match(match_value.error__status(), legacy)){
TTCN_Logger::log_logmatch_info(".error_status");
single_value->field_error__status.log_match(match_value.error__status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.error__message().ispresent()){
if(!single_value->field_error__message.match(match_value.error__message(), legacy)){
TTCN_Logger::log_logmatch_info(".error_message");
single_value->field_error__message.log_match(match_value.error__message(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_error__message.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".error_message := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_error__message.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("{ client_id := ");
if (match_value.client__id().ispresent()) {
single_value->field_client__id.log_match(match_value.client__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_client__id.log();
if (single_value->field_client__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", error_status := ");
single_value->field_error__status.log_match(match_value.error__status(), legacy);
TTCN_Logger::log_event_str(", error_message := ");
if (match_value.error__message().ispresent()) {
single_value->field_error__message.log_match(match_value.error__message(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_error__message.log();
if (single_value->field_error__message.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 ASP__SCTP__RESULT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_client__id.encode_text(text_buf);
single_value->field_error__status.encode_text(text_buf);
single_value->field_error__message.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 @SCTPasp_Types.ASP_SCTP_RESULT.");
}
}

void ASP__SCTP__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_client__id.decode_text(text_buf);
single_value->field_error__status.decode_text(text_buf);
single_value->field_error__message.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__SCTP__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 @SCTPasp_Types.ASP_SCTP_RESULT.");
}
}

void ASP__SCTP__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__SCTP__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 (3<param.get_size()) {
      param.error("record template of type @SCTPasp_Types.ASP_SCTP_RESULT has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) client__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) error__status().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) error__message().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "client_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          client__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(), "error_status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__status().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(), "error_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__message().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 @SCTPasp_Types.ASP_SCTP_RESULT: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ASP__SCTP__RESULT_template* precondition = new ASP__SCTP__RESULT_template;
    precondition->set_param(*param.get_elem(0));
    ASP__SCTP__RESULT_template* implied_template = new ASP__SCTP__RESULT_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__SCTP__RESULT_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCTPasp_Types.ASP_SCTP_RESULT");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__SCTP__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_client__id.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_RESULT");
single_value->field_error__status.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_RESULT");
single_value->field_error__message.check_restriction(t_res, t_name ? t_name : "@SCTPasp_Types.ASP_SCTP_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 : "@SCTPasp_Types.ASP_SCTP_RESULT");
}

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

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


} /* end of namespace */
