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

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

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

/* Including header files */

#include "Osmocom_CTRL_Adapter.hh"

namespace Osmocom__CTRL__Adapter {

/* Literal string constants */

extern const CHARSTRING cs_2(0, NULL),
cs_1(4, "-IPA"),
cs_5('.'),
cs_8(4, ".id."),
cs_0(12, "IPA-CTRL-CLI"),
cs_3(12, "IPA-CTRL-SRV"),
cs_4(4, "bts."),
cs_7(4, "fsm."),
cs_9(5, "state"),
cs_6(4, "trx.");
const unsigned char module_checksum[] = { 0x1c, 0x92, 0xdb, 0xb6, 0x22, 0x49, 0x4a, 0x5f, 0x50, 0xd6, 0xe5, 0x33, 0xdc, 0x10, 0xec, 0xc1 };

/* Global variable definitions */

const TTCN_Typedescriptor_t& CTRL__Adapter__CT_descr_ = COMPONENT_descr_;
COMPONENT CTRL__Adapter__CT_component_vc__CTRL__IPA;
BOOLEAN CTRL__Adapter__CT_component_ipa__is__up;
IPA__Emulation::IPA__CTRL__PT CTRL__Adapter__CT_component_IPA__CTRL("IPA_CTRL");
TTCN_Module module_object("Osmocom_CTRL_Adapter", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

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

/* Bodies of functions, altsteps and testcases */

void f__ipa__ctrl__wait__link__up()
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 31, TTCN_Location::LOCATION_FUNCTION, "f_ipa_ctrl_wait_link_up");
current_location.update_lineno(33);
/* Osmocom_CTRL_Adapter.ttcn, line 33 */
if ((CTRL__Adapter__CT_component_ipa__is__up == TRUE)) {
current_location.update_lineno(34);
/* Osmocom_CTRL_Adapter.ttcn, line 34 */
return;
}
current_location.update_lineno(36);
/* Osmocom_CTRL_Adapter.ttcn, line 36 */
TIMER T("T", 1.0e1);
current_location.update_lineno(37);
/* Osmocom_CTRL_Adapter.ttcn, line 37 */
T.start();
current_location.update_lineno(38);
/* Osmocom_CTRL_Adapter.ttcn, line 38 */
{
tmp_0:
alt_status tmp_0_alt_flag_0 = ALT_MAYBE;
alt_status tmp_0_alt_flag_1 = ALT_MAYBE;
alt_status tmp_0_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_0_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(39);
/* Osmocom_CTRL_Adapter.ttcn, line 39 */
tmp_0_alt_flag_0 = CTRL__Adapter__CT_component_IPA__CTRL.receive(IPA__Emulation::tr__ASP__IPA__EV(IPA__Emulation::ASP__IPA__EventType_template(IPA__Emulation::ASP__IPA__EventType::ASP__IPA__EVENT__UP), IPA__Emulation::tr__ASP__IPA__EV_conn__id_defval, IPA__Emulation::tr__ASP__IPA__EV_id__resp_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_0_alt_flag_0 == ALT_YES) {
current_location.update_lineno(39);
/* Osmocom_CTRL_Adapter.ttcn, line 39 */
CTRL__Adapter__CT_component_ipa__is__up = TRUE;
break;
}
}
if (tmp_0_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(40);
/* Osmocom_CTRL_Adapter.ttcn, line 40 */
tmp_0_alt_flag_1 = T.timeout(NULL);
if (tmp_0_alt_flag_1 == ALT_YES) {
current_location.update_lineno(41);
/* Osmocom_CTRL_Adapter.ttcn, line 41 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout CTRL waiting for ASP_IPA_EVENT_UP"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(42);
/* Osmocom_CTRL_Adapter.ttcn, line 42 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_0_default_flag == ALT_MAYBE) {
tmp_0_default_flag = TTCN_Default::try_altsteps();
if (tmp_0_default_flag == ALT_YES || tmp_0_default_flag == ALT_BREAK) break;
else if (tmp_0_default_flag == ALT_REPEAT) goto tmp_0;
}
current_location.update_lineno(38);
/* Osmocom_CTRL_Adapter.ttcn, line 38 */
if (tmp_0_alt_flag_0 == ALT_NO && tmp_0_alt_flag_1 == ALT_NO && tmp_0_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file Osmocom_CTRL_Adapter.ttcn between lines 38 and 44.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__ipa__ctrl__wait__link__up(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_wait_link_up(");
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, "Osmocom_CTRL_Adapter", "f_ipa_ctrl_wait_link_up", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ipa__ctrl__wait__link__down()
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 48, TTCN_Location::LOCATION_FUNCTION, "f_ipa_ctrl_wait_link_down");
current_location.update_lineno(50);
/* Osmocom_CTRL_Adapter.ttcn, line 50 */
if ((CTRL__Adapter__CT_component_ipa__is__up == FALSE)) {
current_location.update_lineno(51);
/* Osmocom_CTRL_Adapter.ttcn, line 51 */
return;
}
current_location.update_lineno(53);
/* Osmocom_CTRL_Adapter.ttcn, line 53 */
TIMER T("T", 1.0e1);
current_location.update_lineno(54);
/* Osmocom_CTRL_Adapter.ttcn, line 54 */
T.start();
current_location.update_lineno(55);
/* Osmocom_CTRL_Adapter.ttcn, line 55 */
{
tmp_2:
alt_status tmp_2_alt_flag_0 = ALT_MAYBE;
alt_status tmp_2_alt_flag_1 = ALT_MAYBE;
alt_status tmp_2_default_flag = ALT_MAYBE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_2_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(56);
/* Osmocom_CTRL_Adapter.ttcn, line 56 */
tmp_2_alt_flag_0 = CTRL__Adapter__CT_component_IPA__CTRL.receive(IPA__Emulation::tr__ASP__IPA__EV(IPA__Emulation::ASP__IPA__EventType_template(IPA__Emulation::ASP__IPA__EventType::ASP__IPA__EVENT__DOWN), IPA__Emulation::tr__ASP__IPA__EV_conn__id_defval, IPA__Emulation::tr__ASP__IPA__EV_id__resp_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_2_alt_flag_0 == ALT_YES) {
current_location.update_lineno(56);
/* Osmocom_CTRL_Adapter.ttcn, line 56 */
CTRL__Adapter__CT_component_ipa__is__up = FALSE;
break;
}
}
if (tmp_2_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(57);
/* Osmocom_CTRL_Adapter.ttcn, line 57 */
tmp_2_alt_flag_1 = T.timeout(NULL);
if (tmp_2_alt_flag_1 == ALT_YES) {
current_location.update_lineno(58);
/* Osmocom_CTRL_Adapter.ttcn, line 58 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout CTRL waiting for ASP_IPA_EVENT_DOWN"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(59);
/* Osmocom_CTRL_Adapter.ttcn, line 59 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_2_default_flag == ALT_MAYBE) {
tmp_2_default_flag = TTCN_Default::try_altsteps();
if (tmp_2_default_flag == ALT_YES || tmp_2_default_flag == ALT_BREAK) break;
else if (tmp_2_default_flag == ALT_REPEAT) goto tmp_2;
}
current_location.update_lineno(55);
/* Osmocom_CTRL_Adapter.ttcn, line 55 */
if (tmp_2_alt_flag_0 == ALT_NO && tmp_2_alt_flag_1 == ALT_NO && tmp_2_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file Osmocom_CTRL_Adapter.ttcn between lines 55 and 61.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__ipa__ctrl__wait__link__down(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_wait_link_down(");
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, "Osmocom_CTRL_Adapter", "f_ipa_ctrl_wait_link_down", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ipa__ctrl__start__client(const CHARSTRING& bsc__host, const INTEGER& bsc__port)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 65, TTCN_Location::LOCATION_FUNCTION, "f_ipa_ctrl_start_client");
current_location.update_lineno(67);
/* Osmocom_CTRL_Adapter.ttcn, line 67 */
CHARSTRING id(cs_0);
current_location.update_lineno(69);
/* Osmocom_CTRL_Adapter.ttcn, line 69 */
CTRL__Adapter__CT_component_vc__CTRL__IPA = TTCN_Runtime::create_component("IPA_Emulation", "IPA_Emulation_CT", (id + cs_1), NULL, FALSE);
current_location.update_lineno(71);
/* Osmocom_CTRL_Adapter.ttcn, line 71 */
{
Map_Params tmp_5(0);
TTCN_Runtime::map_port(CTRL__Adapter__CT_component_vc__CTRL__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__PORT.get_name(), SYSTEM_COMPREF, "IPA_CODEC_PT", tmp_5);
}
current_location.update_lineno(72);
/* Osmocom_CTRL_Adapter.ttcn, line 72 */
TTCN_Runtime::connect_port(CTRL__Adapter__CT_component_vc__CTRL__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__CTRL__PORT.get_name(), self, CTRL__Adapter__CT_component_IPA__CTRL.get_name());
current_location.update_lineno(74);
/* Osmocom_CTRL_Adapter.ttcn, line 74 */
IPA__Emulation::start_main__client(CTRL__Adapter__CT_component_vc__CTRL__IPA, bsc__host, bsc__port, cs_2, 0, IPA__Emulation::c__IPA__default__ccm__pars, FALSE);
current_location.update_lineno(77);
/* Osmocom_CTRL_Adapter.ttcn, line 77 */
f__ipa__ctrl__wait__link__up();
}

void start_f__ipa__ctrl__start__client(const COMPONENT& component_reference, const CHARSTRING& bsc__host, const INTEGER& bsc__port)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_start_client(");
bsc__host.log();
TTCN_Logger::log_event_str(", ");
bsc__port.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, "Osmocom_CTRL_Adapter", "f_ipa_ctrl_start_client", text_buf);
bsc__host.encode_text(text_buf);
bsc__port.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ipa__ctrl__start__server(const CHARSTRING& listen__host, const INTEGER& listen__port)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 81, TTCN_Location::LOCATION_FUNCTION, "f_ipa_ctrl_start_server");
current_location.update_lineno(83);
/* Osmocom_CTRL_Adapter.ttcn, line 83 */
CHARSTRING id(cs_3);
current_location.update_lineno(84);
/* Osmocom_CTRL_Adapter.ttcn, line 84 */
TIMER T("T", 1.0e1);
current_location.update_lineno(86);
/* Osmocom_CTRL_Adapter.ttcn, line 86 */
CTRL__Adapter__CT_component_vc__CTRL__IPA = TTCN_Runtime::create_component("IPA_Emulation", "IPA_Emulation_CT", (id + cs_1), NULL, FALSE);
current_location.update_lineno(88);
/* Osmocom_CTRL_Adapter.ttcn, line 88 */
{
Map_Params tmp_7(0);
TTCN_Runtime::map_port(CTRL__Adapter__CT_component_vc__CTRL__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__PORT.get_name(), SYSTEM_COMPREF, "IPA_CODEC_PT", tmp_7);
}
current_location.update_lineno(89);
/* Osmocom_CTRL_Adapter.ttcn, line 89 */
TTCN_Runtime::connect_port(CTRL__Adapter__CT_component_vc__CTRL__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__CTRL__PORT.get_name(), self, CTRL__Adapter__CT_component_IPA__CTRL.get_name());
current_location.update_lineno(91);
/* Osmocom_CTRL_Adapter.ttcn, line 91 */
IPA__Emulation::start_main__server(CTRL__Adapter__CT_component_vc__CTRL__IPA, listen__host, listen__port, FALSE, IPA__Emulation::main__server_init__behavior_defval, FALSE);
}

void start_f__ipa__ctrl__start__server(const COMPONENT& component_reference, const CHARSTRING& listen__host, const INTEGER& listen__port)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_start_server(");
listen__host.log();
TTCN_Logger::log_event_str(", ");
listen__port.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, "Osmocom_CTRL_Adapter", "f_ipa_ctrl_start_server", text_buf);
listen__host.encode_text(text_buf);
listen__port.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__ipa__ctrl__stop()
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 95, TTCN_Location::LOCATION_FUNCTION, "f_ipa_ctrl_stop");
current_location.update_lineno(96);
/* Osmocom_CTRL_Adapter.ttcn, line 96 */
CTRL__Adapter__CT_component_vc__CTRL__IPA.stop();
}

void start_f__ipa__ctrl__stop(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_stop(");
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, "Osmocom_CTRL_Adapter", "f_ipa_ctrl_stop", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

CHARSTRING f__ctrl__get__bts(IPA__Emulation::IPA__CTRL__PT& pt, const INTEGER& bts__nr, const CHARSTRING& suffix)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 101, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_get_bts");
current_location.update_lineno(102);
/* Osmocom_CTRL_Adapter.ttcn, line 102 */
return Osmocom__CTRL__Functions::f__ctrl__get(pt, (((cs_4 + int2str(bts__nr)) + cs_5) + suffix), Osmocom__CTRL__Functions::f__ctrl__get_on__err_defval);
}

void f__ctrl__set__bts(IPA__Emulation::IPA__CTRL__PT& pt, const INTEGER& bts__nr, const CHARSTRING& suffix, const CHARSTRING& val)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 104, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_set_bts");
current_location.update_lineno(105);
/* Osmocom_CTRL_Adapter.ttcn, line 105 */
Osmocom__CTRL__Functions::f__ctrl__set(pt, (((cs_4 + int2str(bts__nr)) + cs_5) + suffix), val);
}

CHARSTRING_template ts__bts(const INTEGER& bts__nr)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 108, TTCN_Location::LOCATION_TEMPLATE, "ts_bts");
CHARSTRING_template ret_val;
ret_val = ((cs_4 + int2str(bts__nr)) + cs_5);
return ret_val;
}

CHARSTRING_template ts__bts__trx(const INTEGER& bts__nr, const INTEGER& trx__nr)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 109, TTCN_Location::LOCATION_TEMPLATE, "ts_bts_trx");
CHARSTRING_template ret_val;
ret_val = (((ts__bts(bts__nr).valueof() + cs_6) + int2str(trx__nr)) + cs_5);
return ret_val;
}

void f__ctrl__get__exp__bts(IPA__Emulation::IPA__CTRL__PT& pt, const INTEGER& bts__nr, const CHARSTRING& suffix, const CHARSTRING_template& exp)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 112, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_get_exp_bts");
current_location.update_lineno(113);
/* Osmocom_CTRL_Adapter.ttcn, line 113 */
Osmocom__CTRL__Functions::f__ctrl__get__exp(pt, (ts__bts(bts__nr).valueof() + suffix), exp);
}

void f__ctrl__get__exp__trx(IPA__Emulation::IPA__CTRL__PT& pt, const INTEGER& bts__nr, const INTEGER& trx__nr, const CHARSTRING& suffix, const CHARSTRING_template& exp)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 116, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_get_exp_trx");
current_location.update_lineno(119);
/* Osmocom_CTRL_Adapter.ttcn, line 119 */
Osmocom__CTRL__Functions::f__ctrl__get__exp(pt, (ts__bts__trx(bts__nr, trx__nr).valueof() + suffix), exp);
}

