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

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

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

/* Including header files */

#include "DIAMETER_Emulation.hh"

namespace DIAMETER__Emulation {

/* Literal string constants */

const unsigned char os_0_octets[] = { 0, 0, 0, 1 };
extern const OCTETSTRING os_0(4, os_0_octets);
extern const CHARSTRING cs_1('@'),
cs_0(4, "omit");
const unsigned char module_checksum[] = { 0xd6, 0xda, 0x73, 0xcd, 0xa3, 0xc9, 0x81, 0xa9, 0x29, 0xe7, 0xd2, 0xa2, 0x05, 0x7a, 0x5a, 0x04 };

/* Global variable definitions */

const XERdescriptor_t       IMSI_xer_ = { {"IMSI>\n", "IMSI>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t IMSI_descr_ = { "@DIAMETER_Emulation.IMSI", NULL, &HEXSTRING_raw_, NULL, &IMSI_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DiameterCapabilityExchgInd_rx_default_coding("RAW");
UNIVERSAL_CHARSTRING DiameterCapabilityExchgInd_tx_default_coding("RAW");
// No XER for DiameterCapabilityExchgInd
const TTCN_Typedescriptor_t DiameterCapabilityExchgInd_descr_ = { "@DIAMETER_Emulation.DiameterCapabilityExchgInd", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_Typedescriptor_t& DIAMETER__ConnHdlr_descr_ = COMPONENT_descr_;
DIAMETER__Conn__PT DIAMETER__ConnHdlr_component_DIAMETER("DIAMETER");
DIAMETEREM__PROC__PT DIAMETER__ConnHdlr_component_DIAMETER__PROC("DIAMETER_PROC");
// No XER for AssociationData
const TTCN_Typedescriptor_t AssociationData_descr_ = { "@DIAMETER_Emulation.AssociationData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       AssociationData_imsi_xer_ = { {"imsi>\n", "imsi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t AssociationData_imsi_descr_ = { "@DIAMETER_Emulation.AssociationData.imsi", NULL, &HEXSTRING_raw_, NULL, &AssociationData_imsi_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ETEIDData
const TTCN_Typedescriptor_t ETEIDData_descr_ = { "@DIAMETER_Emulation.ETEIDData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ETEIDData_ete__id_xer_ = { {"ete_id>\n", "ete_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ETEIDData_ete__id_oer_ext_arr_[0] = {};
const int ETEIDData_ete__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t ETEIDData_ete__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, ETEIDData_ete__id_oer_ext_arr_, 0, ETEIDData_ete__id_oer_p_};
const TTCN_Typedescriptor_t ETEIDData_ete__id_descr_ = { "@DIAMETER_Emulation.ETEIDData.ete_id", &OCTETSTRING_ber_, &DIAMETER__Types::UINT32_raw_, &OCTETSTRING_text_, &ETEIDData_ete__id_xer_, &OCTETSTRING_json_, &ETEIDData_ete__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ETEIDData_ete__id_default_coding("RAW");
const TTCN_Typedescriptor_t& DIAMETER__Emulation__CT_descr_ = COMPONENT_descr_;
DIAMETER__CodecPort::DIAMETER__CODEC__PT DIAMETER__Emulation__CT_component_DIAMETER("DIAMETER");
DIAMETER__Conn__PT DIAMETER__Emulation__CT_component_DIAMETER__CLIENT("DIAMETER_CLIENT");
VALUE_ARRAY<AssociationData, 256, 0> DIAMETER__Emulation__CT_component_DiameterAssocTable;
VALUE_ARRAY<ETEIDData, 256, 0> DIAMETER__Emulation__CT_component_DiameterETEIDTable;
// No XER for ExpectData
const TTCN_Typedescriptor_t ExpectData_descr_ = { "@DIAMETER_Emulation.ExpectData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ExpectData_imsi_xer_ = { {"imsi>\n", "imsi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ExpectData_imsi_descr_ = { "@DIAMETER_Emulation.ExpectData.imsi", NULL, &HEXSTRING_raw_, NULL, &ExpectData_imsi_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
VALUE_ARRAY<ExpectData, 256, 0> DIAMETER__Emulation__CT_component_DiameterExpectTable;
DIAMETEREM__PROC__PT DIAMETER__Emulation__CT_component_DIAMETER__PROC("DIAMETER_PROC");
DIAMETER__PT DIAMETER__Emulation__CT_component_DIAMETER__UNIT("DIAMETER_UNIT");
CHARSTRING DIAMETER__Emulation__CT_component_g__diameter__id;
INTEGER DIAMETER__Emulation__CT_component_g__diameter__conn__id;
// No XER for DIAMETERCreateCallback
const TTCN_Typedescriptor_t DIAMETERCreateCallback_descr_ = { "@DIAMETER_Emulation.DIAMETERCreateCallback", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for DIAMETERUnitdataCallback
const TTCN_Typedescriptor_t DIAMETERUnitdataCallback_descr_ = { "@DIAMETER_Emulation.DIAMETERUnitdataCallback", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETEROps_raw_xer_ = { {"raw>\n", "raw>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int DIAMETEROps_raw_oer_ext_arr_[0] = {};
const int DIAMETEROps_raw_oer_p_[0] = {};
const TTCN_OERdescriptor_t DIAMETEROps_raw_oer_ = { -1, TRUE, -1, FALSE, 0, 0, DIAMETEROps_raw_oer_ext_arr_, 0, DIAMETEROps_raw_oer_p_};
const TTCN_Typedescriptor_t DIAMETEROps_raw_descr_ = { "@DIAMETER_Emulation.DIAMETEROps.raw", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &DIAMETEROps_raw_xer_, &BOOLEAN_json_, &DIAMETEROps_raw_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for DIAMETEROps
const TTCN_Typedescriptor_t DIAMETEROps_descr_ = { "@DIAMETER_Emulation.DIAMETEROps", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_remote__ip_xer_ = { {"remote_ip>\n", "remote_ip>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_remote__ip_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.remote_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DIAMETER__conn__parameters_remote__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_remote__sctp__port_xer_ = { {"remote_sctp_port>\n", "remote_sctp_port>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DIAMETER__conn__parameters_remote__sctp__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_remote__sctp__port_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.remote_sctp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &DIAMETER__conn__parameters_remote__sctp__port_xer_, &INTEGER_json_, &DIAMETER__conn__parameters_remote__sctp__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_local__ip_xer_ = { {"local_ip>\n", "local_ip>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_local__ip_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.local_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DIAMETER__conn__parameters_local__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_local__sctp__port_xer_ = { {"local_sctp_port>\n", "local_sctp_port>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DIAMETER__conn__parameters_local__sctp__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_local__sctp__port_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.local_sctp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &DIAMETER__conn__parameters_local__sctp__port_xer_, &INTEGER_json_, &DIAMETER__conn__parameters_local__sctp__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_origin__host_xer_ = { {"origin_host>\n", "origin_host>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_origin__host_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.origin_host", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DIAMETER__conn__parameters_origin__host_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_origin__realm_xer_ = { {"origin_realm>\n", "origin_realm>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_origin__realm_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.origin_realm", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DIAMETER__conn__parameters_origin__realm_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for DIAMETER__conn__parameters
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       DIAMETER__conn__parameters_auth__app__id_xer_ = { {"auth_app_id>\n", "auth_app_id>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_auth__app__id_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.auth_app_id", &INTEGER_ber_, &Osmocom__Types::uint32__t_raw_, &INTEGER_text_, &DIAMETER__conn__parameters_auth__app__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DIAMETER__conn__parameters_auth__app__id_default_coding("RAW");
const XERdescriptor_t       DIAMETER__conn__parameters_vendor__app__id_xer_ = { {"vendor_app_id>\n", "vendor_app_id>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t DIAMETER__conn__parameters_vendor__app__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t DIAMETER__conn__parameters_vendor__app__id_descr_ = { "@DIAMETER_Emulation.DIAMETER_conn_parameters.vendor_app_id", &INTEGER_ber_, &Osmocom__Types::uint32__t_raw_, &INTEGER_text_, &DIAMETER__conn__parameters_vendor__app__id_xer_, &INTEGER_json_, &DIAMETER__conn__parameters_vendor__app__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING DIAMETER__conn__parameters_vendor__app__id_default_coding("RAW");
DIAMETER__Types::PDU__DIAMETER_template template_f__diameter__xceive_rx__t_defval;
const DIAMETER__Types::PDU__DIAMETER_template& f__diameter__xceive_rx__t_defval = template_f__diameter__xceive_rx__t_defval;
// No XER for ExpectDataE2EID
const TTCN_Typedescriptor_t ExpectDataE2EID_descr_ = { "@DIAMETER_Emulation.ExpectDataE2EID", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ExpectDataE2EID_ete__id_xer_ = { {"ete_id>\n", "ete_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ExpectDataE2EID_ete__id_oer_ext_arr_[0] = {};
const int ExpectDataE2EID_ete__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t ExpectDataE2EID_ete__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, ExpectDataE2EID_ete__id_oer_ext_arr_, 0, ExpectDataE2EID_ete__id_oer_p_};
const TTCN_Typedescriptor_t ExpectDataE2EID_ete__id_descr_ = { "@DIAMETER_Emulation.ExpectDataE2EID.ete_id", &OCTETSTRING_ber_, &DIAMETER__Types::UINT32_raw_, &OCTETSTRING_text_, &ExpectDataE2EID_ete__id_xer_, &OCTETSTRING_json_, &ExpectDataE2EID_ete__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ExpectDataE2EID_ete__id_default_coding("RAW");
TTCN_Module module_object("DIAMETER_Emulation", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

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

/* Member functions of C++ classes */

DiameterCapabilityExchgInd::DiameterCapabilityExchgInd()
{
}

DiameterCapabilityExchgInd::DiameterCapabilityExchgInd(const DIAMETER__Types::PDU__DIAMETER& par_rx,
    const DIAMETER__Types::PDU__DIAMETER& par_tx)
  :   field_rx(par_rx),
  field_tx(par_tx)
{
}

DiameterCapabilityExchgInd::DiameterCapabilityExchgInd(const DiameterCapabilityExchgInd& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
if (other_value.rx().is_bound()) field_rx = other_value.rx();
else field_rx.clean_up();
if (other_value.tx().is_bound()) field_tx = other_value.tx();
else field_tx.clean_up();
}

void DiameterCapabilityExchgInd::clean_up()
{
field_rx.clean_up();
field_tx.clean_up();
}

const TTCN_Typedescriptor_t* DiameterCapabilityExchgInd::get_descriptor() const { return &DiameterCapabilityExchgInd_descr_; }
DiameterCapabilityExchgInd& DiameterCapabilityExchgInd::operator=(const DiameterCapabilityExchgInd& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
  if (other_value.rx().is_bound()) field_rx = other_value.rx();
  else field_rx.clean_up();
  if (other_value.tx().is_bound()) field_tx = other_value.tx();
  else field_tx.clean_up();
}
return *this;
}

boolean DiameterCapabilityExchgInd::operator==(const DiameterCapabilityExchgInd& other_value) const
{
return field_rx==other_value.field_rx
  && field_tx==other_value.field_tx;
}

boolean DiameterCapabilityExchgInd::is_bound() const
{
return (field_rx.is_bound())
  || (field_tx.is_bound());
}
boolean DiameterCapabilityExchgInd::is_value() const
{
return field_rx.is_value()
  && field_tx.is_value();
}
void DiameterCapabilityExchgInd::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rx := ");
field_rx.log();
TTCN_Logger::log_event_str(", tx := ");
field_tx.log();
TTCN_Logger::log_event_str(" }");
}

void DiameterCapabilityExchgInd::set_implicit_omit()
{
if (rx().is_bound()) rx().set_implicit_omit();
if (tx().is_bound()) tx().set_implicit_omit();
}

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

void DiameterCapabilityExchgInd::encode_text(Text_Buf& text_buf) const
{
field_rx.encode_text(text_buf);
field_tx.encode_text(text_buf);
}

void DiameterCapabilityExchgInd::decode_text(Text_Buf& text_buf)
{
field_rx.decode_text(text_buf);
field_tx.decode_text(text_buf);
}

struct DiameterCapabilityExchgInd_template::single_value_struct {
DIAMETER__Types::PDU__DIAMETER_template field_rx;
DIAMETER__Types::PDU__DIAMETER_template field_tx;
};

void DiameterCapabilityExchgInd_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_rx = ANY_VALUE;
single_value->field_tx = ANY_VALUE;
}
}
}

void DiameterCapabilityExchgInd_template::copy_value(const DiameterCapabilityExchgInd& other_value)
{
single_value = new single_value_struct;
if (other_value.rx().is_bound()) {
  single_value->field_rx = other_value.rx();
} else {
  single_value->field_rx.clean_up();
}
if (other_value.tx().is_bound()) {
  single_value->field_tx = other_value.tx();
} else {
  single_value->field_tx.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DiameterCapabilityExchgInd_template::copy_template(const DiameterCapabilityExchgInd_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rx().get_selection()) {
single_value->field_rx = other_value.rx();
} else {
single_value->field_rx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tx().get_selection()) {
single_value->field_tx = other_value.tx();
} else {
single_value->field_tx.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 DiameterCapabilityExchgInd_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 DiameterCapabilityExchgInd_template(*other_value.implication_.precondition);
implication_.implied_template = new DiameterCapabilityExchgInd_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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
break;
}
set_selection(other_value);
}

DiameterCapabilityExchgInd_template::DiameterCapabilityExchgInd_template()
{
}

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

DiameterCapabilityExchgInd_template::DiameterCapabilityExchgInd_template(const DiameterCapabilityExchgInd& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DiameterCapabilityExchgInd_template::match(const DiameterCapabilityExchgInd& 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.rx().is_bound()) return FALSE;
if(!single_value->field_rx.match(other_value.rx(), legacy))return FALSE;
if(!other_value.tx().is_bound()) return FALSE;
if(!single_value->field_tx.match(other_value.tx(), 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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
}
return FALSE;
}

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

boolean DiameterCapabilityExchgInd_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rx.is_value()
 && single_value->field_tx.is_value();
}

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

DiameterCapabilityExchgInd DiameterCapabilityExchgInd_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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
DiameterCapabilityExchgInd ret_val;
if (single_value->field_rx.is_bound()) {
ret_val.rx() = single_value->field_rx.valueof();
}
if (single_value->field_tx.is_bound()) {
ret_val.tx() = single_value->field_tx.valueof();
}
return ret_val;
}

void DiameterCapabilityExchgInd_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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DiameterCapabilityExchgInd_template[list_length];
}

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

DIAMETER__Types::PDU__DIAMETER_template& DiameterCapabilityExchgInd_template::rx()
{
set_specific();
return single_value->field_rx;
}

const DIAMETER__Types::PDU__DIAMETER_template& DiameterCapabilityExchgInd_template::rx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rx of a non-specific template of type @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
return single_value->field_rx;
}

DIAMETER__Types::PDU__DIAMETER_template& DiameterCapabilityExchgInd_template::tx()
{
set_specific();
return single_value->field_tx;
}

const DIAMETER__Types::PDU__DIAMETER_template& DiameterCapabilityExchgInd_template::tx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tx of a non-specific template of type @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
return single_value->field_tx;
}

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

void DiameterCapabilityExchgInd_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rx := ");
single_value->field_rx.log();
TTCN_Logger::log_event_str(", tx := ");
single_value->field_tx.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 DiameterCapabilityExchgInd_template::log_match(const DiameterCapabilityExchgInd& 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_rx.match(match_value.rx(), legacy)){
TTCN_Logger::log_logmatch_info(".rx");
single_value->field_rx.log_match(match_value.rx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tx.match(match_value.tx(), legacy)){
TTCN_Logger::log_logmatch_info(".tx");
single_value->field_tx.log_match(match_value.tx(), 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("{ rx := ");
single_value->field_rx.log_match(match_value.rx(), legacy);
TTCN_Logger::log_event_str(", tx := ");
single_value->field_tx.log_match(match_value.tx(), 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 DiameterCapabilityExchgInd_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rx().is_bound()) rx().set_implicit_omit();
if (tx().is_bound()) tx().set_implicit_omit();
}

void DiameterCapabilityExchgInd_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rx.encode_text(text_buf);
single_value->field_tx.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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
}
}

void DiameterCapabilityExchgInd_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_rx.decode_text(text_buf);
single_value->field_tx.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 DiameterCapabilityExchgInd_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 @DIAMETER_Emulation.DiameterCapabilityExchgInd.");
}
}

void DiameterCapabilityExchgInd_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: {
    DiameterCapabilityExchgInd_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 @DIAMETER_Emulation.DiameterCapabilityExchgInd 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) rx().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx().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(), "rx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rx().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(), "tx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx().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 @DIAMETER_Emulation.DiameterCapabilityExchgInd: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DiameterCapabilityExchgInd_template* precondition = new DiameterCapabilityExchgInd_template;
    precondition->set_param(*param.get_elem(0));
    DiameterCapabilityExchgInd_template* implied_template = new DiameterCapabilityExchgInd_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DiameterCapabilityExchgInd_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
  }
  is_ifpresent = param.get_ifpresent();
}

void DiameterCapabilityExchgInd_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_rx.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
single_value->field_tx.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
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 : "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
}

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

boolean DiameterCapabilityExchgInd_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 DIAMETER__Conn__PT::remove_msg_queue_head()
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
switch (my_head->item_selection) {
case MESSAGE_0:
delete (my_head)->message_0;
break;
default:
TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name);
}
msg_queue_item_base *next_item = msg_queue_head->next_item;
delete (msg_queue_item*)msg_queue_head;
msg_queue_head = next_item;
if (next_item == NULL) msg_queue_tail = NULL;
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));}

void DIAMETER__Conn__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

DIAMETER__Conn__PT::DIAMETER__Conn__PT(const char *par_port_name)
 : PORT(par_port_name)
{
msg_queue_head = NULL;
msg_queue_tail = NULL;
}

DIAMETER__Conn__PT::~DIAMETER__Conn__PT()
{
clear_queue();
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation.");
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_send(port_name, destination_component,
(TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Types.PDU_DIAMETER");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect);
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Types.PDU_DIAMETER");
send_par.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE),
TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void DIAMETER__Conn__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status DIAMETER__Conn__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__Conn__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status DIAMETER__Conn__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__Conn__PT::receive(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__Conn__PT::check_receive(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETER__Conn__PT::trigger(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void DIAMETER__Conn__PT::incoming_message(const DIAMETER__Types::PDU__DIAMETER& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a message has arrived on it.", port_name);
}
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_0;
new_item->message_0 = new DIAMETER__Types::PDU__DIAMETER(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

boolean DIAMETER__Conn__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@DIAMETER_Types.PDU_DIAMETER")) {
DIAMETER__Types::PDU__DIAMETER incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void DIAMETER__PT::remove_msg_queue_head()
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
switch (my_head->item_selection) {
case MESSAGE_0:
delete (my_head)->message_0;
break;
case MESSAGE_1:
delete (my_head)->message_1;
break;
default:
TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name);
}
msg_queue_item_base *next_item = msg_queue_head->next_item;
delete (msg_queue_item*)msg_queue_head;
msg_queue_head = next_item;
if (next_item == NULL) msg_queue_tail = NULL;
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));}

void DIAMETER__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

DIAMETER__PT::DIAMETER__PT(const char *par_port_name)
 : PORT(par_port_name)
{
msg_queue_head = NULL;
msg_queue_tail = NULL;
}

DIAMETER__PT::~DIAMETER__PT()
{
clear_queue();
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation.");
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_send(port_name, destination_component,
(TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Types.PDU_DIAMETER");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect);
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Types.PDU_DIAMETER");
send_par.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE),
TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void DIAMETER__PT::send(const DIAMETER__Types::PDU__DIAMETER_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const DIAMETER__Types::PDU__DIAMETER& send_par_value = DIAMETER__Types::PDU__DIAMETER(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation.");
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_send(port_name, destination_component,
(TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Emulation.DiameterCapabilityExchgInd : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect);
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_message(text_buf, "@DIAMETER_Emulation.DiameterCapabilityExchgInd");
send_par.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE),
TTCN_Logger::log_event_str(" @DIAMETER_Emulation.DiameterCapabilityExchgInd : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const DiameterCapabilityExchgInd& send_par_value = DiameterCapabilityExchgInd(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const DiameterCapabilityExchgInd& send_par_value = DiameterCapabilityExchgInd(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void DIAMETER__PT::send(const DiameterCapabilityExchgInd_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const DiameterCapabilityExchgInd& send_par_value = DiameterCapabilityExchgInd(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status DIAMETER__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status DIAMETER__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__PT::receive(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__PT::check_receive(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETER__PT::trigger(const DIAMETER__Types::PDU__DIAMETER_template& value_template, DIAMETER__Types::PDU__DIAMETER *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @DIAMETER_Types.PDU_DIAMETER.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Types.PDU_DIAMETER : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__PT::receive(const DiameterCapabilityExchgInd_template& value_template, DiameterCapabilityExchgInd *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_1) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Emulation.DiameterCapabilityExchgInd.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_1)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status DIAMETER__PT::check_receive(const DiameterCapabilityExchgInd_template& value_template, DiameterCapabilityExchgInd *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_1) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @DIAMETER_Emulation.DiameterCapabilityExchgInd.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_1)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETER__PT::trigger(const DiameterCapabilityExchgInd_template& value_template, DiameterCapabilityExchgInd *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else if (my_head->item_selection != MESSAGE_1) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @DIAMETER_Emulation.DiameterCapabilityExchgInd.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_1)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @DIAMETER_Emulation.DiameterCapabilityExchgInd : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void DIAMETER__PT::incoming_message(const DIAMETER__Types::PDU__DIAMETER& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a message has arrived on it.", port_name);
}
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Types.PDU_DIAMETER : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_0;
new_item->message_0 = new DIAMETER__Types::PDU__DIAMETER(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void DIAMETER__PT::incoming_message(const DiameterCapabilityExchgInd& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a message has arrived on it.", port_name);
}
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @DIAMETER_Emulation.DiameterCapabilityExchgInd : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_1;
new_item->message_1 = new DiameterCapabilityExchgInd(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

boolean DIAMETER__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@DIAMETER_Types.PDU_DIAMETER")) {
DIAMETER__Types::PDU__DIAMETER incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@DIAMETER_Emulation.DiameterCapabilityExchgInd")) {
DiameterCapabilityExchgInd incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

AssociationData::AssociationData()
{
}

AssociationData::AssociationData(const COMPONENT& par_comp__ref,
    const OPTIONAL< HEXSTRING >& par_imsi)
  :   field_comp__ref(par_comp__ref),
  field_imsi(par_imsi)
{
}

AssociationData::AssociationData(const AssociationData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.AssociationData.");
if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
else field_comp__ref.clean_up();
if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
else field_imsi.clean_up();
}

void AssociationData::clean_up()
{
field_comp__ref.clean_up();
field_imsi.clean_up();
}

const TTCN_Typedescriptor_t* AssociationData::get_descriptor() const { return &AssociationData_descr_; }
AssociationData& AssociationData::operator=(const AssociationData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.AssociationData.");
  if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
  else field_comp__ref.clean_up();
  if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
  else field_imsi.clean_up();
}
return *this;
}

boolean AssociationData::operator==(const AssociationData& other_value) const
{
return field_comp__ref==other_value.field_comp__ref
  && field_imsi==other_value.field_imsi;
}

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

void AssociationData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ comp_ref := ");
field_comp__ref.log();
TTCN_Logger::log_event_str(", imsi := ");
field_imsi.log();
TTCN_Logger::log_event_str(" }");
}

void AssociationData::set_implicit_omit()
{
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (!imsi().is_bound()) imsi() = OMIT_VALUE;
else imsi().set_implicit_omit();
}

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

void AssociationData::encode_text(Text_Buf& text_buf) const
{
field_comp__ref.encode_text(text_buf);
field_imsi.encode_text(text_buf);
}

void AssociationData::decode_text(Text_Buf& text_buf)
{
field_comp__ref.decode_text(text_buf);
field_imsi.decode_text(text_buf);
}

struct AssociationData_template::single_value_struct {
COMPONENT_template field_comp__ref;
HEXSTRING_template field_imsi;
};

void AssociationData_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_comp__ref = ANY_VALUE;
single_value->field_imsi = ANY_OR_OMIT;
}
}
}

void AssociationData_template::copy_value(const AssociationData& other_value)
{
single_value = new single_value_struct;
if (other_value.comp__ref().is_bound()) {
  single_value->field_comp__ref = other_value.comp__ref();
} else {
  single_value->field_comp__ref.clean_up();
}
if (other_value.imsi().is_bound()) {
  if (other_value.imsi().ispresent()) single_value->field_imsi = other_value.imsi()();
  else single_value->field_imsi = OMIT_VALUE;
} else {
  single_value->field_imsi.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AssociationData_template::copy_template(const AssociationData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.comp__ref().get_selection()) {
single_value->field_comp__ref = other_value.comp__ref();
} else {
single_value->field_comp__ref.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imsi().get_selection()) {
single_value->field_imsi = other_value.imsi();
} else {
single_value->field_imsi.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 AssociationData_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 AssociationData_template(*other_value.implication_.precondition);
implication_.implied_template = new AssociationData_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 @DIAMETER_Emulation.AssociationData.");
break;
}
set_selection(other_value);
}

AssociationData_template::AssociationData_template()
{
}

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

AssociationData_template::AssociationData_template(const AssociationData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AssociationData_template::match(const AssociationData& 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.comp__ref().is_bound()) return FALSE;
if(!single_value->field_comp__ref.match(other_value.comp__ref(), legacy))return FALSE;
if(!other_value.imsi().is_bound()) return FALSE;
if((other_value.imsi().ispresent() ? !single_value->field_imsi.match((const HEXSTRING&)other_value.imsi(), legacy) : !single_value->field_imsi.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 @DIAMETER_Emulation.AssociationData.");
}
return FALSE;
}

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

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

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

AssociationData AssociationData_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 @DIAMETER_Emulation.AssociationData.");
AssociationData ret_val;
if (single_value->field_comp__ref.is_bound()) {
ret_val.comp__ref() = single_value->field_comp__ref.valueof();
}
if (single_value->field_imsi.is_omit()) ret_val.imsi() = OMIT_VALUE;
else if (single_value->field_imsi.is_bound()) {
ret_val.imsi() = single_value->field_imsi.valueof();
}
return ret_val;
}

void AssociationData_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 @DIAMETER_Emulation.AssociationData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AssociationData_template[list_length];
}

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

COMPONENT_template& AssociationData_template::comp__ref()
{
set_specific();
return single_value->field_comp__ref;
}

const COMPONENT_template& AssociationData_template::comp__ref() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field comp_ref of a non-specific template of type @DIAMETER_Emulation.AssociationData.");
return single_value->field_comp__ref;
}

HEXSTRING_template& AssociationData_template::imsi()
{
set_specific();
return single_value->field_imsi;
}

const HEXSTRING_template& AssociationData_template::imsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imsi of a non-specific template of type @DIAMETER_Emulation.AssociationData.");
return single_value->field_imsi;
}

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

void AssociationData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ comp_ref := ");
single_value->field_comp__ref.log();
TTCN_Logger::log_event_str(", imsi := ");
single_value->field_imsi.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 AssociationData_template::log_match(const AssociationData& 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_comp__ref.match(match_value.comp__ref(), legacy)){
TTCN_Logger::log_logmatch_info(".comp_ref");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.imsi().ispresent()){
if(!single_value->field_imsi.match(match_value.imsi(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_imsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".imsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_imsi.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("{ comp_ref := ");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::log_event_str(", imsi := ");
if (match_value.imsi().ispresent()) {
single_value->field_imsi.log_match(match_value.imsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_imsi.log();
if (single_value->field_imsi.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 AssociationData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (!imsi().is_bound()) imsi() = OMIT_VALUE;
else imsi().set_implicit_omit();
}

void AssociationData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_comp__ref.encode_text(text_buf);
single_value->field_imsi.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 @DIAMETER_Emulation.AssociationData.");
}
}

void AssociationData_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_comp__ref.decode_text(text_buf);
single_value->field_imsi.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 AssociationData_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 @DIAMETER_Emulation.AssociationData.");
}
}

void AssociationData_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: {
    AssociationData_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 @DIAMETER_Emulation.AssociationData 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) comp__ref().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) imsi().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(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().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(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().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 @DIAMETER_Emulation.AssociationData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AssociationData_template* precondition = new AssociationData_template;
    precondition->set_param(*param.get_elem(0));
    AssociationData_template* implied_template = new AssociationData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AssociationData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.AssociationData");
  }
  is_ifpresent = param.get_ifpresent();
}

void AssociationData_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_comp__ref.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.AssociationData");
single_value->field_imsi.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.AssociationData");
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 : "@DIAMETER_Emulation.AssociationData");
}

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

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

ETEIDData::ETEIDData()
{
}

ETEIDData::ETEIDData(const COMPONENT& par_comp__ref,
    const OPTIONAL< OCTETSTRING >& par_ete__id)
  :   field_comp__ref(par_comp__ref),
  field_ete__id(par_ete__id)
{
}

ETEIDData::ETEIDData(const ETEIDData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.ETEIDData.");
if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
else field_comp__ref.clean_up();
if (other_value.ete__id().is_bound()) field_ete__id = other_value.ete__id();
else field_ete__id.clean_up();
}

void ETEIDData::clean_up()
{
field_comp__ref.clean_up();
field_ete__id.clean_up();
}

const TTCN_Typedescriptor_t* ETEIDData::get_descriptor() const { return &ETEIDData_descr_; }
ETEIDData& ETEIDData::operator=(const ETEIDData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.ETEIDData.");
  if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
  else field_comp__ref.clean_up();
  if (other_value.ete__id().is_bound()) field_ete__id = other_value.ete__id();
  else field_ete__id.clean_up();
}
return *this;
}

boolean ETEIDData::operator==(const ETEIDData& other_value) const
{
return field_comp__ref==other_value.field_comp__ref
  && field_ete__id==other_value.field_ete__id;
}

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

void ETEIDData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ comp_ref := ");
field_comp__ref.log();
TTCN_Logger::log_event_str(", ete_id := ");
field_ete__id.log();
TTCN_Logger::log_event_str(" }");
}

void ETEIDData::set_implicit_omit()
{
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (!ete__id().is_bound()) ete__id() = OMIT_VALUE;
else ete__id().set_implicit_omit();
}

void ETEIDData::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 @DIAMETER_Emulation.ETEIDData 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) comp__ref().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ete__id().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(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().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(), "ete_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ete__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 @DIAMETER_Emulation.ETEIDData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@DIAMETER_Emulation.ETEIDData");
  }
}

void ETEIDData::encode_text(Text_Buf& text_buf) const
{
field_comp__ref.encode_text(text_buf);
field_ete__id.encode_text(text_buf);
}

void ETEIDData::decode_text(Text_Buf& text_buf)
{
field_comp__ref.decode_text(text_buf);
field_ete__id.decode_text(text_buf);
}

struct ETEIDData_template::single_value_struct {
COMPONENT_template field_comp__ref;
OCTETSTRING_template field_ete__id;
};

void ETEIDData_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_comp__ref = ANY_VALUE;
single_value->field_ete__id = ANY_OR_OMIT;
}
}
}

void ETEIDData_template::copy_value(const ETEIDData& other_value)
{
single_value = new single_value_struct;
if (other_value.comp__ref().is_bound()) {
  single_value->field_comp__ref = other_value.comp__ref();
} else {
  single_value->field_comp__ref.clean_up();
}
if (other_value.ete__id().is_bound()) {
  if (other_value.ete__id().ispresent()) single_value->field_ete__id = other_value.ete__id()();
  else single_value->field_ete__id = OMIT_VALUE;
} else {
  single_value->field_ete__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ETEIDData_template::copy_template(const ETEIDData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.comp__ref().get_selection()) {
single_value->field_comp__ref = other_value.comp__ref();
} else {
single_value->field_comp__ref.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ete__id().get_selection()) {
single_value->field_ete__id = other_value.ete__id();
} else {
single_value->field_ete__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 ETEIDData_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 ETEIDData_template(*other_value.implication_.precondition);
implication_.implied_template = new ETEIDData_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 @DIAMETER_Emulation.ETEIDData.");
break;
}
set_selection(other_value);
}

ETEIDData_template::ETEIDData_template()
{
}

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

ETEIDData_template::ETEIDData_template(const ETEIDData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ETEIDData_template::match(const ETEIDData& 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.comp__ref().is_bound()) return FALSE;
if(!single_value->field_comp__ref.match(other_value.comp__ref(), legacy))return FALSE;
if(!other_value.ete__id().is_bound()) return FALSE;
if((other_value.ete__id().ispresent() ? !single_value->field_ete__id.match((const OCTETSTRING&)other_value.ete__id(), legacy) : !single_value->field_ete__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 @DIAMETER_Emulation.ETEIDData.");
}
return FALSE;
}

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

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

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

ETEIDData ETEIDData_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 @DIAMETER_Emulation.ETEIDData.");
ETEIDData ret_val;
if (single_value->field_comp__ref.is_bound()) {
ret_val.comp__ref() = single_value->field_comp__ref.valueof();
}
if (single_value->field_ete__id.is_omit()) ret_val.ete__id() = OMIT_VALUE;
else if (single_value->field_ete__id.is_bound()) {
ret_val.ete__id() = single_value->field_ete__id.valueof();
}
return ret_val;
}

void ETEIDData_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 @DIAMETER_Emulation.ETEIDData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ETEIDData_template[list_length];
}

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

COMPONENT_template& ETEIDData_template::comp__ref()
{
set_specific();
return single_value->field_comp__ref;
}

const COMPONENT_template& ETEIDData_template::comp__ref() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field comp_ref of a non-specific template of type @DIAMETER_Emulation.ETEIDData.");
return single_value->field_comp__ref;
}

OCTETSTRING_template& ETEIDData_template::ete__id()
{
set_specific();
return single_value->field_ete__id;
}

const OCTETSTRING_template& ETEIDData_template::ete__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ete_id of a non-specific template of type @DIAMETER_Emulation.ETEIDData.");
return single_value->field_ete__id;
}

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

void ETEIDData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ comp_ref := ");
single_value->field_comp__ref.log();
TTCN_Logger::log_event_str(", ete_id := ");
single_value->field_ete__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 ETEIDData_template::log_match(const ETEIDData& 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_comp__ref.match(match_value.comp__ref(), legacy)){
TTCN_Logger::log_logmatch_info(".comp_ref");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ete__id().ispresent()){
if(!single_value->field_ete__id.match(match_value.ete__id(), legacy)){
TTCN_Logger::log_logmatch_info(".ete_id");
single_value->field_ete__id.log_match(match_value.ete__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ete__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ete_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ete__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("{ comp_ref := ");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::log_event_str(", ete_id := ");
if (match_value.ete__id().ispresent()) {
single_value->field_ete__id.log_match(match_value.ete__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ete__id.log();
if (single_value->field_ete__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 ETEIDData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (!ete__id().is_bound()) ete__id() = OMIT_VALUE;
else ete__id().set_implicit_omit();
}

void ETEIDData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_comp__ref.encode_text(text_buf);
single_value->field_ete__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 @DIAMETER_Emulation.ETEIDData.");
}
}

void ETEIDData_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_comp__ref.decode_text(text_buf);
single_value->field_ete__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 ETEIDData_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 @DIAMETER_Emulation.ETEIDData.");
}
}

void ETEIDData_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: {
    ETEIDData_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 @DIAMETER_Emulation.ETEIDData 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) comp__ref().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ete__id().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(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().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(), "ete_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ete__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 @DIAMETER_Emulation.ETEIDData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ETEIDData_template* precondition = new ETEIDData_template;
    precondition->set_param(*param.get_elem(0));
    ETEIDData_template* implied_template = new ETEIDData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ETEIDData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.ETEIDData");
  }
  is_ifpresent = param.get_ifpresent();
}

void ETEIDData_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_comp__ref.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ETEIDData");
single_value->field_ete__id.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ETEIDData");
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 : "@DIAMETER_Emulation.ETEIDData");
}

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

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

ExpectData::ExpectData()
{
}

ExpectData::ExpectData(const OPTIONAL< HEXSTRING >& par_imsi,
    const COMPONENT& par_vc__conn)
  :   field_imsi(par_imsi),
  field_vc__conn(par_vc__conn)
{
}

ExpectData::ExpectData(const ExpectData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.ExpectData.");
if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
else field_imsi.clean_up();
if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
else field_vc__conn.clean_up();
}

void ExpectData::clean_up()
{
field_imsi.clean_up();
field_vc__conn.clean_up();
}

const TTCN_Typedescriptor_t* ExpectData::get_descriptor() const { return &ExpectData_descr_; }
ExpectData& ExpectData::operator=(const ExpectData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.ExpectData.");
  if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
  else field_imsi.clean_up();
  if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
  else field_vc__conn.clean_up();
}
return *this;
}

boolean ExpectData::operator==(const ExpectData& other_value) const
{
return field_imsi==other_value.field_imsi
  && field_vc__conn==other_value.field_vc__conn;
}

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

void ExpectData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ imsi := ");
field_imsi.log();
TTCN_Logger::log_event_str(", vc_conn := ");
field_vc__conn.log();
TTCN_Logger::log_event_str(" }");
}

