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

namespace L1CTL__PortType {

/* Literal string constants */

extern const CHARSTRING cs_0(15, "/tmp/osmocom_l2");
const unsigned char module_checksum[] = { 0x7b, 0xe3, 0x40, 0xfe, 0xbd, 0x72, 0x67, 0x1f, 0xe4, 0x94, 0xf9, 0xa5, 0x7c, 0x10, 0x57, 0x57 };

/* Global variable definitions */

const XERdescriptor_t       L1CTL__connect_path_xer_ = { {"path>\n", "path>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t L1CTL__connect_path_descr_ = { "@L1CTL_PortType.L1CTL_connect.path", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &L1CTL__connect_path_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for L1CTL__connect
const TTCN_Typedescriptor_t L1CTL__connect_descr_ = { "@L1CTL_PortType.L1CTL_connect", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for L1CTL__connect__result
const TTCN_Typedescriptor_t L1CTL__connect__result_descr_ = { "@L1CTL_PortType.L1CTL_connect_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       L1CTL__connect__result_err_xer_ = { {"err>\n", "err>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t L1CTL__connect__result_err_descr_ = { "@L1CTL_PortType.L1CTL_connect_result.err", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &L1CTL__connect__result_err_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
CHARSTRING modulepar_m__l1ctl__sock__path;
const CHARSTRING& m__l1ctl__sock__path = modulepar_m__l1ctl__sock__path;
GSM__Types::RslChannelNr_template template_f__L1CTL__rx__data_chan__nr_defval;
const GSM__Types::RslChannelNr_template& f__L1CTL__rx__data_chan__nr_defval = template_f__L1CTL__rx__data_chan__nr_defval;
GSM__Types::RslLinkId_template template_f__L1CTL__rx__data_link__id_defval;
const GSM__Types::RslLinkId_template& f__L1CTL__rx__data_link__id_defval = template_f__L1CTL__rx__data_link__id_defval;
L1CTL__Types::L1ctlCcchMode const_f__L1CTL__FBSB_ccch__mode_defval;
const L1CTL__Types::L1ctlCcchMode& f__L1CTL__FBSB_ccch__mode_defval = const_f__L1CTL__FBSB_ccch__mode_defval;
INTEGER const_f__L1CTL__FBSB_rxlev__exp_defval;
const INTEGER& f__L1CTL__FBSB_rxlev__exp_defval = const_f__L1CTL__FBSB_rxlev__exp_defval;
L1CTL__Types::L1ctlMessage_template template_f__L1CTL__TCH__MODE_tch__mode__req__tmpl_defval;
const L1CTL__Types::L1ctlMessage_template& f__L1CTL__TCH__MODE_tch__mode__req__tmpl_defval = template_f__L1CTL__TCH__MODE_tch__mode__req__tmpl_defval;
INTEGER const_f__L1CTL__RACH_combined_defval;
const INTEGER& f__L1CTL__RACH_combined_defval = const_f__L1CTL__RACH_combined_defval;
INTEGER const_f__L1CTL__RACH_offset_defval;
const INTEGER& f__L1CTL__RACH_offset_defval = const_f__L1CTL__RACH_offset_defval;
GSM__Types::RslChannelNr_template template_f__L1CTL__RACH_chan__nr_defval;
const GSM__Types::RslChannelNr_template& f__L1CTL__RACH_chan__nr_defval = template_f__L1CTL__RACH_chan__nr_defval;
GSM__Types::RslLinkId_template template_f__L1CTL__RACH_link__id_defval;
const GSM__Types::RslLinkId_template& f__L1CTL__RACH_link__id_defval = template_f__L1CTL__RACH_link__id_defval;
INTEGER const_f__L1CTL__EXT__RACH_combined_defval;
const INTEGER& f__L1CTL__EXT__RACH_combined_defval = const_f__L1CTL__EXT__RACH_combined_defval;
INTEGER const_f__L1CTL__EXT__RACH_offset_defval;
const INTEGER& f__L1CTL__EXT__RACH_offset_defval = const_f__L1CTL__EXT__RACH_offset_defval;
L1CTL__Types::L1ctlMA const_f__L1CTL__DM__EST__REQ__IA_ma_defval;
const L1CTL__Types::L1ctlMA& f__L1CTL__DM__EST__REQ__IA_ma_defval = const_f__L1CTL__DM__EST__REQ__IA_ma_defval;
L1CTL__Types::L1ctlResetType const_f__L1CTL__RESET_res__type_defval;
const L1CTL__Types::L1ctlResetType& f__L1CTL__RESET_res__type_defval = const_f__L1CTL__RESET_res__type_defval;
CHARSTRING const_f__connect__reset_l1ctl__sock__path_defval;
const CHARSTRING& f__connect__reset_l1ctl__sock__path_defval = const_f__connect__reset_l1ctl__sock__path_defval;
TTCN_Module module_object("L1CTL_PortType", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, NULL, NULL, NULL, NULL);

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

/* Member functions of C++ classes */

L1CTL__connect::L1CTL__connect()
{
}

L1CTL__connect::L1CTL__connect(const CHARSTRING& par_path)
  :   field_path(par_path)
{
}

L1CTL__connect::L1CTL__connect(const L1CTL__connect& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @L1CTL_PortType.L1CTL_connect.");
if (other_value.path().is_bound()) field_path = other_value.path();
else field_path.clean_up();
}

void L1CTL__connect::clean_up()
{
field_path.clean_up();
}

const TTCN_Typedescriptor_t* L1CTL__connect::get_descriptor() const { return &L1CTL__connect_descr_; }
L1CTL__connect& L1CTL__connect::operator=(const L1CTL__connect& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @L1CTL_PortType.L1CTL_connect.");
  if (other_value.path().is_bound()) field_path = other_value.path();
  else field_path.clean_up();
}
return *this;
}

boolean L1CTL__connect::operator==(const L1CTL__connect& other_value) const
{
return field_path==other_value.field_path;
}

boolean L1CTL__connect::is_bound() const
{
return (field_path.is_bound());
}
boolean L1CTL__connect::is_value() const
{
return field_path.is_value();
}
void L1CTL__connect::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ path := ");
field_path.log();
TTCN_Logger::log_event_str(" }");
}

void L1CTL__connect::set_implicit_omit()
{
if (path().is_bound()) path().set_implicit_omit();
}

void L1CTL__connect::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @L1CTL_PortType.L1CTL_connect has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) path().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "path")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          path().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 @L1CTL_PortType.L1CTL_connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@L1CTL_PortType.L1CTL_connect");
  }
}

void L1CTL__connect::encode_text(Text_Buf& text_buf) const
{
field_path.encode_text(text_buf);
}

void L1CTL__connect::decode_text(Text_Buf& text_buf)
{
field_path.decode_text(text_buf);
}

struct L1CTL__connect_template::single_value_struct {
CHARSTRING_template field_path;
};

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

void L1CTL__connect_template::copy_value(const L1CTL__connect& other_value)
{
single_value = new single_value_struct;
if (other_value.path().is_bound()) {
  single_value->field_path = other_value.path();
} else {
  single_value->field_path.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void L1CTL__connect_template::copy_template(const L1CTL__connect_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.path().get_selection()) {
single_value->field_path = other_value.path();
} else {
single_value->field_path.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 L1CTL__connect_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L1CTL__connect_template(*other_value.implication_.precondition);
implication_.implied_template = new L1CTL__connect_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @L1CTL_PortType.L1CTL_connect.");
break;
}
set_selection(other_value);
}

L1CTL__connect_template::L1CTL__connect_template()
{
}

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

L1CTL__connect_template::L1CTL__connect_template(const L1CTL__connect& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean L1CTL__connect_template::match(const L1CTL__connect& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.path().is_bound()) return FALSE;
if(!single_value->field_path.match(other_value.path(), 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 @L1CTL_PortType.L1CTL_connect.");
}
return FALSE;
}

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

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

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

L1CTL__connect L1CTL__connect_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @L1CTL_PortType.L1CTL_connect.");
L1CTL__connect ret_val;
if (single_value->field_path.is_bound()) {
ret_val.path() = single_value->field_path.valueof();
}
return ret_val;
}

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

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

CHARSTRING_template& L1CTL__connect_template::path()
{
set_specific();
return single_value->field_path;
}

const CHARSTRING_template& L1CTL__connect_template::path() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field path of a non-specific template of type @L1CTL_PortType.L1CTL_connect.");
return single_value->field_path;
}

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

void L1CTL__connect_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ path := ");
single_value->field_path.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 L1CTL__connect_template::log_match(const L1CTL__connect& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_path.match(match_value.path(), legacy)){
TTCN_Logger::log_logmatch_info(".path");
single_value->field_path.log_match(match_value.path(), 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("{ path := ");
single_value->field_path.log_match(match_value.path(), 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 L1CTL__connect_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (path().is_bound()) path().set_implicit_omit();
}

void L1CTL__connect_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_path.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 @L1CTL_PortType.L1CTL_connect.");
}
}

