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

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

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

/* Including header files */

#include "RAW_NS.hh"

namespace RAW__NS {

/* Literal string constants */

extern const CHARSTRING cs_1(7, "-provFR"),
cs_0(7, "-provIP"),
cs_2(13, "RAW_NS.ttcnpp"),
cs_3(23, "Unsupported NS provider");
const unsigned char module_checksum[] = { 0x3b, 0x91, 0x2f, 0x6c, 0xbd, 0xbf, 0xe8, 0xc5, 0xf2, 0xbf, 0x5b, 0xc7, 0x8e, 0xc7, 0x73, 0xbf };

/* Global variable definitions */

const XERdescriptor_t       PerIPProvider_local__ip_xer_ = { {"local_ip>\n", "local_ip>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PerIPProvider_local__ip_descr_ = { "@RAW_NS.PerIPProvider.local_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &PerIPProvider_local__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PerIPProvider_local__udp__port_xer_ = { {"local_udp_port>\n", "local_udp_port>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PerIPProvider_local__udp__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PerIPProvider_local__udp__port_descr_ = { "@RAW_NS.PerIPProvider.local_udp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PerIPProvider_local__udp__port_xer_, &INTEGER_json_, &PerIPProvider_local__udp__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for PerIPProvider
const TTCN_Typedescriptor_t PerIPProvider_descr_ = { "@RAW_NS.PerIPProvider", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_Typedescriptor_t& RAW__NS__CT_descr_ = COMPONENT_descr_;
PORT_ARRAY<NS__Emulation::NS__PROVIDER__PT, 4, 0> RAW__NS__CT_component_NSCP;
VALUE_ARRAY<PerIPProvider, 4, 0> RAW__NS__CT_component_ip__prov;
NS__Provider__IPL4::NSPIP__PROC__PT RAW__NS__CT_component_NSPIP__PROC("NSPIP_PROC");
VALUE_ARRAY<COMPONENT, 4, 0> RAW__NS__CT_component_vc__NSP__FR;
NS__Emulation::NSConfiguration RAW__NS__CT_component_g__nsconfig;
TIMER RAW__NS__CT_component_g__T__guard("g_T_guard");
BOOLEAN RAW__NS__CT_component_g__handle__rx__alive;
BOOLEAN RAW__NS__CT_component_rawns__initialized;
INTEGER const_f__init__ns__codec_idx_defval;
const INTEGER& f__init__ns__codec_idx_defval = const_f__init__ns__codec_idx_defval;
FLOAT const_f__init__ns__codec_guard__secs_defval;
const FLOAT& f__init__ns__codec_guard__secs_defval = const_f__init__ns__codec_guard__secs_defval;
CHARSTRING const_f__init__ns__codec_id_defval;
const CHARSTRING& f__init__ns__codec_id_defval = const_f__init__ns__codec_id_defval;
INTEGER const_ax__rx__fail__on__any__ns_idx_defval;
const INTEGER& ax__rx__fail__on__any__ns_idx_defval = const_ax__rx__fail__on__any__ns_idx_defval;
INTEGER const_f__ns__exp_idx_defval;
const INTEGER& f__ns__exp_idx_defval = const_f__ns__exp_idx_defval;
INTEGER const_f__outgoing__ns__alive_idx_defval;
const INTEGER& f__outgoing__ns__alive_idx_defval = const_f__outgoing__ns__alive_idx_defval;
INTEGER const_f__outgoing__ns__alive__no__ack_idx_defval;
const INTEGER& f__outgoing__ns__alive__no__ack_idx_defval = const_f__outgoing__ns__alive__no__ack_idx_defval;
FLOAT const_f__outgoing__ns__alive__no__ack_tout_defval;
const FLOAT& f__outgoing__ns__alive__no__ack_tout_defval = const_f__outgoing__ns__alive__no__ack_tout_defval;
INTEGER const_f__outgoing__ns__reset_idx_defval;
const INTEGER& f__outgoing__ns__reset_idx_defval = const_f__outgoing__ns__reset_idx_defval;
FLOAT const_f__outgoing__ns__reset_tout_defval;
const FLOAT& f__outgoing__ns__reset_tout_defval = const_f__outgoing__ns__reset_tout_defval;
INTEGER const_f__outgoing__ns__block_idx_defval;
const INTEGER& f__outgoing__ns__block_idx_defval = const_f__outgoing__ns__block_idx_defval;
INTEGER const_f__outgoing__ns__unblock_idx_defval;
const INTEGER& f__outgoing__ns__unblock_idx_defval = const_f__outgoing__ns__unblock_idx_defval;
BOOLEAN const_as__rx__alive__tx__ack_oneshot_defval;
const BOOLEAN& as__rx__alive__tx__ack_oneshot_defval = const_as__rx__alive__tx__ack_oneshot_defval;
INTEGER const_as__rx__alive__tx__ack_idx_defval;
const INTEGER& as__rx__alive__tx__ack_idx_defval = const_as__rx__alive__tx__ack_idx_defval;
INTEGER const_f__tx__bvc__reset__rx__ack_idx_defval;
const INTEGER& f__tx__bvc__reset__rx__ack_idx_defval = const_f__tx__bvc__reset__rx__ack_idx_defval;
BOOLEAN const_f__tx__bvc__reset__rx__ack_exp__ack_defval;
const BOOLEAN& f__tx__bvc__reset__rx__ack_exp__ack_defval = const_f__tx__bvc__reset__rx__ack_exp__ack_defval;
BOOLEAN const_as__rx__bvc__reset__tx__ack_oneshot_defval;
const BOOLEAN& as__rx__bvc__reset__tx__ack_oneshot_defval = const_as__rx__bvc__reset__tx__ack_oneshot_defval;
INTEGER const_as__rx__bvc__reset__tx__ack_idx_defval;
const INTEGER& as__rx__bvc__reset__tx__ack_idx_defval = const_as__rx__bvc__reset__tx__ack_idx_defval;
BOOLEAN const_as__rx__bvc__unblock__tx__ack_oneshot_defval;
const BOOLEAN& as__rx__bvc__unblock__tx__ack_oneshot_defval = const_as__rx__bvc__unblock__tx__ack_oneshot_defval;
INTEGER const_as__rx__bvc__unblock__tx__ack_idx_defval;
const INTEGER& as__rx__bvc__unblock__tx__ack_idx_defval = const_as__rx__bvc__unblock__tx__ack_idx_defval;
BOOLEAN const_as__rx__bvc__fc__tx__ack_oneshot_defval;
const BOOLEAN& as__rx__bvc__fc__tx__ack_oneshot_defval = const_as__rx__bvc__fc__tx__ack_oneshot_defval;
INTEGER const_as__rx__bvc__fc__tx__ack_idx_defval;
const INTEGER& as__rx__bvc__fc__tx__ack_idx_defval = const_as__rx__bvc__fc__tx__ack_idx_defval;
BOOLEAN const_as__rx__ns__reset__ack_oneshot_defval;
const BOOLEAN& as__rx__ns__reset__ack_oneshot_defval = const_as__rx__ns__reset__ack_oneshot_defval;
INTEGER const_as__rx__ns__reset__ack_idx_defval;
const INTEGER& as__rx__ns__reset__ack_idx_defval = const_as__rx__ns__reset__ack_idx_defval;
BOOLEAN const_as__rx__ns__unblock__ack_oneshot_defval;
const BOOLEAN& as__rx__ns__unblock__ack_oneshot_defval = const_as__rx__ns__unblock__ack_oneshot_defval;
INTEGER const_as__rx__ns__unblock__ack_idx_defval;
const INTEGER& as__rx__ns__unblock__ack_idx_defval = const_as__rx__ns__unblock__ack_idx_defval;
BOOLEAN const_as__rx__ns__block__ack_oneshot_defval;
const BOOLEAN& as__rx__ns__block__ack_oneshot_defval = const_as__rx__ns__block__ack_oneshot_defval;
INTEGER const_as__rx__ns__block__ack_idx_defval;
const INTEGER& as__rx__ns__block__ack_idx_defval = const_as__rx__ns__block__ack_idx_defval;
Osmocom__Gb__Types::NsCause_template template_as__rx__ns__block__ack_cause_defval;
const Osmocom__Gb__Types::NsCause_template& as__rx__ns__block__ack_cause_defval = template_as__rx__ns__block__ack_cause_defval;
INTEGER_template template_as__rx__ns__block__ack_nsvci_defval;
const INTEGER_template& as__rx__ns__block__ack_nsvci_defval = template_as__rx__ns__block__ack_nsvci_defval;
Osmocom__Gb__Types::NsCause_template template_f__incoming__sns__size_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__incoming__sns__size_cause_defval = template_f__incoming__sns__size_cause_defval;
INTEGER const_f__incoming__sns__size_idx_defval;
const INTEGER& f__incoming__sns__size_idx_defval = const_f__incoming__sns__size_idx_defval;
INTEGER_template template_f__incoming__sns__size_num__max__nsvcs_defval;
const INTEGER_template& f__incoming__sns__size_num__max__nsvcs_defval = template_f__incoming__sns__size_num__max__nsvcs_defval;
INTEGER_template template_f__incoming__sns__size_num__ep_defval;
const INTEGER_template& f__incoming__sns__size_num__ep_defval = template_f__incoming__sns__size_num__ep_defval;
Osmocom__Gb__Types::NsCause_template template_f__outgoing__sns__size_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__outgoing__sns__size_cause_defval = template_f__outgoing__sns__size_cause_defval;
INTEGER const_f__outgoing__sns__size_max__nsvcs_defval;
const INTEGER& f__outgoing__sns__size_max__nsvcs_defval = const_f__outgoing__sns__size_max__nsvcs_defval;
INTEGER const_f__outgoing__sns__size_num__ip_defval;
const INTEGER& f__outgoing__sns__size_num__ip_defval = const_f__outgoing__sns__size_num__ip_defval;
INTEGER const_f__outgoing__sns__size_idx_defval;
const INTEGER& f__outgoing__sns__size_idx_defval = const_f__outgoing__sns__size_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__incoming__sns__config_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__incoming__sns__config_cause_defval = template_f__incoming__sns__config_cause_defval;
INTEGER const_f__incoming__sns__config_idx_defval;
const INTEGER& f__incoming__sns__config_idx_defval = const_f__incoming__sns__config_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__outgoing__sns__config_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__outgoing__sns__config_cause_defval = template_f__outgoing__sns__config_cause_defval;
INTEGER const_f__outgoing__sns__config_idx_defval;
const INTEGER& f__outgoing__sns__config_idx_defval = const_f__outgoing__sns__config_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__outgoing__sns__config__1c1u_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__outgoing__sns__config__1c1u_cause_defval = template_f__outgoing__sns__config__1c1u_cause_defval;
INTEGER const_f__outgoing__sns__config__1c1u_idx_defval;
const INTEGER& f__outgoing__sns__config__1c1u_idx_defval = const_f__outgoing__sns__config__1c1u_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__outgoing__sns__config__1c1u__separate_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__outgoing__sns__config__1c1u__separate_cause_defval = template_f__outgoing__sns__config__1c1u__separate_cause_defval;
INTEGER const_f__outgoing__sns__config__1c1u__separate_idx_defval;
const INTEGER& f__outgoing__sns__config__1c1u__separate_idx_defval = const_f__outgoing__sns__config__1c1u__separate_idx_defval;
INTEGER const_f__incoming__sns__chg__weight_idx__chg_defval;
const INTEGER& f__incoming__sns__chg__weight_idx__chg_defval = const_f__incoming__sns__chg__weight_idx__chg_defval;
Osmocom__Gb__Types::NsCause_template template_f__incoming__sns__chg__weight_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__incoming__sns__chg__weight_cause_defval = template_f__incoming__sns__chg__weight_cause_defval;
INTEGER const_f__incoming__sns__chg__weight_idx_defval;
const INTEGER& f__incoming__sns__chg__weight_idx_defval = const_f__incoming__sns__chg__weight_idx_defval;
INTEGER const_f__incoming__sns__add_w__sig_defval;
const INTEGER& f__incoming__sns__add_w__sig_defval = const_f__incoming__sns__add_w__sig_defval;
INTEGER const_f__incoming__sns__add_w__user_defval;
const INTEGER& f__incoming__sns__add_w__user_defval = const_f__incoming__sns__add_w__user_defval;
INTEGER const_f__incoming__sns__add_idx_defval;
const INTEGER& f__incoming__sns__add_idx_defval = const_f__incoming__sns__add_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__incoming__sns__add_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__incoming__sns__add_cause_defval = template_f__incoming__sns__add_cause_defval;
INTEGER const_f__outgoing__sns__add_w__sig_defval;
const INTEGER& f__outgoing__sns__add_w__sig_defval = const_f__outgoing__sns__add_w__sig_defval;
INTEGER const_f__outgoing__sns__add_w__user_defval;
const INTEGER& f__outgoing__sns__add_w__user_defval = const_f__outgoing__sns__add_w__user_defval;
INTEGER const_f__outgoing__sns__add_idx_defval;
const INTEGER& f__outgoing__sns__add_idx_defval = const_f__outgoing__sns__add_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__outgoing__sns__add_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__outgoing__sns__add_cause_defval = template_f__outgoing__sns__add_cause_defval;
INTEGER const_f__outgoing__sns__add_tid_defval;
const INTEGER& f__outgoing__sns__add_tid_defval = const_f__outgoing__sns__add_tid_defval;
INTEGER const_f__incoming__sns__del_w__sig_defval;
const INTEGER& f__incoming__sns__del_w__sig_defval = const_f__incoming__sns__del_w__sig_defval;
INTEGER const_f__incoming__sns__del_w__user_defval;
const INTEGER& f__incoming__sns__del_w__user_defval = const_f__incoming__sns__del_w__user_defval;
INTEGER const_f__incoming__sns__del_idx_defval;
const INTEGER& f__incoming__sns__del_idx_defval = const_f__incoming__sns__del_idx_defval;
Osmocom__Gb__Types::NsCause_template template_f__incoming__sns__del_cause_defval;
const Osmocom__Gb__Types::NsCause_template& f__incoming__sns__del_cause_defval = template_f__incoming__sns__del_cause_defval;
INTEGER const_f__outgoing__sns__del_w__sig_defval;
const INTEGER& f__outgoing__sns__del_w__sig_defval = const_f__outgoing__sns__del_w__sig_defval;
INTEGER const_f__outgoing__sns__del_w__user_defval;
const INTEGER& f__outgoing__sns__del_w__user_defval = const_f__outgoing__sns__del_w__user_defval;
INTEGER const_f__outgoing__sns__del_idx_defval;
const INTEGER& f__outgoing__sns__del_idx_defval = const_f__outgoing__sns__del_idx_defval;
INTEGER const_f__outgoing__sns__del_tid_defval;
const INTEGER& f__outgoing__sns__del_tid_defval = const_f__outgoing__sns__del_tid_defval;
INTEGER const_f__outgoing__sns__chg__weight_idx_defval;
const INTEGER& f__outgoing__sns__chg__weight_idx_defval = const_f__outgoing__sns__chg__weight_idx_defval;
INTEGER const_f__outgoing__sns__chg__weight_tid_defval;
const INTEGER& f__outgoing__sns__chg__weight_tid_defval = const_f__outgoing__sns__chg__weight_tid_defval;
TTCN_Module module_object("RAW_NS", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

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

/* Member functions of C++ classes */

PerIPProvider::PerIPProvider()
{
}

PerIPProvider::PerIPProvider(const COMPONENT& par_vc__NSP__IP,
    const CHARSTRING& par_local__ip,
    const INTEGER& par_local__udp__port)
  :   field_vc__NSP__IP(par_vc__NSP__IP),
  field_local__ip(par_local__ip),
  field_local__udp__port(par_local__udp__port)
{
}

PerIPProvider::PerIPProvider(const PerIPProvider& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RAW_NS.PerIPProvider.");
if (other_value.vc__NSP__IP().is_bound()) field_vc__NSP__IP = other_value.vc__NSP__IP();
else field_vc__NSP__IP.clean_up();
if (other_value.local__ip().is_bound()) field_local__ip = other_value.local__ip();
else field_local__ip.clean_up();
if (other_value.local__udp__port().is_bound()) field_local__udp__port = other_value.local__udp__port();
else field_local__udp__port.clean_up();
}

void PerIPProvider::clean_up()
{
field_vc__NSP__IP.clean_up();
field_local__ip.clean_up();
field_local__udp__port.clean_up();
}

const TTCN_Typedescriptor_t* PerIPProvider::get_descriptor() const { return &PerIPProvider_descr_; }
PerIPProvider& PerIPProvider::operator=(const PerIPProvider& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RAW_NS.PerIPProvider.");
  if (other_value.vc__NSP__IP().is_bound()) field_vc__NSP__IP = other_value.vc__NSP__IP();
  else field_vc__NSP__IP.clean_up();
  if (other_value.local__ip().is_bound()) field_local__ip = other_value.local__ip();
  else field_local__ip.clean_up();
  if (other_value.local__udp__port().is_bound()) field_local__udp__port = other_value.local__udp__port();
  else field_local__udp__port.clean_up();
}
return *this;
}

boolean PerIPProvider::operator==(const PerIPProvider& other_value) const
{
return field_vc__NSP__IP==other_value.field_vc__NSP__IP
  && field_local__ip==other_value.field_local__ip
  && field_local__udp__port==other_value.field_local__udp__port;
}

boolean PerIPProvider::is_bound() const
{
return (field_vc__NSP__IP.is_bound())
  || (field_local__ip.is_bound())
  || (field_local__udp__port.is_bound());
}
boolean PerIPProvider::is_value() const
{
return field_vc__NSP__IP.is_value()
  && field_local__ip.is_value()
  && field_local__udp__port.is_value();
}
void PerIPProvider::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ vc_NSP_IP := ");
field_vc__NSP__IP.log();
TTCN_Logger::log_event_str(", local_ip := ");
field_local__ip.log();
TTCN_Logger::log_event_str(", local_udp_port := ");
field_local__udp__port.log();
TTCN_Logger::log_event_str(" }");
}

void PerIPProvider::set_implicit_omit()
{
if (vc__NSP__IP().is_bound()) vc__NSP__IP().set_implicit_omit();
if (local__ip().is_bound()) local__ip().set_implicit_omit();
if (local__udp__port().is_bound()) local__udp__port().set_implicit_omit();
}

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

void PerIPProvider::encode_text(Text_Buf& text_buf) const
{
field_vc__NSP__IP.encode_text(text_buf);
field_local__ip.encode_text(text_buf);
field_local__udp__port.encode_text(text_buf);
}

void PerIPProvider::decode_text(Text_Buf& text_buf)
{
field_vc__NSP__IP.decode_text(text_buf);
field_local__ip.decode_text(text_buf);
field_local__udp__port.decode_text(text_buf);
}

struct PerIPProvider_template::single_value_struct {
COMPONENT_template field_vc__NSP__IP;
CHARSTRING_template field_local__ip;
INTEGER_template field_local__udp__port;
};

void PerIPProvider_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_vc__NSP__IP = ANY_VALUE;
single_value->field_local__ip = ANY_VALUE;
single_value->field_local__udp__port = ANY_VALUE;
}
}
}

void PerIPProvider_template::copy_value(const PerIPProvider& other_value)
{
single_value = new single_value_struct;
if (other_value.vc__NSP__IP().is_bound()) {
  single_value->field_vc__NSP__IP = other_value.vc__NSP__IP();
} else {
  single_value->field_vc__NSP__IP.clean_up();
}
if (other_value.local__ip().is_bound()) {
  single_value->field_local__ip = other_value.local__ip();
} else {
  single_value->field_local__ip.clean_up();
}
if (other_value.local__udp__port().is_bound()) {
  single_value->field_local__udp__port = other_value.local__udp__port();
} else {
  single_value->field_local__udp__port.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PerIPProvider_template::copy_template(const PerIPProvider_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.vc__NSP__IP().get_selection()) {
single_value->field_vc__NSP__IP = other_value.vc__NSP__IP();
} else {
single_value->field_vc__NSP__IP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__ip().get_selection()) {
single_value->field_local__ip = other_value.local__ip();
} else {
single_value->field_local__ip.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.local__udp__port().get_selection()) {
single_value->field_local__udp__port = other_value.local__udp__port();
} else {
single_value->field_local__udp__port.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PerIPProvider_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 PerIPProvider_template(*other_value.implication_.precondition);
implication_.implied_template = new PerIPProvider_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 @RAW_NS.PerIPProvider.");
break;
}
set_selection(other_value);
}

PerIPProvider_template::PerIPProvider_template()
{
}

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

PerIPProvider_template::PerIPProvider_template(const PerIPProvider& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PerIPProvider_template::match(const PerIPProvider& 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.vc__NSP__IP().is_bound()) return FALSE;
if(!single_value->field_vc__NSP__IP.match(other_value.vc__NSP__IP(), legacy))return FALSE;
if(!other_value.local__ip().is_bound()) return FALSE;
if(!single_value->field_local__ip.match(other_value.local__ip(), legacy))return FALSE;
if(!other_value.local__udp__port().is_bound()) return FALSE;
if(!single_value->field_local__udp__port.match(other_value.local__udp__port(), 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 @RAW_NS.PerIPProvider.");
}
return FALSE;
}

boolean PerIPProvider_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_vc__NSP__IP.is_bound()
 || single_value->field_local__ip.is_bound()
 || single_value->field_local__udp__port.is_bound();
}

boolean PerIPProvider_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_vc__NSP__IP.is_value()
 && single_value->field_local__ip.is_value()
 && single_value->field_local__udp__port.is_value();
}

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

PerIPProvider PerIPProvider_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 @RAW_NS.PerIPProvider.");
PerIPProvider ret_val;
if (single_value->field_vc__NSP__IP.is_bound()) {
ret_val.vc__NSP__IP() = single_value->field_vc__NSP__IP.valueof();
}
if (single_value->field_local__ip.is_bound()) {
ret_val.local__ip() = single_value->field_local__ip.valueof();
}
if (single_value->field_local__udp__port.is_bound()) {
ret_val.local__udp__port() = single_value->field_local__udp__port.valueof();
}
return ret_val;
}

void PerIPProvider_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 @RAW_NS.PerIPProvider.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PerIPProvider_template[list_length];
}

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

