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

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

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

/* Including header files */

#include "BSSGP_Emulation.hh"

namespace BSSGP__Emulation {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 0 },
bs_1_bits[] = { 1 };
extern const BITSTRING bs_0(4, bs_0_bits),
bs_1(1, bs_1_bits);
extern const HEXSTRING hs_0(0, NULL);
const unsigned char os_1_octets[] = { 0, 0, 0, 0 },
os_0_octets[] = { 255, 255, 255, 255 };
extern const OCTETSTRING os_1(4, os_1_octets),
os_0(4, os_0_octets);
extern const CHARSTRING cs_0(5, "-BVCI"),
cs_3(22, "BSSGP_Emulation.ttcnpp"),
cs_1(9, "Connected"),
cs_2(4, "omit");
const unsigned char module_checksum[] = { 0x1e, 0xd5, 0xe7, 0x33, 0x4e, 0xde, 0xa3, 0xd5, 0x6a, 0xf8, 0x91, 0xc5, 0x43, 0x76, 0xec, 0x05 };

/* Global variable definitions */

const XERdescriptor_t       BssgpStatusIndication_bvci_xer_ = { {"bvci>\n", "bvci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpStatusIndication_bvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpStatusIndication_bvci_descr_ = { "@BSSGP_Emulation.BssgpStatusIndication.bvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpStatusIndication_bvci_xer_, &INTEGER_json_, &BssgpStatusIndication_bvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpStatusIndication_bvci_default_coding("RAW");
// No XER for BvcState
const TTCN_Typedescriptor_t BvcState_descr_ = { "@BSSGP_Emulation.BvcState", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for BssgpStatusIndication
const TTCN_Typedescriptor_t BssgpStatusIndication_descr_ = { "@BSSGP_Emulation.BssgpStatusIndication", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       BssgpStatusIndication_nsei_xer_ = { {"nsei>\n", "nsei>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpStatusIndication_nsei_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpStatusIndication_nsei_descr_ = { "@BSSGP_Emulation.BssgpStatusIndication.nsei", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpStatusIndication_nsei_xer_, &INTEGER_json_, &BssgpStatusIndication_nsei_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpStatusIndication_nsei_default_coding("RAW");
const XERdescriptor_t       BssgpResetIndication_bvci_xer_ = { {"bvci>\n", "bvci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpResetIndication_bvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpResetIndication_bvci_descr_ = { "@BSSGP_Emulation.BssgpResetIndication.bvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpResetIndication_bvci_xer_, &INTEGER_json_, &BssgpResetIndication_bvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpResetIndication_bvci_default_coding("RAW");
// No XER for BssgpResetIndication
const TTCN_Typedescriptor_t BssgpResetIndication_descr_ = { "@BSSGP_Emulation.BssgpResetIndication", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_Typedescriptor_t& BSSGP__Client__CT_descr_ = COMPONENT_descr_;
PORT_ARRAY<BSSGP__PT, 3, 0> BSSGP__Client__CT_component_BSSGP;
PORT_ARRAY<BSSGP__PT, 3, 0> BSSGP__Client__CT_component_BSSGP__SIG;
PORT_ARRAY<BSSGP__PT, 3, 0> BSSGP__Client__CT_component_BSSGP__GLOBAL;
PORT_ARRAY<BSSGP__PROC__PT, 3, 0> BSSGP__Client__CT_component_BSSGP__PROC;
const TTCN_Typedescriptor_t& BSSGP__CT_descr_ = COMPONENT_descr_;
NS__Emulation::NS__PT BSSGP__CT_component_BSCP("BSCP");
BSSGP__CT__PROC__PT BSSGP__CT_component_PROC("PROC");
BSSGP__SP__PT BSSGP__CT_component_GLOBAL("GLOBAL");
BSSGP__SP__PT BSSGP__CT_component_RIM("RIM");
BSSGP__BVC__MGMT__SP__PT BSSGP__CT_component_MGMT("MGMT");
const XERdescriptor_t       BssgpConfig_nsei_xer_ = { {"nsei>\n", "nsei>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpConfig_nsei_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpConfig_nsei_descr_ = { "@BSSGP_Emulation.BssgpConfig.nsei", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpConfig_nsei_xer_, &INTEGER_json_, &BssgpConfig_nsei_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpConfig_nsei_default_coding("RAW");
const XERdescriptor_t       BssgpConfig_sgsn__role_xer_ = { {"sgsn_role>\n", "sgsn_role>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int BssgpConfig_sgsn__role_oer_ext_arr_[0] = {};
const int BssgpConfig_sgsn__role_oer_p_[0] = {};
const TTCN_OERdescriptor_t BssgpConfig_sgsn__role_oer_ = { -1, TRUE, -1, FALSE, 0, 0, BssgpConfig_sgsn__role_oer_ext_arr_, 0, BssgpConfig_sgsn__role_oer_p_};
const TTCN_Typedescriptor_t BssgpConfig_sgsn__role_descr_ = { "@BSSGP_Emulation.BssgpConfig.sgsn_role", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &BssgpConfig_sgsn__role_xer_, &BOOLEAN_json_, &BssgpConfig_sgsn__role_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for BssgpBvcConfigs
const TTCN_Typedescriptor_t BssgpBvcConfigs_descr_ = { "@BSSGP_Emulation.BssgpBvcConfigs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &BssgpBvcConfig_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       BssgpBvcConfig_bvci_xer_ = { {"bvci>\n", "bvci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpBvcConfig_bvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpBvcConfig_bvci_descr_ = { "@BSSGP_Emulation.BssgpBvcConfig.bvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpBvcConfig_bvci_xer_, &INTEGER_json_, &BssgpBvcConfig_bvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpBvcConfig_bvci_default_coding("RAW");
UNIVERSAL_CHARSTRING BssgpBvcConfig_cell__id_default_coding("RAW");
// No XER for BssgpDecodeDepth
const TTCN_Typedescriptor_t BssgpDecodeDepth_descr_ = { "@BSSGP_Emulation.BssgpDecodeDepth", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for BssgpCreateCallback
const TTCN_Typedescriptor_t BssgpCreateCallback_descr_ = { "@BSSGP_Emulation.BssgpCreateCallback", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpDecoded_bssgp_default_coding("RAW");
// No XER for BssgpDecoded
const TTCN_Typedescriptor_t BssgpDecoded_descr_ = { "@BSSGP_Emulation.BssgpDecoded", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpDecoded_llc_default_coding("RAW");
UNIVERSAL_CHARSTRING BssgpDecoded_l3__mo_default_coding("RAW");
UNIVERSAL_CHARSTRING BssgpDecoded_l3__mt_default_coding("RAW");
UNIVERSAL_CHARSTRING BssgpDecoded_sndcp_default_coding("RAW");
// No XER for BssgpBvcConfig
const TTCN_Typedescriptor_t BssgpBvcConfig_descr_ = { "@BSSGP_Emulation.BssgpBvcConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for BssgpConfig
const TTCN_Typedescriptor_t BssgpConfig_descr_ = { "@BSSGP_Emulation.BssgpConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
BssgpConfig BSSGP__CT_component_g__cfg;
BvcState BSSGP__CT_component_g__sign__bvc__state;
TIMER BSSGP__CT_component_g__T2("g_T2", 6.0e1);
BSSGP__BVC__SP__PT BSSGP__CT_component_BVC("BVC");
const XERdescriptor_t       BvcEntity_bvci_xer_ = { {"bvci>\n", "bvci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BvcEntity_bvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BvcEntity_bvci_descr_ = { "@BSSGP_Emulation.BvcEntity.bvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BvcEntity_bvci_xer_, &INTEGER_json_, &BvcEntity_bvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BvcEntity_bvci_default_coding("RAW");
UNIVERSAL_CHARSTRING BvcEntity_cell__id_default_coding("RAW");
const TTCN_Typedescriptor_t& BSSGP__BVC__CT_descr_ = COMPONENT_descr_;
// No XER for BvcEntity
const TTCN_Typedescriptor_t BvcEntity_descr_ = { "@BSSGP_Emulation.BvcEntity", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
VALUE_ARRAY<BvcEntity, 64, 0> BSSGP__CT_component_BvcTable;
BSSGP__Types::PDU__BSSGP_template template_tr__GLOBAL__SIG;
const BSSGP__Types::PDU__BSSGP_template& tr__GLOBAL__SIG = template_tr__GLOBAL__SIG;
BSSGP__Types::PDU__BSSGP_template template_tr__RIM;
const BSSGP__Types::PDU__BSSGP_template& tr__RIM = template_tr__RIM;
BSSGP__BVC__PT BSSGP__BVC__CT_component_BVC("BVC");
BSSGP__BVC__MGMT__SP__PT BSSGP__BVC__CT_component_MGMT("MGMT");
BSSGP__SP__PT BSSGP__BVC__CT_component_GLOBAL("GLOBAL");
BSSGP__SP__PT BSSGP__BVC__CT_component_BSSGP__SP("BSSGP_SP");
BSSGP__SP__PT BSSGP__BVC__CT_component_BSSGP__SP__SIG("BSSGP_SP_SIG");
BSSGP__PROC__PT BSSGP__BVC__CT_component_BSSGP__PROC("BSSGP_PROC");
BssgpBvcConfig BSSGP__BVC__CT_component_g__cfg;
BOOLEAN BSSGP__BVC__CT_component_g__sgsn__role;
INTEGER BSSGP__BVC__CT_component_g__nsei;
INTEGER BSSGP__BVC__CT_component_g__bvc__lsp;
BvcState BSSGP__BVC__CT_component_g__ptp__bvc__state;
TIMER BSSGP__BVC__CT_component_g__T1("g_T1", 1.5e1);
TIMER BSSGP__BVC__CT_component_g__T2("g_T2", 6.0e1);
BOOLEAN BSSGP__BVC__CT_component_g__t1__waits__for__block__ack;
Osmocom__Gb__Types::BssgpCause BSSGP__BVC__CT_component_g__last__block__cause;
Osmocom__Gb__Types::BssgpCause BSSGP__BVC__CT_component_g__last__reset__cause;
const XERdescriptor_t       ClientEntity_tlli_xer_ = { {"tlli>\n", "tlli>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ClientEntity_tlli_oer_ext_arr_[0] = {};
const int ClientEntity_tlli_oer_p_[0] = {};
const TTCN_OERdescriptor_t ClientEntity_tlli_oer_ = { -1, TRUE, 4, FALSE, 0, 0, ClientEntity_tlli_oer_ext_arr_, 0, ClientEntity_tlli_oer_p_};
const TTCN_Typedescriptor_t ClientEntity_tlli_descr_ = { "@BSSGP_Emulation.ClientEntity.tlli", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &ClientEntity_tlli_xer_, &OCTETSTRING_json_, &ClientEntity_tlli_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClientEntity_tlli_default_coding("RAW");
const XERdescriptor_t       ClientEntity_imsi_xer_ = { {"imsi>\n", "imsi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ClientEntity_imsi_descr_ = { "@BSSGP_Emulation.ClientEntity.imsi", NULL, &HEXSTRING_raw_, NULL, &ClientEntity_imsi_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       LLC__Entity_sgsn__role_xer_ = { {"sgsn_role>\n", "sgsn_role>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int LLC__Entity_sgsn__role_oer_ext_arr_[0] = {};
const int LLC__Entity_sgsn__role_oer_p_[0] = {};
const TTCN_OERdescriptor_t LLC__Entity_sgsn__role_oer_ = { -1, TRUE, -1, FALSE, 0, 0, LLC__Entity_sgsn__role_oer_ext_arr_, 0, LLC__Entity_sgsn__role_oer_p_};
const TTCN_Typedescriptor_t LLC__Entity_sgsn__role_descr_ = { "@BSSGP_Emulation.LLC_Entity.sgsn_role", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &LLC__Entity_sgsn__role_xer_, &BOOLEAN_json_, &LLC__Entity_sgsn__role_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       LLC__Entity_n__u__tx__next_xer_ = { {"n_u_tx_next>\n", "n_u_tx_next>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LLC__Entity_n__u__tx__next_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LLC__Entity_n__u__tx__next_descr_ = { "@BSSGP_Emulation.LLC_Entity.n_u_tx_next", &INTEGER_ber_, &Osmocom__Types::uint9__t_raw_, &INTEGER_text_, &LLC__Entity_n__u__tx__next_xer_, &INTEGER_json_, &LLC__Entity_n__u__tx__next_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LLC__Entity_n__u__tx__next_default_coding("RAW");
// No XER for LLC__Entity
const TTCN_Typedescriptor_t LLC__Entity_descr_ = { "@BSSGP_Emulation.LLC_Entity", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       LLC__Entity_n__u__rx__last_xer_ = { {"n_u_rx_last>\n", "n_u_rx_last>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t LLC__Entity_n__u__rx__last_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t LLC__Entity_n__u__rx__last_descr_ = { "@BSSGP_Emulation.LLC_Entity.n_u_rx_last", &INTEGER_ber_, &Osmocom__Types::uint9__t_raw_, &INTEGER_text_, &LLC__Entity_n__u__rx__last_xer_, &INTEGER_json_, &LLC__Entity_n__u__rx__last_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING LLC__Entity_n__u__rx__last_default_coding("RAW");
// No XER for ClientEntity_llc
const TTCN_Typedescriptor_t ClientEntity_llc_descr_ = { "@BSSGP_Emulation.ClientEntity.llc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ClientEntity
const TTCN_Typedescriptor_t ClientEntity_descr_ = { "@BSSGP_Emulation.ClientEntity", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ClientEntity_tlli__old_xer_ = { {"tlli_old>\n", "tlli_old>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ClientEntity_tlli__old_oer_ext_arr_[0] = {};
const int ClientEntity_tlli__old_oer_p_[0] = {};
const TTCN_OERdescriptor_t ClientEntity_tlli__old_oer_ = { -1, TRUE, 4, FALSE, 0, 0, ClientEntity_tlli__old_oer_ext_arr_, 0, ClientEntity_tlli__old_oer_p_};
const TTCN_Typedescriptor_t ClientEntity_tlli__old_descr_ = { "@BSSGP_Emulation.ClientEntity.tlli_old", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &ClientEntity_tlli__old_xer_, &OCTETSTRING_json_, &ClientEntity_tlli__old_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClientEntity_tlli__old_default_coding("RAW");
VALUE_ARRAY<ClientEntity, 64, 0> BSSGP__BVC__CT_component_ClientTable;
UNIVERSAL_CHARSTRING BssgpResetRequest_cause_default_coding("RAW");
// No XER for BssgpResetRequest
const TTCN_Typedescriptor_t BssgpResetRequest_descr_ = { "@BSSGP_Emulation.BssgpResetRequest", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpBlockRequest_cause_default_coding("RAW");
// No XER for BssgpBlockRequest
const TTCN_Typedescriptor_t BssgpBlockRequest_descr_ = { "@BSSGP_Emulation.BssgpBlockRequest", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for BssgpUnblockRequest
const TTCN_Typedescriptor_t BssgpUnblockRequest_descr_ = { "@BSSGP_Emulation.BssgpUnblockRequest", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for LLC__Entities
const TTCN_Typedescriptor_t LLC__Entities_descr_ = { "@BSSGP_Emulation.LLC_Entities", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &LLC__Entity_descr_, TTCN_Typedescriptor_t::DONTCARE };
BSSGP__Types::PDU__BSSGP_template template_tr__GLOBAL__PTP;
const BSSGP__Types::PDU__BSSGP_template& tr__GLOBAL__PTP = template_tr__GLOBAL__PTP;
BOOLEAN const_f__llc__create_sgsn__role_defval;
const BOOLEAN& f__llc__create_sgsn__role_defval = const_f__llc__create_sgsn__role_defval;
BOOLEAN const_t__LLC__init_sgsn__role_defval;
const BOOLEAN& t__LLC__init_sgsn__role_defval = const_t__LLC__init_sgsn__role_defval;
Osmocom__Gb__Types::BssgpCause const_f__ptp__sendReset_cause_defval;
const Osmocom__Gb__Types::BssgpCause& f__ptp__sendReset_cause_defval = const_f__ptp__sendReset_cause_defval;
TTCN_Module module_object("BSSGP_Emulation", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

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

/* Member functions of C++ classes */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const char *BvcState::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case BVC__S__WAIT__RESET: return "BVC_S_WAIT_RESET";
case BVC__S__WAIT__NS__ALIVE__UNBLOCKED: return "BVC_S_WAIT_NS_ALIVE_UNBLOCKED";
case BVC__S__BLOCKED: return "BVC_S_BLOCKED";
case BVC__S__UNBLOCKED: return "BVC_S_UNBLOCKED";
default:
return "<unknown>";
}
}

BvcState::enum_type BvcState::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "BVC_S_WAIT_RESET")) return BVC__S__WAIT__RESET;
if (!strcmp(str_par, "BVC_S_WAIT_NS_ALIVE_UNBLOCKED")) return BVC__S__WAIT__NS__ALIVE__UNBLOCKED;
if (!strcmp(str_par, "BVC_S_BLOCKED")) return BVC__S__BLOCKED;
if (!strcmp(str_par, "BVC_S_UNBLOCKED")) return BVC__S__UNBLOCKED;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

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

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

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

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

void BvcState_template::copy_template(const BvcState_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BvcState_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 BvcState_template(*other_value.implication_.precondition);
implication_.implied_template = new BvcState_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @BSSGP_Emulation.BvcState.");
}
}

BvcState_template::BvcState_template()
{
}

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

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

BvcState_template::BvcState_template(BvcState::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BvcState_template::match(BvcState::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @BSSGP_Emulation.BvcState.");
}
return FALSE;
}

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

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

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

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

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

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

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

void BvcState_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (BvcState::enum_type)text_buf.pull_int().get_val();
if (!BvcState::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @BSSGP_Emulation.BvcState.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BvcState_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @BSSGP_Emulation.BvcState.");
}
}

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

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

void BvcState_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    BvcState_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    BvcState::enum_type enum_val = BvcState::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!BvcState::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @BSSGP_Emulation.BvcState.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    BvcState_template* precondition = new BvcState_template;
    precondition->set_param(*m_p->get_elem(0));
    BvcState_template* implied_template = new BvcState_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = BvcState_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@BSSGP_Emulation.BvcState");
  }
  is_ifpresent = param.get_ifpresent();
}

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

BssgpStatusIndication::BssgpStatusIndication()
{
}

BssgpStatusIndication::BssgpStatusIndication(const OPTIONAL< INTEGER >& par_nsei,
    const INTEGER& par_bvci,
    const BvcState& par_state)
  :   field_nsei(par_nsei),
  field_bvci(par_bvci),
  field_state(par_state)
{
}

BssgpStatusIndication::BssgpStatusIndication(const BssgpStatusIndication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpStatusIndication.");
if (other_value.nsei().is_bound()) field_nsei = other_value.nsei();
else field_nsei.clean_up();
if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
else field_bvci.clean_up();
if (other_value.state().is_bound()) field_state = other_value.state();
else field_state.clean_up();
}

void BssgpStatusIndication::clean_up()
{
field_nsei.clean_up();
field_bvci.clean_up();
field_state.clean_up();
}

const TTCN_Typedescriptor_t* BssgpStatusIndication::get_descriptor() const { return &BssgpStatusIndication_descr_; }
BssgpStatusIndication& BssgpStatusIndication::operator=(const BssgpStatusIndication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpStatusIndication.");
  if (other_value.nsei().is_bound()) field_nsei = other_value.nsei();
  else field_nsei.clean_up();
  if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
  else field_bvci.clean_up();
  if (other_value.state().is_bound()) field_state = other_value.state();
  else field_state.clean_up();
}
return *this;
}

boolean BssgpStatusIndication::operator==(const BssgpStatusIndication& other_value) const
{
return field_nsei==other_value.field_nsei
  && field_bvci==other_value.field_bvci
  && field_state==other_value.field_state;
}

boolean BssgpStatusIndication::is_bound() const
{
return (OPTIONAL_OMIT == field_nsei.get_selection() || field_nsei.is_bound())
  || (field_bvci.is_bound())
  || (field_state.is_bound());
}
boolean BssgpStatusIndication::is_value() const
{
return (OPTIONAL_OMIT == field_nsei.get_selection() || field_nsei.is_value())
  && field_bvci.is_value()
  && field_state.is_value();
}
int BssgpStatusIndication::size_of() const
{
  int ret_val = 2;
  if (field_nsei.ispresent()) ret_val++;
  return ret_val;
}

void BssgpStatusIndication::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ nsei := ");
field_nsei.log();
TTCN_Logger::log_event_str(", bvci := ");
field_bvci.log();
TTCN_Logger::log_event_str(", state := ");
field_state.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpStatusIndication::set_implicit_omit()
{
if (!nsei().is_bound()) nsei() = OMIT_VALUE;
else nsei().set_implicit_omit();
if (bvci().is_bound()) bvci().set_implicit_omit();
if (state().is_bound()) state().set_implicit_omit();
}

void BssgpStatusIndication::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 @BSSGP_Emulation.BssgpStatusIndication 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) nsei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bvci().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) state().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(), "nsei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsei().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(), "bvci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvci().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(), "state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          state().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Emulation.BssgpStatusIndication: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.BssgpStatusIndication");
  }
}

void BssgpStatusIndication::encode_text(Text_Buf& text_buf) const
{
field_nsei.encode_text(text_buf);
field_bvci.encode_text(text_buf);
field_state.encode_text(text_buf);
}

void BssgpStatusIndication::decode_text(Text_Buf& text_buf)
{
field_nsei.decode_text(text_buf);
field_bvci.decode_text(text_buf);
field_state.decode_text(text_buf);
}

struct BssgpStatusIndication_template::single_value_struct {
INTEGER_template field_nsei;
INTEGER_template field_bvci;
BvcState_template field_state;
};

void BssgpStatusIndication_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_nsei = ANY_OR_OMIT;
single_value->field_bvci = ANY_VALUE;
single_value->field_state = ANY_VALUE;
}
}
}

void BssgpStatusIndication_template::copy_value(const BssgpStatusIndication& other_value)
{
single_value = new single_value_struct;
if (other_value.nsei().is_bound()) {
  if (other_value.nsei().ispresent()) single_value->field_nsei = other_value.nsei()();
  else single_value->field_nsei = OMIT_VALUE;
} else {
  single_value->field_nsei.clean_up();
}
if (other_value.bvci().is_bound()) {
  single_value->field_bvci = other_value.bvci();
} else {
  single_value->field_bvci.clean_up();
}
if (other_value.state().is_bound()) {
  single_value->field_state = other_value.state();
} else {
  single_value->field_state.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpStatusIndication_template::copy_template(const BssgpStatusIndication_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.nsei().get_selection()) {
single_value->field_nsei = other_value.nsei();
} else {
single_value->field_nsei.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bvci().get_selection()) {
single_value->field_bvci = other_value.bvci();
} else {
single_value->field_bvci.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.state().get_selection()) {
single_value->field_state = other_value.state();
} else {
single_value->field_state.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BssgpStatusIndication_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 BssgpStatusIndication_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpStatusIndication_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 @BSSGP_Emulation.BssgpStatusIndication.");
break;
}
set_selection(other_value);
}

BssgpStatusIndication_template::BssgpStatusIndication_template()
{
}

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

BssgpStatusIndication_template::BssgpStatusIndication_template(const BssgpStatusIndication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpStatusIndication_template::match(const BssgpStatusIndication& 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.nsei().is_bound()) return FALSE;
if((other_value.nsei().ispresent() ? !single_value->field_nsei.match((const INTEGER&)other_value.nsei(), legacy) : !single_value->field_nsei.match_omit(legacy)))return FALSE;
if(!other_value.bvci().is_bound()) return FALSE;
if(!single_value->field_bvci.match(other_value.bvci(), legacy))return FALSE;
if(!other_value.state().is_bound()) return FALSE;
if(!single_value->field_state.match(other_value.state(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpStatusIndication.");
}
return FALSE;
}

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

boolean BssgpStatusIndication_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_nsei.is_omit() || single_value->field_nsei.is_value())
 && single_value->field_bvci.is_value()
 && single_value->field_state.is_value();
}

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

BssgpStatusIndication BssgpStatusIndication_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 @BSSGP_Emulation.BssgpStatusIndication.");
BssgpStatusIndication ret_val;
if (single_value->field_nsei.is_omit()) ret_val.nsei() = OMIT_VALUE;
else if (single_value->field_nsei.is_bound()) {
ret_val.nsei() = single_value->field_nsei.valueof();
}
if (single_value->field_bvci.is_bound()) {
ret_val.bvci() = single_value->field_bvci.valueof();
}
if (single_value->field_state.is_bound()) {
ret_val.state() = single_value->field_state.valueof();
}
return ret_val;
}

void BssgpStatusIndication_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 @BSSGP_Emulation.BssgpStatusIndication.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpStatusIndication_template[list_length];
}

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

INTEGER_template& BssgpStatusIndication_template::nsei()
{
set_specific();
return single_value->field_nsei;
}

const INTEGER_template& BssgpStatusIndication_template::nsei() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsei of a non-specific template of type @BSSGP_Emulation.BssgpStatusIndication.");
return single_value->field_nsei;
}

INTEGER_template& BssgpStatusIndication_template::bvci()
{
set_specific();
return single_value->field_bvci;
}

const INTEGER_template& BssgpStatusIndication_template::bvci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bvci of a non-specific template of type @BSSGP_Emulation.BssgpStatusIndication.");
return single_value->field_bvci;
}

BvcState_template& BssgpStatusIndication_template::state()
{
set_specific();
return single_value->field_state;
}

const BvcState_template& BssgpStatusIndication_template::state() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field state of a non-specific template of type @BSSGP_Emulation.BssgpStatusIndication.");
return single_value->field_state;
}

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

void BssgpStatusIndication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ nsei := ");
single_value->field_nsei.log();
TTCN_Logger::log_event_str(", bvci := ");
single_value->field_bvci.log();
TTCN_Logger::log_event_str(", state := ");
single_value->field_state.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void BssgpStatusIndication_template::log_match(const BssgpStatusIndication& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.nsei().ispresent()){
if(!single_value->field_nsei.match(match_value.nsei(), legacy)){
TTCN_Logger::log_logmatch_info(".nsei");
single_value->field_nsei.log_match(match_value.nsei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_nsei.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".nsei := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_nsei.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_bvci.match(match_value.bvci(), legacy)){
TTCN_Logger::log_logmatch_info(".bvci");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_state.match(match_value.state(), legacy)){
TTCN_Logger::log_logmatch_info(".state");
single_value->field_state.log_match(match_value.state(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ nsei := ");
if (match_value.nsei().ispresent()) {
single_value->field_nsei.log_match(match_value.nsei(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_nsei.log();
if (single_value->field_nsei.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bvci := ");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::log_event_str(", state := ");
single_value->field_state.log_match(match_value.state(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void BssgpStatusIndication_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!nsei().is_bound()) nsei() = OMIT_VALUE;
else nsei().set_implicit_omit();
if (bvci().is_bound()) bvci().set_implicit_omit();
if (state().is_bound()) state().set_implicit_omit();
}

void BssgpStatusIndication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_nsei.encode_text(text_buf);
single_value->field_bvci.encode_text(text_buf);
single_value->field_state.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpStatusIndication.");
}
}

void BssgpStatusIndication_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_nsei.decode_text(text_buf);
single_value->field_bvci.decode_text(text_buf);
single_value->field_state.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BssgpStatusIndication_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 @BSSGP_Emulation.BssgpStatusIndication.");
}
}

void BssgpStatusIndication_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: {
    BssgpStatusIndication_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 @BSSGP_Emulation.BssgpStatusIndication 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) nsei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bvci().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) state().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(), "nsei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsei().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(), "bvci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvci().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(), "state")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          state().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Emulation.BssgpStatusIndication: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpStatusIndication_template* precondition = new BssgpStatusIndication_template;
    precondition->set_param(*param.get_elem(0));
    BssgpStatusIndication_template* implied_template = new BssgpStatusIndication_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpStatusIndication_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.BssgpStatusIndication");
  }
  is_ifpresent = param.get_ifpresent();
}

void BssgpStatusIndication_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_nsei.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpStatusIndication");
single_value->field_bvci.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpStatusIndication");
single_value->field_state.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpStatusIndication");
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 : "@BSSGP_Emulation.BssgpStatusIndication");
}

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

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

BssgpResetIndication::BssgpResetIndication()
{
}

BssgpResetIndication::BssgpResetIndication(const INTEGER& par_bvci)
  :   field_bvci(par_bvci)
{
}

BssgpResetIndication::BssgpResetIndication(const BssgpResetIndication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpResetIndication.");
if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
else field_bvci.clean_up();
}

void BssgpResetIndication::clean_up()
{
field_bvci.clean_up();
}

const TTCN_Typedescriptor_t* BssgpResetIndication::get_descriptor() const { return &BssgpResetIndication_descr_; }
BssgpResetIndication& BssgpResetIndication::operator=(const BssgpResetIndication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpResetIndication.");
  if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
  else field_bvci.clean_up();
}
return *this;
}

boolean BssgpResetIndication::operator==(const BssgpResetIndication& other_value) const
{
return field_bvci==other_value.field_bvci;
}

boolean BssgpResetIndication::is_bound() const
{
return (field_bvci.is_bound());
}
boolean BssgpResetIndication::is_value() const
{
return field_bvci.is_value();
}
void BssgpResetIndication::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bvci := ");
field_bvci.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpResetIndication::set_implicit_omit()
{
if (bvci().is_bound()) bvci().set_implicit_omit();
}

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

void BssgpResetIndication::encode_text(Text_Buf& text_buf) const
{
field_bvci.encode_text(text_buf);
}

void BssgpResetIndication::decode_text(Text_Buf& text_buf)
{
field_bvci.decode_text(text_buf);
}

struct BssgpResetIndication_template::single_value_struct {
INTEGER_template field_bvci;
};

void BssgpResetIndication_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_bvci = ANY_VALUE;
}
}
}

void BssgpResetIndication_template::copy_value(const BssgpResetIndication& other_value)
{
single_value = new single_value_struct;
if (other_value.bvci().is_bound()) {
  single_value->field_bvci = other_value.bvci();
} else {
  single_value->field_bvci.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpResetIndication_template::copy_template(const BssgpResetIndication_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bvci().get_selection()) {
single_value->field_bvci = other_value.bvci();
} else {
single_value->field_bvci.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 BssgpResetIndication_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 BssgpResetIndication_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpResetIndication_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 @BSSGP_Emulation.BssgpResetIndication.");
break;
}
set_selection(other_value);
}

BssgpResetIndication_template::BssgpResetIndication_template()
{
}

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

BssgpResetIndication_template::BssgpResetIndication_template(const BssgpResetIndication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpResetIndication_template::match(const BssgpResetIndication& 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.bvci().is_bound()) return FALSE;
if(!single_value->field_bvci.match(other_value.bvci(), 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 @BSSGP_Emulation.BssgpResetIndication.");
}
return FALSE;
}

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

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

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

BssgpResetIndication BssgpResetIndication_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 @BSSGP_Emulation.BssgpResetIndication.");
BssgpResetIndication ret_val;
if (single_value->field_bvci.is_bound()) {
ret_val.bvci() = single_value->field_bvci.valueof();
}
return ret_val;
}

void BssgpResetIndication_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 @BSSGP_Emulation.BssgpResetIndication.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpResetIndication_template[list_length];
}

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

INTEGER_template& BssgpResetIndication_template::bvci()
{
set_specific();
return single_value->field_bvci;
}

const INTEGER_template& BssgpResetIndication_template::bvci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bvci of a non-specific template of type @BSSGP_Emulation.BssgpResetIndication.");
return single_value->field_bvci;
}

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

void BssgpResetIndication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bvci := ");
single_value->field_bvci.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 BssgpResetIndication_template::log_match(const BssgpResetIndication& 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_bvci.match(match_value.bvci(), legacy)){
TTCN_Logger::log_logmatch_info(".bvci");
single_value->field_bvci.log_match(match_value.bvci(), 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("{ bvci := ");
single_value->field_bvci.log_match(match_value.bvci(), 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 BssgpResetIndication_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bvci().is_bound()) bvci().set_implicit_omit();
}

void BssgpResetIndication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bvci.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 @BSSGP_Emulation.BssgpResetIndication.");
}
}

void BssgpResetIndication_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_bvci.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 BssgpResetIndication_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 @BSSGP_Emulation.BssgpResetIndication.");
}
}

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

void BssgpResetIndication_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_bvci.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpResetIndication");
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 : "@BSSGP_Emulation.BssgpResetIndication");
}

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

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

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

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

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

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

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

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

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

void BSSGP__SP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const LLC__Types::PDU__LLC_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const LLC__Types::PDU__LLC_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const LLC__Types::PDU__LLC_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const SNDCP__Types::PDU__SN_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const SNDCP__Types::PDU__SN& send_par_value = SNDCP__Types::PDU__SN(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const SNDCP__Types::PDU__SN_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const SNDCP__Types::PDU__SN& send_par_value = SNDCP__Types::PDU__SN(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const SNDCP__Types::PDU__SN_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const SNDCP__Types::PDU__SN& send_par_value = SNDCP__Types::PDU__SN(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const NS__Emulation::NsStatusIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsStatusIndication& send_par_value = NS__Emulation::NsStatusIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const NS__Emulation::NsStatusIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsStatusIndication& send_par_value = NS__Emulation::NsStatusIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const NS__Emulation::NsStatusIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsStatusIndication& send_par_value = NS__Emulation::NsStatusIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const BssgpStatusIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const BssgpStatusIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const BssgpStatusIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__SP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__SP__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@BSSGP_Types.PDU_BSSGP")) {
BSSGP__Types::PDU__BSSGP incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@LLC_Types.PDU_LLC")) {
LLC__Types::PDU__LLC incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@MobileL3_Types.PDU_L3_MS_SGSN")) {
MobileL3__Types::PDU__L3__MS__SGSN incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@MobileL3_Types.PDU_L3_SGSN_MS")) {
MobileL3__Types::PDU__L3__SGSN__MS incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

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

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

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

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

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

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

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

void BSSGP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__PT::send(const BSSGP__Types::PDU__BSSGP_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BSSGP__Types::PDU__BSSGP& send_par_value = BSSGP__Types::PDU__BSSGP(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__PT::send(const LLC__Types::PDU__LLC_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__PT::send(const LLC__Types::PDU__LLC_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__PT::send(const LLC__Types::PDU__LLC_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const LLC__Types::PDU__LLC& send_par_value = LLC__Types::PDU__LLC(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__SGSN__MS_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__SGSN__MS& send_par_value = MobileL3__Types::PDU__L3__SGSN__MS(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__PT::send(const MobileL3__Types::PDU__L3__MS__SGSN_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const MobileL3__Types::PDU__L3__MS__SGSN& send_par_value = MobileL3__Types::PDU__L3__MS__SGSN(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status BSSGP__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @Socket_API_Definitions.PortEvent: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @NS_Emulation.NsStatusIndication: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Emulation.BssgpStatusIndication: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Types.PDU_BSSGP: "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_4:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LLC_Types.PDU_LLC: "),
my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_5:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @SNDCP_Types.PDU_SN: "),
my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_6:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_MS_SGSN: "),
my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_7:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_SGSN_MS: "),
my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status BSSGP__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @Socket_API_Definitions.PortEvent: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @NS_Emulation.NsStatusIndication: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Emulation.BssgpStatusIndication: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Types.PDU_BSSGP: "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_4:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LLC_Types.PDU_LLC: "),
my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_5:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @SNDCP_Types.PDU_SN: "),
my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_6:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_MS_SGSN: "),
my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_7:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_SGSN_MS: "),
my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status BSSGP__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @Socket_API_Definitions.PortEvent: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @NS_Emulation.NsStatusIndication: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_2:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Emulation.BssgpStatusIndication: "),
my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_3:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @BSSGP_Types.PDU_BSSGP: "),
my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_4:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LLC_Types.PDU_LLC: "),
my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_5:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @SNDCP_Types.PDU_SN: "),
my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_6:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_MS_SGSN: "),
my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_7:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @MobileL3_Types.PDU_L3_SGSN_MS: "),
my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@Socket_API_Definitions.PortEvent")) {
Socket__API__Definitions::PortEvent incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@NS_Emulation.NsStatusIndication")) {
NS__Emulation::NsStatusIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpStatusIndication")) {
BssgpStatusIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Types.PDU_BSSGP")) {
BSSGP__Types::PDU__BSSGP incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@LLC_Types.PDU_LLC")) {
LLC__Types::PDU__LLC incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@SNDCP_Types.PDU_SN")) {
SNDCP__Types::PDU__SN incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@MobileL3_Types.PDU_L3_MS_SGSN")) {
MobileL3__Types::PDU__L3__MS__SGSN incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@MobileL3_Types.PDU_L3_SGSN_MS")) {
MobileL3__Types::PDU__L3__SGSN__MS incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void BSSGP__register__client_call::encode_text(Text_Buf& text_buf) const
{
param_imsi.encode_text(text_buf);
param_tlli.encode_text(text_buf);
}

void BSSGP__register__client_call::decode_text(Text_Buf& text_buf)
{
param_imsi.decode_text(text_buf);
param_tlli.decode_text(text_buf);
}

void BSSGP__register__client_call::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_register_client : { ");
TTCN_Logger::log_event_str("imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__register__client_call_redirect::set_parameters(const BSSGP__register__client_call& call_par) const
{
if (ptr_imsi != NULL) *ptr_imsi = call_par.imsi();
if (ptr_tlli != NULL) *ptr_tlli = call_par.tlli();
}

void BSSGP__register__client_reply::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_register_client : { }");
}

BSSGP__register__client_template::BSSGP__register__client_template()
 : param_imsi(ANY_VALUE), param_tlli(ANY_VALUE)
{
}

BSSGP__register__client_call BSSGP__register__client_template::create_call() const
{
BSSGP__register__client_call ret_val;
ret_val.imsi() = param_imsi.valueof();
ret_val.tlli() = param_tlli.valueof();
return ret_val;
}

boolean BSSGP__register__client_template::match_call(const BSSGP__register__client_call& match_value, boolean legacy) const
{
return param_imsi.match(match_value.imsi(), legacy) &&
param_tlli.match(match_value.tlli(), legacy);
}

void BSSGP__register__client_template::log() const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__register__client_template::log_match_call(const BSSGP__register__client_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log_match(match_value.tlli(), legacy);
TTCN_Logger::log_event_str(" }");
}

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

void BSSGP__register__client_template::encode_text(Text_Buf& text_buf) const
{
param_imsi.encode_text(text_buf);
param_tlli.encode_text(text_buf);
}

void BSSGP__register__client_template::decode_text(Text_Buf& text_buf)
{
param_imsi.decode_text(text_buf);
param_tlli.decode_text(text_buf);
}

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

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

void BSSGP__unregister__client_call::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_unregister_client : { ");
TTCN_Logger::log_event_str("imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__unregister__client_call_redirect::set_parameters(const BSSGP__unregister__client_call& call_par) const
{
if (ptr_imsi != NULL) *ptr_imsi = call_par.imsi();
}

void BSSGP__unregister__client_reply::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_unregister_client : { }");
}

BSSGP__unregister__client_template::BSSGP__unregister__client_template()
 : param_imsi(ANY_VALUE)
{
}

BSSGP__unregister__client_call BSSGP__unregister__client_template::create_call() const
{
BSSGP__unregister__client_call ret_val;
ret_val.imsi() = param_imsi.valueof();
return ret_val;
}

boolean BSSGP__unregister__client_template::match_call(const BSSGP__unregister__client_call& match_value, boolean legacy) const
{
return param_imsi.match(match_value.imsi(), legacy);
}

void BSSGP__unregister__client_template::log() const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__unregister__client_template::log_match_call(const BSSGP__unregister__client_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ imsi := ");
param_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(" }");
}

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

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

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

void BSSGP__llgmm__assign_call::encode_text(Text_Buf& text_buf) const
{
param_tlli__old.encode_text(text_buf);
param_tlli.encode_text(text_buf);
}

void BSSGP__llgmm__assign_call::decode_text(Text_Buf& text_buf)
{
param_tlli__old.decode_text(text_buf);
param_tlli.decode_text(text_buf);
}

void BSSGP__llgmm__assign_call::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_llgmm_assign : { ");
TTCN_Logger::log_event_str("tlli_old := ");
param_tlli__old.log();
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__llgmm__assign_call_redirect::set_parameters(const BSSGP__llgmm__assign_call& call_par) const
{
if (ptr_tlli__old != NULL) *ptr_tlli__old = call_par.tlli__old();
if (ptr_tlli != NULL) *ptr_tlli = call_par.tlli();
}

void BSSGP__llgmm__assign_reply::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_llgmm_assign : { }");
}

BSSGP__llgmm__assign_template::BSSGP__llgmm__assign_template()
 : param_tlli__old(ANY_VALUE), param_tlli(ANY_VALUE)
{
}

BSSGP__llgmm__assign_call BSSGP__llgmm__assign_template::create_call() const
{
BSSGP__llgmm__assign_call ret_val;
ret_val.tlli__old() = param_tlli__old.valueof();
ret_val.tlli() = param_tlli.valueof();
return ret_val;
}

boolean BSSGP__llgmm__assign_template::match_call(const BSSGP__llgmm__assign_call& match_value, boolean legacy) const
{
return param_tlli__old.match(match_value.tlli__old(), legacy) &&
param_tlli.match(match_value.tlli(), legacy);
}

void BSSGP__llgmm__assign_template::log() const
{
TTCN_Logger::log_event_str("{ tlli_old := ");
param_tlli__old.log();
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__llgmm__assign_template::log_match_call(const BSSGP__llgmm__assign_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ tlli_old := ");
param_tlli__old.log_match(match_value.tlli__old(), legacy);
TTCN_Logger::log_event_str(", tlli := ");
param_tlli.log_match(match_value.tlli(), legacy);
TTCN_Logger::log_event_str(" }");
}

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

void BSSGP__llgmm__assign_template::encode_text(Text_Buf& text_buf) const
{
param_tlli__old.encode_text(text_buf);
param_tlli.encode_text(text_buf);
}

void BSSGP__llgmm__assign_template::decode_text(Text_Buf& text_buf)
{
param_tlli__old.decode_text(text_buf);
param_tlli.decode_text(text_buf);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__PROC__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_register_client")) {
BSSGP__register__client_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_unregister_client")) {
BSSGP__unregister__client_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_llgmm_assign")) {
BSSGP__llgmm__assign_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

boolean BSSGP__PROC__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_register_client")) {
BSSGP__register__client_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_unregister_client")) {
BSSGP__unregister__client_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_llgmm_assign")) {
BSSGP__llgmm__assign_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}


const BssgpBvcConfig BssgpBvcConfigs::UNBOUND_ELEM;
BssgpBvcConfigs::BssgpBvcConfigs()
{
val_ptr = NULL;
}

BssgpBvcConfigs::BssgpBvcConfigs(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

BssgpBvcConfigs::BssgpBvcConfigs(const BssgpBvcConfigs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

BssgpBvcConfigs::~BssgpBvcConfigs()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void BssgpBvcConfigs::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

BssgpBvcConfigs& BssgpBvcConfigs::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

BssgpBvcConfigs& BssgpBvcConfigs::operator=(const BssgpBvcConfigs& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean BssgpBvcConfigs::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
return val_ptr->n_elements == 0 ;
}

boolean BssgpBvcConfigs::operator==(const BssgpBvcConfigs& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

BssgpBvcConfig& BssgpBvcConfigs::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Emulation.BssgpBvcConfigs using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (BssgpBvcConfig**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new BssgpBvcConfig(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new BssgpBvcConfig;
}
return *val_ptr->value_elements[index_value];
}

BssgpBvcConfig& BssgpBvcConfigs::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Emulation.BssgpBvcConfigs.");
return (*this)[(int)index_value];
}

const BssgpBvcConfig& BssgpBvcConfigs::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Emulation.BssgpBvcConfigs using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BSSGP_Emulation.BssgpBvcConfigs: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const BssgpBvcConfig& BssgpBvcConfigs::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Emulation.BssgpBvcConfigs.");
return (*this)[(int)index_value];
}

BssgpBvcConfigs BssgpBvcConfigs::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

BssgpBvcConfigs BssgpBvcConfigs::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

BssgpBvcConfigs BssgpBvcConfigs::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

BssgpBvcConfigs BssgpBvcConfigs::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
BssgpBvcConfigs ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new BssgpBvcConfig(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

BssgpBvcConfigs BssgpBvcConfigs::operator+(const BssgpBvcConfigs& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Emulation.BssgpBvcConfigs concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
BssgpBvcConfigs ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new BssgpBvcConfig(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new BssgpBvcConfig(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

BssgpBvcConfigs BssgpBvcConfigs::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Emulation.BssgpBvcConfigs","element");
BssgpBvcConfigs ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new BssgpBvcConfig(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

BssgpBvcConfigs BssgpBvcConfigs::replace(int index, int len, const BssgpBvcConfigs& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Emulation.BssgpBvcConfigs","element");
BssgpBvcConfigs ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new BssgpBvcConfig(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new BssgpBvcConfig(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new BssgpBvcConfig(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

BssgpBvcConfigs BssgpBvcConfigs::replace(int index, int len, const BssgpBvcConfigs_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void BssgpBvcConfigs::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Emulation.BssgpBvcConfigs.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (BssgpBvcConfig**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new BssgpBvcConfig(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (BssgpBvcConfig**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BSSGP_Emulation.BssgpBvcConfigs: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (BssgpBvcConfig**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean BssgpBvcConfigs::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int BssgpBvcConfigs::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
return val_ptr->n_elements;
}

int BssgpBvcConfigs::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void BssgpBvcConfigs::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void BssgpBvcConfigs::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void BssgpBvcConfigs::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BSSGP_Emulation.BssgpBvcConfigs");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BSSGP_Emulation.BssgpBvcConfigs");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void BssgpBvcConfigs::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void BssgpBvcConfigs::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BSSGP_Emulation.BssgpBvcConfigs.");
val_ptr->value_elements = (BssgpBvcConfig**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new BssgpBvcConfig;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void BssgpBvcConfigs_template::copy_value(const BssgpBvcConfigs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Emulation.BssgpBvcConfigs with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (BssgpBvcConfig_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new BssgpBvcConfig_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new BssgpBvcConfig_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void BssgpBvcConfigs_template::copy_template(const BssgpBvcConfigs_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (BssgpBvcConfig_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new BssgpBvcConfig_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new BssgpBvcConfig_template;
}
}
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 BssgpBvcConfigs_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 BssgpBvcConfigs_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpBvcConfigs_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 @BSSGP_Emulation.BssgpBvcConfigs.");
break;
}
set_selection(other_value);
}

boolean BssgpBvcConfigs_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const BssgpBvcConfigs_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const BssgpBvcConfigs*)value_ptr)[value_index], legacy);
else return ((const BssgpBvcConfigs_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

BssgpBvcConfigs_template::BssgpBvcConfigs_template()
{
}

BssgpBvcConfigs_template::BssgpBvcConfigs_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

BssgpBvcConfigs_template::BssgpBvcConfigs_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

BssgpBvcConfigs_template::BssgpBvcConfigs_template(const BssgpBvcConfigs& other_value)
{
copy_value(other_value);
}

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

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

BssgpBvcConfigs_template::BssgpBvcConfigs_template(Dynamic_Match_Interface<BssgpBvcConfigs>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<BssgpBvcConfigs>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

BssgpBvcConfigs_template::BssgpBvcConfigs_template(const BssgpBvcConfigs_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

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

void BssgpBvcConfigs_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
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;
}

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

BssgpBvcConfigs_template& BssgpBvcConfigs_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

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

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

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

BssgpBvcConfig_template& BssgpBvcConfigs_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Emulation.BssgpBvcConfigs using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Emulation.BssgpBvcConfigs.");
    break;
}
return *single_value.value_elements[index_value];
}

BssgpBvcConfig_template& BssgpBvcConfigs_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Emulation.BssgpBvcConfigs.");
return (*this)[(int)index_value];
}

const BssgpBvcConfig_template& BssgpBvcConfigs_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Emulation.BssgpBvcConfigs using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Emulation.BssgpBvcConfigs.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Emulation.BssgpBvcConfigs: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const BssgpBvcConfig_template& BssgpBvcConfigs_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Emulation.BssgpBvcConfigs.");
return (*this)[(int)index_value];
}

void BssgpBvcConfigs_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BSSGP_Emulation.BssgpBvcConfigs.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (BssgpBvcConfig_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new BssgpBvcConfig_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new BssgpBvcConfig_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (BssgpBvcConfig_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int BssgpBvcConfigs_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int BssgpBvcConfigs_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.BssgpBvcConfigs containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpBvcConfigs.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Emulation.BssgpBvcConfigs");
}

boolean BssgpBvcConfigs_template::match(const BssgpBvcConfigs& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, 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 with an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpBvcConfigs.");
}
return FALSE;
}

boolean BssgpBvcConfigs_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

BssgpBvcConfigs BssgpBvcConfigs_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 @BSSGP_Emulation.BssgpBvcConfigs.");
BssgpBvcConfigs ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

BssgpBvcConfigs BssgpBvcConfigs_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

BssgpBvcConfigs BssgpBvcConfigs_template::replace(int index, int len, const BssgpBvcConfigs_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

BssgpBvcConfigs BssgpBvcConfigs_template::replace(int index, int len, const BssgpBvcConfigs& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

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

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

void BssgpBvcConfigs_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else 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_restricted();
log_ifpresent();
}

void BssgpBvcConfigs_template::log_match(const BssgpBvcConfigs& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} 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 BssgpBvcConfigs_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->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 @BSSGP_Emulation.BssgpBvcConfigs.");
}
}

void BssgpBvcConfigs_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BSSGP_Emulation.BssgpBvcConfigs.");
single_value.value_elements = (BssgpBvcConfig_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new BssgpBvcConfig_template;
single_value.value_elements[elem_count]->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 BssgpBvcConfigs_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 for a template of type @BSSGP_Emulation.BssgpBvcConfigs.");
}
}

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

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

void BssgpBvcConfigs_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void BssgpBvcConfigs_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: {
    BssgpBvcConfigs_template temp;
    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++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpBvcConfigs_template* precondition = new BssgpBvcConfigs_template;
    precondition->set_param(*param.get_elem(0));
    BssgpBvcConfigs_template* implied_template = new BssgpBvcConfigs_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpBvcConfigs_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Emulation.BssgpBvcConfigs");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void BssgpBvcConfigs_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;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBvcConfigs");
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 : "@BSSGP_Emulation.BssgpBvcConfigs");
}

boolean BssgpBvcConfigs_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
BssgpDecodeDepth::BssgpDecodeDepth()
{
enum_value = UNBOUND_VALUE;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const char *BssgpDecodeDepth::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case BSSGP__DECODE__DEPTH__BSSGP: return "BSSGP_DECODE_DEPTH_BSSGP";
case BSSGP__DECODE__DEPTH__LLC: return "BSSGP_DECODE_DEPTH_LLC";
case BSSGP__DECODE__DEPTH__SNDCP: return "BSSGP_DECODE_DEPTH_SNDCP";
case BSSGP__DECODE__DEPTH__L3: return "BSSGP_DECODE_DEPTH_L3";
default:
return "<unknown>";
}
}

BssgpDecodeDepth::enum_type BssgpDecodeDepth::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "BSSGP_DECODE_DEPTH_BSSGP")) return BSSGP__DECODE__DEPTH__BSSGP;
if (!strcmp(str_par, "BSSGP_DECODE_DEPTH_LLC")) return BSSGP__DECODE__DEPTH__LLC;
if (!strcmp(str_par, "BSSGP_DECODE_DEPTH_SNDCP")) return BSSGP__DECODE__DEPTH__SNDCP;
if (!strcmp(str_par, "BSSGP_DECODE_DEPTH_L3")) return BSSGP__DECODE__DEPTH__L3;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

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

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

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

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

void BssgpDecodeDepth_template::copy_template(const BssgpDecodeDepth_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BssgpDecodeDepth_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 BssgpDecodeDepth_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpDecodeDepth_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @BSSGP_Emulation.BssgpDecodeDepth.");
}
}

BssgpDecodeDepth_template::BssgpDecodeDepth_template()
{
}

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

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

BssgpDecodeDepth_template::BssgpDecodeDepth_template(BssgpDecodeDepth::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BssgpDecodeDepth_template::match(BssgpDecodeDepth::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @BSSGP_Emulation.BssgpDecodeDepth.");
}
return FALSE;
}

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

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

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

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

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

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

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

void BssgpDecodeDepth_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (BssgpDecodeDepth::enum_type)text_buf.pull_int().get_val();
if (!BssgpDecodeDepth::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @BSSGP_Emulation.BssgpDecodeDepth.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BssgpDecodeDepth_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @BSSGP_Emulation.BssgpDecodeDepth.");
}
}

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

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

void BssgpDecodeDepth_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    BssgpDecodeDepth_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    BssgpDecodeDepth::enum_type enum_val = BssgpDecodeDepth::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!BssgpDecodeDepth::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @BSSGP_Emulation.BssgpDecodeDepth.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpDecodeDepth_template* precondition = new BssgpDecodeDepth_template;
    precondition->set_param(*m_p->get_elem(0));
    BssgpDecodeDepth_template* implied_template = new BssgpDecodeDepth_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = BssgpDecodeDepth_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@BSSGP_Emulation.BssgpDecodeDepth");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

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

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

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

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

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

void BssgpCreateCallback::invoke(const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId& cell__id, const OCTETSTRING& tlli, const BssgpDecoded& dec) const
{
must_bound("Call of unbound function.");
if(referred_function == (BssgpCreateCallback::function_pointer)Module_List::get_fat_null())
TTCN_error("null reference cannot be invoked.");
referred_function(bvci, cell__id, tlli, dec);
}

void BssgpCreateCallback::start(const COMPONENT& component_reference, const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId& cell__id, const OCTETSTRING& tlli, const BssgpDecoded& dec) const
{
((BssgpCreateCallback::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, bvci, cell__id, tlli, dec);
}

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

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

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

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

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

void BssgpCreateCallback_template::copy_template(const BssgpCreateCallback_template& other_value)
{
switch(other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BssgpCreateCallback_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i] = other_value.value_list.list_value[i];
break;
default:
TTCN_error("Copying an unitialized/unsupported @BSSGP_Emulation.BssgpCreateCallback template.");
}
set_selection(other_value);
}

BssgpCreateCallback_template::BssgpCreateCallback_template()
{
}

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

BssgpCreateCallback_template::BssgpCreateCallback_template(BssgpCreateCallback::function_pointer other_value)
  : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

boolean BssgpCreateCallback_template::match(BssgpCreateCallback::function_pointer other_value, boolean) const
{
switch(template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for(unsigned int i = 0; i < value_list.n_values; i++)
if(value_list.list_value[i].match(other_value))
return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching with an unitialized/unsupported @BSSGP_Emulation.BssgpCreateCallback template.");
};
return FALSE;
}

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

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

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

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

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

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

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

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

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

boolean BssgpCreateCallback_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

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

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

BssgpDecoded::BssgpDecoded()
{
}

BssgpDecoded::BssgpDecoded(const BSSGP__Types::PDU__BSSGP& par_bssgp,
    const OPTIONAL< LLC__Types::PDU__LLC >& par_llc,
    const OPTIONAL< MobileL3__Types::PDU__L3__MS__SGSN >& par_l3__mo,
    const OPTIONAL< MobileL3__Types::PDU__L3__SGSN__MS >& par_l3__mt,
    const OPTIONAL< SNDCP__Types::PDU__SN >& par_sndcp)
  :   field_bssgp(par_bssgp),
  field_llc(par_llc),
  field_l3__mo(par_l3__mo),
  field_l3__mt(par_l3__mt),
  field_sndcp(par_sndcp)
{
}

BssgpDecoded::BssgpDecoded(const BssgpDecoded& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpDecoded.");
if (other_value.bssgp().is_bound()) field_bssgp = other_value.bssgp();
else field_bssgp.clean_up();
if (other_value.llc().is_bound()) field_llc = other_value.llc();
else field_llc.clean_up();
if (other_value.l3__mo().is_bound()) field_l3__mo = other_value.l3__mo();
else field_l3__mo.clean_up();
if (other_value.l3__mt().is_bound()) field_l3__mt = other_value.l3__mt();
else field_l3__mt.clean_up();
if (other_value.sndcp().is_bound()) field_sndcp = other_value.sndcp();
else field_sndcp.clean_up();
}

void BssgpDecoded::clean_up()
{
field_bssgp.clean_up();
field_llc.clean_up();
field_l3__mo.clean_up();
field_l3__mt.clean_up();
field_sndcp.clean_up();
}

const TTCN_Typedescriptor_t* BssgpDecoded::get_descriptor() const { return &BssgpDecoded_descr_; }
BssgpDecoded& BssgpDecoded::operator=(const BssgpDecoded& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpDecoded.");
  if (other_value.bssgp().is_bound()) field_bssgp = other_value.bssgp();
  else field_bssgp.clean_up();
  if (other_value.llc().is_bound()) field_llc = other_value.llc();
  else field_llc.clean_up();
  if (other_value.l3__mo().is_bound()) field_l3__mo = other_value.l3__mo();
  else field_l3__mo.clean_up();
  if (other_value.l3__mt().is_bound()) field_l3__mt = other_value.l3__mt();
  else field_l3__mt.clean_up();
  if (other_value.sndcp().is_bound()) field_sndcp = other_value.sndcp();
  else field_sndcp.clean_up();
}
return *this;
}

boolean BssgpDecoded::operator==(const BssgpDecoded& other_value) const
{
return field_bssgp==other_value.field_bssgp
  && field_llc==other_value.field_llc
  && field_l3__mo==other_value.field_l3__mo
  && field_l3__mt==other_value.field_l3__mt
  && field_sndcp==other_value.field_sndcp;
}

boolean BssgpDecoded::is_bound() const
{
return (field_bssgp.is_bound())
  || (OPTIONAL_OMIT == field_llc.get_selection() || field_llc.is_bound())
  || (OPTIONAL_OMIT == field_l3__mo.get_selection() || field_l3__mo.is_bound())
  || (OPTIONAL_OMIT == field_l3__mt.get_selection() || field_l3__mt.is_bound())
  || (OPTIONAL_OMIT == field_sndcp.get_selection() || field_sndcp.is_bound());
}
boolean BssgpDecoded::is_value() const
{
return field_bssgp.is_value()
  && (OPTIONAL_OMIT == field_llc.get_selection() || field_llc.is_value())
  && (OPTIONAL_OMIT == field_l3__mo.get_selection() || field_l3__mo.is_value())
  && (OPTIONAL_OMIT == field_l3__mt.get_selection() || field_l3__mt.is_value())
  && (OPTIONAL_OMIT == field_sndcp.get_selection() || field_sndcp.is_value());
}
int BssgpDecoded::size_of() const
{
  int ret_val = 1;
  if (field_llc.ispresent()) ret_val++;
  if (field_l3__mo.ispresent()) ret_val++;
  if (field_l3__mt.ispresent()) ret_val++;
  if (field_sndcp.ispresent()) ret_val++;
  return ret_val;
}

void BssgpDecoded::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgp := ");
field_bssgp.log();
TTCN_Logger::log_event_str(", llc := ");
field_llc.log();
TTCN_Logger::log_event_str(", l3_mo := ");
field_l3__mo.log();
TTCN_Logger::log_event_str(", l3_mt := ");
field_l3__mt.log();
TTCN_Logger::log_event_str(", sndcp := ");
field_sndcp.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpDecoded::set_implicit_omit()
{
if (bssgp().is_bound()) bssgp().set_implicit_omit();
if (!llc().is_bound()) llc() = OMIT_VALUE;
else llc().set_implicit_omit();
if (!l3__mo().is_bound()) l3__mo() = OMIT_VALUE;
else l3__mo().set_implicit_omit();
if (!l3__mt().is_bound()) l3__mt() = OMIT_VALUE;
else l3__mt().set_implicit_omit();
if (!sndcp().is_bound()) sndcp() = OMIT_VALUE;
else sndcp().set_implicit_omit();
}

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

void BssgpDecoded::encode_text(Text_Buf& text_buf) const
{
field_bssgp.encode_text(text_buf);
field_llc.encode_text(text_buf);
field_l3__mo.encode_text(text_buf);
field_l3__mt.encode_text(text_buf);
field_sndcp.encode_text(text_buf);
}

void BssgpDecoded::decode_text(Text_Buf& text_buf)
{
field_bssgp.decode_text(text_buf);
field_llc.decode_text(text_buf);
field_l3__mo.decode_text(text_buf);
field_l3__mt.decode_text(text_buf);
field_sndcp.decode_text(text_buf);
}

struct BssgpDecoded_template::single_value_struct {
BSSGP__Types::PDU__BSSGP_template field_bssgp;
LLC__Types::PDU__LLC_template field_llc;
MobileL3__Types::PDU__L3__MS__SGSN_template field_l3__mo;
MobileL3__Types::PDU__L3__SGSN__MS_template field_l3__mt;
SNDCP__Types::PDU__SN_template field_sndcp;
};

void BssgpDecoded_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_bssgp = ANY_VALUE;
single_value->field_llc = ANY_OR_OMIT;
single_value->field_l3__mo = ANY_OR_OMIT;
single_value->field_l3__mt = ANY_OR_OMIT;
single_value->field_sndcp = ANY_OR_OMIT;
}
}
}

void BssgpDecoded_template::copy_value(const BssgpDecoded& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgp().is_bound()) {
  single_value->field_bssgp = other_value.bssgp();
} else {
  single_value->field_bssgp.clean_up();
}
if (other_value.llc().is_bound()) {
  if (other_value.llc().ispresent()) single_value->field_llc = other_value.llc()();
  else single_value->field_llc = OMIT_VALUE;
} else {
  single_value->field_llc.clean_up();
}
if (other_value.l3__mo().is_bound()) {
  if (other_value.l3__mo().ispresent()) single_value->field_l3__mo = other_value.l3__mo()();
  else single_value->field_l3__mo = OMIT_VALUE;
} else {
  single_value->field_l3__mo.clean_up();
}
if (other_value.l3__mt().is_bound()) {
  if (other_value.l3__mt().ispresent()) single_value->field_l3__mt = other_value.l3__mt()();
  else single_value->field_l3__mt = OMIT_VALUE;
} else {
  single_value->field_l3__mt.clean_up();
}
if (other_value.sndcp().is_bound()) {
  if (other_value.sndcp().ispresent()) single_value->field_sndcp = other_value.sndcp()();
  else single_value->field_sndcp = OMIT_VALUE;
} else {
  single_value->field_sndcp.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpDecoded_template::copy_template(const BssgpDecoded_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgp().get_selection()) {
single_value->field_bssgp = other_value.bssgp();
} else {
single_value->field_bssgp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.llc().get_selection()) {
single_value->field_llc = other_value.llc();
} else {
single_value->field_llc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.l3__mo().get_selection()) {
single_value->field_l3__mo = other_value.l3__mo();
} else {
single_value->field_l3__mo.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.l3__mt().get_selection()) {
single_value->field_l3__mt = other_value.l3__mt();
} else {
single_value->field_l3__mt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sndcp().get_selection()) {
single_value->field_sndcp = other_value.sndcp();
} else {
single_value->field_sndcp.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 BssgpDecoded_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 BssgpDecoded_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpDecoded_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 @BSSGP_Emulation.BssgpDecoded.");
break;
}
set_selection(other_value);
}

BssgpDecoded_template::BssgpDecoded_template()
{
}

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

BssgpDecoded_template::BssgpDecoded_template(const BssgpDecoded& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpDecoded_template::match(const BssgpDecoded& 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.bssgp().is_bound()) return FALSE;
if(!single_value->field_bssgp.match(other_value.bssgp(), legacy))return FALSE;
if(!other_value.llc().is_bound()) return FALSE;
if((other_value.llc().ispresent() ? !single_value->field_llc.match((const LLC__Types::PDU__LLC&)other_value.llc(), legacy) : !single_value->field_llc.match_omit(legacy)))return FALSE;
if(!other_value.l3__mo().is_bound()) return FALSE;
if((other_value.l3__mo().ispresent() ? !single_value->field_l3__mo.match((const MobileL3__Types::PDU__L3__MS__SGSN&)other_value.l3__mo(), legacy) : !single_value->field_l3__mo.match_omit(legacy)))return FALSE;
if(!other_value.l3__mt().is_bound()) return FALSE;
if((other_value.l3__mt().ispresent() ? !single_value->field_l3__mt.match((const MobileL3__Types::PDU__L3__SGSN__MS&)other_value.l3__mt(), legacy) : !single_value->field_l3__mt.match_omit(legacy)))return FALSE;
if(!other_value.sndcp().is_bound()) return FALSE;
if((other_value.sndcp().ispresent() ? !single_value->field_sndcp.match((const SNDCP__Types::PDU__SN&)other_value.sndcp(), legacy) : !single_value->field_sndcp.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpDecoded.");
}
return FALSE;
}

boolean BssgpDecoded_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgp.is_bound()
 || (single_value->field_llc.is_omit() || single_value->field_llc.is_bound())
 || (single_value->field_l3__mo.is_omit() || single_value->field_l3__mo.is_bound())
 || (single_value->field_l3__mt.is_omit() || single_value->field_l3__mt.is_bound())
 || (single_value->field_sndcp.is_omit() || single_value->field_sndcp.is_bound());
}

boolean BssgpDecoded_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgp.is_value()
 && (single_value->field_llc.is_omit() || single_value->field_llc.is_value())
 && (single_value->field_l3__mo.is_omit() || single_value->field_l3__mo.is_value())
 && (single_value->field_l3__mt.is_omit() || single_value->field_l3__mt.is_value())
 && (single_value->field_sndcp.is_omit() || single_value->field_sndcp.is_value());
}

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

BssgpDecoded BssgpDecoded_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 @BSSGP_Emulation.BssgpDecoded.");
BssgpDecoded ret_val;
if (single_value->field_bssgp.is_bound()) {
ret_val.bssgp() = single_value->field_bssgp.valueof();
}
if (single_value->field_llc.is_omit()) ret_val.llc() = OMIT_VALUE;
else if (single_value->field_llc.is_bound()) {
ret_val.llc() = single_value->field_llc.valueof();
}
if (single_value->field_l3__mo.is_omit()) ret_val.l3__mo() = OMIT_VALUE;
else if (single_value->field_l3__mo.is_bound()) {
ret_val.l3__mo() = single_value->field_l3__mo.valueof();
}
if (single_value->field_l3__mt.is_omit()) ret_val.l3__mt() = OMIT_VALUE;
else if (single_value->field_l3__mt.is_bound()) {
ret_val.l3__mt() = single_value->field_l3__mt.valueof();
}
if (single_value->field_sndcp.is_omit()) ret_val.sndcp() = OMIT_VALUE;
else if (single_value->field_sndcp.is_bound()) {
ret_val.sndcp() = single_value->field_sndcp.valueof();
}
return ret_val;
}

void BssgpDecoded_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 @BSSGP_Emulation.BssgpDecoded.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpDecoded_template[list_length];
}

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

BSSGP__Types::PDU__BSSGP_template& BssgpDecoded_template::bssgp()
{
set_specific();
return single_value->field_bssgp;
}

const BSSGP__Types::PDU__BSSGP_template& BssgpDecoded_template::bssgp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgp of a non-specific template of type @BSSGP_Emulation.BssgpDecoded.");
return single_value->field_bssgp;
}

LLC__Types::PDU__LLC_template& BssgpDecoded_template::llc()
{
set_specific();
return single_value->field_llc;
}

const LLC__Types::PDU__LLC_template& BssgpDecoded_template::llc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field llc of a non-specific template of type @BSSGP_Emulation.BssgpDecoded.");
return single_value->field_llc;
}

MobileL3__Types::PDU__L3__MS__SGSN_template& BssgpDecoded_template::l3__mo()
{
set_specific();
return single_value->field_l3__mo;
}

const MobileL3__Types::PDU__L3__MS__SGSN_template& BssgpDecoded_template::l3__mo() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l3_mo of a non-specific template of type @BSSGP_Emulation.BssgpDecoded.");
return single_value->field_l3__mo;
}

MobileL3__Types::PDU__L3__SGSN__MS_template& BssgpDecoded_template::l3__mt()
{
set_specific();
return single_value->field_l3__mt;
}

const MobileL3__Types::PDU__L3__SGSN__MS_template& BssgpDecoded_template::l3__mt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l3_mt of a non-specific template of type @BSSGP_Emulation.BssgpDecoded.");
return single_value->field_l3__mt;
}

SNDCP__Types::PDU__SN_template& BssgpDecoded_template::sndcp()
{
set_specific();
return single_value->field_sndcp;
}

const SNDCP__Types::PDU__SN_template& BssgpDecoded_template::sndcp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sndcp of a non-specific template of type @BSSGP_Emulation.BssgpDecoded.");
return single_value->field_sndcp;
}

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

void BssgpDecoded_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgp := ");
single_value->field_bssgp.log();
TTCN_Logger::log_event_str(", llc := ");
single_value->field_llc.log();
TTCN_Logger::log_event_str(", l3_mo := ");
single_value->field_l3__mo.log();
TTCN_Logger::log_event_str(", l3_mt := ");
single_value->field_l3__mt.log();
TTCN_Logger::log_event_str(", sndcp := ");
single_value->field_sndcp.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 BssgpDecoded_template::log_match(const BssgpDecoded& 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_bssgp.match(match_value.bssgp(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgp");
single_value->field_bssgp.log_match(match_value.bssgp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.llc().ispresent()){
if(!single_value->field_llc.match(match_value.llc(), legacy)){
TTCN_Logger::log_logmatch_info(".llc");
single_value->field_llc.log_match(match_value.llc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_llc.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".llc := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_llc.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.l3__mo().ispresent()){
if(!single_value->field_l3__mo.match(match_value.l3__mo(), legacy)){
TTCN_Logger::log_logmatch_info(".l3_mo");
single_value->field_l3__mo.log_match(match_value.l3__mo(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_l3__mo.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".l3_mo := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_l3__mo.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.l3__mt().ispresent()){
if(!single_value->field_l3__mt.match(match_value.l3__mt(), legacy)){
TTCN_Logger::log_logmatch_info(".l3_mt");
single_value->field_l3__mt.log_match(match_value.l3__mt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_l3__mt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".l3_mt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_l3__mt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sndcp().ispresent()){
if(!single_value->field_sndcp.match(match_value.sndcp(), legacy)){
TTCN_Logger::log_logmatch_info(".sndcp");
single_value->field_sndcp.log_match(match_value.sndcp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sndcp.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sndcp := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sndcp.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgp := ");
single_value->field_bssgp.log_match(match_value.bssgp(), legacy);
TTCN_Logger::log_event_str(", llc := ");
if (match_value.llc().ispresent()) {
single_value->field_llc.log_match(match_value.llc(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_llc.log();
if (single_value->field_llc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", l3_mo := ");
if (match_value.l3__mo().ispresent()) {
single_value->field_l3__mo.log_match(match_value.l3__mo(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_l3__mo.log();
if (single_value->field_l3__mo.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", l3_mt := ");
if (match_value.l3__mt().ispresent()) {
single_value->field_l3__mt.log_match(match_value.l3__mt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_l3__mt.log();
if (single_value->field_l3__mt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sndcp := ");
if (match_value.sndcp().ispresent()) {
single_value->field_sndcp.log_match(match_value.sndcp(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sndcp.log();
if (single_value->field_sndcp.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void BssgpDecoded_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bssgp().is_bound()) bssgp().set_implicit_omit();
if (!llc().is_bound()) llc() = OMIT_VALUE;
else llc().set_implicit_omit();
if (!l3__mo().is_bound()) l3__mo() = OMIT_VALUE;
else l3__mo().set_implicit_omit();
if (!l3__mt().is_bound()) l3__mt() = OMIT_VALUE;
else l3__mt().set_implicit_omit();
if (!sndcp().is_bound()) sndcp() = OMIT_VALUE;
else sndcp().set_implicit_omit();
}

void BssgpDecoded_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgp.encode_text(text_buf);
single_value->field_llc.encode_text(text_buf);
single_value->field_l3__mo.encode_text(text_buf);
single_value->field_l3__mt.encode_text(text_buf);
single_value->field_sndcp.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 @BSSGP_Emulation.BssgpDecoded.");
}
}

void BssgpDecoded_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_bssgp.decode_text(text_buf);
single_value->field_llc.decode_text(text_buf);
single_value->field_l3__mo.decode_text(text_buf);
single_value->field_l3__mt.decode_text(text_buf);
single_value->field_sndcp.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 BssgpDecoded_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 @BSSGP_Emulation.BssgpDecoded.");
}
}

void BssgpDecoded_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: {
    BssgpDecoded_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Emulation.BssgpDecoded has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgp().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) llc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) l3__mo().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) l3__mt().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sndcp().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgp().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(), "llc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc().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(), "l3_mo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l3__mo().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(), "l3_mt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l3__mt().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(), "sndcp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sndcp().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 @BSSGP_Emulation.BssgpDecoded: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpDecoded_template* precondition = new BssgpDecoded_template;
    precondition->set_param(*param.get_elem(0));
    BssgpDecoded_template* implied_template = new BssgpDecoded_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpDecoded_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.BssgpDecoded");
  }
  is_ifpresent = param.get_ifpresent();
}

void BssgpDecoded_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_bssgp.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpDecoded");
single_value->field_llc.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpDecoded");
single_value->field_l3__mo.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpDecoded");
single_value->field_l3__mt.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpDecoded");
single_value->field_sndcp.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpDecoded");
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 : "@BSSGP_Emulation.BssgpDecoded");
}

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

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

BssgpBvcConfig::BssgpBvcConfig()
{
}

BssgpBvcConfig::BssgpBvcConfig(const INTEGER& par_bvci,
    const Osmocom__Gb__Types::BssgpCellId& par_cell__id,
    const BssgpDecodeDepth& par_depth,
    const BssgpCreateCallback& par_create__cb)
  :   field_bvci(par_bvci),
  field_cell__id(par_cell__id),
  field_depth(par_depth),
  field_create__cb(par_create__cb)
{
}

BssgpBvcConfig::BssgpBvcConfig(const BssgpBvcConfig& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpBvcConfig.");
if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
else field_bvci.clean_up();
if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
else field_cell__id.clean_up();
if (other_value.depth().is_bound()) field_depth = other_value.depth();
else field_depth.clean_up();
if (other_value.create__cb().is_bound()) field_create__cb = other_value.create__cb();
else field_create__cb.clean_up();
}

void BssgpBvcConfig::clean_up()
{
field_bvci.clean_up();
field_cell__id.clean_up();
field_depth.clean_up();
field_create__cb.clean_up();
}

const TTCN_Typedescriptor_t* BssgpBvcConfig::get_descriptor() const { return &BssgpBvcConfig_descr_; }
BssgpBvcConfig& BssgpBvcConfig::operator=(const BssgpBvcConfig& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpBvcConfig.");
  if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
  else field_bvci.clean_up();
  if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
  else field_cell__id.clean_up();
  if (other_value.depth().is_bound()) field_depth = other_value.depth();
  else field_depth.clean_up();
  if (other_value.create__cb().is_bound()) field_create__cb = other_value.create__cb();
  else field_create__cb.clean_up();
}
return *this;
}

boolean BssgpBvcConfig::operator==(const BssgpBvcConfig& other_value) const
{
return field_bvci==other_value.field_bvci
  && field_cell__id==other_value.field_cell__id
  && field_depth==other_value.field_depth
  && field_create__cb==other_value.field_create__cb;
}

boolean BssgpBvcConfig::is_bound() const
{
return (field_bvci.is_bound())
  || (field_cell__id.is_bound())
  || (field_depth.is_bound())
  || (field_create__cb.is_bound());
}
boolean BssgpBvcConfig::is_value() const
{
return field_bvci.is_value()
  && field_cell__id.is_value()
  && field_depth.is_value()
  && field_create__cb.is_value();
}
void BssgpBvcConfig::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bvci := ");
field_bvci.log();
TTCN_Logger::log_event_str(", cell_id := ");
field_cell__id.log();
TTCN_Logger::log_event_str(", depth := ");
field_depth.log();
TTCN_Logger::log_event_str(", create_cb := ");
field_create__cb.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpBvcConfig::set_implicit_omit()
{
if (bvci().is_bound()) bvci().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (depth().is_bound()) depth().set_implicit_omit();
if (create__cb().is_bound()) create__cb().set_implicit_omit();
}

void BssgpBvcConfig::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Emulation.BssgpBvcConfig has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bvci().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) depth().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) create__cb().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bvci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvci().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(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "depth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          depth().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(), "create_cb")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          create__cb().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Emulation.BssgpBvcConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.BssgpBvcConfig");
  }
}

void BssgpBvcConfig::encode_text(Text_Buf& text_buf) const
{
field_bvci.encode_text(text_buf);
field_cell__id.encode_text(text_buf);
field_depth.encode_text(text_buf);
field_create__cb.encode_text(text_buf);
}

void BssgpBvcConfig::decode_text(Text_Buf& text_buf)
{
field_bvci.decode_text(text_buf);
field_cell__id.decode_text(text_buf);
field_depth.decode_text(text_buf);
field_create__cb.decode_text(text_buf);
}

struct BssgpBvcConfig_template::single_value_struct {
INTEGER_template field_bvci;
Osmocom__Gb__Types::BssgpCellId_template field_cell__id;
BssgpDecodeDepth_template field_depth;
BssgpCreateCallback_template field_create__cb;
};

void BssgpBvcConfig_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_bvci = ANY_VALUE;
single_value->field_cell__id = ANY_VALUE;
single_value->field_depth = ANY_VALUE;
single_value->field_create__cb = ANY_VALUE;
}
}
}

void BssgpBvcConfig_template::copy_value(const BssgpBvcConfig& other_value)
{
single_value = new single_value_struct;
if (other_value.bvci().is_bound()) {
  single_value->field_bvci = other_value.bvci();
} else {
  single_value->field_bvci.clean_up();
}
if (other_value.cell__id().is_bound()) {
  single_value->field_cell__id = other_value.cell__id();
} else {
  single_value->field_cell__id.clean_up();
}
if (other_value.depth().is_bound()) {
  single_value->field_depth = other_value.depth();
} else {
  single_value->field_depth.clean_up();
}
if (other_value.create__cb().is_bound()) {
  single_value->field_create__cb = other_value.create__cb();
} else {
  single_value->field_create__cb.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpBvcConfig_template::copy_template(const BssgpBvcConfig_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bvci().get_selection()) {
single_value->field_bvci = other_value.bvci();
} else {
single_value->field_bvci.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) {
single_value->field_cell__id = other_value.cell__id();
} else {
single_value->field_cell__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.depth().get_selection()) {
single_value->field_depth = other_value.depth();
} else {
single_value->field_depth.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.create__cb().get_selection()) {
single_value->field_create__cb = other_value.create__cb();
} else {
single_value->field_create__cb.clean_up();
}
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 BssgpBvcConfig_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 BssgpBvcConfig_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpBvcConfig_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 @BSSGP_Emulation.BssgpBvcConfig.");
break;
}
set_selection(other_value);
}

BssgpBvcConfig_template::BssgpBvcConfig_template()
{
}

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

BssgpBvcConfig_template::BssgpBvcConfig_template(const BssgpBvcConfig& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpBvcConfig_template::match(const BssgpBvcConfig& 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.bvci().is_bound()) return FALSE;
if(!single_value->field_bvci.match(other_value.bvci(), legacy))return FALSE;
if(!other_value.cell__id().is_bound()) return FALSE;
if(!single_value->field_cell__id.match(other_value.cell__id(), legacy))return FALSE;
if(!other_value.depth().is_bound()) return FALSE;
if(!single_value->field_depth.match(other_value.depth(), legacy))return FALSE;
if(!other_value.create__cb().is_bound()) return FALSE;
if(!single_value->field_create__cb.match(other_value.create__cb(), 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 @BSSGP_Emulation.BssgpBvcConfig.");
}
return FALSE;
}

boolean BssgpBvcConfig_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bvci.is_bound()
 || single_value->field_cell__id.is_bound()
 || single_value->field_depth.is_bound()
 || single_value->field_create__cb.is_bound();
}

boolean BssgpBvcConfig_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bvci.is_value()
 && single_value->field_cell__id.is_value()
 && single_value->field_depth.is_value()
 && single_value->field_create__cb.is_value();
}

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

BssgpBvcConfig BssgpBvcConfig_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 @BSSGP_Emulation.BssgpBvcConfig.");
BssgpBvcConfig ret_val;
if (single_value->field_bvci.is_bound()) {
ret_val.bvci() = single_value->field_bvci.valueof();
}
if (single_value->field_cell__id.is_bound()) {
ret_val.cell__id() = single_value->field_cell__id.valueof();
}
if (single_value->field_depth.is_bound()) {
ret_val.depth() = single_value->field_depth.valueof();
}
if (single_value->field_create__cb.is_bound()) {
ret_val.create__cb() = single_value->field_create__cb.valueof();
}
return ret_val;
}

void BssgpBvcConfig_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 @BSSGP_Emulation.BssgpBvcConfig.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpBvcConfig_template[list_length];
}

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

INTEGER_template& BssgpBvcConfig_template::bvci()
{
set_specific();
return single_value->field_bvci;
}

const INTEGER_template& BssgpBvcConfig_template::bvci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bvci of a non-specific template of type @BSSGP_Emulation.BssgpBvcConfig.");
return single_value->field_bvci;
}

Osmocom__Gb__Types::BssgpCellId_template& BssgpBvcConfig_template::cell__id()
{
set_specific();
return single_value->field_cell__id;
}

const Osmocom__Gb__Types::BssgpCellId_template& BssgpBvcConfig_template::cell__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_id of a non-specific template of type @BSSGP_Emulation.BssgpBvcConfig.");
return single_value->field_cell__id;
}

BssgpDecodeDepth_template& BssgpBvcConfig_template::depth()
{
set_specific();
return single_value->field_depth;
}

const BssgpDecodeDepth_template& BssgpBvcConfig_template::depth() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field depth of a non-specific template of type @BSSGP_Emulation.BssgpBvcConfig.");
return single_value->field_depth;
}

BssgpCreateCallback_template& BssgpBvcConfig_template::create__cb()
{
set_specific();
return single_value->field_create__cb;
}

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

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

void BssgpBvcConfig_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bvci := ");
single_value->field_bvci.log();
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.log();
TTCN_Logger::log_event_str(", depth := ");
single_value->field_depth.log();
TTCN_Logger::log_event_str(", create_cb := ");
single_value->field_create__cb.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 BssgpBvcConfig_template::log_match(const BssgpBvcConfig& 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_bvci.match(match_value.bvci(), legacy)){
TTCN_Logger::log_logmatch_info(".bvci");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__id.match(match_value.cell__id(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_id");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_depth.match(match_value.depth(), legacy)){
TTCN_Logger::log_logmatch_info(".depth");
single_value->field_depth.log_match(match_value.depth(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_create__cb.match(match_value.create__cb(), legacy)){
TTCN_Logger::log_logmatch_info(".create_cb");
single_value->field_create__cb.log_match(match_value.create__cb(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ bvci := ");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::log_event_str(", depth := ");
single_value->field_depth.log_match(match_value.depth(), legacy);
TTCN_Logger::log_event_str(", create_cb := ");
single_value->field_create__cb.log_match(match_value.create__cb(), 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 BssgpBvcConfig_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bvci().is_bound()) bvci().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (depth().is_bound()) depth().set_implicit_omit();
if (create__cb().is_bound()) create__cb().set_implicit_omit();
}

void BssgpBvcConfig_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bvci.encode_text(text_buf);
single_value->field_cell__id.encode_text(text_buf);
single_value->field_depth.encode_text(text_buf);
single_value->field_create__cb.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 @BSSGP_Emulation.BssgpBvcConfig.");
}
}

void BssgpBvcConfig_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_bvci.decode_text(text_buf);
single_value->field_cell__id.decode_text(text_buf);
single_value->field_depth.decode_text(text_buf);
single_value->field_create__cb.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 BssgpBvcConfig_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 @BSSGP_Emulation.BssgpBvcConfig.");
}
}

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

void BssgpBvcConfig_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_bvci.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBvcConfig");
single_value->field_cell__id.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBvcConfig");
single_value->field_depth.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBvcConfig");
single_value->field_create__cb.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBvcConfig");
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 : "@BSSGP_Emulation.BssgpBvcConfig");
}

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

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

BssgpConfig::BssgpConfig()
{
}

BssgpConfig::BssgpConfig(const INTEGER& par_nsei,
    const BOOLEAN& par_sgsn__role,
    const BssgpBvcConfigs& par_bvc)
  :   field_nsei(par_nsei),
  field_sgsn__role(par_sgsn__role),
  field_bvc(par_bvc)
{
}

BssgpConfig::BssgpConfig(const BssgpConfig& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpConfig.");
if (other_value.nsei().is_bound()) field_nsei = other_value.nsei();
else field_nsei.clean_up();
if (other_value.sgsn__role().is_bound()) field_sgsn__role = other_value.sgsn__role();
else field_sgsn__role.clean_up();
if (other_value.bvc().is_bound()) field_bvc = other_value.bvc();
else field_bvc.clean_up();
}

void BssgpConfig::clean_up()
{
field_nsei.clean_up();
field_sgsn__role.clean_up();
field_bvc.clean_up();
}

const TTCN_Typedescriptor_t* BssgpConfig::get_descriptor() const { return &BssgpConfig_descr_; }
BssgpConfig& BssgpConfig::operator=(const BssgpConfig& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpConfig.");
  if (other_value.nsei().is_bound()) field_nsei = other_value.nsei();
  else field_nsei.clean_up();
  if (other_value.sgsn__role().is_bound()) field_sgsn__role = other_value.sgsn__role();
  else field_sgsn__role.clean_up();
  if (other_value.bvc().is_bound()) field_bvc = other_value.bvc();
  else field_bvc.clean_up();
}
return *this;
}

boolean BssgpConfig::operator==(const BssgpConfig& other_value) const
{
return field_nsei==other_value.field_nsei
  && field_sgsn__role==other_value.field_sgsn__role
  && field_bvc==other_value.field_bvc;
}

boolean BssgpConfig::is_bound() const
{
return (field_nsei.is_bound())
  || (field_sgsn__role.is_bound())
  || (field_bvc.is_bound());
}
boolean BssgpConfig::is_value() const
{
return field_nsei.is_value()
  && field_sgsn__role.is_value()
  && field_bvc.is_value();
}
void BssgpConfig::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ nsei := ");
field_nsei.log();
TTCN_Logger::log_event_str(", sgsn_role := ");
field_sgsn__role.log();
TTCN_Logger::log_event_str(", bvc := ");
field_bvc.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpConfig::set_implicit_omit()
{
if (nsei().is_bound()) nsei().set_implicit_omit();
if (sgsn__role().is_bound()) sgsn__role().set_implicit_omit();
if (bvc().is_bound()) bvc().set_implicit_omit();
}

void BssgpConfig::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 @BSSGP_Emulation.BssgpConfig 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) nsei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sgsn__role().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bvc().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(), "nsei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsei().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(), "sgsn_role")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sgsn__role().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(), "bvc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvc().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 @BSSGP_Emulation.BssgpConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.BssgpConfig");
  }
}

void BssgpConfig::encode_text(Text_Buf& text_buf) const
{
field_nsei.encode_text(text_buf);
field_sgsn__role.encode_text(text_buf);
field_bvc.encode_text(text_buf);
}

void BssgpConfig::decode_text(Text_Buf& text_buf)
{
field_nsei.decode_text(text_buf);
field_sgsn__role.decode_text(text_buf);
field_bvc.decode_text(text_buf);
}

struct BssgpConfig_template::single_value_struct {
INTEGER_template field_nsei;
BOOLEAN_template field_sgsn__role;
BssgpBvcConfigs_template field_bvc;
};

void BssgpConfig_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_nsei = ANY_VALUE;
single_value->field_sgsn__role = ANY_VALUE;
single_value->field_bvc = ANY_VALUE;
}
}
}

void BssgpConfig_template::copy_value(const BssgpConfig& other_value)
{
single_value = new single_value_struct;
if (other_value.nsei().is_bound()) {
  single_value->field_nsei = other_value.nsei();
} else {
  single_value->field_nsei.clean_up();
}
if (other_value.sgsn__role().is_bound()) {
  single_value->field_sgsn__role = other_value.sgsn__role();
} else {
  single_value->field_sgsn__role.clean_up();
}
if (other_value.bvc().is_bound()) {
  single_value->field_bvc = other_value.bvc();
} else {
  single_value->field_bvc.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpConfig_template::copy_template(const BssgpConfig_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.nsei().get_selection()) {
single_value->field_nsei = other_value.nsei();
} else {
single_value->field_nsei.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sgsn__role().get_selection()) {
single_value->field_sgsn__role = other_value.sgsn__role();
} else {
single_value->field_sgsn__role.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bvc().get_selection()) {
single_value->field_bvc = other_value.bvc();
} else {
single_value->field_bvc.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 BssgpConfig_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 BssgpConfig_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpConfig_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 @BSSGP_Emulation.BssgpConfig.");
break;
}
set_selection(other_value);
}

BssgpConfig_template::BssgpConfig_template()
{
}

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

BssgpConfig_template::BssgpConfig_template(const BssgpConfig& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpConfig_template::match(const BssgpConfig& 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.nsei().is_bound()) return FALSE;
if(!single_value->field_nsei.match(other_value.nsei(), legacy))return FALSE;
if(!other_value.sgsn__role().is_bound()) return FALSE;
if(!single_value->field_sgsn__role.match(other_value.sgsn__role(), legacy))return FALSE;
if(!other_value.bvc().is_bound()) return FALSE;
if(!single_value->field_bvc.match(other_value.bvc(), 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 @BSSGP_Emulation.BssgpConfig.");
}
return FALSE;
}

boolean BssgpConfig_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_nsei.is_bound()
 || single_value->field_sgsn__role.is_bound()
 || single_value->field_bvc.is_bound();
}

boolean BssgpConfig_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_nsei.is_value()
 && single_value->field_sgsn__role.is_value()
 && single_value->field_bvc.is_value();
}

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

BssgpConfig BssgpConfig_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 @BSSGP_Emulation.BssgpConfig.");
BssgpConfig ret_val;
if (single_value->field_nsei.is_bound()) {
ret_val.nsei() = single_value->field_nsei.valueof();
}
if (single_value->field_sgsn__role.is_bound()) {
ret_val.sgsn__role() = single_value->field_sgsn__role.valueof();
}
if (single_value->field_bvc.is_bound()) {
ret_val.bvc() = single_value->field_bvc.valueof();
}
return ret_val;
}

void BssgpConfig_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 @BSSGP_Emulation.BssgpConfig.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpConfig_template[list_length];
}

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

INTEGER_template& BssgpConfig_template::nsei()
{
set_specific();
return single_value->field_nsei;
}

const INTEGER_template& BssgpConfig_template::nsei() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsei of a non-specific template of type @BSSGP_Emulation.BssgpConfig.");
return single_value->field_nsei;
}

BOOLEAN_template& BssgpConfig_template::sgsn__role()
{
set_specific();
return single_value->field_sgsn__role;
}

const BOOLEAN_template& BssgpConfig_template::sgsn__role() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sgsn_role of a non-specific template of type @BSSGP_Emulation.BssgpConfig.");
return single_value->field_sgsn__role;
}

BssgpBvcConfigs_template& BssgpConfig_template::bvc()
{
set_specific();
return single_value->field_bvc;
}

const BssgpBvcConfigs_template& BssgpConfig_template::bvc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bvc of a non-specific template of type @BSSGP_Emulation.BssgpConfig.");
return single_value->field_bvc;
}

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

void BssgpConfig_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ nsei := ");
single_value->field_nsei.log();
TTCN_Logger::log_event_str(", sgsn_role := ");
single_value->field_sgsn__role.log();
TTCN_Logger::log_event_str(", bvc := ");
single_value->field_bvc.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 BssgpConfig_template::log_match(const BssgpConfig& 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_nsei.match(match_value.nsei(), legacy)){
TTCN_Logger::log_logmatch_info(".nsei");
single_value->field_nsei.log_match(match_value.nsei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sgsn__role.match(match_value.sgsn__role(), legacy)){
TTCN_Logger::log_logmatch_info(".sgsn_role");
single_value->field_sgsn__role.log_match(match_value.sgsn__role(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bvc.match(match_value.bvc(), legacy)){
TTCN_Logger::log_logmatch_info(".bvc");
single_value->field_bvc.log_match(match_value.bvc(), 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("{ nsei := ");
single_value->field_nsei.log_match(match_value.nsei(), legacy);
TTCN_Logger::log_event_str(", sgsn_role := ");
single_value->field_sgsn__role.log_match(match_value.sgsn__role(), legacy);
TTCN_Logger::log_event_str(", bvc := ");
single_value->field_bvc.log_match(match_value.bvc(), 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 BssgpConfig_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (nsei().is_bound()) nsei().set_implicit_omit();
if (sgsn__role().is_bound()) sgsn__role().set_implicit_omit();
if (bvc().is_bound()) bvc().set_implicit_omit();
}

void BssgpConfig_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_nsei.encode_text(text_buf);
single_value->field_sgsn__role.encode_text(text_buf);
single_value->field_bvc.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 @BSSGP_Emulation.BssgpConfig.");
}
}

void BssgpConfig_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_nsei.decode_text(text_buf);
single_value->field_sgsn__role.decode_text(text_buf);
single_value->field_bvc.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 BssgpConfig_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 @BSSGP_Emulation.BssgpConfig.");
}
}

void BssgpConfig_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: {
    BssgpConfig_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 @BSSGP_Emulation.BssgpConfig 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) nsei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sgsn__role().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bvc().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(), "nsei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nsei().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(), "sgsn_role")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sgsn__role().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(), "bvc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvc().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 @BSSGP_Emulation.BssgpConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpConfig_template* precondition = new BssgpConfig_template;
    precondition->set_param(*param.get_elem(0));
    BssgpConfig_template* implied_template = new BssgpConfig_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpConfig_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.BssgpConfig");
  }
  is_ifpresent = param.get_ifpresent();
}

void BssgpConfig_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_nsei.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpConfig");
single_value->field_sgsn__role.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpConfig");
single_value->field_bvc.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpConfig");
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 : "@BSSGP_Emulation.BssgpConfig");
}

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

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

BvcEntity::BvcEntity()
{
}

BvcEntity::BvcEntity(const INTEGER& par_bvci,
    const Osmocom__Gb__Types::BssgpCellId& par_cell__id,
    const COMPONENT& par_comp__ref)
  :   field_bvci(par_bvci),
  field_cell__id(par_cell__id),
  field_comp__ref(par_comp__ref)
{
}

BvcEntity::BvcEntity(const BvcEntity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BvcEntity.");
if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
else field_bvci.clean_up();
if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
else field_cell__id.clean_up();
if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
else field_comp__ref.clean_up();
}

void BvcEntity::clean_up()
{
field_bvci.clean_up();
field_cell__id.clean_up();
field_comp__ref.clean_up();
}

const TTCN_Typedescriptor_t* BvcEntity::get_descriptor() const { return &BvcEntity_descr_; }
BvcEntity& BvcEntity::operator=(const BvcEntity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BvcEntity.");
  if (other_value.bvci().is_bound()) field_bvci = other_value.bvci();
  else field_bvci.clean_up();
  if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
  else field_cell__id.clean_up();
  if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
  else field_comp__ref.clean_up();
}
return *this;
}

boolean BvcEntity::operator==(const BvcEntity& other_value) const
{
return field_bvci==other_value.field_bvci
  && field_cell__id==other_value.field_cell__id
  && field_comp__ref==other_value.field_comp__ref;
}

boolean BvcEntity::is_bound() const
{
return (field_bvci.is_bound())
  || (field_cell__id.is_bound())
  || (field_comp__ref.is_bound());
}
boolean BvcEntity::is_value() const
{
return field_bvci.is_value()
  && field_cell__id.is_value()
  && field_comp__ref.is_value();
}
void BvcEntity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bvci := ");
field_bvci.log();
TTCN_Logger::log_event_str(", cell_id := ");
field_cell__id.log();
TTCN_Logger::log_event_str(", comp_ref := ");
field_comp__ref.log();
TTCN_Logger::log_event_str(" }");
}

void BvcEntity::set_implicit_omit()
{
if (bvci().is_bound()) bvci().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
}

void BvcEntity::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 @BSSGP_Emulation.BvcEntity 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) bvci().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) comp__ref().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(), "bvci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvci().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(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Emulation.BvcEntity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.BvcEntity");
  }
}

void BvcEntity::encode_text(Text_Buf& text_buf) const
{
field_bvci.encode_text(text_buf);
field_cell__id.encode_text(text_buf);
field_comp__ref.encode_text(text_buf);
}

void BvcEntity::decode_text(Text_Buf& text_buf)
{
field_bvci.decode_text(text_buf);
field_cell__id.decode_text(text_buf);
field_comp__ref.decode_text(text_buf);
}

struct BvcEntity_template::single_value_struct {
INTEGER_template field_bvci;
Osmocom__Gb__Types::BssgpCellId_template field_cell__id;
COMPONENT_template field_comp__ref;
};

void BvcEntity_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_bvci = ANY_VALUE;
single_value->field_cell__id = ANY_VALUE;
single_value->field_comp__ref = ANY_VALUE;
}
}
}

void BvcEntity_template::copy_value(const BvcEntity& other_value)
{
single_value = new single_value_struct;
if (other_value.bvci().is_bound()) {
  single_value->field_bvci = other_value.bvci();
} else {
  single_value->field_bvci.clean_up();
}
if (other_value.cell__id().is_bound()) {
  single_value->field_cell__id = other_value.cell__id();
} else {
  single_value->field_cell__id.clean_up();
}
if (other_value.comp__ref().is_bound()) {
  single_value->field_comp__ref = other_value.comp__ref();
} else {
  single_value->field_comp__ref.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BvcEntity_template::copy_template(const BvcEntity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bvci().get_selection()) {
single_value->field_bvci = other_value.bvci();
} else {
single_value->field_bvci.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) {
single_value->field_cell__id = other_value.cell__id();
} else {
single_value->field_cell__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.comp__ref().get_selection()) {
single_value->field_comp__ref = other_value.comp__ref();
} else {
single_value->field_comp__ref.clean_up();
}
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 BvcEntity_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 BvcEntity_template(*other_value.implication_.precondition);
implication_.implied_template = new BvcEntity_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 @BSSGP_Emulation.BvcEntity.");
break;
}
set_selection(other_value);
}

BvcEntity_template::BvcEntity_template()
{
}

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

BvcEntity_template::BvcEntity_template(const BvcEntity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BvcEntity_template::match(const BvcEntity& 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.bvci().is_bound()) return FALSE;
if(!single_value->field_bvci.match(other_value.bvci(), legacy))return FALSE;
if(!other_value.cell__id().is_bound()) return FALSE;
if(!single_value->field_cell__id.match(other_value.cell__id(), legacy))return FALSE;
if(!other_value.comp__ref().is_bound()) return FALSE;
if(!single_value->field_comp__ref.match(other_value.comp__ref(), 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 @BSSGP_Emulation.BvcEntity.");
}
return FALSE;
}

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

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

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

BvcEntity BvcEntity_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 @BSSGP_Emulation.BvcEntity.");
BvcEntity ret_val;
if (single_value->field_bvci.is_bound()) {
ret_val.bvci() = single_value->field_bvci.valueof();
}
if (single_value->field_cell__id.is_bound()) {
ret_val.cell__id() = single_value->field_cell__id.valueof();
}
if (single_value->field_comp__ref.is_bound()) {
ret_val.comp__ref() = single_value->field_comp__ref.valueof();
}
return ret_val;
}

void BvcEntity_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 @BSSGP_Emulation.BvcEntity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BvcEntity_template[list_length];
}

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

INTEGER_template& BvcEntity_template::bvci()
{
set_specific();
return single_value->field_bvci;
}

const INTEGER_template& BvcEntity_template::bvci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bvci of a non-specific template of type @BSSGP_Emulation.BvcEntity.");
return single_value->field_bvci;
}

Osmocom__Gb__Types::BssgpCellId_template& BvcEntity_template::cell__id()
{
set_specific();
return single_value->field_cell__id;
}

const Osmocom__Gb__Types::BssgpCellId_template& BvcEntity_template::cell__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_id of a non-specific template of type @BSSGP_Emulation.BvcEntity.");
return single_value->field_cell__id;
}

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

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

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

void BvcEntity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bvci := ");
single_value->field_bvci.log();
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.log();
TTCN_Logger::log_event_str(", comp_ref := ");
single_value->field_comp__ref.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 BvcEntity_template::log_match(const BvcEntity& 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_bvci.match(match_value.bvci(), legacy)){
TTCN_Logger::log_logmatch_info(".bvci");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__id.match(match_value.cell__id(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_id");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_comp__ref.match(match_value.comp__ref(), legacy)){
TTCN_Logger::log_logmatch_info(".comp_ref");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ bvci := ");
single_value->field_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::log_event_str(", comp_ref := ");
single_value->field_comp__ref.log_match(match_value.comp__ref(), 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 BvcEntity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bvci().is_bound()) bvci().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
}

void BvcEntity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bvci.encode_text(text_buf);
single_value->field_cell__id.encode_text(text_buf);
single_value->field_comp__ref.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 @BSSGP_Emulation.BvcEntity.");
}
}

void BvcEntity_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_bvci.decode_text(text_buf);
single_value->field_cell__id.decode_text(text_buf);
single_value->field_comp__ref.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 BvcEntity_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 @BSSGP_Emulation.BvcEntity.");
}
}

void BvcEntity_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: {
    BvcEntity_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 @BSSGP_Emulation.BvcEntity 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) bvci().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) comp__ref().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(), "bvci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bvci().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(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Emulation.BvcEntity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BvcEntity_template* precondition = new BvcEntity_template;
    precondition->set_param(*param.get_elem(0));
    BvcEntity_template* implied_template = new BvcEntity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BvcEntity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.BvcEntity");
  }
  is_ifpresent = param.get_ifpresent();
}

void BvcEntity_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_bvci.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BvcEntity");
single_value->field_cell__id.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BvcEntity");
single_value->field_comp__ref.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BvcEntity");
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 : "@BSSGP_Emulation.BvcEntity");
}

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

boolean BvcEntity_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__sig__wait__reset_Default::as__sig__wait__reset_Default()
 : Default_Base("as_sig_wait_reset")
{
}

alt_status as__sig__wait__reset_Default::call_altstep(boolean first_alt_run)
{
return as__sig__wait__reset_instance(first_alt_run);
}

as__sig__unblocked_Default::as__sig__unblocked_Default()
 : Default_Base("as_sig_unblocked")
{
}

alt_status as__sig__unblocked_Default::call_altstep(boolean first_alt_run)
{
return as__sig__unblocked_instance(first_alt_run);
}

as__sig__wait__ns__alive__unblocked_Default::as__sig__wait__ns__alive__unblocked_Default()
 : Default_Base("as_sig_wait_ns_alive_unblocked")
{
}

alt_status as__sig__wait__ns__alive__unblocked_Default::call_altstep(boolean first_alt_run)
{
return as__sig__wait__ns__alive__unblocked_instance(first_alt_run);
}

as__sig__allstate__pre_Default::as__sig__allstate__pre_Default()
 : Default_Base("as_sig_allstate_pre")
{
}

alt_status as__sig__allstate__pre_Default::call_altstep(boolean first_alt_run)
{
return as__sig__allstate__pre_instance(first_alt_run);
}

as__sig__allstate__post_Default::as__sig__allstate__post_Default()
 : Default_Base("as_sig_allstate_post")
{
}

alt_status as__sig__allstate__post_Default::call_altstep(boolean first_alt_run)
{
return as__sig__allstate__post_instance(first_alt_run);
}

void BSSGP__get__bvci__ct_call::encode_text(Text_Buf& text_buf) const
{
param_bvci.encode_text(text_buf);
}

void BSSGP__get__bvci__ct_call::decode_text(Text_Buf& text_buf)
{
param_bvci.decode_text(text_buf);
}

void BSSGP__get__bvci__ct_call::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_get_bvci_ct : { ");
TTCN_Logger::log_event_str("bvci := ");
param_bvci.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__get__bvci__ct_call_redirect::set_parameters(const BSSGP__get__bvci__ct_call& call_par) const
{
if (ptr_bvci != NULL) *ptr_bvci = call_par.bvci();
}

void BSSGP__get__bvci__ct_reply::encode_text(Text_Buf& text_buf) const
{
reply_value.encode_text(text_buf);
}

void BSSGP__get__bvci__ct_reply::decode_text(Text_Buf& text_buf)
{
reply_value.decode_text(text_buf);
}

void BSSGP__get__bvci__ct_reply::log() const
{
TTCN_Logger::log_event_str("@BSSGP_Emulation.BSSGP_get_bvci_ct : { } value ");
reply_value.log();
}

void BSSGP__get__bvci__ct_reply_redirect::set_parameters(const BSSGP__get__bvci__ct_reply& reply_par) const
{
if (ret_val_redir != NULL) *ret_val_redir = reply_par.return_value();
}

BSSGP__get__bvci__ct_template::BSSGP__get__bvci__ct_template()
 : param_bvci(ANY_VALUE), reply_value(ANY_VALUE)
{
}

BSSGP__get__bvci__ct_call BSSGP__get__bvci__ct_template::create_call() const
{
BSSGP__get__bvci__ct_call ret_val;
ret_val.bvci() = param_bvci.valueof();
return ret_val;
}

BSSGP__get__bvci__ct_reply BSSGP__get__bvci__ct_template::create_reply() const
{
BSSGP__get__bvci__ct_reply ret_val;
ret_val.return_value() = reply_value.valueof();
return ret_val;
}

boolean BSSGP__get__bvci__ct_template::match_call(const BSSGP__get__bvci__ct_call& match_value, boolean legacy) const
{
return param_bvci.match(match_value.bvci(), legacy);
}

boolean BSSGP__get__bvci__ct_template::match_reply(const BSSGP__get__bvci__ct_reply& match_value, boolean legacy) const
{
return reply_value.match(match_value.return_value(), legacy);
}

const BSSGP__get__bvci__ct_template& BSSGP__get__bvci__ct_template::set_value_template(const COMPONENT_template& new_template) const
{
reply_value = new_template;
return *this;
}

void BSSGP__get__bvci__ct_template::log() const
{
TTCN_Logger::log_event_str("{ bvci := ");
param_bvci.log();
TTCN_Logger::log_event_str(" }");
}

void BSSGP__get__bvci__ct_template::log_match_call(const BSSGP__get__bvci__ct_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ bvci := ");
param_bvci.log_match(match_value.bvci(), legacy);
TTCN_Logger::log_event_str(" }");
}

void BSSGP__get__bvci__ct_template::log_match_reply(const BSSGP__get__bvci__ct_reply& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ } with { } matched value ");
reply_value.log_match(match_value.return_value(), legacy);
}

void BSSGP__get__bvci__ct_template::encode_text(Text_Buf& text_buf) const
{
param_bvci.encode_text(text_buf);
}

void BSSGP__get__bvci__ct_template::decode_text(Text_Buf& text_buf)
{
param_bvci.decode_text(text_buf);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__CT__PROC__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_get_bvci_ct")) {
BSSGP__get__bvci__ct_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

boolean BSSGP__CT__PROC__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@BSSGP_Emulation.BSSGP_get_bvci_ct")) {
BSSGP__get__bvci__ct_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

LLC__Entity::LLC__Entity()
{
}

LLC__Entity::LLC__Entity(const BOOLEAN& par_sgsn__role,
    const INTEGER& par_n__u__tx__next,
    const OPTIONAL< INTEGER >& par_n__u__rx__last)
  :   field_sgsn__role(par_sgsn__role),
  field_n__u__tx__next(par_n__u__tx__next),
  field_n__u__rx__last(par_n__u__rx__last)
{
}

LLC__Entity::LLC__Entity(const LLC__Entity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.LLC_Entity.");
if (other_value.sgsn__role().is_bound()) field_sgsn__role = other_value.sgsn__role();
else field_sgsn__role.clean_up();
if (other_value.n__u__tx__next().is_bound()) field_n__u__tx__next = other_value.n__u__tx__next();
else field_n__u__tx__next.clean_up();
if (other_value.n__u__rx__last().is_bound()) field_n__u__rx__last = other_value.n__u__rx__last();
else field_n__u__rx__last.clean_up();
}

void LLC__Entity::clean_up()
{
field_sgsn__role.clean_up();
field_n__u__tx__next.clean_up();
field_n__u__rx__last.clean_up();
}

const TTCN_Typedescriptor_t* LLC__Entity::get_descriptor() const { return &LLC__Entity_descr_; }
LLC__Entity& LLC__Entity::operator=(const LLC__Entity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.LLC_Entity.");
  if (other_value.sgsn__role().is_bound()) field_sgsn__role = other_value.sgsn__role();
  else field_sgsn__role.clean_up();
  if (other_value.n__u__tx__next().is_bound()) field_n__u__tx__next = other_value.n__u__tx__next();
  else field_n__u__tx__next.clean_up();
  if (other_value.n__u__rx__last().is_bound()) field_n__u__rx__last = other_value.n__u__rx__last();
  else field_n__u__rx__last.clean_up();
}
return *this;
}

boolean LLC__Entity::operator==(const LLC__Entity& other_value) const
{
return field_sgsn__role==other_value.field_sgsn__role
  && field_n__u__tx__next==other_value.field_n__u__tx__next
  && field_n__u__rx__last==other_value.field_n__u__rx__last;
}

boolean LLC__Entity::is_bound() const
{
return (field_sgsn__role.is_bound())
  || (field_n__u__tx__next.is_bound())
  || (OPTIONAL_OMIT == field_n__u__rx__last.get_selection() || field_n__u__rx__last.is_bound());
}
boolean LLC__Entity::is_value() const
{
return field_sgsn__role.is_value()
  && field_n__u__tx__next.is_value()
  && (OPTIONAL_OMIT == field_n__u__rx__last.get_selection() || field_n__u__rx__last.is_value());
}
int LLC__Entity::size_of() const
{
  int ret_val = 2;
  if (field_n__u__rx__last.ispresent()) ret_val++;
  return ret_val;
}

void LLC__Entity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sgsn_role := ");
field_sgsn__role.log();
TTCN_Logger::log_event_str(", n_u_tx_next := ");
field_n__u__tx__next.log();
TTCN_Logger::log_event_str(", n_u_rx_last := ");
field_n__u__rx__last.log();
TTCN_Logger::log_event_str(" }");
}

void LLC__Entity::set_implicit_omit()
{
if (sgsn__role().is_bound()) sgsn__role().set_implicit_omit();
if (n__u__tx__next().is_bound()) n__u__tx__next().set_implicit_omit();
if (!n__u__rx__last().is_bound()) n__u__rx__last() = OMIT_VALUE;
else n__u__rx__last().set_implicit_omit();
}

void LLC__Entity::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 @BSSGP_Emulation.LLC_Entity 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) sgsn__role().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) n__u__tx__next().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) n__u__rx__last().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(), "sgsn_role")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sgsn__role().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(), "n_u_tx_next")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          n__u__tx__next().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(), "n_u_rx_last")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          n__u__rx__last().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 @BSSGP_Emulation.LLC_Entity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.LLC_Entity");
  }
}

void LLC__Entity::encode_text(Text_Buf& text_buf) const
{
field_sgsn__role.encode_text(text_buf);
field_n__u__tx__next.encode_text(text_buf);
field_n__u__rx__last.encode_text(text_buf);
}

void LLC__Entity::decode_text(Text_Buf& text_buf)
{
field_sgsn__role.decode_text(text_buf);
field_n__u__tx__next.decode_text(text_buf);
field_n__u__rx__last.decode_text(text_buf);
}

struct LLC__Entity_template::single_value_struct {
BOOLEAN_template field_sgsn__role;
INTEGER_template field_n__u__tx__next;
INTEGER_template field_n__u__rx__last;
};

void LLC__Entity_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_sgsn__role = ANY_VALUE;
single_value->field_n__u__tx__next = ANY_VALUE;
single_value->field_n__u__rx__last = ANY_OR_OMIT;
}
}
}

void LLC__Entity_template::copy_value(const LLC__Entity& other_value)
{
single_value = new single_value_struct;
if (other_value.sgsn__role().is_bound()) {
  single_value->field_sgsn__role = other_value.sgsn__role();
} else {
  single_value->field_sgsn__role.clean_up();
}
if (other_value.n__u__tx__next().is_bound()) {
  single_value->field_n__u__tx__next = other_value.n__u__tx__next();
} else {
  single_value->field_n__u__tx__next.clean_up();
}
if (other_value.n__u__rx__last().is_bound()) {
  if (other_value.n__u__rx__last().ispresent()) single_value->field_n__u__rx__last = other_value.n__u__rx__last()();
  else single_value->field_n__u__rx__last = OMIT_VALUE;
} else {
  single_value->field_n__u__rx__last.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void LLC__Entity_template::copy_template(const LLC__Entity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sgsn__role().get_selection()) {
single_value->field_sgsn__role = other_value.sgsn__role();
} else {
single_value->field_sgsn__role.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.n__u__tx__next().get_selection()) {
single_value->field_n__u__tx__next = other_value.n__u__tx__next();
} else {
single_value->field_n__u__tx__next.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.n__u__rx__last().get_selection()) {
single_value->field_n__u__rx__last = other_value.n__u__rx__last();
} else {
single_value->field_n__u__rx__last.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 LLC__Entity_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 LLC__Entity_template(*other_value.implication_.precondition);
implication_.implied_template = new LLC__Entity_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 @BSSGP_Emulation.LLC_Entity.");
break;
}
set_selection(other_value);
}

LLC__Entity_template::LLC__Entity_template()
{
}

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

LLC__Entity_template::LLC__Entity_template(const LLC__Entity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean LLC__Entity_template::match(const LLC__Entity& 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.sgsn__role().is_bound()) return FALSE;
if(!single_value->field_sgsn__role.match(other_value.sgsn__role(), legacy))return FALSE;
if(!other_value.n__u__tx__next().is_bound()) return FALSE;
if(!single_value->field_n__u__tx__next.match(other_value.n__u__tx__next(), legacy))return FALSE;
if(!other_value.n__u__rx__last().is_bound()) return FALSE;
if((other_value.n__u__rx__last().ispresent() ? !single_value->field_n__u__rx__last.match((const INTEGER&)other_value.n__u__rx__last(), legacy) : !single_value->field_n__u__rx__last.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Emulation.LLC_Entity.");
}
return FALSE;
}

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

boolean LLC__Entity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sgsn__role.is_value()
 && single_value->field_n__u__tx__next.is_value()
 && (single_value->field_n__u__rx__last.is_omit() || single_value->field_n__u__rx__last.is_value());
}

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

LLC__Entity LLC__Entity_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 @BSSGP_Emulation.LLC_Entity.");
LLC__Entity ret_val;
if (single_value->field_sgsn__role.is_bound()) {
ret_val.sgsn__role() = single_value->field_sgsn__role.valueof();
}
if (single_value->field_n__u__tx__next.is_bound()) {
ret_val.n__u__tx__next() = single_value->field_n__u__tx__next.valueof();
}
if (single_value->field_n__u__rx__last.is_omit()) ret_val.n__u__rx__last() = OMIT_VALUE;
else if (single_value->field_n__u__rx__last.is_bound()) {
ret_val.n__u__rx__last() = single_value->field_n__u__rx__last.valueof();
}
return ret_val;
}

void LLC__Entity_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 @BSSGP_Emulation.LLC_Entity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new LLC__Entity_template[list_length];
}

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

BOOLEAN_template& LLC__Entity_template::sgsn__role()
{
set_specific();
return single_value->field_sgsn__role;
}

const BOOLEAN_template& LLC__Entity_template::sgsn__role() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sgsn_role of a non-specific template of type @BSSGP_Emulation.LLC_Entity.");
return single_value->field_sgsn__role;
}

INTEGER_template& LLC__Entity_template::n__u__tx__next()
{
set_specific();
return single_value->field_n__u__tx__next;
}

const INTEGER_template& LLC__Entity_template::n__u__tx__next() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field n_u_tx_next of a non-specific template of type @BSSGP_Emulation.LLC_Entity.");
return single_value->field_n__u__tx__next;
}

INTEGER_template& LLC__Entity_template::n__u__rx__last()
{
set_specific();
return single_value->field_n__u__rx__last;
}

const INTEGER_template& LLC__Entity_template::n__u__rx__last() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field n_u_rx_last of a non-specific template of type @BSSGP_Emulation.LLC_Entity.");
return single_value->field_n__u__rx__last;
}

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

void LLC__Entity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sgsn_role := ");
single_value->field_sgsn__role.log();
TTCN_Logger::log_event_str(", n_u_tx_next := ");
single_value->field_n__u__tx__next.log();
TTCN_Logger::log_event_str(", n_u_rx_last := ");
single_value->field_n__u__rx__last.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 LLC__Entity_template::log_match(const LLC__Entity& 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_sgsn__role.match(match_value.sgsn__role(), legacy)){
TTCN_Logger::log_logmatch_info(".sgsn_role");
single_value->field_sgsn__role.log_match(match_value.sgsn__role(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_n__u__tx__next.match(match_value.n__u__tx__next(), legacy)){
TTCN_Logger::log_logmatch_info(".n_u_tx_next");
single_value->field_n__u__tx__next.log_match(match_value.n__u__tx__next(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.n__u__rx__last().ispresent()){
if(!single_value->field_n__u__rx__last.match(match_value.n__u__rx__last(), legacy)){
TTCN_Logger::log_logmatch_info(".n_u_rx_last");
single_value->field_n__u__rx__last.log_match(match_value.n__u__rx__last(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_n__u__rx__last.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".n_u_rx_last := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_n__u__rx__last.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ sgsn_role := ");
single_value->field_sgsn__role.log_match(match_value.sgsn__role(), legacy);
TTCN_Logger::log_event_str(", n_u_tx_next := ");
single_value->field_n__u__tx__next.log_match(match_value.n__u__tx__next(), legacy);
TTCN_Logger::log_event_str(", n_u_rx_last := ");
if (match_value.n__u__rx__last().ispresent()) {
single_value->field_n__u__rx__last.log_match(match_value.n__u__rx__last(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_n__u__rx__last.log();
if (single_value->field_n__u__rx__last.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void LLC__Entity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (sgsn__role().is_bound()) sgsn__role().set_implicit_omit();
if (n__u__tx__next().is_bound()) n__u__tx__next().set_implicit_omit();
if (!n__u__rx__last().is_bound()) n__u__rx__last() = OMIT_VALUE;
else n__u__rx__last().set_implicit_omit();
}

void LLC__Entity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sgsn__role.encode_text(text_buf);
single_value->field_n__u__tx__next.encode_text(text_buf);
single_value->field_n__u__rx__last.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 @BSSGP_Emulation.LLC_Entity.");
}
}

void LLC__Entity_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_sgsn__role.decode_text(text_buf);
single_value->field_n__u__tx__next.decode_text(text_buf);
single_value->field_n__u__rx__last.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 LLC__Entity_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 @BSSGP_Emulation.LLC_Entity.");
}
}

void LLC__Entity_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: {
    LLC__Entity_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 @BSSGP_Emulation.LLC_Entity 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) sgsn__role().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) n__u__tx__next().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) n__u__rx__last().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(), "sgsn_role")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sgsn__role().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(), "n_u_tx_next")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          n__u__tx__next().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(), "n_u_rx_last")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          n__u__rx__last().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 @BSSGP_Emulation.LLC_Entity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LLC__Entity_template* precondition = new LLC__Entity_template;
    precondition->set_param(*param.get_elem(0));
    LLC__Entity_template* implied_template = new LLC__Entity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LLC__Entity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.LLC_Entity");
  }
  is_ifpresent = param.get_ifpresent();
}

void LLC__Entity_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_sgsn__role.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.LLC_Entity");
single_value->field_n__u__tx__next.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.LLC_Entity");
single_value->field_n__u__rx__last.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.LLC_Entity");
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 : "@BSSGP_Emulation.LLC_Entity");
}

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

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

ClientEntity::ClientEntity()
{
}

ClientEntity::ClientEntity(const OCTETSTRING& par_tlli,
    const OPTIONAL< OCTETSTRING >& par_tlli__old,
    const HEXSTRING& par_imsi,
    const COMPONENT& par_comp__ref,
    const ClientEntity_llc& par_llc)
  :   field_tlli(par_tlli),
  field_tlli__old(par_tlli__old),
  field_imsi(par_imsi),
  field_comp__ref(par_comp__ref),
  field_llc(par_llc)
{
}

ClientEntity::ClientEntity(const ClientEntity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.ClientEntity.");
if (other_value.tlli().is_bound()) field_tlli = other_value.tlli();
else field_tlli.clean_up();
if (other_value.tlli__old().is_bound()) field_tlli__old = other_value.tlli__old();
else field_tlli__old.clean_up();
if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
else field_imsi.clean_up();
if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
else field_comp__ref.clean_up();
if (other_value.llc().is_bound()) field_llc = other_value.llc();
else field_llc.clean_up();
}

void ClientEntity::clean_up()
{
field_tlli.clean_up();
field_tlli__old.clean_up();
field_imsi.clean_up();
field_comp__ref.clean_up();
field_llc.clean_up();
}

const TTCN_Typedescriptor_t* ClientEntity::get_descriptor() const { return &ClientEntity_descr_; }
ClientEntity& ClientEntity::operator=(const ClientEntity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.ClientEntity.");
  if (other_value.tlli().is_bound()) field_tlli = other_value.tlli();
  else field_tlli.clean_up();
  if (other_value.tlli__old().is_bound()) field_tlli__old = other_value.tlli__old();
  else field_tlli__old.clean_up();
  if (other_value.imsi().is_bound()) field_imsi = other_value.imsi();
  else field_imsi.clean_up();
  if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref();
  else field_comp__ref.clean_up();
  if (other_value.llc().is_bound()) field_llc = other_value.llc();
  else field_llc.clean_up();
}
return *this;
}

boolean ClientEntity::operator==(const ClientEntity& other_value) const
{
return field_tlli==other_value.field_tlli
  && field_tlli__old==other_value.field_tlli__old
  && field_imsi==other_value.field_imsi
  && field_comp__ref==other_value.field_comp__ref
  && field_llc==other_value.field_llc;
}

boolean ClientEntity::is_bound() const
{
return (field_tlli.is_bound())
  || (OPTIONAL_OMIT == field_tlli__old.get_selection() || field_tlli__old.is_bound())
  || (field_imsi.is_bound())
  || (field_comp__ref.is_bound())
  || (field_llc.is_bound());
}
boolean ClientEntity::is_value() const
{
return field_tlli.is_value()
  && (OPTIONAL_OMIT == field_tlli__old.get_selection() || field_tlli__old.is_value())
  && field_imsi.is_value()
  && field_comp__ref.is_value()
  && field_llc.is_value();
}
int ClientEntity::size_of() const
{
  int ret_val = 4;
  if (field_tlli__old.ispresent()) ret_val++;
  return ret_val;
}

void ClientEntity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tlli := ");
field_tlli.log();
TTCN_Logger::log_event_str(", tlli_old := ");
field_tlli__old.log();
TTCN_Logger::log_event_str(", imsi := ");
field_imsi.log();
TTCN_Logger::log_event_str(", comp_ref := ");
field_comp__ref.log();
TTCN_Logger::log_event_str(", llc := ");
field_llc.log();
TTCN_Logger::log_event_str(" }");
}

void ClientEntity::set_implicit_omit()
{
if (tlli().is_bound()) tlli().set_implicit_omit();
if (!tlli__old().is_bound()) tlli__old() = OMIT_VALUE;
else tlli__old().set_implicit_omit();
if (imsi().is_bound()) imsi().set_implicit_omit();
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (llc().is_bound()) llc().set_implicit_omit();
}

void ClientEntity::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Emulation.ClientEntity has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tlli().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tlli__old().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) comp__ref().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) llc().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tlli")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tlli().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(), "tlli_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tlli__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc().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 @BSSGP_Emulation.ClientEntity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Emulation.ClientEntity");
  }
}

void ClientEntity::encode_text(Text_Buf& text_buf) const
{
field_tlli.encode_text(text_buf);
field_tlli__old.encode_text(text_buf);
field_imsi.encode_text(text_buf);
field_comp__ref.encode_text(text_buf);
field_llc.encode_text(text_buf);
}

void ClientEntity::decode_text(Text_Buf& text_buf)
{
field_tlli.decode_text(text_buf);
field_tlli__old.decode_text(text_buf);
field_imsi.decode_text(text_buf);
field_comp__ref.decode_text(text_buf);
field_llc.decode_text(text_buf);
}

struct ClientEntity_template::single_value_struct {
OCTETSTRING_template field_tlli;
OCTETSTRING_template field_tlli__old;
HEXSTRING_template field_imsi;
COMPONENT_template field_comp__ref;
ClientEntity_llc_template field_llc;
};

void ClientEntity_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_tlli = ANY_VALUE;
single_value->field_tlli__old = ANY_OR_OMIT;
single_value->field_imsi = ANY_VALUE;
single_value->field_comp__ref = ANY_VALUE;
single_value->field_llc = ANY_VALUE;
}
}
}

void ClientEntity_template::copy_value(const ClientEntity& other_value)
{
single_value = new single_value_struct;
if (other_value.tlli().is_bound()) {
  single_value->field_tlli = other_value.tlli();
} else {
  single_value->field_tlli.clean_up();
}
if (other_value.tlli__old().is_bound()) {
  if (other_value.tlli__old().ispresent()) single_value->field_tlli__old = other_value.tlli__old()();
  else single_value->field_tlli__old = OMIT_VALUE;
} else {
  single_value->field_tlli__old.clean_up();
}
if (other_value.imsi().is_bound()) {
  single_value->field_imsi = other_value.imsi();
} else {
  single_value->field_imsi.clean_up();
}
if (other_value.comp__ref().is_bound()) {
  single_value->field_comp__ref = other_value.comp__ref();
} else {
  single_value->field_comp__ref.clean_up();
}
if (other_value.llc().is_bound()) {
  single_value->field_llc = other_value.llc();
} else {
  single_value->field_llc.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ClientEntity_template::copy_template(const ClientEntity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tlli().get_selection()) {
single_value->field_tlli = other_value.tlli();
} else {
single_value->field_tlli.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tlli__old().get_selection()) {
single_value->field_tlli__old = other_value.tlli__old();
} else {
single_value->field_tlli__old.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imsi().get_selection()) {
single_value->field_imsi = other_value.imsi();
} else {
single_value->field_imsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.comp__ref().get_selection()) {
single_value->field_comp__ref = other_value.comp__ref();
} else {
single_value->field_comp__ref.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.llc().get_selection()) {
single_value->field_llc = other_value.llc();
} else {
single_value->field_llc.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 ClientEntity_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 ClientEntity_template(*other_value.implication_.precondition);
implication_.implied_template = new ClientEntity_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 @BSSGP_Emulation.ClientEntity.");
break;
}
set_selection(other_value);
}

ClientEntity_template::ClientEntity_template()
{
}

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

ClientEntity_template::ClientEntity_template(const ClientEntity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ClientEntity_template::match(const ClientEntity& 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.tlli().is_bound()) return FALSE;
if(!single_value->field_tlli.match(other_value.tlli(), legacy))return FALSE;
if(!other_value.tlli__old().is_bound()) return FALSE;
if((other_value.tlli__old().ispresent() ? !single_value->field_tlli__old.match((const OCTETSTRING&)other_value.tlli__old(), legacy) : !single_value->field_tlli__old.match_omit(legacy)))return FALSE;
if(!other_value.imsi().is_bound()) return FALSE;
if(!single_value->field_imsi.match(other_value.imsi(), legacy))return FALSE;
if(!other_value.comp__ref().is_bound()) return FALSE;
if(!single_value->field_comp__ref.match(other_value.comp__ref(), legacy))return FALSE;
if(!other_value.llc().is_bound()) return FALSE;
if(!single_value->field_llc.match(other_value.llc(), 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 @BSSGP_Emulation.ClientEntity.");
}
return FALSE;
}

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

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

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

ClientEntity ClientEntity_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 @BSSGP_Emulation.ClientEntity.");
ClientEntity ret_val;
if (single_value->field_tlli.is_bound()) {
ret_val.tlli() = single_value->field_tlli.valueof();
}
if (single_value->field_tlli__old.is_omit()) ret_val.tlli__old() = OMIT_VALUE;
else if (single_value->field_tlli__old.is_bound()) {
ret_val.tlli__old() = single_value->field_tlli__old.valueof();
}
if (single_value->field_imsi.is_bound()) {
ret_val.imsi() = single_value->field_imsi.valueof();
}
if (single_value->field_comp__ref.is_bound()) {
ret_val.comp__ref() = single_value->field_comp__ref.valueof();
}
if (single_value->field_llc.is_bound()) {
ret_val.llc() = single_value->field_llc.valueof();
}
return ret_val;
}

void ClientEntity_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 @BSSGP_Emulation.ClientEntity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ClientEntity_template[list_length];
}

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

OCTETSTRING_template& ClientEntity_template::tlli()
{
set_specific();
return single_value->field_tlli;
}

const OCTETSTRING_template& ClientEntity_template::tlli() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tlli of a non-specific template of type @BSSGP_Emulation.ClientEntity.");
return single_value->field_tlli;
}

OCTETSTRING_template& ClientEntity_template::tlli__old()
{
set_specific();
return single_value->field_tlli__old;
}

const OCTETSTRING_template& ClientEntity_template::tlli__old() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tlli_old of a non-specific template of type @BSSGP_Emulation.ClientEntity.");
return single_value->field_tlli__old;
}

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

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

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

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

ClientEntity_llc_template& ClientEntity_template::llc()
{
set_specific();
return single_value->field_llc;
}

const ClientEntity_llc_template& ClientEntity_template::llc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field llc of a non-specific template of type @BSSGP_Emulation.ClientEntity.");
return single_value->field_llc;
}

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

void ClientEntity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tlli := ");
single_value->field_tlli.log();
TTCN_Logger::log_event_str(", tlli_old := ");
single_value->field_tlli__old.log();
TTCN_Logger::log_event_str(", imsi := ");
single_value->field_imsi.log();
TTCN_Logger::log_event_str(", comp_ref := ");
single_value->field_comp__ref.log();
TTCN_Logger::log_event_str(", llc := ");
single_value->field_llc.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 ClientEntity_template::log_match(const ClientEntity& 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_tlli.match(match_value.tlli(), legacy)){
TTCN_Logger::log_logmatch_info(".tlli");
single_value->field_tlli.log_match(match_value.tlli(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tlli__old().ispresent()){
if(!single_value->field_tlli__old.match(match_value.tlli__old(), legacy)){
TTCN_Logger::log_logmatch_info(".tlli_old");
single_value->field_tlli__old.log_match(match_value.tlli__old(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tlli__old.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tlli_old := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tlli__old.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_imsi.match(match_value.imsi(), legacy)){
TTCN_Logger::log_logmatch_info(".imsi");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_comp__ref.match(match_value.comp__ref(), legacy)){
TTCN_Logger::log_logmatch_info(".comp_ref");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_llc.match(match_value.llc(), legacy)){
TTCN_Logger::log_logmatch_info(".llc");
single_value->field_llc.log_match(match_value.llc(), 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("{ tlli := ");
single_value->field_tlli.log_match(match_value.tlli(), legacy);
TTCN_Logger::log_event_str(", tlli_old := ");
if (match_value.tlli__old().ispresent()) {
single_value->field_tlli__old.log_match(match_value.tlli__old(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tlli__old.log();
if (single_value->field_tlli__old.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", imsi := ");
single_value->field_imsi.log_match(match_value.imsi(), legacy);
TTCN_Logger::log_event_str(", comp_ref := ");
single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy);
TTCN_Logger::log_event_str(", llc := ");
single_value->field_llc.log_match(match_value.llc(), 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 ClientEntity_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tlli().is_bound()) tlli().set_implicit_omit();
if (!tlli__old().is_bound()) tlli__old() = OMIT_VALUE;
else tlli__old().set_implicit_omit();
if (imsi().is_bound()) imsi().set_implicit_omit();
if (comp__ref().is_bound()) comp__ref().set_implicit_omit();
if (llc().is_bound()) llc().set_implicit_omit();
}

void ClientEntity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tlli.encode_text(text_buf);
single_value->field_tlli__old.encode_text(text_buf);
single_value->field_imsi.encode_text(text_buf);
single_value->field_comp__ref.encode_text(text_buf);
single_value->field_llc.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 @BSSGP_Emulation.ClientEntity.");
}
}

void ClientEntity_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_tlli.decode_text(text_buf);
single_value->field_tlli__old.decode_text(text_buf);
single_value->field_imsi.decode_text(text_buf);
single_value->field_comp__ref.decode_text(text_buf);
single_value->field_llc.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 ClientEntity_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 @BSSGP_Emulation.ClientEntity.");
}
}

void ClientEntity_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: {
    ClientEntity_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Emulation.ClientEntity has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tlli().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tlli__old().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) comp__ref().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) llc().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tlli")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tlli().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(), "tlli_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tlli__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "comp_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          comp__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc().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 @BSSGP_Emulation.ClientEntity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ClientEntity_template* precondition = new ClientEntity_template;
    precondition->set_param(*param.get_elem(0));
    ClientEntity_template* implied_template = new ClientEntity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ClientEntity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Emulation.ClientEntity");
  }
  is_ifpresent = param.get_ifpresent();
}

void ClientEntity_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_tlli.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.ClientEntity");
single_value->field_tlli__old.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.ClientEntity");
single_value->field_imsi.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.ClientEntity");
single_value->field_comp__ref.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.ClientEntity");
single_value->field_llc.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.ClientEntity");
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 : "@BSSGP_Emulation.ClientEntity");
}

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

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

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

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

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

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

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

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

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

void BSSGP__BVC__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const Socket__API__Definitions::PortEvent_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const Socket__API__Definitions::PortEvent& send_par_value = Socket__API__Definitions::PortEvent(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__SP__PT::send(const BssgpStatusIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const BssgpStatusIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const BssgpStatusIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__SP__PT::send(const BssgpResetIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const BssgpResetIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const BssgpResetIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__SP__PT::send(const NS__Emulation::NsUnitdataIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataIndication& send_par_value = NS__Emulation::NsUnitdataIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const NS__Emulation::NsUnitdataIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataIndication& send_par_value = NS__Emulation::NsUnitdataIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__SP__PT::send(const NS__Emulation::NsUnitdataIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataIndication& send_par_value = NS__Emulation::NsUnitdataIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

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

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

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

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

boolean BSSGP__BVC__SP__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@NS_Emulation.NsUnitdataRequest")) {
NS__Emulation::NsUnitdataRequest incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

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

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

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

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

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

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

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

void BSSGP__BVC__PT::send(const NS__Emulation::NsUnitdataRequest_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataRequest& send_par_value = NS__Emulation::NsUnitdataRequest(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__PT::send(const NS__Emulation::NsUnitdataRequest_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataRequest& send_par_value = NS__Emulation::NsUnitdataRequest(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__PT::send(const NS__Emulation::NsUnitdataRequest_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const NS__Emulation::NsUnitdataRequest& send_par_value = NS__Emulation::NsUnitdataRequest(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__BVC__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@Socket_API_Definitions.PortEvent")) {
Socket__API__Definitions::PortEvent incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpStatusIndication")) {
BssgpStatusIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpResetIndication")) {
BssgpResetIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@NS_Emulation.NsUnitdataIndication")) {
NS__Emulation::NsUnitdataIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

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

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

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

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

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

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

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

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpStatusIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpStatusIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpStatusIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpStatusIndication& send_par_value = BssgpStatusIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpResetIndication_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpResetIndication_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__MGMT__SP__PT::send(const BssgpResetIndication_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpResetIndication& send_par_value = BssgpResetIndication(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__BVC__MGMT__SP__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@BSSGP_Emulation.BssgpResetRequest")) {
BssgpResetRequest incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpBlockRequest")) {
BssgpBlockRequest incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpUnblockRequest")) {
BssgpUnblockRequest incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

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

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

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

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

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

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

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

void BSSGP__BVC__MGMT__PT::send(const BssgpResetRequest_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpResetRequest& send_par_value = BssgpResetRequest(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpResetRequest_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpResetRequest& send_par_value = BssgpResetRequest(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpResetRequest_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpResetRequest& send_par_value = BssgpResetRequest(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__MGMT__PT::send(const BssgpBlockRequest_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpBlockRequest& send_par_value = BssgpBlockRequest(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpBlockRequest_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpBlockRequest& send_par_value = BssgpBlockRequest(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpBlockRequest_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpBlockRequest& send_par_value = BssgpBlockRequest(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

void BSSGP__BVC__MGMT__PT::send(const BssgpUnblockRequest_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const BssgpUnblockRequest& send_par_value = BssgpUnblockRequest(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpUnblockRequest_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const BssgpUnblockRequest& send_par_value = BssgpUnblockRequest(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void BSSGP__BVC__MGMT__PT::send(const BssgpUnblockRequest_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const BssgpUnblockRequest& send_par_value = BssgpUnblockRequest(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

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

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

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

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

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

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

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

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

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

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

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

boolean BSSGP__BVC__MGMT__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@BSSGP_Emulation.BssgpStatusIndication")) {
BssgpStatusIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@BSSGP_Emulation.BssgpResetIndication")) {
BssgpResetIndication incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

BssgpResetRequest::BssgpResetRequest()
{
}

BssgpResetRequest::BssgpResetRequest(const Osmocom__Gb__Types::BssgpCause& par_cause)
  :   field_cause(par_cause)
{
}

BssgpResetRequest::BssgpResetRequest(const BssgpResetRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpResetRequest.");
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void BssgpResetRequest::clean_up()
{
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* BssgpResetRequest::get_descriptor() const { return &BssgpResetRequest_descr_; }
BssgpResetRequest& BssgpResetRequest::operator=(const BssgpResetRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpResetRequest.");
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean BssgpResetRequest::operator==(const BssgpResetRequest& other_value) const
{
return field_cause==other_value.field_cause;
}

boolean BssgpResetRequest::is_bound() const
{
return (field_cause.is_bound());
}
boolean BssgpResetRequest::is_value() const
{
return field_cause.is_value();
}
void BssgpResetRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpResetRequest::set_implicit_omit()
{
if (cause().is_bound()) cause().set_implicit_omit();
}

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

void BssgpResetRequest::encode_text(Text_Buf& text_buf) const
{
field_cause.encode_text(text_buf);
}

void BssgpResetRequest::decode_text(Text_Buf& text_buf)
{
field_cause.decode_text(text_buf);
}

struct BssgpResetRequest_template::single_value_struct {
Osmocom__Gb__Types::BssgpCause_template field_cause;
};

void BssgpResetRequest_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_cause = ANY_VALUE;
}
}
}

void BssgpResetRequest_template::copy_value(const BssgpResetRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpResetRequest_template::copy_template(const BssgpResetRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.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 BssgpResetRequest_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 BssgpResetRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpResetRequest_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 @BSSGP_Emulation.BssgpResetRequest.");
break;
}
set_selection(other_value);
}

BssgpResetRequest_template::BssgpResetRequest_template()
{
}

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

BssgpResetRequest_template::BssgpResetRequest_template(const BssgpResetRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpResetRequest_template::match(const BssgpResetRequest& 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.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), 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 @BSSGP_Emulation.BssgpResetRequest.");
}
return FALSE;
}

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

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

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

BssgpResetRequest BssgpResetRequest_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 @BSSGP_Emulation.BssgpResetRequest.");
BssgpResetRequest ret_val;
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void BssgpResetRequest_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 @BSSGP_Emulation.BssgpResetRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpResetRequest_template[list_length];
}

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

Osmocom__Gb__Types::BssgpCause_template& BssgpResetRequest_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Osmocom__Gb__Types::BssgpCause_template& BssgpResetRequest_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Emulation.BssgpResetRequest.");
return single_value->field_cause;
}

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

void BssgpResetRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cause := ");
single_value->field_cause.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 BssgpResetRequest_template::log_match(const BssgpResetRequest& 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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), 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("{ cause := ");
single_value->field_cause.log_match(match_value.cause(), 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 BssgpResetRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cause().is_bound()) cause().set_implicit_omit();
}

void BssgpResetRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cause.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 @BSSGP_Emulation.BssgpResetRequest.");
}
}

void BssgpResetRequest_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_cause.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 BssgpResetRequest_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 @BSSGP_Emulation.BssgpResetRequest.");
}
}

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

void BssgpResetRequest_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_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpResetRequest");
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 : "@BSSGP_Emulation.BssgpResetRequest");
}

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

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

BssgpBlockRequest::BssgpBlockRequest()
{
}

BssgpBlockRequest::BssgpBlockRequest(const Osmocom__Gb__Types::BssgpCause& par_cause)
  :   field_cause(par_cause)
{
}

BssgpBlockRequest::BssgpBlockRequest(const BssgpBlockRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.BssgpBlockRequest.");
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void BssgpBlockRequest::clean_up()
{
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* BssgpBlockRequest::get_descriptor() const { return &BssgpBlockRequest_descr_; }
BssgpBlockRequest& BssgpBlockRequest::operator=(const BssgpBlockRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Emulation.BssgpBlockRequest.");
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean BssgpBlockRequest::operator==(const BssgpBlockRequest& other_value) const
{
return field_cause==other_value.field_cause;
}

boolean BssgpBlockRequest::is_bound() const
{
return (field_cause.is_bound());
}
boolean BssgpBlockRequest::is_value() const
{
return field_cause.is_value();
}
void BssgpBlockRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpBlockRequest::set_implicit_omit()
{
if (cause().is_bound()) cause().set_implicit_omit();
}

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

void BssgpBlockRequest::encode_text(Text_Buf& text_buf) const
{
field_cause.encode_text(text_buf);
}

void BssgpBlockRequest::decode_text(Text_Buf& text_buf)
{
field_cause.decode_text(text_buf);
}

struct BssgpBlockRequest_template::single_value_struct {
Osmocom__Gb__Types::BssgpCause_template field_cause;
};

void BssgpBlockRequest_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_cause = ANY_VALUE;
}
}
}

void BssgpBlockRequest_template::copy_value(const BssgpBlockRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpBlockRequest_template::copy_template(const BssgpBlockRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.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 BssgpBlockRequest_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 BssgpBlockRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpBlockRequest_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 @BSSGP_Emulation.BssgpBlockRequest.");
break;
}
set_selection(other_value);
}

BssgpBlockRequest_template::BssgpBlockRequest_template()
{
}

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

BssgpBlockRequest_template::BssgpBlockRequest_template(const BssgpBlockRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpBlockRequest_template::match(const BssgpBlockRequest& 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.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), 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 @BSSGP_Emulation.BssgpBlockRequest.");
}
return FALSE;
}

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

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

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

BssgpBlockRequest BssgpBlockRequest_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 @BSSGP_Emulation.BssgpBlockRequest.");
BssgpBlockRequest ret_val;
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void BssgpBlockRequest_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 @BSSGP_Emulation.BssgpBlockRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpBlockRequest_template[list_length];
}

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

Osmocom__Gb__Types::BssgpCause_template& BssgpBlockRequest_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Osmocom__Gb__Types::BssgpCause_template& BssgpBlockRequest_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Emulation.BssgpBlockRequest.");
return single_value->field_cause;
}

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

void BssgpBlockRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cause := ");
single_value->field_cause.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 BssgpBlockRequest_template::log_match(const BssgpBlockRequest& 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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), 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("{ cause := ");
single_value->field_cause.log_match(match_value.cause(), 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 BssgpBlockRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cause().is_bound()) cause().set_implicit_omit();
}

void BssgpBlockRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cause.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 @BSSGP_Emulation.BssgpBlockRequest.");
}
}

void BssgpBlockRequest_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_cause.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 BssgpBlockRequest_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 @BSSGP_Emulation.BssgpBlockRequest.");
}
}

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

void BssgpBlockRequest_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_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.BssgpBlockRequest");
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 : "@BSSGP_Emulation.BssgpBlockRequest");
}

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

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

BssgpUnblockRequest::BssgpUnblockRequest()
{
bound_flag = FALSE;
}

BssgpUnblockRequest::BssgpUnblockRequest(null_type)
{
bound_flag = TRUE;
}

BssgpUnblockRequest::BssgpUnblockRequest(const BssgpUnblockRequest& other_value)
{
other_value.must_bound("Copying an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
bound_flag = TRUE;
}

BssgpUnblockRequest& BssgpUnblockRequest::operator=(null_type)
{
bound_flag = TRUE;
return *this;
}

BssgpUnblockRequest& BssgpUnblockRequest::operator=(const BssgpUnblockRequest& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
bound_flag = TRUE;
return *this;
}

boolean BssgpUnblockRequest::operator==(null_type) const
{
must_bound("Comparison of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
return TRUE;
}

boolean BssgpUnblockRequest::operator==(const BssgpUnblockRequest& other_value) const
{
must_bound("Comparison of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
other_value.must_bound("Comparison of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
return TRUE;
}

void BssgpUnblockRequest::log() const
{
if (bound_flag) TTCN_Logger::log_event_str("{ }");
else TTCN_Logger::log_event_unbound();
}

void BssgpUnblockRequest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "empty record/set value (i.e. { })");
  if (param.get_type()!=Module_Param::MP_Value_List || param.get_size()>0) {
    param.type_error("empty record/set value (i.e. { })", "@BSSGP_Emulation.BssgpUnblockRequest");
  }
  bound_flag = TRUE;
}

void BssgpUnblockRequest::encode_text(Text_Buf& /*text_buf*/) const
{
must_bound("Text encoder: Encoding an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
}

void BssgpUnblockRequest::decode_text(Text_Buf& /*text_buf*/)
{
bound_flag = TRUE;
}

void BssgpUnblockRequest_template::copy_template(const BssgpUnblockRequest_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 BssgpUnblockRequest_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 BssgpUnblockRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpUnblockRequest_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 @BSSGP_Emulation.BssgpUnblockRequest.");
break;
}
}

BssgpUnblockRequest_template::BssgpUnblockRequest_template()
{
}

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

BssgpUnblockRequest_template::BssgpUnblockRequest_template(null_type)
 : Base_Template(SPECIFIC_VALUE)
{
}

BssgpUnblockRequest_template::BssgpUnblockRequest_template(const BssgpUnblockRequest& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
}

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

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

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

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

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

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

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

BssgpUnblockRequest_template& BssgpUnblockRequest_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

BssgpUnblockRequest_template& BssgpUnblockRequest_template::operator=(const BssgpUnblockRequest& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

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

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

boolean BssgpUnblockRequest_template::match(null_type other_value,boolean) const
{
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
return TRUE;
case OMIT_VALUE:
return FALSE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Emulation.BssgpUnblockRequest.");
}
return FALSE;
}

boolean BssgpUnblockRequest_template::match(const BssgpUnblockRequest& other_value, boolean) const
{
if (!other_value.is_bound()) return FALSE;
return match(NULL_VALUE);
}

BssgpUnblockRequest BssgpUnblockRequest_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 @BSSGP_Emulation.BssgpUnblockRequest.");
return NULL_VALUE;
}

void BssgpUnblockRequest_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 @BSSGP_Emulation.BssgpUnblockRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpUnblockRequest_template[list_length];
}

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

void BssgpUnblockRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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 BssgpUnblockRequest_template::log_match(const BssgpUnblockRequest& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void BssgpUnblockRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 @BSSGP_Emulation.BssgpUnblockRequest.");
}
}

void BssgpUnblockRequest_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BssgpUnblockRequest_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 @BSSGP_Emulation.BssgpUnblockRequest.");
}
}

void BssgpUnblockRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set 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: {
    BssgpUnblockRequest_template temp;
    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++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Value_List:
    if (param.get_size()>0) param.type_error("empty record/set template", "@BSSGP_Emulation.BssgpUnblockRequest");
    *this = NULL_VALUE;
    break;
  case Module_Param::MP_Implication_Template: {
    BssgpUnblockRequest_template* precondition = new BssgpUnblockRequest_template;
    precondition->set_param(*param.get_elem(0));
    BssgpUnblockRequest_template* implied_template = new BssgpUnblockRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpUnblockRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("empty record/set template", "@BSSGP_Emulation.BssgpUnblockRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void BssgpUnblockRequest_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;
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 : "@BSSGP_Emulation.BssgpUnblockRequest");
}

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

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


const LLC__Entity LLC__Entities::UNBOUND_ELEM;
LLC__Entities::LLC__Entities()
{
val_ptr = NULL;
}

LLC__Entities::LLC__Entities(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

LLC__Entities::LLC__Entities(const LLC__Entities& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Emulation.LLC_Entities.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

LLC__Entities::~LLC__Entities()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void LLC__Entities::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

LLC__Entities& LLC__Entities::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

LLC__Entities& LLC__Entities::operator=(const LLC__Entities& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean LLC__Entities::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
return val_ptr->n_elements == 0 ;
}

boolean LLC__Entities::operator==(const LLC__Entities& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

LLC__Entity& LLC__Entities::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Emulation.LLC_Entities using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (LLC__Entity**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new LLC__Entity(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new LLC__Entity;
}
return *val_ptr->value_elements[index_value];
}

LLC__Entity& LLC__Entities::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Emulation.LLC_Entities.");
return (*this)[(int)index_value];
}

const LLC__Entity& LLC__Entities::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Emulation.LLC_Entities using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BSSGP_Emulation.LLC_Entities: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const LLC__Entity& LLC__Entities::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Emulation.LLC_Entities.");
return (*this)[(int)index_value];
}

LLC__Entities LLC__Entities::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

LLC__Entities LLC__Entities::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

LLC__Entities LLC__Entities::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

LLC__Entities LLC__Entities::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
LLC__Entities ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new LLC__Entity(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

LLC__Entities LLC__Entities::operator+(const LLC__Entities& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Emulation.LLC_Entities concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
LLC__Entities ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new LLC__Entity(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new LLC__Entity(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

LLC__Entities LLC__Entities::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Emulation.LLC_Entities","element");
LLC__Entities ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new LLC__Entity(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

LLC__Entities LLC__Entities::replace(int index, int len, const LLC__Entities& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Emulation.LLC_Entities","element");
LLC__Entities ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new LLC__Entity(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new LLC__Entity(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new LLC__Entity(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

LLC__Entities LLC__Entities::replace(int index, int len, const LLC__Entities_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void LLC__Entities::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Emulation.LLC_Entities.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (LLC__Entity**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new LLC__Entity(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (LLC__Entity**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BSSGP_Emulation.LLC_Entities: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (LLC__Entity**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean LLC__Entities::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int LLC__Entities::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Emulation.LLC_Entities.");
return val_ptr->n_elements;
}

int LLC__Entities::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Emulation.LLC_Entities.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void LLC__Entities::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void LLC__Entities::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void LLC__Entities::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BSSGP_Emulation.LLC_Entities");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BSSGP_Emulation.LLC_Entities");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void LLC__Entities::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Emulation.LLC_Entities.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void LLC__Entities::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BSSGP_Emulation.LLC_Entities.");
val_ptr->value_elements = (LLC__Entity**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new LLC__Entity;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void LLC__Entities_template::copy_value(const LLC__Entities& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Emulation.LLC_Entities with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (LLC__Entity_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new LLC__Entity_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new LLC__Entity_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void LLC__Entities_template::copy_template(const LLC__Entities_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (LLC__Entity_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new LLC__Entity_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new LLC__Entity_template;
}
}
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 LLC__Entities_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 LLC__Entities_template(*other_value.implication_.precondition);
implication_.implied_template = new LLC__Entities_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 @BSSGP_Emulation.LLC_Entities.");
break;
}
set_selection(other_value);
}

boolean LLC__Entities_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const LLC__Entities_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const LLC__Entities*)value_ptr)[value_index], legacy);
else return ((const LLC__Entities_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

LLC__Entities_template::LLC__Entities_template()
{
}

LLC__Entities_template::LLC__Entities_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

LLC__Entities_template::LLC__Entities_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

LLC__Entities_template::LLC__Entities_template(const LLC__Entities& other_value)
{
copy_value(other_value);
}

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

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

LLC__Entities_template::LLC__Entities_template(Dynamic_Match_Interface<LLC__Entities>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<LLC__Entities>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

LLC__Entities_template::LLC__Entities_template(const LLC__Entities_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

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

void LLC__Entities_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
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;
}

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

LLC__Entities_template& LLC__Entities_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

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

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

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

LLC__Entity_template& LLC__Entities_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Emulation.LLC_Entities using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Emulation.LLC_Entities.");
    break;
}
return *single_value.value_elements[index_value];
}

LLC__Entity_template& LLC__Entities_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Emulation.LLC_Entities.");
return (*this)[(int)index_value];
}

const LLC__Entity_template& LLC__Entities_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Emulation.LLC_Entities using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Emulation.LLC_Entities.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Emulation.LLC_Entities: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const LLC__Entity_template& LLC__Entities_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Emulation.LLC_Entities.");
return (*this)[(int)index_value];
}

void LLC__Entities_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BSSGP_Emulation.LLC_Entities.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (LLC__Entity_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new LLC__Entity_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new LLC__Entity_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (LLC__Entity_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int LLC__Entities_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int LLC__Entities_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BSSGP_Emulation.LLC_Entities containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Emulation.LLC_Entities.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Emulation.LLC_Entities");
}

boolean LLC__Entities_template::match(const LLC__Entities& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, 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 with an uninitialized/unsupported template of type @BSSGP_Emulation.LLC_Entities.");
}
return FALSE;
}

boolean LLC__Entities_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

LLC__Entities LLC__Entities_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 @BSSGP_Emulation.LLC_Entities.");
LLC__Entities ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

LLC__Entities LLC__Entities_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

LLC__Entities LLC__Entities_template::replace(int index, int len, const LLC__Entities_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

LLC__Entities LLC__Entities_template::replace(int index, int len, const LLC__Entities& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

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

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

void LLC__Entities_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else 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_restricted();
log_ifpresent();
}

void LLC__Entities_template::log_match(const LLC__Entities& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} 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 LLC__Entities_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->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 @BSSGP_Emulation.LLC_Entities.");
}
}

void LLC__Entities_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BSSGP_Emulation.LLC_Entities.");
single_value.value_elements = (LLC__Entity_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new LLC__Entity_template;
single_value.value_elements[elem_count]->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 LLC__Entities_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 for a template of type @BSSGP_Emulation.LLC_Entities.");
}
}

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

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

void LLC__Entities_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void LLC__Entities_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: {
    LLC__Entities_template temp;
    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++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    LLC__Entities_template* precondition = new LLC__Entities_template;
    precondition->set_param(*param.get_elem(0));
    LLC__Entities_template* implied_template = new LLC__Entities_template;
    implied_template->set_param(*param.get_elem(1));
    *this = LLC__Entities_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Emulation.LLC_Entities");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void LLC__Entities_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;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BSSGP_Emulation.LLC_Entities");
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 : "@BSSGP_Emulation.LLC_Entities");
}

boolean LLC__Entities_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
as__ptp__blocked_Default::as__ptp__blocked_Default()
 : Default_Base("as_ptp_blocked")
{
}

alt_status as__ptp__blocked_Default::call_altstep(boolean first_alt_run)
{
return as__ptp__blocked_instance(first_alt_run);
}

as__ptp__unblocked_Default::as__ptp__unblocked_Default()
 : Default_Base("as_ptp_unblocked")
{
}

alt_status as__ptp__unblocked_Default::call_altstep(boolean first_alt_run)
{
return as__ptp__unblocked_instance(first_alt_run);
}

as__ptp__handle__inbound__reset_Default::as__ptp__handle__inbound__reset_Default()
 : Default_Base("as_ptp_handle_inbound_reset")
{
}

alt_status as__ptp__handle__inbound__reset_Default::call_altstep(boolean first_alt_run)
{
return as__ptp__handle__inbound__reset_instance(first_alt_run);
}

as__ptp__allstate_Default::as__ptp__allstate_Default()
 : Default_Base("as_ptp_allstate")
{
}

alt_status as__ptp__allstate_Default::call_altstep(boolean first_alt_run)
{
return as__ptp__allstate_instance(first_alt_run);
}


/* Bodies of functions, altsteps and testcases */

BssgpStatusIndication_template ts__BssgpStsInd(const INTEGER_template& nsei, const INTEGER_template& bvci, const BvcState_template& state)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 54, TTCN_Location::LOCATION_TEMPLATE, "ts_BssgpStsInd");
BssgpStatusIndication_template ret_val;
ret_val.nsei() = nsei;
ret_val.bvci() = bvci;
ret_val.state() = state;
return ret_val;
}

BssgpStatusIndication_template tr__BssgpStsInd(const INTEGER_template& nsei, const INTEGER_template& bvci, const BvcState_template& state)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 62, TTCN_Location::LOCATION_TEMPLATE, "tr_BssgpStsInd");
BssgpStatusIndication_template ret_val;
ret_val.nsei() = nsei;
ret_val.bvci() = bvci;
ret_val.state() = state;
return ret_val;
}

void f__bssgp__client__register(const HEXSTRING& imsi, const OCTETSTRING& tlli, BSSGP__PROC__PT& PT)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 157, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_client_register");
current_location.update_lineno(159);
/* BSSGP_Emulation.ttcnpp, line 159 */
{
BSSGP__register__client_template tmp_0;
tmp_0.imsi() = imsi;
tmp_0.tlli() = tlli;
PT.call(tmp_0, FALSE, NULL);
}
{
alt_status tmp_1_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(159);
/* BSSGP_Emulation.ttcnpp, line 159 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_1_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(160);
/* BSSGP_Emulation.ttcnpp, line 160 */
{
BSSGP__register__client_template tmp_2;
tmp_2.imsi() = imsi;
tmp_2.tlli() = tlli;
tmp_1_alt_flag_0 = PT.getreply(tmp_2, any_compref, BSSGP__register__client_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_1_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(159);
/* BSSGP_Emulation.ttcnpp, line 159 */
if (tmp_1_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file BSSGP_Emulation.ttcnpp between lines 159 and 161.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__bssgp__client__unregister(const HEXSTRING& imsi, BSSGP__PROC__PT& PT)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 164, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_client_unregister");
current_location.update_lineno(166);
/* BSSGP_Emulation.ttcnpp, line 166 */
{
BSSGP__unregister__client_template tmp_3;
tmp_3.imsi() = imsi;
PT.call(tmp_3, FALSE, NULL);
}
{
alt_status tmp_4_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(166);
/* BSSGP_Emulation.ttcnpp, line 166 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_4_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(167);
/* BSSGP_Emulation.ttcnpp, line 167 */
{
BSSGP__unregister__client_template tmp_5;
tmp_5.imsi() = imsi;
tmp_4_alt_flag_0 = PT.getreply(tmp_5, any_compref, BSSGP__unregister__client_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_4_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(166);
/* BSSGP_Emulation.ttcnpp, line 166 */
if (tmp_4_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file BSSGP_Emulation.ttcnpp between lines 166 and 168.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__bssgp__client__llgmm__assign(const OCTETSTRING& tlli__old, const OCTETSTRING& tlli__new, BSSGP__PROC__PT& PT)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 172, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_client_llgmm_assign");
current_location.update_lineno(174);
/* BSSGP_Emulation.ttcnpp, line 174 */
{
BSSGP__llgmm__assign_template tmp_6;
tmp_6.tlli__old() = tlli__old;
tmp_6.tlli() = tlli__new;
PT.call(tmp_6, FALSE, NULL);
}
{
alt_status tmp_7_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(174);
/* BSSGP_Emulation.ttcnpp, line 174 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_7_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(175);
/* BSSGP_Emulation.ttcnpp, line 175 */
{
BSSGP__llgmm__assign_template tmp_8;
tmp_8.tlli__old() = tlli__old;
tmp_8.tlli() = tlli__new;
tmp_7_alt_flag_0 = PT.getreply(tmp_8, any_compref, BSSGP__llgmm__assign_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_7_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(174);
/* BSSGP_Emulation.ttcnpp, line 174 */
if (tmp_7_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file BSSGP_Emulation.ttcnpp between lines 174 and 176.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void BssgpStart(const BssgpConfig& cfg, const CHARSTRING& id)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 193, TTCN_Location::LOCATION_FUNCTION, "BssgpStart");
current_location.update_lineno(194);
/* BSSGP_Emulation.ttcnpp, line 194 */
BSSGP__CT_component_g__cfg = cfg;
{
current_location.update_lineno(197);
/* BSSGP_Emulation.ttcnpp, line 197 */
INTEGER i(0);
current_location.update_lineno(197);
/* BSSGP_Emulation.ttcnpp, line 197 */
for ( ; ; ) {
current_location.update_lineno(197);
/* BSSGP_Emulation.ttcnpp, line 197 */
if (!(i < const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).bvc().lengthof())) break;
current_location.update_lineno(198);
/* BSSGP_Emulation.ttcnpp, line 198 */
BssgpBvcConfig bvc__cfg(const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).bvc()[i]);
current_location.update_lineno(199);
/* BSSGP_Emulation.ttcnpp, line 199 */
CHARSTRING bvc__id(((id + cs_0) + int2str(const_cast< const BssgpBvcConfig&>(bvc__cfg).bvci())));
current_location.update_lineno(201);
/* BSSGP_Emulation.ttcnpp, line 201 */
COMPONENT bvc__ct(TTCN_Runtime::create_component("BSSGP_Emulation", "BSSGP_BVC_CT", bvc__id, NULL, TRUE));
current_location.update_lineno(202);
/* BSSGP_Emulation.ttcnpp, line 202 */
TTCN_Runtime::connect_port(bvc__ct, BSSGP__BVC__CT_component_BVC.get_name(), self, BSSGP__CT_component_BVC.get_name());
current_location.update_lineno(203);
/* BSSGP_Emulation.ttcnpp, line 203 */
start_f__bssgp__bvc__main(bvc__ct, bvc__cfg, const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).sgsn__role(), const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei(), bvc__id);
current_location.update_lineno(205);
/* BSSGP_Emulation.ttcnpp, line 205 */
{
BvcEntity& tmp_11 = BSSGP__CT_component_BvcTable[i]; /* 7388 */
tmp_11.bvci() = const_cast< const BssgpBvcConfig&>(bvc__cfg).bvci();
tmp_11.cell__id() = const_cast< const BssgpBvcConfig&>(bvc__cfg).cell__id();
tmp_11.comp__ref() = bvc__ct;
}
current_location.update_lineno(197);
/* BSSGP_Emulation.ttcnpp, line 197 */
{
INTEGER tmp_12;
++i;
}
}
}
current_location.update_lineno(212);
/* BSSGP_Emulation.ttcnpp, line 212 */
if (const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).sgsn__role()) {
current_location.update_lineno(214);
/* BSSGP_Emulation.ttcnpp, line 214 */
f__sign__change__state(BvcState::BVC__S__WAIT__RESET);
}
else {
current_location.update_lineno(217);
/* BSSGP_Emulation.ttcnpp, line 217 */
f__sign__change__state(BvcState::BVC__S__WAIT__NS__ALIVE__UNBLOCKED);
}
current_location.update_lineno(221);
/* BSSGP_Emulation.ttcnpp, line 221 */
f__bssgp__ScanEvents();
}

void start_BssgpStart(const COMPONENT& component_reference, const BssgpConfig& cfg, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function BssgpStart(");
cfg.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, "BSSGP_Emulation", "BssgpStart", text_buf);
cfg.encode_text(text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

boolean operator==(null_type, const BssgpBvcConfigs& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Emulation.BssgpBvcConfigs.");
return other_value.val_ptr->n_elements == 0;
}

COMPONENT f__comp__for__bvci(const INTEGER& bvci)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 265, TTCN_Location::LOCATION_FUNCTION, "f_comp_for_bvci");
current_location.update_lineno(266);
/* BSSGP_Emulation.ttcnpp, line 266 */
INTEGER i;
current_location.update_lineno(268);
/* BSSGP_Emulation.ttcnpp, line 268 */
i = 0;
current_location.update_lineno(268);
/* BSSGP_Emulation.ttcnpp, line 268 */
for ( ; ; ) {
current_location.update_lineno(268);
/* BSSGP_Emulation.ttcnpp, line 268 */
if (!(i < BSSGP__CT_component_BvcTable.lengthof())) break;
current_location.update_lineno(269);
/* BSSGP_Emulation.ttcnpp, line 269 */
if ((const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].bvci() == bvci)) {
current_location.update_lineno(270);
/* BSSGP_Emulation.ttcnpp, line 270 */
return const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref();
}
current_location.update_lineno(268);
/* BSSGP_Emulation.ttcnpp, line 268 */
{
INTEGER tmp_14;
++i;
}
}
current_location.update_lineno(273);
/* BSSGP_Emulation.ttcnpp, line 273 */
return NULL_COMPREF;
}

void start_f__comp__for__bvci(const COMPONENT& component_reference, const INTEGER& bvci)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_for_bvci(");
bvci.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, "BSSGP_Emulation", "f_comp_for_bvci", text_buf);
bvci.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__sig__wait__reset_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 277, TTCN_Location::LOCATION_ALTSTEP, "as_sig_wait_reset");
current_location.update_lineno(278);
/* BSSGP_Emulation.ttcnpp, line 278 */
NS__Emulation::NsUnitdataIndication udi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(281);
/* BSSGP_Emulation.ttcnpp, line 281 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(0), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(282);
/* BSSGP_Emulation.ttcnpp, line 282 */
TTCN_Logger::log_str(TTCN_USER, "Rx BVC-RESET for Signaling BVCI=0");
current_location.update_lineno(283);
/* BSSGP_Emulation.ttcnpp, line 283 */
f__sign__change__state(BvcState::BVC__S__UNBLOCKED);
current_location.update_lineno(284);
/* BSSGP_Emulation.ttcnpp, line 284 */
if (BSSGP__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(285);
/* BSSGP_Emulation.ttcnpp, line 285 */
{
BssgpResetIndication_template tmp_15;
tmp_15.bvci() = 0;
BSSGP__CT_component_MGMT.send(tmp_15, FALSE, NULL);
}
}
current_location.update_lineno(287);
/* BSSGP_Emulation.ttcnpp, line 287 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET__ACK(0, Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__sig__wait__reset(boolean nodefault_modifier)
{
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__sig__wait__reset_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_sig_wait_reset.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__sig__wait__reset()
{
return new as__sig__wait__reset_Default();
}

alt_status as__sig__unblocked_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 305, TTCN_Location::LOCATION_ALTSTEP, "as_sig_unblocked");
current_location.update_lineno(306);
/* BSSGP_Emulation.ttcnpp, line 306 */
COMPONENT bvc__comp__ref;
current_location.update_lineno(307);
/* BSSGP_Emulation.ttcnpp, line 307 */
COMPONENT vc__conn;
current_location.update_lineno(308);
/* BSSGP_Emulation.ttcnpp, line 308 */
NS__Emulation::NsUnitdataIndication udi;
current_location.update_lineno(309);
/* BSSGP_Emulation.ttcnpp, line 309 */
NS__Emulation::NsUnitdataRequest udr;
current_location.update_lineno(310);
/* BSSGP_Emulation.ttcnpp, line 310 */
BSSGP__Types::PDU__BSSGP bssgp;
alt_status ret_val = ALT_NO;
current_location.update_lineno(313);
/* BSSGP_Emulation.ttcnpp, line 313 */
{
alt_status tmp_17;
{
INTEGER_template tmp_16;
tmp_16.set_type(VALUE_RANGE);
tmp_16.set_min(2);
tmp_16.set_max(65535);
tmp_17 = BSSGP__CT_component_BSCP.receive(f__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), tmp_16), &(udi), any_compref, NULL, NULL, NULL);
}
switch (tmp_17) {
case ALT_YES:
{
current_location.update_lineno(314);
/* BSSGP_Emulation.ttcnpp, line 314 */
bvc__comp__ref = f__comp__for__bvci(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci());
current_location.update_lineno(315);
/* BSSGP_Emulation.ttcnpp, line 315 */
{
boolean tmp_19;
tmp_19 = bvc__comp__ref.is_bound();
if (tmp_19) tmp_19 = (bvc__comp__ref != NULL_COMPREF);
if (tmp_19) {
current_location.update_lineno(317);
/* BSSGP_Emulation.ttcnpp, line 317 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(bvc__comp__ref), NULL);
}
else {
current_location.update_lineno(319);
/* BSSGP_Emulation.ttcnpp, line 319 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BSSGP for unknown PTP BVCI "),const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci().log(),TTCN_Logger::log_event_str(": "),const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(320);
/* BSSGP_Emulation.ttcnpp, line 320 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci()), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__BVCI__UNKNOWN), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci(), 0), FALSE, NULL);
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(325);
/* BSSGP_Emulation.ttcnpp, line 325 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(tr__GLOBAL__SIG, INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(326);
/* BSSGP_Emulation.ttcnpp, line 326 */
if (BSSGP__CT_component_GLOBAL.check_port_state(cs_1)) {
current_location.update_lineno(327);
/* BSSGP_Emulation.ttcnpp, line 327 */
BSSGP__CT_component_GLOBAL.send(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()(), FALSE, NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(330);
/* BSSGP_Emulation.ttcnpp, line 330 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(tr__RIM, INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(331);
/* BSSGP_Emulation.ttcnpp, line 331 */
if (BSSGP__CT_component_RIM.check_port_state(cs_1)) {
current_location.update_lineno(332);
/* BSSGP_Emulation.ttcnpp, line 332 */
BSSGP__CT_component_RIM.send(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()(), FALSE, NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(337);
/* BSSGP_Emulation.ttcnpp, line 337 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK(OCTETSTRING_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval, Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK_nsei_defval), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(338);
/* BSSGP_Emulation.ttcnpp, line 338 */
TTCN_Logger::log_str(TTCN_USER, "Rx FLUSH_LL_ACK: broadcasting");
{
current_location.update_lineno(339);
/* BSSGP_Emulation.ttcnpp, line 339 */
INTEGER i(0);
current_location.update_lineno(339);
/* BSSGP_Emulation.ttcnpp, line 339 */
for ( ; ; ) {
current_location.update_lineno(339);
/* BSSGP_Emulation.ttcnpp, line 339 */
if (!(i < BSSGP__CT_component_BvcTable.lengthof())) break;
current_location.update_lineno(340);
/* BSSGP_Emulation.ttcnpp, line 340 */
{
boolean tmp_20;
{
boolean tmp_21 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_21) {
const int tmp_22 = i;
tmp_21 = (tmp_22 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_22);
if(tmp_21) {
const BvcEntity& tmp_23 = BSSGP__CT_component_BvcTable[tmp_22];
tmp_21 = tmp_23.is_bound();
if(tmp_21) {
const BvcEntity& tmp_24 = tmp_23;
const COMPONENT& tmp_25 = tmp_24.comp__ref();
tmp_21 = tmp_25.is_bound();
}
}
}
tmp_20 = tmp_21;
}
if (tmp_20) tmp_20 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_20) {
current_location.update_lineno(341);
/* BSSGP_Emulation.ttcnpp, line 341 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(339);
/* BSSGP_Emulation.ttcnpp, line 339 */
{
INTEGER tmp_26;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(347);
/* BSSGP_Emulation.ttcnpp, line 347 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(348);
/* BSSGP_Emulation.ttcnpp, line 348 */
INTEGER_template ptp__bvci(Osmocom__Gb__Types::f__BSSGP__BVCI__get(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(349);
/* BSSGP_Emulation.ttcnpp, line 349 */
if (ptp__bvci.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(350);
/* BSSGP_Emulation.ttcnpp, line 350 */
TTCN_Logger::log_str(TTCN_USER, "Rx on SIG BVCI without PTP BVCI: broadcasting");
{
current_location.update_lineno(351);
/* BSSGP_Emulation.ttcnpp, line 351 */
INTEGER i(0);
current_location.update_lineno(351);
/* BSSGP_Emulation.ttcnpp, line 351 */
for ( ; ; ) {
current_location.update_lineno(351);
/* BSSGP_Emulation.ttcnpp, line 351 */
if (!(i < BSSGP__CT_component_BvcTable.lengthof())) break;
current_location.update_lineno(352);
/* BSSGP_Emulation.ttcnpp, line 352 */
{
boolean tmp_27;
{
boolean tmp_28 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_28) {
const int tmp_29 = i;
tmp_28 = (tmp_29 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_29);
if(tmp_28) {
const BvcEntity& tmp_30 = BSSGP__CT_component_BvcTable[tmp_29];
tmp_28 = tmp_30.is_bound();
if(tmp_28) {
const BvcEntity& tmp_31 = tmp_30;
const COMPONENT& tmp_32 = tmp_31.comp__ref();
tmp_28 = tmp_32.is_bound();
}
}
}
tmp_27 = tmp_28;
}
if (tmp_27) tmp_27 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_27) {
current_location.update_lineno(353);
/* BSSGP_Emulation.ttcnpp, line 353 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(351);
/* BSSGP_Emulation.ttcnpp, line 351 */
{
INTEGER tmp_33;
++i;
}
}
}
}
else {
current_location.update_lineno(357);
/* BSSGP_Emulation.ttcnpp, line 357 */
bvc__comp__ref = f__comp__for__bvci(ptp__bvci.valueof());
current_location.update_lineno(358);
/* BSSGP_Emulation.ttcnpp, line 358 */
{
boolean tmp_35;
tmp_35 = bvc__comp__ref.is_bound();
if (tmp_35) tmp_35 = (bvc__comp__ref != NULL_COMPREF);
if (tmp_35) {
current_location.update_lineno(360);
/* BSSGP_Emulation.ttcnpp, line 360 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(bvc__comp__ref), NULL);
}
else {
current_location.update_lineno(362);
/* BSSGP_Emulation.ttcnpp, line 362 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx SIG BSSGP for unknown PTP BVCI "),ptp__bvci.log(),TTCN_Logger::log_event_str(": "),const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(363);
/* BSSGP_Emulation.ttcnpp, line 363 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci()), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__BVCI__UNKNOWN), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), 0, 0), FALSE, NULL);
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(369);
/* BSSGP_Emulation.ttcnpp, line 369 */
{
alt_status tmp_37;
{
BSSGP__Types::PDU__BSSGP_template tmp_36;
tmp_36.pDU__BSSGP__PAGING__PS() = ANY_VALUE;
tmp_37 = BSSGP__CT_component_BSCP.receive(f__BnsUdInd(tmp_36, INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL);
}
switch (tmp_37) {
case ALT_YES:
{
{
current_location.update_lineno(371);
/* BSSGP_Emulation.ttcnpp, line 371 */
INTEGER i(0);
current_location.update_lineno(371);
/* BSSGP_Emulation.ttcnpp, line 371 */
for ( ; ; ) {
current_location.update_lineno(371);
/* BSSGP_Emulation.ttcnpp, line 371 */
if (!(i < BSSGP__CT_component_BvcTable.lengthof())) break;
current_location.update_lineno(372);
/* BSSGP_Emulation.ttcnpp, line 372 */
{
boolean tmp_38;
{
boolean tmp_39 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_39) {
const int tmp_40 = i;
tmp_39 = (tmp_40 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_40);
if(tmp_39) {
const BvcEntity& tmp_41 = BSSGP__CT_component_BvcTable[tmp_40];
tmp_39 = tmp_41.is_bound();
if(tmp_39) {
const BvcEntity& tmp_42 = tmp_41;
const COMPONENT& tmp_43 = tmp_42.comp__ref();
tmp_39 = tmp_43.is_bound();
}
}
}
tmp_38 = tmp_39;
}
if (tmp_38) tmp_38 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_38) {
current_location.update_lineno(373);
/* BSSGP_Emulation.ttcnpp, line 373 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(371);
/* BSSGP_Emulation.ttcnpp, line 371 */
{
INTEGER tmp_44;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(378);
/* BSSGP_Emulation.ttcnpp, line 378 */
{
alt_status tmp_46;
{
BSSGP__Types::PDU__BSSGP_template tmp_45;
tmp_45.pDU__BSSGP__PAGING__CS() = ANY_VALUE;
tmp_46 = BSSGP__CT_component_BSCP.receive(f__BnsUdInd(tmp_45, INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL);
}
switch (tmp_46) {
case ALT_YES:
{
{
current_location.update_lineno(380);
/* BSSGP_Emulation.ttcnpp, line 380 */
INTEGER i(0);
current_location.update_lineno(380);
/* BSSGP_Emulation.ttcnpp, line 380 */
for ( ; ; ) {
current_location.update_lineno(380);
/* BSSGP_Emulation.ttcnpp, line 380 */
if (!(i < BSSGP__CT_component_BvcTable.lengthof())) break;
current_location.update_lineno(381);
/* BSSGP_Emulation.ttcnpp, line 381 */
{
boolean tmp_47;
{
boolean tmp_48 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_48) {
const int tmp_49 = i;
tmp_48 = (tmp_49 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_49);
if(tmp_48) {
const BvcEntity& tmp_50 = BSSGP__CT_component_BvcTable[tmp_49];
tmp_48 = tmp_50.is_bound();
if(tmp_48) {
const BvcEntity& tmp_51 = tmp_50;
const COMPONENT& tmp_52 = tmp_51.comp__ref();
tmp_48 = tmp_52.is_bound();
}
}
}
tmp_47 = tmp_48;
}
if (tmp_47) tmp_47 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_47) {
current_location.update_lineno(382);
/* BSSGP_Emulation.ttcnpp, line 382 */
BSSGP__CT_component_BVC.send(udi, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(380);
/* BSSGP_Emulation.ttcnpp, line 380 */
{
INTEGER tmp_53;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(388);
/* BSSGP_Emulation.ttcnpp, line 388 */
switch (BSSGP__CT_component_BVC.receive(NS__Emulation::NsUnitdataRequest_template(ANY_VALUE), &(udr), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(390);
/* BSSGP_Emulation.ttcnpp, line 390 */
udr.nsei() = const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei();
current_location.update_lineno(391);
/* BSSGP_Emulation.ttcnpp, line 391 */
BSSGP__CT_component_BSCP.send(udr, FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(394);
/* BSSGP_Emulation.ttcnpp, line 394 */
switch (BSSGP__CT_component_GLOBAL.receive(tr__GLOBAL__SIG, &(bssgp), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(395);
/* BSSGP_Emulation.ttcnpp, line 395 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(bssgp), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(398);
/* BSSGP_Emulation.ttcnpp, line 398 */
switch (BSSGP__CT_component_RIM.receive(tr__RIM, &(bssgp), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(399);
/* BSSGP_Emulation.ttcnpp, line 399 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(bssgp), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__sig__unblocked(boolean nodefault_modifier)
{
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__sig__unblocked_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_sig_unblocked.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__sig__unblocked()
{
return new as__sig__unblocked_Default();
}

alt_status as__sig__wait__ns__alive__unblocked_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 405, TTCN_Location::LOCATION_ALTSTEP, "as_sig_wait_ns_alive_unblocked");
current_location.update_lineno(406);
/* BSSGP_Emulation.ttcnpp, line 406 */
NS__Emulation::NsStatusIndication nsi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(407);
/* BSSGP_Emulation.ttcnpp, line 407 */
{
alt_status tmp_57;
{
NS__Emulation::NsStatusIndication_template tmp_55;
tmp_55.nsei() = const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei();
tmp_55.nsvci() = ANY_VALUE;
{
NS__Emulation::NsvcState_template& tmp_56 = tmp_55.old__state();
tmp_56.set_type(COMPLEMENTED_LIST, 1);
tmp_56.list_item(0) = NS__Emulation::NsvcState::NSVC__S__ALIVE__UNBLOCKED;
}
tmp_55.new__state() = NS__Emulation::NsvcState::NSVC__S__ALIVE__UNBLOCKED;
tmp_55.first__or__last() = TRUE;
tmp_57 = BSSGP__CT_component_BSCP.receive(tmp_55, &(nsi), any_compref, NULL, NULL, NULL);
}
switch (tmp_57) {
case ALT_YES:
{
current_location.update_lineno(409);
/* BSSGP_Emulation.ttcnpp, line 409 */
if ((const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).sgsn__role() == FALSE)) {
current_location.update_lineno(410);
/* BSSGP_Emulation.ttcnpp, line 410 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__OM__INTERVENTION, 0, Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), 0, 0), FALSE, NULL);
current_location.update_lineno(411);
/* BSSGP_Emulation.ttcnpp, line 411 */
BSSGP__CT_component_g__T2.start();
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__sig__wait__ns__alive__unblocked(boolean nodefault_modifier)
{
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__sig__wait__ns__alive__unblocked_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_sig_wait_ns_alive_unblocked.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__sig__wait__ns__alive__unblocked()
{
return new as__sig__wait__ns__alive__unblocked_Default();
}

alt_status as__sig__allstate__pre_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 420, TTCN_Location::LOCATION_ALTSTEP, "as_sig_allstate_pre");
current_location.update_lineno(421);
/* BSSGP_Emulation.ttcnpp, line 421 */
NS__Emulation::NsUnitdataIndication udi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(424);
/* BSSGP_Emulation.ttcnpp, line 424 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(0), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(425);
/* BSSGP_Emulation.ttcnpp, line 425 */
TTCN_Logger::log_str(TTCN_USER, "Rx BVC-RESET for Signaling BVCI=0");
current_location.update_lineno(426);
/* BSSGP_Emulation.ttcnpp, line 426 */
if (BSSGP__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(427);
/* BSSGP_Emulation.ttcnpp, line 427 */
{
BssgpResetIndication_template tmp_58;
tmp_58.bvci() = 0;
BSSGP__CT_component_MGMT.send(tmp_58, FALSE, NULL);
}
}
current_location.update_lineno(429);
/* BSSGP_Emulation.ttcnpp, line 429 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET__ACK(0, Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), 0, 0), FALSE, NULL);
{
current_location.update_lineno(430);
/* BSSGP_Emulation.ttcnpp, line 430 */
INTEGER i(0);
current_location.update_lineno(430);
/* BSSGP_Emulation.ttcnpp, line 430 */
for ( ; ; ) {
current_location.update_lineno(430);
/* BSSGP_Emulation.ttcnpp, line 430 */
if (!(i < 64)) break;
current_location.update_lineno(431);
/* BSSGP_Emulation.ttcnpp, line 431 */
{
boolean tmp_59;
{
boolean tmp_60 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_60) {
const int tmp_61 = i;
tmp_60 = (tmp_61 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_61);
if(tmp_60) {
const BvcEntity& tmp_62 = BSSGP__CT_component_BvcTable[tmp_61];
tmp_60 = tmp_62.is_bound();
if(tmp_60) {
const BvcEntity& tmp_63 = tmp_62;
const COMPONENT& tmp_64 = tmp_63.comp__ref();
tmp_60 = tmp_64.is_bound();
}
}
}
tmp_59 = tmp_60;
}
if (tmp_59) tmp_59 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_59) {
current_location.update_lineno(432);
/* BSSGP_Emulation.ttcnpp, line 432 */
{
BssgpResetIndication_template tmp_65;
tmp_65.bvci() = 0;
BSSGP__CT_component_BVC.send(tmp_65, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
}
current_location.update_lineno(430);
/* BSSGP_Emulation.ttcnpp, line 430 */
{
INTEGER tmp_66;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(438);
/* BSSGP_Emulation.ttcnpp, line 438 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK(INTEGER_template(0), Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(439);
/* BSSGP_Emulation.ttcnpp, line 439 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-BLOCK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(441);
/* BSSGP_Emulation.ttcnpp, line 441 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(442);
/* BSSGP_Emulation.ttcnpp, line 442 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-UNBLOCK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(444);
/* BSSGP_Emulation.ttcnpp, line 444 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK__ACK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(445);
/* BSSGP_Emulation.ttcnpp, line 445 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-BLOCK-ACK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(447);
/* BSSGP_Emulation.ttcnpp, line 447 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK__ACK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(448);
/* BSSGP_Emulation.ttcnpp, line 448 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-UNBLOCK-ACK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(452);
/* BSSGP_Emulation.ttcnpp, line 452 */
static boolean guard_expr_5 = FALSE;
if (first_alt_run) {
guard_expr_5 = BSSGP__CT_component_g__T2.running(NULL);
}
if (guard_expr_5) {
current_location.update_lineno(452);
/* BSSGP_Emulation.ttcnpp, line 452 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET__ACK(INTEGER_template(0), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(453);
/* BSSGP_Emulation.ttcnpp, line 453 */
TTCN_Logger::log_str(TTCN_USER, "BVCI(0) Rx BVC-RESET-ACK");
current_location.update_lineno(454);
/* BSSGP_Emulation.ttcnpp, line 454 */
BSSGP__CT_component_g__T2.stop();
current_location.update_lineno(455);
/* BSSGP_Emulation.ttcnpp, line 455 */
f__sign__change__state(BvcState::BVC__S__UNBLOCKED);
{
current_location.update_lineno(456);
/* BSSGP_Emulation.ttcnpp, line 456 */
INTEGER i(0);
current_location.update_lineno(456);
/* BSSGP_Emulation.ttcnpp, line 456 */
for ( ; ; ) {
current_location.update_lineno(456);
/* BSSGP_Emulation.ttcnpp, line 456 */
if (!(i < 64)) break;
current_location.update_lineno(457);
/* BSSGP_Emulation.ttcnpp, line 457 */
{
boolean tmp_67;
{
boolean tmp_68 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_68) {
const int tmp_69 = i;
tmp_68 = (tmp_69 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_69);
if(tmp_68) {
const BvcEntity& tmp_70 = BSSGP__CT_component_BvcTable[tmp_69];
tmp_68 = tmp_70.is_bound();
if(tmp_68) {
const BvcEntity& tmp_71 = tmp_70;
const COMPONENT& tmp_72 = tmp_71.comp__ref();
tmp_68 = tmp_72.is_bound();
}
}
}
tmp_67 = tmp_68;
}
if (tmp_67) tmp_67 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_67) {
current_location.update_lineno(458);
/* BSSGP_Emulation.ttcnpp, line 458 */
{
BssgpResetIndication_template tmp_73;
tmp_73.bvci() = 0;
BSSGP__CT_component_BVC.send(tmp_73, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
}
current_location.update_lineno(456);
/* BSSGP_Emulation.ttcnpp, line 456 */
{
INTEGER tmp_74;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(462);
/* BSSGP_Emulation.ttcnpp, line 462 */
static boolean guard_expr_6 = FALSE;
if (first_alt_run) {
guard_expr_6 = BSSGP__CT_component_g__T2.running(NULL);
}
if (guard_expr_6) {
current_location.update_lineno(462);
/* BSSGP_Emulation.ttcnpp, line 462 */
switch (BSSGP__CT_component_g__T2.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(463);
/* BSSGP_Emulation.ttcnpp, line 463 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for BVC-RESET-ACK on BVCI=0"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(464);
/* BSSGP_Emulation.ttcnpp, line 464 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bvci()), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__BVCI__UNKNOWN), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), 0, 0), FALSE, NULL);
current_location.update_lineno(465);
/* BSSGP_Emulation.ttcnpp, line 465 */
BSSGP__CT_component_g__T2.start();
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__sig__allstate__pre(boolean nodefault_modifier)
{
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__sig__allstate__pre_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_sig_allstate_pre.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__sig__allstate__pre()
{
return new as__sig__allstate__pre_Default();
}

alt_status as__sig__allstate__post_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 470, TTCN_Location::LOCATION_ALTSTEP, "as_sig_allstate_post");
current_location.update_lineno(471);
/* BSSGP_Emulation.ttcnpp, line 471 */
COMPONENT vc__conn;
current_location.update_lineno(472);
/* BSSGP_Emulation.ttcnpp, line 472 */
NS__Emulation::NsUnitdataIndication udi;
current_location.update_lineno(473);
/* BSSGP_Emulation.ttcnpp, line 473 */
NS__Emulation::NsStatusIndication nsi;
current_location.update_lineno(474);
/* BSSGP_Emulation.ttcnpp, line 474 */
Socket__API__Definitions::PortEvent evt;
current_location.update_lineno(475);
/* BSSGP_Emulation.ttcnpp, line 475 */
COMPONENT bvc__comp__ref;
current_location.update_lineno(476);
/* BSSGP_Emulation.ttcnpp, line 476 */
INTEGER bvci;
current_location.update_lineno(477);
/* BSSGP_Emulation.ttcnpp, line 477 */
BssgpResetRequest brr;
alt_status ret_val = ALT_NO;
current_location.update_lineno(480);
/* BSSGP_Emulation.ttcnpp, line 480 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(0), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(481);
/* BSSGP_Emulation.ttcnpp, line 481 */
TTCN_Logger::log_str(TTCN_USER, "Rx BVC-RESET for Signaling BVCI=0");
current_location.update_lineno(482);
/* BSSGP_Emulation.ttcnpp, line 482 */
if (BSSGP__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(483);
/* BSSGP_Emulation.ttcnpp, line 483 */
{
BssgpResetIndication_template tmp_75;
tmp_75.bvci() = 0;
BSSGP__CT_component_MGMT.send(tmp_75, FALSE, NULL);
}
}
current_location.update_lineno(485);
/* BSSGP_Emulation.ttcnpp, line 485 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET__ACK(0, Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), 0, 0), FALSE, NULL);
{
current_location.update_lineno(486);
/* BSSGP_Emulation.ttcnpp, line 486 */
INTEGER i(0);
current_location.update_lineno(486);
/* BSSGP_Emulation.ttcnpp, line 486 */
for ( ; ; ) {
current_location.update_lineno(486);
/* BSSGP_Emulation.ttcnpp, line 486 */
if (!(i < 64)) break;
current_location.update_lineno(487);
/* BSSGP_Emulation.ttcnpp, line 487 */
{
boolean tmp_76;
{
boolean tmp_77 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_77) {
const int tmp_78 = i;
tmp_77 = (tmp_78 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_78);
if(tmp_77) {
const BvcEntity& tmp_79 = BSSGP__CT_component_BvcTable[tmp_78];
tmp_77 = tmp_79.is_bound();
if(tmp_77) {
const BvcEntity& tmp_80 = tmp_79;
const COMPONENT& tmp_81 = tmp_80.comp__ref();
tmp_77 = tmp_81.is_bound();
}
}
}
tmp_76 = tmp_77;
}
if (tmp_76) tmp_76 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_76) {
current_location.update_lineno(488);
/* BSSGP_Emulation.ttcnpp, line 488 */
{
BssgpResetIndication_template tmp_82;
tmp_82.bvci() = 0;
BSSGP__CT_component_BVC.send(tmp_82, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
}
current_location.update_lineno(486);
/* BSSGP_Emulation.ttcnpp, line 486 */
{
INTEGER tmp_83;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(494);
/* BSSGP_Emulation.ttcnpp, line 494 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK(INTEGER_template(0), Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(495);
/* BSSGP_Emulation.ttcnpp, line 495 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-BLOCK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(497);
/* BSSGP_Emulation.ttcnpp, line 497 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(498);
/* BSSGP_Emulation.ttcnpp, line 498 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-UNBLOCK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(500);
/* BSSGP_Emulation.ttcnpp, line 500 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK__ACK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(501);
/* BSSGP_Emulation.ttcnpp, line 501 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-BLOCK-ACK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(503);
/* BSSGP_Emulation.ttcnpp, line 503 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK__ACK(INTEGER_template(0)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(504);
/* BSSGP_Emulation.ttcnpp, line 504 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-UNBLOCK-ACK illegal for BVCI=0: "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(508);
/* BSSGP_Emulation.ttcnpp, line 508 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK(INTEGER_template(ANY_VALUE), Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(509);
/* BSSGP_Emulation.ttcnpp, line 509 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-BLOCK for unknown BVCI"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(510);
/* BSSGP_Emulation.ttcnpp, line 510 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(0), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__BVCI__UNKNOWN), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(514);
/* BSSGP_Emulation.ttcnpp, line 514 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(ANY_VALUE), Osmocom__Gb__Types::BssgpCellId_template(ANY_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(515);
/* BSSGP_Emulation.ttcnpp, line 515 */
INTEGER ptp__bvci(oct2int(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()().pDU__BSSGP__BVC__RESET().bVCI().unstructured__value()));
current_location.update_lineno(516);
/* BSSGP_Emulation.ttcnpp, line 516 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx BVC-RESET for unknown BVCI "),ptp__bvci.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(517);
/* BSSGP_Emulation.ttcnpp, line 517 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(ptp__bvci), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__BVCI__UNKNOWN), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(521);
/* BSSGP_Emulation.ttcnpp, line 521 */
switch (BSSGP__CT_component_BSCP.receive(Socket__API__Definitions::PortEvent_template(ANY_VALUE), &(evt), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
{
current_location.update_lineno(522);
/* BSSGP_Emulation.ttcnpp, line 522 */
INTEGER i(0);
current_location.update_lineno(522);
/* BSSGP_Emulation.ttcnpp, line 522 */
for ( ; ; ) {
current_location.update_lineno(522);
/* BSSGP_Emulation.ttcnpp, line 522 */
if (!(i < 64)) break;
current_location.update_lineno(523);
/* BSSGP_Emulation.ttcnpp, line 523 */
{
boolean tmp_84;
{
boolean tmp_85 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_85) {
const int tmp_86 = i;
tmp_85 = (tmp_86 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_86);
if(tmp_85) {
const BvcEntity& tmp_87 = BSSGP__CT_component_BvcTable[tmp_86];
tmp_85 = tmp_87.is_bound();
if(tmp_85) {
const BvcEntity& tmp_88 = tmp_87;
const COMPONENT& tmp_89 = tmp_88.comp__ref();
tmp_85 = tmp_89.is_bound();
}
}
}
tmp_84 = tmp_85;
}
if (tmp_84) tmp_84 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_84) {
current_location.update_lineno(524);
/* BSSGP_Emulation.ttcnpp, line 524 */
BSSGP__CT_component_BVC.send(evt, COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(522);
/* BSSGP_Emulation.ttcnpp, line 522 */
{
INTEGER tmp_90;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(529);
/* BSSGP_Emulation.ttcnpp, line 529 */
switch (BSSGP__CT_component_BSCP.receive(NS__Emulation::tr__NsStsInd(INTEGER_template(const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei()), NS__Emulation::tr__NsStsInd_nsvci_defval, NS__Emulation::tr__NsStsInd_old__state_defval, NS__Emulation::tr__NsStsInd_state_defval, NS__Emulation::tr__NsStsInd_first__or__last_defval), &(nsi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(531);
/* BSSGP_Emulation.ttcnpp, line 531 */
switch (BSSGP__CT_component_BSCP.receive(NS__Emulation::tr__NsStsInd(INTEGER_template(ANY_VALUE), NS__Emulation::tr__NsStsInd_nsvci_defval, NS__Emulation::tr__NsStsInd_old__state_defval, NS__Emulation::tr__NsStsInd_state_defval, NS__Emulation::tr__NsStsInd_first__or__last_defval), &(nsi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(532);
/* BSSGP_Emulation.ttcnpp, line 532 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx NsStatusInd for wrong NSEI "),nsi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(536);
/* BSSGP_Emulation.ttcnpp, line 536 */
{
alt_status tmp_92;
{
BSSGP__get__bvci__ct_template tmp_91;
tmp_91.bvci() = ANY_VALUE;
tmp_92 = BSSGP__CT_component_PROC.getcall(tmp_91, any_compref, BSSGP__get__bvci__ct_call_redirect(&(bvci)), &(vc__conn), NULL, NULL);
}
switch (tmp_92) {
case ALT_YES:
{
{
current_location.update_lineno(537);
/* BSSGP_Emulation.ttcnpp, line 537 */
INTEGER i(0);
current_location.update_lineno(537);
/* BSSGP_Emulation.ttcnpp, line 537 */
for ( ; ; ) {
current_location.update_lineno(537);
/* BSSGP_Emulation.ttcnpp, line 537 */
if (!(i < 64)) break;
current_location.update_lineno(538);
/* BSSGP_Emulation.ttcnpp, line 538 */
if ((const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].bvci() == bvci)) {
current_location.update_lineno(539);
/* BSSGP_Emulation.ttcnpp, line 539 */
{
BSSGP__get__bvci__ct_template tmp_93;
tmp_93.bvci() = bvci;
BSSGP__CT_component_PROC.reply(tmp_93.set_value_template(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), COMPONENT(vc__conn), NULL);
}
current_location.update_lineno(540);
/* BSSGP_Emulation.ttcnpp, line 540 */
return ALT_YES;
}
current_location.update_lineno(537);
/* BSSGP_Emulation.ttcnpp, line 537 */
{
INTEGER tmp_94;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(546);
/* BSSGP_Emulation.ttcnpp, line 546 */
switch (BSSGP__CT_component_BSCP.receive(f__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(547);
/* BSSGP_Emulation.ttcnpp, line 547 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx Unexpected BSSGP PDU "),const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp().log(),TTCN_Logger::log_event_str("  in state "),BSSGP__CT_component_g__sign__bvc__state.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(548);
/* BSSGP_Emulation.ttcnpp, line 548 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(0), Osmocom__Gb__Types::BssgpCause_template(Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__PDU__NOT__COMPATIBLE__WITH__PROTOCOL__STATE), const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()), 0, 0), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(551);
/* BSSGP_Emulation.ttcnpp, line 551 */
switch (BSSGP__CT_component_MGMT.receive(BssgpResetRequest_template(ANY_VALUE), &(brr), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(552);
/* BSSGP_Emulation.ttcnpp, line 552 */
BSSGP__CT_component_BSCP.send(f__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET(const_cast< const BssgpResetRequest&>(brr).cause(), 0, Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), 0, 0), FALSE, NULL);
current_location.update_lineno(553);
/* BSSGP_Emulation.ttcnpp, line 553 */
BSSGP__CT_component_g__T2.start();
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__sig__allstate__post(boolean nodefault_modifier)
{
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__sig__allstate__post_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_sig_allstate_post.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__sig__allstate__post()
{
return new as__sig__allstate__post_Default();
}

void f__send__bssgp__dec(const BssgpDecoded& dec, const COMPONENT& vc__conn, BSSGP__SP__PT& pt)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 558, TTCN_Location::LOCATION_FUNCTION, "f_send_bssgp_dec");
current_location.update_lineno(560);
/* BSSGP_Emulation.ttcnpp, line 560 */
{
boolean tmp_98;
{
boolean tmp_95 = dec.is_bound();
if(tmp_95) {
const OPTIONAL< MobileL3__Types::PDU__L3__SGSN__MS >& tmp_96 = dec.l3__mt();
switch (tmp_96.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_95 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_95 = FALSE;
break;
default:
{
const MobileL3__Types::PDU__L3__SGSN__MS& tmp_97 = (const MobileL3__Types::PDU__L3__SGSN__MS&) tmp_96;
tmp_95 = tmp_97.is_present();
break;}
}
}
tmp_98 = tmp_95;
}
if (tmp_98) {
current_location.update_lineno(561);
/* BSSGP_Emulation.ttcnpp, line 561 */
pt.send(const_cast< const BssgpDecoded&>(dec).l3__mt()(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(562);
/* BSSGP_Emulation.ttcnpp, line 562 */
boolean tmp_102;
{
boolean tmp_99 = dec.is_bound();
if(tmp_99) {
const OPTIONAL< MobileL3__Types::PDU__L3__MS__SGSN >& tmp_100 = dec.l3__mo();
switch (tmp_100.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_99 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_99 = FALSE;
break;
default:
{
const MobileL3__Types::PDU__L3__MS__SGSN& tmp_101 = (const MobileL3__Types::PDU__L3__MS__SGSN&) tmp_100;
tmp_99 = tmp_101.is_present();
break;}
}
}
tmp_102 = tmp_99;
}
if (tmp_102) {
current_location.update_lineno(563);
/* BSSGP_Emulation.ttcnpp, line 563 */
pt.send(const_cast< const BssgpDecoded&>(dec).l3__mo()(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(566);
/* BSSGP_Emulation.ttcnpp, line 566 */
boolean tmp_106;
{
boolean tmp_103 = dec.is_bound();
if(tmp_103) {
const OPTIONAL< SNDCP__Types::PDU__SN >& tmp_104 = dec.sndcp();
switch (tmp_104.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_103 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_103 = FALSE;
break;
default:
{
const SNDCP__Types::PDU__SN& tmp_105 = (const SNDCP__Types::PDU__SN&) tmp_104;
tmp_103 = tmp_105.is_present();
break;}
}
}
tmp_106 = tmp_103;
}
if (tmp_106) {
current_location.update_lineno(567);
/* BSSGP_Emulation.ttcnpp, line 567 */
pt.send(const_cast< const BssgpDecoded&>(dec).sndcp()(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(568);
/* BSSGP_Emulation.ttcnpp, line 568 */
boolean tmp_110;
{
boolean tmp_107 = dec.is_bound();
if(tmp_107) {
const OPTIONAL< LLC__Types::PDU__LLC >& tmp_108 = dec.llc();
switch (tmp_108.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_107 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_107 = FALSE;
break;
default:
{
const LLC__Types::PDU__LLC& tmp_109 = (const LLC__Types::PDU__LLC&) tmp_108;
tmp_107 = tmp_109.is_present();
break;}
}
}
tmp_110 = tmp_107;
}
if (tmp_110) {
current_location.update_lineno(569);
/* BSSGP_Emulation.ttcnpp, line 569 */
pt.send(const_cast< const BssgpDecoded&>(dec).llc()(), COMPONENT(vc__conn), NULL);
}
else {
current_location.update_lineno(571);
/* BSSGP_Emulation.ttcnpp, line 571 */
pt.send(const_cast< const BssgpDecoded&>(dec).bssgp(), COMPONENT(vc__conn), NULL);
}
}
}
}
}
}

INTEGER f__llc__get__n__u__tx(LLC__Entity& llc)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 576, TTCN_Location::LOCATION_FUNCTION, "f_llc_get_n_u_tx");
current_location.update_lineno(577);
/* BSSGP_Emulation.ttcnpp, line 577 */
INTEGER ret(const_cast< const LLC__Entity&>(llc).n__u__tx__next());
current_location.update_lineno(578);
/* BSSGP_Emulation.ttcnpp, line 578 */
{
INTEGER tmp_111;
tmp_111 = (const_cast< const LLC__Entity&>(llc).n__u__tx__next() + 1);
llc.n__u__tx__next() = tmp_111;
}
current_location.update_lineno(579);
/* BSSGP_Emulation.ttcnpp, line 579 */
return ret;
}

BITSTRING f__llc__sapi__by__l3__mo(const MobileL3__Types::PDU__L3__MS__SGSN& l3__mo)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 583, TTCN_Location::LOCATION_FUNCTION, "f_llc_sapi_by_l3_mo");
current_location.update_lineno(584);
/* BSSGP_Emulation.ttcnpp, line 584 */
{
boolean tmp_115;
{
boolean tmp_112 = l3__mo.is_bound();
if(tmp_112) {
const MobileL3__Types::PDU__L3__MS__SGSN& tmp_113 = l3__mo;
const MobileL3__Types::L3__Discr__MS__SGSN& tmp_114 = tmp_113.msgs();
tmp_112 = tmp_114.is_bound();
if (tmp_112) {
tmp_112 = tmp_114.ischosen(MobileL3__Types::L3__Discr__MS__SGSN::ALT_gprs__mm);
}
}
tmp_115 = tmp_112;
}
if (tmp_115) {
current_location.update_lineno(585);
/* BSSGP_Emulation.ttcnpp, line 585 */
return LLC__Templates::c__LLC__SAPI__LLGMM;
}
else {
current_location.update_lineno(586);
/* BSSGP_Emulation.ttcnpp, line 586 */
boolean tmp_119;
{
boolean tmp_116 = l3__mo.is_bound();
if(tmp_116) {
const MobileL3__Types::PDU__L3__MS__SGSN& tmp_117 = l3__mo;
const MobileL3__Types::L3__Discr__MS__SGSN& tmp_118 = tmp_117.msgs();
tmp_116 = tmp_118.is_bound();
if (tmp_116) {
tmp_116 = tmp_118.ischosen(MobileL3__Types::L3__Discr__MS__SGSN::ALT_gprs__sm);
}
}
tmp_119 = tmp_116;
}
if (tmp_119) {
current_location.update_lineno(587);
/* BSSGP_Emulation.ttcnpp, line 587 */
return LLC__Templates::c__LLC__SAPI__LLGMM;
}
else {
current_location.update_lineno(588);
/* BSSGP_Emulation.ttcnpp, line 588 */
boolean tmp_123;
{
boolean tmp_120 = l3__mo.is_bound();
if(tmp_120) {
const MobileL3__Types::PDU__L3__MS__SGSN& tmp_121 = l3__mo;
const MobileL3__Types::L3__Discr__MS__SGSN& tmp_122 = tmp_121.msgs();
tmp_120 = tmp_122.is_bound();
if (tmp_120) {
tmp_120 = tmp_122.ischosen(MobileL3__Types::L3__Discr__MS__SGSN::ALT_sms);
}
}
tmp_123 = tmp_120;
}
if (tmp_123) {
current_location.update_lineno(589);
/* BSSGP_Emulation.ttcnpp, line 589 */
return LLC__Templates::c__LLC__SAPI__LLSMS;
}
}
}
}
current_location.update_lineno(591);
/* BSSGP_Emulation.ttcnpp, line 591 */
Misc__Helpers::f__shutdown(cs_3, 591, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No LLC SAPI for "),l3__mo.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(592);
/* BSSGP_Emulation.ttcnpp, line 592 */
return bs_0;
}

BITSTRING f__llc__sapi__by__l3__mt(const MobileL3__Types::PDU__L3__SGSN__MS& l3__mt)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 595, TTCN_Location::LOCATION_FUNCTION, "f_llc_sapi_by_l3_mt");
current_location.update_lineno(596);
/* BSSGP_Emulation.ttcnpp, line 596 */
{
boolean tmp_127;
{
boolean tmp_124 = l3__mt.is_bound();
if(tmp_124) {
const MobileL3__Types::PDU__L3__SGSN__MS& tmp_125 = l3__mt;
const MobileL3__Types::L3__Discr__SGSN__MS& tmp_126 = tmp_125.msgs();
tmp_124 = tmp_126.is_bound();
if (tmp_124) {
tmp_124 = tmp_126.ischosen(MobileL3__Types::L3__Discr__SGSN__MS::ALT_gprs__mm);
}
}
tmp_127 = tmp_124;
}
if (tmp_127) {
current_location.update_lineno(597);
/* BSSGP_Emulation.ttcnpp, line 597 */
return LLC__Templates::c__LLC__SAPI__LLGMM;
}
else {
current_location.update_lineno(598);
/* BSSGP_Emulation.ttcnpp, line 598 */
boolean tmp_131;
{
boolean tmp_128 = l3__mt.is_bound();
if(tmp_128) {
const MobileL3__Types::PDU__L3__SGSN__MS& tmp_129 = l3__mt;
const MobileL3__Types::L3__Discr__SGSN__MS& tmp_130 = tmp_129.msgs();
tmp_128 = tmp_130.is_bound();
if (tmp_128) {
tmp_128 = tmp_130.ischosen(MobileL3__Types::L3__Discr__SGSN__MS::ALT_gprs__sm);
}
}
tmp_131 = tmp_128;
}
if (tmp_131) {
current_location.update_lineno(599);
/* BSSGP_Emulation.ttcnpp, line 599 */
return LLC__Templates::c__LLC__SAPI__LLGMM;
}
else {
current_location.update_lineno(600);
/* BSSGP_Emulation.ttcnpp, line 600 */
boolean tmp_135;
{
boolean tmp_132 = l3__mt.is_bound();
if(tmp_132) {
const MobileL3__Types::PDU__L3__SGSN__MS& tmp_133 = l3__mt;
const MobileL3__Types::L3__Discr__SGSN__MS& tmp_134 = tmp_133.msgs();
tmp_132 = tmp_134.is_bound();
if (tmp_132) {
tmp_132 = tmp_134.ischosen(MobileL3__Types::L3__Discr__SGSN__MS::ALT_sms);
}
}
tmp_135 = tmp_132;
}
if (tmp_135) {
current_location.update_lineno(601);
/* BSSGP_Emulation.ttcnpp, line 601 */
return LLC__Templates::c__LLC__SAPI__LLSMS;
}
}
}
}
current_location.update_lineno(603);
/* BSSGP_Emulation.ttcnpp, line 603 */
Misc__Helpers::f__shutdown(cs_3, 603, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No LLC SAPI for "),l3__mt.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(604);
/* BSSGP_Emulation.ttcnpp, line 604 */
return bs_0;
}

void f__bssgp__ScanEvents()
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 609, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_ScanEvents");
for ( ; ; ) {
current_location.update_lineno(611);
/* BSSGP_Emulation.ttcnpp, line 611 */
{
tmp_136:
alt_status tmp_136_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_136_alt_flag_1 = ALT_MAYBE;
alt_status tmp_136_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_136_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_136_alt_flag_4 = ALT_UNCHECKED;
alt_status tmp_136_alt_flag_5 = ALT_MAYBE;
alt_status tmp_136_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_136_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(612);
/* BSSGP_Emulation.ttcnpp, line 612 */
if ((BSSGP__CT_component_g__sign__bvc__state == BvcState::BVC__S__WAIT__RESET)) tmp_136_alt_flag_0 = ALT_MAYBE;
else tmp_136_alt_flag_0 = ALT_NO;
}
if (tmp_136_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(612);
/* BSSGP_Emulation.ttcnpp, line 612 */
tmp_136_alt_flag_0 = as__sig__wait__reset_instance(first_run);
if (tmp_136_alt_flag_0 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_0 == ALT_BREAK) break;
if (tmp_136_alt_flag_0 == ALT_YES) break;
}
if (tmp_136_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(613);
/* BSSGP_Emulation.ttcnpp, line 613 */
tmp_136_alt_flag_1 = as__sig__allstate__pre_instance(first_run);
if (tmp_136_alt_flag_1 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_1 == ALT_BREAK) break;
if (tmp_136_alt_flag_1 == ALT_YES) break;
}
if (tmp_136_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(614);
/* BSSGP_Emulation.ttcnpp, line 614 */
if ((BSSGP__CT_component_g__sign__bvc__state == BvcState::BVC__S__WAIT__NS__ALIVE__UNBLOCKED)) tmp_136_alt_flag_2 = ALT_MAYBE;
else tmp_136_alt_flag_2 = ALT_NO;
}
if (tmp_136_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(614);
/* BSSGP_Emulation.ttcnpp, line 614 */
tmp_136_alt_flag_2 = as__sig__wait__ns__alive__unblocked_instance(first_run);
if (tmp_136_alt_flag_2 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_2 == ALT_BREAK) break;
if (tmp_136_alt_flag_2 == ALT_YES) break;
}
if (tmp_136_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(615);
/* BSSGP_Emulation.ttcnpp, line 615 */
if ((BSSGP__CT_component_g__sign__bvc__state == BvcState::BVC__S__UNBLOCKED)) tmp_136_alt_flag_3 = ALT_MAYBE;
else tmp_136_alt_flag_3 = ALT_NO;
}
if (tmp_136_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(615);
/* BSSGP_Emulation.ttcnpp, line 615 */
tmp_136_alt_flag_3 = as__sig__unblocked_instance(first_run);
if (tmp_136_alt_flag_3 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_3 == ALT_BREAK) break;
if (tmp_136_alt_flag_3 == ALT_YES) break;
}
if (tmp_136_alt_flag_4 == ALT_UNCHECKED) {
current_location.update_lineno(616);
/* BSSGP_Emulation.ttcnpp, line 616 */
if ((BSSGP__CT_component_g__sign__bvc__state == BvcState::BVC__S__WAIT__RESET)) tmp_136_alt_flag_4 = ALT_MAYBE;
else tmp_136_alt_flag_4 = ALT_NO;
}
if (tmp_136_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(616);
/* BSSGP_Emulation.ttcnpp, line 616 */
tmp_136_alt_flag_4 = as__sig__wait__reset_instance(first_run);
if (tmp_136_alt_flag_4 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_4 == ALT_BREAK) break;
if (tmp_136_alt_flag_4 == ALT_YES) break;
}
if (tmp_136_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(617);
/* BSSGP_Emulation.ttcnpp, line 617 */
tmp_136_alt_flag_5 = as__sig__allstate__post_instance(first_run);
if (tmp_136_alt_flag_5 == ALT_REPEAT) goto tmp_136;
if (tmp_136_alt_flag_5 == ALT_BREAK) break;
if (tmp_136_alt_flag_5 == ALT_YES) break;
}
if (tmp_136_default_flag == ALT_MAYBE) {
tmp_136_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_136_default_flag == ALT_YES || tmp_136_default_flag == ALT_BREAK) break;
else if (tmp_136_default_flag == ALT_REPEAT) goto tmp_136;
}
current_location.update_lineno(611);
/* BSSGP_Emulation.ttcnpp, line 611 */
if (tmp_136_alt_flag_0 == ALT_NO && tmp_136_alt_flag_1 == ALT_NO && tmp_136_alt_flag_2 == ALT_NO && tmp_136_alt_flag_3 == ALT_NO && tmp_136_alt_flag_4 == ALT_NO && tmp_136_alt_flag_5 == ALT_NO && tmp_136_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BSSGP_Emulation.ttcnpp between lines 611 and 618.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}
}

void start_f__bssgp__ScanEvents(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_bssgp_ScanEvents(");
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, "BSSGP_Emulation", "f_bssgp_ScanEvents", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

NS__Emulation::NsUnitdataRequest f__BnsUdReq(const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER& bvci, const INTEGER& lsp)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 623, TTCN_Location::LOCATION_FUNCTION, "f_BnsUdReq");
current_location.update_lineno(625);
/* BSSGP_Emulation.ttcnpp, line 625 */
NS__Emulation::NsUnitdataRequest udr;
udr.bvci() = bvci;
udr.nsei() = const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei();
udr.lsp() = lsp;
udr.sdu() = BSSGP__Types::enc__PDU__BSSGP(pdu.valueof());
udr.bssgp() = OMIT_VALUE;
current_location.update_lineno(636);
/* BSSGP_Emulation.ttcnpp, line 636 */
return udr;
}

void start_f__BnsUdReq(const COMPONENT& component_reference, const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER& bvci, const INTEGER& lsp)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_BnsUdReq(");
pdu.log();
TTCN_Logger::log_event_str(", ");
bvci.log();
TTCN_Logger::log_event_str(", ");
lsp.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, "BSSGP_Emulation", "f_BnsUdReq", text_buf);
pdu.encode_text(text_buf);
bvci.encode_text(text_buf);
lsp.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

NS__Emulation::NsUnitdataIndication_template f__BnsUdInd(const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER_template& bvci)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 640, TTCN_Location::LOCATION_FUNCTION, "f_BnsUdInd");
current_location.update_lineno(642);
/* BSSGP_Emulation.ttcnpp, line 642 */
NS__Emulation::NsUnitdataIndication_template udi;
udi.bvci() = bvci;
udi.nsei() = const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei();
udi.nsvci() = ANY_VALUE;
udi.sdu() = ANY_OR_OMIT;
udi.bssgp() = pdu;
current_location.update_lineno(649);
/* BSSGP_Emulation.ttcnpp, line 649 */
return udi;
}

void start_f__BnsUdInd(const COMPONENT& component_reference, const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER_template& bvci)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_BnsUdInd(");
pdu.log();
TTCN_Logger::log_event_str(", ");
bvci.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, "BSSGP_Emulation", "f_BnsUdInd", text_buf);
pdu.encode_text(text_buf);
bvci.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__sign__change__state(const BvcState& new__state)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 653, TTCN_Location::LOCATION_FUNCTION, "f_sign_change_state");
current_location.update_lineno(654);
/* BSSGP_Emulation.ttcnpp, line 654 */
if ((new__state == BSSGP__CT_component_g__sign__bvc__state)) {
current_location.update_lineno(655);
/* BSSGP_Emulation.ttcnpp, line 655 */
return;
}
current_location.update_lineno(657);
/* BSSGP_Emulation.ttcnpp, line 657 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("BVCI(0) State Transition: ");
BSSGP__CT_component_g__sign__bvc__state.log();
TTCN_Logger::log_event_str(" -> ");
new__state.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(658);
/* BSSGP_Emulation.ttcnpp, line 658 */
BSSGP__CT_component_g__sign__bvc__state = new__state;
{
current_location.update_lineno(659);
/* BSSGP_Emulation.ttcnpp, line 659 */
INTEGER i(0);
current_location.update_lineno(659);
/* BSSGP_Emulation.ttcnpp, line 659 */
for ( ; ; ) {
current_location.update_lineno(659);
/* BSSGP_Emulation.ttcnpp, line 659 */
if (!(i < 64)) break;
current_location.update_lineno(660);
/* BSSGP_Emulation.ttcnpp, line 660 */
{
boolean tmp_138;
{
boolean tmp_139 = BSSGP__CT_component_BvcTable.is_bound();
if(tmp_139) {
const int tmp_140 = i;
tmp_139 = (tmp_140 >= 0) && (BSSGP__CT_component_BvcTable.size_of() > tmp_140);
if(tmp_139) {
const BvcEntity& tmp_141 = BSSGP__CT_component_BvcTable[tmp_140];
tmp_139 = tmp_141.is_bound();
if(tmp_139) {
const BvcEntity& tmp_142 = tmp_141;
const COMPONENT& tmp_143 = tmp_142.comp__ref();
tmp_139 = tmp_143.is_bound();
}
}
}
tmp_138 = tmp_139;
}
if (tmp_138) tmp_138 = (const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_138) {
current_location.update_lineno(661);
/* BSSGP_Emulation.ttcnpp, line 661 */
BSSGP__CT_component_BVC.send(ts__BssgpStsInd(INTEGER_template(const_cast< const BssgpConfig&>(BSSGP__CT_component_g__cfg).nsei()), INTEGER_template(0), BvcState_template(BSSGP__CT_component_g__sign__bvc__state)), COMPONENT(const_cast< const VALUE_ARRAY<BvcEntity, 64, 0>&>(BSSGP__CT_component_BvcTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(659);
/* BSSGP_Emulation.ttcnpp, line 659 */
{
INTEGER tmp_144;
++i;
}
}
}
}

void start_f__sign__change__state(const COMPONENT& component_reference, const BvcState& new__state)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_sign_change_state(");
new__state.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, "BSSGP_Emulation", "f_sign_change_state", text_buf);
new__state.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

COMPONENT f__bssgp__get__bvci__ct(const INTEGER& bvci, BSSGP__CT__PROC__PT& PT)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 674, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_get_bvci_ct");
current_location.update_lineno(675);
/* BSSGP_Emulation.ttcnpp, line 675 */
COMPONENT res;
current_location.update_lineno(676);
/* BSSGP_Emulation.ttcnpp, line 676 */
{
BSSGP__get__bvci__ct_template tmp_145;
tmp_145.bvci() = bvci;
PT.call(tmp_145, FALSE, NULL);
}
{
alt_status tmp_146_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(676);
/* BSSGP_Emulation.ttcnpp, line 676 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_146_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(677);
/* BSSGP_Emulation.ttcnpp, line 677 */
{
BSSGP__get__bvci__ct_template tmp_147;
tmp_147.bvci() = bvci;
tmp_146_alt_flag_0 = PT.getreply(tmp_147.set_value_template(COMPONENT_template(ANY_VALUE)), any_compref, BSSGP__get__bvci__ct_reply_redirect(&(res)), NULL, NULL, NULL);
}
if (tmp_146_alt_flag_0 == ALT_YES) {
current_location.update_lineno(678);
/* BSSGP_Emulation.ttcnpp, line 678 */
return res;
}
}
current_location.update_lineno(676);
/* BSSGP_Emulation.ttcnpp, line 676 */
if (tmp_146_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file BSSGP_Emulation.ttcnpp between lines 676 and 680.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

boolean operator==(null_type, const BssgpUnblockRequest& other_value)
{
other_value.must_bound("Comparison of an unbound value of type @BSSGP_Emulation.BssgpUnblockRequest.");
return TRUE;
}

boolean operator==(null_type, const LLC__Entities& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Emulation.LLC_Entities.");
return other_value.val_ptr->n_elements == 0;
}

LLC__Entities f__llc__create(const BOOLEAN& sgsn__role)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 788, TTCN_Location::LOCATION_FUNCTION, "f_llc_create");
current_location.update_lineno(789);
/* BSSGP_Emulation.ttcnpp, line 789 */
LLC__Entities llc;
{
current_location.update_lineno(790);
/* BSSGP_Emulation.ttcnpp, line 790 */
INTEGER i(0);
current_location.update_lineno(790);
/* BSSGP_Emulation.ttcnpp, line 790 */
for ( ; ; ) {
current_location.update_lineno(790);
/* BSSGP_Emulation.ttcnpp, line 790 */
if (!(i < 16)) break;
current_location.update_lineno(791);
/* BSSGP_Emulation.ttcnpp, line 791 */
llc[i] = t__LLC__init(sgsn__role).valueof();
current_location.update_lineno(790);
/* BSSGP_Emulation.ttcnpp, line 790 */
{
INTEGER tmp_149;
++i;
}
}
}
current_location.update_lineno(793);
/* BSSGP_Emulation.ttcnpp, line 793 */
return llc;
}

LLC__Entity_template t__LLC__init(const BOOLEAN& sgsn__role)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 796, TTCN_Location::LOCATION_TEMPLATE, "t_LLC_init");
LLC__Entity_template ret_val;
ret_val.sgsn__role() = sgsn__role;
ret_val.n__u__tx__next() = 0;
return ret_val;
}

void DefaultCreateCallback(const INTEGER& , const Osmocom__Gb__Types::BssgpCellId& , const OCTETSTRING& tlli, const BssgpDecoded& )
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 829, TTCN_Location::LOCATION_FUNCTION, "DefaultCreateCallback");
current_location.update_lineno(830);
/* BSSGP_Emulation.ttcnpp, line 830 */
Misc__Helpers::f__shutdown(cs_3, 830, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Couldn't find Component for TLLI "),tlli.log(),TTCN_Logger::end_event_log2str()));
}

void start_DefaultCreateCallback(const COMPONENT& component_reference, const INTEGER& bvci, const Osmocom__Gb__Types::BssgpCellId& cell__id, const OCTETSTRING& tlli, const BssgpDecoded& dec)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function DefaultCreateCallback(");
bvci.log();
TTCN_Logger::log_event_str(", ");
cell__id.log();
TTCN_Logger::log_event_str(", ");
tlli.log();
TTCN_Logger::log_event_str(", ");
dec.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, "BSSGP_Emulation", "DefaultCreateCallback", text_buf);
bvci.encode_text(text_buf);
cell__id.encode_text(text_buf);
tlli.encode_text(text_buf);
dec.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__tbl__client__add(const HEXSTRING& imsi, const OCTETSTRING& tlli, const COMPONENT& vc__conn)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 846, TTCN_Location::LOCATION_FUNCTION, "f_tbl_client_add");
current_location.update_lineno(848);
/* BSSGP_Emulation.ttcnpp, line 848 */
INTEGER i;
current_location.update_lineno(849);
/* BSSGP_Emulation.ttcnpp, line 849 */
i = 0;
current_location.update_lineno(849);
/* BSSGP_Emulation.ttcnpp, line 849 */
for ( ; ; ) {
current_location.update_lineno(849);
/* BSSGP_Emulation.ttcnpp, line 849 */
if (!(i < 64)) break;
current_location.update_lineno(850);
/* BSSGP_Emulation.ttcnpp, line 850 */
{
boolean tmp_156;
{
boolean tmp_151 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_151) {
const int tmp_152 = i;
tmp_151 = (tmp_152 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_152);
if(tmp_151) {
const ClientEntity& tmp_153 = BSSGP__BVC__CT_component_ClientTable[tmp_152];
tmp_151 = tmp_153.is_bound();
if(tmp_151) {
const ClientEntity& tmp_154 = tmp_153;
const COMPONENT& tmp_155 = tmp_154.comp__ref();
tmp_151 = tmp_155.is_value();
}
}
}
tmp_156 = (!(tmp_151));
}
if (tmp_156) {
current_location.update_lineno(851);
/* BSSGP_Emulation.ttcnpp, line 851 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Adding Client=");
vc__conn.log();
TTCN_Logger::log_event_str(", IMSI=");
imsi.log();
TTCN_Logger::log_event_str(", TLLI=");
tlli.log();
TTCN_Logger::log_event_str(", index=");
i.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(852);
/* BSSGP_Emulation.ttcnpp, line 852 */
{
ClientEntity& tmp_158 = BSSGP__BVC__CT_component_ClientTable[i]; /* 7388 */
tmp_158.tlli() = tlli;
tmp_158.tlli__old() = OMIT_VALUE;
tmp_158.imsi() = imsi;
tmp_158.comp__ref() = vc__conn;
}
{
current_location.update_lineno(859);
/* BSSGP_Emulation.ttcnpp, line 859 */
INTEGER j(0);
current_location.update_lineno(859);
/* BSSGP_Emulation.ttcnpp, line 859 */
for ( ; ; ) {
current_location.update_lineno(859);
/* BSSGP_Emulation.ttcnpp, line 859 */
if (!(j < 16)) break;
current_location.update_lineno(860);
/* BSSGP_Emulation.ttcnpp, line 860 */
BSSGP__BVC__CT_component_ClientTable[i].llc()[j] = t__LLC__init(BSSGP__BVC__CT_component_g__sgsn__role).valueof();
current_location.update_lineno(859);
/* BSSGP_Emulation.ttcnpp, line 859 */
{
INTEGER tmp_160;
++j;
}
}
}
current_location.update_lineno(862);
/* BSSGP_Emulation.ttcnpp, line 862 */
return;
}
}
current_location.update_lineno(849);
/* BSSGP_Emulation.ttcnpp, line 849 */
{
INTEGER tmp_161;
++i;
}
}
current_location.update_lineno(865);
/* BSSGP_Emulation.ttcnpp, line 865 */
TTCN_Logger::log_str(TTCN_USER, "Client Table full");
TTCN_error("testcase.stop");
}

void start_f__tbl__client__add(const COMPONENT& component_reference, const HEXSTRING& imsi, const OCTETSTRING& tlli, const COMPONENT& vc__conn)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_add(");
imsi.log();
TTCN_Logger::log_event_str(", ");
tlli.log();
TTCN_Logger::log_event_str(", ");
vc__conn.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, "BSSGP_Emulation", "f_tbl_client_add", text_buf);
imsi.encode_text(text_buf);
tlli.encode_text(text_buf);
vc__conn.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__tbl__client__del(const HEXSTRING& imsi, const COMPONENT& vc__conn)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 868, TTCN_Location::LOCATION_FUNCTION, "f_tbl_client_del");
current_location.update_lineno(869);
/* BSSGP_Emulation.ttcnpp, line 869 */
INTEGER i;
current_location.update_lineno(870);
/* BSSGP_Emulation.ttcnpp, line 870 */
i = 0;
current_location.update_lineno(870);
/* BSSGP_Emulation.ttcnpp, line 870 */
for ( ; ; ) {
current_location.update_lineno(870);
/* BSSGP_Emulation.ttcnpp, line 870 */
if (!(i < 64)) break;
current_location.update_lineno(871);
/* BSSGP_Emulation.ttcnpp, line 871 */
{
boolean tmp_163;
{
boolean tmp_164 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_164) {
const int tmp_165 = i;
tmp_164 = (tmp_165 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_165);
if(tmp_164) {
const ClientEntity& tmp_166 = BSSGP__BVC__CT_component_ClientTable[tmp_165];
tmp_164 = tmp_166.is_bound();
if(tmp_164) {
const ClientEntity& tmp_167 = tmp_166;
const HEXSTRING& tmp_168 = tmp_167.imsi();
tmp_164 = tmp_168.is_value();
}
}
}
tmp_163 = tmp_164;
}
if (tmp_163) tmp_163 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].imsi() == imsi);
if (tmp_163) {
current_location.update_lineno(872);
/* BSSGP_Emulation.ttcnpp, line 872 */
if ((const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() != vc__conn)) {
current_location.update_lineno(873);
/* BSSGP_Emulation.ttcnpp, line 873 */
Misc__Helpers::f__shutdown(cs_3, 873, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Cannot unregister index="),i.log(),TTCN_Logger::log_event_str(" IMSI "),imsi.log(),TTCN_Logger::log_event_str(" registred to "),const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref().log(),TTCN_Logger::log_event_str(" from "),vc__conn.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(878);
/* BSSGP_Emulation.ttcnpp, line 878 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Removing Client IMSI=");
imsi.log();
TTCN_Logger::log_event_str(", index=");
i.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(879);
/* BSSGP_Emulation.ttcnpp, line 879 */
{
ClientEntity& tmp_170 = BSSGP__BVC__CT_component_ClientTable[i]; /* 7388 */
tmp_170.tlli__old() = OMIT_VALUE;
tmp_170.imsi() = hs_0;
tmp_170.comp__ref() = NULL_COMPREF;
}
current_location.update_lineno(885);
/* BSSGP_Emulation.ttcnpp, line 885 */
return;
}
}
current_location.update_lineno(870);
/* BSSGP_Emulation.ttcnpp, line 870 */
{
INTEGER tmp_171;
++i;
}
}
current_location.update_lineno(888);
/* BSSGP_Emulation.ttcnpp, line 888 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Warning: Could not find client for IMSI ");
imsi.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(889);
/* BSSGP_Emulation.ttcnpp, line 889 */
return;
}

void start_f__tbl__client__del(const COMPONENT& component_reference, const HEXSTRING& imsi, const COMPONENT& vc__conn)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_del(");
imsi.log();
TTCN_Logger::log_event_str(", ");
vc__conn.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, "BSSGP_Emulation", "f_tbl_client_del", text_buf);
imsi.encode_text(text_buf);
vc__conn.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__tbl__client__llgmm__assign(const OCTETSTRING& tlli__old, const OCTETSTRING& tlli__new, const COMPONENT& vc__conn)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 893, TTCN_Location::LOCATION_FUNCTION, "f_tbl_client_llgmm_assign");
current_location.update_lineno(895);
/* BSSGP_Emulation.ttcnpp, line 895 */
INTEGER i(f__tbl__idx__by__comp(vc__conn));
current_location.update_lineno(897);
/* BSSGP_Emulation.ttcnpp, line 897 */
{
boolean tmp_172;
tmp_172 = (tlli__old == os_0);
if (tmp_172) tmp_172 = (tlli__new != os_0);
if (tmp_172) {
current_location.update_lineno(899);
/* BSSGP_Emulation.ttcnpp, line 899 */
BSSGP__BVC__CT_component_ClientTable[i].tlli() = tlli__new;
current_location.update_lineno(900);
/* BSSGP_Emulation.ttcnpp, line 900 */
BSSGP__BVC__CT_component_ClientTable[i].tlli__old() = OMIT_VALUE;
}
else {
current_location.update_lineno(901);
/* BSSGP_Emulation.ttcnpp, line 901 */
boolean tmp_175;
tmp_175 = (tlli__old != os_0);
if (tmp_175) tmp_175 = (tlli__new != os_0);
if (tmp_175) {
current_location.update_lineno(903);
/* BSSGP_Emulation.ttcnpp, line 903 */
BSSGP__BVC__CT_component_ClientTable[i].tlli() = tlli__new;
current_location.update_lineno(904);
/* BSSGP_Emulation.ttcnpp, line 904 */
BSSGP__BVC__CT_component_ClientTable[i].tlli__old() = tlli__old;
}
else {
current_location.update_lineno(905);
/* BSSGP_Emulation.ttcnpp, line 905 */
boolean tmp_178;
tmp_178 = (tlli__old != os_0);
if (tmp_178) tmp_178 = (tlli__new == os_0);
if (tmp_178) {
current_location.update_lineno(907);
/* BSSGP_Emulation.ttcnpp, line 907 */
BSSGP__BVC__CT_component_ClientTable[i].tlli__old() = OMIT_VALUE;
}
}
}
}
}

void start_f__tbl__client__llgmm__assign(const COMPONENT& component_reference, const OCTETSTRING& tlli__old, const OCTETSTRING& tlli__new, const COMPONENT& vc__conn)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_llgmm_assign(");
tlli__old.log();
TTCN_Logger::log_event_str(", ");
tlli__new.log();
TTCN_Logger::log_event_str(", ");
vc__conn.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, "BSSGP_Emulation", "f_tbl_client_llgmm_assign", text_buf);
tlli__old.encode_text(text_buf);
tlli__new.encode_text(text_buf);
vc__conn.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

COMPONENT f__tbl__comp__by__imsi(const HEXSTRING& imsi)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 911, TTCN_Location::LOCATION_FUNCTION, "f_tbl_comp_by_imsi");
current_location.update_lineno(912);
/* BSSGP_Emulation.ttcnpp, line 912 */
INTEGER i;
current_location.update_lineno(913);
/* BSSGP_Emulation.ttcnpp, line 913 */
i = 0;
current_location.update_lineno(913);
/* BSSGP_Emulation.ttcnpp, line 913 */
for ( ; ; ) {
current_location.update_lineno(913);
/* BSSGP_Emulation.ttcnpp, line 913 */
if (!(i < 64)) break;
current_location.update_lineno(914);
/* BSSGP_Emulation.ttcnpp, line 914 */
{
boolean tmp_181;
{
boolean tmp_182;
{
boolean tmp_183 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_183) {
const int tmp_184 = i;
tmp_183 = (tmp_184 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_184);
if(tmp_183) {
const ClientEntity& tmp_185 = BSSGP__BVC__CT_component_ClientTable[tmp_184];
tmp_183 = tmp_185.is_bound();
if(tmp_183) {
const ClientEntity& tmp_186 = tmp_185;
const HEXSTRING& tmp_187 = tmp_186.imsi();
tmp_183 = tmp_187.is_value();
}
}
}
tmp_182 = tmp_183;
}
if (tmp_182) {
boolean tmp_188 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_188) {
const int tmp_189 = i;
tmp_188 = (tmp_189 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_189);
if(tmp_188) {
const ClientEntity& tmp_190 = BSSGP__BVC__CT_component_ClientTable[tmp_189];
tmp_188 = tmp_190.is_bound();
if(tmp_188) {
const ClientEntity& tmp_191 = tmp_190;
const COMPONENT& tmp_192 = tmp_191.comp__ref();
tmp_188 = tmp_192.is_value();
}
}
}
tmp_182 = tmp_188;
}
tmp_181 = tmp_182;
}
if (tmp_181) tmp_181 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].imsi() == imsi);
if (tmp_181) {
current_location.update_lineno(916);
/* BSSGP_Emulation.ttcnpp, line 916 */
return const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref();
}
}
current_location.update_lineno(913);
/* BSSGP_Emulation.ttcnpp, line 913 */
{
INTEGER tmp_193;
++i;
}
}
current_location.update_lineno(919);
/* BSSGP_Emulation.ttcnpp, line 919 */
Misc__Helpers::f__shutdown(cs_3, 919, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Couldn't find Component for IMSI "),imsi.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(920);
/* BSSGP_Emulation.ttcnpp, line 920 */
return const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[0].comp__ref();
}

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

COMPONENT f__tbl__comp__by__tlli(const OCTETSTRING& tlli)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 923, TTCN_Location::LOCATION_FUNCTION, "f_tbl_comp_by_tlli");
current_location.update_lineno(924);
/* BSSGP_Emulation.ttcnpp, line 924 */
INTEGER i;
current_location.update_lineno(925);
/* BSSGP_Emulation.ttcnpp, line 925 */
i = 0;
current_location.update_lineno(925);
/* BSSGP_Emulation.ttcnpp, line 925 */
for ( ; ; ) {
current_location.update_lineno(925);
/* BSSGP_Emulation.ttcnpp, line 925 */
if (!(i < 64)) break;
current_location.update_lineno(926);
/* BSSGP_Emulation.ttcnpp, line 926 */
{
boolean tmp_195;
{
boolean tmp_196 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_196) {
const int tmp_197 = i;
tmp_196 = (tmp_197 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_197);
if(tmp_196) {
const ClientEntity& tmp_198 = BSSGP__BVC__CT_component_ClientTable[tmp_197];
tmp_196 = tmp_198.is_bound();
if(tmp_196) {
const ClientEntity& tmp_199 = tmp_198;
const COMPONENT& tmp_200 = tmp_199.comp__ref();
tmp_196 = tmp_200.is_value();
}
}
}
tmp_195 = tmp_196;
}
if (tmp_195) {
boolean tmp_201;
{
boolean tmp_202 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_202) {
const int tmp_203 = i;
tmp_202 = (tmp_203 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_203);
if(tmp_202) {
const ClientEntity& tmp_204 = BSSGP__BVC__CT_component_ClientTable[tmp_203];
tmp_202 = tmp_204.is_bound();
if(tmp_202) {
const ClientEntity& tmp_205 = tmp_204;
const OCTETSTRING& tmp_206 = tmp_205.tlli();
tmp_202 = tmp_206.is_value();
}
}
}
tmp_201 = tmp_202;
}
if (tmp_201) {
boolean tmp_207;
tmp_207 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].tlli() == tlli);
if (!tmp_207) {
boolean tmp_208;
{
boolean tmp_209 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_209) {
const int tmp_210 = i;
tmp_209 = (tmp_210 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_210);
if(tmp_209) {
const ClientEntity& tmp_211 = BSSGP__BVC__CT_component_ClientTable[tmp_210];
tmp_209 = tmp_211.is_bound();
if(tmp_209) {
const OPTIONAL< OCTETSTRING >& tmp_212 = tmp_211.tlli__old();
switch (tmp_212.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_209 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_209 = FALSE;
break;
default:
{
const OCTETSTRING& tmp_213 = (const OCTETSTRING&) tmp_212;
tmp_209 = tmp_213.is_value();
break;}
}
}
}
}
tmp_208 = tmp_209;
}
if (tmp_208) tmp_208 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].tlli__old() == tlli);
tmp_207 = tmp_208;
}
tmp_201 = tmp_207;
}
tmp_195 = tmp_201;
}
if (tmp_195) {
current_location.update_lineno(929);
/* BSSGP_Emulation.ttcnpp, line 929 */
return const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref();
}
}
current_location.update_lineno(925);
/* BSSGP_Emulation.ttcnpp, line 925 */
{
INTEGER tmp_214;
++i;
}
}
current_location.update_lineno(932);
/* BSSGP_Emulation.ttcnpp, line 932 */
return NULL_COMPREF;
}

void start_f__tbl__comp__by__tlli(const COMPONENT& component_reference, const OCTETSTRING& tlli)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_comp_by_tlli(");
tlli.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, "BSSGP_Emulation", "f_tbl_comp_by_tlli", text_buf);
tlli.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

INTEGER f__tbl__idx__by__comp(const COMPONENT& comp__ref)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 935, TTCN_Location::LOCATION_FUNCTION, "f_tbl_idx_by_comp");
current_location.update_lineno(936);
/* BSSGP_Emulation.ttcnpp, line 936 */
INTEGER i;
current_location.update_lineno(937);
/* BSSGP_Emulation.ttcnpp, line 937 */
i = 0;
current_location.update_lineno(937);
/* BSSGP_Emulation.ttcnpp, line 937 */
for ( ; ; ) {
current_location.update_lineno(937);
/* BSSGP_Emulation.ttcnpp, line 937 */
if (!(i < 64)) break;
current_location.update_lineno(938);
/* BSSGP_Emulation.ttcnpp, line 938 */
{
boolean tmp_216;
{
boolean tmp_217 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_217) {
const int tmp_218 = i;
tmp_217 = (tmp_218 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_218);
if(tmp_217) {
const ClientEntity& tmp_219 = BSSGP__BVC__CT_component_ClientTable[tmp_218];
tmp_217 = tmp_219.is_bound();
if(tmp_217) {
const ClientEntity& tmp_220 = tmp_219;
const COMPONENT& tmp_221 = tmp_220.comp__ref();
tmp_217 = tmp_221.is_value();
}
}
}
tmp_216 = tmp_217;
}
if (tmp_216) tmp_216 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() == comp__ref);
if (tmp_216) {
current_location.update_lineno(939);
/* BSSGP_Emulation.ttcnpp, line 939 */
return i;
}
}
current_location.update_lineno(937);
/* BSSGP_Emulation.ttcnpp, line 937 */
{
INTEGER tmp_222;
++i;
}
}
current_location.update_lineno(942);
/* BSSGP_Emulation.ttcnpp, line 942 */
Misc__Helpers::f__shutdown(cs_3, 942, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Couldn't find Client for Component "),comp__ref.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(943);
/* BSSGP_Emulation.ttcnpp, line 943 */
return 1;
}

void start_f__tbl__idx__by__comp(const COMPONENT& component_reference, const COMPONENT& comp__ref)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_idx_by_comp(");
comp__ref.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, "BSSGP_Emulation", "f_tbl_idx_by_comp", text_buf);
comp__ref.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

OCTETSTRING f__tbl__tlli__by__comp(const COMPONENT& comp__ref)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 946, TTCN_Location::LOCATION_FUNCTION, "f_tbl_tlli_by_comp");
current_location.update_lineno(947);
/* BSSGP_Emulation.ttcnpp, line 947 */
INTEGER i;
current_location.update_lineno(948);
/* BSSGP_Emulation.ttcnpp, line 948 */
i = 0;
current_location.update_lineno(948);
/* BSSGP_Emulation.ttcnpp, line 948 */
for ( ; ; ) {
current_location.update_lineno(948);
/* BSSGP_Emulation.ttcnpp, line 948 */
if (!(i < 64)) break;
current_location.update_lineno(949);
/* BSSGP_Emulation.ttcnpp, line 949 */
{
boolean tmp_224;
{
boolean tmp_225;
{
boolean tmp_226 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_226) {
const int tmp_227 = i;
tmp_226 = (tmp_227 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_227);
if(tmp_226) {
const ClientEntity& tmp_228 = BSSGP__BVC__CT_component_ClientTable[tmp_227];
tmp_226 = tmp_228.is_bound();
if(tmp_226) {
const ClientEntity& tmp_229 = tmp_228;
const OCTETSTRING& tmp_230 = tmp_229.tlli();
tmp_226 = tmp_230.is_value();
}
}
}
tmp_225 = tmp_226;
}
if (tmp_225) {
boolean tmp_231 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_231) {
const int tmp_232 = i;
tmp_231 = (tmp_232 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_232);
if(tmp_231) {
const ClientEntity& tmp_233 = BSSGP__BVC__CT_component_ClientTable[tmp_232];
tmp_231 = tmp_233.is_bound();
if(tmp_231) {
const ClientEntity& tmp_234 = tmp_233;
const COMPONENT& tmp_235 = tmp_234.comp__ref();
tmp_231 = tmp_235.is_value();
}
}
}
tmp_225 = tmp_231;
}
tmp_224 = tmp_225;
}
if (tmp_224) tmp_224 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() == comp__ref);
if (tmp_224) {
current_location.update_lineno(951);
/* BSSGP_Emulation.ttcnpp, line 951 */
return const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].tlli();
}
}
current_location.update_lineno(948);
/* BSSGP_Emulation.ttcnpp, line 948 */
{
INTEGER tmp_236;
++i;
}
}
current_location.update_lineno(954);
/* BSSGP_Emulation.ttcnpp, line 954 */
Misc__Helpers::f__shutdown(cs_3, 954, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Couldn't find TLLI for Component "),comp__ref.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(955);
/* BSSGP_Emulation.ttcnpp, line 955 */
return os_1;
}

void start_f__tbl__tlli__by__comp(const COMPONENT& component_reference, const COMPONENT& comp__ref)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_tlli_by_comp(");
comp__ref.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, "BSSGP_Emulation", "f_tbl_tlli_by_comp", text_buf);
comp__ref.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BssgpDecoded f__dec__bssgp(const BSSGP__Types::PDU__BSSGP& bssgp)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 970, TTCN_Location::LOCATION_FUNCTION, "f_dec_bssgp");
current_location.update_lineno(971);
/* BSSGP_Emulation.ttcnpp, line 971 */
BssgpDecoded dec;
dec.bssgp() = bssgp;
dec.llc() = OMIT_VALUE;
dec.l3__mo() = OMIT_VALUE;
dec.l3__mt() = OMIT_VALUE;
dec.sndcp() = OMIT_VALUE;
current_location.update_lineno(982);
/* BSSGP_Emulation.ttcnpp, line 982 */
if ((const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).depth() >= BssgpDecodeDepth::BSSGP__DECODE__DEPTH__LLC)) {
current_location.update_lineno(983);
/* BSSGP_Emulation.ttcnpp, line 983 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__DL__UNITDATA)) {
current_location.update_lineno(984);
/* BSSGP_Emulation.ttcnpp, line 984 */
dec.llc() = LLC__Types::dec__PDU__LLC(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__DL__UNITDATA().lLC__PDU().lLC__PDU(), LLC__Types::dec__PDU__LLC_checkFCS_defval);
}
else {
current_location.update_lineno(985);
/* BSSGP_Emulation.ttcnpp, line 985 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__UL__UNITDATA)) {
current_location.update_lineno(986);
/* BSSGP_Emulation.ttcnpp, line 986 */
dec.llc() = LLC__Types::dec__PDU__LLC(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__UL__UNITDATA().lLC__PDU().lLC__PDU(), LLC__Types::dec__PDU__LLC_checkFCS_defval);
}
}
}
current_location.update_lineno(991);
/* BSSGP_Emulation.ttcnpp, line 991 */
if ((const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).depth() >= BssgpDecodeDepth::BSSGP__DECODE__DEPTH__SNDCP)) {
current_location.update_lineno(992);
/* BSSGP_Emulation.ttcnpp, line 992 */
{
boolean tmp_239;
{
boolean tmp_240 = dec.is_bound();
if(tmp_240) {
const OPTIONAL< LLC__Types::PDU__LLC >& tmp_241 = dec.llc();
switch (tmp_241.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_240 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_240 = FALSE;
break;
default:
{
const LLC__Types::PDU__LLC& tmp_242 = (const LLC__Types::PDU__LLC&) tmp_241;
tmp_240 = tmp_242.is_value();
break;}
}
}
tmp_239 = tmp_240;
}
if (tmp_239) tmp_239 = LLC__Templates::tr__LLC__UI__USER.match(const_cast< const BssgpDecoded&>(dec).llc());
if (tmp_239) {
current_location.update_lineno(993);
/* BSSGP_Emulation.ttcnpp, line 993 */
dec.sndcp() = SNDCP__Types::dec__PDU__SN(const_cast< const BssgpDecoded&>(dec).llc()().pDU__LLC__UI().information__field__UI());
}
}
}
current_location.update_lineno(999);
/* BSSGP_Emulation.ttcnpp, line 999 */
if ((const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).depth() >= BssgpDecodeDepth::BSSGP__DECODE__DEPTH__L3)) {
current_location.update_lineno(1000);
/* BSSGP_Emulation.ttcnpp, line 1000 */
{
boolean tmp_244;
{
boolean tmp_245 = dec.is_bound();
if(tmp_245) {
const OPTIONAL< LLC__Types::PDU__LLC >& tmp_246 = dec.llc();
switch (tmp_246.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_245 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_245 = FALSE;
break;
default:
{
const LLC__Types::PDU__LLC& tmp_247 = (const LLC__Types::PDU__LLC&) tmp_246;
tmp_245 = tmp_247.is_value();
break;}
}
}
tmp_244 = tmp_245;
}
if (tmp_244) tmp_244 = LLC__Templates::tr__LLC__UI__L3.match(const_cast< const BssgpDecoded&>(dec).llc());
if (tmp_244) {
current_location.update_lineno(1001);
/* BSSGP_Emulation.ttcnpp, line 1001 */
if (BSSGP__BVC__CT_component_g__sgsn__role) {
current_location.update_lineno(1002);
/* BSSGP_Emulation.ttcnpp, line 1002 */
dec.l3__mo() = MobileL3__Types::dec__PDU__L3__MS__SGSN(const_cast< const BssgpDecoded&>(dec).llc()().pDU__LLC__UI().information__field__UI());
}
else {
current_location.update_lineno(1004);
/* BSSGP_Emulation.ttcnpp, line 1004 */
dec.l3__mt() = MobileL3__Types::dec__PDU__L3__SGSN__MS(const_cast< const BssgpDecoded&>(dec).llc()().pDU__LLC__UI().information__field__UI());
}
}
}
}
current_location.update_lineno(1010);
/* BSSGP_Emulation.ttcnpp, line 1010 */
return dec;
}

void start_f__dec__bssgp(const COMPONENT& component_reference, const BSSGP__Types::PDU__BSSGP& bssgp)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_dec_bssgp(");
bssgp.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, "BSSGP_Emulation", "f_dec_bssgp", text_buf);
bssgp.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ptp__sendUnblock()
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1013, TTCN_Location::LOCATION_FUNCTION, "f_ptp_sendUnblock");
current_location.update_lineno(1014);
/* BSSGP_Emulation.ttcnpp, line 1014 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__UNBLOCK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1015);
/* BSSGP_Emulation.ttcnpp, line 1015 */
BSSGP__BVC__CT_component_g__t1__waits__for__block__ack = FALSE;
current_location.update_lineno(1016);
/* BSSGP_Emulation.ttcnpp, line 1016 */
BSSGP__BVC__CT_component_g__T1.start();
}

void start_f__ptp__sendUnblock(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendUnblock(");
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, "BSSGP_Emulation", "f_ptp_sendUnblock", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ptp__sendBlock(const Osmocom__Gb__Types::BssgpCause& cause)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1019, TTCN_Location::LOCATION_FUNCTION, "f_ptp_sendBlock");
current_location.update_lineno(1020);
/* BSSGP_Emulation.ttcnpp, line 1020 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__BLOCK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCause_template(cause)), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1021);
/* BSSGP_Emulation.ttcnpp, line 1021 */
BSSGP__BVC__CT_component_g__t1__waits__for__block__ack = TRUE;
current_location.update_lineno(1022);
/* BSSGP_Emulation.ttcnpp, line 1022 */
BSSGP__BVC__CT_component_g__T1.start();
current_location.update_lineno(1023);
/* BSSGP_Emulation.ttcnpp, line 1023 */
BSSGP__BVC__CT_component_g__last__block__cause = cause;
}

void start_f__ptp__sendBlock(const COMPONENT& component_reference, const Osmocom__Gb__Types::BssgpCause& cause)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendBlock(");
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, "BSSGP_Emulation", "f_ptp_sendBlock", text_buf);
cause.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ptp__sendStatus(const Osmocom__Gb__Types::BssgpCause& cause, const BSSGP__Types::PDU__BSSGP& pdu)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1026, TTCN_Location::LOCATION_FUNCTION, "f_ptp_sendStatus");
current_location.update_lineno(1028);
/* BSSGP_Emulation.ttcnpp, line 1028 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__STATUS(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCause_template(cause), pdu), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}

void start_f__ptp__sendStatus(const COMPONENT& component_reference, const Osmocom__Gb__Types::BssgpCause& cause, const BSSGP__Types::PDU__BSSGP& pdu)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendStatus(");
cause.log();
TTCN_Logger::log_event_str(", ");
pdu.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, "BSSGP_Emulation", "f_ptp_sendStatus", text_buf);
cause.encode_text(text_buf);
pdu.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ptp__sendReset(const Osmocom__Gb__Types::BssgpCause& cause)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1031, TTCN_Location::LOCATION_FUNCTION, "f_ptp_sendReset");
current_location.update_lineno(1032);
/* BSSGP_Emulation.ttcnpp, line 1032 */
BSSGP__Types::PDU__BSSGP pdu;
current_location.update_lineno(1037);
/* BSSGP_Emulation.ttcnpp, line 1037 */
if (BSSGP__BVC__CT_component_g__sgsn__role) {
current_location.update_lineno(1038);
/* BSSGP_Emulation.ttcnpp, line 1038 */
pdu = Osmocom__Gb__Types::ts__BVC__RESET(cause, const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci(), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)).valueof();
}
else {
current_location.update_lineno(1040);
/* BSSGP_Emulation.ttcnpp, line 1040 */
pdu = Osmocom__Gb__Types::ts__BVC__RESET(cause, const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci(), Osmocom__Gb__Types::BssgpCellId_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id())).valueof();
}
current_location.update_lineno(1044);
/* BSSGP_Emulation.ttcnpp, line 1044 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(pdu), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1045);
/* BSSGP_Emulation.ttcnpp, line 1045 */
BSSGP__BVC__CT_component_g__T2.start();
current_location.update_lineno(1047);
/* BSSGP_Emulation.ttcnpp, line 1047 */
BSSGP__BVC__CT_component_g__last__reset__cause = cause;
}

void start_f__ptp__sendReset(const COMPONENT& component_reference, const Osmocom__Gb__Types::BssgpCause& cause)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendReset(");
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, "BSSGP_Emulation", "f_ptp_sendReset", text_buf);
cause.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__ptp__blocked_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1051, TTCN_Location::LOCATION_ALTSTEP, "as_ptp_blocked");
current_location.update_lineno(1052);
/* BSSGP_Emulation.ttcnpp, line 1052 */
NS__Emulation::NsUnitdataIndication udi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(1054);
/* BSSGP_Emulation.ttcnpp, line 1054 */
static boolean guard_expr_0 = FALSE;
if (first_alt_run) {
boolean tmp_256;
tmp_256 = BSSGP__BVC__CT_component_g__T1.running(NULL);
if (tmp_256) tmp_256 = (!(BSSGP__BVC__CT_component_g__t1__waits__for__block__ack));
guard_expr_0 = tmp_256;
}
if (guard_expr_0) {
current_location.update_lineno(1054);
/* BSSGP_Emulation.ttcnpp, line 1054 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0)), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1055);
/* BSSGP_Emulation.ttcnpp, line 1055 */
BSSGP__BVC__CT_component_g__T1.stop();
current_location.update_lineno(1056);
/* BSSGP_Emulation.ttcnpp, line 1056 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1060);
/* BSSGP_Emulation.ttcnpp, line 1060 */
static boolean guard_expr_1 = FALSE;
if (first_alt_run) {
guard_expr_1 = BSSGP__BVC__CT_component_g__sgsn__role;
}
if (guard_expr_1) {
current_location.update_lineno(1060);
/* BSSGP_Emulation.ttcnpp, line 1060 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0)), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1061);
/* BSSGP_Emulation.ttcnpp, line 1061 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__UNBLOCK__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1062);
/* BSSGP_Emulation.ttcnpp, line 1062 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1066);
/* BSSGP_Emulation.ttcnpp, line 1066 */
static boolean guard_expr_2 = FALSE;
if (first_alt_run) {
guard_expr_2 = (BSSGP__BVC__CT_component_g__T2.running(NULL) && BSSGP__BVC__CT_component_g__sgsn__role);
}
if (guard_expr_2) {
current_location.update_lineno(1066);
/* BSSGP_Emulation.ttcnpp, line 1066 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id())), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1067);
/* BSSGP_Emulation.ttcnpp, line 1067 */
BSSGP__BVC__CT_component_g__T2.stop();
current_location.update_lineno(1068);
/* BSSGP_Emulation.ttcnpp, line 1068 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1071);
/* BSSGP_Emulation.ttcnpp, line 1071 */
static boolean guard_expr_3 = FALSE;
if (first_alt_run) {
boolean tmp_257;
tmp_257 = BSSGP__BVC__CT_component_g__T2.running(NULL);
if (tmp_257) tmp_257 = (!(BSSGP__BVC__CT_component_g__sgsn__role));
guard_expr_3 = tmp_257;
}
if (guard_expr_3) {
current_location.update_lineno(1071);
/* BSSGP_Emulation.ttcnpp, line 1071 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1072);
/* BSSGP_Emulation.ttcnpp, line 1072 */
BSSGP__BVC__CT_component_g__T2.stop();
current_location.update_lineno(1073);
/* BSSGP_Emulation.ttcnpp, line 1073 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1076);
/* BSSGP_Emulation.ttcnpp, line 1076 */
switch (as__ptp__handle__inbound__reset_instance(first_alt_run)) {
case ALT_YES:
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1078);
/* BSSGP_Emulation.ttcnpp, line 1078 */
switch (BSSGP__BVC__CT_component_g__T2.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(1080);
/* BSSGP_Emulation.ttcnpp, line 1080 */
f__ptp__sendReset(Osmocom__Gb__Types::BssgpCause(BSSGP__BVC__CT_component_g__last__reset__cause));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1083);
/* BSSGP_Emulation.ttcnpp, line 1083 */
switch (BSSGP__BVC__CT_component_MGMT.receive(BssgpUnblockRequest_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1084);
/* BSSGP_Emulation.ttcnpp, line 1084 */
f__ptp__sendUnblock();
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__ptp__blocked(boolean nodefault_modifier)
{
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__ptp__blocked_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_ptp_blocked.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__ptp__blocked()
{
return new as__ptp__blocked_Default();
}

alt_status as__ptp__unblocked_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1089, TTCN_Location::LOCATION_ALTSTEP, "as_ptp_unblocked");
current_location.update_lineno(1090);
/* BSSGP_Emulation.ttcnpp, line 1090 */
NS__Emulation::NsUnitdataIndication udi;
current_location.update_lineno(1091);
/* BSSGP_Emulation.ttcnpp, line 1091 */
NS__Emulation::NsStatusIndication nsi;
current_location.update_lineno(1092);
/* BSSGP_Emulation.ttcnpp, line 1092 */
BssgpBlockRequest bbr;
current_location.update_lineno(1093);
/* BSSGP_Emulation.ttcnpp, line 1093 */
COMPONENT vc__conn;
current_location.update_lineno(1094);
/* BSSGP_Emulation.ttcnpp, line 1094 */
Socket__API__Definitions::PortEvent evt;
current_location.update_lineno(1095);
/* BSSGP_Emulation.ttcnpp, line 1095 */
BSSGP__Types::PDU__BSSGP bs__pdu;
current_location.update_lineno(1096);
/* BSSGP_Emulation.ttcnpp, line 1096 */
LLC__Types::PDU__LLC llc;
current_location.update_lineno(1098);
/* BSSGP_Emulation.ttcnpp, line 1098 */
MobileL3__Types::PDU__L3__MS__SGSN l3__mo;
current_location.update_lineno(1099);
/* BSSGP_Emulation.ttcnpp, line 1099 */
MobileL3__Types::PDU__L3__SGSN__MS l3__mt;
alt_status ret_val = ALT_NO;
current_location.update_lineno(1103);
/* BSSGP_Emulation.ttcnpp, line 1103 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__UNBLOCK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1104);
/* BSSGP_Emulation.ttcnpp, line 1104 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__UNBLOCK__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1107);
/* BSSGP_Emulation.ttcnpp, line 1107 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1108);
/* BSSGP_Emulation.ttcnpp, line 1108 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__BLOCK__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1109);
/* BSSGP_Emulation.ttcnpp, line 1109 */
BSSGP__BVC__CT_component_g__T1.stop();
current_location.update_lineno(1110);
/* BSSGP_Emulation.ttcnpp, line 1110 */
f__ptp__change__state(BvcState::BVC__S__BLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1113);
/* BSSGP_Emulation.ttcnpp, line 1113 */
static boolean guard_expr_2 = FALSE;
if (first_alt_run) {
guard_expr_2 = (BSSGP__BVC__CT_component_g__T1.running(NULL) && BSSGP__BVC__CT_component_g__t1__waits__for__block__ack);
}
if (guard_expr_2) {
current_location.update_lineno(1113);
/* BSSGP_Emulation.ttcnpp, line 1113 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__BLOCK__ACK(INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1114);
/* BSSGP_Emulation.ttcnpp, line 1114 */
BSSGP__BVC__CT_component_g__T1.stop();
current_location.update_lineno(1115);
/* BSSGP_Emulation.ttcnpp, line 1115 */
f__ptp__change__state(BvcState::BVC__S__BLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1118);
/* BSSGP_Emulation.ttcnpp, line 1118 */
static boolean guard_expr_3 = FALSE;
if (first_alt_run) {
boolean tmp_258;
tmp_258 = BSSGP__BVC__CT_component_g__T1.running(NULL);
if (tmp_258) tmp_258 = (!(BSSGP__BVC__CT_component_g__t1__waits__for__block__ack));
guard_expr_3 = tmp_258;
}
if (guard_expr_3) {
current_location.update_lineno(1118);
/* BSSGP_Emulation.ttcnpp, line 1118 */
switch (BSSGP__BVC__CT_component_g__T1.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(1119);
/* BSSGP_Emulation.ttcnpp, line 1119 */
f__ptp__sendUnblock();
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1121);
/* BSSGP_Emulation.ttcnpp, line 1121 */
static boolean guard_expr_4 = FALSE;
if (first_alt_run) {
guard_expr_4 = (BSSGP__BVC__CT_component_g__T1.running(NULL) && BSSGP__BVC__CT_component_g__t1__waits__for__block__ack);
}
if (guard_expr_4) {
current_location.update_lineno(1121);
/* BSSGP_Emulation.ttcnpp, line 1121 */
switch (BSSGP__BVC__CT_component_g__T1.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(1122);
/* BSSGP_Emulation.ttcnpp, line 1122 */
f__ptp__sendBlock(Osmocom__Gb__Types::BssgpCause(BSSGP__BVC__CT_component_g__last__block__cause));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1125);
/* BSSGP_Emulation.ttcnpp, line 1125 */
switch (as__ptp__handle__inbound__reset_instance(first_alt_run)) {
case ALT_YES:
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1127);
/* BSSGP_Emulation.ttcnpp, line 1127 */
static boolean guard_expr_6 = FALSE;
if (first_alt_run) {
guard_expr_6 = BSSGP__BVC__CT_component_g__sgsn__role;
}
if (guard_expr_6) {
current_location.update_lineno(1127);
/* BSSGP_Emulation.ttcnpp, line 1127 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(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), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1128);
/* BSSGP_Emulation.ttcnpp, line 1128 */
if (BSSGP__BVC__CT_component_GLOBAL.check_port_state(cs_1)) {
current_location.update_lineno(1129);
/* BSSGP_Emulation.ttcnpp, line 1129 */
BSSGP__BVC__CT_component_GLOBAL.send(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()(), FALSE, NULL);
}
else {
current_location.update_lineno(1132);
/* BSSGP_Emulation.ttcnpp, line 1132 */
OCTETSTRING tag(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()().pDU__BSSGP__FLOW__CONTROL__BVC().tag().unstructured__Value());
current_location.update_lineno(1133);
/* BSSGP_Emulation.ttcnpp, line 1133 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__FC__BVC__ACK(OCTETSTRING_template(tag)), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1137);
/* BSSGP_Emulation.ttcnpp, line 1137 */
static boolean guard_expr_7 = FALSE;
if (first_alt_run) {
guard_expr_7 = (!(BSSGP__BVC__CT_component_g__sgsn__role));
}
if (guard_expr_7) {
current_location.update_lineno(1137);
/* BSSGP_Emulation.ttcnpp, line 1137 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__FC__BVC__ACK(OCTETSTRING_template(ANY_VALUE)), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1138);
/* BSSGP_Emulation.ttcnpp, line 1138 */
if (BSSGP__BVC__CT_component_GLOBAL.check_port_state(cs_1)) {
current_location.update_lineno(1139);
/* BSSGP_Emulation.ttcnpp, line 1139 */
BSSGP__BVC__CT_component_GLOBAL.send(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()(), FALSE, NULL);
}
else {
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1145);
/* BSSGP_Emulation.ttcnpp, line 1145 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(tr__GLOBAL__PTP, INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1146);
/* BSSGP_Emulation.ttcnpp, line 1146 */
if (BSSGP__BVC__CT_component_GLOBAL.check_port_state(cs_1)) {
current_location.update_lineno(1147);
/* BSSGP_Emulation.ttcnpp, line 1147 */
BSSGP__BVC__CT_component_GLOBAL.send(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()(), FALSE, NULL);
}
else {
current_location.update_lineno(1149);
/* BSSGP_Emulation.ttcnpp, line 1149 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received BSSGP STATUS "),const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp().log(),TTCN_Logger::end_event_log2str()));
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1154);
/* BSSGP_Emulation.ttcnpp, line 1154 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci())), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1155);
/* BSSGP_Emulation.ttcnpp, line 1155 */
BssgpDecoded dec(f__dec__bssgp(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(1156);
/* BSSGP_Emulation.ttcnpp, line 1156 */
OCTETSTRING_template tlli(f__bssgp__get__tlli(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(1157);
/* BSSGP_Emulation.ttcnpp, line 1157 */
if (tlli.is_value()) {
current_location.update_lineno(1158);
/* BSSGP_Emulation.ttcnpp, line 1158 */
vc__conn = f__tbl__comp__by__tlli(tlli.valueof());
current_location.update_lineno(1159);
/* BSSGP_Emulation.ttcnpp, line 1159 */
if ((vc__conn == NULL_COMPREF)) {
current_location.update_lineno(1160);
/* BSSGP_Emulation.ttcnpp, line 1160 */
const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).create__cb().invoke(INTEGER(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id()), tlli.valueof(), dec);
}
else {
current_location.update_lineno(1162);
/* BSSGP_Emulation.ttcnpp, line 1162 */
f__send__bssgp__dec(dec, vc__conn, BSSGP__BVC__CT_component_BSSGP__SP);
}
}
else {
current_location.update_lineno(1165);
/* BSSGP_Emulation.ttcnpp, line 1165 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("No TLLI: Broadcasting ");
dec.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
{
current_location.update_lineno(1168);
/* BSSGP_Emulation.ttcnpp, line 1168 */
INTEGER i(0);
current_location.update_lineno(1168);
/* BSSGP_Emulation.ttcnpp, line 1168 */
for ( ; ; ) {
current_location.update_lineno(1168);
/* BSSGP_Emulation.ttcnpp, line 1168 */
if (!(i < 64)) break;
current_location.update_lineno(1169);
/* BSSGP_Emulation.ttcnpp, line 1169 */
{
boolean tmp_260;
{
boolean tmp_261 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_261) {
const int tmp_262 = i;
tmp_261 = (tmp_262 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_262);
if(tmp_261) {
const ClientEntity& tmp_263 = BSSGP__BVC__CT_component_ClientTable[tmp_262];
tmp_261 = tmp_263.is_bound();
if(tmp_261) {
const ClientEntity& tmp_264 = tmp_263;
const COMPONENT& tmp_265 = tmp_264.comp__ref();
tmp_261 = tmp_265.is_bound();
}
}
}
tmp_260 = tmp_261;
}
if (tmp_260) tmp_260 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_260) {
current_location.update_lineno(1170);
/* BSSGP_Emulation.ttcnpp, line 1170 */
f__send__bssgp__dec(dec, const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref(), BSSGP__BVC__CT_component_BSSGP__SP);
}
}
current_location.update_lineno(1168);
/* BSSGP_Emulation.ttcnpp, line 1168 */
{
INTEGER tmp_266;
++i;
}
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1176);
/* BSSGP_Emulation.ttcnpp, line 1176 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK(OCTETSTRING_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval, Osmocom__Gb__Types::tr__BSSGP__FLUSH__LL__ACK_nsei_defval), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1177);
/* BSSGP_Emulation.ttcnpp, line 1177 */
BssgpDecoded dec(f__dec__bssgp(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(1179);
/* BSSGP_Emulation.ttcnpp, line 1179 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Broadcasting FLUSH_LL_ACK ");
dec.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
{
current_location.update_lineno(1182);
/* BSSGP_Emulation.ttcnpp, line 1182 */
INTEGER i(0);
current_location.update_lineno(1182);
/* BSSGP_Emulation.ttcnpp, line 1182 */
for ( ; ; ) {
current_location.update_lineno(1182);
/* BSSGP_Emulation.ttcnpp, line 1182 */
if (!(i < 64)) break;
current_location.update_lineno(1183);
/* BSSGP_Emulation.ttcnpp, line 1183 */
{
boolean tmp_267;
{
boolean tmp_268 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_268) {
const int tmp_269 = i;
tmp_268 = (tmp_269 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_269);
if(tmp_268) {
const ClientEntity& tmp_270 = BSSGP__BVC__CT_component_ClientTable[tmp_269];
tmp_268 = tmp_270.is_bound();
if(tmp_268) {
const ClientEntity& tmp_271 = tmp_270;
const COMPONENT& tmp_272 = tmp_271.comp__ref();
tmp_268 = tmp_272.is_bound();
}
}
}
tmp_267 = tmp_268;
}
if (tmp_267) tmp_267 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_267) {
current_location.update_lineno(1184);
/* BSSGP_Emulation.ttcnpp, line 1184 */
f__send__bssgp__dec(dec, const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref(), BSSGP__BVC__CT_component_BSSGP__SP__SIG);
}
}
current_location.update_lineno(1182);
/* BSSGP_Emulation.ttcnpp, line 1182 */
{
INTEGER tmp_273;
++i;
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1190);
/* BSSGP_Emulation.ttcnpp, line 1190 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1191);
/* BSSGP_Emulation.ttcnpp, line 1191 */
BssgpDecoded dec(f__dec__bssgp(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(1192);
/* BSSGP_Emulation.ttcnpp, line 1192 */
OCTETSTRING_template tlli(f__bssgp__get__tlli(const_cast< const NS__Emulation::NsUnitdataIndication&>(udi).bssgp()));
current_location.update_lineno(1193);
/* BSSGP_Emulation.ttcnpp, line 1193 */
if (tlli.is_value()) {
current_location.update_lineno(1194);
/* BSSGP_Emulation.ttcnpp, line 1194 */
vc__conn = f__tbl__comp__by__tlli(tlli.valueof());
current_location.update_lineno(1195);
/* BSSGP_Emulation.ttcnpp, line 1195 */
if ((vc__conn == NULL_COMPREF)) {
current_location.update_lineno(1196);
/* BSSGP_Emulation.ttcnpp, line 1196 */
const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).create__cb().invoke(INTEGER(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id()), tlli.valueof(), dec);
}
else {
current_location.update_lineno(1198);
/* BSSGP_Emulation.ttcnpp, line 1198 */
f__send__bssgp__dec(dec, vc__conn, BSSGP__BVC__CT_component_BSSGP__SP__SIG);
}
}
else {
current_location.update_lineno(1201);
/* BSSGP_Emulation.ttcnpp, line 1201 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("No TLLI: Broadcasting ");
dec.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
{
current_location.update_lineno(1204);
/* BSSGP_Emulation.ttcnpp, line 1204 */
INTEGER i(0);
current_location.update_lineno(1204);
/* BSSGP_Emulation.ttcnpp, line 1204 */
for ( ; ; ) {
current_location.update_lineno(1204);
/* BSSGP_Emulation.ttcnpp, line 1204 */
if (!(i < 64)) break;
current_location.update_lineno(1205);
/* BSSGP_Emulation.ttcnpp, line 1205 */
{
boolean tmp_275;
{
boolean tmp_276 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_276) {
const int tmp_277 = i;
tmp_276 = (tmp_277 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_277);
if(tmp_276) {
const ClientEntity& tmp_278 = BSSGP__BVC__CT_component_ClientTable[tmp_277];
tmp_276 = tmp_278.is_bound();
if(tmp_276) {
const ClientEntity& tmp_279 = tmp_278;
const COMPONENT& tmp_280 = tmp_279.comp__ref();
tmp_276 = tmp_280.is_bound();
}
}
}
tmp_275 = tmp_276;
}
if (tmp_275) tmp_275 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_275) {
current_location.update_lineno(1206);
/* BSSGP_Emulation.ttcnpp, line 1206 */
f__send__bssgp__dec(dec, const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref(), BSSGP__BVC__CT_component_BSSGP__SP__SIG);
}
}
current_location.update_lineno(1204);
/* BSSGP_Emulation.ttcnpp, line 1204 */
{
INTEGER tmp_281;
++i;
}
}
}
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1213);
/* BSSGP_Emulation.ttcnpp, line 1213 */
switch (BSSGP__BVC__CT_component_BSSGP__SP__SIG.receive(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), &(bs__pdu), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1214);
/* BSSGP_Emulation.ttcnpp, line 1214 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(bs__pdu), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1218);
/* BSSGP_Emulation.ttcnpp, line 1218 */
switch (BSSGP__BVC__CT_component_BSSGP__SP.receive(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), &(bs__pdu), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1219);
/* BSSGP_Emulation.ttcnpp, line 1219 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(bs__pdu), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1224);
/* BSSGP_Emulation.ttcnpp, line 1224 */
static boolean guard_expr_14 = FALSE;
if (first_alt_run) {
guard_expr_14 = BSSGP__BVC__CT_component_g__sgsn__role;
}
if (guard_expr_14) {
current_location.update_lineno(1224);
/* BSSGP_Emulation.ttcnpp, line 1224 */
switch (BSSGP__BVC__CT_component_BSSGP__SP.receive(MobileL3__Types::PDU__L3__SGSN__MS_template(ANY_VALUE), &(l3__mt), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1225);
/* BSSGP_Emulation.ttcnpp, line 1225 */
INTEGER idx(f__tbl__idx__by__comp(vc__conn));
current_location.update_lineno(1226);
/* BSSGP_Emulation.ttcnpp, line 1226 */
OCTETSTRING tlli(const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[idx].tlli());
current_location.update_lineno(1227);
/* BSSGP_Emulation.ttcnpp, line 1227 */
OCTETSTRING l3__enc(MobileL3__Types::enc__PDU__L3__SGSN__MS(l3__mt));
current_location.update_lineno(1228);
/* BSSGP_Emulation.ttcnpp, line 1228 */
BITSTRING sapi(f__llc__sapi__by__l3__mt(l3__mt));
current_location.update_lineno(1229);
/* BSSGP_Emulation.ttcnpp, line 1229 */
INTEGER n__u(f__llc__get__n__u__tx(BSSGP__BVC__CT_component_ClientTable[idx].llc()[bit2int(sapi)]));
current_location.update_lineno(1230);
/* BSSGP_Emulation.ttcnpp, line 1230 */
OCTETSTRING llc__enc(LLC__Types::enc__PDU__LLC(LLC__Templates::ts__LLC__UI(l3__enc, sapi, bs_1, n__u, LLC__Templates::ts__LLC__UI_encrypted_defval, LLC__Templates::ts__LLC__UI_protected__defval).valueof()));
current_location.update_lineno(1231);
/* BSSGP_Emulation.ttcnpp, line 1231 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__DL__UD(tlli, llc__enc, Osmocom__Gb__Types::ts__BSSGP__DL__UD_racap_defval, Osmocom__Gb__Types::ts__BSSGP__DL__UD_imsi_defval), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(oct2int(tlli))), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1233);
/* BSSGP_Emulation.ttcnpp, line 1233 */
static boolean guard_expr_15 = FALSE;
if (first_alt_run) {
guard_expr_15 = (!(BSSGP__BVC__CT_component_g__sgsn__role));
}
if (guard_expr_15) {
current_location.update_lineno(1233);
/* BSSGP_Emulation.ttcnpp, line 1233 */
switch (BSSGP__BVC__CT_component_BSSGP__SP.receive(MobileL3__Types::PDU__L3__MS__SGSN_template(ANY_VALUE), &(l3__mo), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1234);
/* BSSGP_Emulation.ttcnpp, line 1234 */
INTEGER idx(f__tbl__idx__by__comp(vc__conn));
current_location.update_lineno(1235);
/* BSSGP_Emulation.ttcnpp, line 1235 */
OCTETSTRING tlli(const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[idx].tlli());
current_location.update_lineno(1236);
/* BSSGP_Emulation.ttcnpp, line 1236 */
OCTETSTRING l3__enc(MobileL3__Types::enc__PDU__L3__MS__SGSN(l3__mo));
current_location.update_lineno(1237);
/* BSSGP_Emulation.ttcnpp, line 1237 */
BITSTRING sapi(f__llc__sapi__by__l3__mo(l3__mo));
current_location.update_lineno(1238);
/* BSSGP_Emulation.ttcnpp, line 1238 */
INTEGER n__u(f__llc__get__n__u__tx(BSSGP__BVC__CT_component_ClientTable[idx].llc()[bit2int(sapi)]));
current_location.update_lineno(1239);
/* BSSGP_Emulation.ttcnpp, line 1239 */
OCTETSTRING llc__enc(LLC__Types::enc__PDU__LLC(LLC__Templates::ts__LLC__UI(l3__enc, sapi, bs_1, n__u, LLC__Templates::ts__LLC__UI_encrypted_defval, LLC__Templates::ts__LLC__UI_protected__defval).valueof()));
current_location.update_lineno(1240);
/* BSSGP_Emulation.ttcnpp, line 1240 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__UL__UD(tlli, const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id(), llc__enc), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(oct2int(tlli))), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1245);
/* BSSGP_Emulation.ttcnpp, line 1245 */
static boolean guard_expr_16 = FALSE;
if (first_alt_run) {
guard_expr_16 = (!(BSSGP__BVC__CT_component_g__sgsn__role));
}
if (guard_expr_16) {
current_location.update_lineno(1245);
/* BSSGP_Emulation.ttcnpp, line 1245 */
switch (BSSGP__BVC__CT_component_BSSGP__SP.receive(LLC__Types::PDU__LLC_template(ANY_VALUE), &(llc), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1246);
/* BSSGP_Emulation.ttcnpp, line 1246 */
INTEGER idx(f__tbl__idx__by__comp(vc__conn));
current_location.update_lineno(1247);
/* BSSGP_Emulation.ttcnpp, line 1247 */
OCTETSTRING tlli(const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[idx].tlli());
current_location.update_lineno(1248);
/* BSSGP_Emulation.ttcnpp, line 1248 */
OCTETSTRING llc__enc(LLC__Types::enc__PDU__LLC(llc));
current_location.update_lineno(1249);
/* BSSGP_Emulation.ttcnpp, line 1249 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__UL__UD(tlli, const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id(), llc__enc), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(oct2int(tlli))), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1251);
/* BSSGP_Emulation.ttcnpp, line 1251 */
static boolean guard_expr_17 = FALSE;
if (first_alt_run) {
guard_expr_17 = BSSGP__BVC__CT_component_g__sgsn__role;
}
if (guard_expr_17) {
current_location.update_lineno(1251);
/* BSSGP_Emulation.ttcnpp, line 1251 */
switch (BSSGP__BVC__CT_component_BSSGP__SP.receive(LLC__Types::PDU__LLC_template(ANY_VALUE), &(llc), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1252);
/* BSSGP_Emulation.ttcnpp, line 1252 */
INTEGER idx(f__tbl__idx__by__comp(vc__conn));
current_location.update_lineno(1253);
/* BSSGP_Emulation.ttcnpp, line 1253 */
OCTETSTRING tlli(const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[idx].tlli());
current_location.update_lineno(1254);
/* BSSGP_Emulation.ttcnpp, line 1254 */
OCTETSTRING llc__enc(LLC__Types::enc__PDU__LLC(llc));
current_location.update_lineno(1255);
/* BSSGP_Emulation.ttcnpp, line 1255 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BSSGP__DL__UD(tlli, llc__enc, Osmocom__Gb__Types::ts__BSSGP__DL__UD_racap_defval, Osmocom__Gb__Types::ts__BSSGP__DL__UD_imsi_defval), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(oct2int(tlli))), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1259);
/* BSSGP_Emulation.ttcnpp, line 1259 */
switch (BSSGP__BVC__CT_component_GLOBAL.receive(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), &(bs__pdu), any_compref, &(vc__conn), NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1260);
/* BSSGP_Emulation.ttcnpp, line 1260 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(BSSGP__Types::PDU__BSSGP_template(bs__pdu), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1263);
/* BSSGP_Emulation.ttcnpp, line 1263 */
switch (BSSGP__BVC__CT_component_MGMT.receive(BssgpBlockRequest_template(ANY_VALUE), &(bbr), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1264);
/* BSSGP_Emulation.ttcnpp, line 1264 */
f__ptp__sendBlock(const_cast< const BssgpBlockRequest&>(bbr).cause());
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__ptp__unblocked(boolean nodefault_modifier)
{
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__ptp__unblocked_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_ptp_unblocked.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__ptp__unblocked()
{
return new as__ptp__unblocked_Default();
}

alt_status as__ptp__handle__inbound__reset_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1268, TTCN_Location::LOCATION_ALTSTEP, "as_ptp_handle_inbound_reset");
current_location.update_lineno(1269);
/* BSSGP_Emulation.ttcnpp, line 1269 */
NS__Emulation::NsUnitdataIndication udi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(1271);
/* BSSGP_Emulation.ttcnpp, line 1271 */
static boolean guard_expr_0 = FALSE;
if (first_alt_run) {
guard_expr_0 = BSSGP__BVC__CT_component_g__sgsn__role;
}
if (guard_expr_0) {
current_location.update_lineno(1271);
/* BSSGP_Emulation.ttcnpp, line 1271 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id())), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1272);
/* BSSGP_Emulation.ttcnpp, line 1272 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Rx BVC-RESET from BVCI=");
const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1273);
/* BSSGP_Emulation.ttcnpp, line 1273 */
if (BSSGP__BVC__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(1274);
/* BSSGP_Emulation.ttcnpp, line 1274 */
{
BssgpResetIndication_template tmp_282;
tmp_282.bvci() = const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci();
BSSGP__BVC__CT_component_MGMT.send(tmp_282, FALSE, NULL);
}
}
current_location.update_lineno(1277);
/* BSSGP_Emulation.ttcnpp, line 1277 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET__ACK(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci(), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1279);
/* BSSGP_Emulation.ttcnpp, line 1279 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1282);
/* BSSGP_Emulation.ttcnpp, line 1282 */
static boolean guard_expr_1 = FALSE;
if (first_alt_run) {
guard_expr_1 = (!(BSSGP__BVC__CT_component_g__sgsn__role));
}
if (guard_expr_1) {
current_location.update_lineno(1282);
/* BSSGP_Emulation.ttcnpp, line 1282 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(Osmocom__Gb__Types::tr__BVC__RESET(Osmocom__Gb__Types::BssgpCause_template(ANY_VALUE), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), Osmocom__Gb__Types::BssgpCellId_template(OMIT_VALUE)), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1283);
/* BSSGP_Emulation.ttcnpp, line 1283 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Rx BVC-RESET from BVCI=");
const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1284);
/* BSSGP_Emulation.ttcnpp, line 1284 */
if (BSSGP__BVC__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(1285);
/* BSSGP_Emulation.ttcnpp, line 1285 */
{
BssgpResetIndication_template tmp_283;
tmp_283.bvci() = const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci();
BSSGP__BVC__CT_component_MGMT.send(tmp_283, FALSE, NULL);
}
}
current_location.update_lineno(1288);
/* BSSGP_Emulation.ttcnpp, line 1288 */
BSSGP__BVC__CT_component_BVC.send(ts__ptp__BnsUdReq(Osmocom__Gb__Types::ts__BVC__RESET__ACK(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci(), Osmocom__Gb__Types::BssgpCellId_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).cell__id())), INTEGER_template(0), INTEGER_template(BSSGP__BVC__CT_component_g__bvc__lsp)), FALSE, NULL);
current_location.update_lineno(1290);
/* BSSGP_Emulation.ttcnpp, line 1290 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__ptp__handle__inbound__reset(boolean nodefault_modifier)
{
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__ptp__handle__inbound__reset_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_ptp_handle_inbound_reset.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__ptp__handle__inbound__reset()
{
return new as__ptp__handle__inbound__reset_Default();
}

alt_status as__ptp__allstate_instance(boolean first_alt_run)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1295, TTCN_Location::LOCATION_ALTSTEP, "as_ptp_allstate");
current_location.update_lineno(1296);
/* BSSGP_Emulation.ttcnpp, line 1296 */
NS__Emulation::NsUnitdataIndication udi;
current_location.update_lineno(1297);
/* BSSGP_Emulation.ttcnpp, line 1297 */
BssgpResetRequest brr;
current_location.update_lineno(1298);
/* BSSGP_Emulation.ttcnpp, line 1298 */
COMPONENT vc__conn;
current_location.update_lineno(1299);
/* BSSGP_Emulation.ttcnpp, line 1299 */
OCTETSTRING tlli;
current_location.update_lineno(1299);
/* BSSGP_Emulation.ttcnpp, line 1299 */
OCTETSTRING tlli__old;
current_location.update_lineno(1300);
/* BSSGP_Emulation.ttcnpp, line 1300 */
HEXSTRING imsi;
alt_status ret_val = ALT_NO;
current_location.update_lineno(1303);
/* BSSGP_Emulation.ttcnpp, line 1303 */
{
alt_status tmp_285;
{
BssgpResetIndication_template tmp_284;
tmp_284.bvci() = 0;
tmp_285 = BSSGP__BVC__CT_component_BVC.receive(tmp_284, NULL, any_compref, NULL, NULL, NULL);
}
switch (tmp_285) {
case ALT_YES:
{
current_location.update_lineno(1304);
/* BSSGP_Emulation.ttcnpp, line 1304 */
if (BSSGP__BVC__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(1305);
/* BSSGP_Emulation.ttcnpp, line 1305 */
{
BssgpResetIndication_template tmp_286;
tmp_286.bvci() = 0;
BSSGP__BVC__CT_component_MGMT.send(tmp_286, FALSE, NULL);
}
}
current_location.update_lineno(1307);
/* BSSGP_Emulation.ttcnpp, line 1307 */
if ((!(BSSGP__BVC__CT_component_g__sgsn__role))) {
current_location.update_lineno(1308);
/* BSSGP_Emulation.ttcnpp, line 1308 */
f__ptp__change__state(BvcState::BVC__S__BLOCKED);
current_location.update_lineno(1311);
/* BSSGP_Emulation.ttcnpp, line 1311 */
f__ptp__sendReset(f__ptp__sendReset_cause_defval);
}
else {
current_location.update_lineno(1313);
/* BSSGP_Emulation.ttcnpp, line 1313 */
f__ptp__change__state(BvcState::BVC__S__UNBLOCKED);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1318);
/* BSSGP_Emulation.ttcnpp, line 1318 */
switch (BSSGP__BVC__CT_component_BVC.receive(Socket__API__Definitions::PortEvent_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1319);
/* BSSGP_Emulation.ttcnpp, line 1319 */
switch (BSSGP__BVC__CT_component_BVC.receive(BssgpStatusIndication_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1322);
/* BSSGP_Emulation.ttcnpp, line 1322 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(0)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1323);
/* BSSGP_Emulation.ttcnpp, line 1323 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected NS (SIG): "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1325);
/* BSSGP_Emulation.ttcnpp, line 1325 */
switch (BSSGP__BVC__CT_component_BVC.receive(tr__ptp__BnsUdInd(BSSGP__Types::PDU__BSSGP_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), &(udi), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1326);
/* BSSGP_Emulation.ttcnpp, line 1326 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected NS (PTP): "),udi.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1328);
/* BSSGP_Emulation.ttcnpp, line 1328 */
switch (BSSGP__BVC__CT_component_BVC.receive(any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1329);
/* BSSGP_Emulation.ttcnpp, line 1329 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected message from BSSGP_CT"),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(1333);
/* BSSGP_Emulation.ttcnpp, line 1333 */
{
alt_status tmp_288;
{
BSSGP__register__client_template tmp_287;
tmp_287.imsi() = ANY_VALUE;
tmp_287.tlli() = ANY_VALUE;
tmp_288 = BSSGP__BVC__CT_component_BSSGP__PROC.getcall(tmp_287, any_compref, BSSGP__register__client_call_redirect(&(imsi), &(tlli)), &(vc__conn), NULL, NULL);
}
switch (tmp_288) {
case ALT_YES:
{
current_location.update_lineno(1334);
/* BSSGP_Emulation.ttcnpp, line 1334 */
f__tbl__client__add(imsi, tlli, vc__conn);
current_location.update_lineno(1335);
/* BSSGP_Emulation.ttcnpp, line 1335 */
{
BSSGP__register__client_template tmp_289;
tmp_289.imsi() = imsi;
tmp_289.tlli() = tlli;
BSSGP__BVC__CT_component_BSSGP__PROC.reply(tmp_289, COMPONENT(vc__conn), NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1337);
/* BSSGP_Emulation.ttcnpp, line 1337 */
{
alt_status tmp_291;
{
BSSGP__unregister__client_template tmp_290;
tmp_290.imsi() = ANY_VALUE;
tmp_291 = BSSGP__BVC__CT_component_BSSGP__PROC.getcall(tmp_290, any_compref, BSSGP__unregister__client_call_redirect(&(imsi)), &(vc__conn), NULL, NULL);
}
switch (tmp_291) {
case ALT_YES:
{
current_location.update_lineno(1338);
/* BSSGP_Emulation.ttcnpp, line 1338 */
f__tbl__client__del(imsi, vc__conn);
current_location.update_lineno(1339);
/* BSSGP_Emulation.ttcnpp, line 1339 */
{
BSSGP__unregister__client_template tmp_292;
tmp_292.imsi() = imsi;
BSSGP__BVC__CT_component_BSSGP__PROC.reply(tmp_292, COMPONENT(vc__conn), NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1341);
/* BSSGP_Emulation.ttcnpp, line 1341 */
{
alt_status tmp_294;
{
BSSGP__llgmm__assign_template tmp_293;
tmp_293.tlli__old() = ANY_VALUE;
tmp_293.tlli() = ANY_VALUE;
tmp_294 = BSSGP__BVC__CT_component_BSSGP__PROC.getcall(tmp_293, any_compref, BSSGP__llgmm__assign_call_redirect(&(tlli__old), &(tlli)), &(vc__conn), NULL, NULL);
}
switch (tmp_294) {
case ALT_YES:
{
current_location.update_lineno(1342);
/* BSSGP_Emulation.ttcnpp, line 1342 */
f__tbl__client__llgmm__assign(tlli__old, tlli, vc__conn);
current_location.update_lineno(1343);
/* BSSGP_Emulation.ttcnpp, line 1343 */
{
BSSGP__llgmm__assign_template tmp_295;
tmp_295.tlli__old() = tlli__old;
tmp_295.tlli() = tlli;
BSSGP__BVC__CT_component_BSSGP__PROC.reply(tmp_295, COMPONENT(vc__conn), NULL);
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(1346);
/* BSSGP_Emulation.ttcnpp, line 1346 */
switch (BSSGP__BVC__CT_component_MGMT.receive(BssgpResetRequest_template(ANY_VALUE), &(brr), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(1347);
/* BSSGP_Emulation.ttcnpp, line 1347 */
f__ptp__change__state(BvcState::BVC__S__BLOCKED);
current_location.update_lineno(1348);
/* BSSGP_Emulation.ttcnpp, line 1348 */
f__ptp__sendReset(const_cast< const BssgpResetRequest&>(brr).cause());
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__ptp__allstate(boolean nodefault_modifier)
{
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__ptp__allstate_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
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_ptp_allstate.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__ptp__allstate()
{
return new as__ptp__allstate_Default();
}

void f__bssgp__bvc__ScanEvents()
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1353, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_bvc_ScanEvents");
for ( ; ; ) {
current_location.update_lineno(1355);
/* BSSGP_Emulation.ttcnpp, line 1355 */
{
tmp_296:
alt_status tmp_296_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_296_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_296_alt_flag_2 = ALT_MAYBE;
alt_status tmp_296_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_296_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(1356);
/* BSSGP_Emulation.ttcnpp, line 1356 */
if ((BSSGP__BVC__CT_component_g__ptp__bvc__state == BvcState::BVC__S__BLOCKED)) tmp_296_alt_flag_0 = ALT_MAYBE;
else tmp_296_alt_flag_0 = ALT_NO;
}
if (tmp_296_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1356);
/* BSSGP_Emulation.ttcnpp, line 1356 */
tmp_296_alt_flag_0 = as__ptp__blocked_instance(first_run);
if (tmp_296_alt_flag_0 == ALT_REPEAT) goto tmp_296;
if (tmp_296_alt_flag_0 == ALT_BREAK) break;
if (tmp_296_alt_flag_0 == ALT_YES) break;
}
if (tmp_296_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(1357);
/* BSSGP_Emulation.ttcnpp, line 1357 */
if ((BSSGP__BVC__CT_component_g__ptp__bvc__state == BvcState::BVC__S__UNBLOCKED)) tmp_296_alt_flag_1 = ALT_MAYBE;
else tmp_296_alt_flag_1 = ALT_NO;
}
if (tmp_296_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1357);
/* BSSGP_Emulation.ttcnpp, line 1357 */
tmp_296_alt_flag_1 = as__ptp__unblocked_instance(first_run);
if (tmp_296_alt_flag_1 == ALT_REPEAT) goto tmp_296;
if (tmp_296_alt_flag_1 == ALT_BREAK) break;
if (tmp_296_alt_flag_1 == ALT_YES) break;
}
if (tmp_296_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1358);
/* BSSGP_Emulation.ttcnpp, line 1358 */
tmp_296_alt_flag_2 = as__ptp__allstate_instance(first_run);
if (tmp_296_alt_flag_2 == ALT_REPEAT) goto tmp_296;
if (tmp_296_alt_flag_2 == ALT_BREAK) break;
if (tmp_296_alt_flag_2 == ALT_YES) break;
}
if (tmp_296_default_flag == ALT_MAYBE) {
tmp_296_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_296_default_flag == ALT_YES || tmp_296_default_flag == ALT_BREAK) break;
else if (tmp_296_default_flag == ALT_REPEAT) goto tmp_296;
}
current_location.update_lineno(1355);
/* BSSGP_Emulation.ttcnpp, line 1355 */
if (tmp_296_alt_flag_0 == ALT_NO && tmp_296_alt_flag_1 == ALT_NO && tmp_296_alt_flag_2 == ALT_NO && tmp_296_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BSSGP_Emulation.ttcnpp between lines 1355 and 1359.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}
}

void start_f__bssgp__bvc__ScanEvents(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_bssgp_bvc_ScanEvents(");
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, "BSSGP_Emulation", "f_bssgp_bvc_ScanEvents", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__bssgp__bvc__main(const BssgpBvcConfig& cfg, const BOOLEAN& sgsn__role, const INTEGER& nsei, const CHARSTRING& )
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1364, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_bvc_main");
current_location.update_lineno(1365);
/* BSSGP_Emulation.ttcnpp, line 1365 */
BSSGP__BVC__CT_component_g__cfg = cfg;
current_location.update_lineno(1366);
/* BSSGP_Emulation.ttcnpp, line 1366 */
BSSGP__BVC__CT_component_g__nsei = nsei;
current_location.update_lineno(1367);
/* BSSGP_Emulation.ttcnpp, line 1367 */
BSSGP__BVC__CT_component_g__bvc__lsp = const_cast< const BssgpBvcConfig&>(cfg).bvci();
current_location.update_lineno(1368);
/* BSSGP_Emulation.ttcnpp, line 1368 */
BSSGP__BVC__CT_component_g__sgsn__role = sgsn__role;
current_location.update_lineno(1369);
/* BSSGP_Emulation.ttcnpp, line 1369 */
f__bssgp__bvc__ScanEvents();
}

void start_f__bssgp__bvc__main(const COMPONENT& component_reference, const BssgpBvcConfig& cfg, const BOOLEAN& sgsn__role, const INTEGER& nsei, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_bssgp_bvc_main(");
cfg.log();
TTCN_Logger::log_event_str(", ");
sgsn__role.log();
TTCN_Logger::log_event_str(", ");
nsei.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, "BSSGP_Emulation", "f_bssgp_bvc_main", text_buf);
cfg.encode_text(text_buf);
sgsn__role.encode_text(text_buf);
nsei.encode_text(text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

NS__Emulation::NsUnitdataRequest_template ts__ptp__BnsUdReq(const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER_template& bvci, const INTEGER_template& lsp)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1372, TTCN_Location::LOCATION_TEMPLATE, "ts_ptp_BnsUdReq");
NS__Emulation::NsUnitdataRequest_template ret_val;
ret_val.bvci() = bvci;
ret_val.nsei() = 0;
ret_val.lsp() = lsp;
ret_val.sdu() = BSSGP__Types::enc__PDU__BSSGP(pdu.valueof());
ret_val.bssgp() = OMIT_VALUE;
return ret_val;
}

NS__Emulation::NsUnitdataIndication_template tr__ptp__BnsUdInd(const BSSGP__Types::PDU__BSSGP_template& pdu, const INTEGER_template& bvci)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1385, TTCN_Location::LOCATION_TEMPLATE, "tr_ptp_BnsUdInd");
NS__Emulation::NsUnitdataIndication_template ret_val;
ret_val.bvci() = bvci;
ret_val.nsei() = ANY_VALUE;
ret_val.nsvci() = ANY_VALUE;
ret_val.sdu() = ANY_OR_OMIT;
ret_val.bssgp() = pdu;
return ret_val;
}

void f__ptp__change__state(const BvcState& new__state)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1394, TTCN_Location::LOCATION_FUNCTION, "f_ptp_change_state");
current_location.update_lineno(1395);
/* BSSGP_Emulation.ttcnpp, line 1395 */
if ((new__state == BSSGP__BVC__CT_component_g__ptp__bvc__state)) {
current_location.update_lineno(1396);
/* BSSGP_Emulation.ttcnpp, line 1396 */
return;
}
current_location.update_lineno(1398);
/* BSSGP_Emulation.ttcnpp, line 1398 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("BVCI(");
const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci().log();
TTCN_Logger::log_event_str(") State Transition: ");
BSSGP__BVC__CT_component_g__ptp__bvc__state.log();
TTCN_Logger::log_event_str(" -> ");
new__state.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1399);
/* BSSGP_Emulation.ttcnpp, line 1399 */
BSSGP__BVC__CT_component_g__ptp__bvc__state = new__state;
current_location.update_lineno(1400);
/* BSSGP_Emulation.ttcnpp, line 1400 */
if (BSSGP__BVC__CT_component_MGMT.check_port_state(cs_1)) {
current_location.update_lineno(1401);
/* BSSGP_Emulation.ttcnpp, line 1401 */
BSSGP__BVC__CT_component_MGMT.send(ts__BssgpStsInd(INTEGER_template(BSSGP__BVC__CT_component_g__nsei), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), BvcState_template(BSSGP__BVC__CT_component_g__ptp__bvc__state)), FALSE, NULL);
}
{
current_location.update_lineno(1403);
/* BSSGP_Emulation.ttcnpp, line 1403 */
INTEGER i(0);
current_location.update_lineno(1403);
/* BSSGP_Emulation.ttcnpp, line 1403 */
for ( ; ; ) {
current_location.update_lineno(1403);
/* BSSGP_Emulation.ttcnpp, line 1403 */
if (!(i < 64)) break;
current_location.update_lineno(1404);
/* BSSGP_Emulation.ttcnpp, line 1404 */
{
boolean tmp_302;
{
boolean tmp_303 = BSSGP__BVC__CT_component_ClientTable.is_bound();
if(tmp_303) {
const int tmp_304 = i;
tmp_303 = (tmp_304 >= 0) && (BSSGP__BVC__CT_component_ClientTable.size_of() > tmp_304);
if(tmp_303) {
const ClientEntity& tmp_305 = BSSGP__BVC__CT_component_ClientTable[tmp_304];
tmp_303 = tmp_305.is_bound();
if(tmp_303) {
const ClientEntity& tmp_306 = tmp_305;
const COMPONENT& tmp_307 = tmp_306.comp__ref();
tmp_303 = tmp_307.is_bound();
}
}
}
tmp_302 = tmp_303;
}
if (tmp_302) tmp_302 = (const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref() != NULL_COMPREF);
if (tmp_302) {
current_location.update_lineno(1405);
/* BSSGP_Emulation.ttcnpp, line 1405 */
BSSGP__BVC__CT_component_BSSGP__SP.send(ts__BssgpStsInd(INTEGER_template(BSSGP__BVC__CT_component_g__nsei), INTEGER_template(const_cast< const BssgpBvcConfig&>(BSSGP__BVC__CT_component_g__cfg).bvci()), BvcState_template(BSSGP__BVC__CT_component_g__ptp__bvc__state)), COMPONENT(const_cast< const VALUE_ARRAY<ClientEntity, 64, 0>&>(BSSGP__BVC__CT_component_ClientTable)[i].comp__ref()), NULL);
}
}
current_location.update_lineno(1403);
/* BSSGP_Emulation.ttcnpp, line 1403 */
{
INTEGER tmp_308;
++i;
}
}
}
}

void start_f__ptp__change__state(const COMPONENT& component_reference, const BvcState& new__state)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_change_state(");
new__state.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, "BSSGP_Emulation", "f_ptp_change_state", text_buf);
new__state.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

OCTETSTRING_template f__bssgp__get__tlli(const BSSGP__Types::PDU__BSSGP& bssgp)
{
TTCN_Location current_location("BSSGP_Emulation.ttcnpp", 1411, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_get_tlli");
current_location.update_lineno(1412);
/* BSSGP_Emulation.ttcnpp, line 1412 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__DL__UNITDATA)) {
current_location.update_lineno(1413);
/* BSSGP_Emulation.ttcnpp, line 1413 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__DL__UNITDATA().tLLI__current());
}
else {
current_location.update_lineno(1414);
/* BSSGP_Emulation.ttcnpp, line 1414 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__UL__UNITDATA)) {
current_location.update_lineno(1415);
/* BSSGP_Emulation.ttcnpp, line 1415 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__UL__UNITDATA().tLLI());
}
else {
current_location.update_lineno(1416);
/* BSSGP_Emulation.ttcnpp, line 1416 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RA__CAPABILITY)) {
current_location.update_lineno(1417);
/* BSSGP_Emulation.ttcnpp, line 1417 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RA__CAPABILITY().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1418);
/* BSSGP_Emulation.ttcnpp, line 1418 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RA__CAPABILITY__UPDATE)) {
current_location.update_lineno(1419);
/* BSSGP_Emulation.ttcnpp, line 1419 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RA__CAPABILITY__UPDATE().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1420);
/* BSSGP_Emulation.ttcnpp, line 1420 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RA__CAPABILITY__UPDATE__ACK)) {
current_location.update_lineno(1421);
/* BSSGP_Emulation.ttcnpp, line 1421 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RA__CAPABILITY__UPDATE__ACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1422);
/* BSSGP_Emulation.ttcnpp, line 1422 */
boolean tmp_309;
tmp_309 = bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RADIO__STATUS);
if (tmp_309) {
boolean tmp_310 = bssgp.is_bound();
if(tmp_310) {
tmp_310 = bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RADIO__STATUS);
}
if(tmp_310) {
const BSSGP__Types::PDU__BSSGP& tmp_311 = bssgp;
const BSSGP__Types::PDU__BSSGP__RADIO__STATUS& tmp_312 = tmp_311.pDU__BSSGP__RADIO__STATUS();
tmp_310 = tmp_312.is_bound();
if(tmp_310) {
const OPTIONAL< BSSGP__Types::TLLI__BSSGP >& tmp_313 = tmp_312.tLLI();
switch (tmp_313.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_310 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_310 = FALSE;
break;
default:
{
const BSSGP__Types::TLLI__BSSGP& tmp_314 = (const BSSGP__Types::TLLI__BSSGP&) tmp_313;
tmp_310 = tmp_314.is_present();
break;}
}
}
}
tmp_309 = tmp_310;
}
if (tmp_309) {
current_location.update_lineno(1424);
/* BSSGP_Emulation.ttcnpp, line 1424 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RADIO__STATUS().tLLI()().tLLI__Value());
}
else {
current_location.update_lineno(1425);
/* BSSGP_Emulation.ttcnpp, line 1425 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__SUSPEND)) {
current_location.update_lineno(1426);
/* BSSGP_Emulation.ttcnpp, line 1426 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__SUSPEND().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1427);
/* BSSGP_Emulation.ttcnpp, line 1427 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__SUSPEND__ACK)) {
current_location.update_lineno(1428);
/* BSSGP_Emulation.ttcnpp, line 1428 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__SUSPEND__ACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1429);
/* BSSGP_Emulation.ttcnpp, line 1429 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__SUSPEND__NACK)) {
current_location.update_lineno(1430);
/* BSSGP_Emulation.ttcnpp, line 1430 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__SUSPEND__NACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1431);
/* BSSGP_Emulation.ttcnpp, line 1431 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RESUME)) {
current_location.update_lineno(1432);
/* BSSGP_Emulation.ttcnpp, line 1432 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RESUME().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1433);
/* BSSGP_Emulation.ttcnpp, line 1433 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RESUME__ACK)) {
current_location.update_lineno(1434);
/* BSSGP_Emulation.ttcnpp, line 1434 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RESUME__ACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1435);
/* BSSGP_Emulation.ttcnpp, line 1435 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__RESUME__NACK)) {
current_location.update_lineno(1436);
/* BSSGP_Emulation.ttcnpp, line 1436 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__RESUME__NACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1437);
/* BSSGP_Emulation.ttcnpp, line 1437 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__FLUSH__LL)) {
current_location.update_lineno(1438);
/* BSSGP_Emulation.ttcnpp, line 1438 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__FLUSH__LL().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1439);
/* BSSGP_Emulation.ttcnpp, line 1439 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__FLUSH__LL__ACK)) {
current_location.update_lineno(1440);
/* BSSGP_Emulation.ttcnpp, line 1440 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__FLUSH__LL__ACK().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1441);
/* BSSGP_Emulation.ttcnpp, line 1441 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__LLC__DISCARDED)) {
current_location.update_lineno(1442);
/* BSSGP_Emulation.ttcnpp, line 1442 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__LLC__DISCARDED().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1443);
/* BSSGP_Emulation.ttcnpp, line 1443 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__LLC__DISCARDED)) {
current_location.update_lineno(1444);
/* BSSGP_Emulation.ttcnpp, line 1444 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__LLC__DISCARDED().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1445);
/* BSSGP_Emulation.ttcnpp, line 1445 */
boolean tmp_315;
tmp_315 = bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__PAGING__CS);
if (tmp_315) {
boolean tmp_316 = bssgp.is_bound();
if(tmp_316) {
tmp_316 = bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__PAGING__CS);
}
if(tmp_316) {
const BSSGP__Types::PDU__BSSGP& tmp_317 = bssgp;
const BSSGP__Types::PDU__BSSGP__PAGING__CS& tmp_318 = tmp_317.pDU__BSSGP__PAGING__CS();
tmp_316 = tmp_318.is_bound();
if(tmp_316) {
const OPTIONAL< BSSGP__Types::TLLI__BSSGP >& tmp_319 = tmp_318.tLLI();
switch (tmp_319.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_316 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_316 = FALSE;
break;
default:
{
const BSSGP__Types::TLLI__BSSGP& tmp_320 = (const BSSGP__Types::TLLI__BSSGP&) tmp_319;
tmp_316 = tmp_320.is_value();
break;}
}
}
}
tmp_315 = tmp_316;
}
if (tmp_315) {
current_location.update_lineno(1447);
/* BSSGP_Emulation.ttcnpp, line 1447 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__PAGING__CS().tLLI()().tLLI__Value());
}
else {
current_location.update_lineno(1448);
/* BSSGP_Emulation.ttcnpp, line 1448 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__FLOW__CONTROL__MS)) {
current_location.update_lineno(1449);
/* BSSGP_Emulation.ttcnpp, line 1449 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__FLOW__CONTROL__MS().tLLI().tLLI__Value());
}
else {
current_location.update_lineno(1450);
/* BSSGP_Emulation.ttcnpp, line 1450 */
if (bssgp.ischosen(BSSGP__Types::PDU__BSSGP::ALT_pDU__BSSGP__FLOW__CONTROL__MS__ACK)) {
current_location.update_lineno(1451);
/* BSSGP_Emulation.ttcnpp, line 1451 */
return OCTETSTRING_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(bssgp).pDU__BSSGP__FLOW__CONTROL__MS__ACK().tLLI().tLLI__Value());
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
current_location.update_lineno(1454);
/* BSSGP_Emulation.ttcnpp, line 1454 */
return OCTETSTRING_template(OMIT_VALUE);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("BSSGP_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BSSGP_Emulation");
NS__Emulation::module_object.pre_init_module();
MobileL3__Types::module_object.pre_init_module();
LLC__Templates::module_object.pre_init_module();
SNDCP__Types::module_object.pre_init_module();
{
static const char * const port_name = "BSSGP";
BSSGP__Client__CT_component_BSSGP.set_name(port_name);
}
{
static const char * const port_name = "BSSGP_SIG";
BSSGP__Client__CT_component_BSSGP__SIG.set_name(port_name);
}
{
static const char * const port_name = "BSSGP_GLOBAL";
BSSGP__Client__CT_component_BSSGP__GLOBAL.set_name(port_name);
}
{
static const char * const port_name = "BSSGP_PROC";
BSSGP__Client__CT_component_BSSGP__PROC.set_name(port_name);
}
module_object.add_function("f_bssgp_client_register", (genericfunc_t)&f__bssgp__client__register, NULL);
module_object.add_function("f_bssgp_client_unregister", (genericfunc_t)&f__bssgp__client__unregister, NULL);
module_object.add_function("f_bssgp_client_llgmm_assign", (genericfunc_t)&f__bssgp__client__llgmm__assign, NULL);
module_object.add_function("BssgpStart", (genericfunc_t)&BssgpStart, (genericfunc_t)&start_BssgpStart);
module_object.add_function("f_comp_for_bvci", (genericfunc_t)&f__comp__for__bvci, (genericfunc_t)&start_f__comp__for__bvci);
module_object.add_altstep("as_sig_wait_reset", (genericfunc_t)&as__sig__wait__reset_instance, (genericfunc_t )&activate_as__sig__wait__reset, (genericfunc_t )&as__sig__wait__reset);
module_object.add_altstep("as_sig_unblocked", (genericfunc_t)&as__sig__unblocked_instance, (genericfunc_t )&activate_as__sig__unblocked, (genericfunc_t )&as__sig__unblocked);
module_object.add_altstep("as_sig_wait_ns_alive_unblocked", (genericfunc_t)&as__sig__wait__ns__alive__unblocked_instance, (genericfunc_t )&activate_as__sig__wait__ns__alive__unblocked, (genericfunc_t )&as__sig__wait__ns__alive__unblocked);
module_object.add_altstep("as_sig_allstate_pre", (genericfunc_t)&as__sig__allstate__pre_instance, (genericfunc_t )&activate_as__sig__allstate__pre, (genericfunc_t )&as__sig__allstate__pre);
module_object.add_altstep("as_sig_allstate_post", (genericfunc_t)&as__sig__allstate__post_instance, (genericfunc_t )&activate_as__sig__allstate__post, (genericfunc_t )&as__sig__allstate__post);
module_object.add_function("f_send_bssgp_dec", (genericfunc_t)&f__send__bssgp__dec, NULL);
module_object.add_function("f_llc_get_n_u_tx", (genericfunc_t)&f__llc__get__n__u__tx, NULL);
module_object.add_function("f_llc_sapi_by_l3_mo", (genericfunc_t)&f__llc__sapi__by__l3__mo, NULL);
module_object.add_function("f_llc_sapi_by_l3_mt", (genericfunc_t)&f__llc__sapi__by__l3__mt, NULL);
module_object.add_function("f_bssgp_ScanEvents", (genericfunc_t)&f__bssgp__ScanEvents, (genericfunc_t)&start_f__bssgp__ScanEvents);
module_object.add_function("f_BnsUdReq", (genericfunc_t)&f__BnsUdReq, (genericfunc_t)&start_f__BnsUdReq);
module_object.add_function("f_BnsUdInd", (genericfunc_t)&f__BnsUdInd, (genericfunc_t)&start_f__BnsUdInd);
module_object.add_function("f_sign_change_state", (genericfunc_t)&f__sign__change__state, (genericfunc_t)&start_f__sign__change__state);
module_object.add_function("f_bssgp_get_bvci_ct", (genericfunc_t)&f__bssgp__get__bvci__ct, NULL);
module_object.add_function("f_llc_create", (genericfunc_t)&f__llc__create, NULL);
module_object.add_function("DefaultCreateCallback", (genericfunc_t)&DefaultCreateCallback, (genericfunc_t)&start_DefaultCreateCallback);
module_object.add_function("f_tbl_client_add", (genericfunc_t)&f__tbl__client__add, (genericfunc_t)&start_f__tbl__client__add);
module_object.add_function("f_tbl_client_del", (genericfunc_t)&f__tbl__client__del, (genericfunc_t)&start_f__tbl__client__del);
module_object.add_function("f_tbl_client_llgmm_assign", (genericfunc_t)&f__tbl__client__llgmm__assign, (genericfunc_t)&start_f__tbl__client__llgmm__assign);
module_object.add_function("f_tbl_comp_by_imsi", (genericfunc_t)&f__tbl__comp__by__imsi, (genericfunc_t)&start_f__tbl__comp__by__imsi);
module_object.add_function("f_tbl_comp_by_tlli", (genericfunc_t)&f__tbl__comp__by__tlli, (genericfunc_t)&start_f__tbl__comp__by__tlli);
module_object.add_function("f_tbl_idx_by_comp", (genericfunc_t)&f__tbl__idx__by__comp, (genericfunc_t)&start_f__tbl__idx__by__comp);
module_object.add_function("f_tbl_tlli_by_comp", (genericfunc_t)&f__tbl__tlli__by__comp, (genericfunc_t)&start_f__tbl__tlli__by__comp);
module_object.add_function("f_dec_bssgp", (genericfunc_t)&f__dec__bssgp, (genericfunc_t)&start_f__dec__bssgp);
module_object.add_function("f_ptp_sendUnblock", (genericfunc_t)&f__ptp__sendUnblock, (genericfunc_t)&start_f__ptp__sendUnblock);
module_object.add_function("f_ptp_sendBlock", (genericfunc_t)&f__ptp__sendBlock, (genericfunc_t)&start_f__ptp__sendBlock);
module_object.add_function("f_ptp_sendStatus", (genericfunc_t)&f__ptp__sendStatus, (genericfunc_t)&start_f__ptp__sendStatus);
module_object.add_function("f_ptp_sendReset", (genericfunc_t)&f__ptp__sendReset, (genericfunc_t)&start_f__ptp__sendReset);
module_object.add_altstep("as_ptp_blocked", (genericfunc_t)&as__ptp__blocked_instance, (genericfunc_t )&activate_as__ptp__blocked, (genericfunc_t )&as__ptp__blocked);
module_object.add_altstep("as_ptp_unblocked", (genericfunc_t)&as__ptp__unblocked_instance, (genericfunc_t )&activate_as__ptp__unblocked, (genericfunc_t )&as__ptp__unblocked);
module_object.add_altstep("as_ptp_handle_inbound_reset", (genericfunc_t)&as__ptp__handle__inbound__reset_instance, (genericfunc_t )&activate_as__ptp__handle__inbound__reset, (genericfunc_t )&as__ptp__handle__inbound__reset);
module_object.add_altstep("as_ptp_allstate", (genericfunc_t)&as__ptp__allstate_instance, (genericfunc_t )&activate_as__ptp__allstate, (genericfunc_t )&as__ptp__allstate);
module_object.add_function("f_bssgp_bvc_ScanEvents", (genericfunc_t)&f__bssgp__bvc__ScanEvents, (genericfunc_t)&start_f__bssgp__bvc__ScanEvents);
module_object.add_function("f_bssgp_bvc_main", (genericfunc_t)&f__bssgp__bvc__main, (genericfunc_t)&start_f__bssgp__bvc__main);
module_object.add_function("f_ptp_change_state", (genericfunc_t)&f__ptp__change__state, (genericfunc_t)&start_f__ptp__change__state);
module_object.add_function("f_bssgp_get_tlli", (genericfunc_t)&f__bssgp__get__tlli, NULL);
}

void post_init_module()
{
TTCN_Location current_location("BSSGP_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BSSGP_Emulation");
NS__Emulation::module_object.post_init_module();
MobileL3__Types::module_object.post_init_module();
LLC__Templates::module_object.post_init_module();
SNDCP__Types::module_object.post_init_module();
current_location.update_lineno(291);
/* BSSGP_Emulation.ttcnpp, line 291 */
template_tr__GLOBAL__SIG.set_type(VALUE_LIST, 9);
template_tr__GLOBAL__SIG.list_item(0).pDU__BSSGP__SUSPEND() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(1).pDU__BSSGP__SUSPEND__ACK() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(2).pDU__BSSGP__SUSPEND__NACK() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(3).pDU__BSSGP__RESUME() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(4).pDU__BSSGP__RESUME__ACK() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(5).pDU__BSSGP__RESUME__NACK() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(6).pDU__BSSGP__SGSN__INVOKE__TRACE() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(7).pDU__BSSGP__OVERLOAD() = ANY_VALUE;
template_tr__GLOBAL__SIG.list_item(8).pDU__BSSGP__STATUS() = ANY_VALUE;
current_location.update_lineno(298);
/* BSSGP_Emulation.ttcnpp, line 298 */
template_tr__RIM.set_type(VALUE_LIST, 5);
template_tr__RIM.list_item(0).pDU__BSSGP__RAN__INFORMATION() = ANY_VALUE;
template_tr__RIM.list_item(1).pDU__BSSGP__RAN__INFORMATION__REQUEST() = ANY_VALUE;
template_tr__RIM.list_item(2).pDU__BSSGP__RAN__INFORMATION__ACK() = ANY_VALUE;
template_tr__RIM.list_item(3).pDU__BSSGP__RAN__INFORMATION__ERROR() = ANY_VALUE;
template_tr__RIM.list_item(4).pDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR() = ANY_VALUE;
current_location.update_lineno(784);
/* BSSGP_Emulation.ttcnpp, line 784 */
template_tr__GLOBAL__PTP.set_type(VALUE_LIST, 1);
template_tr__GLOBAL__PTP.list_item(0).pDU__BSSGP__STATUS() = ANY_VALUE;
current_location.update_lineno(788);
/* BSSGP_Emulation.ttcnpp, line 788 */
const_f__llc__create_sgsn__role_defval = FALSE;
current_location.update_lineno(796);
/* BSSGP_Emulation.ttcnpp, line 796 */
const_t__LLC__init_sgsn__role_defval = FALSE;
current_location.update_lineno(1031);
/* BSSGP_Emulation.ttcnpp, line 1031 */
const_f__ptp__sendReset_cause_defval = Osmocom__Gb__Types::BssgpCause::BSSGP__CAUSE__OM__INTERVENTION;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "BSSGP_Client_CT")) {
BSSGP__Client__CT_component_BSSGP.activate_port();
BSSGP__Client__CT_component_BSSGP__SIG.activate_port();
BSSGP__Client__CT_component_BSSGP__GLOBAL.activate_port();
BSSGP__Client__CT_component_BSSGP__PROC.activate_port();
return TRUE;
} else if (!strcmp(component_type, "BSSGP_CT")) {
BSSGP__CT_component_BSCP.activate_port();
BSSGP__CT_component_PROC.activate_port();
BSSGP__CT_component_GLOBAL.activate_port();
BSSGP__CT_component_RIM.activate_port();
BSSGP__CT_component_MGMT.activate_port();
BSSGP__CT_component_g__cfg.clean_up();
BSSGP__CT_component_g__sign__bvc__state = BvcState::BVC__S__WAIT__RESET;
BSSGP__CT_component_BVC.activate_port();
BSSGP__CT_component_BvcTable.clean_up();
return TRUE;
} else if (!strcmp(component_type, "BSSGP_BVC_CT")) {
BSSGP__BVC__CT_component_BVC.activate_port();
BSSGP__BVC__CT_component_MGMT.activate_port();
BSSGP__BVC__CT_component_GLOBAL.activate_port();
BSSGP__BVC__CT_component_BSSGP__SP.activate_port();
BSSGP__BVC__CT_component_BSSGP__SP__SIG.activate_port();
BSSGP__BVC__CT_component_BSSGP__PROC.activate_port();
BSSGP__BVC__CT_component_g__cfg.clean_up();
BSSGP__BVC__CT_component_g__sgsn__role.clean_up();
BSSGP__BVC__CT_component_g__nsei.clean_up();
BSSGP__BVC__CT_component_g__bvc__lsp.clean_up();
BSSGP__BVC__CT_component_g__ptp__bvc__state = BvcState::BVC__S__BLOCKED;
BSSGP__BVC__CT_component_g__t1__waits__for__block__ack = FALSE;
BSSGP__BVC__CT_component_g__last__block__cause.clean_up();
BSSGP__BVC__CT_component_g__last__reset__cause.clean_up();
BSSGP__BVC__CT_component_ClientTable.clean_up();
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "BSSGP_Client_CT")) {
if (!strcmp(port_name, "BSSGP")) {
BSSGP__Client__CT_component_BSSGP.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BSSGP_GLOBAL")) {
BSSGP__Client__CT_component_BSSGP__GLOBAL.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BSSGP_PROC")) {
BSSGP__Client__CT_component_BSSGP__PROC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BSSGP_SIG")) {
BSSGP__Client__CT_component_BSSGP__SIG.safe_start();
return TRUE;
}
}
else if (!strcmp(component_type, "BSSGP_CT")) {
if (!strcmp(port_name, "BSCP")) {
BSSGP__CT_component_BSCP.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BVC")) {
BSSGP__CT_component_BVC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "GLOBAL")) {
BSSGP__CT_component_GLOBAL.safe_start();
return TRUE;
}
if (!strcmp(port_name, "MGMT")) {
BSSGP__CT_component_MGMT.safe_start();
return TRUE;
}
if (!strcmp(port_name, "PROC")) {
BSSGP__CT_component_PROC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "RIM")) {
BSSGP__CT_component_RIM.safe_start();
return TRUE;
}
}
else if (!strcmp(component_type, "BSSGP_BVC_CT")) {
if (!strcmp(port_name, "BSSGP_PROC")) {
BSSGP__BVC__CT_component_BSSGP__PROC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BSSGP_SP")) {
BSSGP__BVC__CT_component_BSSGP__SP.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BSSGP_SP_SIG")) {
BSSGP__BVC__CT_component_BSSGP__SP__SIG.safe_start();
return TRUE;
}
if (!strcmp(port_name, "BVC")) {
BSSGP__BVC__CT_component_BVC.safe_start();
return TRUE;
}
if (!strcmp(port_name, "GLOBAL")) {
BSSGP__BVC__CT_component_GLOBAL.safe_start();
return TRUE;
}
if (!strcmp(port_name, "MGMT")) {
BSSGP__BVC__CT_component_MGMT.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "BssgpStart")) {
BssgpConfig cfg;
CHARSTRING id;
cfg.decode_text(function_arguments);
id.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function BssgpStart(");
cfg.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
BssgpStart(cfg, id);
TTCN_Runtime::function_finished("BssgpStart");
return TRUE;
} else if (!strcmp(function_name, "f_comp_for_bvci")) {
INTEGER bvci;
bvci.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_comp_for_bvci(");
bvci.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__comp__for__bvci(bvci);
TTCN_Runtime::function_finished("f_comp_for_bvci");
return TRUE;
} else if (!strcmp(function_name, "f_bssgp_ScanEvents")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_bssgp_ScanEvents().");
TTCN_Runtime::function_started(function_arguments);
f__bssgp__ScanEvents();
TTCN_Runtime::function_finished("f_bssgp_ScanEvents");
return TRUE;
} else if (!strcmp(function_name, "f_BnsUdReq")) {
BSSGP__Types::PDU__BSSGP_template pdu;
INTEGER bvci;
INTEGER lsp;
pdu.decode_text(function_arguments);
bvci.decode_text(function_arguments);
lsp.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_BnsUdReq(");
pdu.log();
TTCN_Logger::log_event_str(", ");
bvci.log();
TTCN_Logger::log_event_str(", ");
lsp.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__BnsUdReq(pdu, bvci, lsp);
TTCN_Runtime::function_finished("f_BnsUdReq");
return TRUE;
} else if (!strcmp(function_name, "f_BnsUdInd")) {
BSSGP__Types::PDU__BSSGP_template pdu;
INTEGER_template bvci;
pdu.decode_text(function_arguments);
bvci.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_BnsUdInd(");
pdu.log();
TTCN_Logger::log_event_str(", ");
bvci.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__BnsUdInd(pdu, bvci);
TTCN_Runtime::function_finished("f_BnsUdInd");
return TRUE;
} else if (!strcmp(function_name, "f_sign_change_state")) {
BvcState new__state;
new__state.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_sign_change_state(");
new__state.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__sign__change__state(new__state);
TTCN_Runtime::function_finished("f_sign_change_state");
return TRUE;
} else if (!strcmp(function_name, "DefaultCreateCallback")) {
INTEGER bvci;
Osmocom__Gb__Types::BssgpCellId cell__id;
OCTETSTRING tlli;
BssgpDecoded dec;
bvci.decode_text(function_arguments);
cell__id.decode_text(function_arguments);
tlli.decode_text(function_arguments);
dec.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function DefaultCreateCallback(");
bvci.log();
TTCN_Logger::log_event_str(", ");
cell__id.log();
TTCN_Logger::log_event_str(", ");
tlli.log();
TTCN_Logger::log_event_str(", ");
dec.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
DefaultCreateCallback(bvci, cell__id, tlli, dec);
TTCN_Runtime::function_finished("DefaultCreateCallback");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_client_add")) {
HEXSTRING imsi;
OCTETSTRING tlli;
COMPONENT vc__conn;
imsi.decode_text(function_arguments);
tlli.decode_text(function_arguments);
vc__conn.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_add(");
imsi.log();
TTCN_Logger::log_event_str(", ");
tlli.log();
TTCN_Logger::log_event_str(", ");
vc__conn.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__client__add(imsi, tlli, vc__conn);
TTCN_Runtime::function_finished("f_tbl_client_add");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_client_del")) {
HEXSTRING imsi;
COMPONENT vc__conn;
imsi.decode_text(function_arguments);
vc__conn.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_del(");
imsi.log();
TTCN_Logger::log_event_str(", ");
vc__conn.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__client__del(imsi, vc__conn);
TTCN_Runtime::function_finished("f_tbl_client_del");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_client_llgmm_assign")) {
OCTETSTRING tlli__old;
OCTETSTRING tlli__new;
COMPONENT vc__conn;
tlli__old.decode_text(function_arguments);
tlli__new.decode_text(function_arguments);
vc__conn.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_client_llgmm_assign(");
tlli__old.log();
TTCN_Logger::log_event_str(", ");
tlli__new.log();
TTCN_Logger::log_event_str(", ");
vc__conn.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__client__llgmm__assign(tlli__old, tlli__new, vc__conn);
TTCN_Runtime::function_finished("f_tbl_client_llgmm_assign");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_comp_by_imsi")) {
HEXSTRING imsi;
imsi.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_comp_by_imsi(");
imsi.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__comp__by__imsi(imsi);
TTCN_Runtime::function_finished("f_tbl_comp_by_imsi");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_comp_by_tlli")) {
OCTETSTRING tlli;
tlli.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_comp_by_tlli(");
tlli.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__comp__by__tlli(tlli);
TTCN_Runtime::function_finished("f_tbl_comp_by_tlli");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_idx_by_comp")) {
COMPONENT comp__ref;
comp__ref.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_idx_by_comp(");
comp__ref.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__idx__by__comp(comp__ref);
TTCN_Runtime::function_finished("f_tbl_idx_by_comp");
return TRUE;
} else if (!strcmp(function_name, "f_tbl_tlli_by_comp")) {
COMPONENT comp__ref;
comp__ref.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tbl_tlli_by_comp(");
comp__ref.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tbl__tlli__by__comp(comp__ref);
TTCN_Runtime::function_finished("f_tbl_tlli_by_comp");
return TRUE;
} else if (!strcmp(function_name, "f_dec_bssgp")) {
BSSGP__Types::PDU__BSSGP bssgp;
bssgp.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_dec_bssgp(");
bssgp.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__dec__bssgp(bssgp);
TTCN_Runtime::function_finished("f_dec_bssgp");
return TRUE;
} else if (!strcmp(function_name, "f_ptp_sendUnblock")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_ptp_sendUnblock().");
TTCN_Runtime::function_started(function_arguments);
f__ptp__sendUnblock();
TTCN_Runtime::function_finished("f_ptp_sendUnblock");
return TRUE;
} else if (!strcmp(function_name, "f_ptp_sendBlock")) {
Osmocom__Gb__Types::BssgpCause cause;
cause.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendBlock(");
cause.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ptp__sendBlock(cause);
TTCN_Runtime::function_finished("f_ptp_sendBlock");
return TRUE;
} else if (!strcmp(function_name, "f_ptp_sendStatus")) {
Osmocom__Gb__Types::BssgpCause cause;
BSSGP__Types::PDU__BSSGP pdu;
cause.decode_text(function_arguments);
pdu.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendStatus(");
cause.log();
TTCN_Logger::log_event_str(", ");
pdu.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ptp__sendStatus(cause, pdu);
TTCN_Runtime::function_finished("f_ptp_sendStatus");
return TRUE;
} else if (!strcmp(function_name, "f_ptp_sendReset")) {
Osmocom__Gb__Types::BssgpCause cause;
cause.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_sendReset(");
cause.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ptp__sendReset(cause);
TTCN_Runtime::function_finished("f_ptp_sendReset");
return TRUE;
} else if (!strcmp(function_name, "f_bssgp_bvc_ScanEvents")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_bssgp_bvc_ScanEvents().");
TTCN_Runtime::function_started(function_arguments);
f__bssgp__bvc__ScanEvents();
TTCN_Runtime::function_finished("f_bssgp_bvc_ScanEvents");
return TRUE;
} else if (!strcmp(function_name, "f_bssgp_bvc_main")) {
BssgpBvcConfig cfg;
BOOLEAN sgsn__role;
INTEGER nsei;
CHARSTRING id;
cfg.decode_text(function_arguments);
sgsn__role.decode_text(function_arguments);
nsei.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_bssgp_bvc_main(");
cfg.log();
TTCN_Logger::log_event_str(", ");
sgsn__role.log();
TTCN_Logger::log_event_str(", ");
nsei.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__bssgp__bvc__main(cfg, sgsn__role, nsei, id);
TTCN_Runtime::function_finished("f_bssgp_bvc_main");
return TRUE;
} else if (!strcmp(function_name, "f_ptp_change_state")) {
BvcState new__state;
new__state.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ptp_change_state(");
new__state.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ptp__change__state(new__state);
TTCN_Runtime::function_finished("f_ptp_change_state");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