void L1CTL__connect_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_path.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 L1CTL__connect_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @L1CTL_PortType.L1CTL_connect.");
}
}

void L1CTL__connect_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L1CTL__connect_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @L1CTL_PortType.L1CTL_connect has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) path().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "path")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          path().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 @L1CTL_PortType.L1CTL_connect: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    L1CTL__connect_template* precondition = new L1CTL__connect_template;
    precondition->set_param(*param.get_elem(0));
    L1CTL__connect_template* implied_template = new L1CTL__connect_template;
    implied_template->set_param(*param.get_elem(1));
    *this = L1CTL__connect_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@L1CTL_PortType.L1CTL_connect");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

L1CTL__connect__result::L1CTL__connect__result()
{
}

L1CTL__connect__result::L1CTL__connect__result(const OPTIONAL< UD__Types::UD__Result__code >& par_result__code,
    const OPTIONAL< CHARSTRING >& par_err)
  :   field_result__code(par_result__code),
  field_err(par_err)
{
}

L1CTL__connect__result::L1CTL__connect__result(const L1CTL__connect__result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @L1CTL_PortType.L1CTL_connect_result.");
if (other_value.result__code().is_bound()) field_result__code = other_value.result__code();
else field_result__code.clean_up();
if (other_value.err().is_bound()) field_err = other_value.err();
else field_err.clean_up();
}

void L1CTL__connect__result::clean_up()
{
field_result__code.clean_up();
field_err.clean_up();
}

const TTCN_Typedescriptor_t* L1CTL__connect__result::get_descriptor() const { return &L1CTL__connect__result_descr_; }
L1CTL__connect__result& L1CTL__connect__result::operator=(const L1CTL__connect__result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @L1CTL_PortType.L1CTL_connect_result.");
  if (other_value.result__code().is_bound()) field_result__code = other_value.result__code();
  else field_result__code.clean_up();
  if (other_value.err().is_bound()) field_err = other_value.err();
  else field_err.clean_up();
}
return *this;
}

boolean L1CTL__connect__result::operator==(const L1CTL__connect__result& other_value) const
{
return field_result__code==other_value.field_result__code
  && field_err==other_value.field_err;
}

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

void L1CTL__connect__result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ result_code := ");
field_result__code.log();
TTCN_Logger::log_event_str(", err := ");
field_err.log();
TTCN_Logger::log_event_str(" }");
}

void L1CTL__connect__result::set_implicit_omit()
{
if (!result__code().is_bound()) result__code() = OMIT_VALUE;
else result__code().set_implicit_omit();
if (!err().is_bound()) err() = OMIT_VALUE;
else err().set_implicit_omit();
}

void L1CTL__connect__result::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @L1CTL_PortType.L1CTL_connect_result 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) result__code().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "result_code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          result__code().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(), "err")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          err().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 @L1CTL_PortType.L1CTL_connect_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@L1CTL_PortType.L1CTL_connect_result");
  }
}

void L1CTL__connect__result::encode_text(Text_Buf& text_buf) const
{
field_result__code.encode_text(text_buf);
field_err.encode_text(text_buf);
}

void L1CTL__connect__result::decode_text(Text_Buf& text_buf)
{
field_result__code.decode_text(text_buf);
field_err.decode_text(text_buf);
}

struct L1CTL__connect__result_template::single_value_struct {
UD__Types::UD__Result__code_template field_result__code;
CHARSTRING_template field_err;
};

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

void L1CTL__connect__result_template::copy_value(const L1CTL__connect__result& other_value)
{
single_value = new single_value_struct;
if (other_value.result__code().is_bound()) {
  if (other_value.result__code().ispresent()) single_value->field_result__code = other_value.result__code()();
  else single_value->field_result__code = OMIT_VALUE;
} else {
  single_value->field_result__code.clean_up();
}
if (other_value.err().is_bound()) {
  if (other_value.err().ispresent()) single_value->field_err = other_value.err()();
  else single_value->field_err = OMIT_VALUE;
} else {
  single_value->field_err.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void L1CTL__connect__result_template::copy_template(const L1CTL__connect__result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.result__code().get_selection()) {
single_value->field_result__code = other_value.result__code();
} else {
single_value->field_result__code.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.err().get_selection()) {
single_value->field_err = other_value.err();
} else {
single_value->field_err.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 L1CTL__connect__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new L1CTL__connect__result_template(*other_value.implication_.precondition);
implication_.implied_template = new L1CTL__connect__result_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @L1CTL_PortType.L1CTL_connect_result.");
break;
}
set_selection(other_value);
}

L1CTL__connect__result_template::L1CTL__connect__result_template()
{
}

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

L1CTL__connect__result_template::L1CTL__connect__result_template(const L1CTL__connect__result& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean L1CTL__connect__result_template::match(const L1CTL__connect__result& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.result__code().is_bound()) return FALSE;
if((other_value.result__code().ispresent() ? !single_value->field_result__code.match((const UD__Types::UD__Result__code&)other_value.result__code(), legacy) : !single_value->field_result__code.match_omit(legacy)))return FALSE;
if(!other_value.err().is_bound()) return FALSE;
if((other_value.err().ispresent() ? !single_value->field_err.match((const CHARSTRING&)other_value.err(), legacy) : !single_value->field_err.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 @L1CTL_PortType.L1CTL_connect_result.");
}
return FALSE;
}

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

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

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

L1CTL__connect__result L1CTL__connect__result_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @L1CTL_PortType.L1CTL_connect_result.");
L1CTL__connect__result ret_val;
if (single_value->field_result__code.is_omit()) ret_val.result__code() = OMIT_VALUE;
else if (single_value->field_result__code.is_bound()) {
ret_val.result__code() = single_value->field_result__code.valueof();
}
if (single_value->field_err.is_omit()) ret_val.err() = OMIT_VALUE;
else if (single_value->field_err.is_bound()) {
ret_val.err() = single_value->field_err.valueof();
}
return ret_val;
}

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

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

UD__Types::UD__Result__code_template& L1CTL__connect__result_template::result__code()
{
set_specific();
return single_value->field_result__code;
}

const UD__Types::UD__Result__code_template& L1CTL__connect__result_template::result__code() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field result_code of a non-specific template of type @L1CTL_PortType.L1CTL_connect_result.");
return single_value->field_result__code;
}

CHARSTRING_template& L1CTL__connect__result_template::err()
{
set_specific();
return single_value->field_err;
}

const CHARSTRING_template& L1CTL__connect__result_template::err() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field err of a non-specific template of type @L1CTL_PortType.L1CTL_connect_result.");
return single_value->field_err;
}

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