COMPONENT_template& PerIPProvider_template::vc__NSP__IP()
{
set_specific();
return single_value->field_vc__NSP__IP;
}

const COMPONENT_template& PerIPProvider_template::vc__NSP__IP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vc_NSP_IP of a non-specific template of type @RAW_NS.PerIPProvider.");
return single_value->field_vc__NSP__IP;
}

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

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

INTEGER_template& PerIPProvider_template::local__udp__port()
{
set_specific();
return single_value->field_local__udp__port;
}

const INTEGER_template& PerIPProvider_template::local__udp__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_udp_port of a non-specific template of type @RAW_NS.PerIPProvider.");
return single_value->field_local__udp__port;
}

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

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

void PerIPProvider_template::log_match(const PerIPProvider& 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_vc__NSP__IP.match(match_value.vc__NSP__IP(), legacy)){
TTCN_Logger::log_logmatch_info(".vc_NSP_IP");
single_value->field_vc__NSP__IP.log_match(match_value.vc__NSP__IP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__ip.match(match_value.local__ip(), legacy)){
TTCN_Logger::log_logmatch_info(".local_ip");
single_value->field_local__ip.log_match(match_value.local__ip(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_local__udp__port.match(match_value.local__udp__port(), legacy)){
TTCN_Logger::log_logmatch_info(".local_udp_port");
single_value->field_local__udp__port.log_match(match_value.local__udp__port(), 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("{ vc_NSP_IP := ");
single_value->field_vc__NSP__IP.log_match(match_value.vc__NSP__IP(), legacy);
TTCN_Logger::log_event_str(", local_ip := ");
single_value->field_local__ip.log_match(match_value.local__ip(), legacy);
TTCN_Logger::log_event_str(", local_udp_port := ");
single_value->field_local__udp__port.log_match(match_value.local__udp__port(), 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 PerIPProvider_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_vc__NSP__IP.encode_text(text_buf);
single_value->field_local__ip.encode_text(text_buf);
single_value->field_local__udp__port.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @RAW_NS.PerIPProvider.");
}
}

void PerIPProvider_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_vc__NSP__IP.decode_text(text_buf);
single_value->field_local__ip.decode_text(text_buf);
single_value->field_local__udp__port.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PerIPProvider_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 @RAW_NS.PerIPProvider.");
}
}

void PerIPProvider_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: {
    PerIPProvider_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @RAW_NS.PerIPProvider has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) vc__NSP__IP().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) local__ip().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) local__udp__port().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vc_NSP_IP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__NSP__IP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_ip")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__ip().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "local_udp_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__udp__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RAW_NS.PerIPProvider: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PerIPProvider_template* precondition = new PerIPProvider_template;
    precondition->set_param(*param.get_elem(0));
    PerIPProvider_template* implied_template = new PerIPProvider_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PerIPProvider_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RAW_NS.PerIPProvider");
  }
  is_ifpresent = param.get_ifpresent();
}

void PerIPProvider_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_vc__NSP__IP.check_restriction(t_res, t_name ? t_name : "@RAW_NS.PerIPProvider");
single_value->field_local__ip.check_restriction(t_res, t_name ? t_name : "@RAW_NS.PerIPProvider");
single_value->field_local__udp__port.check_restriction(t_res, t_name ? t_name : "@RAW_NS.PerIPProvider");
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 : "@RAW_NS.PerIPProvider");
}

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

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

as__Tguard_Default::as__Tguard_Default()
 : Default_Base("as_Tguard")
{
}

alt_status as__Tguard_Default::call_altstep()
{
return as__Tguard_instance();
}

ax__rx__fail__on__any__ns_Default::ax__rx__fail__on__any__ns_Default(const INTEGER& idx)
 : Default_Base("ax_rx_fail_on_any_ns"), par_idx(idx)
{
}

alt_status ax__rx__fail__on__any__ns_Default::call_altstep()
{
return ax__rx__fail__on__any__ns_instance(par_idx);
}