CHARSTRING_template ts__fsm__inst__id(const CHARSTRING& class__name, const CHARSTRING& inst__id)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 122, TTCN_Location::LOCATION_TEMPLATE, "ts_fsm_inst_id");
CHARSTRING_template ret_val;
ret_val = ((((cs_7 + class__name) + cs_8) + inst__id) + cs_5);
return ret_val;
}

CHARSTRING f__ctrl__get__fsm__inst__state(IPA__Emulation::IPA__CTRL__PT& pt, const CHARSTRING& fsm__class__name, const CHARSTRING& fsm__inst__id)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 126, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_get_fsm_inst_state");
current_location.update_lineno(128);
/* Osmocom_CTRL_Adapter.ttcn, line 128 */
return Osmocom__CTRL__Functions::f__ctrl__get(pt, (ts__fsm__inst__id(fsm__class__name, fsm__inst__id).valueof() + cs_9), Osmocom__CTRL__Functions::f__ctrl__get_on__err_defval);
}

void f__ctrl__get__exp__inst__state(IPA__Emulation::IPA__CTRL__PT& pt, const CHARSTRING& fsm__class__name, const CHARSTRING_template& fsm__inst__id, const CHARSTRING_template& exp)
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 132, TTCN_Location::LOCATION_FUNCTION, "f_ctrl_get_exp_inst_state");
current_location.update_lineno(136);
/* Osmocom_CTRL_Adapter.ttcn, line 136 */
Osmocom__CTRL__Functions::f__ctrl__get__exp(pt, (ts__fsm__inst__id(fsm__class__name, fsm__inst__id.valueof()).valueof() + cs_9), exp);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_CTRL_Adapter");
Osmocom__CTRL__Functions::module_object.pre_init_module();
module_object.add_function("f_ipa_ctrl_wait_link_up", (genericfunc_t)&f__ipa__ctrl__wait__link__up, (genericfunc_t)&start_f__ipa__ctrl__wait__link__up);
module_object.add_function("f_ipa_ctrl_wait_link_down", (genericfunc_t)&f__ipa__ctrl__wait__link__down, (genericfunc_t)&start_f__ipa__ctrl__wait__link__down);
module_object.add_function("f_ipa_ctrl_start_client", (genericfunc_t)&f__ipa__ctrl__start__client, (genericfunc_t)&start_f__ipa__ctrl__start__client);
module_object.add_function("f_ipa_ctrl_start_server", (genericfunc_t)&f__ipa__ctrl__start__server, (genericfunc_t)&start_f__ipa__ctrl__start__server);
module_object.add_function("f_ipa_ctrl_stop", (genericfunc_t)&f__ipa__ctrl__stop, (genericfunc_t)&start_f__ipa__ctrl__stop);
module_object.add_function("f_ctrl_get_bts", (genericfunc_t)&f__ctrl__get__bts, NULL);
module_object.add_function("f_ctrl_set_bts", (genericfunc_t)&f__ctrl__set__bts, NULL);
module_object.add_function("f_ctrl_get_exp_bts", (genericfunc_t)&f__ctrl__get__exp__bts, NULL);
module_object.add_function("f_ctrl_get_exp_trx", (genericfunc_t)&f__ctrl__get__exp__trx, NULL);
module_object.add_function("f_ctrl_get_fsm_inst_state", (genericfunc_t)&f__ctrl__get__fsm__inst__state, NULL);
module_object.add_function("f_ctrl_get_exp_inst_state", (genericfunc_t)&f__ctrl__get__exp__inst__state, NULL);
}