void L1CTL__connect__result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ result_code := ");
single_value->field_result__code.log();
TTCN_Logger::log_event_str(", err := ");
single_value->field_err.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 L1CTL__connect__result_template::log_match(const L1CTL__connect__result& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.result__code().ispresent()){
if(!single_value->field_result__code.match(match_value.result__code(), legacy)){
TTCN_Logger::log_logmatch_info(".result_code");
single_value->field_result__code.log_match(match_value.result__code(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_result__code.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".result_code := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_result__code.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.err().ispresent()){
if(!single_value->field_err.match(match_value.err(), legacy)){
TTCN_Logger::log_logmatch_info(".err");
single_value->field_err.log_match(match_value.err(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_err.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".err := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_err.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("{ result_code := ");
if (match_value.result__code().ispresent()) {
single_value->field_result__code.log_match(match_value.result__code(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_result__code.log();
if (single_value->field_result__code.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", err := ");
if (match_value.err().ispresent()) {
single_value->field_err.log_match(match_value.err(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_err.log();
if (single_value->field_err.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 L1CTL__connect__result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!result__code().is_bound()) result__code() = OMIT_VALUE;
else result__code().set_implicit_omit();
if (!err().is_bound()) err() = OMIT_VALUE;
else err().set_implicit_omit();
}

void L1CTL__connect__result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_result__code.encode_text(text_buf);
single_value->field_err.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 @L1CTL_PortType.L1CTL_connect_result.");
}
}

void L1CTL__connect__result_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_result__code.decode_text(text_buf);
single_value->field_err.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 L1CTL__connect__result_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @L1CTL_PortType.L1CTL_connect_result.");
}
}

void L1CTL__connect__result_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    L1CTL__connect__result_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @L1CTL_PortType.L1CTL_connect_result 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) result__code().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "result_code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          result__code().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(), "err")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          err().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 @L1CTL_PortType.L1CTL_connect_result: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    L1CTL__connect__result_template* precondition = new L1CTL__connect__result_template;
    precondition->set_param(*param.get_elem(0));
    L1CTL__connect__result_template* implied_template = new L1CTL__connect__result_template;
    implied_template->set_param(*param.get_elem(1));
    *this = L1CTL__connect__result_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@L1CTL_PortType.L1CTL_connect_result");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

void L1CTL__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;
case MESSAGE_2:
delete (my_head)->message_2;
break;
case MESSAGE_3:
delete (my_head)->message_3;
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 L1CTL__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

L1CTL__PT::L1CTL__PT(const char *par_port_name)
 : UD__PortType::UD__PT_PROVIDER(par_port_name)
{
msg_queue_head = NULL;
msg_queue_tail = NULL;
}

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

void L1CTL__PT::send(const L1CTL__Types::L1ctlMessage& 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(" @L1CTL_Types.L1ctlMessage : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
UD__Types::UD__send__data mapped_par;
L1CTL__to__UD(send_par, mapped_par);
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALSEND)) {
TTCN_Logger::log_dualport_map(0, "@UD_Types.UD_send_data",
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALSEND, TRUE), mapped_par.log(), TTCN_Logger::end_event_log2str()), 0);
}
if (destination_component == SYSTEM_COMPREF) outgoing_send(mapped_par);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@UD_Types.UD_send_data");
mapped_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void L1CTL__PT::send(const L1CTL__Types::L1ctlMessage& 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 L1CTL__PT::send(const L1CTL__Types::L1ctlMessage& 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, "@L1CTL_Types.L1ctlMessage");
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(" @L1CTL_Types.L1ctlMessage : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__Types::L1ctlMessage_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const L1CTL__Types::L1ctlMessage& send_par_value = L1CTL__Types::L1ctlMessage(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__Types::L1ctlMessage_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const L1CTL__Types::L1ctlMessage& send_par_value = L1CTL__Types::L1ctlMessage(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__Types::L1ctlMessage_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const L1CTL__Types::L1ctlMessage& send_par_value = L1CTL__Types::L1ctlMessage(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__connect& 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(" @L1CTL_PortType.L1CTL_connect : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
UD__Types::UD__connect mapped_par;
L1CTL__to__UD__connect(send_par, mapped_par);
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALSEND)) {
TTCN_Logger::log_dualport_map(0, "@UD_Types.UD_connect",
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALSEND, TRUE), mapped_par.log(), TTCN_Logger::end_event_log2str()), 0);
}
if (destination_component == SYSTEM_COMPREF) outgoing_send(mapped_par);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@UD_Types.UD_connect");
mapped_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void L1CTL__PT::send(const L1CTL__connect& 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 L1CTL__PT::send(const L1CTL__connect& 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, "@L1CTL_PortType.L1CTL_connect");
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(" @L1CTL_PortType.L1CTL_connect : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__connect_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const L1CTL__connect& send_par_value = L1CTL__connect(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__connect_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const L1CTL__connect& send_par_value = L1CTL__connect(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void L1CTL__PT::send(const L1CTL__connect_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const L1CTL__connect& send_par_value = L1CTL__connect(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

PORT* L1CTL__PT::get_provider_port() {
(void)get_default_destination();
return this;
}

alt_status L1CTL__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(": @L1CTL_Types.L1ctlMessage: "),
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(": @L1CTL_PortType.L1CTL_connect_result: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
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(": @UD_Types.UD_listen_result: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
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(": @UD_Types.UD_connected: "),
my_head->message_3->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 L1CTL__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(": @L1CTL_Types.L1ctlMessage: "),
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(": @L1CTL_PortType.L1CTL_connect_result: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
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(": @UD_Types.UD_listen_result: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
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(": @UD_Types.UD_connected: "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status L1CTL__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(": @L1CTL_Types.L1ctlMessage: "),
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(": @L1CTL_PortType.L1CTL_connect_result: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
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(": @UD_Types.UD_listen_result: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
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(": @UD_Types.UD_connected: "),
my_head->message_3->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 L1CTL__PT::receive(const L1CTL__Types::L1ctlMessage_template& value_template, L1CTL__Types::L1ctlMessage *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 @L1CTL_Types.L1ctlMessage.", 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(": @L1CTL_Types.L1ctlMessage : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::check_receive(const L1CTL__Types::L1ctlMessage_template& value_template, L1CTL__Types::L1ctlMessage *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 @L1CTL_Types.L1ctlMessage.", 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(": @L1CTL_Types.L1ctlMessage : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status L1CTL__PT::trigger(const L1CTL__Types::L1ctlMessage_template& value_template, L1CTL__Types::L1ctlMessage *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 @L1CTL_Types.L1ctlMessage.", 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(": @L1CTL_Types.L1ctlMessage : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::receive(const L1CTL__connect__result_template& value_template, L1CTL__connect__result *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 @L1CTL_PortType.L1CTL_connect_result.", 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(": @L1CTL_PortType.L1CTL_connect_result : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::check_receive(const L1CTL__connect__result_template& value_template, L1CTL__connect__result *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 @L1CTL_PortType.L1CTL_connect_result.", 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(": @L1CTL_PortType.L1CTL_connect_result : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status L1CTL__PT::trigger(const L1CTL__connect__result_template& value_template, L1CTL__connect__result *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 @L1CTL_PortType.L1CTL_connect_result.", 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(": @L1CTL_PortType.L1CTL_connect_result : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::receive(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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_2) {
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 @UD_Types.UD_listen_result.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_2)) {
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_2),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_2;
}
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_2),
 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(": @UD_Types.UD_listen_result : "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::check_receive(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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_2) {
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 @UD_Types.UD_listen_result.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_2)) {
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_2),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_2;
}
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_2),
 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(": @UD_Types.UD_listen_result : "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status L1CTL__PT::trigger(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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_2) {
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 @UD_Types.UD_listen_result.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_2)) {
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_2),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_2;
}
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_2),
 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(": @UD_Types.UD_listen_result : "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::receive(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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_3) {
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 @UD_Types.UD_connected.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_3)) {
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_3),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_3;
}
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_3),
 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(": @UD_Types.UD_connected : "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status L1CTL__PT::check_receive(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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_3) {
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 @UD_Types.UD_connected.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_3)) {
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_3),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_3;
}
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_3),
 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(": @UD_Types.UD_connected : "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status L1CTL__PT::trigger(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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_3) {
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 @UD_Types.UD_connected.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_3)) {
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_3),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_3;
}
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_3),
 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(": @UD_Types.UD_connected : "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void L1CTL__PT::incoming_message(const UD__Types::UD__listen__result& 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(" @UD_Types.UD_listen_result : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_2;
new_item->message_2 = new UD__Types::UD__listen__result(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__connect__result& 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);
}
}
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+1,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @UD_Types.UD_connect_result : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
L1CTL__connect__result *mapped_par = new L1CTL__connect__result;
try {
UD__to__L1CTL__connect__result(incoming_par, *mapped_par);
} catch (...) {
delete mapped_par;
throw;
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALRECV)) {
TTCN_Logger::log_dualport_map(1, "@L1CTL_PortType.L1CTL_connect_result",
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALRECV, TRUE), mapped_par->log(), TTCN_Logger::end_event_log2str()),
msg_tail_count);
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_1;
new_item->message_1 = mapped_par;
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__connected& 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(" @UD_Types.UD_connected : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_3;
new_item->message_3 = new UD__Types::UD__connected(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__send__data& 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);
}
}
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+1,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @UD_Types.UD_send_data : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
L1CTL__Types::L1ctlMessage *mapped_par = new L1CTL__Types::L1ctlMessage;
try {
UD__to__L1CTL(incoming_par, *mapped_par);
} catch (...) {
delete mapped_par;
throw;
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALRECV)) {
TTCN_Logger::log_dualport_map(1, "@L1CTL_Types.L1ctlMessage",
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALRECV, TRUE), mapped_par->log(), TTCN_Logger::end_event_log2str()),
msg_tail_count);
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_0;
new_item->message_0 = mapped_par;
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__listen__result& incoming_par)
{
incoming_message(incoming_par, SYSTEM_COMPREF);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__connect__result& incoming_par)
{
incoming_message(incoming_par, SYSTEM_COMPREF);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__connected& incoming_par)
{
incoming_message(incoming_par, SYSTEM_COMPREF);
}

void L1CTL__PT::incoming_message(const UD__Types::UD__send__data& incoming_par)
{
incoming_message(incoming_par, SYSTEM_COMPREF);
}

boolean L1CTL__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@UD_Types.UD_listen_result")) {
UD__Types::UD__listen__result incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@UD_Types.UD_connect_result")) {
UD__Types::UD__connect__result incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@UD_Types.UD_connected")) {
UD__Types::UD__connected incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@UD_Types.UD_send_data")) {
UD__Types::UD__send__data incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}


/* Bodies of functions, altsteps and testcases */