as__rx__alive__tx__ack_Default::as__rx__alive__tx__ack_Default(const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_alive_tx_ack"), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__alive__tx__ack_Default::call_altstep()
{
return as__rx__alive__tx__ack_instance(par_oneshot, par_idx);
}

as__rx__bvc__reset__tx__ack_Default::as__rx__bvc__reset__tx__ack_Default(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_bvc_reset_tx_ack"), par_bvci(bvci), par_rx__cell__id(rx__cell__id), par_tx__cell__id(tx__cell__id), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__bvc__reset__tx__ack_Default::call_altstep()
{
return as__rx__bvc__reset__tx__ack_instance(par_bvci, par_rx__cell__id, par_tx__cell__id, par_oneshot, par_idx);
}

as__rx__bvc__unblock__tx__ack_Default::as__rx__bvc__unblock__tx__ack_Default(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_bvc_unblock_tx_ack"), par_bvci(bvci), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__bvc__unblock__tx__ack_Default::call_altstep()
{
return as__rx__bvc__unblock__tx__ack_instance(par_bvci, par_oneshot, par_idx);
}

as__rx__bvc__fc__tx__ack_Default::as__rx__bvc__fc__tx__ack_Default(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_bvc_fc_tx_ack"), par_bvci(bvci), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__bvc__fc__tx__ack_Default::call_altstep()
{
return as__rx__bvc__fc__tx__ack_instance(par_bvci, par_oneshot, par_idx);
}

as__rx__ns__reset__ack_Default::as__rx__ns__reset__ack_Default(const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_ns_reset_ack"), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__ns__reset__ack_Default::call_altstep()
{
return as__rx__ns__reset__ack_instance(par_oneshot, par_idx);
}

as__rx__ns__unblock__ack_Default::as__rx__ns__unblock__ack_Default(const BOOLEAN& oneshot, const INTEGER& idx)
 : Default_Base("as_rx_ns_unblock_ack"), par_oneshot(oneshot), par_idx(idx)
{
}

alt_status as__rx__ns__unblock__ack_Default::call_altstep()
{
return as__rx__ns__unblock__ack_instance(par_oneshot, par_idx);
}

as__rx__ns__block__ack_Default::as__rx__ns__block__ack_Default(const BOOLEAN& oneshot, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER_template& nsvci)
 : Default_Base("as_rx_ns_block_ack"), par_oneshot(oneshot), par_idx(idx), par_cause(cause), par_nsvci(nsvci)
{
}

alt_status as__rx__ns__block__ack_Default::call_altstep()
{
return as__rx__ns__block__ack_instance(par_oneshot, par_idx, par_cause, par_nsvci);
}


/* Bodies of functions, altsteps and testcases */

alt_status as__Tguard_instance()
{
TTCN_Location current_location("RAW_NS.ttcnpp", 48, TTCN_Location::LOCATION_ALTSTEP, "as_Tguard");
alt_status ret_val = ALT_NO;
current_location.update_lineno(49);
/* RAW_NS.ttcnpp, line 49 */
switch (RAW__NS__CT_component_g__T__guard.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(50);
/* RAW_NS.ttcnpp, line 50 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout of T_guard"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(51);
/* RAW_NS.ttcnpp, line 51 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__Tguard()
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__Tguard_instance();
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_Tguard.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__Tguard()
{
return new as__Tguard_Default();
}

INTEGER f__find__ip__provider(const NS__Emulation::NSVCConfigurationIP& nsip__config)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 55, TTCN_Location::LOCATION_FUNCTION, "f_find_ip_provider");
{
current_location.update_lineno(57);
/* RAW_NS.ttcnpp, line 57 */
INTEGER idx(0);
current_location.update_lineno(57);
/* RAW_NS.ttcnpp, line 57 */
for ( ; ; ) {
current_location.update_lineno(57);
/* RAW_NS.ttcnpp, line 57 */
if (!(idx < 4)) break;
{
current_location.update_lineno(58);
/* RAW_NS.ttcnpp, line 58 */
if ((const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[idx].vc__NSP__IP() == NULL_COMPREF)) {
current_location.update_lineno(59);
/* RAW_NS.ttcnpp, line 59 */
goto tmp_0;
}
current_location.update_lineno(62);
/* RAW_NS.ttcnpp, line 62 */
{
boolean tmp_1;
tmp_1 = (const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[idx].local__ip() == const_cast< const NS__Emulation::NSVCConfigurationIP&>(nsip__config).local__ip());
if (tmp_1) tmp_1 = (const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[idx].local__udp__port() == const_cast< const NS__Emulation::NSVCConfigurationIP&>(nsip__config).local__udp__port());
if (tmp_1) {
current_location.update_lineno(64);
/* RAW_NS.ttcnpp, line 64 */
return idx;
}
}
}
tmp_0:
current_location.update_lineno(57);
/* RAW_NS.ttcnpp, line 57 */
{
INTEGER tmp_2;
++idx;
}
}
}
current_location.update_lineno(67);
/* RAW_NS.ttcnpp, line 67 */
return -1;
}

void start_f__find__ip__provider(const COMPONENT& component_reference, const NS__Emulation::NSVCConfigurationIP& nsip__config)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_find_ip_provider(");
nsip__config.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_find_ip_provider", text_buf);
nsip__config.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__init__ns__codec(const NS__Emulation::NSConfiguration& ns__config, const INTEGER& idx, const FLOAT& guard__secs, const CHARSTRING& id)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 70, TTCN_Location::LOCATION_FUNCTION, "f_init_ns_codec");
current_location.update_lineno(71);
/* RAW_NS.ttcnpp, line 71 */
Socket__API__Definitions::Result res;
current_location.update_lineno(73);
/* RAW_NS.ttcnpp, line 73 */
if ((!(RAW__NS__CT_component_g__T__guard.running(NULL)))) {
current_location.update_lineno(74);
/* RAW_NS.ttcnpp, line 74 */
RAW__NS__CT_component_g__T__guard.start(guard__secs);
current_location.update_lineno(75);
/* RAW_NS.ttcnpp, line 75 */
activate_as__Tguard();
}
current_location.update_lineno(78);
/* RAW_NS.ttcnpp, line 78 */
if ((!(RAW__NS__CT_component_rawns__initialized))) {
{
current_location.update_lineno(79);
/* RAW_NS.ttcnpp, line 79 */
INTEGER i(0);
current_location.update_lineno(79);
/* RAW_NS.ttcnpp, line 79 */
for ( ; ; ) {
current_location.update_lineno(79);
/* RAW_NS.ttcnpp, line 79 */
if (!(i < 4)) break;
current_location.update_lineno(80);
/* RAW_NS.ttcnpp, line 80 */
RAW__NS__CT_component_ip__prov[i].vc__NSP__IP() = NULL_COMPREF;
current_location.update_lineno(79);
/* RAW_NS.ttcnpp, line 79 */
{
INTEGER tmp_4;
++i;
}
}
}
current_location.update_lineno(82);
/* RAW_NS.ttcnpp, line 82 */
RAW__NS__CT_component_rawns__initialized = TRUE;
}
current_location.update_lineno(85);
/* RAW_NS.ttcnpp, line 85 */
if ((!(RAW__NS__CT_component_g__nsconfig.is_bound()))) {
current_location.update_lineno(86);
/* RAW_NS.ttcnpp, line 86 */
RAW__NS__CT_component_g__nsconfig = ns__config;
}
current_location.update_lineno(89);
/* RAW_NS.ttcnpp, line 89 */
{
boolean tmp_14;
{
boolean tmp_7 = ns__config.is_bound();
if(tmp_7) {
const NS__Emulation::NSConfiguration& tmp_8 = ns__config;
const NS__Emulation::NSVCConfigurations& tmp_9 = tmp_8.nsvc();
tmp_7 = tmp_9.is_bound();
if(tmp_7) {
const int tmp_10 = idx;
tmp_7 = (tmp_10 >= 0) && (tmp_9.size_of() > tmp_10);
if(tmp_7) {
const NS__Emulation::NSVCConfiguration& tmp_11 = tmp_9[tmp_10];
tmp_7 = tmp_11.is_bound();
if(tmp_7) {
const NS__Emulation::NSVCConfiguration& tmp_12 = tmp_11;
const NS__Emulation::NSVCConfigurationP& tmp_13 = tmp_12.provider();
tmp_7 = tmp_13.is_bound();
if (tmp_7) {
tmp_7 = tmp_13.ischosen(NS__Emulation::NSVCConfigurationP::ALT_ip);
}
}
}
}
}
tmp_14 = tmp_7;
}
if (tmp_14) {
current_location.update_lineno(90);
/* RAW_NS.ttcnpp, line 90 */
INTEGER prov__idx(f__find__ip__provider(const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx].provider().ip()));
current_location.update_lineno(95);
/* RAW_NS.ttcnpp, line 95 */
if ((prov__idx == -1)) {
current_location.update_lineno(96);
/* RAW_NS.ttcnpp, line 96 */
prov__idx = 0;
current_location.update_lineno(96);
/* RAW_NS.ttcnpp, line 96 */
for ( ; ; ) {
current_location.update_lineno(96);
/* RAW_NS.ttcnpp, line 96 */
if (!(prov__idx < 4)) break;
current_location.update_lineno(97);
/* RAW_NS.ttcnpp, line 97 */
if ((const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[prov__idx].vc__NSP__IP() == NULL_COMPREF)) {
current_location.update_lineno(98);
/* RAW_NS.ttcnpp, line 98 */
break;
}
current_location.update_lineno(96);
/* RAW_NS.ttcnpp, line 96 */
{
INTEGER tmp_16;
++prov__idx;
}
}
current_location.update_lineno(101);
/* RAW_NS.ttcnpp, line 101 */
if ((prov__idx > 4)) {
}
current_location.update_lineno(104);
/* RAW_NS.ttcnpp, line 104 */
RAW__NS__CT_component_ip__prov[prov__idx].local__ip() = const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx].provider().ip().local__ip();
current_location.update_lineno(105);
/* RAW_NS.ttcnpp, line 105 */
RAW__NS__CT_component_ip__prov[prov__idx].local__udp__port() = const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx].provider().ip().local__udp__port();
current_location.update_lineno(106);
/* RAW_NS.ttcnpp, line 106 */
RAW__NS__CT_component_ip__prov[prov__idx].vc__NSP__IP() = TTCN_Runtime::create_component("NS_Provider_IPL4", "NS_Provider_IPL4_CT", ((id + cs_0) + int2str(prov__idx)), NULL, TRUE);
current_location.update_lineno(107);
/* RAW_NS.ttcnpp, line 107 */
TTCN_Runtime::connect_port(self, RAW__NS__CT_component_NSPIP__PROC.get_name(), const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[prov__idx].vc__NSP__IP(), NS__Provider__IPL4::NS__Provider__IPL4__CT_component_PROC.get_name());
current_location.update_lineno(108);
/* RAW_NS.ttcnpp, line 108 */
NS__Provider__IPL4::start_main_(const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[prov__idx].vc__NSP__IP(), const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx], ns__config, id);
}
current_location.update_lineno(110);
/* RAW_NS.ttcnpp, line 110 */
INTEGER port__idx(NS__Provider__IPL4::f__nspip__add__nsvc2(COMPONENT(const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[prov__idx].vc__NSP__IP()), const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx].provider().ip().remote__ip(), const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx].provider().ip().remote__udp__port()));
current_location.update_lineno(111);
/* RAW_NS.ttcnpp, line 111 */
TTCN_Runtime::connect_port(self, RAW__NS__CT_component_NSCP[idx].get_name(), const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[prov__idx].vc__NSP__IP(), NS__Provider__IPL4::NS__Provider__IPL4__CT_component_NSVC[port__idx].get_name());
}
else {
current_location.update_lineno(114);
/* RAW_NS.ttcnpp, line 114 */
boolean tmp_27;
{
boolean tmp_20 = ns__config.is_bound();
if(tmp_20) {
const NS__Emulation::NSConfiguration& tmp_21 = ns__config;
const NS__Emulation::NSVCConfigurations& tmp_22 = tmp_21.nsvc();
tmp_20 = tmp_22.is_bound();
if(tmp_20) {
const int tmp_23 = idx;
tmp_20 = (tmp_23 >= 0) && (tmp_22.size_of() > tmp_23);
if(tmp_20) {
const NS__Emulation::NSVCConfiguration& tmp_24 = tmp_22[tmp_23];
tmp_20 = tmp_24.is_bound();
if(tmp_20) {
const NS__Emulation::NSVCConfiguration& tmp_25 = tmp_24;
const NS__Emulation::NSVCConfigurationP& tmp_26 = tmp_25.provider();
tmp_20 = tmp_26.is_bound();
if (tmp_20) {
tmp_20 = tmp_26.ischosen(NS__Emulation::NSVCConfigurationP::ALT_fr);
}
}
}
}
}
tmp_27 = tmp_20;
}
if (tmp_27) {
current_location.update_lineno(115);
/* RAW_NS.ttcnpp, line 115 */
RAW__NS__CT_component_vc__NSP__FR[idx] = TTCN_Runtime::create_component("NS_Provider_FR", "NS_Provider_FR_CT", (id + cs_1), NULL, TRUE);
current_location.update_lineno(116);
/* RAW_NS.ttcnpp, line 116 */
TTCN_Runtime::connect_port(self, RAW__NS__CT_component_NSCP[idx].get_name(), const_cast< const VALUE_ARRAY<COMPONENT, 4, 0>&>(RAW__NS__CT_component_vc__NSP__FR)[idx], NS__Emulation::NS__Provider__CT_component_NSE.get_name());
current_location.update_lineno(117);
/* RAW_NS.ttcnpp, line 117 */
NS__Provider__FR::start_main_(const_cast< const VALUE_ARRAY<COMPONENT, 4, 0>&>(RAW__NS__CT_component_vc__NSP__FR)[idx], const_cast< const NS__Emulation::NSConfiguration&>(ns__config).nsvc()[idx], ns__config, id);
current_location.update_lineno(118);
/* RAW_NS.ttcnpp, line 118 */
{
tmp_29:
NS__Emulation::NS__Provider__Evt_template tmp_30;
tmp_30.link__status() = NS__Emulation::NS__Provider__LinkStatus::NS__PROV__LINK__STATUS__UP;
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = RAW__NS__CT_component_NSCP[idx].receive(tmp_30, NULL, any_compref, NULL, NULL, NULL);
if (alt_flag == ALT_YES) break;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_29;
}
current_location.update_lineno(118);
/* RAW_NS.ttcnpp, line 118 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file RAW_NS.ttcnpp, line 118.");
TTCN_Snapshot::take_new(TRUE);
}
}
}
else {
current_location.update_lineno(121);
/* RAW_NS.ttcnpp, line 121 */
Misc__Helpers::f__shutdown(cs_2, 121, FAIL, cs_3);
}
}
}
}