void ExpectData::set_implicit_omit()
{
if (!imsi().is_bound()) imsi() = OMIT_VALUE;
else imsi().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

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

void ExpectData::encode_text(Text_Buf& text_buf) const
{
field_imsi.encode_text(text_buf);
field_vc__conn.encode_text(text_buf);
}

void ExpectData::decode_text(Text_Buf& text_buf)
{
field_imsi.decode_text(text_buf);
field_vc__conn.decode_text(text_buf);
}

struct ExpectData_template::single_value_struct {
HEXSTRING_template field_imsi;
COMPONENT_template field_vc__conn;
};

void ExpectData_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_imsi = ANY_OR_OMIT;
single_value->field_vc__conn = ANY_VALUE;
}
}
}

void ExpectData_template::copy_value(const ExpectData& other_value)
{
single_value = new single_value_struct;
if (other_value.imsi().is_bound()) {
  if (other_value.imsi().ispresent()) single_value->field_imsi = other_value.imsi()();
  else single_value->field_imsi = OMIT_VALUE;
} else {
  single_value->field_imsi.clean_up();
}
if (other_value.vc__conn().is_bound()) {
  single_value->field_vc__conn = other_value.vc__conn();
} else {
  single_value->field_vc__conn.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ExpectData_template::copy_template(const ExpectData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.imsi().get_selection()) {
single_value->field_imsi = other_value.imsi();
} else {
single_value->field_imsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vc__conn().get_selection()) {
single_value->field_vc__conn = other_value.vc__conn();
} else {
single_value->field_vc__conn.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 ExpectData_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 ExpectData_template(*other_value.implication_.precondition);
implication_.implied_template = new ExpectData_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 @DIAMETER_Emulation.ExpectData.");
break;
}
set_selection(other_value);
}

ExpectData_template::ExpectData_template()
{
}

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

ExpectData_template::ExpectData_template(const ExpectData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ExpectData_template::match(const ExpectData& 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.imsi().is_bound()) return FALSE;
if((other_value.imsi().ispresent() ? !single_value->field_imsi.match((const HEXSTRING&)other_value.imsi(), legacy) : !single_value->field_imsi.match_omit(legacy)))return FALSE;
if(!other_value.vc__conn().is_bound()) return FALSE;
if(!single_value->field_vc__conn.match(other_value.vc__conn(), 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 @DIAMETER_Emulation.ExpectData.");
}
return FALSE;
}

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

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

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

ExpectData ExpectData_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 @DIAMETER_Emulation.ExpectData.");
ExpectData ret_val;
if (single_value->field_imsi.is_omit()) ret_val.imsi() = OMIT_VALUE;
else if (single_value->field_imsi.is_bound()) {
ret_val.imsi() = single_value->field_imsi.valueof();
}
if (single_value->field_vc__conn.is_bound()) {
ret_val.vc__conn() = single_value->field_vc__conn.valueof();
}
return ret_val;
}

void ExpectData_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 @DIAMETER_Emulation.ExpectData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ExpectData_template[list_length];
}

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

HEXSTRING_template& ExpectData_template::imsi()
{
set_specific();
return single_value->field_imsi;
}

const HEXSTRING_template& ExpectData_template::imsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imsi of a non-specific template of type @DIAMETER_Emulation.ExpectData.");
return single_value->field_imsi;
}

COMPONENT_template& ExpectData_template::vc__conn()
{
set_specific();
return single_value->field_vc__conn;
}

const COMPONENT_template& ExpectData_template::vc__conn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vc_conn of a non-specific template of type @DIAMETER_Emulation.ExpectData.");
return single_value->field_vc__conn;
}

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

void ExpectData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ imsi := ");
single_value->field_imsi.log();
TTCN_Logger::log_event_str(", vc_conn := ");
single_value->field_vc__conn.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 ExpectData_template::log_match(const ExpectData& 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.imsi().ispresent()){
if(!single_value->field_imsi.match(match_value.imsi(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_imsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".imsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_imsi.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_vc__conn.match(match_value.vc__conn(), legacy)){
TTCN_Logger::log_logmatch_info(".vc_conn");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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("{ imsi := ");
if (match_value.imsi().ispresent()) {
single_value->field_imsi.log_match(match_value.imsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_imsi.log();
if (single_value->field_imsi.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vc_conn := ");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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 ExpectData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!imsi().is_bound()) imsi() = OMIT_VALUE;
else imsi().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

void ExpectData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_imsi.encode_text(text_buf);
single_value->field_vc__conn.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 @DIAMETER_Emulation.ExpectData.");
}
}

void ExpectData_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_imsi.decode_text(text_buf);
single_value->field_vc__conn.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 ExpectData_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 @DIAMETER_Emulation.ExpectData.");
}
}

void ExpectData_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: {
    ExpectData_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 @DIAMETER_Emulation.ExpectData 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) imsi().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vc__conn().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(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().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(), "vc_conn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__conn().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 @DIAMETER_Emulation.ExpectData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ExpectData_template* precondition = new ExpectData_template;
    precondition->set_param(*param.get_elem(0));
    ExpectData_template* implied_template = new ExpectData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ExpectData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.ExpectData");
  }
  is_ifpresent = param.get_ifpresent();
}

void ExpectData_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_imsi.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ExpectData");
single_value->field_vc__conn.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ExpectData");
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 : "@DIAMETER_Emulation.ExpectData");
}

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

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

DIAMETERCreateCallback::DIAMETERCreateCallback()
{
referred_function = NULL;
}

DIAMETERCreateCallback::DIAMETERCreateCallback(function_pointer other_value)
{
referred_function = other_value;
}

DIAMETERCreateCallback::DIAMETERCreateCallback(const DIAMETERCreateCallback& other_value)
: Base_Type(){
other_value.must_bound("Copying an unbound @DIAMETER_Emulation.DIAMETERCreateCallback value.");
referred_function = other_value.referred_function;
}

DIAMETERCreateCallback& DIAMETERCreateCallback::operator=(function_pointer other_value)
{
referred_function = other_value;
return *this;
}

DIAMETERCreateCallback& DIAMETERCreateCallback::operator=(const DIAMETERCreateCallback& other_value)
{
other_value.must_bound("Assignment of an unbound value.");
referred_function = other_value.referred_function;
return *this;
}

boolean DIAMETERCreateCallback::operator==(function_pointer other_value) const
{
must_bound("Unbound left operand of @DIAMETER_Emulation.DIAMETERCreateCallback comparison.");
return referred_function == other_value;
}

boolean DIAMETERCreateCallback::operator==(const DIAMETERCreateCallback& other_value) const
{
must_bound("Unbound left operand of @DIAMETER_Emulation.DIAMETERCreateCallback comparison.");
other_value.must_bound("Unbound right operand of @DIAMETER_Emulation.DIAMETERCreateCallback comparison.");
return referred_function == other_value.referred_function;
}

COMPONENT DIAMETERCreateCallback::invoke(const DIAMETER__Types::PDU__DIAMETER& msg, const HEXSTRING& imsi, const CHARSTRING& id) const
{
must_bound("Call of unbound function.");
if(referred_function == (DIAMETERCreateCallback::function_pointer)Module_List::get_fat_null())
TTCN_error("null reference cannot be invoked.");
return referred_function(msg, imsi, id);
}

void DIAMETERCreateCallback::start(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER& msg, const HEXSTRING& imsi, const CHARSTRING& id) const
{
((DIAMETERCreateCallback::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, msg, imsi, id);
}

void DIAMETERCreateCallback::log() const
{
Module_List::log_function((genericfunc_t)referred_function);
}

void DIAMETERCreateCallback::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void DIAMETERCreateCallback::encode_text(Text_Buf& text_buf) const
{
Module_List::encode_function(text_buf,(genericfunc_t)referred_function);
}

void DIAMETERCreateCallback::decode_text(Text_Buf& text_buf)
{
Module_List::decode_function(text_buf,(genericfunc_t*)&referred_function);
}

boolean operator==(DIAMETERCreateCallback::function_pointer value, const DIAMETERCreateCallback& other_value)
{
other_value.must_bound("Unbound right operand of @DIAMETER_Emulation.DIAMETERCreateCallback comparison.");
return value == other_value.referred_function;
}

void DIAMETERCreateCallback_template::copy_template(const DIAMETERCreateCallback_template& other_value)
{
switch(other_value.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:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DIAMETERCreateCallback_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i] = other_value.value_list.list_value[i];
break;
default:
TTCN_error("Copying an unitialized/unsupported @DIAMETER_Emulation.DIAMETERCreateCallback template.");
}
set_selection(other_value);
}

DIAMETERCreateCallback_template::DIAMETERCreateCallback_template()
{
}

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

DIAMETERCreateCallback_template::DIAMETERCreateCallback_template(DIAMETERCreateCallback::function_pointer other_value)
  : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DIAMETERCreateCallback_template::DIAMETERCreateCallback_template(const DIAMETERCreateCallback& other_value)
  :Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound @DIAMETER_Emulation.DIAMETERCreateCallback value.");
single_value = other_value.referred_function;
}