INTEGER f__L1CTL__getMsgLen(const OCTETSTRING& stream, Socket__API__Definitions::ro__integer& )
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 36, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_getMsgLen");
current_location.update_lineno(37);
/* L1CTL_PortType.ttcn, line 37 */
INTEGER stream__len(stream.lengthof());
current_location.update_lineno(38);
/* L1CTL_PortType.ttcn, line 38 */
INTEGER len;
current_location.update_lineno(39);
/* L1CTL_PortType.ttcn, line 39 */
if ((stream__len < 2)) {
current_location.update_lineno(40);
/* L1CTL_PortType.ttcn, line 40 */
return -1;
}
current_location.update_lineno(42);
/* L1CTL_PortType.ttcn, line 42 */
len = (2 + oct2int(substr(stream, 0, 2)));
current_location.update_lineno(43);
/* L1CTL_PortType.ttcn, line 43 */
return len;
}

L1CTL__Types::L1ctlMessage f__L1CTL__rx__data(L1CTL__PT& pt, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 46, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_rx_data");
current_location.update_lineno(50);
/* L1CTL_PortType.ttcn, line 50 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(51);
/* L1CTL_PortType.ttcn, line 51 */
TIMER T("T", 2.0);
current_location.update_lineno(53);
/* L1CTL_PortType.ttcn, line 53 */
T.start();
current_location.update_lineno(54);
/* L1CTL_PortType.ttcn, line 54 */
{
tmp_1:
alt_status tmp_1_alt_flag_0 = ALT_MAYBE;
alt_status tmp_1_alt_flag_1 = ALT_MAYBE;
alt_status tmp_1_alt_flag_2 = ALT_MAYBE;
alt_status tmp_1_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_1_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(55);
/* L1CTL_PortType.ttcn, line 55 */
tmp_1_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__DATA__IND(chan__nr, link__id, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_1_alt_flag_0 == ALT_YES) {
current_location.update_lineno(56);
/* L1CTL_PortType.ttcn, line 56 */
return dl;
}
}
if (tmp_1_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(58);
/* L1CTL_PortType.ttcn, line 58 */
tmp_1_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_1_alt_flag_1 == ALT_YES) {
current_location.update_lineno(58);
/* L1CTL_PortType.ttcn, line 58 */
goto tmp_1;
}
}
if (tmp_1_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(59);
/* L1CTL_PortType.ttcn, line 59 */
tmp_1_alt_flag_2 = T.timeout(NULL);
if (tmp_1_alt_flag_2 == ALT_YES) {
current_location.update_lineno(60);
/* L1CTL_PortType.ttcn, line 60 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL DATA.ind"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(61);
/* L1CTL_PortType.ttcn, line 61 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_1_default_flag == ALT_MAYBE) {
tmp_1_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_1_default_flag == ALT_YES || tmp_1_default_flag == ALT_BREAK) break;
else if (tmp_1_default_flag == ALT_REPEAT) goto tmp_1;
}
current_location.update_lineno(54);
/* L1CTL_PortType.ttcn, line 54 */
if (tmp_1_alt_flag_0 == ALT_NO && tmp_1_alt_flag_1 == ALT_NO && tmp_1_alt_flag_2 == ALT_NO && tmp_1_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 54 and 63.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(66);
/* L1CTL_PortType.ttcn, line 66 */
return dl;
}

void f__L1CTL__FBSB(L1CTL__PT& pt, const GSM__Types::GsmBandArfcn& arfcn, const L1CTL__Types::L1ctlCcchMode& ccch__mode, const INTEGER& rxlev__exp)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 69, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_FBSB");
current_location.update_lineno(73);
/* L1CTL_PortType.ttcn, line 73 */
TIMER T("T", 1.5e1);
{
current_location.update_lineno(74);
/* L1CTL_PortType.ttcn, line 74 */
INTEGER i(0);
current_location.update_lineno(74);
/* L1CTL_PortType.ttcn, line 74 */
for ( ; ; ) {
current_location.update_lineno(74);
/* L1CTL_PortType.ttcn, line 74 */
if (!(i < 10)) break;
current_location.update_lineno(75);
/* L1CTL_PortType.ttcn, line 75 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(76);
/* L1CTL_PortType.ttcn, line 76 */
pt.send(L1CTL__Types::ts__L1CTL__FBSB__REQ(GSM__Types::GsmBandArfcn_template(arfcn), L1CTL__Types::L1ctlFbsbFlags_template(L1CTL__Types::t__L1CTL__FBSB__F__ALL.valueof()), INTEGER_template(0), L1CTL__Types::L1ctlCcchMode_template(ccch__mode), INTEGER_template(rxlev__exp)), FALSE, NULL);
current_location.update_lineno(77);
/* L1CTL_PortType.ttcn, line 77 */
T.start();
current_location.update_lineno(78);
/* L1CTL_PortType.ttcn, line 78 */
{
tmp_2:
alt_status tmp_2_alt_flag_0 = ALT_MAYBE;
alt_status tmp_2_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_2_alt_flag_2 = ALT_MAYBE;
alt_status tmp_2_alt_flag_3 = ALT_MAYBE;
alt_status tmp_2_alt_flag_4 = ALT_MAYBE;
alt_status tmp_2_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_2_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(79);
/* L1CTL_PortType.ttcn, line 79 */
tmp_2_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__FBSB__CONF(INTEGER_template(0)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_2_alt_flag_0 == ALT_YES) {
current_location.update_lineno(79);
/* L1CTL_PortType.ttcn, line 79 */
return;
}
}
if (tmp_2_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(80);
/* L1CTL_PortType.ttcn, line 80 */
if ((i >= 9)) tmp_2_alt_flag_1 = ALT_MAYBE;
else tmp_2_alt_flag_1 = ALT_NO;
}
if (tmp_2_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(80);
/* L1CTL_PortType.ttcn, line 80 */
tmp_2_alt_flag_1 = pt.receive(L1CTL__Types::tr__L1CTL__FBSB__CONF(INTEGER_template(ANY_VALUE)), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_2_alt_flag_1 == ALT_YES) {
current_location.update_lineno(81);
/* L1CTL_PortType.ttcn, line 81 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("FBSB Failed with non-zero return code "),const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().fbsb__conf().result().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(82);
/* L1CTL_PortType.ttcn, line 82 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_2_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(84);
/* L1CTL_PortType.ttcn, line 84 */
tmp_2_alt_flag_2 = pt.receive(L1CTL__Types::tr__L1CTL__FBSB__CONF(INTEGER_template(ANY_VALUE)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_2_alt_flag_2 == ALT_YES) {
current_location.update_lineno(85);
/* L1CTL_PortType.ttcn, line 85 */
Osmocom__Types::f__sleep(1.0);
break;
}
}
if (tmp_2_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(87);
/* L1CTL_PortType.ttcn, line 87 */
tmp_2_alt_flag_3 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_2_alt_flag_3 == ALT_YES) {
current_location.update_lineno(87);
/* L1CTL_PortType.ttcn, line 87 */
goto tmp_2;
}
}
if (tmp_2_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(88);
/* L1CTL_PortType.ttcn, line 88 */
tmp_2_alt_flag_4 = T.timeout(NULL);
if (tmp_2_alt_flag_4 == ALT_YES) {
current_location.update_lineno(89);
/* L1CTL_PortType.ttcn, line 89 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL_FBSB_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(90);
/* L1CTL_PortType.ttcn, line 90 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_2_default_flag == ALT_MAYBE) {
tmp_2_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_2_default_flag == ALT_YES || tmp_2_default_flag == ALT_BREAK) break;
else if (tmp_2_default_flag == ALT_REPEAT) goto tmp_2;
}
current_location.update_lineno(78);
/* L1CTL_PortType.ttcn, line 78 */
if (tmp_2_alt_flag_0 == ALT_NO && tmp_2_alt_flag_1 == ALT_NO && tmp_2_alt_flag_2 == ALT_NO && tmp_2_alt_flag_3 == ALT_NO && tmp_2_alt_flag_4 == ALT_NO && tmp_2_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 78 and 92.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(74);
/* L1CTL_PortType.ttcn, line 74 */
{
INTEGER tmp_3;
++i;
}
}
}
}

void f__L1CTL__CCCH__MODE(L1CTL__PT& pt, const L1CTL__Types::L1ctlCcchMode& ccch__mode)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 96, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_CCCH_MODE");
current_location.update_lineno(97);
/* L1CTL_PortType.ttcn, line 97 */
TIMER T("T", 2.0);
current_location.update_lineno(98);
/* L1CTL_PortType.ttcn, line 98 */
pt.send(L1CTL__Types::ts__L1CTL__CCCH__MODE__REQ(L1CTL__Types::L1ctlCcchMode_template(ccch__mode)), FALSE, NULL);
current_location.update_lineno(99);
/* L1CTL_PortType.ttcn, line 99 */
T.start();
current_location.update_lineno(100);
/* L1CTL_PortType.ttcn, line 100 */
{
tmp_4:
alt_status tmp_4_alt_flag_0 = ALT_MAYBE;
alt_status tmp_4_alt_flag_1 = ALT_MAYBE;
alt_status tmp_4_alt_flag_2 = ALT_MAYBE;
alt_status tmp_4_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_4_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(101);
/* L1CTL_PortType.ttcn, line 101 */
tmp_4_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__CCCH__MODE__CONF, NULL, any_compref, NULL, NULL, NULL);
if (tmp_4_alt_flag_0 == ALT_YES) break;
}
if (tmp_4_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(102);
/* L1CTL_PortType.ttcn, line 102 */
tmp_4_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_4_alt_flag_1 == ALT_YES) {
current_location.update_lineno(102);
/* L1CTL_PortType.ttcn, line 102 */
goto tmp_4;
}
}
if (tmp_4_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(103);
/* L1CTL_PortType.ttcn, line 103 */
tmp_4_alt_flag_2 = T.timeout(NULL);
if (tmp_4_alt_flag_2 == ALT_YES) {
current_location.update_lineno(104);
/* L1CTL_PortType.ttcn, line 104 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL_CCCH_MODE_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(105);
/* L1CTL_PortType.ttcn, line 105 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_4_default_flag == ALT_MAYBE) {
tmp_4_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_4_default_flag == ALT_YES || tmp_4_default_flag == ALT_BREAK) break;
else if (tmp_4_default_flag == ALT_REPEAT) goto tmp_4;
}
current_location.update_lineno(100);
/* L1CTL_PortType.ttcn, line 100 */
if (tmp_4_alt_flag_0 == ALT_NO && tmp_4_alt_flag_1 == ALT_NO && tmp_4_alt_flag_2 == ALT_NO && tmp_4_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 100 and 107.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void f__L1CTL__TCH__MODE(L1CTL__PT& pt, const L1CTL__Types::L1ctlMessage_template& tch__mode__req__tmpl)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 110, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_TCH_MODE");
current_location.update_lineno(112);
/* L1CTL_PortType.ttcn, line 112 */
TIMER T("T", 2.0);
current_location.update_lineno(113);
/* L1CTL_PortType.ttcn, line 113 */
pt.send(tch__mode__req__tmpl, FALSE, NULL);
current_location.update_lineno(114);
/* L1CTL_PortType.ttcn, line 114 */
T.start();
current_location.update_lineno(115);
/* L1CTL_PortType.ttcn, line 115 */
{
tmp_5:
alt_status tmp_5_alt_flag_0 = ALT_MAYBE;
alt_status tmp_5_alt_flag_1 = ALT_MAYBE;
alt_status tmp_5_alt_flag_2 = ALT_MAYBE;
alt_status tmp_5_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_5_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(116);
/* L1CTL_PortType.ttcn, line 116 */
tmp_5_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__MsgType(L1CTL__Types::L1ctlMsgType_template(L1CTL__Types::L1ctlMsgType::L1CTL__TCH__MODE__CONF)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_5_alt_flag_0 == ALT_YES) break;
}
if (tmp_5_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(117);
/* L1CTL_PortType.ttcn, line 117 */
tmp_5_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_5_alt_flag_1 == ALT_YES) {
current_location.update_lineno(117);
/* L1CTL_PortType.ttcn, line 117 */
goto tmp_5;
}
}
if (tmp_5_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(118);
/* L1CTL_PortType.ttcn, line 118 */
tmp_5_alt_flag_2 = T.timeout(NULL);
if (tmp_5_alt_flag_2 == ALT_YES) {
current_location.update_lineno(119);
/* L1CTL_PortType.ttcn, line 119 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL_TCH_MODE_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(120);
/* L1CTL_PortType.ttcn, line 120 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_5_default_flag == ALT_MAYBE) {
tmp_5_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_5_default_flag == ALT_YES || tmp_5_default_flag == ALT_BREAK) break;
else if (tmp_5_default_flag == ALT_REPEAT) goto tmp_5;
}
current_location.update_lineno(115);
/* L1CTL_PortType.ttcn, line 115 */
if (tmp_5_alt_flag_0 == ALT_NO && tmp_5_alt_flag_1 == ALT_NO && tmp_5_alt_flag_2 == ALT_NO && tmp_5_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 115 and 122.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

INTEGER f__L1CTL__RACH(L1CTL__PT& pt, const INTEGER& ra, const INTEGER& combined, const INTEGER& offset, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 125, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_RACH");
current_location.update_lineno(129);
/* L1CTL_PortType.ttcn, line 129 */
L1CTL__Types::L1ctlMessage rc;
current_location.update_lineno(130);
/* L1CTL_PortType.ttcn, line 130 */
INTEGER fn;
current_location.update_lineno(131);
/* L1CTL_PortType.ttcn, line 131 */
TIMER T("T", 2.0);
current_location.update_lineno(132);
/* L1CTL_PortType.ttcn, line 132 */
T.start();
current_location.update_lineno(133);
/* L1CTL_PortType.ttcn, line 133 */
pt.send(L1CTL__Types::ts__L1CTL__RACH__REQ(INTEGER_template(ra), INTEGER_template(combined), INTEGER_template(offset), chan__nr, link__id), FALSE, NULL);
current_location.update_lineno(134);
/* L1CTL_PortType.ttcn, line 134 */
{
tmp_6:
alt_status tmp_6_alt_flag_0 = ALT_MAYBE;
alt_status tmp_6_alt_flag_1 = ALT_MAYBE;
alt_status tmp_6_alt_flag_2 = ALT_MAYBE;
alt_status tmp_6_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_6_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(135);
/* L1CTL_PortType.ttcn, line 135 */
tmp_6_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__RACH__CONF, &(rc), any_compref, NULL, NULL, NULL);
if (tmp_6_alt_flag_0 == ALT_YES) {
current_location.update_lineno(135);
/* L1CTL_PortType.ttcn, line 135 */
fn = const_cast< const L1CTL__Types::L1ctlMessage&>(rc).dl__info()().frame__nr();
break;
}
}
if (tmp_6_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(136);
/* L1CTL_PortType.ttcn, line 136 */
tmp_6_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_6_alt_flag_1 == ALT_YES) {
current_location.update_lineno(136);
/* L1CTL_PortType.ttcn, line 136 */
goto tmp_6;
}
}
if (tmp_6_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(137);
/* L1CTL_PortType.ttcn, line 137 */
tmp_6_alt_flag_2 = T.timeout(NULL);
if (tmp_6_alt_flag_2 == ALT_YES) {
current_location.update_lineno(138);
/* L1CTL_PortType.ttcn, line 138 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL_RACH_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(139);
/* L1CTL_PortType.ttcn, line 139 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_6_default_flag == ALT_MAYBE) {
tmp_6_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_6_default_flag == ALT_YES || tmp_6_default_flag == ALT_BREAK) break;
else if (tmp_6_default_flag == ALT_REPEAT) goto tmp_6;
}
current_location.update_lineno(134);
/* L1CTL_PortType.ttcn, line 134 */
if (tmp_6_alt_flag_0 == ALT_NO && tmp_6_alt_flag_1 == ALT_NO && tmp_6_alt_flag_2 == ALT_NO && tmp_6_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 134 and 141.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(142);
/* L1CTL_PortType.ttcn, line 142 */
return fn;
}

INTEGER f__L1CTL__EXT__RACH(L1CTL__PT& pt, const INTEGER& ra11, const L1CTL__Types::L1ctlRachSynchSeq& seq, const INTEGER& combined, const INTEGER& offset)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 145, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_EXT_RACH");
current_location.update_lineno(149);
/* L1CTL_PortType.ttcn, line 149 */
L1CTL__Types::L1ctlMessage rc;
current_location.update_lineno(150);
/* L1CTL_PortType.ttcn, line 150 */
INTEGER fn;
current_location.update_lineno(151);
/* L1CTL_PortType.ttcn, line 151 */
TIMER T("T", 2.0);
current_location.update_lineno(153);
/* L1CTL_PortType.ttcn, line 153 */
T.start();
current_location.update_lineno(154);
/* L1CTL_PortType.ttcn, line 154 */
pt.send(L1CTL__Types::ts__L1CTL__EXT__RACH__REQ(INTEGER_template(ra11), L1CTL__Types::L1ctlRachSynchSeq_template(seq), INTEGER_template(combined), INTEGER_template(offset)), FALSE, NULL);
current_location.update_lineno(155);
/* L1CTL_PortType.ttcn, line 155 */
{
tmp_8:
alt_status tmp_8_alt_flag_0 = ALT_MAYBE;
alt_status tmp_8_alt_flag_1 = ALT_MAYBE;
alt_status tmp_8_alt_flag_2 = ALT_MAYBE;
alt_status tmp_8_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_8_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(156);
/* L1CTL_PortType.ttcn, line 156 */
tmp_8_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__RACH__CONF, &(rc), any_compref, NULL, NULL, NULL);
if (tmp_8_alt_flag_0 == ALT_YES) {
current_location.update_lineno(156);
/* L1CTL_PortType.ttcn, line 156 */
fn = const_cast< const L1CTL__Types::L1ctlMessage&>(rc).dl__info()().frame__nr();
break;
}
}
if (tmp_8_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(157);
/* L1CTL_PortType.ttcn, line 157 */
tmp_8_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_8_alt_flag_1 == ALT_YES) {
current_location.update_lineno(157);
/* L1CTL_PortType.ttcn, line 157 */
goto tmp_8;
}
}
if (tmp_8_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(158);
/* L1CTL_PortType.ttcn, line 158 */
tmp_8_alt_flag_2 = T.timeout(NULL);
if (tmp_8_alt_flag_2 == ALT_YES) {
current_location.update_lineno(159);
/* L1CTL_PortType.ttcn, line 159 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for (extended) L1CTL_RACH_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(160);
/* L1CTL_PortType.ttcn, line 160 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_8_default_flag == ALT_MAYBE) {
tmp_8_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_8_default_flag == ALT_YES || tmp_8_default_flag == ALT_BREAK) break;
else if (tmp_8_default_flag == ALT_REPEAT) goto tmp_8;
}
current_location.update_lineno(155);
/* L1CTL_PortType.ttcn, line 155 */
if (tmp_8_alt_flag_0 == ALT_NO && tmp_8_alt_flag_1 == ALT_NO && tmp_8_alt_flag_2 == ALT_NO && tmp_8_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 155 and 162.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(164);
/* L1CTL_PortType.ttcn, line 164 */
return fn;
}

void f__L1CTL__PARAM(L1CTL__PT& pt, const INTEGER& ta, const INTEGER& tx__power)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 167, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_PARAM");
current_location.update_lineno(168);
/* L1CTL_PortType.ttcn, line 168 */
pt.send(L1CTL__Types::ts__L1CTL__PAR__REQ(INTEGER_template(ta), INTEGER_template(tx__power)), FALSE, NULL);
}

GSM__RR__Types::ImmediateAssignment f__L1CTL__WAIT__IMM__ASS(L1CTL__PT& pt, const INTEGER& ra, const INTEGER& rach__fn)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 171, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_WAIT_IMM_ASS");
current_location.update_lineno(172);
/* L1CTL_PortType.ttcn, line 172 */
GSM__RR__Types::GsmRrMessage_template rr__imm__ass;
current_location.update_lineno(173);
/* L1CTL_PortType.ttcn, line 173 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(174);
/* L1CTL_PortType.ttcn, line 174 */
GSM__RR__Types::GsmRrMessage rr;
current_location.update_lineno(175);
/* L1CTL_PortType.ttcn, line 175 */
TIMER T("T", 1.0e1);
current_location.update_lineno(178);
/* L1CTL_PortType.ttcn, line 178 */
rr__imm__ass = GSM__RR__Types::tr__IMM__ASS(INTEGER_template(ra), INTEGER_template(rach__fn), GSM__RR__Types::tr__IMM__ASS_ta_defval, GSM__RR__Types::tr__IMM__ASS_ch__desc_defval, GSM__RR__Types::tr__IMM__ASS_ma_defval, GSM__RR__Types::tr__IMM__ASS_page__mode_defval);
current_location.update_lineno(179);
/* L1CTL_PortType.ttcn, line 179 */
rr__imm__ass.payload().imm__ass().ded__or__tbf() = ANY_VALUE;
current_location.update_lineno(180);
/* L1CTL_PortType.ttcn, line 180 */
rr__imm__ass.payload().imm__ass().pkt__chan__desc() = ANY_OR_OMIT;
current_location.update_lineno(181);
/* L1CTL_PortType.ttcn, line 181 */
rr__imm__ass.payload().imm__ass().chan__desc() = ANY_OR_OMIT;
current_location.update_lineno(183);
/* L1CTL_PortType.ttcn, line 183 */
T.start();
current_location.update_lineno(184);
/* L1CTL_PortType.ttcn, line 184 */
{
tmp_14:
alt_status tmp_14_alt_flag_0 = ALT_MAYBE;
alt_status tmp_14_alt_flag_1 = ALT_MAYBE;
alt_status tmp_14_alt_flag_2 = ALT_MAYBE;
alt_status tmp_14_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_14_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(185);
/* L1CTL_PortType.ttcn, line 185 */
tmp_14_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_14_alt_flag_0 == ALT_YES) {
current_location.update_lineno(186);
/* L1CTL_PortType.ttcn, line 186 */
rr = GSM__RR__Types::dec__GsmRrMessage(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload());
current_location.update_lineno(187);
/* L1CTL_PortType.ttcn, line 187 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("PCH/AGCH DL RR: ");
rr.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(188);
/* L1CTL_PortType.ttcn, line 188 */
if (rr__imm__ass.match(rr)) {
current_location.update_lineno(189);
/* L1CTL_PortType.ttcn, line 189 */
TTCN_Logger::log_str(TTCN_USER, "Received IMM.ASS for our RACH!");
}
else {
current_location.update_lineno(191);
/* L1CTL_PortType.ttcn, line 191 */
goto tmp_14;
}
break;
}
}
if (tmp_14_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(194);
/* L1CTL_PortType.ttcn, line 194 */
tmp_14_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_14_alt_flag_1 == ALT_YES) {
current_location.update_lineno(194);
/* L1CTL_PortType.ttcn, line 194 */
goto tmp_14;
}
}
if (tmp_14_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(195);
/* L1CTL_PortType.ttcn, line 195 */
tmp_14_alt_flag_2 = T.timeout(NULL);
if (tmp_14_alt_flag_2 == ALT_YES) {
current_location.update_lineno(196);
/* L1CTL_PortType.ttcn, line 196 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for IMM ASS"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(197);
/* L1CTL_PortType.ttcn, line 197 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_14_default_flag == ALT_MAYBE) {
tmp_14_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_14_default_flag == ALT_YES || tmp_14_default_flag == ALT_BREAK) break;
else if (tmp_14_default_flag == ALT_REPEAT) goto tmp_14;
}
current_location.update_lineno(184);
/* L1CTL_PortType.ttcn, line 184 */
if (tmp_14_alt_flag_0 == ALT_NO && tmp_14_alt_flag_1 == ALT_NO && tmp_14_alt_flag_2 == ALT_NO && tmp_14_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 184 and 199.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(200);
/* L1CTL_PortType.ttcn, line 200 */
T.stop();
current_location.update_lineno(201);
/* L1CTL_PortType.ttcn, line 201 */
return const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass();
}

GSM__RR__Types::ImmediateAssignment f__L1CTL__WAIT__IMM__ASS__TBF__DL(L1CTL__PT& pt, const OCTETSTRING& tlli)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 204, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_WAIT_IMM_ASS_TBF_DL");
current_location.update_lineno(205);
/* L1CTL_PortType.ttcn, line 205 */
GSM__RestOctets::PacketDlAssign_template dl__ass(GSM__RestOctets::tr__PacketDlAssign(OCTETSTRING_template(tlli)));
current_location.update_lineno(206);
/* L1CTL_PortType.ttcn, line 206 */
GSM__RestOctets::IaRestOctets_template rest(GSM__RestOctets::tr__IaRestOctets__DLAss(dl__ass));
current_location.update_lineno(207);
/* L1CTL_PortType.ttcn, line 207 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(208);
/* L1CTL_PortType.ttcn, line 208 */
GSM__RR__Types::GsmRrMessage rr;
current_location.update_lineno(209);
/* L1CTL_PortType.ttcn, line 209 */
TIMER T("T", 1.0e1);
current_location.update_lineno(210);
/* L1CTL_PortType.ttcn, line 210 */
T.start();
current_location.update_lineno(211);
/* L1CTL_PortType.ttcn, line 211 */
{
tmp_16:
alt_status tmp_16_alt_flag_0 = ALT_MAYBE;
alt_status tmp_16_alt_flag_1 = ALT_MAYBE;
alt_status tmp_16_alt_flag_2 = ALT_MAYBE;
alt_status tmp_16_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_16_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(212);
/* L1CTL_PortType.ttcn, line 212 */
tmp_16_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_16_alt_flag_0 == ALT_YES) {
current_location.update_lineno(214);
/* L1CTL_PortType.ttcn, line 214 */
rr = GSM__RR__Types::dec__GsmRrMessage(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload());
current_location.update_lineno(215);
/* L1CTL_PortType.ttcn, line 215 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("PCH/AGCN DL RR: ");
rr.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(216);
/* L1CTL_PortType.ttcn, line 216 */
if (GSM__RR__Types::tr__IMM__TBF__ASS(BOOLEAN_template(TRUE), GSM__RR__Types::tr__IMM__TBF__ASS_ra_defval, GSM__RR__Types::tr__IMM__TBF__ASS_fn_defval, GSM__RR__Types::tr__IMM__TBF__ASS_ta_defval, GSM__RR__Types::tr__IMM__TBF__ASS_ch__desc_defval, GSM__RR__Types::tr__IMM__TBF__ASS_ma_defval, rest).match(rr)) {
current_location.update_lineno(217);
/* L1CTL_PortType.ttcn, line 217 */
TTCN_Logger::log_str(TTCN_USER, "Received IMM.ASS for our TLLI!");
}
else {
current_location.update_lineno(219);
/* L1CTL_PortType.ttcn, line 219 */
goto tmp_16;
}
break;
}
}
if (tmp_16_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(222);
/* L1CTL_PortType.ttcn, line 222 */
tmp_16_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_16_alt_flag_1 == ALT_YES) {
current_location.update_lineno(222);
/* L1CTL_PortType.ttcn, line 222 */
goto tmp_16;
}
}
if (tmp_16_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(223);
/* L1CTL_PortType.ttcn, line 223 */
tmp_16_alt_flag_2 = T.timeout(NULL);
if (tmp_16_alt_flag_2 == ALT_YES) {
current_location.update_lineno(224);
/* L1CTL_PortType.ttcn, line 224 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for TBF IMM ASS"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(225);
/* L1CTL_PortType.ttcn, line 225 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_16_default_flag == ALT_MAYBE) {
tmp_16_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_16_default_flag == ALT_YES || tmp_16_default_flag == ALT_BREAK) break;
else if (tmp_16_default_flag == ALT_REPEAT) goto tmp_16;
}
current_location.update_lineno(211);
/* L1CTL_PortType.ttcn, line 211 */
if (tmp_16_alt_flag_0 == ALT_NO && tmp_16_alt_flag_1 == ALT_NO && tmp_16_alt_flag_2 == ALT_NO && tmp_16_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 211 and 227.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(228);
/* L1CTL_PortType.ttcn, line 228 */
T.stop();
current_location.update_lineno(229);
/* L1CTL_PortType.ttcn, line 229 */
return const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass();
}

void f__L1CTL__DM__EST__REQ__IA(L1CTL__PT& pt, const GSM__RR__Types::ImmediateAssignment& imm__ass, const L1CTL__Types::L1ctlMA& ma)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 233, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_DM_EST_REQ_IA");
current_location.update_lineno(235);
/* L1CTL_PortType.ttcn, line 235 */
if ((const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).ded__or__tbf().tbf() == TRUE)) {
current_location.update_lineno(236);
/* L1CTL_PortType.ttcn, line 236 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("TBF assignment is not handled by f_L1CTL_DM_EST_REQ_IA"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(237);
/* L1CTL_PortType.ttcn, line 237 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
current_location.update_lineno(241);
/* L1CTL_PortType.ttcn, line 241 */
if ((!(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().h()))) {
current_location.update_lineno(242);
/* L1CTL_PortType.ttcn, line 242 */
pt.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H0(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().chan__nr()), INTEGER_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().tsc()), INTEGER_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().arfcn())), FALSE, NULL);
}
else {
current_location.update_lineno(248);
/* L1CTL_PortType.ttcn, line 248 */
pt.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H1(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().chan__nr()), INTEGER_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().tsc()), INTEGER_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().maio__hsn()().hsn()), INTEGER_template(const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc()().maio__hsn()().maio()), L1CTL__Types::L1ctlMA_template(ma)), FALSE, NULL);
}
}