void post_init_module()
{
TTCN_Location current_location("Osmocom_CTRL_Adapter.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_CTRL_Adapter");
Osmocom__CTRL__Functions::module_object.post_init_module();
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "CTRL_Adapter_CT")) {
CTRL__Adapter__CT_component_vc__CTRL__IPA.clean_up();
CTRL__Adapter__CT_component_ipa__is__up = FALSE;
CTRL__Adapter__CT_component_IPA__CTRL.activate_port();
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "CTRL_Adapter_CT")) {
if (!strcmp(port_name, "IPA_CTRL")) {
CTRL__Adapter__CT_component_IPA__CTRL.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_ipa_ctrl_wait_link_up")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_ipa_ctrl_wait_link_up().");
TTCN_Runtime::function_started(function_arguments);
f__ipa__ctrl__wait__link__up();
TTCN_Runtime::function_finished("f_ipa_ctrl_wait_link_up");
return TRUE;
} else if (!strcmp(function_name, "f_ipa_ctrl_wait_link_down")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_ipa_ctrl_wait_link_down().");
TTCN_Runtime::function_started(function_arguments);
f__ipa__ctrl__wait__link__down();
TTCN_Runtime::function_finished("f_ipa_ctrl_wait_link_down");
return TRUE;
} else if (!strcmp(function_name, "f_ipa_ctrl_start_client")) {
CHARSTRING bsc__host;
INTEGER bsc__port;
bsc__host.decode_text(function_arguments);
bsc__port.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_start_client(");
bsc__host.log();
TTCN_Logger::log_event_str(", ");
bsc__port.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ipa__ctrl__start__client(bsc__host, bsc__port);
TTCN_Runtime::function_finished("f_ipa_ctrl_start_client");
return TRUE;
} else if (!strcmp(function_name, "f_ipa_ctrl_start_server")) {
CHARSTRING listen__host;
INTEGER listen__port;
listen__host.decode_text(function_arguments);
listen__port.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_ipa_ctrl_start_server(");
listen__host.log();
TTCN_Logger::log_event_str(", ");
listen__port.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__ipa__ctrl__start__server(listen__host, listen__port);
TTCN_Runtime::function_finished("f_ipa_ctrl_start_server");
return TRUE;
} else if (!strcmp(function_name, "f_ipa_ctrl_stop")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_ipa_ctrl_stop().");
TTCN_Runtime::function_started(function_arguments);
f__ipa__ctrl__stop();
TTCN_Runtime::function_finished("f_ipa_ctrl_stop");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