DIAMETERCreateCallback_template::DIAMETERCreateCallback_template(const OPTIONAL<DIAMETERCreateCallback>& other_value)
{
if(other_value.ispresent()) {
set_selection(SPECIFIC_VALUE);
single_value = ((const DIAMETERCreateCallback&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
}

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

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

void DIAMETERCreateCallback_template::clean_up(){
if(template_selection == VALUE_LIST ||
template_selection == COMPLEMENTED_LIST)
delete[] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}

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

DIAMETERCreateCallback_template& DIAMETERCreateCallback_template::operator=(DIAMETERCreateCallback::function_pointer other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;}

DIAMETERCreateCallback_template& DIAMETERCreateCallback_template::operator=(const DIAMETERCreateCallback& other_value)
{
other_value.must_bound("Assignment of an unbound @DIAMETER_Emulation.DIAMETERCreateCallback value to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.referred_function;
return *this;
}

DIAMETERCreateCallback_template& DIAMETERCreateCallback_template::operator=(const OPTIONAL<DIAMETERCreateCallback>& other_value)
{
clean_up();
if(other_value.ispresent()) { 
set_selection(SPECIFIC_VALUE);
single_value = ((const DIAMETERCreateCallback&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
return *this;}

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

boolean DIAMETERCreateCallback_template::match(DIAMETERCreateCallback::function_pointer 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 i = 0; i < value_list.n_values; i++)
if(value_list.list_value[i].match(other_value))
return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching with an unitialized/unsupported @DIAMETER_Emulation.DIAMETERCreateCallback template.");
};
return FALSE;
}

boolean DIAMETERCreateCallback_template::match(const DIAMETERCreateCallback& other_value, boolean) const
{
  if (!other_value.is_bound()) return FALSE;
return match(other_value.referred_function);
}

DIAMETERCreateCallback DIAMETERCreateCallback_template::valueof() const
{
if(template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific @DIAMETER_Emulation.DIAMETERCreateCallback template.");
return single_value;
}

void DIAMETERCreateCallback_template::set_type(template_sel template_type, unsigned int list_length)
{
if(template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid type for an @DIAMETER_Emulation.DIAMETERCreateCallback template.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DIAMETERCreateCallback_template[list_length];
}

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

void DIAMETERCreateCallback_template::log() const
{
switch(template_selection) {
case SPECIFIC_VALUE:
Module_List::log_function((genericfunc_t)single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for(unsigned int i = 0; i < value_list.n_values; i++) {
if(i > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[i].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}

void DIAMETERCreateCallback_template::log_match(const DIAMETERCreateCallback& match_value, boolean legacy) const
{
log();
TTCN_Logger::log_event_str(" with ");
match_value.log();
if(match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DIAMETERCreateCallback_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::encode_function(text_buf, (genericfunc_t)single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @DIAMETER_Emulation.DIAMETERCreateCallback.");
}
}

void DIAMETERCreateCallback_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::decode_function(text_buf,(genericfunc_t*)&single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DIAMETERCreateCallback_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].decode_text(text_buf);
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @DIAMETER_Emulation.DIAMETERCreateCallback.");
}
}

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

boolean DIAMETERCreateCallback_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
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 DIAMETERCreateCallback_template::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void DIAMETERCreateCallback_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 : "@DIAMETER_Emulation.DIAMETERCreateCallback");
}

DIAMETERUnitdataCallback::DIAMETERUnitdataCallback()
{
referred_function = NULL;
}

DIAMETERUnitdataCallback::DIAMETERUnitdataCallback(function_pointer other_value)
{
referred_function = other_value;
}

DIAMETERUnitdataCallback::DIAMETERUnitdataCallback(const DIAMETERUnitdataCallback& other_value)
: Base_Type(){
other_value.must_bound("Copying an unbound @DIAMETER_Emulation.DIAMETERUnitdataCallback value.");
referred_function = other_value.referred_function;
}

DIAMETERUnitdataCallback& DIAMETERUnitdataCallback::operator=(function_pointer other_value)
{
referred_function = other_value;
return *this;
}

DIAMETERUnitdataCallback& DIAMETERUnitdataCallback::operator=(const DIAMETERUnitdataCallback& other_value)
{
other_value.must_bound("Assignment of an unbound value.");
referred_function = other_value.referred_function;
return *this;
}

boolean DIAMETERUnitdataCallback::operator==(function_pointer other_value) const
{
must_bound("Unbound left operand of @DIAMETER_Emulation.DIAMETERUnitdataCallback comparison.");
return referred_function == other_value;
}

boolean DIAMETERUnitdataCallback::operator==(const DIAMETERUnitdataCallback& other_value) const
{
must_bound("Unbound left operand of @DIAMETER_Emulation.DIAMETERUnitdataCallback comparison.");
other_value.must_bound("Unbound right operand of @DIAMETER_Emulation.DIAMETERUnitdataCallback comparison.");
return referred_function == other_value.referred_function;
}

DIAMETER__Types::PDU__DIAMETER_template DIAMETERUnitdataCallback::invoke(const DIAMETER__Types::PDU__DIAMETER& msg) const
{
must_bound("Call of unbound function.");
if(referred_function == (DIAMETERUnitdataCallback::function_pointer)Module_List::get_fat_null())
TTCN_error("null reference cannot be invoked.");
return referred_function(msg);
}

void DIAMETERUnitdataCallback::start(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER& msg) const
{
((DIAMETERUnitdataCallback::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, msg);
}

void DIAMETERUnitdataCallback::log() const
{
Module_List::log_function((genericfunc_t)referred_function);
}

void DIAMETERUnitdataCallback::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void DIAMETERUnitdataCallback::encode_text(Text_Buf& text_buf) const
{
Module_List::encode_function(text_buf,(genericfunc_t)referred_function);
}

void DIAMETERUnitdataCallback::decode_text(Text_Buf& text_buf)
{
Module_List::decode_function(text_buf,(genericfunc_t*)&referred_function);
}

boolean operator==(DIAMETERUnitdataCallback::function_pointer value, const DIAMETERUnitdataCallback& other_value)
{
other_value.must_bound("Unbound right operand of @DIAMETER_Emulation.DIAMETERUnitdataCallback comparison.");
return value == other_value.referred_function;
}

void DIAMETERUnitdataCallback_template::copy_template(const DIAMETERUnitdataCallback_template& other_value)
{
switch(other_value.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:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new DIAMETERUnitdataCallback_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i] = other_value.value_list.list_value[i];
break;
default:
TTCN_error("Copying an unitialized/unsupported @DIAMETER_Emulation.DIAMETERUnitdataCallback template.");
}
set_selection(other_value);
}

DIAMETERUnitdataCallback_template::DIAMETERUnitdataCallback_template()
{
}

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

DIAMETERUnitdataCallback_template::DIAMETERUnitdataCallback_template(DIAMETERUnitdataCallback::function_pointer other_value)
  : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

DIAMETERUnitdataCallback_template::DIAMETERUnitdataCallback_template(const DIAMETERUnitdataCallback& other_value)
  :Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound @DIAMETER_Emulation.DIAMETERUnitdataCallback value.");
single_value = other_value.referred_function;
}

DIAMETERUnitdataCallback_template::DIAMETERUnitdataCallback_template(const OPTIONAL<DIAMETERUnitdataCallback>& other_value)
{
if(other_value.ispresent()) {
set_selection(SPECIFIC_VALUE);
single_value = ((const DIAMETERUnitdataCallback&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
}

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

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

void DIAMETERUnitdataCallback_template::clean_up(){
if(template_selection == VALUE_LIST ||
template_selection == COMPLEMENTED_LIST)
delete[] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}

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

DIAMETERUnitdataCallback_template& DIAMETERUnitdataCallback_template::operator=(DIAMETERUnitdataCallback::function_pointer other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;}

DIAMETERUnitdataCallback_template& DIAMETERUnitdataCallback_template::operator=(const DIAMETERUnitdataCallback& other_value)
{
other_value.must_bound("Assignment of an unbound @DIAMETER_Emulation.DIAMETERUnitdataCallback value to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.referred_function;
return *this;
}

DIAMETERUnitdataCallback_template& DIAMETERUnitdataCallback_template::operator=(const OPTIONAL<DIAMETERUnitdataCallback>& other_value)
{
clean_up();
if(other_value.ispresent()) { 
set_selection(SPECIFIC_VALUE);
single_value = ((const DIAMETERUnitdataCallback&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
return *this;}

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

boolean DIAMETERUnitdataCallback_template::match(DIAMETERUnitdataCallback::function_pointer 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 i = 0; i < value_list.n_values; i++)
if(value_list.list_value[i].match(other_value))
return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching with an unitialized/unsupported @DIAMETER_Emulation.DIAMETERUnitdataCallback template.");
};
return FALSE;
}

boolean DIAMETERUnitdataCallback_template::match(const DIAMETERUnitdataCallback& other_value, boolean) const
{
  if (!other_value.is_bound()) return FALSE;
return match(other_value.referred_function);
}

DIAMETERUnitdataCallback DIAMETERUnitdataCallback_template::valueof() const
{
if(template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific @DIAMETER_Emulation.DIAMETERUnitdataCallback template.");
return single_value;
}

void DIAMETERUnitdataCallback_template::set_type(template_sel template_type, unsigned int list_length)
{
if(template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid type for an @DIAMETER_Emulation.DIAMETERUnitdataCallback template.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DIAMETERUnitdataCallback_template[list_length];
}

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

void DIAMETERUnitdataCallback_template::log() const
{
switch(template_selection) {
case SPECIFIC_VALUE:
Module_List::log_function((genericfunc_t)single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for(unsigned int i = 0; i < value_list.n_values; i++) {
if(i > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[i].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}

void DIAMETERUnitdataCallback_template::log_match(const DIAMETERUnitdataCallback& match_value, boolean legacy) const
{
log();
TTCN_Logger::log_event_str(" with ");
match_value.log();
if(match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void DIAMETERUnitdataCallback_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::encode_function(text_buf, (genericfunc_t)single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @DIAMETER_Emulation.DIAMETERUnitdataCallback.");
}
}

void DIAMETERUnitdataCallback_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::decode_function(text_buf,(genericfunc_t*)&single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new DIAMETERUnitdataCallback_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].decode_text(text_buf);
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @DIAMETER_Emulation.DIAMETERUnitdataCallback.");
}
}

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

boolean DIAMETERUnitdataCallback_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
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 DIAMETERUnitdataCallback_template::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void DIAMETERUnitdataCallback_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 : "@DIAMETER_Emulation.DIAMETERUnitdataCallback");
}

DIAMETEROps::DIAMETEROps()
{
}

DIAMETEROps::DIAMETEROps(const DIAMETERCreateCallback& par_create__cb,
    const DIAMETERUnitdataCallback& par_unitdata__cb,
    const BOOLEAN& par_raw)
  :   field_create__cb(par_create__cb),
  field_unitdata__cb(par_unitdata__cb),
  field_raw(par_raw)
{
}

DIAMETEROps::DIAMETEROps(const DIAMETEROps& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.DIAMETEROps.");
if (other_value.create__cb().is_bound()) field_create__cb = other_value.create__cb();
else field_create__cb.clean_up();
if (other_value.unitdata__cb().is_bound()) field_unitdata__cb = other_value.unitdata__cb();
else field_unitdata__cb.clean_up();
if (other_value.raw().is_bound()) field_raw = other_value.raw();
else field_raw.clean_up();
}

void DIAMETEROps::clean_up()
{
field_create__cb.clean_up();
field_unitdata__cb.clean_up();
field_raw.clean_up();
}

const TTCN_Typedescriptor_t* DIAMETEROps::get_descriptor() const { return &DIAMETEROps_descr_; }
DIAMETEROps& DIAMETEROps::operator=(const DIAMETEROps& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.DIAMETEROps.");
  if (other_value.create__cb().is_bound()) field_create__cb = other_value.create__cb();
  else field_create__cb.clean_up();
  if (other_value.unitdata__cb().is_bound()) field_unitdata__cb = other_value.unitdata__cb();
  else field_unitdata__cb.clean_up();
  if (other_value.raw().is_bound()) field_raw = other_value.raw();
  else field_raw.clean_up();
}
return *this;
}

boolean DIAMETEROps::operator==(const DIAMETEROps& other_value) const
{
return field_create__cb==other_value.field_create__cb
  && field_unitdata__cb==other_value.field_unitdata__cb
  && field_raw==other_value.field_raw;
}

boolean DIAMETEROps::is_bound() const
{
return (field_create__cb.is_bound())
  || (field_unitdata__cb.is_bound())
  || (field_raw.is_bound());
}
boolean DIAMETEROps::is_value() const
{
return field_create__cb.is_value()
  && field_unitdata__cb.is_value()
  && field_raw.is_value();
}
void DIAMETEROps::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ create_cb := ");
field_create__cb.log();
TTCN_Logger::log_event_str(", unitdata_cb := ");
field_unitdata__cb.log();
TTCN_Logger::log_event_str(", raw := ");
field_raw.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETEROps::set_implicit_omit()
{
if (create__cb().is_bound()) create__cb().set_implicit_omit();
if (unitdata__cb().is_bound()) unitdata__cb().set_implicit_omit();
if (raw().is_bound()) raw().set_implicit_omit();
}

void DIAMETEROps::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 @DIAMETER_Emulation.DIAMETEROps 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) create__cb().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unitdata__cb().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) raw().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(), "create_cb")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          create__cb().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(), "unitdata_cb")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unitdata__cb().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(), "raw")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raw().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 @DIAMETER_Emulation.DIAMETEROps: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@DIAMETER_Emulation.DIAMETEROps");
  }
}

void DIAMETEROps::encode_text(Text_Buf& text_buf) const
{
field_create__cb.encode_text(text_buf);
field_unitdata__cb.encode_text(text_buf);
field_raw.encode_text(text_buf);
}

void DIAMETEROps::decode_text(Text_Buf& text_buf)
{
field_create__cb.decode_text(text_buf);
field_unitdata__cb.decode_text(text_buf);
field_raw.decode_text(text_buf);
}

struct DIAMETEROps_template::single_value_struct {
DIAMETERCreateCallback_template field_create__cb;
DIAMETERUnitdataCallback_template field_unitdata__cb;
BOOLEAN_template field_raw;
};

void DIAMETEROps_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_create__cb = ANY_VALUE;
single_value->field_unitdata__cb = ANY_VALUE;
single_value->field_raw = ANY_VALUE;
}
}
}

void DIAMETEROps_template::copy_value(const DIAMETEROps& other_value)
{
single_value = new single_value_struct;
if (other_value.create__cb().is_bound()) {
  single_value->field_create__cb = other_value.create__cb();
} else {
  single_value->field_create__cb.clean_up();
}
if (other_value.unitdata__cb().is_bound()) {
  single_value->field_unitdata__cb = other_value.unitdata__cb();
} else {
  single_value->field_unitdata__cb.clean_up();
}
if (other_value.raw().is_bound()) {
  single_value->field_raw = other_value.raw();
} else {
  single_value->field_raw.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DIAMETEROps_template::copy_template(const DIAMETEROps_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.create__cb().get_selection()) {
single_value->field_create__cb = other_value.create__cb();
} else {
single_value->field_create__cb.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unitdata__cb().get_selection()) {
single_value->field_unitdata__cb = other_value.unitdata__cb();
} else {
single_value->field_unitdata__cb.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.raw().get_selection()) {
single_value->field_raw = other_value.raw();
} else {
single_value->field_raw.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 DIAMETEROps_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 DIAMETEROps_template(*other_value.implication_.precondition);
implication_.implied_template = new DIAMETEROps_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 @DIAMETER_Emulation.DIAMETEROps.");
break;
}
set_selection(other_value);
}

DIAMETEROps_template::DIAMETEROps_template()
{
}

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

DIAMETEROps_template::DIAMETEROps_template(const DIAMETEROps& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DIAMETEROps_template::match(const DIAMETEROps& 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.create__cb().is_bound()) return FALSE;
if(!single_value->field_create__cb.match(other_value.create__cb(), legacy))return FALSE;
if(!other_value.unitdata__cb().is_bound()) return FALSE;
if(!single_value->field_unitdata__cb.match(other_value.unitdata__cb(), legacy))return FALSE;
if(!other_value.raw().is_bound()) return FALSE;
if(!single_value->field_raw.match(other_value.raw(), 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 @DIAMETER_Emulation.DIAMETEROps.");
}
return FALSE;
}

boolean DIAMETEROps_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_create__cb.is_bound()
 || single_value->field_unitdata__cb.is_bound()
 || single_value->field_raw.is_bound();
}

boolean DIAMETEROps_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_create__cb.is_value()
 && single_value->field_unitdata__cb.is_value()
 && single_value->field_raw.is_value();
}

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

DIAMETEROps DIAMETEROps_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 @DIAMETER_Emulation.DIAMETEROps.");
DIAMETEROps ret_val;
if (single_value->field_create__cb.is_bound()) {
ret_val.create__cb() = single_value->field_create__cb.valueof();
}
if (single_value->field_unitdata__cb.is_bound()) {
ret_val.unitdata__cb() = single_value->field_unitdata__cb.valueof();
}
if (single_value->field_raw.is_bound()) {
ret_val.raw() = single_value->field_raw.valueof();
}
return ret_val;
}

void DIAMETEROps_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 @DIAMETER_Emulation.DIAMETEROps.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DIAMETEROps_template[list_length];
}

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

DIAMETERCreateCallback_template& DIAMETEROps_template::create__cb()
{
set_specific();
return single_value->field_create__cb;
}

const DIAMETERCreateCallback_template& DIAMETEROps_template::create__cb() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field create_cb of a non-specific template of type @DIAMETER_Emulation.DIAMETEROps.");
return single_value->field_create__cb;
}

DIAMETERUnitdataCallback_template& DIAMETEROps_template::unitdata__cb()
{
set_specific();
return single_value->field_unitdata__cb;
}

const DIAMETERUnitdataCallback_template& DIAMETEROps_template::unitdata__cb() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unitdata_cb of a non-specific template of type @DIAMETER_Emulation.DIAMETEROps.");
return single_value->field_unitdata__cb;
}

BOOLEAN_template& DIAMETEROps_template::raw()
{
set_specific();
return single_value->field_raw;
}

const BOOLEAN_template& DIAMETEROps_template::raw() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field raw of a non-specific template of type @DIAMETER_Emulation.DIAMETEROps.");
return single_value->field_raw;
}

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

void DIAMETEROps_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ create_cb := ");
single_value->field_create__cb.log();
TTCN_Logger::log_event_str(", unitdata_cb := ");
single_value->field_unitdata__cb.log();
TTCN_Logger::log_event_str(", raw := ");
single_value->field_raw.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 DIAMETEROps_template::log_match(const DIAMETEROps& 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_create__cb.match(match_value.create__cb(), legacy)){
TTCN_Logger::log_logmatch_info(".create_cb");
single_value->field_create__cb.log_match(match_value.create__cb(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_unitdata__cb.match(match_value.unitdata__cb(), legacy)){
TTCN_Logger::log_logmatch_info(".unitdata_cb");
single_value->field_unitdata__cb.log_match(match_value.unitdata__cb(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_raw.match(match_value.raw(), legacy)){
TTCN_Logger::log_logmatch_info(".raw");
single_value->field_raw.log_match(match_value.raw(), 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("{ create_cb := ");
single_value->field_create__cb.log_match(match_value.create__cb(), legacy);
TTCN_Logger::log_event_str(", unitdata_cb := ");
single_value->field_unitdata__cb.log_match(match_value.unitdata__cb(), legacy);
TTCN_Logger::log_event_str(", raw := ");
single_value->field_raw.log_match(match_value.raw(), 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 DIAMETEROps_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (create__cb().is_bound()) create__cb().set_implicit_omit();
if (unitdata__cb().is_bound()) unitdata__cb().set_implicit_omit();
if (raw().is_bound()) raw().set_implicit_omit();
}

void DIAMETEROps_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_create__cb.encode_text(text_buf);
single_value->field_unitdata__cb.encode_text(text_buf);
single_value->field_raw.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 @DIAMETER_Emulation.DIAMETEROps.");
}
}

void DIAMETEROps_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_create__cb.decode_text(text_buf);
single_value->field_unitdata__cb.decode_text(text_buf);
single_value->field_raw.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 DIAMETEROps_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 @DIAMETER_Emulation.DIAMETEROps.");
}
}

void DIAMETEROps_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: {
    DIAMETEROps_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 @DIAMETER_Emulation.DIAMETEROps 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) create__cb().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) unitdata__cb().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) raw().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(), "create_cb")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          create__cb().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(), "unitdata_cb")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unitdata__cb().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(), "raw")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raw().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 @DIAMETER_Emulation.DIAMETEROps: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DIAMETEROps_template* precondition = new DIAMETEROps_template;
    precondition->set_param(*param.get_elem(0));
    DIAMETEROps_template* implied_template = new DIAMETEROps_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DIAMETEROps_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.DIAMETEROps");
  }
  is_ifpresent = param.get_ifpresent();
}

void DIAMETEROps_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_create__cb.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETEROps");
single_value->field_unitdata__cb.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETEROps");
single_value->field_raw.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETEROps");
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 : "@DIAMETER_Emulation.DIAMETEROps");
}

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

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

DIAMETER__conn__parameters::DIAMETER__conn__parameters()
{
}

DIAMETER__conn__parameters::DIAMETER__conn__parameters(const CHARSTRING& par_remote__ip,
    const INTEGER& par_remote__sctp__port,
    const CHARSTRING& par_local__ip,
    const INTEGER& par_local__sctp__port,
    const CHARSTRING& par_origin__host,
    const CHARSTRING& par_origin__realm,
    const OPTIONAL< INTEGER >& par_auth__app__id,
    const OPTIONAL< INTEGER >& par_vendor__app__id)
  :   field_remote__ip(par_remote__ip),
  field_remote__sctp__port(par_remote__sctp__port),
  field_local__ip(par_local__ip),
  field_local__sctp__port(par_local__sctp__port),
  field_origin__host(par_origin__host),
  field_origin__realm(par_origin__realm),
  field_auth__app__id(par_auth__app__id),
  field_vendor__app__id(par_vendor__app__id)
{
}

DIAMETER__conn__parameters::DIAMETER__conn__parameters(const DIAMETER__conn__parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
if (other_value.remote__ip().is_bound()) field_remote__ip = other_value.remote__ip();
else field_remote__ip.clean_up();
if (other_value.remote__sctp__port().is_bound()) field_remote__sctp__port = other_value.remote__sctp__port();
else field_remote__sctp__port.clean_up();
if (other_value.local__ip().is_bound()) field_local__ip = other_value.local__ip();
else field_local__ip.clean_up();
if (other_value.local__sctp__port().is_bound()) field_local__sctp__port = other_value.local__sctp__port();
else field_local__sctp__port.clean_up();
if (other_value.origin__host().is_bound()) field_origin__host = other_value.origin__host();
else field_origin__host.clean_up();
if (other_value.origin__realm().is_bound()) field_origin__realm = other_value.origin__realm();
else field_origin__realm.clean_up();
if (other_value.auth__app__id().is_bound()) field_auth__app__id = other_value.auth__app__id();
else field_auth__app__id.clean_up();
if (other_value.vendor__app__id().is_bound()) field_vendor__app__id = other_value.vendor__app__id();
else field_vendor__app__id.clean_up();
}

void DIAMETER__conn__parameters::clean_up()
{
field_remote__ip.clean_up();
field_remote__sctp__port.clean_up();
field_local__ip.clean_up();
field_local__sctp__port.clean_up();
field_origin__host.clean_up();
field_origin__realm.clean_up();
field_auth__app__id.clean_up();
field_vendor__app__id.clean_up();
}

const TTCN_Typedescriptor_t* DIAMETER__conn__parameters::get_descriptor() const { return &DIAMETER__conn__parameters_descr_; }
DIAMETER__conn__parameters& DIAMETER__conn__parameters::operator=(const DIAMETER__conn__parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
  if (other_value.remote__ip().is_bound()) field_remote__ip = other_value.remote__ip();
  else field_remote__ip.clean_up();
  if (other_value.remote__sctp__port().is_bound()) field_remote__sctp__port = other_value.remote__sctp__port();
  else field_remote__sctp__port.clean_up();
  if (other_value.local__ip().is_bound()) field_local__ip = other_value.local__ip();
  else field_local__ip.clean_up();
  if (other_value.local__sctp__port().is_bound()) field_local__sctp__port = other_value.local__sctp__port();
  else field_local__sctp__port.clean_up();
  if (other_value.origin__host().is_bound()) field_origin__host = other_value.origin__host();
  else field_origin__host.clean_up();
  if (other_value.origin__realm().is_bound()) field_origin__realm = other_value.origin__realm();
  else field_origin__realm.clean_up();
  if (other_value.auth__app__id().is_bound()) field_auth__app__id = other_value.auth__app__id();
  else field_auth__app__id.clean_up();
  if (other_value.vendor__app__id().is_bound()) field_vendor__app__id = other_value.vendor__app__id();
  else field_vendor__app__id.clean_up();
}
return *this;
}

boolean DIAMETER__conn__parameters::operator==(const DIAMETER__conn__parameters& other_value) const
{
return field_remote__ip==other_value.field_remote__ip
  && field_remote__sctp__port==other_value.field_remote__sctp__port
  && field_local__ip==other_value.field_local__ip
  && field_local__sctp__port==other_value.field_local__sctp__port
  && field_origin__host==other_value.field_origin__host
  && field_origin__realm==other_value.field_origin__realm
  && field_auth__app__id==other_value.field_auth__app__id
  && field_vendor__app__id==other_value.field_vendor__app__id;
}