void f__L1CTL__DM__REL__REQ(L1CTL__PT& pt, const GSM__Types::RslChannelNr& chan__nr)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 257, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_DM_REL_REQ");
current_location.update_lineno(258);
/* L1CTL_PortType.ttcn, line 258 */
pt.send(L1CTL__Types::ts__L1CTL__DM__REL__REQ(GSM__Types::RslChannelNr_template(chan__nr)), FALSE, NULL);
}

void f__L1CTL__RESET(L1CTL__PT& pt, const L1CTL__Types::L1ctlResetType& res__type)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 261, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_RESET");
current_location.update_lineno(262);
/* L1CTL_PortType.ttcn, line 262 */
TIMER T("T", 2.0);
current_location.update_lineno(263);
/* L1CTL_PortType.ttcn, line 263 */
pt.send(L1CTL__Types::t__L1ctlResetReq(L1CTL__Types::L1ctlResetType_template(res__type)), FALSE, NULL);
current_location.update_lineno(264);
/* L1CTL_PortType.ttcn, line 264 */
T.start();
current_location.update_lineno(265);
/* L1CTL_PortType.ttcn, line 265 */
{
tmp_18:
alt_status tmp_18_alt_flag_0 = ALT_MAYBE;
alt_status tmp_18_alt_flag_1 = ALT_MAYBE;
alt_status tmp_18_alt_flag_2 = ALT_MAYBE;
alt_status tmp_18_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_18_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(266);
/* L1CTL_PortType.ttcn, line 266 */
tmp_18_alt_flag_0 = pt.receive(L1CTL__Types::tr__L1CTL__MsgType(L1CTL__Types::L1ctlMsgType_template(L1CTL__Types::L1ctlMsgType::L1CTL__RESET__CONF)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_18_alt_flag_0 == ALT_YES) break;
}
if (tmp_18_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(267);
/* L1CTL_PortType.ttcn, line 267 */
tmp_18_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL);
if (tmp_18_alt_flag_1 == ALT_YES) {
current_location.update_lineno(267);
/* L1CTL_PortType.ttcn, line 267 */
goto tmp_18;
}
}
if (tmp_18_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(268);
/* L1CTL_PortType.ttcn, line 268 */
tmp_18_alt_flag_2 = T.timeout(NULL);
if (tmp_18_alt_flag_2 == ALT_YES) {
current_location.update_lineno(269);
/* L1CTL_PortType.ttcn, line 269 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for L1CTL_RESET_CONF"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(270);
/* L1CTL_PortType.ttcn, line 270 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_18_default_flag == ALT_MAYBE) {
tmp_18_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_18_default_flag == ALT_YES || tmp_18_default_flag == ALT_BREAK) break;
else if (tmp_18_default_flag == ALT_REPEAT) goto tmp_18;
}
current_location.update_lineno(265);
/* L1CTL_PortType.ttcn, line 265 */
if (tmp_18_alt_flag_0 == ALT_NO && tmp_18_alt_flag_1 == ALT_NO && tmp_18_alt_flag_2 == ALT_NO && tmp_18_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file L1CTL_PortType.ttcn between lines 265 and 272.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void f__L1CTL__CRYPTO__REQ(L1CTL__PT& pt, const GSM__Types::RslChannelNr& chan__nr, const INTEGER& algo, const OCTETSTRING& key)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 275, TTCN_Location::LOCATION_FUNCTION, "f_L1CTL_CRYPTO_REQ");
current_location.update_lineno(276);
/* L1CTL_PortType.ttcn, line 276 */
pt.send(L1CTL__Types::ts__L1CTL__CRYPTO__REQ(GSM__Types::RslChannelNr_template(chan__nr), INTEGER_template(algo), OCTETSTRING_template(key)), FALSE, NULL);
}

void f__connect__reset(L1CTL__PT& pt, const CHARSTRING& l1ctl__sock__path)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 279, TTCN_Location::LOCATION_FUNCTION, "f_connect_reset");
current_location.update_lineno(280);
/* L1CTL_PortType.ttcn, line 280 */
Socket__API__Definitions::f__getMsgLen vl__f(&f__L1CTL__getMsgLen);
current_location.update_lineno(281);
/* L1CTL_PortType.ttcn, line 281 */
L1CTL__PortType__CtrlFunct::f__L1CTL__setGetMsgLen(pt, -1, vl__f, NULL_VALUE);
current_location.update_lineno(282);
/* L1CTL_PortType.ttcn, line 282 */
{
L1CTL__connect_template tmp_19;
tmp_19.path() = l1ctl__sock__path;
pt.send(tmp_19, FALSE, NULL);
}
current_location.update_lineno(283);
/* L1CTL_PortType.ttcn, line 283 */
{
tmp_20:
L1CTL__connect__result_template tmp_21;
tmp_21.result__code() = UD__Types::UD__Result__code::SUCCESS;
tmp_21.err() = OMIT_VALUE;
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = pt.receive(tmp_21, NULL, any_compref, NULL, NULL, NULL);
if (alt_flag == ALT_YES) break;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_20;
}
current_location.update_lineno(283);
/* L1CTL_PortType.ttcn, line 283 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file L1CTL_PortType.ttcn, line 283.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(284);
/* L1CTL_PortType.ttcn, line 284 */
L1CTL__PortType__CtrlFunct::f__L1CTL__setGetMsgLen(pt, 0, vl__f, NULL_VALUE);
current_location.update_lineno(285);
/* L1CTL_PortType.ttcn, line 285 */
f__L1CTL__RESET(pt, f__L1CTL__RESET_res__type_defval);
}