void start_f__init__ns__codec(const COMPONENT& component_reference, const NS__Emulation::NSConfiguration& ns__config, const INTEGER& idx, const FLOAT& guard__secs, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_ns_codec(");
ns__config.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
guard__secs.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_init_ns_codec", text_buf);
ns__config.encode_text(text_buf);
idx.encode_text(text_buf);
guard__secs.encode_text(text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__clean__ns__codec()
{
TTCN_Location current_location("RAW_NS.ttcnpp", 125, TTCN_Location::LOCATION_FUNCTION, "f_clean_ns_codec");
{
current_location.update_lineno(126);
/* RAW_NS.ttcnpp, line 126 */
INTEGER i(0);
current_location.update_lineno(126);
/* RAW_NS.ttcnpp, line 126 */
for ( ; ; ) {
current_location.update_lineno(126);
/* RAW_NS.ttcnpp, line 126 */
if (!(i < RAW__NS__CT_component_ip__prov.lengthof())) break;
current_location.update_lineno(127);
/* RAW_NS.ttcnpp, line 127 */
if ((const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[i].vc__NSP__IP() != NULL_COMPREF)) {
current_location.update_lineno(128);
/* RAW_NS.ttcnpp, line 128 */
const_cast< const VALUE_ARRAY<PerIPProvider, 4, 0>&>(RAW__NS__CT_component_ip__prov)[i].vc__NSP__IP().stop();
}
current_location.update_lineno(126);
/* RAW_NS.ttcnpp, line 126 */
{
INTEGER tmp_31;
++i;
}
}
}
{
current_location.update_lineno(132);
/* RAW_NS.ttcnpp, line 132 */
INTEGER i(0);
current_location.update_lineno(132);
/* RAW_NS.ttcnpp, line 132 */
for ( ; ; ) {
current_location.update_lineno(132);
/* RAW_NS.ttcnpp, line 132 */
if (!(i < RAW__NS__CT_component_vc__NSP__FR.lengthof())) break;
current_location.update_lineno(133);
/* RAW_NS.ttcnpp, line 133 */
const_cast< const VALUE_ARRAY<COMPONENT, 4, 0>&>(RAW__NS__CT_component_vc__NSP__FR)[i].stop();
current_location.update_lineno(132);
/* RAW_NS.ttcnpp, line 132 */
{
INTEGER tmp_32;
++i;
}
}
}
}

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

alt_status ax__rx__fail__on__any__ns_instance(const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 138, TTCN_Location::LOCATION_ALTSTEP, "ax_rx_fail_on_any_ns");
current_location.update_lineno(139);
/* RAW_NS.ttcnpp, line 139 */
NS__Types::PDU__NS nrf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(140);
/* RAW_NS.ttcnpp, line 140 */
switch (RAW__NS__CT_component_NSCP[idx].receive(NS__Types::PDU__NS_template(ANY_VALUE), &(nrf), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(141);
/* RAW_NS.ttcnpp, line 141 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected NS: "),nrf.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(142);
/* RAW_NS.ttcnpp, line 142 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void ax__rx__fail__on__any__ns(const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = ax__rx__fail__on__any__ns_instance(idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep ax_rx_fail_on_any_ns.");
else block_flag = TRUE;
}
}

Default_Base *activate_ax__rx__fail__on__any__ns(const INTEGER& idx)
{
return new ax__rx__fail__on__any__ns_Default(idx);
}

NS__Types::PDU__NS f__ns__exp(const NS__Types::PDU__NS_template& exp__rx, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 146, TTCN_Location::LOCATION_FUNCTION, "f_ns_exp");
current_location.update_lineno(147);
/* RAW_NS.ttcnpp, line 147 */
NS__Types::PDU__NS nrf;
current_location.update_lineno(148);
/* RAW_NS.ttcnpp, line 148 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_ns_exp() expecting ");
exp__rx.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(150);
/* RAW_NS.ttcnpp, line 150 */
DEFAULT d(activate_ax__rx__fail__on__any__ns(ax__rx__fail__on__any__ns_idx_defval));
current_location.update_lineno(151);
/* RAW_NS.ttcnpp, line 151 */
{
tmp_33:
alt_status tmp_33_alt_flag_0 = ALT_MAYBE;
alt_status tmp_33_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_33_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_33_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(152);
/* RAW_NS.ttcnpp, line 152 */
tmp_33_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(exp__rx, &(nrf), any_compref, NULL, NULL, NULL);
if (tmp_33_alt_flag_0 == ALT_YES) break;
}
if (tmp_33_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(153);
/* RAW_NS.ttcnpp, line 153 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_33_alt_flag_1 = ALT_MAYBE;
else tmp_33_alt_flag_1 = ALT_NO;
}
if (tmp_33_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(153);
/* RAW_NS.ttcnpp, line 153 */
tmp_33_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_33_alt_flag_1 == ALT_REPEAT) goto tmp_33;
if (tmp_33_alt_flag_1 == ALT_BREAK) break;
if (tmp_33_alt_flag_1 == ALT_YES) break;
}
if (tmp_33_default_flag == ALT_MAYBE) {
tmp_33_default_flag = TTCN_Default::try_altsteps();
if (tmp_33_default_flag == ALT_YES || tmp_33_default_flag == ALT_BREAK) break;
else if (tmp_33_default_flag == ALT_REPEAT) goto tmp_33;
}
current_location.update_lineno(151);
/* RAW_NS.ttcnpp, line 151 */
if (tmp_33_alt_flag_0 == ALT_NO && tmp_33_alt_flag_1 == ALT_NO && tmp_33_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 151 and 154.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(155);
/* RAW_NS.ttcnpp, line 155 */
TTCN_Default::deactivate(d);
;
current_location.update_lineno(156);
/* RAW_NS.ttcnpp, line 156 */
return nrf;
}

void start_f__ns__exp(const COMPONENT& component_reference, const NS__Types::PDU__NS_template& exp__rx, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ns_exp(");
exp__rx.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_ns_exp", text_buf);
exp__rx.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__ns__alive(const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 160, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_ns_alive");
current_location.update_lineno(161);
/* RAW_NS.ttcnpp, line 161 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::t__NS__ALIVE, NULL);
current_location.update_lineno(162);
/* RAW_NS.ttcnpp, line 162 */
{
tmp_34:
alt_status tmp_34_alt_flag_0 = ALT_MAYBE;
alt_status tmp_34_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_34_alt_flag_2 = ALT_MAYBE;
alt_status tmp_34_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_34_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(163);
/* RAW_NS.ttcnpp, line 163 */
tmp_34_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::t__NS__ALIVE__ACK, NULL, any_compref, NULL, NULL, NULL);
if (tmp_34_alt_flag_0 == ALT_YES) break;
}
if (tmp_34_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(164);
/* RAW_NS.ttcnpp, line 164 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_34_alt_flag_1 = ALT_MAYBE;
else tmp_34_alt_flag_1 = ALT_NO;
}
if (tmp_34_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(164);
/* RAW_NS.ttcnpp, line 164 */
tmp_34_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_34_alt_flag_1 == ALT_REPEAT) goto tmp_34;
if (tmp_34_alt_flag_1 == ALT_BREAK) break;
if (tmp_34_alt_flag_1 == ALT_YES) break;
}
if (tmp_34_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(165);
/* RAW_NS.ttcnpp, line 165 */
tmp_34_alt_flag_2 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_34_alt_flag_2 == ALT_YES) {
current_location.update_lineno(165);
/* RAW_NS.ttcnpp, line 165 */
goto tmp_34;
}
}
if (tmp_34_default_flag == ALT_MAYBE) {
tmp_34_default_flag = TTCN_Default::try_altsteps();
if (tmp_34_default_flag == ALT_YES || tmp_34_default_flag == ALT_BREAK) break;
else if (tmp_34_default_flag == ALT_REPEAT) goto tmp_34;
}
current_location.update_lineno(162);
/* RAW_NS.ttcnpp, line 162 */
if (tmp_34_alt_flag_0 == ALT_NO && tmp_34_alt_flag_1 == ALT_NO && tmp_34_alt_flag_2 == ALT_NO && tmp_34_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 162 and 166.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__outgoing__ns__alive(const COMPONENT& component_reference, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_alive(");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_ns_alive", text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__ns__alive__no__ack(const INTEGER& idx, const FLOAT& tout)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 170, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_ns_alive_no_ack");
current_location.update_lineno(171);
/* RAW_NS.ttcnpp, line 171 */
TIMER T("T", tout);
current_location.update_lineno(172);
/* RAW_NS.ttcnpp, line 172 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::t__NS__ALIVE, NULL);
current_location.update_lineno(173);
/* RAW_NS.ttcnpp, line 173 */
T.start();
current_location.update_lineno(174);
/* RAW_NS.ttcnpp, line 174 */
{
tmp_35:
alt_status tmp_35_alt_flag_0 = ALT_MAYBE;
alt_status tmp_35_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_35_alt_flag_2 = ALT_MAYBE;
alt_status tmp_35_alt_flag_3 = ALT_MAYBE;
alt_status tmp_35_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_35_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(175);
/* RAW_NS.ttcnpp, line 175 */
tmp_35_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::t__NS__ALIVE__ACK, NULL, any_compref, NULL, NULL, NULL);
if (tmp_35_alt_flag_0 == ALT_YES) {
current_location.update_lineno(176);
/* RAW_NS.ttcnpp, line 176 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected NS-ALIVE ACK"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_35_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(178);
/* RAW_NS.ttcnpp, line 178 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_35_alt_flag_1 = ALT_MAYBE;
else tmp_35_alt_flag_1 = ALT_NO;
}
if (tmp_35_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(178);
/* RAW_NS.ttcnpp, line 178 */
tmp_35_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_35_alt_flag_1 == ALT_REPEAT) goto tmp_35;
if (tmp_35_alt_flag_1 == ALT_BREAK) break;
if (tmp_35_alt_flag_1 == ALT_YES) break;
}
if (tmp_35_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(179);
/* RAW_NS.ttcnpp, line 179 */
tmp_35_alt_flag_2 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_35_alt_flag_2 == ALT_YES) {
current_location.update_lineno(179);
/* RAW_NS.ttcnpp, line 179 */
goto tmp_35;
}
}
if (tmp_35_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(180);
/* RAW_NS.ttcnpp, line 180 */
tmp_35_alt_flag_3 = T.timeout(NULL);
if (tmp_35_alt_flag_3 == ALT_YES) {
current_location.update_lineno(181);
/* RAW_NS.ttcnpp, line 181 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_35_default_flag == ALT_MAYBE) {
tmp_35_default_flag = TTCN_Default::try_altsteps();
if (tmp_35_default_flag == ALT_YES || tmp_35_default_flag == ALT_BREAK) break;
else if (tmp_35_default_flag == ALT_REPEAT) goto tmp_35;
}
current_location.update_lineno(174);
/* RAW_NS.ttcnpp, line 174 */
if (tmp_35_alt_flag_0 == ALT_NO && tmp_35_alt_flag_1 == ALT_NO && tmp_35_alt_flag_2 == ALT_NO && tmp_35_alt_flag_3 == ALT_NO && tmp_35_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 174 and 183.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__outgoing__ns__alive__no__ack(const COMPONENT& component_reference, const INTEGER& idx, const FLOAT& tout)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_alive_no_ack(");
idx.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_ns_alive_no_ack", text_buf);
idx.encode_text(text_buf);
tout.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__ns__reset(const INTEGER& idx, const FLOAT& tout)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 186, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_ns_reset");
current_location.update_lineno(187);
/* RAW_NS.ttcnpp, line 187 */
TIMER T("T", tout);
current_location.update_lineno(188);
/* RAW_NS.ttcnpp, line 188 */
NS__Types::PDU__NS_template reset(Osmocom__Gb__Types::ts__NS__RESET(Osmocom__Gb__Types::NsCause::NS__CAUSE__EQUIPMENT__FAILURE, const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()));
current_location.update_lineno(189);
/* RAW_NS.ttcnpp, line 189 */
RAW__NS__CT_component_NSCP[idx].send(reset, NULL);
current_location.update_lineno(190);
/* RAW_NS.ttcnpp, line 190 */
T.start();
current_location.update_lineno(191);
/* RAW_NS.ttcnpp, line 191 */
{
tmp_36:
alt_status tmp_36_alt_flag_0 = ALT_MAYBE;
alt_status tmp_36_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_36_alt_flag_2 = ALT_MAYBE;
alt_status tmp_36_alt_flag_3 = ALT_MAYBE;
alt_status tmp_36_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_36_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(192);
/* RAW_NS.ttcnpp, line 192 */
tmp_36_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::ts__NS__RESET__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), NULL, any_compref, NULL, NULL, NULL);
if (tmp_36_alt_flag_0 == ALT_YES) {
current_location.update_lineno(193);
/* RAW_NS.ttcnpp, line 193 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_36_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(195);
/* RAW_NS.ttcnpp, line 195 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_36_alt_flag_1 = ALT_MAYBE;
else tmp_36_alt_flag_1 = ALT_NO;
}
if (tmp_36_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(195);
/* RAW_NS.ttcnpp, line 195 */
tmp_36_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_36_alt_flag_1 == ALT_REPEAT) goto tmp_36;
if (tmp_36_alt_flag_1 == ALT_BREAK) break;
if (tmp_36_alt_flag_1 == ALT_YES) break;
}
if (tmp_36_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(196);
/* RAW_NS.ttcnpp, line 196 */
tmp_36_alt_flag_2 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_36_alt_flag_2 == ALT_YES) {
current_location.update_lineno(196);
/* RAW_NS.ttcnpp, line 196 */
goto tmp_36;
}
}
if (tmp_36_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(197);
/* RAW_NS.ttcnpp, line 197 */
tmp_36_alt_flag_3 = T.timeout(NULL);
if (tmp_36_alt_flag_3 == ALT_YES) {
current_location.update_lineno(198);
/* RAW_NS.ttcnpp, line 198 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Failed to receive a RESET ACK"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_36_default_flag == ALT_MAYBE) {
tmp_36_default_flag = TTCN_Default::try_altsteps();
if (tmp_36_default_flag == ALT_YES || tmp_36_default_flag == ALT_BREAK) break;
else if (tmp_36_default_flag == ALT_REPEAT) goto tmp_36;
}
current_location.update_lineno(191);
/* RAW_NS.ttcnpp, line 191 */
if (tmp_36_alt_flag_0 == ALT_NO && tmp_36_alt_flag_1 == ALT_NO && tmp_36_alt_flag_2 == ALT_NO && tmp_36_alt_flag_3 == ALT_NO && tmp_36_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 191 and 200.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__outgoing__ns__reset(const COMPONENT& component_reference, const INTEGER& idx, const FLOAT& tout)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_reset(");
idx.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_ns_reset", text_buf);
idx.encode_text(text_buf);
tout.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__ns__block(const Osmocom__Gb__Types::NsCause& cause, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 204, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_ns_block");
current_location.update_lineno(205);
/* RAW_NS.ttcnpp, line 205 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__BLOCK(cause, const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci()), NULL);
current_location.update_lineno(206);
/* RAW_NS.ttcnpp, line 206 */
{
tmp_37:
alt_status tmp_37_alt_flag_0 = ALT_MAYBE;
alt_status tmp_37_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_37_alt_flag_2 = ALT_MAYBE;
alt_status tmp_37_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_37_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(207);
/* RAW_NS.ttcnpp, line 207 */
tmp_37_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__BLOCK__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci())), NULL, any_compref, NULL, NULL, NULL);
if (tmp_37_alt_flag_0 == ALT_YES) break;
}
if (tmp_37_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(208);
/* RAW_NS.ttcnpp, line 208 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_37_alt_flag_1 = ALT_MAYBE;
else tmp_37_alt_flag_1 = ALT_NO;
}
if (tmp_37_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(208);
/* RAW_NS.ttcnpp, line 208 */
tmp_37_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_37_alt_flag_1 == ALT_REPEAT) goto tmp_37;
if (tmp_37_alt_flag_1 == ALT_BREAK) break;
if (tmp_37_alt_flag_1 == ALT_YES) break;
}
if (tmp_37_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(209);
/* RAW_NS.ttcnpp, line 209 */
tmp_37_alt_flag_2 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_37_alt_flag_2 == ALT_YES) {
current_location.update_lineno(209);
/* RAW_NS.ttcnpp, line 209 */
goto tmp_37;
}
}
if (tmp_37_default_flag == ALT_MAYBE) {
tmp_37_default_flag = TTCN_Default::try_altsteps();
if (tmp_37_default_flag == ALT_YES || tmp_37_default_flag == ALT_BREAK) break;
else if (tmp_37_default_flag == ALT_REPEAT) goto tmp_37;
}
current_location.update_lineno(206);
/* RAW_NS.ttcnpp, line 206 */
if (tmp_37_alt_flag_0 == ALT_NO && tmp_37_alt_flag_1 == ALT_NO && tmp_37_alt_flag_2 == ALT_NO && tmp_37_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 206 and 210.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__outgoing__ns__block(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_block(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_ns_block", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__ns__unblock(const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 214, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_ns_unblock");
current_location.update_lineno(215);
/* RAW_NS.ttcnpp, line 215 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::t__NS__UNBLOCK, NULL);
current_location.update_lineno(216);
/* RAW_NS.ttcnpp, line 216 */
{
tmp_38:
alt_status tmp_38_alt_flag_0 = ALT_MAYBE;
alt_status tmp_38_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_38_alt_flag_2 = ALT_MAYBE;
alt_status tmp_38_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_38_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(217);
/* RAW_NS.ttcnpp, line 217 */
tmp_38_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::t__NS__UNBLOCK__ACK, NULL, any_compref, NULL, NULL, NULL);
if (tmp_38_alt_flag_0 == ALT_YES) break;
}
if (tmp_38_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(218);
/* RAW_NS.ttcnpp, line 218 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_38_alt_flag_1 = ALT_MAYBE;
else tmp_38_alt_flag_1 = ALT_NO;
}
if (tmp_38_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(218);
/* RAW_NS.ttcnpp, line 218 */
tmp_38_alt_flag_1 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_38_alt_flag_1 == ALT_REPEAT) goto tmp_38;
if (tmp_38_alt_flag_1 == ALT_BREAK) break;
if (tmp_38_alt_flag_1 == ALT_YES) break;
}
if (tmp_38_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(219);
/* RAW_NS.ttcnpp, line 219 */
tmp_38_alt_flag_2 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_38_alt_flag_2 == ALT_YES) {
current_location.update_lineno(219);
/* RAW_NS.ttcnpp, line 219 */
goto tmp_38;
}
}
if (tmp_38_default_flag == ALT_MAYBE) {
tmp_38_default_flag = TTCN_Default::try_altsteps();
if (tmp_38_default_flag == ALT_YES || tmp_38_default_flag == ALT_BREAK) break;
else if (tmp_38_default_flag == ALT_REPEAT) goto tmp_38;
}
current_location.update_lineno(216);
/* RAW_NS.ttcnpp, line 216 */
if (tmp_38_alt_flag_0 == ALT_NO && tmp_38_alt_flag_1 == ALT_NO && tmp_38_alt_flag_2 == ALT_NO && tmp_38_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 216 and 220.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__outgoing__ns__unblock(const COMPONENT& component_reference, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_unblock(");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_ns_unblock", text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__rx__alive__tx__ack_instance(const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 224, TTCN_Location::LOCATION_ALTSTEP, "as_rx_alive_tx_ack");
alt_status ret_val = ALT_NO;
current_location.update_lineno(225);
/* RAW_NS.ttcnpp, line 225 */
switch (RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::t__NS__ALIVE, NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(226);
/* RAW_NS.ttcnpp, line 226 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::t__NS__ALIVE__ACK, NULL);
current_location.update_lineno(227);
/* RAW_NS.ttcnpp, line 227 */
if ((!(oneshot))) {
current_location.update_lineno(227);
/* RAW_NS.ttcnpp, line 227 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(233);
/* RAW_NS.ttcnpp, line 233 */
if (oneshot) {
current_location.update_lineno(233);
/* RAW_NS.ttcnpp, line 233 */
switch (RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__UNITDATA(NS__Types::NS__SDU__ControlBits_template(ANY_VALUE), INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE)), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(234);
/* RAW_NS.ttcnpp, line 234 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__rx__alive__tx__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__alive__tx__ack_instance(oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_alive_tx_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__alive__tx__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__alive__tx__ack_Default(oneshot, idx);
}

void f__tx__bvc__reset__rx__ack(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const INTEGER& idx, const BOOLEAN& exp__ack)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 239, TTCN_Location::LOCATION_FUNCTION, "f_tx_bvc_reset_rx_ack");
current_location.update_lineno(242);
/* RAW_NS.ttcnpp, line 242 */
BSSGP__Types::PDU__BSSGP bssgp__tx(Osmocom__Gb__Types::ts__BVC__RESET(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__NET__SV__CAP__MOD__GT__ZERO__KBPS, bvci, tx__cell__id).valueof());
current_location.update_lineno(244);
/* RAW_NS.ttcnpp, line 244 */
TIMER T("T", 5.0);
current_location.update_lineno(245);
/* RAW_NS.ttcnpp, line 245 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, 0, BSSGP__Types::enc__PDU__BSSGP(bssgp__tx)), NULL);
current_location.update_lineno(246);
/* RAW_NS.ttcnpp, line 246 */
T.start();
current_location.update_lineno(247);
/* RAW_NS.ttcnpp, line 247 */
{
tmp_39:
alt_status tmp_39_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_39_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_39_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_39_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_39_alt_flag_4 = ALT_MAYBE;
alt_status tmp_39_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_39_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(248);
/* RAW_NS.ttcnpp, line 248 */
if (exp__ack) tmp_39_alt_flag_0 = ALT_MAYBE;
else tmp_39_alt_flag_0 = ALT_NO;
}
if (tmp_39_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(248);
/* RAW_NS.ttcnpp, line 248 */
{
OCTETSTRING_template tmp_40;
class Dec_Match_tmp_41 : public Dec_Match_Interface {
BSSGP__Types::PDU__BSSGP_template target;
BSSGP__Types::PDU__BSSGP* dec_val;
public:
Dec_Match_tmp_41(BSSGP__Types::PDU__BSSGP_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_41() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new BSSGP__Types::PDU__BSSGP;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (BSSGP__Types::PDU__BSSGP_decoder(os, *dec_val, BSSGP__Types::PDU__BSSGP_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("PDU_BSSGP: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &BSSGP__Types::PDU__BSSGP_descr_; }
};
tmp_40.set_type(DECODE_MATCH);
{
BSSGP__Types::PDU__BSSGP_template tmp_42;
tmp_42 = Osmocom__Gb__Types::tr__BVC__RESET__ACK(INTEGER_template(bvci), rx__cell__id);
tmp_40.set_decmatch(new Dec_Match_tmp_41(tmp_42));
}
tmp_39_alt_flag_0 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, INTEGER_template(0), tmp_40), NULL, any_compref, NULL, NULL, NULL);
}
if (tmp_39_alt_flag_0 == ALT_YES) {
current_location.update_lineno(250);
/* RAW_NS.ttcnpp, line 250 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_39_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(252);
/* RAW_NS.ttcnpp, line 252 */
if (exp__ack) tmp_39_alt_flag_1 = ALT_MAYBE;
else tmp_39_alt_flag_1 = ALT_NO;
}
if (tmp_39_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(252);
/* RAW_NS.ttcnpp, line 252 */
tmp_39_alt_flag_1 = T.timeout(NULL);
if (tmp_39_alt_flag_1 == ALT_YES) {
current_location.update_lineno(253);
/* RAW_NS.ttcnpp, line 253 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No response to BVC-RESET"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_39_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(255);
/* RAW_NS.ttcnpp, line 255 */
if ((!(exp__ack))) tmp_39_alt_flag_2 = ALT_MAYBE;
else tmp_39_alt_flag_2 = ALT_NO;
}
if (tmp_39_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(255);
/* RAW_NS.ttcnpp, line 255 */
tmp_39_alt_flag_2 = T.timeout(NULL);
if (tmp_39_alt_flag_2 == ALT_YES) {
current_location.update_lineno(256);
/* RAW_NS.ttcnpp, line 256 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_39_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(258);
/* RAW_NS.ttcnpp, line 258 */
if (RAW__NS__CT_component_g__handle__rx__alive) tmp_39_alt_flag_3 = ALT_MAYBE;
else tmp_39_alt_flag_3 = ALT_NO;
}
if (tmp_39_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(258);
/* RAW_NS.ttcnpp, line 258 */
tmp_39_alt_flag_3 = as__rx__alive__tx__ack_instance(as__rx__alive__tx__ack_oneshot_defval, idx);
if (tmp_39_alt_flag_3 == ALT_REPEAT) goto tmp_39;
if (tmp_39_alt_flag_3 == ALT_BREAK) break;
if (tmp_39_alt_flag_3 == ALT_YES) break;
}
if (tmp_39_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(259);
/* RAW_NS.ttcnpp, line 259 */
tmp_39_alt_flag_4 = RAW__NS__CT_component_NSCP[idx].receive(any_compref, NULL, NULL, NULL);
if (tmp_39_alt_flag_4 == ALT_YES) {
current_location.update_lineno(259);
/* RAW_NS.ttcnpp, line 259 */
goto tmp_39;
}
}
if (tmp_39_default_flag == ALT_MAYBE) {
tmp_39_default_flag = TTCN_Default::try_altsteps();
if (tmp_39_default_flag == ALT_YES || tmp_39_default_flag == ALT_BREAK) break;
else if (tmp_39_default_flag == ALT_REPEAT) goto tmp_39;
}
current_location.update_lineno(247);
/* RAW_NS.ttcnpp, line 247 */
if (tmp_39_alt_flag_0 == ALT_NO && tmp_39_alt_flag_1 == ALT_NO && tmp_39_alt_flag_2 == ALT_NO && tmp_39_alt_flag_3 == ALT_NO && tmp_39_alt_flag_4 == ALT_NO && tmp_39_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RAW_NS.ttcnpp between lines 247 and 260.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__tx__bvc__reset__rx__ack(const COMPONENT& component_reference, const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const INTEGER& idx, const BOOLEAN& exp__ack)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_bvc_reset_rx_ack(");
bvci.log();
TTCN_Logger::log_event_str(", ");
tx__cell__id.log();
TTCN_Logger::log_event_str(", ");
rx__cell__id.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
exp__ack.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_tx_bvc_reset_rx_ack", text_buf);
bvci.encode_text(text_buf);
tx__cell__id.encode_text(text_buf);
rx__cell__id.encode_text(text_buf);
idx.encode_text(text_buf);
exp__ack.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__rx__bvc__reset__tx__ack_instance(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 264, TTCN_Location::LOCATION_ALTSTEP, "as_rx_bvc_reset_tx_ack");
current_location.update_lineno(266);
/* RAW_NS.ttcnpp, line 266 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(267);
/* RAW_NS.ttcnpp, line 267 */
{
alt_status tmp_46;
{
OCTETSTRING_template tmp_43;
class Dec_Match_tmp_44 : public Dec_Match_Interface {
BSSGP__Types::PDU__BSSGP_template target;
BSSGP__Types::PDU__BSSGP* dec_val;
public:
Dec_Match_tmp_44(BSSGP__Types::PDU__BSSGP_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_44() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new BSSGP__Types::PDU__BSSGP;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (BSSGP__Types::PDU__BSSGP_decoder(os, *dec_val, BSSGP__Types::PDU__BSSGP_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("PDU_BSSGP: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &BSSGP__Types::PDU__BSSGP_descr_; }
};
tmp_43.set_type(DECODE_MATCH);
{
BSSGP__Types::PDU__BSSGP_template tmp_45;
tmp_45 = Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(bvci), rx__cell__id);
tmp_43.set_decmatch(new Dec_Match_tmp_44(tmp_45));
}
tmp_46 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, INTEGER_template(0), tmp_43), &(ns__rf), any_compref, NULL, NULL, NULL);
}
switch (tmp_46) {
case ALT_YES:
{
current_location.update_lineno(270);
/* RAW_NS.ttcnpp, line 270 */
BSSGP__Types::PDU__BSSGP bssgp__rx(BSSGP__Types::dec__PDU__BSSGP(const_cast< const NS__Types::PDU__NS&>(ns__rf).pDU__NS__Unitdata().nS__SDU()));
current_location.update_lineno(271);
/* RAW_NS.ttcnpp, line 271 */
BSSGP__Types::PDU__BSSGP bssgp__tx(Osmocom__Gb__Types::ts__BVC__RESET__ACK(bvci, tx__cell__id).valueof());
current_location.update_lineno(272);
/* RAW_NS.ttcnpp, line 272 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, 0, BSSGP__Types::enc__PDU__BSSGP(bssgp__tx)), NULL);
current_location.update_lineno(273);
/* RAW_NS.ttcnpp, line 273 */
if ((!(oneshot))) {
current_location.update_lineno(273);
/* RAW_NS.ttcnpp, line 273 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__rx__bvc__reset__tx__ack(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__bvc__reset__tx__ack_instance(bvci, rx__cell__id, tx__cell__id, oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_bvc_reset_tx_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__bvc__reset__tx__ack(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId_template& rx__cell__id, const Osmocom__Gb__Types::BssgpCellId_template& tx__cell__id, const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__bvc__reset__tx__ack_Default(bvci, rx__cell__id, tx__cell__id, oneshot, idx);
}

alt_status as__rx__bvc__unblock__tx__ack_instance(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 279, TTCN_Location::LOCATION_ALTSTEP, "as_rx_bvc_unblock_tx_ack");
current_location.update_lineno(280);
/* RAW_NS.ttcnpp, line 280 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(281);
/* RAW_NS.ttcnpp, line 281 */
{
alt_status tmp_50;
{
OCTETSTRING_template tmp_47;
class Dec_Match_tmp_48 : public Dec_Match_Interface {
BSSGP__Types::PDU__BSSGP_template target;
BSSGP__Types::PDU__BSSGP* dec_val;
public:
Dec_Match_tmp_48(BSSGP__Types::PDU__BSSGP_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_48() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new BSSGP__Types::PDU__BSSGP;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (BSSGP__Types::PDU__BSSGP_decoder(os, *dec_val, BSSGP__Types::PDU__BSSGP_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("PDU_BSSGP: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &BSSGP__Types::PDU__BSSGP_descr_; }
};
tmp_47.set_type(DECODE_MATCH);
{
BSSGP__Types::PDU__BSSGP_template tmp_49;
tmp_49 = Osmocom__Gb__Types::tr__BVC__UNBLOCK(INTEGER_template(bvci));
tmp_47.set_decmatch(new Dec_Match_tmp_48(tmp_49));
}
tmp_50 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, INTEGER_template(0), tmp_47), &(ns__rf), any_compref, NULL, NULL, NULL);
}
switch (tmp_50) {
case ALT_YES:
{
current_location.update_lineno(282);
/* RAW_NS.ttcnpp, line 282 */
BSSGP__Types::PDU__BSSGP bssgp__rx(BSSGP__Types::dec__PDU__BSSGP(const_cast< const NS__Types::PDU__NS&>(ns__rf).pDU__NS__Unitdata().nS__SDU()));
current_location.update_lineno(283);
/* RAW_NS.ttcnpp, line 283 */
BSSGP__Types::PDU__BSSGP bssgp__tx(Osmocom__Gb__Types::ts__BVC__UNBLOCK__ACK(INTEGER_template(bvci)).valueof());
current_location.update_lineno(284);
/* RAW_NS.ttcnpp, line 284 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, 0, BSSGP__Types::enc__PDU__BSSGP(bssgp__tx)), NULL);
current_location.update_lineno(285);
/* RAW_NS.ttcnpp, line 285 */
if ((!(oneshot))) {
current_location.update_lineno(285);
/* RAW_NS.ttcnpp, line 285 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__rx__bvc__unblock__tx__ack(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__bvc__unblock__tx__ack_instance(bvci, oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_bvc_unblock_tx_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__bvc__unblock__tx__ack(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__bvc__unblock__tx__ack_Default(bvci, oneshot, idx);
}

alt_status as__rx__bvc__fc__tx__ack_instance(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 290, TTCN_Location::LOCATION_ALTSTEP, "as_rx_bvc_fc_tx_ack");
current_location.update_lineno(291);
/* RAW_NS.ttcnpp, line 291 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(292);
/* RAW_NS.ttcnpp, line 292 */
{
alt_status tmp_54;
{
OCTETSTRING_template tmp_51;
class Dec_Match_tmp_52 : public Dec_Match_Interface {
BSSGP__Types::PDU__BSSGP_template target;
BSSGP__Types::PDU__BSSGP* dec_val;
public:
Dec_Match_tmp_52(BSSGP__Types::PDU__BSSGP_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_52() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new BSSGP__Types::PDU__BSSGP;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (BSSGP__Types::PDU__BSSGP_decoder(os, *dec_val, BSSGP__Types::PDU__BSSGP_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("PDU_BSSGP: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &BSSGP__Types::PDU__BSSGP_descr_; }
};
tmp_51.set_type(DECODE_MATCH);
{
BSSGP__Types::PDU__BSSGP_template tmp_53;
tmp_53 = Osmocom__Gb__Types::tr__BVC__FC__BVC(Osmocom__Gb__Types::tr__BVC__FC__BVC_bmax_defval, Osmocom__Gb__Types::tr__BVC__FC__BVC_bucket__leak__rate_defval, Osmocom__Gb__Types::tr__BVC__FC__BVC_bmax__default__ms_defval, Osmocom__Gb__Types::tr__BVC__FC__BVC_r__default__ms_defval, Osmocom__Gb__Types::tr__BVC__FC__BVC_tag_defval);
tmp_51.set_decmatch(new Dec_Match_tmp_52(tmp_53));
}
tmp_54 = RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, INTEGER_template(bvci), tmp_51), &(ns__rf), any_compref, NULL, NULL, NULL);
}
switch (tmp_54) {
case ALT_YES:
{
current_location.update_lineno(295);
/* RAW_NS.ttcnpp, line 295 */
BSSGP__Types::PDU__BSSGP bssgp__rx(BSSGP__Types::dec__PDU__BSSGP(const_cast< const NS__Types::PDU__NS&>(ns__rf).pDU__NS__Unitdata().nS__SDU()));
current_location.update_lineno(296);
/* RAW_NS.ttcnpp, line 296 */
OCTETSTRING tag(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp__rx).pDU__BSSGP__FLOW__CONTROL__BVC().tag().unstructured__Value());
current_location.update_lineno(297);
/* RAW_NS.ttcnpp, line 297 */
BSSGP__Types::PDU__BSSGP bssgp__tx(Osmocom__Gb__Types::ts__BVC__FC__BVC__ACK(OCTETSTRING_template(tag)).valueof());
current_location.update_lineno(298);
/* RAW_NS.ttcnpp, line 298 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__UNITDATA(Osmocom__Gb__Types::t__SduCtrlB, bvci, BSSGP__Types::enc__PDU__BSSGP(bssgp__tx)), NULL);
current_location.update_lineno(299);
/* RAW_NS.ttcnpp, line 299 */
if ((!(oneshot))) {
current_location.update_lineno(299);
/* RAW_NS.ttcnpp, line 299 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__rx__bvc__fc__tx__ack(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__bvc__fc__tx__ack_instance(bvci, oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_bvc_fc_tx_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__bvc__fc__tx__ack(const INTEGER& bvci, const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__bvc__fc__tx__ack_Default(bvci, oneshot, idx);
}

alt_status as__rx__ns__reset__ack_instance(const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 308, TTCN_Location::LOCATION_ALTSTEP, "as_rx_ns_reset_ack");
current_location.update_lineno(309);
/* RAW_NS.ttcnpp, line 309 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(310);
/* RAW_NS.ttcnpp, line 310 */
switch (RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__RESET(Osmocom__Gb__Types::NsCause_template(Osmocom__Gb__Types::NsCause::NS__CAUSE__OM__INTERVENTION), INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci()), INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei())), &(ns__rf), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(312);
/* RAW_NS.ttcnpp, line 312 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__RESET__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx].nsvci(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), NULL);
current_location.update_lineno(313);
/* RAW_NS.ttcnpp, line 313 */
if ((!(oneshot))) {
current_location.update_lineno(313);
/* RAW_NS.ttcnpp, line 313 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__rx__ns__reset__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__ns__reset__ack_instance(oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_ns_reset_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__ns__reset__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__ns__reset__ack_Default(oneshot, idx);
}

alt_status as__rx__ns__unblock__ack_instance(const BOOLEAN& oneshot, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 317, TTCN_Location::LOCATION_ALTSTEP, "as_rx_ns_unblock_ack");
current_location.update_lineno(318);
/* RAW_NS.ttcnpp, line 318 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(319);
/* RAW_NS.ttcnpp, line 319 */
switch (RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::t__NS__UNBLOCK, &(ns__rf), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(320);
/* RAW_NS.ttcnpp, line 320 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::t__NS__UNBLOCK__ACK, NULL);
current_location.update_lineno(321);
/* RAW_NS.ttcnpp, line 321 */
if ((!(oneshot))) {
current_location.update_lineno(321);
/* RAW_NS.ttcnpp, line 321 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__rx__ns__unblock__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__ns__unblock__ack_instance(oneshot, idx);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_ns_unblock_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__ns__unblock__ack(const BOOLEAN& oneshot, const INTEGER& idx)
{
return new as__rx__ns__unblock__ack_Default(oneshot, idx);
}

alt_status as__rx__ns__block__ack_instance(const BOOLEAN& oneshot, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER_template& nsvci)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 326, TTCN_Location::LOCATION_ALTSTEP, "as_rx_ns_block_ack");
current_location.update_lineno(327);
/* RAW_NS.ttcnpp, line 327 */
NS__Types::PDU__NS ns__rf;
alt_status ret_val = ALT_NO;
current_location.update_lineno(328);
/* RAW_NS.ttcnpp, line 328 */
switch (RAW__NS__CT_component_NSCP[idx].receive(Osmocom__Gb__Types::tr__NS__BLOCK(cause, nsvci), &(ns__rf), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(329);
/* RAW_NS.ttcnpp, line 329 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__NS__BLOCK__ACK(oct2int(const_cast< const NS__Types::PDU__NS&>(ns__rf).pDU__NS__Block().nS__VCI().nS__VCI())), NULL);
current_location.update_lineno(330);
/* RAW_NS.ttcnpp, line 330 */
if ((!(oneshot))) {
current_location.update_lineno(330);
/* RAW_NS.ttcnpp, line 330 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__rx__ns__block__ack(const BOOLEAN& oneshot, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER_template& nsvci)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__rx__ns__block__ack_instance(oneshot, idx, cause, nsvci);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_rx_ns_block_ack.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__rx__ns__block__ack(const BOOLEAN& oneshot, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER_template& nsvci)
{
return new as__rx__ns__block__ack_Default(oneshot, idx, cause, nsvci);
}

void f__incoming__sns__size(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx, const INTEGER_template& num__max__nsvcs, const INTEGER_template& num__ep)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 339, TTCN_Location::LOCATION_FUNCTION, "f_incoming_sns_size");
current_location.update_lineno(342);
/* RAW_NS.ttcnpp, line 342 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_incoming_sns_size(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(343);
/* RAW_NS.ttcnpp, line 343 */
NS__Types::PDU__NS rx;
current_location.update_lineno(344);
/* RAW_NS.ttcnpp, line 344 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx]);
current_location.update_lineno(346);
/* RAW_NS.ttcnpp, line 346 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(348);
/* RAW_NS.ttcnpp, line 348 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__SIZE(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), BOOLEAN_template(TRUE), num__max__nsvcs, num__ep, INTEGER_template(OMIT_VALUE)), idx);
}
else {
current_location.update_lineno(352);
/* RAW_NS.ttcnpp, line 352 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__SIZE(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), BOOLEAN_template(TRUE), num__max__nsvcs, INTEGER_template(OMIT_VALUE), num__ep), idx);
}
current_location.update_lineno(355);
/* RAW_NS.ttcnpp, line 355 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__SIZE__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), cause), NULL);
}

void start_f__incoming__sns__size(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx, const INTEGER_template& num__max__nsvcs, const INTEGER_template& num__ep)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_size(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
num__max__nsvcs.log();
TTCN_Logger::log_event_str(", ");
num__ep.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_incoming_sns_size", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
num__max__nsvcs.encode_text(text_buf);
num__ep.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__size(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& max__nsvcs, const INTEGER& num__ip, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 359, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_size");
current_location.update_lineno(362);
/* RAW_NS.ttcnpp, line 362 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_size(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(363);
/* RAW_NS.ttcnpp, line 363 */
NS__Types::PDU__NS rx;
current_location.update_lineno(364);
/* RAW_NS.ttcnpp, line 364 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx]);
current_location.update_lineno(366);
/* RAW_NS.ttcnpp, line 366 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(367);
/* RAW_NS.ttcnpp, line 367 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__SIZE(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, max__nsvcs, INTEGER_template(num__ip), INTEGER_template(OMIT_VALUE)), NULL);
}
else {
current_location.update_lineno(371);
/* RAW_NS.ttcnpp, line 371 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__SIZE(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, max__nsvcs, INTEGER_template(OMIT_VALUE), INTEGER_template(num__ip)), NULL);
}
current_location.update_lineno(376);
/* RAW_NS.ttcnpp, line 376 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__SIZE__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), cause), idx);
}

void start_f__outgoing__sns__size(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& max__nsvcs, const INTEGER& num__ip, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_size(");
cause.log();
TTCN_Logger::log_event_str(", ");
max__nsvcs.log();
TTCN_Logger::log_event_str(", ");
num__ip.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_size", text_buf);
cause.encode_text(text_buf);
max__nsvcs.encode_text(text_buf);
num__ip.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__incoming__sns__config(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 380, TTCN_Location::LOCATION_FUNCTION, "f_incoming_sns_config");
current_location.update_lineno(382);
/* RAW_NS.ttcnpp, line 382 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_incoming_sns_config(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(383);
/* RAW_NS.ttcnpp, line 383 */
NS__Types::PDU__NS rx;
current_location.update_lineno(384);
/* RAW_NS.ttcnpp, line 384 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx]);
current_location.update_lineno(386);
/* RAW_NS.ttcnpp, line 386 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(387);
/* RAW_NS.ttcnpp, line 387 */
NS__Types::IP4__Elements_template v4__elem;
v4__elem.set_size(1);
v4__elem[0] = Osmocom__Gb__Types::tr__SNS__IPv4(CHARSTRING_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip()), INTEGER_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port()), Osmocom__Gb__Types::tr__SNS__IPv4_sig__weight_defval, Osmocom__Gb__Types::tr__SNS__IPv4_data__weight_defval);
current_location.update_lineno(389);
/* RAW_NS.ttcnpp, line 389 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CONFIG(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), BOOLEAN_template(TRUE), v4__elem, Osmocom__Gb__Types::tr__SNS__CONFIG_v6_defval), idx);
}
else {
current_location.update_lineno(391);
/* RAW_NS.ttcnpp, line 391 */
NS__Types::IP6__Elements_template v6__elem;
v6__elem.set_size(1);
v6__elem[0] = Osmocom__Gb__Types::tr__SNS__IPv6(CHARSTRING_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip()), INTEGER_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port()), Osmocom__Gb__Types::tr__SNS__IPv6_sig__weight_defval, Osmocom__Gb__Types::tr__SNS__IPv6_data__weight_defval);
current_location.update_lineno(393);
/* RAW_NS.ttcnpp, line 393 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CONFIG(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), BOOLEAN_template(TRUE), Osmocom__Gb__Types::tr__SNS__CONFIG_v4_defval, v6__elem), idx);
}
current_location.update_lineno(395);
/* RAW_NS.ttcnpp, line 395 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), cause), NULL);
}

void start_f__incoming__sns__config(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_config(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_incoming_sns_config", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__config(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 399, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_config");
current_location.update_lineno(401);
/* RAW_NS.ttcnpp, line 401 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_config(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(402);
/* RAW_NS.ttcnpp, line 402 */
NS__Types::PDU__NS rx;
current_location.update_lineno(403);
/* RAW_NS.ttcnpp, line 403 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx]);
current_location.update_lineno(405);
/* RAW_NS.ttcnpp, line 405 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(406);
/* RAW_NS.ttcnpp, line 406 */
NS__Types::IP4__Elements_template v4;
v4.set_size(1);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), Osmocom__Gb__Types::ts__SNS__IPv4_sig__weight_defval, Osmocom__Gb__Types::ts__SNS__IPv4_data__weight_defval);
current_location.update_lineno(408);
/* RAW_NS.ttcnpp, line 408 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, v4, Osmocom__Gb__Types::ts__SNS__CONFIG_v6_defval), NULL);
}
else {
current_location.update_lineno(410);
/* RAW_NS.ttcnpp, line 410 */
NS__Types::IP6__Elements_template v6;
v6.set_size(1);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), Osmocom__Gb__Types::ts__SNS__IPv6_sig__weight_defval, Osmocom__Gb__Types::ts__SNS__IPv6_data__weight_defval);
current_location.update_lineno(412);
/* RAW_NS.ttcnpp, line 412 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
}
current_location.update_lineno(414);
/* RAW_NS.ttcnpp, line 414 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CONFIG__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), cause), idx);
}

void start_f__outgoing__sns__config(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_config", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__config__1c1u(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 418, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_config_1c1u");
current_location.update_lineno(420);
/* RAW_NS.ttcnpp, line 420 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_config_1c1u(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(421);
/* RAW_NS.ttcnpp, line 421 */
NS__Types::PDU__NS rx;
current_location.update_lineno(423);
/* RAW_NS.ttcnpp, line 423 */
if ((const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(424);
/* RAW_NS.ttcnpp, line 424 */
NS__Types::IP4__Elements_template v4;
v4.set_size(2);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().local__udp__port(), 1, 0);
v4[1] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__udp__port(), 0, 1);
current_location.update_lineno(428);
/* RAW_NS.ttcnpp, line 428 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, v4, Osmocom__Gb__Types::ts__SNS__CONFIG_v6_defval), NULL);
}
else {
current_location.update_lineno(430);
/* RAW_NS.ttcnpp, line 430 */
NS__Types::IP6__Elements_template v6;
v6.set_size(2);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().local__udp__port(), 1, 0);
v6[1] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__udp__port(), 0, 1);
current_location.update_lineno(434);
/* RAW_NS.ttcnpp, line 434 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
}
current_location.update_lineno(436);
/* RAW_NS.ttcnpp, line 436 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CONFIG__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), cause), idx);
}

void start_f__outgoing__sns__config__1c1u(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config_1c1u(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_config_1c1u", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__config__1c1u__separate(const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 440, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_config_1c1u_separate");
current_location.update_lineno(442);
/* RAW_NS.ttcnpp, line 442 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_config_1c1u_separate(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(443);
/* RAW_NS.ttcnpp, line 443 */
NS__Types::PDU__NS rx;
current_location.update_lineno(444);
/* RAW_NS.ttcnpp, line 444 */
if ((const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[0].provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(445);
/* RAW_NS.ttcnpp, line 445 */
NS__Types::IP4__Elements_template v4;
v4.set_size(2);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__udp__port(), 1, 0);
v4[1] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[2].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[2].provider().ip().local__udp__port(), 0, 1);
current_location.update_lineno(449);
/* RAW_NS.ttcnpp, line 449 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, v4, Osmocom__Gb__Types::ts__SNS__CONFIG_v6_defval), NULL);
}
else {
current_location.update_lineno(451);
/* RAW_NS.ttcnpp, line 451 */
NS__Types::IP6__Elements_template v6;
v6.set_size(2);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[1].provider().ip().local__udp__port(), 1, 0);
v6[1] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[2].provider().ip().local__ip(), const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[2].provider().ip().local__udp__port(), 0, 1);
current_location.update_lineno(455);
/* RAW_NS.ttcnpp, line 455 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CONFIG(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), TRUE, NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
}
current_location.update_lineno(457);
/* RAW_NS.ttcnpp, line 457 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CONFIG__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), cause), idx);
}

void start_f__outgoing__sns__config__1c1u__separate(const COMPONENT& component_reference, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config_1c1u_separate(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_config_1c1u_separate", text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__incoming__sns__chg__weight(const INTEGER& idx__chg, const Osmocom__Gb__Types::NsCause_template& , const INTEGER& idx)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 461, TTCN_Location::LOCATION_FUNCTION, "f_incoming_sns_chg_weight");
current_location.update_lineno(463);
/* RAW_NS.ttcnpp, line 463 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_incoming_sns_chg_weight(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(464);
/* RAW_NS.ttcnpp, line 464 */
NS__Types::PDU__NS rx;
current_location.update_lineno(465);
/* RAW_NS.ttcnpp, line 465 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__chg]);
current_location.update_lineno(467);
/* RAW_NS.ttcnpp, line 467 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(468);
/* RAW_NS.ttcnpp, line 468 */
NS__Types::IP4__Elements_template v4__elem;
v4__elem.set_size(1);
v4__elem[0] = Osmocom__Gb__Types::tr__SNS__IPv4(CHARSTRING_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip()), INTEGER_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port()), Osmocom__Gb__Types::tr__SNS__IPv4_sig__weight_defval, Osmocom__Gb__Types::tr__SNS__IPv4_data__weight_defval);
current_location.update_lineno(470);
/* RAW_NS.ttcnpp, line 470 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CHG__WEIGHT(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), v4__elem, Osmocom__Gb__Types::tr__SNS__CHG__WEIGHT_v6_defval), idx);
}
else {
current_location.update_lineno(472);
/* RAW_NS.ttcnpp, line 472 */
NS__Types::IP6__Elements_template v6__elem;
v6__elem.set_size(1);
v6__elem[0] = Osmocom__Gb__Types::tr__SNS__IPv6(CHARSTRING_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip()), INTEGER_template(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port()), Osmocom__Gb__Types::tr__SNS__IPv6_sig__weight_defval, Osmocom__Gb__Types::tr__SNS__IPv6_data__weight_defval);
current_location.update_lineno(474);
/* RAW_NS.ttcnpp, line 474 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__CHG__WEIGHT(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), v6__elem), idx);
}
current_location.update_lineno(476);
/* RAW_NS.ttcnpp, line 476 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), const_cast< const NS__Types::PDU__NS&>(rx).pDU__SNS__ChangeWeight().transactionID(), Osmocom__Gb__Types::ts__SNS__ACK_cause_defval, Osmocom__Gb__Types::ts__SNS__ACK_v4_defval, Osmocom__Gb__Types::ts__SNS__ACK_v6_defval), NULL);
}

void start_f__incoming__sns__chg__weight(const COMPONENT& component_reference, const INTEGER& idx__chg, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& idx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_chg_weight(");
idx__chg.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_incoming_sns_chg_weight", text_buf);
idx__chg.encode_text(text_buf);
cause.encode_text(text_buf);
idx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__incoming__sns__add(const INTEGER& idx__add, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& )
{
TTCN_Location current_location("RAW_NS.ttcnpp", 481, TTCN_Location::LOCATION_FUNCTION, "f_incoming_sns_add");
current_location.update_lineno(483);
/* RAW_NS.ttcnpp, line 483 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_incoming_sns_add(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(484);
/* RAW_NS.ttcnpp, line 484 */
NS__Types::PDU__NS rx;
current_location.update_lineno(485);
/* RAW_NS.ttcnpp, line 485 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__add]);
current_location.update_lineno(487);
/* RAW_NS.ttcnpp, line 487 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(488);
/* RAW_NS.ttcnpp, line 488 */
NS__Types::IP4__Elements_template v4__elem;
v4__elem.set_size(1);
v4__elem[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port(), w__sig, w__user);
current_location.update_lineno(491);
/* RAW_NS.ttcnpp, line 491 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ADD(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), v4__elem, Osmocom__Gb__Types::tr__SNS__ADD_v6_defval), idx);
}
else {
current_location.update_lineno(493);
/* RAW_NS.ttcnpp, line 493 */
NS__Types::IP6__Elements_template v6__elem;
v6__elem.set_size(1);
v6__elem[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port(), w__sig, w__user);
current_location.update_lineno(496);
/* RAW_NS.ttcnpp, line 496 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ADD(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), v6__elem), idx);
}
current_location.update_lineno(498);
/* RAW_NS.ttcnpp, line 498 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), const_cast< const NS__Types::PDU__NS&>(rx).pDU__SNS__Add().transactionID(), Osmocom__Gb__Types::ts__SNS__ACK_cause_defval, Osmocom__Gb__Types::ts__SNS__ACK_v4_defval, Osmocom__Gb__Types::ts__SNS__ACK_v6_defval), NULL);
}

void start_f__incoming__sns__add(const COMPONENT& component_reference, const INTEGER& idx__add, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_add(");
idx__add.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_incoming_sns_add", text_buf);
idx__add.encode_text(text_buf);
w__sig.encode_text(text_buf);
w__user.encode_text(text_buf);
idx.encode_text(text_buf);
cause.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__add(const INTEGER& idx__add, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& tid)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 501, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_add");
current_location.update_lineno(503);
/* RAW_NS.ttcnpp, line 503 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_add(idx_add=");
idx__add.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(504);
/* RAW_NS.ttcnpp, line 504 */
NS__Types::PDU__NS rx;
current_location.update_lineno(505);
/* RAW_NS.ttcnpp, line 505 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__add]);
current_location.update_lineno(507);
/* RAW_NS.ttcnpp, line 507 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(508);
/* RAW_NS.ttcnpp, line 508 */
NS__Types::IP4__Elements_template v4;
v4.set_size(1);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(511);
/* RAW_NS.ttcnpp, line 511 */
NS__Types::IP4__Elements_template ack__v4(OMIT_VALUE);
current_location.update_lineno(512);
/* RAW_NS.ttcnpp, line 512 */
{
boolean tmp_67;
tmp_67 = cause.is_value();
if (tmp_67) tmp_67 = (cause.valueof() == Osmocom__Gb__Types::NsCause::NS__CAUSE__UNKNOWN__IP__ENDPOINT);
if (tmp_67) {
current_location.update_lineno(513);
/* RAW_NS.ttcnpp, line 513 */
ack__v4 = v4;
}
}
current_location.update_lineno(515);
/* RAW_NS.ttcnpp, line 515 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__ADD(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, v4, Osmocom__Gb__Types::ts__SNS__ADD_v6_defval), NULL);
current_location.update_lineno(516);
/* RAW_NS.ttcnpp, line 516 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), cause, ack__v4, Osmocom__Gb__Types::tr__SNS__ACK_v6_defval), f__ns__exp_idx_defval);
}
else {
current_location.update_lineno(518);
/* RAW_NS.ttcnpp, line 518 */
NS__Types::IP6__Elements_template v6;
v6.set_size(1);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(521);
/* RAW_NS.ttcnpp, line 521 */
NS__Types::IP6__Elements_template ack__v6(OMIT_VALUE);
current_location.update_lineno(522);
/* RAW_NS.ttcnpp, line 522 */
{
boolean tmp_70;
tmp_70 = cause.is_value();
if (tmp_70) tmp_70 = (cause.valueof() == Osmocom__Gb__Types::NsCause::NS__CAUSE__UNKNOWN__IP__ENDPOINT);
if (tmp_70) {
current_location.update_lineno(523);
/* RAW_NS.ttcnpp, line 523 */
ack__v6 = v6;
}
}
current_location.update_lineno(525);
/* RAW_NS.ttcnpp, line 525 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__ADD(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
current_location.update_lineno(526);
/* RAW_NS.ttcnpp, line 526 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), cause, NS__Types::IP4__Elements_template(OMIT_VALUE), ack__v6), f__ns__exp_idx_defval);
}
}

void start_f__outgoing__sns__add(const COMPONENT& component_reference, const INTEGER& idx__add, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause, const INTEGER& tid)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_add(");
idx__add.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_add", text_buf);
idx__add.encode_text(text_buf);
w__sig.encode_text(text_buf);
w__user.encode_text(text_buf);
idx.encode_text(text_buf);
cause.encode_text(text_buf);
tid.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__incoming__sns__del(const INTEGER& idx__del, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& )
{
TTCN_Location current_location("RAW_NS.ttcnpp", 531, TTCN_Location::LOCATION_FUNCTION, "f_incoming_sns_del");
current_location.update_lineno(533);
/* RAW_NS.ttcnpp, line 533 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_incoming_sns_del(idx=");
idx.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(534);
/* RAW_NS.ttcnpp, line 534 */
NS__Types::PDU__NS rx;
current_location.update_lineno(535);
/* RAW_NS.ttcnpp, line 535 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__del]);
current_location.update_lineno(537);
/* RAW_NS.ttcnpp, line 537 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(538);
/* RAW_NS.ttcnpp, line 538 */
NS__Types::IP4__Elements_template v4__elem;
v4__elem.set_size(1);
v4__elem[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port(), w__sig, w__user);
current_location.update_lineno(541);
/* RAW_NS.ttcnpp, line 541 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__DEL(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), NS__Types::IPAddress_template(OMIT_VALUE), v4__elem, Osmocom__Gb__Types::tr__SNS__DEL_v6_defval), idx);
}
else {
current_location.update_lineno(543);
/* RAW_NS.ttcnpp, line 543 */
NS__Types::IP6__Elements_template v6__elem;
v6__elem.set_size(1);
v6__elem[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().remote__udp__port(), w__sig, w__user);
current_location.update_lineno(546);
/* RAW_NS.ttcnpp, line 546 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__DEL(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(ANY_VALUE), NS__Types::IPAddress_template(OMIT_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), v6__elem), idx);
}
current_location.update_lineno(548);
/* RAW_NS.ttcnpp, line 548 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__ACK(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), const_cast< const NS__Types::PDU__NS&>(rx).pDU__SNS__Delete().transactionID(), Osmocom__Gb__Types::ts__SNS__ACK_cause_defval, Osmocom__Gb__Types::ts__SNS__ACK_v4_defval, Osmocom__Gb__Types::ts__SNS__ACK_v6_defval), NULL);
}

void start_f__incoming__sns__del(const COMPONENT& component_reference, const INTEGER& idx__del, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const Osmocom__Gb__Types::NsCause_template& cause)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_del(");
idx__del.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_incoming_sns_del", text_buf);
idx__del.encode_text(text_buf);
w__sig.encode_text(text_buf);
w__user.encode_text(text_buf);
idx.encode_text(text_buf);
cause.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__del(const INTEGER& idx__del, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const INTEGER& tid)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 552, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_del");
current_location.update_lineno(554);
/* RAW_NS.ttcnpp, line 554 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_del(idx_del=");
idx__del.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(555);
/* RAW_NS.ttcnpp, line 555 */
NS__Types::PDU__NS rx;
current_location.update_lineno(556);
/* RAW_NS.ttcnpp, line 556 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__del]);
current_location.update_lineno(557);
/* RAW_NS.ttcnpp, line 557 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(558);
/* RAW_NS.ttcnpp, line 558 */
NS__Types::IP4__Elements_template v4;
v4.set_size(1);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(561);
/* RAW_NS.ttcnpp, line 561 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__DEL(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, NS__Types::IPAddress_template(OMIT_VALUE), v4, Osmocom__Gb__Types::ts__SNS__DEL_v6_defval), NULL);
current_location.update_lineno(562);
/* RAW_NS.ttcnpp, line 562 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), Osmocom__Gb__Types::NsCause_template(OMIT_VALUE), v4, Osmocom__Gb__Types::tr__SNS__ACK_v6_defval), f__ns__exp_idx_defval);
}
else {
current_location.update_lineno(564);
/* RAW_NS.ttcnpp, line 564 */
NS__Types::IP6__Elements_template v6;
v6.set_size(1);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(567);
/* RAW_NS.ttcnpp, line 567 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__DEL(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, NS__Types::IPAddress_template(OMIT_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
current_location.update_lineno(568);
/* RAW_NS.ttcnpp, line 568 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), Osmocom__Gb__Types::NsCause_template(OMIT_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), v6), f__ns__exp_idx_defval);
}
}

void start_f__outgoing__sns__del(const COMPONENT& component_reference, const INTEGER& idx__del, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const INTEGER& tid)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_del(");
idx__del.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_del", text_buf);
idx__del.encode_text(text_buf);
w__sig.encode_text(text_buf);
w__user.encode_text(text_buf);
idx.encode_text(text_buf);
tid.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__outgoing__sns__chg__weight(const INTEGER& idx__chg, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const INTEGER& tid)
{
TTCN_Location current_location("RAW_NS.ttcnpp", 572, TTCN_Location::LOCATION_FUNCTION, "f_outgoing_sns_chg_weight");
current_location.update_lineno(574);
/* RAW_NS.ttcnpp, line 574 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_outgoing_sns_chg_weight(idx_chg=");
idx__chg.log();
TTCN_Logger::log_char(')');
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(575);
/* RAW_NS.ttcnpp, line 575 */
NS__Types::PDU__NS rx;
current_location.update_lineno(576);
/* RAW_NS.ttcnpp, line 576 */
NS__Emulation::NSVCConfiguration nsvc__cfg(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsvc()[idx__chg]);
current_location.update_lineno(577);
/* RAW_NS.ttcnpp, line 577 */
if ((const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().address__family() == Osmocom__Types::AddressFamily::AF__INET)) {
current_location.update_lineno(578);
/* RAW_NS.ttcnpp, line 578 */
NS__Types::IP4__Elements_template v4;
v4.set_size(1);
v4[0] = Osmocom__Gb__Types::ts__SNS__IPv4(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(581);
/* RAW_NS.ttcnpp, line 581 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CHG__WEIGHT(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, v4, Osmocom__Gb__Types::ts__SNS__CHG__WEIGHT_v6_defval), NULL);
current_location.update_lineno(582);
/* RAW_NS.ttcnpp, line 582 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), Osmocom__Gb__Types::NsCause_template(OMIT_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), Osmocom__Gb__Types::tr__SNS__ACK_v6_defval), f__ns__exp_idx_defval);
}
else {
current_location.update_lineno(584);
/* RAW_NS.ttcnpp, line 584 */
NS__Types::IP6__Elements_template v6;
v6.set_size(1);
v6[0] = Osmocom__Gb__Types::ts__SNS__IPv6(const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__ip(), const_cast< const NS__Emulation::NSVCConfiguration&>(nsvc__cfg).provider().ip().local__udp__port(), w__sig, w__user);
current_location.update_lineno(587);
/* RAW_NS.ttcnpp, line 587 */
RAW__NS__CT_component_NSCP[idx].send(Osmocom__Gb__Types::ts__SNS__CHG__WEIGHT(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei(), tid, NS__Types::IP4__Elements_template(OMIT_VALUE), v6), NULL);
current_location.update_lineno(588);
/* RAW_NS.ttcnpp, line 588 */
rx = f__ns__exp(Osmocom__Gb__Types::tr__SNS__ACK(INTEGER_template(const_cast< const NS__Emulation::NSConfiguration&>(RAW__NS__CT_component_g__nsconfig).nsei()), INTEGER_template(tid), Osmocom__Gb__Types::NsCause_template(OMIT_VALUE), NS__Types::IP4__Elements_template(OMIT_VALUE), NS__Types::IP6__Elements_template(OMIT_VALUE)), f__ns__exp_idx_defval);
}
}

void start_f__outgoing__sns__chg__weight(const COMPONENT& component_reference, const INTEGER& idx__chg, const INTEGER& w__sig, const INTEGER& w__user, const INTEGER& idx, const INTEGER& tid)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_chg_weight(");
idx__chg.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "RAW_NS", "f_outgoing_sns_chg_weight", text_buf);
idx__chg.encode_text(text_buf);
w__sig.encode_text(text_buf);
w__user.encode_text(text_buf);
idx.encode_text(text_buf);
tid.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("RAW_NS.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RAW_NS");
NS__Emulation::module_object.pre_init_module();
NS__Emulation::module_object.pre_init_module();
NS__Provider__IPL4::module_object.pre_init_module();
NS__Provider__FR::module_object.pre_init_module();
{
static const char * const port_name = "NSCP";
RAW__NS__CT_component_NSCP.set_name(port_name);
}
module_object.add_altstep("as_Tguard", (genericfunc_t)&as__Tguard_instance, (genericfunc_t )&activate_as__Tguard, (genericfunc_t )&as__Tguard);
module_object.add_function("f_find_ip_provider", (genericfunc_t)&f__find__ip__provider, (genericfunc_t)&start_f__find__ip__provider);
module_object.add_function("f_init_ns_codec", (genericfunc_t)&f__init__ns__codec, (genericfunc_t)&start_f__init__ns__codec);
module_object.add_function("f_clean_ns_codec", (genericfunc_t)&f__clean__ns__codec, (genericfunc_t)&start_f__clean__ns__codec);
module_object.add_altstep("ax_rx_fail_on_any_ns", (genericfunc_t)&ax__rx__fail__on__any__ns_instance, (genericfunc_t )&activate_ax__rx__fail__on__any__ns, (genericfunc_t )&ax__rx__fail__on__any__ns);
module_object.add_function("f_ns_exp", (genericfunc_t)&f__ns__exp, (genericfunc_t)&start_f__ns__exp);
module_object.add_function("f_outgoing_ns_alive", (genericfunc_t)&f__outgoing__ns__alive, (genericfunc_t)&start_f__outgoing__ns__alive);
module_object.add_function("f_outgoing_ns_alive_no_ack", (genericfunc_t)&f__outgoing__ns__alive__no__ack, (genericfunc_t)&start_f__outgoing__ns__alive__no__ack);
module_object.add_function("f_outgoing_ns_reset", (genericfunc_t)&f__outgoing__ns__reset, (genericfunc_t)&start_f__outgoing__ns__reset);
module_object.add_function("f_outgoing_ns_block", (genericfunc_t)&f__outgoing__ns__block, (genericfunc_t)&start_f__outgoing__ns__block);
module_object.add_function("f_outgoing_ns_unblock", (genericfunc_t)&f__outgoing__ns__unblock, (genericfunc_t)&start_f__outgoing__ns__unblock);
module_object.add_altstep("as_rx_alive_tx_ack", (genericfunc_t)&as__rx__alive__tx__ack_instance, (genericfunc_t )&activate_as__rx__alive__tx__ack, (genericfunc_t )&as__rx__alive__tx__ack);
module_object.add_function("f_tx_bvc_reset_rx_ack", (genericfunc_t)&f__tx__bvc__reset__rx__ack, (genericfunc_t)&start_f__tx__bvc__reset__rx__ack);
module_object.add_altstep("as_rx_bvc_reset_tx_ack", (genericfunc_t)&as__rx__bvc__reset__tx__ack_instance, (genericfunc_t )&activate_as__rx__bvc__reset__tx__ack, (genericfunc_t )&as__rx__bvc__reset__tx__ack);
module_object.add_altstep("as_rx_bvc_unblock_tx_ack", (genericfunc_t)&as__rx__bvc__unblock__tx__ack_instance, (genericfunc_t )&activate_as__rx__bvc__unblock__tx__ack, (genericfunc_t )&as__rx__bvc__unblock__tx__ack);
module_object.add_altstep("as_rx_bvc_fc_tx_ack", (genericfunc_t)&as__rx__bvc__fc__tx__ack_instance, (genericfunc_t )&activate_as__rx__bvc__fc__tx__ack, (genericfunc_t )&as__rx__bvc__fc__tx__ack);
module_object.add_altstep("as_rx_ns_reset_ack", (genericfunc_t)&as__rx__ns__reset__ack_instance, (genericfunc_t )&activate_as__rx__ns__reset__ack, (genericfunc_t )&as__rx__ns__reset__ack);
module_object.add_altstep("as_rx_ns_unblock_ack", (genericfunc_t)&as__rx__ns__unblock__ack_instance, (genericfunc_t )&activate_as__rx__ns__unblock__ack, (genericfunc_t )&as__rx__ns__unblock__ack);
module_object.add_altstep("as_rx_ns_block_ack", (genericfunc_t)&as__rx__ns__block__ack_instance, (genericfunc_t )&activate_as__rx__ns__block__ack, (genericfunc_t )&as__rx__ns__block__ack);
module_object.add_function("f_incoming_sns_size", (genericfunc_t)&f__incoming__sns__size, (genericfunc_t)&start_f__incoming__sns__size);
module_object.add_function("f_outgoing_sns_size", (genericfunc_t)&f__outgoing__sns__size, (genericfunc_t)&start_f__outgoing__sns__size);
module_object.add_function("f_incoming_sns_config", (genericfunc_t)&f__incoming__sns__config, (genericfunc_t)&start_f__incoming__sns__config);
module_object.add_function("f_outgoing_sns_config", (genericfunc_t)&f__outgoing__sns__config, (genericfunc_t)&start_f__outgoing__sns__config);
module_object.add_function("f_outgoing_sns_config_1c1u", (genericfunc_t)&f__outgoing__sns__config__1c1u, (genericfunc_t)&start_f__outgoing__sns__config__1c1u);
module_object.add_function("f_outgoing_sns_config_1c1u_separate", (genericfunc_t)&f__outgoing__sns__config__1c1u__separate, (genericfunc_t)&start_f__outgoing__sns__config__1c1u__separate);
module_object.add_function("f_incoming_sns_chg_weight", (genericfunc_t)&f__incoming__sns__chg__weight, (genericfunc_t)&start_f__incoming__sns__chg__weight);
module_object.add_function("f_incoming_sns_add", (genericfunc_t)&f__incoming__sns__add, (genericfunc_t)&start_f__incoming__sns__add);
module_object.add_function("f_outgoing_sns_add", (genericfunc_t)&f__outgoing__sns__add, (genericfunc_t)&start_f__outgoing__sns__add);
module_object.add_function("f_incoming_sns_del", (genericfunc_t)&f__incoming__sns__del, (genericfunc_t)&start_f__incoming__sns__del);
module_object.add_function("f_outgoing_sns_del", (genericfunc_t)&f__outgoing__sns__del, (genericfunc_t)&start_f__outgoing__sns__del);
module_object.add_function("f_outgoing_sns_chg_weight", (genericfunc_t)&f__outgoing__sns__chg__weight, (genericfunc_t)&start_f__outgoing__sns__chg__weight);
}

void post_init_module()
{
TTCN_Location current_location("RAW_NS.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RAW_NS");
NS__Emulation::module_object.post_init_module();
NS__Emulation::module_object.post_init_module();
NS__Provider__IPL4::module_object.post_init_module();
NS__Provider__FR::module_object.post_init_module();
current_location.update_lineno(70);
/* RAW_NS.ttcnpp, line 70 */
const_f__init__ns__codec_idx_defval = 0;
current_location.update_lineno(70);
/* RAW_NS.ttcnpp, line 70 */
const_f__init__ns__codec_guard__secs_defval = 6.0e1;
current_location.update_lineno(70);
/* RAW_NS.ttcnpp, line 70 */
const_f__init__ns__codec_id_defval = TTCN_Runtime::get_testcasename();
current_location.update_lineno(138);
/* RAW_NS.ttcnpp, line 138 */
const_ax__rx__fail__on__any__ns_idx_defval = 0;
current_location.update_lineno(146);
/* RAW_NS.ttcnpp, line 146 */
const_f__ns__exp_idx_defval = 0;
current_location.update_lineno(160);
/* RAW_NS.ttcnpp, line 160 */
const_f__outgoing__ns__alive_idx_defval = 0;
current_location.update_lineno(170);
/* RAW_NS.ttcnpp, line 170 */
const_f__outgoing__ns__alive__no__ack_idx_defval = 0;
current_location.update_lineno(170);
/* RAW_NS.ttcnpp, line 170 */
const_f__outgoing__ns__alive__no__ack_tout_defval = 1.0e1;
current_location.update_lineno(186);
/* RAW_NS.ttcnpp, line 186 */
const_f__outgoing__ns__reset_idx_defval = 0;
current_location.update_lineno(186);
/* RAW_NS.ttcnpp, line 186 */
const_f__outgoing__ns__reset_tout_defval = 1.0e1;
current_location.update_lineno(204);
/* RAW_NS.ttcnpp, line 204 */
const_f__outgoing__ns__block_idx_defval = 0;
current_location.update_lineno(214);
/* RAW_NS.ttcnpp, line 214 */
const_f__outgoing__ns__unblock_idx_defval = 0;
current_location.update_lineno(224);
/* RAW_NS.ttcnpp, line 224 */
const_as__rx__alive__tx__ack_oneshot_defval = FALSE;
current_location.update_lineno(224);
/* RAW_NS.ttcnpp, line 224 */
const_as__rx__alive__tx__ack_idx_defval = 0;
current_location.update_lineno(240);
/* RAW_NS.ttcnpp, line 240 */
const_f__tx__bvc__reset__rx__ack_idx_defval = 0;
current_location.update_lineno(240);
/* RAW_NS.ttcnpp, line 240 */
const_f__tx__bvc__reset__rx__ack_exp__ack_defval = TRUE;
current_location.update_lineno(265);
/* RAW_NS.ttcnpp, line 265 */
const_as__rx__bvc__reset__tx__ack_oneshot_defval = FALSE;
current_location.update_lineno(265);
/* RAW_NS.ttcnpp, line 265 */
const_as__rx__bvc__reset__tx__ack_idx_defval = 0;
current_location.update_lineno(279);
/* RAW_NS.ttcnpp, line 279 */
const_as__rx__bvc__unblock__tx__ack_oneshot_defval = FALSE;
current_location.update_lineno(279);
/* RAW_NS.ttcnpp, line 279 */
const_as__rx__bvc__unblock__tx__ack_idx_defval = 0;
current_location.update_lineno(290);
/* RAW_NS.ttcnpp, line 290 */
const_as__rx__bvc__fc__tx__ack_oneshot_defval = FALSE;
current_location.update_lineno(290);
/* RAW_NS.ttcnpp, line 290 */
const_as__rx__bvc__fc__tx__ack_idx_defval = 0;
current_location.update_lineno(308);
/* RAW_NS.ttcnpp, line 308 */
const_as__rx__ns__reset__ack_oneshot_defval = FALSE;
current_location.update_lineno(308);
/* RAW_NS.ttcnpp, line 308 */
const_as__rx__ns__reset__ack_idx_defval = 0;
current_location.update_lineno(317);
/* RAW_NS.ttcnpp, line 317 */
const_as__rx__ns__unblock__ack_oneshot_defval = FALSE;
current_location.update_lineno(317);
/* RAW_NS.ttcnpp, line 317 */
const_as__rx__ns__unblock__ack_idx_defval = 0;
current_location.update_lineno(326);
/* RAW_NS.ttcnpp, line 326 */
const_as__rx__ns__block__ack_oneshot_defval = FALSE;
current_location.update_lineno(326);
/* RAW_NS.ttcnpp, line 326 */
const_as__rx__ns__block__ack_idx_defval = 0;
current_location.update_lineno(326);
/* RAW_NS.ttcnpp, line 326 */
template_as__rx__ns__block__ack_cause_defval = ANY_OR_OMIT;
current_location.update_lineno(326);
/* RAW_NS.ttcnpp, line 326 */
template_as__rx__ns__block__ack_nsvci_defval = ANY_OR_OMIT;
current_location.update_lineno(339);
/* RAW_NS.ttcnpp, line 339 */
template_f__incoming__sns__size_cause_defval = OMIT_VALUE;
current_location.update_lineno(339);
/* RAW_NS.ttcnpp, line 339 */
const_f__incoming__sns__size_idx_defval = 0;
current_location.update_lineno(340);
/* RAW_NS.ttcnpp, line 340 */
template_f__incoming__sns__size_num__max__nsvcs_defval = ANY_VALUE;
current_location.update_lineno(340);
/* RAW_NS.ttcnpp, line 340 */
template_f__incoming__sns__size_num__ep_defval = ANY_VALUE;
current_location.update_lineno(359);
/* RAW_NS.ttcnpp, line 359 */
template_f__outgoing__sns__size_cause_defval = OMIT_VALUE;
current_location.update_lineno(359);
/* RAW_NS.ttcnpp, line 359 */
const_f__outgoing__sns__size_max__nsvcs_defval = 1;
current_location.update_lineno(360);
/* RAW_NS.ttcnpp, line 360 */
const_f__outgoing__sns__size_num__ip_defval = 1;
current_location.update_lineno(360);
/* RAW_NS.ttcnpp, line 360 */
const_f__outgoing__sns__size_idx_defval = 0;
current_location.update_lineno(380);
/* RAW_NS.ttcnpp, line 380 */
template_f__incoming__sns__config_cause_defval = OMIT_VALUE;
current_location.update_lineno(380);
/* RAW_NS.ttcnpp, line 380 */
const_f__incoming__sns__config_idx_defval = 0;
current_location.update_lineno(399);
/* RAW_NS.ttcnpp, line 399 */
template_f__outgoing__sns__config_cause_defval = OMIT_VALUE;
current_location.update_lineno(399);
/* RAW_NS.ttcnpp, line 399 */
const_f__outgoing__sns__config_idx_defval = 0;
current_location.update_lineno(418);
/* RAW_NS.ttcnpp, line 418 */
template_f__outgoing__sns__config__1c1u_cause_defval = OMIT_VALUE;
current_location.update_lineno(418);
/* RAW_NS.ttcnpp, line 418 */
const_f__outgoing__sns__config__1c1u_idx_defval = 0;
current_location.update_lineno(440);
/* RAW_NS.ttcnpp, line 440 */
template_f__outgoing__sns__config__1c1u__separate_cause_defval = OMIT_VALUE;
current_location.update_lineno(440);
/* RAW_NS.ttcnpp, line 440 */
const_f__outgoing__sns__config__1c1u__separate_idx_defval = 0;
current_location.update_lineno(461);
/* RAW_NS.ttcnpp, line 461 */
const_f__incoming__sns__chg__weight_idx__chg_defval = 0;
current_location.update_lineno(461);
/* RAW_NS.ttcnpp, line 461 */
template_f__incoming__sns__chg__weight_cause_defval = OMIT_VALUE;
current_location.update_lineno(461);
/* RAW_NS.ttcnpp, line 461 */
const_f__incoming__sns__chg__weight_idx_defval = 0;
current_location.update_lineno(481);
/* RAW_NS.ttcnpp, line 481 */
const_f__incoming__sns__add_w__sig_defval = 1;
current_location.update_lineno(481);
/* RAW_NS.ttcnpp, line 481 */
const_f__incoming__sns__add_w__user_defval = 1;
current_location.update_lineno(481);
/* RAW_NS.ttcnpp, line 481 */
const_f__incoming__sns__add_idx_defval = 0;
current_location.update_lineno(481);
/* RAW_NS.ttcnpp, line 481 */
template_f__incoming__sns__add_cause_defval = OMIT_VALUE;
current_location.update_lineno(501);
/* RAW_NS.ttcnpp, line 501 */
const_f__outgoing__sns__add_w__sig_defval = 1;
current_location.update_lineno(501);
/* RAW_NS.ttcnpp, line 501 */
const_f__outgoing__sns__add_w__user_defval = 1;
current_location.update_lineno(501);
/* RAW_NS.ttcnpp, line 501 */
const_f__outgoing__sns__add_idx_defval = 0;
current_location.update_lineno(501);
/* RAW_NS.ttcnpp, line 501 */
template_f__outgoing__sns__add_cause_defval = OMIT_VALUE;
current_location.update_lineno(501);
/* RAW_NS.ttcnpp, line 501 */
const_f__outgoing__sns__add_tid_defval = 23;
current_location.update_lineno(531);
/* RAW_NS.ttcnpp, line 531 */
const_f__incoming__sns__del_w__sig_defval = 1;
current_location.update_lineno(531);
/* RAW_NS.ttcnpp, line 531 */
const_f__incoming__sns__del_w__user_defval = 1;
current_location.update_lineno(531);
/* RAW_NS.ttcnpp, line 531 */
const_f__incoming__sns__del_idx_defval = 0;
current_location.update_lineno(531);
/* RAW_NS.ttcnpp, line 531 */
template_f__incoming__sns__del_cause_defval = OMIT_VALUE;
current_location.update_lineno(552);
/* RAW_NS.ttcnpp, line 552 */
const_f__outgoing__sns__del_w__sig_defval = 1;
current_location.update_lineno(552);
/* RAW_NS.ttcnpp, line 552 */
const_f__outgoing__sns__del_w__user_defval = 1;
current_location.update_lineno(552);
/* RAW_NS.ttcnpp, line 552 */
const_f__outgoing__sns__del_idx_defval = 0;
current_location.update_lineno(552);
/* RAW_NS.ttcnpp, line 552 */
const_f__outgoing__sns__del_tid_defval = 24;
current_location.update_lineno(572);
/* RAW_NS.ttcnpp, line 572 */
const_f__outgoing__sns__chg__weight_idx_defval = 0;
current_location.update_lineno(572);
/* RAW_NS.ttcnpp, line 572 */
const_f__outgoing__sns__chg__weight_tid_defval = 25;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "RAW_NS_CT")) {
RAW__NS__CT_component_NSCP.activate_port();
RAW__NS__CT_component_ip__prov.clean_up();
RAW__NS__CT_component_NSPIP__PROC.activate_port();
RAW__NS__CT_component_vc__NSP__FR.clean_up();
RAW__NS__CT_component_g__nsconfig.clean_up();
RAW__NS__CT_component_g__handle__rx__alive = FALSE;
RAW__NS__CT_component_rawns__initialized = FALSE;
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "RAW_NS_CT")) {
if (!strcmp(port_name, "NSCP")) {
RAW__NS__CT_component_NSCP.safe_start();
return TRUE;
}
if (!strcmp(port_name, "NSPIP_PROC")) {
RAW__NS__CT_component_NSPIP__PROC.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_find_ip_provider")) {
NS__Emulation::NSVCConfigurationIP nsip__config;
nsip__config.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_find_ip_provider(");
nsip__config.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__find__ip__provider(nsip__config);
TTCN_Runtime::function_finished("f_find_ip_provider");
return TRUE;
} else if (!strcmp(function_name, "f_init_ns_codec")) {
NS__Emulation::NSConfiguration ns__config;
INTEGER idx;
FLOAT guard__secs;
CHARSTRING id;
ns__config.decode_text(function_arguments);
idx.decode_text(function_arguments);
guard__secs.decode_text(function_arguments);
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_ns_codec(");
ns__config.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
guard__secs.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__init__ns__codec(ns__config, idx, guard__secs, id);
TTCN_Runtime::function_finished("f_init_ns_codec");
return TRUE;
} else if (!strcmp(function_name, "f_clean_ns_codec")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_clean_ns_codec().");
TTCN_Runtime::function_started(function_arguments);
f__clean__ns__codec();
TTCN_Runtime::function_finished("f_clean_ns_codec");
return TRUE;
} else if (!strcmp(function_name, "f_ns_exp")) {
NS__Types::PDU__NS_template exp__rx;
INTEGER idx;
exp__rx.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ns_exp(");
exp__rx.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ns__exp(exp__rx, idx);
TTCN_Runtime::function_finished("f_ns_exp");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_ns_alive")) {
INTEGER idx;
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_alive(");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__ns__alive(idx);
TTCN_Runtime::function_finished("f_outgoing_ns_alive");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_ns_alive_no_ack")) {
INTEGER idx;
FLOAT tout;
idx.decode_text(function_arguments);
tout.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_alive_no_ack(");
idx.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__ns__alive__no__ack(idx, tout);
TTCN_Runtime::function_finished("f_outgoing_ns_alive_no_ack");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_ns_reset")) {
INTEGER idx;
FLOAT tout;
idx.decode_text(function_arguments);
tout.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_reset(");
idx.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__ns__reset(idx, tout);
TTCN_Runtime::function_finished("f_outgoing_ns_reset");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_ns_block")) {
Osmocom__Gb__Types::NsCause cause;
INTEGER idx;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_block(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__ns__block(cause, idx);
TTCN_Runtime::function_finished("f_outgoing_ns_block");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_ns_unblock")) {
INTEGER idx;
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_ns_unblock(");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__ns__unblock(idx);
TTCN_Runtime::function_finished("f_outgoing_ns_unblock");
return TRUE;
} else if (!strcmp(function_name, "f_tx_bvc_reset_rx_ack")) {
INTEGER bvci;
Osmocom__Gb__Types::BssgpCellId_template tx__cell__id;
Osmocom__Gb__Types::BssgpCellId_template rx__cell__id;
INTEGER idx;
BOOLEAN exp__ack;
bvci.decode_text(function_arguments);
tx__cell__id.decode_text(function_arguments);
rx__cell__id.decode_text(function_arguments);
idx.decode_text(function_arguments);
exp__ack.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_bvc_reset_rx_ack(");
bvci.log();
TTCN_Logger::log_event_str(", ");
tx__cell__id.log();
TTCN_Logger::log_event_str(", ");
rx__cell__id.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
exp__ack.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tx__bvc__reset__rx__ack(bvci, tx__cell__id, rx__cell__id, idx, exp__ack);
TTCN_Runtime::function_finished("f_tx_bvc_reset_rx_ack");
return TRUE;
} else if (!strcmp(function_name, "f_incoming_sns_size")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
INTEGER_template num__max__nsvcs;
INTEGER_template num__ep;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
num__max__nsvcs.decode_text(function_arguments);
num__ep.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_size(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
num__max__nsvcs.log();
TTCN_Logger::log_event_str(", ");
num__ep.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__incoming__sns__size(cause, idx, num__max__nsvcs, num__ep);
TTCN_Runtime::function_finished("f_incoming_sns_size");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_size")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER max__nsvcs;
INTEGER num__ip;
INTEGER idx;
cause.decode_text(function_arguments);
max__nsvcs.decode_text(function_arguments);
num__ip.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_size(");
cause.log();
TTCN_Logger::log_event_str(", ");
max__nsvcs.log();
TTCN_Logger::log_event_str(", ");
num__ip.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__size(cause, max__nsvcs, num__ip, idx);
TTCN_Runtime::function_finished("f_outgoing_sns_size");
return TRUE;
} else if (!strcmp(function_name, "f_incoming_sns_config")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_config(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__incoming__sns__config(cause, idx);
TTCN_Runtime::function_finished("f_incoming_sns_config");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_config")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__config(cause, idx);
TTCN_Runtime::function_finished("f_outgoing_sns_config");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_config_1c1u")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config_1c1u(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__config__1c1u(cause, idx);
TTCN_Runtime::function_finished("f_outgoing_sns_config_1c1u");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_config_1c1u_separate")) {
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_config_1c1u_separate(");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__config__1c1u__separate(cause, idx);
TTCN_Runtime::function_finished("f_outgoing_sns_config_1c1u_separate");
return TRUE;
} else if (!strcmp(function_name, "f_incoming_sns_chg_weight")) {
INTEGER idx__chg;
Osmocom__Gb__Types::NsCause_template cause;
INTEGER idx;
idx__chg.decode_text(function_arguments);
cause.decode_text(function_arguments);
idx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_chg_weight(");
idx__chg.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__incoming__sns__chg__weight(idx__chg, cause, idx);
TTCN_Runtime::function_finished("f_incoming_sns_chg_weight");
return TRUE;
} else if (!strcmp(function_name, "f_incoming_sns_add")) {
INTEGER idx__add;
INTEGER w__sig;
INTEGER w__user;
INTEGER idx;
Osmocom__Gb__Types::NsCause_template cause;
idx__add.decode_text(function_arguments);
w__sig.decode_text(function_arguments);
w__user.decode_text(function_arguments);
idx.decode_text(function_arguments);
cause.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_add(");
idx__add.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__incoming__sns__add(idx__add, w__sig, w__user, idx, cause);
TTCN_Runtime::function_finished("f_incoming_sns_add");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_add")) {
INTEGER idx__add;
INTEGER w__sig;
INTEGER w__user;
INTEGER idx;
Osmocom__Gb__Types::NsCause_template cause;
INTEGER tid;
idx__add.decode_text(function_arguments);
w__sig.decode_text(function_arguments);
w__user.decode_text(function_arguments);
idx.decode_text(function_arguments);
cause.decode_text(function_arguments);
tid.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_add(");
idx__add.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__add(idx__add, w__sig, w__user, idx, cause, tid);
TTCN_Runtime::function_finished("f_outgoing_sns_add");
return TRUE;
} else if (!strcmp(function_name, "f_incoming_sns_del")) {
INTEGER idx__del;
INTEGER w__sig;
INTEGER w__user;
INTEGER idx;
Osmocom__Gb__Types::NsCause_template cause;
idx__del.decode_text(function_arguments);
w__sig.decode_text(function_arguments);
w__user.decode_text(function_arguments);
idx.decode_text(function_arguments);
cause.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_incoming_sns_del(");
idx__del.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
cause.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__incoming__sns__del(idx__del, w__sig, w__user, idx, cause);
TTCN_Runtime::function_finished("f_incoming_sns_del");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_del")) {
INTEGER idx__del;
INTEGER w__sig;
INTEGER w__user;
INTEGER idx;
INTEGER tid;
idx__del.decode_text(function_arguments);
w__sig.decode_text(function_arguments);
w__user.decode_text(function_arguments);
idx.decode_text(function_arguments);
tid.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_del(");
idx__del.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__del(idx__del, w__sig, w__user, idx, tid);
TTCN_Runtime::function_finished("f_outgoing_sns_del");
return TRUE;
} else if (!strcmp(function_name, "f_outgoing_sns_chg_weight")) {
INTEGER idx__chg;
INTEGER w__sig;
INTEGER w__user;
INTEGER idx;
INTEGER tid;
idx__chg.decode_text(function_arguments);
w__sig.decode_text(function_arguments);
w__user.decode_text(function_arguments);
idx.decode_text(function_arguments);
tid.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_outgoing_sns_chg_weight(");
idx__chg.log();
TTCN_Logger::log_event_str(", ");
w__sig.log();
TTCN_Logger::log_event_str(", ");
w__user.log();
TTCN_Logger::log_event_str(", ");
idx.log();
TTCN_Logger::log_event_str(", ");
tid.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__outgoing__sns__chg__weight(idx__chg, w__sig, w__user, idx, tid);
TTCN_Runtime::function_finished("f_outgoing_sns_chg_weight");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