boolean DIAMETER__conn__parameters::is_bound() const
{
return (field_remote__ip.is_bound())
  || (field_remote__sctp__port.is_bound())
  || (field_local__ip.is_bound())
  || (field_local__sctp__port.is_bound())
  || (field_origin__host.is_bound())
  || (field_origin__realm.is_bound())
  || (OPTIONAL_OMIT == field_auth__app__id.get_selection() || field_auth__app__id.is_bound())
  || (OPTIONAL_OMIT == field_vendor__app__id.get_selection() || field_vendor__app__id.is_bound());
}
boolean DIAMETER__conn__parameters::is_value() const
{
return field_remote__ip.is_value()
  && field_remote__sctp__port.is_value()
  && field_local__ip.is_value()
  && field_local__sctp__port.is_value()
  && field_origin__host.is_value()
  && field_origin__realm.is_value()
  && (OPTIONAL_OMIT == field_auth__app__id.get_selection() || field_auth__app__id.is_value())
  && (OPTIONAL_OMIT == field_vendor__app__id.get_selection() || field_vendor__app__id.is_value());
}
int DIAMETER__conn__parameters::size_of() const
{
  int ret_val = 6;
  if (field_auth__app__id.ispresent()) ret_val++;
  if (field_vendor__app__id.ispresent()) ret_val++;
  return ret_val;
}

void DIAMETER__conn__parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ remote_ip := ");
field_remote__ip.log();
TTCN_Logger::log_event_str(", remote_sctp_port := ");
field_remote__sctp__port.log();
TTCN_Logger::log_event_str(", local_ip := ");
field_local__ip.log();
TTCN_Logger::log_event_str(", local_sctp_port := ");
field_local__sctp__port.log();
TTCN_Logger::log_event_str(", origin_host := ");
field_origin__host.log();
TTCN_Logger::log_event_str(", origin_realm := ");
field_origin__realm.log();
TTCN_Logger::log_event_str(", auth_app_id := ");
field_auth__app__id.log();
TTCN_Logger::log_event_str(", vendor_app_id := ");
field_vendor__app__id.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETER__conn__parameters::set_implicit_omit()
{
if (remote__ip().is_bound()) remote__ip().set_implicit_omit();
if (remote__sctp__port().is_bound()) remote__sctp__port().set_implicit_omit();
if (local__ip().is_bound()) local__ip().set_implicit_omit();
if (local__sctp__port().is_bound()) local__sctp__port().set_implicit_omit();
if (origin__host().is_bound()) origin__host().set_implicit_omit();
if (origin__realm().is_bound()) origin__realm().set_implicit_omit();
if (!auth__app__id().is_bound()) auth__app__id() = OMIT_VALUE;
else auth__app__id().set_implicit_omit();
if (!vendor__app__id().is_bound()) vendor__app__id() = OMIT_VALUE;
else vendor__app__id().set_implicit_omit();
}

void DIAMETER__conn__parameters::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 @DIAMETER_Emulation.DIAMETER_conn_parameters 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) remote__ip().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remote__sctp__port().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__ip().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) local__sctp__port().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) origin__host().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) origin__realm().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) auth__app__id().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) vendor__app__id().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(), "remote_ip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remote__ip().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(), "remote_sctp_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remote__sctp__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_ip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__ip().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_sctp_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__sctp__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "origin_host")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          origin__host().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(), "origin_realm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          origin__realm().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(), "auth_app_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          auth__app__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(), "vendor_app_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vendor__app__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 @DIAMETER_Emulation.DIAMETER_conn_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@DIAMETER_Emulation.DIAMETER_conn_parameters");
  }
}

void DIAMETER__conn__parameters::encode_text(Text_Buf& text_buf) const
{
field_remote__ip.encode_text(text_buf);
field_remote__sctp__port.encode_text(text_buf);
field_local__ip.encode_text(text_buf);
field_local__sctp__port.encode_text(text_buf);
field_origin__host.encode_text(text_buf);
field_origin__realm.encode_text(text_buf);
field_auth__app__id.encode_text(text_buf);
field_vendor__app__id.encode_text(text_buf);
}

void DIAMETER__conn__parameters::decode_text(Text_Buf& text_buf)
{
field_remote__ip.decode_text(text_buf);
field_remote__sctp__port.decode_text(text_buf);
field_local__ip.decode_text(text_buf);
field_local__sctp__port.decode_text(text_buf);
field_origin__host.decode_text(text_buf);
field_origin__realm.decode_text(text_buf);
field_auth__app__id.decode_text(text_buf);
field_vendor__app__id.decode_text(text_buf);
}

struct DIAMETER__conn__parameters_template::single_value_struct {
CHARSTRING_template field_remote__ip;
INTEGER_template field_remote__sctp__port;
CHARSTRING_template field_local__ip;
INTEGER_template field_local__sctp__port;
CHARSTRING_template field_origin__host;
CHARSTRING_template field_origin__realm;
INTEGER_template field_auth__app__id;
INTEGER_template field_vendor__app__id;
};

void DIAMETER__conn__parameters_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_remote__ip = ANY_VALUE;
single_value->field_remote__sctp__port = ANY_VALUE;
single_value->field_local__ip = ANY_VALUE;
single_value->field_local__sctp__port = ANY_VALUE;
single_value->field_origin__host = ANY_VALUE;
single_value->field_origin__realm = ANY_VALUE;
single_value->field_auth__app__id = ANY_OR_OMIT;
single_value->field_vendor__app__id = ANY_OR_OMIT;
}
}
}

void DIAMETER__conn__parameters_template::copy_value(const DIAMETER__conn__parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.remote__ip().is_bound()) {
  single_value->field_remote__ip = other_value.remote__ip();
} else {
  single_value->field_remote__ip.clean_up();
}
if (other_value.remote__sctp__port().is_bound()) {
  single_value->field_remote__sctp__port = other_value.remote__sctp__port();
} else {
  single_value->field_remote__sctp__port.clean_up();
}
if (other_value.local__ip().is_bound()) {
  single_value->field_local__ip = other_value.local__ip();
} else {
  single_value->field_local__ip.clean_up();
}
if (other_value.local__sctp__port().is_bound()) {
  single_value->field_local__sctp__port = other_value.local__sctp__port();
} else {
  single_value->field_local__sctp__port.clean_up();
}
if (other_value.origin__host().is_bound()) {
  single_value->field_origin__host = other_value.origin__host();
} else {
  single_value->field_origin__host.clean_up();
}
if (other_value.origin__realm().is_bound()) {
  single_value->field_origin__realm = other_value.origin__realm();
} else {
  single_value->field_origin__realm.clean_up();
}
if (other_value.auth__app__id().is_bound()) {
  if (other_value.auth__app__id().ispresent()) single_value->field_auth__app__id = other_value.auth__app__id()();
  else single_value->field_auth__app__id = OMIT_VALUE;
} else {
  single_value->field_auth__app__id.clean_up();
}
if (other_value.vendor__app__id().is_bound()) {
  if (other_value.vendor__app__id().ispresent()) single_value->field_vendor__app__id = other_value.vendor__app__id()();
  else single_value->field_vendor__app__id = OMIT_VALUE;
} else {
  single_value->field_vendor__app__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DIAMETER__conn__parameters_template::copy_template(const DIAMETER__conn__parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.remote__ip().get_selection()) {
single_value->field_remote__ip = other_value.remote__ip();
} else {
single_value->field_remote__ip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.remote__sctp__port().get_selection()) {
single_value->field_remote__sctp__port = other_value.remote__sctp__port();
} else {
single_value->field_remote__sctp__port.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__ip().get_selection()) {
single_value->field_local__ip = other_value.local__ip();
} else {
single_value->field_local__ip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__sctp__port().get_selection()) {
single_value->field_local__sctp__port = other_value.local__sctp__port();
} else {
single_value->field_local__sctp__port.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.origin__host().get_selection()) {
single_value->field_origin__host = other_value.origin__host();
} else {
single_value->field_origin__host.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.origin__realm().get_selection()) {
single_value->field_origin__realm = other_value.origin__realm();
} else {
single_value->field_origin__realm.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.auth__app__id().get_selection()) {
single_value->field_auth__app__id = other_value.auth__app__id();
} else {
single_value->field_auth__app__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vendor__app__id().get_selection()) {
single_value->field_vendor__app__id = other_value.vendor__app__id();
} else {
single_value->field_vendor__app__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 DIAMETER__conn__parameters_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 DIAMETER__conn__parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new DIAMETER__conn__parameters_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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
break;
}
set_selection(other_value);
}

DIAMETER__conn__parameters_template::DIAMETER__conn__parameters_template()
{
}

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

DIAMETER__conn__parameters_template::DIAMETER__conn__parameters_template(const DIAMETER__conn__parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DIAMETER__conn__parameters_template::match(const DIAMETER__conn__parameters& 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.remote__ip().is_bound()) return FALSE;
if(!single_value->field_remote__ip.match(other_value.remote__ip(), legacy))return FALSE;
if(!other_value.remote__sctp__port().is_bound()) return FALSE;
if(!single_value->field_remote__sctp__port.match(other_value.remote__sctp__port(), legacy))return FALSE;
if(!other_value.local__ip().is_bound()) return FALSE;
if(!single_value->field_local__ip.match(other_value.local__ip(), legacy))return FALSE;
if(!other_value.local__sctp__port().is_bound()) return FALSE;
if(!single_value->field_local__sctp__port.match(other_value.local__sctp__port(), legacy))return FALSE;
if(!other_value.origin__host().is_bound()) return FALSE;
if(!single_value->field_origin__host.match(other_value.origin__host(), legacy))return FALSE;
if(!other_value.origin__realm().is_bound()) return FALSE;
if(!single_value->field_origin__realm.match(other_value.origin__realm(), legacy))return FALSE;
if(!other_value.auth__app__id().is_bound()) return FALSE;
if((other_value.auth__app__id().ispresent() ? !single_value->field_auth__app__id.match((const INTEGER&)other_value.auth__app__id(), legacy) : !single_value->field_auth__app__id.match_omit(legacy)))return FALSE;
if(!other_value.vendor__app__id().is_bound()) return FALSE;
if((other_value.vendor__app__id().ispresent() ? !single_value->field_vendor__app__id.match((const INTEGER&)other_value.vendor__app__id(), legacy) : !single_value->field_vendor__app__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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
}
return FALSE;
}

boolean DIAMETER__conn__parameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_remote__ip.is_bound()
 || single_value->field_remote__sctp__port.is_bound()
 || single_value->field_local__ip.is_bound()
 || single_value->field_local__sctp__port.is_bound()
 || single_value->field_origin__host.is_bound()
 || single_value->field_origin__realm.is_bound()
 || (single_value->field_auth__app__id.is_omit() || single_value->field_auth__app__id.is_bound())
 || (single_value->field_vendor__app__id.is_omit() || single_value->field_vendor__app__id.is_bound());
}

boolean DIAMETER__conn__parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_remote__ip.is_value()
 && single_value->field_remote__sctp__port.is_value()
 && single_value->field_local__ip.is_value()
 && single_value->field_local__sctp__port.is_value()
 && single_value->field_origin__host.is_value()
 && single_value->field_origin__realm.is_value()
 && (single_value->field_auth__app__id.is_omit() || single_value->field_auth__app__id.is_value())
 && (single_value->field_vendor__app__id.is_omit() || single_value->field_vendor__app__id.is_value());
}

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

DIAMETER__conn__parameters DIAMETER__conn__parameters_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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
DIAMETER__conn__parameters ret_val;
if (single_value->field_remote__ip.is_bound()) {
ret_val.remote__ip() = single_value->field_remote__ip.valueof();
}
if (single_value->field_remote__sctp__port.is_bound()) {
ret_val.remote__sctp__port() = single_value->field_remote__sctp__port.valueof();
}
if (single_value->field_local__ip.is_bound()) {
ret_val.local__ip() = single_value->field_local__ip.valueof();
}
if (single_value->field_local__sctp__port.is_bound()) {
ret_val.local__sctp__port() = single_value->field_local__sctp__port.valueof();
}
if (single_value->field_origin__host.is_bound()) {
ret_val.origin__host() = single_value->field_origin__host.valueof();
}
if (single_value->field_origin__realm.is_bound()) {
ret_val.origin__realm() = single_value->field_origin__realm.valueof();
}
if (single_value->field_auth__app__id.is_omit()) ret_val.auth__app__id() = OMIT_VALUE;
else if (single_value->field_auth__app__id.is_bound()) {
ret_val.auth__app__id() = single_value->field_auth__app__id.valueof();
}
if (single_value->field_vendor__app__id.is_omit()) ret_val.vendor__app__id() = OMIT_VALUE;
else if (single_value->field_vendor__app__id.is_bound()) {
ret_val.vendor__app__id() = single_value->field_vendor__app__id.valueof();
}
return ret_val;
}

void DIAMETER__conn__parameters_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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DIAMETER__conn__parameters_template[list_length];
}

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

CHARSTRING_template& DIAMETER__conn__parameters_template::remote__ip()
{
set_specific();
return single_value->field_remote__ip;
}

const CHARSTRING_template& DIAMETER__conn__parameters_template::remote__ip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field remote_ip of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_remote__ip;
}

INTEGER_template& DIAMETER__conn__parameters_template::remote__sctp__port()
{
set_specific();
return single_value->field_remote__sctp__port;
}

const INTEGER_template& DIAMETER__conn__parameters_template::remote__sctp__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field remote_sctp_port of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_remote__sctp__port;
}

CHARSTRING_template& DIAMETER__conn__parameters_template::local__ip()
{
set_specific();
return single_value->field_local__ip;
}

const CHARSTRING_template& DIAMETER__conn__parameters_template::local__ip() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_ip of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_local__ip;
}

INTEGER_template& DIAMETER__conn__parameters_template::local__sctp__port()
{
set_specific();
return single_value->field_local__sctp__port;
}

const INTEGER_template& DIAMETER__conn__parameters_template::local__sctp__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_sctp_port of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_local__sctp__port;
}

CHARSTRING_template& DIAMETER__conn__parameters_template::origin__host()
{
set_specific();
return single_value->field_origin__host;
}

const CHARSTRING_template& DIAMETER__conn__parameters_template::origin__host() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field origin_host of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_origin__host;
}

CHARSTRING_template& DIAMETER__conn__parameters_template::origin__realm()
{
set_specific();
return single_value->field_origin__realm;
}

const CHARSTRING_template& DIAMETER__conn__parameters_template::origin__realm() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field origin_realm of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_origin__realm;
}

INTEGER_template& DIAMETER__conn__parameters_template::auth__app__id()
{
set_specific();
return single_value->field_auth__app__id;
}

const INTEGER_template& DIAMETER__conn__parameters_template::auth__app__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field auth_app_id of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_auth__app__id;
}

INTEGER_template& DIAMETER__conn__parameters_template::vendor__app__id()
{
set_specific();
return single_value->field_vendor__app__id;
}

const INTEGER_template& DIAMETER__conn__parameters_template::vendor__app__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vendor_app_id of a non-specific template of type @DIAMETER_Emulation.DIAMETER_conn_parameters.");
return single_value->field_vendor__app__id;
}

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

void DIAMETER__conn__parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ remote_ip := ");
single_value->field_remote__ip.log();
TTCN_Logger::log_event_str(", remote_sctp_port := ");
single_value->field_remote__sctp__port.log();
TTCN_Logger::log_event_str(", local_ip := ");
single_value->field_local__ip.log();
TTCN_Logger::log_event_str(", local_sctp_port := ");
single_value->field_local__sctp__port.log();
TTCN_Logger::log_event_str(", origin_host := ");
single_value->field_origin__host.log();
TTCN_Logger::log_event_str(", origin_realm := ");
single_value->field_origin__realm.log();
TTCN_Logger::log_event_str(", auth_app_id := ");
single_value->field_auth__app__id.log();
TTCN_Logger::log_event_str(", vendor_app_id := ");
single_value->field_vendor__app__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 DIAMETER__conn__parameters_template::log_match(const DIAMETER__conn__parameters& 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_remote__ip.match(match_value.remote__ip(), legacy)){
TTCN_Logger::log_logmatch_info(".remote_ip");
single_value->field_remote__ip.log_match(match_value.remote__ip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_remote__sctp__port.match(match_value.remote__sctp__port(), legacy)){
TTCN_Logger::log_logmatch_info(".remote_sctp_port");
single_value->field_remote__sctp__port.log_match(match_value.remote__sctp__port(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__ip.match(match_value.local__ip(), legacy)){
TTCN_Logger::log_logmatch_info(".local_ip");
single_value->field_local__ip.log_match(match_value.local__ip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__sctp__port.match(match_value.local__sctp__port(), legacy)){
TTCN_Logger::log_logmatch_info(".local_sctp_port");
single_value->field_local__sctp__port.log_match(match_value.local__sctp__port(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_origin__host.match(match_value.origin__host(), legacy)){
TTCN_Logger::log_logmatch_info(".origin_host");
single_value->field_origin__host.log_match(match_value.origin__host(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_origin__realm.match(match_value.origin__realm(), legacy)){
TTCN_Logger::log_logmatch_info(".origin_realm");
single_value->field_origin__realm.log_match(match_value.origin__realm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.auth__app__id().ispresent()){
if(!single_value->field_auth__app__id.match(match_value.auth__app__id(), legacy)){
TTCN_Logger::log_logmatch_info(".auth_app_id");
single_value->field_auth__app__id.log_match(match_value.auth__app__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_auth__app__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".auth_app_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_auth__app__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.vendor__app__id().ispresent()){
if(!single_value->field_vendor__app__id.match(match_value.vendor__app__id(), legacy)){
TTCN_Logger::log_logmatch_info(".vendor_app_id");
single_value->field_vendor__app__id.log_match(match_value.vendor__app__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_vendor__app__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".vendor_app_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_vendor__app__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("{ remote_ip := ");
single_value->field_remote__ip.log_match(match_value.remote__ip(), legacy);
TTCN_Logger::log_event_str(", remote_sctp_port := ");
single_value->field_remote__sctp__port.log_match(match_value.remote__sctp__port(), legacy);
TTCN_Logger::log_event_str(", local_ip := ");
single_value->field_local__ip.log_match(match_value.local__ip(), legacy);
TTCN_Logger::log_event_str(", local_sctp_port := ");
single_value->field_local__sctp__port.log_match(match_value.local__sctp__port(), legacy);
TTCN_Logger::log_event_str(", origin_host := ");
single_value->field_origin__host.log_match(match_value.origin__host(), legacy);
TTCN_Logger::log_event_str(", origin_realm := ");
single_value->field_origin__realm.log_match(match_value.origin__realm(), legacy);
TTCN_Logger::log_event_str(", auth_app_id := ");
if (match_value.auth__app__id().ispresent()) {
single_value->field_auth__app__id.log_match(match_value.auth__app__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_auth__app__id.log();
if (single_value->field_auth__app__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vendor_app_id := ");
if (match_value.vendor__app__id().ispresent()) {
single_value->field_vendor__app__id.log_match(match_value.vendor__app__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_vendor__app__id.log();
if (single_value->field_vendor__app__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 DIAMETER__conn__parameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (remote__ip().is_bound()) remote__ip().set_implicit_omit();
if (remote__sctp__port().is_bound()) remote__sctp__port().set_implicit_omit();
if (local__ip().is_bound()) local__ip().set_implicit_omit();
if (local__sctp__port().is_bound()) local__sctp__port().set_implicit_omit();
if (origin__host().is_bound()) origin__host().set_implicit_omit();
if (origin__realm().is_bound()) origin__realm().set_implicit_omit();
if (!auth__app__id().is_bound()) auth__app__id() = OMIT_VALUE;
else auth__app__id().set_implicit_omit();
if (!vendor__app__id().is_bound()) vendor__app__id() = OMIT_VALUE;
else vendor__app__id().set_implicit_omit();
}

void DIAMETER__conn__parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_remote__ip.encode_text(text_buf);
single_value->field_remote__sctp__port.encode_text(text_buf);
single_value->field_local__ip.encode_text(text_buf);
single_value->field_local__sctp__port.encode_text(text_buf);
single_value->field_origin__host.encode_text(text_buf);
single_value->field_origin__realm.encode_text(text_buf);
single_value->field_auth__app__id.encode_text(text_buf);
single_value->field_vendor__app__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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
}
}

void DIAMETER__conn__parameters_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_remote__ip.decode_text(text_buf);
single_value->field_remote__sctp__port.decode_text(text_buf);
single_value->field_local__ip.decode_text(text_buf);
single_value->field_local__sctp__port.decode_text(text_buf);
single_value->field_origin__host.decode_text(text_buf);
single_value->field_origin__realm.decode_text(text_buf);
single_value->field_auth__app__id.decode_text(text_buf);
single_value->field_vendor__app__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 DIAMETER__conn__parameters_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 @DIAMETER_Emulation.DIAMETER_conn_parameters.");
}
}

void DIAMETER__conn__parameters_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: {
    DIAMETER__conn__parameters_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 @DIAMETER_Emulation.DIAMETER_conn_parameters 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) remote__ip().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remote__sctp__port().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__ip().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) local__sctp__port().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) origin__host().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) origin__realm().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) auth__app__id().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) vendor__app__id().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(), "remote_ip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remote__ip().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(), "remote_sctp_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remote__sctp__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_ip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__ip().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_sctp_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__sctp__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "origin_host")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          origin__host().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(), "origin_realm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          origin__realm().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(), "auth_app_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          auth__app__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(), "vendor_app_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vendor__app__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 @DIAMETER_Emulation.DIAMETER_conn_parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DIAMETER__conn__parameters_template* precondition = new DIAMETER__conn__parameters_template;
    precondition->set_param(*param.get_elem(0));
    DIAMETER__conn__parameters_template* implied_template = new DIAMETER__conn__parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DIAMETER__conn__parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.DIAMETER_conn_parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void DIAMETER__conn__parameters_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_remote__ip.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_remote__sctp__port.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_local__ip.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_local__sctp__port.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_origin__host.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_origin__realm.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_auth__app__id.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
single_value->field_vendor__app__id.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
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 : "@DIAMETER_Emulation.DIAMETER_conn_parameters");
}

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

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

ExpectDataE2EID::ExpectDataE2EID()
{
}

ExpectDataE2EID::ExpectDataE2EID(const OPTIONAL< OCTETSTRING >& par_ete__id,
    const COMPONENT& par_vc__conn)
  :   field_ete__id(par_ete__id),
  field_vc__conn(par_vc__conn)
{
}

ExpectDataE2EID::ExpectDataE2EID(const ExpectDataE2EID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @DIAMETER_Emulation.ExpectDataE2EID.");
if (other_value.ete__id().is_bound()) field_ete__id = other_value.ete__id();
else field_ete__id.clean_up();
if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
else field_vc__conn.clean_up();
}

void ExpectDataE2EID::clean_up()
{
field_ete__id.clean_up();
field_vc__conn.clean_up();
}

const TTCN_Typedescriptor_t* ExpectDataE2EID::get_descriptor() const { return &ExpectDataE2EID_descr_; }
ExpectDataE2EID& ExpectDataE2EID::operator=(const ExpectDataE2EID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @DIAMETER_Emulation.ExpectDataE2EID.");
  if (other_value.ete__id().is_bound()) field_ete__id = other_value.ete__id();
  else field_ete__id.clean_up();
  if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
  else field_vc__conn.clean_up();
}
return *this;
}

boolean ExpectDataE2EID::operator==(const ExpectDataE2EID& other_value) const
{
return field_ete__id==other_value.field_ete__id
  && field_vc__conn==other_value.field_vc__conn;
}

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

void ExpectDataE2EID::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ete_id := ");
field_ete__id.log();
TTCN_Logger::log_event_str(", vc_conn := ");
field_vc__conn.log();
TTCN_Logger::log_event_str(" }");
}

void ExpectDataE2EID::set_implicit_omit()
{
if (!ete__id().is_bound()) ete__id() = OMIT_VALUE;
else ete__id().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

void ExpectDataE2EID::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 @DIAMETER_Emulation.ExpectDataE2EID 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) ete__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vc__conn().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(), "ete_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ete__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(), "vc_conn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__conn().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 @DIAMETER_Emulation.ExpectDataE2EID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@DIAMETER_Emulation.ExpectDataE2EID");
  }
}

void ExpectDataE2EID::encode_text(Text_Buf& text_buf) const
{
field_ete__id.encode_text(text_buf);
field_vc__conn.encode_text(text_buf);
}

void ExpectDataE2EID::decode_text(Text_Buf& text_buf)
{
field_ete__id.decode_text(text_buf);
field_vc__conn.decode_text(text_buf);
}

struct ExpectDataE2EID_template::single_value_struct {
OCTETSTRING_template field_ete__id;
COMPONENT_template field_vc__conn;
};

void ExpectDataE2EID_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_ete__id = ANY_OR_OMIT;
single_value->field_vc__conn = ANY_VALUE;
}
}
}

void ExpectDataE2EID_template::copy_value(const ExpectDataE2EID& other_value)
{
single_value = new single_value_struct;
if (other_value.ete__id().is_bound()) {
  if (other_value.ete__id().ispresent()) single_value->field_ete__id = other_value.ete__id()();
  else single_value->field_ete__id = OMIT_VALUE;
} else {
  single_value->field_ete__id.clean_up();
}
if (other_value.vc__conn().is_bound()) {
  single_value->field_vc__conn = other_value.vc__conn();
} else {
  single_value->field_vc__conn.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ExpectDataE2EID_template::copy_template(const ExpectDataE2EID_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ete__id().get_selection()) {
single_value->field_ete__id = other_value.ete__id();
} else {
single_value->field_ete__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vc__conn().get_selection()) {
single_value->field_vc__conn = other_value.vc__conn();
} else {
single_value->field_vc__conn.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 ExpectDataE2EID_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 ExpectDataE2EID_template(*other_value.implication_.precondition);
implication_.implied_template = new ExpectDataE2EID_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 @DIAMETER_Emulation.ExpectDataE2EID.");
break;
}
set_selection(other_value);
}

ExpectDataE2EID_template::ExpectDataE2EID_template()
{
}

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

ExpectDataE2EID_template::ExpectDataE2EID_template(const ExpectDataE2EID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ExpectDataE2EID_template::match(const ExpectDataE2EID& 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.ete__id().is_bound()) return FALSE;
if((other_value.ete__id().ispresent() ? !single_value->field_ete__id.match((const OCTETSTRING&)other_value.ete__id(), legacy) : !single_value->field_ete__id.match_omit(legacy)))return FALSE;
if(!other_value.vc__conn().is_bound()) return FALSE;
if(!single_value->field_vc__conn.match(other_value.vc__conn(), 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 @DIAMETER_Emulation.ExpectDataE2EID.");
}
return FALSE;
}

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

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

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

ExpectDataE2EID ExpectDataE2EID_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 @DIAMETER_Emulation.ExpectDataE2EID.");
ExpectDataE2EID ret_val;
if (single_value->field_ete__id.is_omit()) ret_val.ete__id() = OMIT_VALUE;
else if (single_value->field_ete__id.is_bound()) {
ret_val.ete__id() = single_value->field_ete__id.valueof();
}
if (single_value->field_vc__conn.is_bound()) {
ret_val.vc__conn() = single_value->field_vc__conn.valueof();
}
return ret_val;
}

void ExpectDataE2EID_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 @DIAMETER_Emulation.ExpectDataE2EID.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ExpectDataE2EID_template[list_length];
}

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

OCTETSTRING_template& ExpectDataE2EID_template::ete__id()
{
set_specific();
return single_value->field_ete__id;
}

const OCTETSTRING_template& ExpectDataE2EID_template::ete__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ete_id of a non-specific template of type @DIAMETER_Emulation.ExpectDataE2EID.");
return single_value->field_ete__id;
}