void L1CTL__to__UD__connect(const L1CTL__connect& pin, UD__Types::UD__connect& pout)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 288, TTCN_Location::LOCATION_FUNCTION, "L1CTL_to_UD_connect");
current_location.update_lineno(289);
/* L1CTL_PortType.ttcn, line 289 */
pout.path() = const_cast< const L1CTL__connect&>(pin).path();
current_location.update_lineno(290);
/* L1CTL_PortType.ttcn, line 290 */
pout.id() = 0;
}

void UD__to__L1CTL__connect__result(const UD__Types::UD__connect__result& pin, L1CTL__connect__result& pout)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 293, TTCN_Location::LOCATION_FUNCTION, "UD_to_L1CTL_connect_result");
current_location.update_lineno(294);
/* L1CTL_PortType.ttcn, line 294 */
pout.result__code() = const_cast< const UD__Types::UD__connect__result&>(pin).result()().result__code();
current_location.update_lineno(295);
/* L1CTL_PortType.ttcn, line 295 */
pout.err() = const_cast< const UD__Types::UD__connect__result&>(pin).result()().err();
}

void L1CTL__to__UD(const L1CTL__Types::L1ctlMessage& pin, UD__Types::UD__send__data& pout)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 298, TTCN_Location::LOCATION_FUNCTION, "L1CTL_to_UD");
current_location.update_lineno(299);
/* L1CTL_PortType.ttcn, line 299 */
L1CTL__Types::L1ctlMessageLV msg__lv;
msg__lv.msg() = pin;
current_location.update_lineno(300);
/* L1CTL_PortType.ttcn, line 300 */
pout.data() = L1CTL__Types::enc__L1ctlMessageLV(msg__lv);
current_location.update_lineno(301);
/* L1CTL_PortType.ttcn, line 301 */
pout.id() = 0;
}

void UD__to__L1CTL(const UD__Types::UD__send__data& pin, L1CTL__Types::L1ctlMessage& pout)
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 304, TTCN_Location::LOCATION_FUNCTION, "UD_to_L1CTL");
current_location.update_lineno(305);
/* L1CTL_PortType.ttcn, line 305 */
L1CTL__Types::L1ctlMessageLV msg__lv(L1CTL__Types::dec__L1ctlMessageLV(const_cast< const UD__Types::UD__send__data&>(pin).data()));
current_location.update_lineno(306);
/* L1CTL_PortType.ttcn, line 306 */
pout = const_cast< const L1CTL__Types::L1ctlMessageLV&>(msg__lv).msg();
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "L1CTL_PortType");
L1CTL__Types::module_object.pre_init_module();
UD__PortType::module_object.pre_init_module();
L1CTL__PortType__CtrlFunct::module_object.pre_init_module();
current_location.update_lineno(33);
/* L1CTL_PortType.ttcn, line 33 */
modulepar_m__l1ctl__sock__path = cs_0;
module_object.add_modulepar("m_l1ctl_sock_path");
module_object.add_function("f_L1CTL_getMsgLen", (genericfunc_t)&f__L1CTL__getMsgLen, NULL);
module_object.add_function("f_L1CTL_rx_data", (genericfunc_t)&f__L1CTL__rx__data, NULL);
module_object.add_function("f_L1CTL_FBSB", (genericfunc_t)&f__L1CTL__FBSB, NULL);
module_object.add_function("f_L1CTL_CCCH_MODE", (genericfunc_t)&f__L1CTL__CCCH__MODE, NULL);
module_object.add_function("f_L1CTL_TCH_MODE", (genericfunc_t)&f__L1CTL__TCH__MODE, NULL);
module_object.add_function("f_L1CTL_RACH", (genericfunc_t)&f__L1CTL__RACH, NULL);
module_object.add_function("f_L1CTL_EXT_RACH", (genericfunc_t)&f__L1CTL__EXT__RACH, NULL);
module_object.add_function("f_L1CTL_PARAM", (genericfunc_t)&f__L1CTL__PARAM, NULL);
module_object.add_function("f_L1CTL_WAIT_IMM_ASS", (genericfunc_t)&f__L1CTL__WAIT__IMM__ASS, NULL);
module_object.add_function("f_L1CTL_WAIT_IMM_ASS_TBF_DL", (genericfunc_t)&f__L1CTL__WAIT__IMM__ASS__TBF__DL, NULL);
module_object.add_function("f_L1CTL_DM_EST_REQ_IA", (genericfunc_t)&f__L1CTL__DM__EST__REQ__IA, NULL);
module_object.add_function("f_L1CTL_DM_REL_REQ", (genericfunc_t)&f__L1CTL__DM__REL__REQ, NULL);
module_object.add_function("f_L1CTL_RESET", (genericfunc_t)&f__L1CTL__RESET, NULL);
module_object.add_function("f_L1CTL_CRYPTO_REQ", (genericfunc_t)&f__L1CTL__CRYPTO__REQ, NULL);
module_object.add_function("f_connect_reset", (genericfunc_t)&f__connect__reset, NULL);
module_object.add_function("L1CTL_to_UD_connect", (genericfunc_t)&L1CTL__to__UD__connect, NULL);
module_object.add_function("UD_to_L1CTL_connect_result", (genericfunc_t)&UD__to__L1CTL__connect__result, NULL);
module_object.add_function("L1CTL_to_UD", (genericfunc_t)&L1CTL__to__UD, NULL);
module_object.add_function("UD_to_L1CTL", (genericfunc_t)&UD__to__L1CTL, NULL);
}