COMPONENT_template& ExpectDataE2EID_template::vc__conn()
{
set_specific();
return single_value->field_vc__conn;
}

const COMPONENT_template& ExpectDataE2EID_template::vc__conn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vc_conn of a non-specific template of type @DIAMETER_Emulation.ExpectDataE2EID.");
return single_value->field_vc__conn;
}

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

void ExpectDataE2EID_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ete_id := ");
single_value->field_ete__id.log();
TTCN_Logger::log_event_str(", vc_conn := ");
single_value->field_vc__conn.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 ExpectDataE2EID_template::log_match(const ExpectDataE2EID& 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.ete__id().ispresent()){
if(!single_value->field_ete__id.match(match_value.ete__id(), legacy)){
TTCN_Logger::log_logmatch_info(".ete_id");
single_value->field_ete__id.log_match(match_value.ete__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ete__id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ete_id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ete__id.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_vc__conn.match(match_value.vc__conn(), legacy)){
TTCN_Logger::log_logmatch_info(".vc_conn");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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("{ ete_id := ");
if (match_value.ete__id().ispresent()) {
single_value->field_ete__id.log_match(match_value.ete__id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ete__id.log();
if (single_value->field_ete__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vc_conn := ");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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 ExpectDataE2EID_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!ete__id().is_bound()) ete__id() = OMIT_VALUE;
else ete__id().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

void ExpectDataE2EID_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ete__id.encode_text(text_buf);
single_value->field_vc__conn.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 @DIAMETER_Emulation.ExpectDataE2EID.");
}
}

void ExpectDataE2EID_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_ete__id.decode_text(text_buf);
single_value->field_vc__conn.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 ExpectDataE2EID_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 @DIAMETER_Emulation.ExpectDataE2EID.");
}
}

void ExpectDataE2EID_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: {
    ExpectDataE2EID_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 @DIAMETER_Emulation.ExpectDataE2EID 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) ete__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vc__conn().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(), "ete_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ete__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(), "vc_conn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__conn().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 @DIAMETER_Emulation.ExpectDataE2EID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ExpectDataE2EID_template* precondition = new ExpectDataE2EID_template;
    precondition->set_param(*param.get_elem(0));
    ExpectDataE2EID_template* implied_template = new ExpectDataE2EID_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ExpectDataE2EID_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@DIAMETER_Emulation.ExpectDataE2EID");
  }
  is_ifpresent = param.get_ifpresent();
}

void ExpectDataE2EID_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_ete__id.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ExpectDataE2EID");
single_value->field_vc__conn.check_restriction(t_res, t_name ? t_name : "@DIAMETER_Emulation.ExpectDataE2EID");
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 : "@DIAMETER_Emulation.ExpectDataE2EID");
}

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

boolean ExpectDataE2EID_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 DIAMETEREM__register__eteid_call::encode_text(Text_Buf& text_buf) const
{
param_ete__id.encode_text(text_buf);
param_hdlr.encode_text(text_buf);
}

void DIAMETEREM__register__eteid_call::decode_text(Text_Buf& text_buf)
{
param_ete__id.decode_text(text_buf);
param_hdlr.decode_text(text_buf);
}

void DIAMETEREM__register__eteid_call::log() const
{
TTCN_Logger::log_event_str("@DIAMETER_Emulation.DIAMETEREM_register_eteid : { ");
TTCN_Logger::log_event_str("ete_id := ");
param_ete__id.log();
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__eteid_call_redirect::set_parameters(const DIAMETEREM__register__eteid_call& call_par) const
{
if (ptr_ete__id != NULL) *ptr_ete__id = call_par.ete__id();
if (ptr_hdlr != NULL) *ptr_hdlr = call_par.hdlr();
}

void DIAMETEREM__register__eteid_reply::log() const
{
TTCN_Logger::log_event_str("@DIAMETER_Emulation.DIAMETEREM_register_eteid : { }");
}

DIAMETEREM__register__eteid_template::DIAMETEREM__register__eteid_template()
 : param_ete__id(ANY_VALUE), param_hdlr(ANY_VALUE)
{
}

DIAMETEREM__register__eteid_call DIAMETEREM__register__eteid_template::create_call() const
{
DIAMETEREM__register__eteid_call ret_val;
ret_val.ete__id() = param_ete__id.valueof();
ret_val.hdlr() = param_hdlr.valueof();
return ret_val;
}

boolean DIAMETEREM__register__eteid_template::match_call(const DIAMETEREM__register__eteid_call& match_value, boolean legacy) const
{
return param_ete__id.match(match_value.ete__id(), legacy) &&
param_hdlr.match(match_value.hdlr(), legacy);
}

void DIAMETEREM__register__eteid_template::log() const
{
TTCN_Logger::log_event_str("{ ete_id := ");
param_ete__id.log();
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__eteid_template::log_match_call(const DIAMETEREM__register__eteid_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ ete_id := ");
param_ete__id.log_match(match_value.ete__id(), legacy);
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log_match(match_value.hdlr(), legacy);
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__eteid_template::log_match_reply(const DIAMETEREM__register__eteid_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void DIAMETEREM__register__eteid_template::encode_text(Text_Buf& text_buf) const
{
param_ete__id.encode_text(text_buf);
param_hdlr.encode_text(text_buf);
}

void DIAMETEREM__register__eteid_template::decode_text(Text_Buf& text_buf)
{
param_ete__id.decode_text(text_buf);
param_hdlr.decode_text(text_buf);
}

void DIAMETEREM__register__imsi_call::encode_text(Text_Buf& text_buf) const
{
param_imsi.encode_text(text_buf);
param_hdlr.encode_text(text_buf);
}

void DIAMETEREM__register__imsi_call::decode_text(Text_Buf& text_buf)
{
param_imsi.decode_text(text_buf);
param_hdlr.decode_text(text_buf);
}

void DIAMETEREM__register__imsi_call::log() const
{
TTCN_Logger::log_event_str("@DIAMETER_Emulation.DIAMETEREM_register_imsi : { ");
TTCN_Logger::log_event_str("imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__imsi_call_redirect::set_parameters(const DIAMETEREM__register__imsi_call& call_par) const
{
if (ptr_imsi != NULL) *ptr_imsi = call_par.imsi();
if (ptr_hdlr != NULL) *ptr_hdlr = call_par.hdlr();
}

void DIAMETEREM__register__imsi_reply::log() const
{
TTCN_Logger::log_event_str("@DIAMETER_Emulation.DIAMETEREM_register_imsi : { }");
}

DIAMETEREM__register__imsi_template::DIAMETEREM__register__imsi_template()
 : param_imsi(ANY_VALUE), param_hdlr(ANY_VALUE)
{
}

DIAMETEREM__register__imsi_call DIAMETEREM__register__imsi_template::create_call() const
{
DIAMETEREM__register__imsi_call ret_val;
ret_val.imsi() = param_imsi.valueof();
ret_val.hdlr() = param_hdlr.valueof();
return ret_val;
}

boolean DIAMETEREM__register__imsi_template::match_call(const DIAMETEREM__register__imsi_call& match_value, boolean legacy) const
{
return param_imsi.match(match_value.imsi(), legacy) &&
param_hdlr.match(match_value.hdlr(), legacy);
}

void DIAMETEREM__register__imsi_template::log() const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log();
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__imsi_template::log_match_call(const DIAMETEREM__register__imsi_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(", hdlr := ");
param_hdlr.log_match(match_value.hdlr(), legacy);
TTCN_Logger::log_event_str(" }");
}

void DIAMETEREM__register__imsi_template::log_match_reply(const DIAMETEREM__register__imsi_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void DIAMETEREM__register__imsi_template::encode_text(Text_Buf& text_buf) const
{
param_imsi.encode_text(text_buf);
param_hdlr.encode_text(text_buf);
}

void DIAMETEREM__register__imsi_template::decode_text(Text_Buf& text_buf)
{
param_imsi.decode_text(text_buf);
param_hdlr.decode_text(text_buf);
}

void DIAMETEREM__PROC__PT::append_to_proc_queue(proc_queue_item *new_item)
{
new_item->next_item = NULL;
if (proc_queue_tail != NULL) proc_queue_tail->next_item = new_item;
else proc_queue_head = new_item;
proc_queue_tail = new_item;
}

void DIAMETEREM__PROC__PT::remove_proc_queue_head()
{
switch (proc_queue_head->item_selection) {
case CALL_0:
delete proc_queue_head->call_0;
break;
case CALL_1:
delete proc_queue_head->call_1;
break;
case REPLY_0:
delete proc_queue_head->reply_0;
break;
case REPLY_1:
delete proc_queue_head->reply_1;
break;
default:
TTCN_error("Internal error: Invalid signature selector in the queue of port %s.", port_name);
}
proc_queue_item *next_item = proc_queue_head->next_item;
delete proc_queue_head;
proc_queue_head = next_item;
if (next_item == NULL) proc_queue_tail = NULL;
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__op, port_name, 0, ++proc_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));}

void DIAMETEREM__PROC__PT::clear_queue()
{
while (proc_queue_head != NULL) remove_proc_queue_head();
}

DIAMETEREM__PROC__PT::DIAMETEREM__PROC__PT(const char *par_port_name)
 : PORT(par_port_name)
{
proc_queue_head = NULL;
proc_queue_tail = NULL;
}

DIAMETEREM__PROC__PT::~DIAMETEREM__PROC__PT()
{
clear_queue();
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__imsi_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const DIAMETEREM__register__imsi_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_imsi");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__imsi_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__imsi_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_imsi");
const DIAMETEREM__register__imsi_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__eteid_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const DIAMETEREM__register__eteid_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_eteid");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__eteid_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void DIAMETEREM__PROC__PT::call(const DIAMETEREM__register__eteid_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_eteid");
const DIAMETEREM__register__eteid_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__imsi_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const DIAMETEREM__register__imsi_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_imsi");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__imsi_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__imsi_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_imsi");
const DIAMETEREM__register__imsi_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__eteid_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const DIAMETEREM__register__eteid_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_eteid");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__eteid_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void DIAMETEREM__PROC__PT::reply(const DIAMETEREM__register__eteid_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@DIAMETER_Emulation.DIAMETEREM_register_eteid");
const DIAMETEREM__register__eteid_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

alt_status DIAMETEREM__PROC__PT::getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case CALL_0:
case CALL_1:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component,
FALSE, CHARSTRING(0, NULL), msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name);
return ALT_NO;
}
}

alt_status DIAMETEREM__PROC__PT::check_getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case CALL_0:
case CALL_1:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component,
TRUE, CHARSTRING(0, NULL), msg_head_count+1);
}
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name);
return ALT_NO;
}
}

alt_status DIAMETEREM__PROC__PT::getcall(const DIAMETEREM__register__imsi_template& getcall_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__imsi_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @DIAMETER_Emulation.DIAMETEREM_register_imsi.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::check_getcall(const DIAMETEREM__register__imsi_template& getcall_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__imsi_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @DIAMETER_Emulation.DIAMETEREM_register_imsi.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::getcall(const DIAMETEREM__register__eteid_template& getcall_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__eteid_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @DIAMETER_Emulation.DIAMETEREM_register_eteid.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::check_getcall(const DIAMETEREM__register__eteid_template& getcall_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__eteid_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @DIAMETER_Emulation.DIAMETEREM_register_eteid.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case REPLY_0:
case REPLY_1:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component,
FALSE, CHARSTRING(0, NULL), msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name);
return ALT_NO;
}
}

alt_status DIAMETEREM__PROC__PT::check_getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case REPLY_0:
case REPLY_1:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component,
TRUE, CHARSTRING(0, NULL), msg_head_count+1);
}
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name);
return ALT_NO;
}
}

alt_status DIAMETEREM__PROC__PT::getreply(const DIAMETEREM__register__imsi_template& getreply_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__imsi_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @DIAMETER_Emulation.DIAMETEREM_register_imsi.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::check_getreply(const DIAMETEREM__register__imsi_template& getreply_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__imsi_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @DIAMETER_Emulation.DIAMETEREM_register_imsi.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::getreply(const DIAMETEREM__register__eteid_template& getreply_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__eteid_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @DIAMETER_Emulation.DIAMETEREM_register_eteid.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status DIAMETEREM__PROC__PT::check_getreply(const DIAMETEREM__register__eteid_template& getreply_template, const COMPONENT_template& sender_template, const DIAMETEREM__register__eteid_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @DIAMETER_Emulation.DIAMETEREM_register_eteid.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

void DIAMETEREM__PROC__PT::incoming_call(const DIAMETEREM__register__imsi_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_0;
new_item->call_0 = new DIAMETEREM__register__imsi_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void DIAMETEREM__PROC__PT::incoming_call(const DIAMETEREM__register__eteid_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_1;
new_item->call_1 = new DIAMETEREM__register__eteid_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void DIAMETEREM__PROC__PT::incoming_reply(const DIAMETEREM__register__imsi_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_0;
new_item->reply_0 = new DIAMETEREM__register__imsi_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void DIAMETEREM__PROC__PT::incoming_reply(const DIAMETEREM__register__eteid_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_1;
new_item->reply_1 = new DIAMETEREM__register__eteid_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

boolean DIAMETEREM__PROC__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@DIAMETER_Emulation.DIAMETEREM_register_imsi")) {
DIAMETEREM__register__imsi_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@DIAMETER_Emulation.DIAMETEREM_register_eteid")) {
DIAMETEREM__register__eteid_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

boolean DIAMETEREM__PROC__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@DIAMETER_Emulation.DIAMETEREM_register_imsi")) {
DIAMETEREM__register__imsi_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@DIAMETER_Emulation.DIAMETEREM_register_eteid")) {
DIAMETEREM__register__eteid_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}


/* Bodies of functions, altsteps and testcases */

DIAMETER__CodecPort::DIAMETER__RecvFrom_template tr__DIAMETER__RecvFrom__R(const DIAMETER__Types::PDU__DIAMETER_template& msg)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 128, TTCN_Location::LOCATION_FUNCTION, "tr_DIAMETER_RecvFrom_R");
current_location.update_lineno(130);
/* DIAMETER_Emulation.ttcn, line 130 */
DIAMETER__CodecPort::DIAMETER__RecvFrom_template mrf;
mrf.connId() = DIAMETER__Emulation__CT_component_g__diameter__conn__id;
mrf.remName() = ANY_VALUE;
mrf.remPort() = ANY_VALUE;
mrf.locName() = ANY_VALUE;
mrf.locPort() = ANY_VALUE;
mrf.msg() = msg;
current_location.update_lineno(138);
/* DIAMETER_Emulation.ttcn, line 138 */
return mrf;
}

void start_tr__DIAMETER__RecvFrom__R(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER_template& msg)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function tr_DIAMETER_RecvFrom_R(");
msg.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "tr_DIAMETER_RecvFrom_R", text_buf);
msg.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BOOLEAN f__imsi__known(const HEXSTRING& imsi)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 141, TTCN_Location::LOCATION_FUNCTION, "f_imsi_known");
current_location.update_lineno(143);
/* DIAMETER_Emulation.ttcn, line 143 */
INTEGER i;
current_location.update_lineno(144);
/* DIAMETER_Emulation.ttcn, line 144 */
i = 0;
current_location.update_lineno(144);
/* DIAMETER_Emulation.ttcn, line 144 */
for ( ; ; ) {
current_location.update_lineno(144);
/* DIAMETER_Emulation.ttcn, line 144 */
if (!(i < 256)) break;
current_location.update_lineno(145);
/* DIAMETER_Emulation.ttcn, line 145 */
if ((const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].imsi() == imsi)) {
current_location.update_lineno(146);
/* DIAMETER_Emulation.ttcn, line 146 */
return TRUE;
}
current_location.update_lineno(144);
/* DIAMETER_Emulation.ttcn, line 144 */
{
INTEGER tmp_1;
++i;
}
}
current_location.update_lineno(149);
/* DIAMETER_Emulation.ttcn, line 149 */
return FALSE;
}

void start_f__imsi__known(const COMPONENT& component_reference, const HEXSTRING& imsi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_known(");
imsi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_imsi_known", text_buf);
imsi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BOOLEAN f__comp__known(const COMPONENT& client)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 152, TTCN_Location::LOCATION_FUNCTION, "f_comp_known");
current_location.update_lineno(154);
/* DIAMETER_Emulation.ttcn, line 154 */
INTEGER i;
current_location.update_lineno(155);
/* DIAMETER_Emulation.ttcn, line 155 */
i = 0;
current_location.update_lineno(155);
/* DIAMETER_Emulation.ttcn, line 155 */
for ( ; ; ) {
current_location.update_lineno(155);
/* DIAMETER_Emulation.ttcn, line 155 */
if (!(i < 256)) break;
current_location.update_lineno(156);
/* DIAMETER_Emulation.ttcn, line 156 */
if ((const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].comp__ref() == client)) {
current_location.update_lineno(157);
/* DIAMETER_Emulation.ttcn, line 157 */
return TRUE;
}
current_location.update_lineno(155);
/* DIAMETER_Emulation.ttcn, line 155 */
{
INTEGER tmp_3;
++i;
}
}
current_location.update_lineno(160);
/* DIAMETER_Emulation.ttcn, line 160 */
return FALSE;
}

void start_f__comp__known(const COMPONENT& component_reference, const COMPONENT& client)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_known(");
client.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_comp_known", text_buf);
client.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

COMPONENT f__comp__by__imsi(const HEXSTRING& imsi)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 163, TTCN_Location::LOCATION_FUNCTION, "f_comp_by_imsi");
current_location.update_lineno(165);
/* DIAMETER_Emulation.ttcn, line 165 */
INTEGER i;
current_location.update_lineno(166);
/* DIAMETER_Emulation.ttcn, line 166 */
i = 0;
current_location.update_lineno(166);
/* DIAMETER_Emulation.ttcn, line 166 */
for ( ; ; ) {
current_location.update_lineno(166);
/* DIAMETER_Emulation.ttcn, line 166 */
if (!(i < 256)) break;
current_location.update_lineno(167);
/* DIAMETER_Emulation.ttcn, line 167 */
if ((const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].imsi() == imsi)) {
current_location.update_lineno(168);
/* DIAMETER_Emulation.ttcn, line 168 */
return const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].comp__ref();
}
current_location.update_lineno(166);
/* DIAMETER_Emulation.ttcn, line 166 */
{
INTEGER tmp_5;
++i;
}
}
current_location.update_lineno(171);
/* DIAMETER_Emulation.ttcn, line 171 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DIAMETER Association Table not found by IMSI"),imsi.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(172);
/* DIAMETER_Emulation.ttcn, line 172 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_f__comp__by__imsi(const COMPONENT& component_reference, const HEXSTRING& imsi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_by_imsi(");
imsi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_comp_by_imsi", text_buf);
imsi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

HEXSTRING f__imsi__by__comp(const COMPONENT& client)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 175, TTCN_Location::LOCATION_FUNCTION, "f_imsi_by_comp");
current_location.update_lineno(177);
/* DIAMETER_Emulation.ttcn, line 177 */
INTEGER i;
current_location.update_lineno(178);
/* DIAMETER_Emulation.ttcn, line 178 */
i = 0;
current_location.update_lineno(178);
/* DIAMETER_Emulation.ttcn, line 178 */
for ( ; ; ) {
current_location.update_lineno(178);
/* DIAMETER_Emulation.ttcn, line 178 */
if (!(i < 256)) break;
current_location.update_lineno(179);
/* DIAMETER_Emulation.ttcn, line 179 */
if ((const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].comp__ref() == client)) {
current_location.update_lineno(180);
/* DIAMETER_Emulation.ttcn, line 180 */
return const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].imsi()();
}
current_location.update_lineno(178);
/* DIAMETER_Emulation.ttcn, line 178 */
{
INTEGER tmp_7;
++i;
}
}
current_location.update_lineno(183);
/* DIAMETER_Emulation.ttcn, line 183 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DIAMETER Association Table not found by component "),client.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(184);
/* DIAMETER_Emulation.ttcn, line 184 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_f__imsi__by__comp(const COMPONENT& component_reference, const COMPONENT& client)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_by_comp(");
client.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_imsi_by_comp", text_buf);
client.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__imsi__table__add(const COMPONENT& comp__ref, const HEXSTRING& imsi)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 187, TTCN_Location::LOCATION_FUNCTION, "f_imsi_table_add");
current_location.update_lineno(189);
/* DIAMETER_Emulation.ttcn, line 189 */
INTEGER i;
current_location.update_lineno(190);
/* DIAMETER_Emulation.ttcn, line 190 */
i = 0;
current_location.update_lineno(190);
/* DIAMETER_Emulation.ttcn, line 190 */
for ( ; ; ) {
current_location.update_lineno(190);
/* DIAMETER_Emulation.ttcn, line 190 */
if (!(i < 256)) break;
current_location.update_lineno(191);
/* DIAMETER_Emulation.ttcn, line 191 */
{
boolean tmp_14;
{
boolean tmp_9 = DIAMETER__Emulation__CT_component_DiameterAssocTable.is_bound();
if(tmp_9) {
const int tmp_10 = i;
tmp_9 = (tmp_10 >= 0) && (DIAMETER__Emulation__CT_component_DiameterAssocTable.size_of() > tmp_10);
if(tmp_9) {
const AssociationData& tmp_11 = DIAMETER__Emulation__CT_component_DiameterAssocTable[tmp_10];
tmp_9 = tmp_11.is_bound();
if(tmp_9) {
const OPTIONAL< HEXSTRING >& tmp_12 = tmp_11.imsi();
switch (tmp_12.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_9 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_9 = FALSE;
break;
default:
{
const HEXSTRING& tmp_13 = (const HEXSTRING&) tmp_12;
tmp_9 = tmp_13.is_value();
break;}
}
}
}
}
tmp_14 = (!(tmp_9));
}
if (tmp_14) {
current_location.update_lineno(192);
/* DIAMETER_Emulation.ttcn, line 192 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].imsi() = imsi;
current_location.update_lineno(193);
/* DIAMETER_Emulation.ttcn, line 193 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].comp__ref() = comp__ref;
current_location.update_lineno(194);
/* DIAMETER_Emulation.ttcn, line 194 */
return;
}
}
current_location.update_lineno(190);
/* DIAMETER_Emulation.ttcn, line 190 */
{
INTEGER tmp_17;
++i;
}
}
current_location.update_lineno(197);
/* DIAMETER_Emulation.ttcn, line 197 */
TTCN_Logger::log_str(TTCN_USER, "DIAMETER Association Table full!");
TTCN_error("testcase.stop");
}