void post_init_module()
{
TTCN_Location current_location("L1CTL_PortType.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "L1CTL_PortType");
L1CTL__Types::module_object.post_init_module();
UD__PortType::module_object.post_init_module();
L1CTL__PortType__CtrlFunct::module_object.post_init_module();
current_location.update_lineno(47);
/* L1CTL_PortType.ttcn, line 47 */
template_f__L1CTL__rx__data_chan__nr_defval = ANY_VALUE;
current_location.update_lineno(48);
/* L1CTL_PortType.ttcn, line 48 */
template_f__L1CTL__rx__data_link__id_defval = ANY_VALUE;
current_location.update_lineno(70);
/* L1CTL_PortType.ttcn, line 70 */
const_f__L1CTL__FBSB_ccch__mode_defval = L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED;
current_location.update_lineno(71);
/* L1CTL_PortType.ttcn, line 71 */
const_f__L1CTL__FBSB_rxlev__exp_defval = 57;
current_location.update_lineno(111);
/* L1CTL_PortType.ttcn, line 111 */
template_f__L1CTL__TCH__MODE_tch__mode__req__tmpl_defval = L1CTL__Types::ts__L1CTL__TCH__MODE__REQ(L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_tch__mode_defval, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_audio__mode_defval, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_loop__mode_defval, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_amr__start__codec_defval, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_amr__codecs__bitmask_defval);
current_location.update_lineno(125);
/* L1CTL_PortType.ttcn, line 125 */
const_f__L1CTL__RACH_combined_defval = 1;
current_location.update_lineno(125);
/* L1CTL_PortType.ttcn, line 125 */
const_f__L1CTL__RACH_offset_defval = 0;
current_location.update_lineno(126);
/* L1CTL_PortType.ttcn, line 126 */
template_f__L1CTL__RACH_chan__nr_defval = GSM__Types::ts__RslChanNr__RACH(0);
current_location.update_lineno(127);
/* L1CTL_PortType.ttcn, line 127 */
template_f__L1CTL__RACH_link__id_defval = GSM__Types::ts__RslLinkID__DCCH(0);
current_location.update_lineno(147);
/* L1CTL_PortType.ttcn, line 147 */
const_f__L1CTL__EXT__RACH_combined_defval = 1;
current_location.update_lineno(147);
/* L1CTL_PortType.ttcn, line 147 */
const_f__L1CTL__EXT__RACH_offset_defval = 0;
current_location.update_lineno(233);
/* L1CTL_PortType.ttcn, line 233 */
const_f__L1CTL__DM__EST__REQ__IA_ma_defval = NULL_VALUE;
current_location.update_lineno(261);
/* L1CTL_PortType.ttcn, line 261 */
const_f__L1CTL__RESET_res__type_defval = L1CTL__Types::L1ctlResetType::L1CTL__RES__T__FULL;
current_location.update_lineno(279);
/* L1CTL_PortType.ttcn, line 279 */
const_f__connect__reset_l1ctl__sock__path_defval = m__l1ctl__sock__path;
}

boolean set_module_param(Module_Param& param)
{
const char* const par_name = param.get_id()->get_current_name();
if (!strcmp(par_name, "m_l1ctl_sock_path")) {
modulepar_m__l1ctl__sock__path.set_param(param);
return TRUE;
} else return FALSE;
}

void log_module_param()
{
TTCN_Logger::log_event_str("m_l1ctl_sock_path := ");
m__l1ctl__sock__path.log();
}


} /* end of namespace */