void start_f__imsi__table__add(const COMPONENT& component_reference, const COMPONENT& comp__ref, const HEXSTRING& imsi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_table_add(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_imsi_table_add", text_buf);
comp__ref.encode_text(text_buf);
imsi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__imsi__table__del(const COMPONENT& comp__ref, const HEXSTRING& imsi)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 200, TTCN_Location::LOCATION_FUNCTION, "f_imsi_table_del");
current_location.update_lineno(202);
/* DIAMETER_Emulation.ttcn, line 202 */
INTEGER i;
current_location.update_lineno(203);
/* DIAMETER_Emulation.ttcn, line 203 */
i = 0;
current_location.update_lineno(203);
/* DIAMETER_Emulation.ttcn, line 203 */
for ( ; ; ) {
current_location.update_lineno(203);
/* DIAMETER_Emulation.ttcn, line 203 */
if (!(i < 256)) break;
current_location.update_lineno(204);
/* DIAMETER_Emulation.ttcn, line 204 */
{
boolean tmp_19;
tmp_19 = (const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].comp__ref() == comp__ref);
if (tmp_19) tmp_19 = (const_cast< const VALUE_ARRAY<AssociationData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterAssocTable)[i].imsi() == imsi);
if (tmp_19) {
current_location.update_lineno(206);
/* DIAMETER_Emulation.ttcn, line 206 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].imsi() = OMIT_VALUE;
current_location.update_lineno(207);
/* DIAMETER_Emulation.ttcn, line 207 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].comp__ref() = NULL_COMPREF;
current_location.update_lineno(208);
/* DIAMETER_Emulation.ttcn, line 208 */
return;
}
}
current_location.update_lineno(203);
/* DIAMETER_Emulation.ttcn, line 203 */
{
INTEGER tmp_22;
++i;
}
}
current_location.update_lineno(211);
/* DIAMETER_Emulation.ttcn, line 211 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DIAMETER Association Table: Couldn't find to-be-deleted entry!"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(212);
/* DIAMETER_Emulation.ttcn, line 212 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_f__imsi__table__del(const COMPONENT& component_reference, const COMPONENT& comp__ref, const HEXSTRING& imsi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_table_del(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_imsi_table_del", text_buf);
comp__ref.encode_text(text_buf);
imsi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__imsi__table__init()
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 215, TTCN_Location::LOCATION_FUNCTION, "f_imsi_table_init");
{
current_location.update_lineno(217);
/* DIAMETER_Emulation.ttcn, line 217 */
INTEGER i(0);
current_location.update_lineno(217);
/* DIAMETER_Emulation.ttcn, line 217 */
for ( ; ; ) {
current_location.update_lineno(217);
/* DIAMETER_Emulation.ttcn, line 217 */
if (!(i < 256)) break;
current_location.update_lineno(218);
/* DIAMETER_Emulation.ttcn, line 218 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].comp__ref() = NULL_COMPREF;
current_location.update_lineno(219);
/* DIAMETER_Emulation.ttcn, line 219 */
DIAMETER__Emulation__CT_component_DiameterAssocTable[i].imsi() = OMIT_VALUE;
current_location.update_lineno(217);
/* DIAMETER_Emulation.ttcn, line 217 */
{
INTEGER tmp_25;
++i;
}
}
}
}

void start_f__imsi__table__init(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_table_init(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_imsi_table_init", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BOOLEAN f__ete__id__known(const OCTETSTRING& ete__id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 224, TTCN_Location::LOCATION_FUNCTION, "f_ete_id_known");
current_location.update_lineno(226);
/* DIAMETER_Emulation.ttcn, line 226 */
INTEGER i;
current_location.update_lineno(227);
/* DIAMETER_Emulation.ttcn, line 227 */
i = 0;
current_location.update_lineno(227);
/* DIAMETER_Emulation.ttcn, line 227 */
for ( ; ; ) {
current_location.update_lineno(227);
/* DIAMETER_Emulation.ttcn, line 227 */
if (!(i < 256)) break;
current_location.update_lineno(228);
/* DIAMETER_Emulation.ttcn, line 228 */
if ((const_cast< const VALUE_ARRAY<ETEIDData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterETEIDTable)[i].ete__id() == ete__id)) {
current_location.update_lineno(229);
/* DIAMETER_Emulation.ttcn, line 229 */
return TRUE;
}
current_location.update_lineno(227);
/* DIAMETER_Emulation.ttcn, line 227 */
{
INTEGER tmp_27;
++i;
}
}
current_location.update_lineno(232);
/* DIAMETER_Emulation.ttcn, line 232 */
return FALSE;
}

void start_f__ete__id__known(const COMPONENT& component_reference, const OCTETSTRING& ete__id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ete_id_known(");
ete__id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_ete_id_known", text_buf);
ete__id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

COMPONENT f__comp__by__ete__id(const OCTETSTRING& ete__id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 235, TTCN_Location::LOCATION_FUNCTION, "f_comp_by_ete_id");
current_location.update_lineno(237);
/* DIAMETER_Emulation.ttcn, line 237 */
INTEGER i;
current_location.update_lineno(238);
/* DIAMETER_Emulation.ttcn, line 238 */
i = 0;
current_location.update_lineno(238);
/* DIAMETER_Emulation.ttcn, line 238 */
for ( ; ; ) {
current_location.update_lineno(238);
/* DIAMETER_Emulation.ttcn, line 238 */
if (!(i < 256)) break;
current_location.update_lineno(239);
/* DIAMETER_Emulation.ttcn, line 239 */
if ((const_cast< const VALUE_ARRAY<ETEIDData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterETEIDTable)[i].ete__id() == ete__id)) {
current_location.update_lineno(240);
/* DIAMETER_Emulation.ttcn, line 240 */
return const_cast< const VALUE_ARRAY<ETEIDData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterETEIDTable)[i].comp__ref();
}
current_location.update_lineno(238);
/* DIAMETER_Emulation.ttcn, line 238 */
{
INTEGER tmp_29;
++i;
}
}
current_location.update_lineno(243);
/* DIAMETER_Emulation.ttcn, line 243 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DIAMETER ETEID Table not found by ete_id"),ete__id.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(244);
/* DIAMETER_Emulation.ttcn, line 244 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_f__comp__by__ete__id(const COMPONENT& component_reference, const OCTETSTRING& ete__id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_by_ete_id(");
ete__id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_comp_by_ete_id", text_buf);
ete__id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__eteid__table__add(const COMPONENT& comp__ref, const OCTETSTRING& ete__id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 247, TTCN_Location::LOCATION_FUNCTION, "f_eteid_table_add");
current_location.update_lineno(249);
/* DIAMETER_Emulation.ttcn, line 249 */
INTEGER i;
current_location.update_lineno(250);
/* DIAMETER_Emulation.ttcn, line 250 */
i = 0;
current_location.update_lineno(250);
/* DIAMETER_Emulation.ttcn, line 250 */
for ( ; ; ) {
current_location.update_lineno(250);
/* DIAMETER_Emulation.ttcn, line 250 */
if (!(i < 256)) break;
current_location.update_lineno(251);
/* DIAMETER_Emulation.ttcn, line 251 */
{
boolean tmp_36;
{
boolean tmp_31 = DIAMETER__Emulation__CT_component_DiameterETEIDTable.is_bound();
if(tmp_31) {
const int tmp_32 = i;
tmp_31 = (tmp_32 >= 0) && (DIAMETER__Emulation__CT_component_DiameterETEIDTable.size_of() > tmp_32);
if(tmp_31) {
const ETEIDData& tmp_33 = DIAMETER__Emulation__CT_component_DiameterETEIDTable[tmp_32];
tmp_31 = tmp_33.is_bound();
if(tmp_31) {
const OPTIONAL< OCTETSTRING >& tmp_34 = tmp_33.ete__id();
switch (tmp_34.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_31 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_31 = FALSE;
break;
default:
{
const OCTETSTRING& tmp_35 = (const OCTETSTRING&) tmp_34;
tmp_31 = tmp_35.is_value();
break;}
}
}
}
}
tmp_36 = (!(tmp_31));
}
if (tmp_36) {
current_location.update_lineno(252);
/* DIAMETER_Emulation.ttcn, line 252 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].ete__id() = ete__id;
current_location.update_lineno(253);
/* DIAMETER_Emulation.ttcn, line 253 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].comp__ref() = comp__ref;
current_location.update_lineno(254);
/* DIAMETER_Emulation.ttcn, line 254 */
return;
}
}
current_location.update_lineno(250);
/* DIAMETER_Emulation.ttcn, line 250 */
{
INTEGER tmp_39;
++i;
}
}
current_location.update_lineno(257);
/* DIAMETER_Emulation.ttcn, line 257 */
TTCN_Logger::log_str(TTCN_USER, "DIAMETER ETEID Table full!");
TTCN_error("testcase.stop");
}

void start_f__eteid__table__add(const COMPONENT& component_reference, const COMPONENT& comp__ref, const OCTETSTRING& ete__id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_eteid_table_add(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
ete__id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_eteid_table_add", text_buf);
comp__ref.encode_text(text_buf);
ete__id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__eteid__table__del(const COMPONENT& comp__ref, const OCTETSTRING& ete__id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 260, TTCN_Location::LOCATION_FUNCTION, "f_eteid_table_del");
current_location.update_lineno(262);
/* DIAMETER_Emulation.ttcn, line 262 */
INTEGER i;
current_location.update_lineno(263);
/* DIAMETER_Emulation.ttcn, line 263 */
i = 0;
current_location.update_lineno(263);
/* DIAMETER_Emulation.ttcn, line 263 */
for ( ; ; ) {
current_location.update_lineno(263);
/* DIAMETER_Emulation.ttcn, line 263 */
if (!(i < 256)) break;
current_location.update_lineno(264);
/* DIAMETER_Emulation.ttcn, line 264 */
{
boolean tmp_41;
tmp_41 = (const_cast< const VALUE_ARRAY<ETEIDData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterETEIDTable)[i].comp__ref() == comp__ref);
if (tmp_41) tmp_41 = (const_cast< const VALUE_ARRAY<ETEIDData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterETEIDTable)[i].ete__id() == ete__id);
if (tmp_41) {
current_location.update_lineno(266);
/* DIAMETER_Emulation.ttcn, line 266 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].ete__id() = OMIT_VALUE;
current_location.update_lineno(267);
/* DIAMETER_Emulation.ttcn, line 267 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].comp__ref() = NULL_COMPREF;
current_location.update_lineno(268);
/* DIAMETER_Emulation.ttcn, line 268 */
return;
}
}
current_location.update_lineno(263);
/* DIAMETER_Emulation.ttcn, line 263 */
{
INTEGER tmp_44;
++i;
}
}
current_location.update_lineno(271);
/* DIAMETER_Emulation.ttcn, line 271 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DIAMETER ETEID Table: Couldn't find to-be-deleted entry!"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(272);
/* DIAMETER_Emulation.ttcn, line 272 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_f__eteid__table__del(const COMPONENT& component_reference, const COMPONENT& comp__ref, const OCTETSTRING& ete__id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_eteid_table_del(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
ete__id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_eteid_table_del", text_buf);
comp__ref.encode_text(text_buf);
ete__id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__eteid__table__init()
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 276, TTCN_Location::LOCATION_FUNCTION, "f_eteid_table_init");
{
current_location.update_lineno(278);
/* DIAMETER_Emulation.ttcn, line 278 */
INTEGER i(0);
current_location.update_lineno(278);
/* DIAMETER_Emulation.ttcn, line 278 */
for ( ; ; ) {
current_location.update_lineno(278);
/* DIAMETER_Emulation.ttcn, line 278 */
if (!(i < 256)) break;
current_location.update_lineno(279);
/* DIAMETER_Emulation.ttcn, line 279 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].comp__ref() = NULL_COMPREF;
current_location.update_lineno(280);
/* DIAMETER_Emulation.ttcn, line 280 */
DIAMETER__Emulation__CT_component_DiameterETEIDTable[i].ete__id() = OMIT_VALUE;
current_location.update_lineno(278);
/* DIAMETER_Emulation.ttcn, line 278 */
{
INTEGER tmp_47;
++i;
}
}
}
}

void start_f__eteid__table__init(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_eteid_table_init(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_eteid_table_init", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

HEXSTRING_template f__DIAMETER__get__imsi(const DIAMETER__Types::PDU__DIAMETER& pdu)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 284, TTCN_Location::LOCATION_FUNCTION, "f_DIAMETER_get_imsi");
current_location.update_lineno(286);
/* DIAMETER_Emulation.ttcn, line 286 */
DIAMETER__Types::AVP_template imsi__avp;
current_location.update_lineno(288);
/* DIAMETER_Emulation.ttcn, line 288 */
imsi__avp = DIAMETER__Templates::f__DIAMETER__get__avp(pdu, DIAMETER__Types::AVP__Code_template(DIAMETER__Types::c__AVP__Code__BASE__NONE__User__Name));
current_location.update_lineno(289);
/* DIAMETER_Emulation.ttcn, line 289 */
if (imsi__avp.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(290);
/* DIAMETER_Emulation.ttcn, line 290 */
DIAMETER__Types::AVP_template sid__avp;
current_location.update_lineno(291);
/* DIAMETER_Emulation.ttcn, line 291 */
sid__avp = DIAMETER__Templates::f__DIAMETER__get__avp(pdu, DIAMETER__Types::AVP__Code_template(DIAMETER__Types::c__AVP__Code__DCC__NONE__Subscription__Id));
current_location.update_lineno(292);
/* DIAMETER_Emulation.ttcn, line 292 */
if (sid__avp.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(293);
/* DIAMETER_Emulation.ttcn, line 293 */
return HEXSTRING_template(OMIT_VALUE);
}
current_location.update_lineno(295);
/* DIAMETER_Emulation.ttcn, line 295 */
DIAMETER__Types::AVP__list grp(const_cast< const DIAMETER__Types::AVP_template&>(sid__avp).avp__data().avp__DCC__NONE__Subscription__Id().valueof());
current_location.update_lineno(296);
/* DIAMETER_Emulation.ttcn, line 296 */
if ((!(DIAMETER__Templates::tr__AVP__SubcrIdType(DIAMETER__Types::DCC__NONE__Subscription__Id__Type_template(DIAMETER__Types::DCC__NONE__Subscription__Id__Type::END__USER__IMSI)).match(const_cast< const DIAMETER__Types::AVP__list&>(grp)[0])))) {
current_location.update_lineno(297);
/* DIAMETER_Emulation.ttcn, line 297 */
return HEXSTRING_template(OMIT_VALUE);
}
current_location.update_lineno(299);
/* DIAMETER_Emulation.ttcn, line 299 */
return HEXSTRING_template(str2hex(oct2char(const_cast< const DIAMETER__Types::AVP__list&>(grp)[1].avp().avp__data().avp__DCC__NONE__Subscription__Id__Data())));
}
else {
current_location.update_lineno(301);
/* DIAMETER_Emulation.ttcn, line 301 */
OCTETSTRING imsi__oct(const_cast< const DIAMETER__Types::AVP_template&>(imsi__avp).avp__data().avp__BASE__NONE__User__Name().valueof());
current_location.update_lineno(302);
/* DIAMETER_Emulation.ttcn, line 302 */
CHARSTRING imsi__str(oct2char(imsi__oct));
current_location.update_lineno(304);
/* DIAMETER_Emulation.ttcn, line 304 */
INTEGER pos(TCCConversion__Functions::f__strstr(imsi__str, cs_1, TCCConversion__Functions::f__strstr_offset_defval));
current_location.update_lineno(305);
/* DIAMETER_Emulation.ttcn, line 305 */
if ((pos != -1)) {
current_location.update_lineno(306);
/* DIAMETER_Emulation.ttcn, line 306 */
{
CHARSTRING tmp_50;
tmp_50 = substr(imsi__str, 0, pos);
imsi__str = tmp_50;
}
}
current_location.update_lineno(308);
/* DIAMETER_Emulation.ttcn, line 308 */
return HEXSTRING_template(str2hex(imsi__str));
}
}

DIAMETER__Types::PDU__DIAMETER f__diameter__xceive(const DIAMETER__Types::PDU__DIAMETER_template& tx, const DIAMETER__Types::PDU__DIAMETER_template& rx__t)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 312, TTCN_Location::LOCATION_FUNCTION, "f_diameter_xceive");
current_location.update_lineno(315);
/* DIAMETER_Emulation.ttcn, line 315 */
TIMER T("T", 1.0e1);
current_location.update_lineno(316);
/* DIAMETER_Emulation.ttcn, line 316 */
DIAMETER__CodecPort::DIAMETER__RecvFrom mrf;
current_location.update_lineno(318);
/* DIAMETER_Emulation.ttcn, line 318 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), tx), FALSE, NULL);
current_location.update_lineno(319);
/* DIAMETER_Emulation.ttcn, line 319 */
T.start();
current_location.update_lineno(320);
/* DIAMETER_Emulation.ttcn, line 320 */
{
tmp_51:
alt_status tmp_51_alt_flag_0 = ALT_MAYBE;
alt_status tmp_51_alt_flag_1 = ALT_MAYBE;
alt_status tmp_51_alt_flag_2 = ALT_MAYBE;
alt_status tmp_51_alt_flag_3 = ALT_MAYBE;
alt_status tmp_51_alt_flag_4 = ALT_MAYBE;
alt_status tmp_51_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_51_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(321);
/* DIAMETER_Emulation.ttcn, line 321 */
tmp_51_alt_flag_0 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(rx__t), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_51_alt_flag_0 == ALT_YES) break;
}
if (tmp_51_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(322);
/* DIAMETER_Emulation.ttcn, line 322 */
tmp_51_alt_flag_1 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(DIAMETER__Types::PDU__DIAMETER_template(ANY_VALUE)), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_51_alt_flag_1 == ALT_YES) {
current_location.update_lineno(323);
/* DIAMETER_Emulation.ttcn, line 323 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx unexpected DIAMETER PDU: "),mrf.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(324);
/* DIAMETER_Emulation.ttcn, line 324 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_51_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(326);
/* DIAMETER_Emulation.ttcn, line 326 */
tmp_51_alt_flag_2 = DIAMETER__Emulation__CT_component_DIAMETER.receive(SCTP__Templates::tr__SctpAssocChange(SCTP__Templates::tr__SctpAssocChange_state_defval, SCTP__Templates::tr__SctpAssocChange_conn__id_defval, SCTP__Templates::tr__SctpAssocChange_sctp_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_51_alt_flag_2 == ALT_YES) {
current_location.update_lineno(326);
/* DIAMETER_Emulation.ttcn, line 326 */
goto tmp_51;
}
}
if (tmp_51_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(327);
/* DIAMETER_Emulation.ttcn, line 327 */
tmp_51_alt_flag_3 = DIAMETER__Emulation__CT_component_DIAMETER.receive(SCTP__Templates::tr__SctpPeerAddrChange(SCTP__Templates::tr__SctpPeerAddrChange_state_defval, SCTP__Templates::tr__SctpPeerAddrChange_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_51_alt_flag_3 == ALT_YES) {
current_location.update_lineno(327);
/* DIAMETER_Emulation.ttcn, line 327 */
goto tmp_51;
}
}
if (tmp_51_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(328);
/* DIAMETER_Emulation.ttcn, line 328 */
tmp_51_alt_flag_4 = T.timeout(NULL);
if (tmp_51_alt_flag_4 == ALT_YES) {
current_location.update_lineno(329);
/* DIAMETER_Emulation.ttcn, line 329 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for "),rx__t.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(330);
/* DIAMETER_Emulation.ttcn, line 330 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_51_default_flag == ALT_MAYBE) {
tmp_51_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_51_default_flag == ALT_YES || tmp_51_default_flag == ALT_BREAK) break;
else if (tmp_51_default_flag == ALT_REPEAT) goto tmp_51;
}
current_location.update_lineno(320);
/* DIAMETER_Emulation.ttcn, line 320 */
if (tmp_51_alt_flag_0 == ALT_NO && tmp_51_alt_flag_1 == ALT_NO && tmp_51_alt_flag_2 == ALT_NO && tmp_51_alt_flag_3 == ALT_NO && tmp_51_alt_flag_4 == ALT_NO && tmp_51_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file DIAMETER_Emulation.ttcn between lines 320 and 332.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(333);
/* DIAMETER_Emulation.ttcn, line 333 */
return const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg();
}

void start_f__diameter__xceive(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER_template& tx, const DIAMETER__Types::PDU__DIAMETER_template& rx__t)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_xceive(");
tx.log();
TTCN_Logger::log_event_str(", ");
rx__t.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_diameter_xceive", text_buf);
tx.encode_text(text_buf);
rx__t.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void main_(const DIAMETEROps& ops, const DIAMETER__conn__parameters& p, const CHARSTRING& id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 336, TTCN_Location::LOCATION_FUNCTION, "main");
current_location.update_lineno(337);
/* DIAMETER_Emulation.ttcn, line 337 */
BOOLEAN server__mode((const_cast< const DIAMETER__conn__parameters&>(p).remote__sctp__port() == -1));
current_location.update_lineno(338);
/* DIAMETER_Emulation.ttcn, line 338 */
Socket__API__Definitions::Result res;
current_location.update_lineno(339);
/* DIAMETER_Emulation.ttcn, line 339 */
DIAMETER__Emulation__CT_component_g__diameter__id = id;
current_location.update_lineno(340);
/* DIAMETER_Emulation.ttcn, line 340 */
f__imsi__table__init();
current_location.update_lineno(341);
/* DIAMETER_Emulation.ttcn, line 341 */
f__eteid__table__init();
current_location.update_lineno(342);
/* DIAMETER_Emulation.ttcn, line 342 */
f__expect__table__init();
current_location.update_lineno(344);
/* DIAMETER_Emulation.ttcn, line 344 */
{
Map_Params tmp_53(0);
TTCN_Runtime::map_port(self, DIAMETER__Emulation__CT_component_DIAMETER.get_name(), SYSTEM_COMPREF, "DIAMETER_CODEC_PT", tmp_53);
}
current_location.update_lineno(345);
/* DIAMETER_Emulation.ttcn, line 345 */
if (server__mode) {
current_location.update_lineno(346);
/* DIAMETER_Emulation.ttcn, line 346 */
Socket__API__Definitions::ProtoTuple tmp_55;
tmp_55.sctp() = SCTP__Templates::ts__SctpTuple(SCTP__Templates::ts__SctpTuple_ppid_defval, SCTP__Templates::ts__SctpTuple_assoc__id_defval).valueof();
res = DIAMETER__CodecPort__CtrlFunct::f__IPL4__listen(DIAMETER__Emulation__CT_component_DIAMETER, const_cast< const DIAMETER__conn__parameters&>(p).local__ip(), const_cast< const DIAMETER__conn__parameters&>(p).local__sctp__port(), tmp_55, DIAMETER__CodecPort__CtrlFunct::f__IPL4__listen_options_defval);
}
else {
current_location.update_lineno(349);
/* DIAMETER_Emulation.ttcn, line 349 */
Socket__API__Definitions::ProtoTuple tmp_57;
tmp_57.sctp() = SCTP__Templates::ts__SctpTuple(SCTP__Templates::ts__SctpTuple_ppid_defval, SCTP__Templates::ts__SctpTuple_assoc__id_defval).valueof();
res = DIAMETER__CodecPort__CtrlFunct::f__IPL4__connect(DIAMETER__Emulation__CT_component_DIAMETER, const_cast< const DIAMETER__conn__parameters&>(p).remote__ip(), const_cast< const DIAMETER__conn__parameters&>(p).remote__sctp__port(), const_cast< const DIAMETER__conn__parameters&>(p).local__ip(), const_cast< const DIAMETER__conn__parameters&>(p).local__sctp__port(), -1, tmp_57, DIAMETER__CodecPort__CtrlFunct::f__IPL4__connect_options_defval);
}
current_location.update_lineno(353);
/* DIAMETER_Emulation.ttcn, line 353 */
{
boolean tmp_61;
{
boolean tmp_58 = res.is_bound();
if(tmp_58) {
const OPTIONAL< INTEGER >& tmp_59 = res.connId();
switch (tmp_59.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_58 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_58 = FALSE;
break;
default:
{
const INTEGER& tmp_60 = (const INTEGER&) tmp_59;
tmp_58 = tmp_60.is_present();
break;}
}
}
tmp_61 = (!(tmp_58));
}
if (tmp_61) {
current_location.update_lineno(354);
/* DIAMETER_Emulation.ttcn, line 354 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Could not connect DIAMETER socket, check your configuration"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(355);
/* DIAMETER_Emulation.ttcn, line 355 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
current_location.update_lineno(357);
/* DIAMETER_Emulation.ttcn, line 357 */
DIAMETER__Emulation__CT_component_g__diameter__conn__id = const_cast< const Socket__API__Definitions::Result&>(res).connId();
current_location.update_lineno(360);
/* DIAMETER_Emulation.ttcn, line 360 */
if ((!(server__mode))) {
current_location.update_lineno(361);
/* DIAMETER_Emulation.ttcn, line 361 */
DIAMETER__Types::PDU__DIAMETER_template req;
current_location.update_lineno(362);
/* DIAMETER_Emulation.ttcn, line 362 */
DIAMETER__Types::PDU__DIAMETER rsp;
current_location.update_lineno(364);
/* DIAMETER_Emulation.ttcn, line 364 */
req = DIAMETER__Templates::ts__DIA__CER(Native__Functions::f__inet__addr(const_cast< const DIAMETER__conn__parameters&>(p).local__ip()), const_cast< const DIAMETER__conn__parameters&>(p).vendor__app__id(), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__host()), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__realm()), DIAMETER__Templates::ts__DIA__CER_hbh__id_defval, DIAMETER__Templates::ts__DIA__CER_ete__id_defval);
current_location.update_lineno(366);
/* DIAMETER_Emulation.ttcn, line 366 */
rsp = f__diameter__xceive(req, DIAMETER__Templates::tr__DIAMETER__A(DIAMETER__Types::Command__Code_template(DIAMETER__Types::Command__Code::Capabilities__Exchange), const_cast< const DIAMETER__Types::PDU__DIAMETER_template&>(req).application__id(), DIAMETER__Templates::tr__DIAMETER__A_hbh__id_defval, DIAMETER__Templates::tr__DIAMETER__A_ete__id_defval, DIAMETER__Templates::tr__DIAMETER__A_avps_defval));
current_location.update_lineno(368);
/* DIAMETER_Emulation.ttcn, line 368 */
{
DiameterCapabilityExchgInd_template tmp_65;
tmp_65.rx() = rsp;
tmp_65.tx() = req.valueof();
DIAMETER__Emulation__CT_component_DIAMETER__UNIT.send(tmp_65, FALSE, NULL);
}
}
for ( ; ; ) {
current_location.update_lineno(372);
/* DIAMETER_Emulation.ttcn, line 372 */
COMPONENT vc__conn;
current_location.update_lineno(373);
/* DIAMETER_Emulation.ttcn, line 373 */
HEXSTRING_template imsi__t;
current_location.update_lineno(374);
/* DIAMETER_Emulation.ttcn, line 374 */
HEXSTRING imsi;
current_location.update_lineno(375);
/* DIAMETER_Emulation.ttcn, line 375 */
OCTETSTRING ete__id;
current_location.update_lineno(376);
/* DIAMETER_Emulation.ttcn, line 376 */
DIAMETER__CodecPort::DIAMETER__RecvFrom mrf;
current_location.update_lineno(377);
/* DIAMETER_Emulation.ttcn, line 377 */
DIAMETER__Types::PDU__DIAMETER msg;
current_location.update_lineno(378);
/* DIAMETER_Emulation.ttcn, line 378 */
CHARSTRING vlr__name;
current_location.update_lineno(378);
/* DIAMETER_Emulation.ttcn, line 378 */
CHARSTRING mme__name;
current_location.update_lineno(379);
/* DIAMETER_Emulation.ttcn, line 379 */
Socket__API__Definitions::PortEvent port__evt;
current_location.update_lineno(381);
/* DIAMETER_Emulation.ttcn, line 381 */
{
tmp_66:
alt_status tmp_66_alt_flag_0 = ALT_MAYBE;
alt_status tmp_66_alt_flag_1 = ALT_MAYBE;
alt_status tmp_66_alt_flag_2 = ALT_MAYBE;
alt_status tmp_66_alt_flag_3 = ALT_MAYBE;
alt_status tmp_66_alt_flag_4 = ALT_MAYBE;
alt_status tmp_66_alt_flag_5 = ALT_UNCHECKED;
alt_status tmp_66_alt_flag_6 = ALT_UNCHECKED;
alt_status tmp_66_alt_flag_7 = ALT_UNCHECKED;
alt_status tmp_66_alt_flag_8 = ALT_MAYBE;
alt_status tmp_66_alt_flag_9 = ALT_MAYBE;
alt_status tmp_66_alt_flag_10 = ALT_MAYBE;
alt_status tmp_66_alt_flag_11 = ALT_MAYBE;
alt_status tmp_66_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_66_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(382);
/* DIAMETER_Emulation.ttcn, line 382 */
{
Socket__API__Definitions::PortEvent_template tmp_67;
tmp_67.connOpened() = ANY_VALUE;
tmp_66_alt_flag_0 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tmp_67, &(port__evt), any_compref, NULL, NULL, NULL);
}
if (tmp_66_alt_flag_0 == ALT_YES) {
current_location.update_lineno(383);
/* DIAMETER_Emulation.ttcn, line 383 */
DIAMETER__Emulation__CT_component_g__diameter__conn__id = const_cast< const Socket__API__Definitions::PortEvent&>(port__evt).connOpened().connId();
break;
}
}
if (tmp_66_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(385);
/* DIAMETER_Emulation.ttcn, line 385 */
tmp_66_alt_flag_1 = DIAMETER__Emulation__CT_component_DIAMETER.receive(Socket__API__Definitions::PortEvent_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_1 == ALT_YES) break;
}
if (tmp_66_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(387);
/* DIAMETER_Emulation.ttcn, line 387 */
tmp_66_alt_flag_2 = DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.receive(DIAMETER__Types::PDU__DIAMETER_template(ANY_VALUE), &(msg), any_compref, &(vc__conn), NULL, NULL);
if (tmp_66_alt_flag_2 == ALT_YES) {
current_location.update_lineno(390);
/* DIAMETER_Emulation.ttcn, line 390 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), DIAMETER__Types::PDU__DIAMETER_template(msg)), FALSE, NULL);
break;
}
}
if (tmp_66_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(394);
/* DIAMETER_Emulation.ttcn, line 394 */
tmp_66_alt_flag_3 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(DIAMETER__Templates::tr__DIAMETER__R(DIAMETER__Types::Command__Code_template(DIAMETER__Types::Command__Code::Capabilities__Exchange), DIAMETER__Templates::tr__DIAMETER__R_app__id_defval, DIAMETER__Templates::tr__DIAMETER__R_hbh__id_defval, DIAMETER__Templates::tr__DIAMETER__R_ete__id_defval, DIAMETER__Templates::tr__DIAMETER__R_avps_defval)), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_3 == ALT_YES) {
current_location.update_lineno(395);
/* DIAMETER_Emulation.ttcn, line 395 */
DIAMETER__Types::PDU__DIAMETER_template resp;
current_location.update_lineno(396);
/* DIAMETER_Emulation.ttcn, line 396 */
resp = DIAMETER__Templates::f__ts__DIA__CEA(OCTETSTRING_template(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg().hop__by__hop__id()), OCTETSTRING_template(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg().end__to__end__id()), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__host()), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__realm()), OCTETSTRING_template(Native__Functions::f__inet__addr(const_cast< const DIAMETER__conn__parameters&>(p).local__ip())), INTEGER_template(const_cast< const DIAMETER__conn__parameters&>(p).auth__app__id()), INTEGER_template(const_cast< const DIAMETER__conn__parameters&>(p).vendor__app__id()));
current_location.update_lineno(398);
/* DIAMETER_Emulation.ttcn, line 398 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), resp), FALSE, NULL);
current_location.update_lineno(400);
/* DIAMETER_Emulation.ttcn, line 400 */
{
DiameterCapabilityExchgInd_template tmp_70;
tmp_70.rx() = const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg();
tmp_70.tx() = resp.valueof();
DIAMETER__Emulation__CT_component_DIAMETER__UNIT.send(tmp_70, FALSE, NULL);
}
break;
}
}
if (tmp_66_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(403);
/* DIAMETER_Emulation.ttcn, line 403 */
tmp_66_alt_flag_4 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(DIAMETER__Templates::tr__DIA__DWR(DIAMETER__Templates::tr__DIA__DWR_state__id_defval, DIAMETER__Templates::tr__DIA__DWR_orig__host_defval, DIAMETER__Templates::tr__DIA__DWR_orig__realm_defval, DIAMETER__Templates::tr__DIA__DWR_hbh__id_defval, DIAMETER__Templates::tr__DIA__DWR_ete__id_defval)), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_4 == ALT_YES) {
current_location.update_lineno(404);
/* DIAMETER_Emulation.ttcn, line 404 */
DIAMETER__Types::PDU__DIAMETER_template resp;
current_location.update_lineno(405);
/* DIAMETER_Emulation.ttcn, line 405 */
resp = DIAMETER__Templates::ts__DIA__DWA(OCTETSTRING_template(os_0), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__host()), CHARSTRING_template(const_cast< const DIAMETER__conn__parameters&>(p).origin__realm()), OCTETSTRING_template(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg().hop__by__hop__id()), OCTETSTRING_template(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg().end__to__end__id()));
current_location.update_lineno(408);
/* DIAMETER_Emulation.ttcn, line 408 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), DIAMETER__Types::PDU__DIAMETER_template(resp.valueof())), FALSE, NULL);
break;
}
}
if (tmp_66_alt_flag_5 == ALT_UNCHECKED) {
current_location.update_lineno(412);
/* DIAMETER_Emulation.ttcn, line 412 */
if (const_cast< const DIAMETEROps&>(ops).raw()) tmp_66_alt_flag_5 = ALT_MAYBE;
else tmp_66_alt_flag_5 = ALT_NO;
}
if (tmp_66_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(412);
/* DIAMETER_Emulation.ttcn, line 412 */
tmp_66_alt_flag_5 = DIAMETER__Emulation__CT_component_DIAMETER__UNIT.receive(DIAMETER__Types::PDU__DIAMETER_template(ANY_VALUE), &(msg), any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_5 == ALT_YES) {
current_location.update_lineno(413);
/* DIAMETER_Emulation.ttcn, line 413 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), DIAMETER__Types::PDU__DIAMETER_template(msg)), FALSE, NULL);
break;
}
}
if (tmp_66_alt_flag_6 == ALT_UNCHECKED) {
current_location.update_lineno(416);
/* DIAMETER_Emulation.ttcn, line 416 */
if (const_cast< const DIAMETEROps&>(ops).raw()) tmp_66_alt_flag_6 = ALT_MAYBE;
else tmp_66_alt_flag_6 = ALT_NO;
}
if (tmp_66_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(416);
/* DIAMETER_Emulation.ttcn, line 416 */
tmp_66_alt_flag_6 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(DIAMETER__Types::PDU__DIAMETER_template(ANY_VALUE)), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_6 == ALT_YES) {
current_location.update_lineno(417);
/* DIAMETER_Emulation.ttcn, line 417 */
DIAMETER__Emulation__CT_component_DIAMETER__UNIT.send(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg(), FALSE, NULL);
break;
}
}
if (tmp_66_alt_flag_7 == ALT_UNCHECKED) {
current_location.update_lineno(420);
/* DIAMETER_Emulation.ttcn, line 420 */
if ((!(const_cast< const DIAMETEROps&>(ops).raw()))) tmp_66_alt_flag_7 = ALT_MAYBE;
else tmp_66_alt_flag_7 = ALT_NO;
}
if (tmp_66_alt_flag_7 == ALT_MAYBE) {
current_location.update_lineno(420);
/* DIAMETER_Emulation.ttcn, line 420 */
tmp_66_alt_flag_7 = DIAMETER__Emulation__CT_component_DIAMETER.receive(tr__DIAMETER__RecvFrom__R(DIAMETER__Types::PDU__DIAMETER_template(ANY_VALUE)), &(mrf), any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_7 == ALT_YES) {
current_location.update_lineno(421);
/* DIAMETER_Emulation.ttcn, line 421 */
imsi__t = f__DIAMETER__get__imsi(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg());
current_location.update_lineno(422);
/* DIAMETER_Emulation.ttcn, line 422 */
ete__id = const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg().end__to__end__id();
current_location.update_lineno(423);
/* DIAMETER_Emulation.ttcn, line 423 */
if (f__ete__id__known(ete__id)) {
current_location.update_lineno(424);
/* DIAMETER_Emulation.ttcn, line 424 */
vc__conn = f__comp__by__ete__id(ete__id);
current_location.update_lineno(426);
/* DIAMETER_Emulation.ttcn, line 426 */
f__eteid__table__del(vc__conn, ete__id);
current_location.update_lineno(427);
/* DIAMETER_Emulation.ttcn, line 427 */
DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.send(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(428);
/* DIAMETER_Emulation.ttcn, line 428 */
if (imsi__t.is_value()) {
current_location.update_lineno(429);
/* DIAMETER_Emulation.ttcn, line 429 */
imsi = imsi__t.valueof();
current_location.update_lineno(430);
/* DIAMETER_Emulation.ttcn, line 430 */
if (f__imsi__known(imsi)) {
current_location.update_lineno(431);
/* DIAMETER_Emulation.ttcn, line 431 */
vc__conn = f__comp__by__imsi(imsi);
current_location.update_lineno(432);
/* DIAMETER_Emulation.ttcn, line 432 */
DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.send(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(434);
/* DIAMETER_Emulation.ttcn, line 434 */
vc__conn = const_cast< const DIAMETEROps&>(ops).create__cb().invoke(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg(), imsi, id);
current_location.update_lineno(435);
/* DIAMETER_Emulation.ttcn, line 435 */
f__imsi__table__add(vc__conn, imsi);
current_location.update_lineno(436);
/* DIAMETER_Emulation.ttcn, line 436 */
DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.send(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg(), COMPONENT(vc__conn), NULL);
}
}
else {
current_location.update_lineno(440);
/* DIAMETER_Emulation.ttcn, line 440 */
DIAMETER__Types::PDU__DIAMETER_template resp(const_cast< const DIAMETEROps&>(ops).unitdata__cb().invoke(const_cast< const DIAMETER__CodecPort::DIAMETER__RecvFrom&>(mrf).msg()));
current_location.update_lineno(441);
/* DIAMETER_Emulation.ttcn, line 441 */
if (resp.is_value()) {
current_location.update_lineno(442);
/* DIAMETER_Emulation.ttcn, line 442 */
DIAMETER__Emulation__CT_component_DIAMETER.send(DIAMETER__CodecPort::t__DIAMETER__Send(INTEGER_template(DIAMETER__Emulation__CT_component_g__diameter__conn__id), DIAMETER__Types::PDU__DIAMETER_template(resp.valueof())), FALSE, NULL);
}
}
}
break;
}
}
if (tmp_66_alt_flag_8 == ALT_MAYBE) {
current_location.update_lineno(446);
/* DIAMETER_Emulation.ttcn, line 446 */
tmp_66_alt_flag_8 = DIAMETER__Emulation__CT_component_DIAMETER.receive(SCTP__Templates::tr__SctpAssocChange(SCTP__Templates::tr__SctpAssocChange_state_defval, SCTP__Templates::tr__SctpAssocChange_conn__id_defval, SCTP__Templates::tr__SctpAssocChange_sctp_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_8 == ALT_YES) break;
}
if (tmp_66_alt_flag_9 == ALT_MAYBE) {
current_location.update_lineno(447);
/* DIAMETER_Emulation.ttcn, line 447 */
tmp_66_alt_flag_9 = DIAMETER__Emulation__CT_component_DIAMETER.receive(SCTP__Templates::tr__SctpPeerAddrChange(SCTP__Templates::tr__SctpPeerAddrChange_state_defval, SCTP__Templates::tr__SctpPeerAddrChange_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_66_alt_flag_9 == ALT_YES) break;
}
if (tmp_66_alt_flag_10 == ALT_MAYBE) {
current_location.update_lineno(448);
/* DIAMETER_Emulation.ttcn, line 448 */
{
DIAMETEREM__register__imsi_template tmp_78;
tmp_78.imsi() = ANY_VALUE;
tmp_78.hdlr() = ANY_VALUE;
tmp_66_alt_flag_10 = DIAMETER__Emulation__CT_component_DIAMETER__PROC.getcall(tmp_78, any_compref, DIAMETEREM__register__imsi_call_redirect(&(imsi), &(vc__conn)), NULL, NULL, NULL);
}
if (tmp_66_alt_flag_10 == ALT_YES) {
current_location.update_lineno(449);
/* DIAMETER_Emulation.ttcn, line 449 */
f__create__expect(imsi, vc__conn);
current_location.update_lineno(450);
/* DIAMETER_Emulation.ttcn, line 450 */
{
DIAMETEREM__register__imsi_template tmp_79;
tmp_79.imsi() = imsi;
tmp_79.hdlr() = vc__conn;
DIAMETER__Emulation__CT_component_DIAMETER__PROC.reply(tmp_79, COMPONENT(vc__conn), NULL);
}
break;
}
}
if (tmp_66_alt_flag_11 == ALT_MAYBE) {
current_location.update_lineno(452);
/* DIAMETER_Emulation.ttcn, line 452 */
{
DIAMETEREM__register__eteid_template tmp_80;
tmp_80.ete__id() = ANY_VALUE;
tmp_80.hdlr() = ANY_VALUE;
tmp_66_alt_flag_11 = DIAMETER__Emulation__CT_component_DIAMETER__PROC.getcall(tmp_80, any_compref, DIAMETEREM__register__eteid_call_redirect(&(ete__id), &(vc__conn)), NULL, NULL, NULL);
}
if (tmp_66_alt_flag_11 == ALT_YES) {
current_location.update_lineno(453);
/* DIAMETER_Emulation.ttcn, line 453 */
f__eteid__table__add(vc__conn, ete__id);
current_location.update_lineno(454);
/* DIAMETER_Emulation.ttcn, line 454 */
{
DIAMETEREM__register__eteid_template tmp_81;
tmp_81.ete__id() = ete__id;
tmp_81.hdlr() = vc__conn;
DIAMETER__Emulation__CT_component_DIAMETER__PROC.reply(tmp_81, COMPONENT(vc__conn), NULL);
}
break;
}
}
if (tmp_66_default_flag == ALT_MAYBE) {
tmp_66_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_66_default_flag == ALT_YES || tmp_66_default_flag == ALT_BREAK) break;
else if (tmp_66_default_flag == ALT_REPEAT) goto tmp_66;
}
current_location.update_lineno(381);
/* DIAMETER_Emulation.ttcn, line 381 */
if (tmp_66_alt_flag_0 == ALT_NO && tmp_66_alt_flag_1 == ALT_NO && tmp_66_alt_flag_2 == ALT_NO && tmp_66_alt_flag_3 == ALT_NO && tmp_66_alt_flag_4 == ALT_NO && tmp_66_alt_flag_5 == ALT_NO && tmp_66_alt_flag_6 == ALT_NO && tmp_66_alt_flag_7 == ALT_NO && tmp_66_alt_flag_8 == ALT_NO && tmp_66_alt_flag_9 == ALT_NO && tmp_66_alt_flag_10 == ALT_NO && tmp_66_alt_flag_11 == ALT_NO && tmp_66_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file DIAMETER_Emulation.ttcn between lines 381 and 457.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}
}

void start_main_(const COMPONENT& component_reference, const DIAMETEROps& ops, const DIAMETER__conn__parameters& p, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function main(");
ops.log();
TTCN_Logger::log_event_str(", ");
p.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "main", text_buf);
ops.encode_text(text_buf);
p.encode_text(text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__diameter__expect__eteid(const OCTETSTRING& ete__id)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 471, TTCN_Location::LOCATION_FUNCTION, "f_diameter_expect_eteid");
current_location.update_lineno(472);
/* DIAMETER_Emulation.ttcn, line 472 */
{
DIAMETEREM__register__eteid_template tmp_82;
tmp_82.ete__id() = ete__id;
tmp_82.hdlr() = self;
DIAMETER__ConnHdlr_component_DIAMETER__PROC.call(tmp_82, FALSE, NULL);
}
{
alt_status tmp_83_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(472);
/* DIAMETER_Emulation.ttcn, line 472 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_83_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(473);
/* DIAMETER_Emulation.ttcn, line 473 */
{
DIAMETEREM__register__eteid_template tmp_84;
tmp_84.ete__id() = ANY_VALUE;
tmp_84.hdlr() = ANY_VALUE;
tmp_83_alt_flag_0 = DIAMETER__ConnHdlr_component_DIAMETER__PROC.getreply(tmp_84, any_compref, DIAMETEREM__register__eteid_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_83_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(472);
/* DIAMETER_Emulation.ttcn, line 472 */
if (tmp_83_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file DIAMETER_Emulation.ttcn between lines 472 and 474.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__diameter__expect__eteid(const COMPONENT& component_reference, const OCTETSTRING& ete__id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_expect_eteid(");
ete__id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_diameter_expect_eteid", text_buf);
ete__id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

COMPONENT ExpectedCreateCallback(const DIAMETER__Types::PDU__DIAMETER& msg, const HEXSTRING& imsi, const CHARSTRING& )
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 487, TTCN_Location::LOCATION_FUNCTION, "ExpectedCreateCallback");
current_location.update_lineno(489);
/* DIAMETER_Emulation.ttcn, line 489 */
COMPONENT ret(NULL_COMPREF);
current_location.update_lineno(490);
/* DIAMETER_Emulation.ttcn, line 490 */
INTEGER i;
current_location.update_lineno(492);
/* DIAMETER_Emulation.ttcn, line 492 */
i = 0;
current_location.update_lineno(492);
/* DIAMETER_Emulation.ttcn, line 492 */
for ( ; ; ) {
current_location.update_lineno(492);
/* DIAMETER_Emulation.ttcn, line 492 */
if (!(i < 256)) break;
{
current_location.update_lineno(493);
/* DIAMETER_Emulation.ttcn, line 493 */
{
boolean tmp_92;
{
boolean tmp_87 = DIAMETER__Emulation__CT_component_DiameterExpectTable.is_bound();
if(tmp_87) {
const int tmp_88 = i;
tmp_87 = (tmp_88 >= 0) && (DIAMETER__Emulation__CT_component_DiameterExpectTable.size_of() > tmp_88);
if(tmp_87) {
const ExpectData& tmp_89 = DIAMETER__Emulation__CT_component_DiameterExpectTable[tmp_88];
tmp_87 = tmp_89.is_bound();
if(tmp_87) {
const OPTIONAL< HEXSTRING >& tmp_90 = tmp_89.imsi();
switch (tmp_90.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_87 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_87 = FALSE;
break;
default:
{
const HEXSTRING& tmp_91 = (const HEXSTRING&) tmp_90;
tmp_87 = tmp_91.is_present();
break;}
}
}
}
}
tmp_92 = (!(tmp_87));
}
if (tmp_92) {
current_location.update_lineno(494);
/* DIAMETER_Emulation.ttcn, line 494 */
goto tmp_86;
}
}
current_location.update_lineno(496);
/* DIAMETER_Emulation.ttcn, line 496 */
if ((imsi == const_cast< const VALUE_ARRAY<ExpectData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterExpectTable)[i].imsi())) {
current_location.update_lineno(497);
/* DIAMETER_Emulation.ttcn, line 497 */
ret = const_cast< const VALUE_ARRAY<ExpectData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterExpectTable)[i].vc__conn();
current_location.update_lineno(499);
/* DIAMETER_Emulation.ttcn, line 499 */
DIAMETER__Emulation__CT_component_DiameterExpectTable[i].imsi() = OMIT_VALUE;
current_location.update_lineno(500);
/* DIAMETER_Emulation.ttcn, line 500 */
DIAMETER__Emulation__CT_component_DiameterExpectTable[i].vc__conn() = NULL_COMPREF;
current_location.update_lineno(501);
/* DIAMETER_Emulation.ttcn, line 501 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Found Expect[");
i.log();
TTCN_Logger::log_event_str("] for ");
msg.log();
TTCN_Logger::log_event_str(" handled at ");
ret.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(502);
/* DIAMETER_Emulation.ttcn, line 502 */
return ret;
}
}
tmp_86:
current_location.update_lineno(492);
/* DIAMETER_Emulation.ttcn, line 492 */
{
INTEGER tmp_96;
++i;
}
}
current_location.update_lineno(505);
/* DIAMETER_Emulation.ttcn, line 505 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Couldn't find Expect for "),msg.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(506);
/* DIAMETER_Emulation.ttcn, line 506 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

void start_ExpectedCreateCallback(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER& msg, const HEXSTRING& imsi, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function ExpectedCreateCallback(");
msg.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "ExpectedCreateCallback", text_buf);
msg.encode_text(text_buf);
imsi.encode_text(text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__create__expect(const HEXSTRING& imsi, const COMPONENT& hdlr)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 509, TTCN_Location::LOCATION_FUNCTION, "f_create_expect");
current_location.update_lineno(511);
/* DIAMETER_Emulation.ttcn, line 511 */
INTEGER i;
current_location.update_lineno(514);
/* DIAMETER_Emulation.ttcn, line 514 */
i = 0;
current_location.update_lineno(514);
/* DIAMETER_Emulation.ttcn, line 514 */
for ( ; ; ) {
current_location.update_lineno(514);
/* DIAMETER_Emulation.ttcn, line 514 */
if (!(i < 256)) break;
current_location.update_lineno(515);
/* DIAMETER_Emulation.ttcn, line 515 */
if ((imsi == const_cast< const VALUE_ARRAY<ExpectData, 256, 0>&>(DIAMETER__Emulation__CT_component_DiameterExpectTable)[i].imsi())) {
current_location.update_lineno(516);
/* DIAMETER_Emulation.ttcn, line 516 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("IMSI already present"),imsi.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(517);
/* DIAMETER_Emulation.ttcn, line 517 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
current_location.update_lineno(514);
/* DIAMETER_Emulation.ttcn, line 514 */
{
INTEGER tmp_98;
++i;
}
}
current_location.update_lineno(520);
/* DIAMETER_Emulation.ttcn, line 520 */
i = 0;
current_location.update_lineno(520);
/* DIAMETER_Emulation.ttcn, line 520 */
for ( ; ; ) {
current_location.update_lineno(520);
/* DIAMETER_Emulation.ttcn, line 520 */
if (!(i < 256)) break;
current_location.update_lineno(521);
/* DIAMETER_Emulation.ttcn, line 521 */
{
boolean tmp_105;
{
boolean tmp_100 = DIAMETER__Emulation__CT_component_DiameterExpectTable.is_bound();
if(tmp_100) {
const int tmp_101 = i;
tmp_100 = (tmp_101 >= 0) && (DIAMETER__Emulation__CT_component_DiameterExpectTable.size_of() > tmp_101);
if(tmp_100) {
const ExpectData& tmp_102 = DIAMETER__Emulation__CT_component_DiameterExpectTable[tmp_101];
tmp_100 = tmp_102.is_bound();
if(tmp_100) {
const OPTIONAL< HEXSTRING >& tmp_103 = tmp_102.imsi();
switch (tmp_103.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_100 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_100 = FALSE;
break;
default:
{
const HEXSTRING& tmp_104 = (const HEXSTRING&) tmp_103;
tmp_100 = tmp_104.is_present();
break;}
}
}
}
}
tmp_105 = (!(tmp_100));
}
if (tmp_105) {
current_location.update_lineno(522);
/* DIAMETER_Emulation.ttcn, line 522 */
DIAMETER__Emulation__CT_component_DiameterExpectTable[i].imsi() = imsi;
current_location.update_lineno(523);
/* DIAMETER_Emulation.ttcn, line 523 */
DIAMETER__Emulation__CT_component_DiameterExpectTable[i].vc__conn() = hdlr;
current_location.update_lineno(524);
/* DIAMETER_Emulation.ttcn, line 524 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Created Expect[");
i.log();
TTCN_Logger::log_event_str("] for ");
imsi.log();
TTCN_Logger::log_event_str(" to be handled at ");
hdlr.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(525);
/* DIAMETER_Emulation.ttcn, line 525 */
return;
}
}
current_location.update_lineno(520);
/* DIAMETER_Emulation.ttcn, line 520 */
{
INTEGER tmp_108;
++i;
}
}
current_location.update_lineno(528);
/* DIAMETER_Emulation.ttcn, line 528 */
TTCN_Logger::log_str(TTCN_USER, "No space left in DiameterExpectTable");
TTCN_error("testcase.stop");
}

void start_f__create__expect(const COMPONENT& component_reference, const HEXSTRING& imsi, const COMPONENT& hdlr)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_create_expect(");
imsi.log();
TTCN_Logger::log_event_str(", ");
hdlr.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_create_expect", text_buf);
imsi.encode_text(text_buf);
hdlr.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__diameter__expect__imsi(const HEXSTRING& imsi)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 532, TTCN_Location::LOCATION_FUNCTION, "f_diameter_expect_imsi");
current_location.update_lineno(533);
/* DIAMETER_Emulation.ttcn, line 533 */
{
DIAMETEREM__register__imsi_template tmp_109;
tmp_109.imsi() = imsi;
tmp_109.hdlr() = self;
DIAMETER__ConnHdlr_component_DIAMETER__PROC.call(tmp_109, FALSE, NULL);
}
{
alt_status tmp_110_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(533);
/* DIAMETER_Emulation.ttcn, line 533 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_110_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(534);
/* DIAMETER_Emulation.ttcn, line 534 */
{
DIAMETEREM__register__imsi_template tmp_111;
tmp_111.imsi() = ANY_VALUE;
tmp_111.hdlr() = ANY_VALUE;
tmp_110_alt_flag_0 = DIAMETER__ConnHdlr_component_DIAMETER__PROC.getreply(tmp_111, any_compref, DIAMETEREM__register__imsi_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_110_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(533);
/* DIAMETER_Emulation.ttcn, line 533 */
if (tmp_110_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file DIAMETER_Emulation.ttcn between lines 533 and 535.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__diameter__expect__imsi(const COMPONENT& component_reference, const HEXSTRING& imsi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_expect_imsi(");
imsi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_diameter_expect_imsi", text_buf);
imsi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__expect__table__init()
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 538, TTCN_Location::LOCATION_FUNCTION, "f_expect_table_init");
current_location.update_lineno(540);
/* DIAMETER_Emulation.ttcn, line 540 */
INTEGER i;
current_location.update_lineno(541);
/* DIAMETER_Emulation.ttcn, line 541 */
i = 0;
current_location.update_lineno(541);
/* DIAMETER_Emulation.ttcn, line 541 */
for ( ; ; ) {
current_location.update_lineno(541);
/* DIAMETER_Emulation.ttcn, line 541 */
if (!(i < 256)) break;
current_location.update_lineno(542);
/* DIAMETER_Emulation.ttcn, line 542 */
DIAMETER__Emulation__CT_component_DiameterExpectTable[i].imsi() = OMIT_VALUE;
current_location.update_lineno(541);
/* DIAMETER_Emulation.ttcn, line 541 */
{
INTEGER tmp_114;
++i;
}
}
}

void start_f__expect__table__init(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_expect_table_init(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "f_expect_table_init", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

DIAMETER__Types::PDU__DIAMETER_template DummyUnitdataCallback(const DIAMETER__Types::PDU__DIAMETER& msg)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 546, TTCN_Location::LOCATION_FUNCTION, "DummyUnitdataCallback");
current_location.update_lineno(548);
/* DIAMETER_Emulation.ttcn, line 548 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Ignoring DIAMETER ");
msg.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(549);
/* DIAMETER_Emulation.ttcn, line 549 */
return DIAMETER__Types::PDU__DIAMETER_template(OMIT_VALUE);
}

void start_DummyUnitdataCallback(const COMPONENT& component_reference, const DIAMETER__Types::PDU__DIAMETER& msg)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function DummyUnitdataCallback(");
msg.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "DIAMETER_Emulation", "DummyUnitdataCallback", text_buf);
msg.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__diameter__wait__capability(DIAMETER__PT& pt)
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 557, TTCN_Location::LOCATION_FUNCTION, "f_diameter_wait_capability");
current_location.update_lineno(560);
/* DIAMETER_Emulation.ttcn, line 560 */
TIMER T("T", 1.0e1);
current_location.update_lineno(561);
/* DIAMETER_Emulation.ttcn, line 561 */
T.start();
current_location.update_lineno(562);
/* DIAMETER_Emulation.ttcn, line 562 */
{
tmp_115:
alt_status tmp_115_alt_flag_0 = ALT_MAYBE;
alt_status tmp_115_alt_flag_1 = ALT_MAYBE;
alt_status tmp_115_alt_flag_2 = ALT_MAYBE;
alt_status tmp_115_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_115_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(563);
/* DIAMETER_Emulation.ttcn, line 563 */
tmp_115_alt_flag_0 = pt.receive(DiameterCapabilityExchgInd_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL);
if (tmp_115_alt_flag_0 == ALT_YES) break;
}
if (tmp_115_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(564);
/* DIAMETER_Emulation.ttcn, line 564 */
tmp_115_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_115_alt_flag_1 == ALT_YES) {
current_location.update_lineno(565);
/* DIAMETER_Emulation.ttcn, line 565 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected receive waiting for DiameterCapabilityExchgInd"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(566);
/* DIAMETER_Emulation.ttcn, line 566 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_115_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(568);
/* DIAMETER_Emulation.ttcn, line 568 */
tmp_115_alt_flag_2 = T.timeout(NULL);
if (tmp_115_alt_flag_2 == ALT_YES) {
current_location.update_lineno(569);
/* DIAMETER_Emulation.ttcn, line 569 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for DiameterCapabilityExchgInd"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(570);
/* DIAMETER_Emulation.ttcn, line 570 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_115_default_flag == ALT_MAYBE) {
tmp_115_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_115_default_flag == ALT_YES || tmp_115_default_flag == ALT_BREAK) break;
else if (tmp_115_default_flag == ALT_REPEAT) goto tmp_115;
}
current_location.update_lineno(562);
/* DIAMETER_Emulation.ttcn, line 562 */
if (tmp_115_alt_flag_0 == ALT_NO && tmp_115_alt_flag_1 == ALT_NO && tmp_115_alt_flag_2 == ALT_NO && tmp_115_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file DIAMETER_Emulation.ttcn between lines 562 and 572.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "DIAMETER_Emulation");
DIAMETER__CodecPort__CtrlFunct::module_object.pre_init_module();
DIAMETER__Templates::module_object.pre_init_module();
SCTP__Templates::module_object.pre_init_module();
module_object.add_function("tr_DIAMETER_RecvFrom_R", (genericfunc_t)&tr__DIAMETER__RecvFrom__R, (genericfunc_t)&start_tr__DIAMETER__RecvFrom__R);
module_object.add_function("f_imsi_known", (genericfunc_t)&f__imsi__known, (genericfunc_t)&start_f__imsi__known);
module_object.add_function("f_comp_known", (genericfunc_t)&f__comp__known, (genericfunc_t)&start_f__comp__known);
module_object.add_function("f_comp_by_imsi", (genericfunc_t)&f__comp__by__imsi, (genericfunc_t)&start_f__comp__by__imsi);
module_object.add_function("f_imsi_by_comp", (genericfunc_t)&f__imsi__by__comp, (genericfunc_t)&start_f__imsi__by__comp);
module_object.add_function("f_imsi_table_add", (genericfunc_t)&f__imsi__table__add, (genericfunc_t)&start_f__imsi__table__add);
module_object.add_function("f_imsi_table_del", (genericfunc_t)&f__imsi__table__del, (genericfunc_t)&start_f__imsi__table__del);
module_object.add_function("f_imsi_table_init", (genericfunc_t)&f__imsi__table__init, (genericfunc_t)&start_f__imsi__table__init);
module_object.add_function("f_ete_id_known", (genericfunc_t)&f__ete__id__known, (genericfunc_t)&start_f__ete__id__known);
module_object.add_function("f_comp_by_ete_id", (genericfunc_t)&f__comp__by__ete__id, (genericfunc_t)&start_f__comp__by__ete__id);
module_object.add_function("f_eteid_table_add", (genericfunc_t)&f__eteid__table__add, (genericfunc_t)&start_f__eteid__table__add);
module_object.add_function("f_eteid_table_del", (genericfunc_t)&f__eteid__table__del, (genericfunc_t)&start_f__eteid__table__del);
module_object.add_function("f_eteid_table_init", (genericfunc_t)&f__eteid__table__init, (genericfunc_t)&start_f__eteid__table__init);
module_object.add_function("f_DIAMETER_get_imsi", (genericfunc_t)&f__DIAMETER__get__imsi, NULL);
module_object.add_function("f_diameter_xceive", (genericfunc_t)&f__diameter__xceive, (genericfunc_t)&start_f__diameter__xceive);
module_object.add_function("main", (genericfunc_t)&main_, (genericfunc_t)&start_main_);
module_object.add_function("f_diameter_expect_eteid", (genericfunc_t)&f__diameter__expect__eteid, (genericfunc_t)&start_f__diameter__expect__eteid);
module_object.add_function("ExpectedCreateCallback", (genericfunc_t)&ExpectedCreateCallback, (genericfunc_t)&start_ExpectedCreateCallback);
module_object.add_function("f_create_expect", (genericfunc_t)&f__create__expect, (genericfunc_t)&start_f__create__expect);
module_object.add_function("f_diameter_expect_imsi", (genericfunc_t)&f__diameter__expect__imsi, (genericfunc_t)&start_f__diameter__expect__imsi);
module_object.add_function("f_expect_table_init", (genericfunc_t)&f__expect__table__init, (genericfunc_t)&start_f__expect__table__init);
module_object.add_function("DummyUnitdataCallback", (genericfunc_t)&DummyUnitdataCallback, (genericfunc_t)&start_DummyUnitdataCallback);
module_object.add_function("f_diameter_wait_capability", (genericfunc_t)&f__diameter__wait__capability, NULL);
}

void post_init_module()
{
TTCN_Location current_location("DIAMETER_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "DIAMETER_Emulation");
DIAMETER__CodecPort__CtrlFunct::module_object.post_init_module();
DIAMETER__Templates::module_object.post_init_module();
SCTP__Templates::module_object.post_init_module();
current_location.update_lineno(313);
/* DIAMETER_Emulation.ttcn, line 313 */
template_f__diameter__xceive_rx__t_defval = ANY_VALUE;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "DIAMETER_ConnHdlr")) {
DIAMETER__ConnHdlr_component_DIAMETER.activate_port();
DIAMETER__ConnHdlr_component_DIAMETER__PROC.activate_port();
return TRUE;
} else if (!strcmp(component_type, "DIAMETER_Emulation_CT")) {
DIAMETER__Emulation__CT_component_DIAMETER.activate_port();
DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.activate_port();
DIAMETER__Emulation__CT_component_DiameterAssocTable.clean_up();
DIAMETER__Emulation__CT_component_DiameterETEIDTable.clean_up();
DIAMETER__Emulation__CT_component_DiameterExpectTable.clean_up();
DIAMETER__Emulation__CT_component_DIAMETER__PROC.activate_port();
DIAMETER__Emulation__CT_component_DIAMETER__UNIT.activate_port();
DIAMETER__Emulation__CT_component_g__diameter__id.clean_up();
DIAMETER__Emulation__CT_component_g__diameter__conn__id = -1;
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "DIAMETER_ConnHdlr")) {
if (!strcmp(port_name, "DIAMETER")) {
DIAMETER__ConnHdlr_component_DIAMETER.safe_start();
return TRUE;
}
if (!strcmp(port_name, "DIAMETER_PROC")) {
DIAMETER__ConnHdlr_component_DIAMETER__PROC.safe_start();
return TRUE;
}
}
else if (!strcmp(component_type, "DIAMETER_Emulation_CT")) {
if (!strcmp(port_name, "DIAMETER")) {
DIAMETER__Emulation__CT_component_DIAMETER.safe_start();
return TRUE;
}
if (!strcmp(port_name, "DIAMETER_CLIENT")) {
DIAMETER__Emulation__CT_component_DIAMETER__CLIENT.safe_start();
return TRUE;
}
if (!strcmp(port_name, "DIAMETER_PROC")) {
DIAMETER__Emulation__CT_component_DIAMETER__PROC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "DIAMETER_UNIT")) {
DIAMETER__Emulation__CT_component_DIAMETER__UNIT.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "tr_DIAMETER_RecvFrom_R")) {
DIAMETER__Types::PDU__DIAMETER_template msg;
msg.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function tr_DIAMETER_RecvFrom_R(");
msg.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
tr__DIAMETER__RecvFrom__R(msg);
TTCN_Runtime::function_finished("tr_DIAMETER_RecvFrom_R");
return TRUE;
} else if (!strcmp(function_name, "f_imsi_known")) {
HEXSTRING imsi;
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_known(");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__imsi__known(imsi);
TTCN_Runtime::function_finished("f_imsi_known");
return TRUE;
} else if (!strcmp(function_name, "f_comp_known")) {
COMPONENT client;
client.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_known(");
client.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__comp__known(client);
TTCN_Runtime::function_finished("f_comp_known");
return TRUE;
} else if (!strcmp(function_name, "f_comp_by_imsi")) {
HEXSTRING imsi;
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_by_imsi(");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__comp__by__imsi(imsi);
TTCN_Runtime::function_finished("f_comp_by_imsi");
return TRUE;
} else if (!strcmp(function_name, "f_imsi_by_comp")) {
COMPONENT client;
client.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_by_comp(");
client.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__imsi__by__comp(client);
TTCN_Runtime::function_finished("f_imsi_by_comp");
return TRUE;
} else if (!strcmp(function_name, "f_imsi_table_add")) {
COMPONENT comp__ref;
HEXSTRING imsi;
comp__ref.decode_text(function_arguments);
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_table_add(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__imsi__table__add(comp__ref, imsi);
TTCN_Runtime::function_finished("f_imsi_table_add");
return TRUE;
} else if (!strcmp(function_name, "f_imsi_table_del")) {
COMPONENT comp__ref;
HEXSTRING imsi;
comp__ref.decode_text(function_arguments);
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_imsi_table_del(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__imsi__table__del(comp__ref, imsi);
TTCN_Runtime::function_finished("f_imsi_table_del");
return TRUE;
} else if (!strcmp(function_name, "f_imsi_table_init")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_imsi_table_init().");
TTCN_Runtime::function_started(function_arguments);
f__imsi__table__init();
TTCN_Runtime::function_finished("f_imsi_table_init");
return TRUE;
} else if (!strcmp(function_name, "f_ete_id_known")) {
OCTETSTRING ete__id;
ete__id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ete_id_known(");
ete__id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ete__id__known(ete__id);
TTCN_Runtime::function_finished("f_ete_id_known");
return TRUE;
} else if (!strcmp(function_name, "f_comp_by_ete_id")) {
OCTETSTRING ete__id;
ete__id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_by_ete_id(");
ete__id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__comp__by__ete__id(ete__id);
TTCN_Runtime::function_finished("f_comp_by_ete_id");
return TRUE;
} else if (!strcmp(function_name, "f_eteid_table_add")) {
COMPONENT comp__ref;
OCTETSTRING ete__id;
comp__ref.decode_text(function_arguments);
ete__id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_eteid_table_add(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
ete__id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__eteid__table__add(comp__ref, ete__id);
TTCN_Runtime::function_finished("f_eteid_table_add");
return TRUE;
} else if (!strcmp(function_name, "f_eteid_table_del")) {
COMPONENT comp__ref;
OCTETSTRING ete__id;
comp__ref.decode_text(function_arguments);
ete__id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_eteid_table_del(");
comp__ref.log();
TTCN_Logger::log_event_str(", ");
ete__id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__eteid__table__del(comp__ref, ete__id);
TTCN_Runtime::function_finished("f_eteid_table_del");
return TRUE;
} else if (!strcmp(function_name, "f_eteid_table_init")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_eteid_table_init().");
TTCN_Runtime::function_started(function_arguments);
f__eteid__table__init();
TTCN_Runtime::function_finished("f_eteid_table_init");
return TRUE;
} else if (!strcmp(function_name, "f_diameter_xceive")) {
DIAMETER__Types::PDU__DIAMETER_template tx;
DIAMETER__Types::PDU__DIAMETER_template rx__t;
tx.decode_text(function_arguments);
rx__t.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_xceive(");
tx.log();
TTCN_Logger::log_event_str(", ");
rx__t.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__diameter__xceive(tx, rx__t);
TTCN_Runtime::function_finished("f_diameter_xceive");
return TRUE;
} else if (!strcmp(function_name, "main")) {
DIAMETEROps ops;
DIAMETER__conn__parameters p;
CHARSTRING id;
ops.decode_text(function_arguments);
p.decode_text(function_arguments);
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function main(");
ops.log();
TTCN_Logger::log_event_str(", ");
p.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
main_(ops, p, id);
TTCN_Runtime::function_finished("main");
return TRUE;
} else if (!strcmp(function_name, "f_diameter_expect_eteid")) {
OCTETSTRING ete__id;
ete__id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_expect_eteid(");
ete__id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__diameter__expect__eteid(ete__id);
TTCN_Runtime::function_finished("f_diameter_expect_eteid");
return TRUE;
} else if (!strcmp(function_name, "ExpectedCreateCallback")) {
DIAMETER__Types::PDU__DIAMETER msg;
HEXSTRING imsi;
CHARSTRING id;
msg.decode_text(function_arguments);
imsi.decode_text(function_arguments);
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function ExpectedCreateCallback(");
msg.log();
TTCN_Logger::log_event_str(", ");
imsi.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
ExpectedCreateCallback(msg, imsi, id);
TTCN_Runtime::function_finished("ExpectedCreateCallback");
return TRUE;
} else if (!strcmp(function_name, "f_create_expect")) {
HEXSTRING imsi;
COMPONENT hdlr;
imsi.decode_text(function_arguments);
hdlr.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_create_expect(");
imsi.log();
TTCN_Logger::log_event_str(", ");
hdlr.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__create__expect(imsi, hdlr);
TTCN_Runtime::function_finished("f_create_expect");
return TRUE;
} else if (!strcmp(function_name, "f_diameter_expect_imsi")) {
HEXSTRING imsi;
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_diameter_expect_imsi(");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__diameter__expect__imsi(imsi);
TTCN_Runtime::function_finished("f_diameter_expect_imsi");
return TRUE;
} else if (!strcmp(function_name, "f_expect_table_init")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_expect_table_init().");
TTCN_Runtime::function_started(function_arguments);
f__expect__table__init();
TTCN_Runtime::function_finished("f_expect_table_init");
return TRUE;
} else if (!strcmp(function_name, "DummyUnitdataCallback")) {
DIAMETER__Types::PDU__DIAMETER msg;
msg.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function DummyUnitdataCallback(");
msg.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
DummyUnitdataCallback(msg);
TTCN_Runtime::function_finished("DummyUnitdataCallback");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
