// 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 "RSL_Emulation.hh" namespace RSL__Emulation { /* Literal string constants */ const unsigned char module_checksum[] = { 0x2e, 0x70, 0x7b, 0x06, 0x3d, 0xd7, 0xc1, 0x1d, 0x11, 0xa5, 0x92, 0xfb, 0x48, 0xee, 0xff, 0x3f }; /* Global variable definitions */ const TTCN_Typedescriptor_t& RSL__DchanHdlr_descr_ = COMPONENT_descr_; RSL__DCHAN__PT RSL__DchanHdlr_component_RSL("RSL"); RSLEM__PROC__PT RSL__DchanHdlr_component_RSL__PROC("RSL_PROC"); GSM__Types::RslChannelNr RSL__DchanHdlr_component_g__chan__nr; RSL__DCHAN__PT RSL__DchanHdlr_component_RSL1("RSL1"); RSLEM__PROC__PT RSL__DchanHdlr_component_RSL1__PROC("RSL1_PROC"); RSL__DCHAN__PT RSL__DchanHdlr_component_RSL2("RSL2"); RSLEM__PROC__PT RSL__DchanHdlr_component_RSL2__PROC("RSL2_PROC"); const XERdescriptor_t RSLDC__ChanRqd_ra_xer_ = { {"ra>\n", "ra>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int RSLDC__ChanRqd_ra_oer_ext_arr_[0] = {}; const int RSLDC__ChanRqd_ra_oer_p_[0] = {}; const TTCN_OERdescriptor_t RSLDC__ChanRqd_ra_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RSLDC__ChanRqd_ra_oer_ext_arr_, 0, RSLDC__ChanRqd_ra_oer_p_}; const TTCN_Typedescriptor_t RSLDC__ChanRqd_ra_descr_ = { "@RSL_Emulation.RSLDC_ChanRqd.ra", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &RSLDC__ChanRqd_ra_xer_, &OCTETSTRING_json_, &RSLDC__ChanRqd_ra_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RSLDC__ChanRqd_ra_default_coding("RAW"); // No XER for RSLDC__ChanRqd const TTCN_Typedescriptor_t RSLDC__ChanRqd_descr_ = { "@RSL_Emulation.RSLDC_ChanRqd", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RSLDC__ChanRqd_fn_xer_ = { {"fn>\n", "fn>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RSLDC__ChanRqd_fn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RSLDC__ChanRqd_fn_descr_ = { "@RSL_Emulation.RSLDC_ChanRqd.fn", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &RSLDC__ChanRqd_fn_xer_, &INTEGER_json_, &RSLDC__ChanRqd_fn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RSLDC__ChanRqd_fn_default_coding("RAW"); // No XER for RSLEm__EventType const TTCN_Typedescriptor_t RSLEm__EventType_descr_ = { "@RSL_Emulation.RSLEm_EventType", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RSLEm__Event_sid_default_coding("RAW"); // No XER for RSLEm__Event const TTCN_Typedescriptor_t RSLEm__Event_descr_ = { "@RSL_Emulation.RSLEm_Event", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; IPA__Types::IpaStreamId_template template_tr__RSLEm__EV_sid_defval; const IPA__Types::IpaStreamId_template& tr__RSLEm__EV_sid_defval = template_tr__RSLEm__EV_sid_defval; INTEGER const_f__chan__est_fn_defval; const INTEGER& f__chan__est_fn_defval = const_f__chan__est_fn_defval; INTEGER_template template_f__chan__est_tsc_defval; const INTEGER_template& f__chan__est_tsc_defval = template_f__chan__est_tsc_defval; // No XER for ConnectionData const TTCN_Typedescriptor_t ConnectionData_descr_ = { "@RSL_Emulation.ConnectionData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t ConnectionData_trx__nr_xer_ = { {"trx_nr>\n", "trx_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t ConnectionData_trx__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t ConnectionData_trx__nr_descr_ = { "@RSL_Emulation.ConnectionData.trx_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &ConnectionData_trx__nr_xer_, &INTEGER_json_, &ConnectionData_trx__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ConnectionData_trx__nr_default_coding("RAW"); UNIVERSAL_CHARSTRING ConnectionData_stream__id_default_coding("RAW"); UNIVERSAL_CHARSTRING ConnectionData_chan__nr_default_coding("RAW"); const XERdescriptor_t ConnectionData_ra_xer_ = { {"ra>\n", "ra>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int ConnectionData_ra_oer_ext_arr_[0] = {}; const int ConnectionData_ra_oer_p_[0] = {}; const TTCN_OERdescriptor_t ConnectionData_ra_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ConnectionData_ra_oer_ext_arr_, 0, ConnectionData_ra_oer_p_}; const TTCN_Typedescriptor_t ConnectionData_ra_descr_ = { "@RSL_Emulation.ConnectionData.ra", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &ConnectionData_ra_xer_, &OCTETSTRING_json_, &ConnectionData_ra_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ConnectionData_ra_default_coding("RAW"); const XERdescriptor_t ConnectionData_ra__fn_xer_ = { {"ra_fn>\n", "ra_fn>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t ConnectionData_ra__fn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t ConnectionData_ra__fn_descr_ = { "@RSL_Emulation.ConnectionData.ra_fn", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &ConnectionData_ra__fn_xer_, &INTEGER_json_, &ConnectionData_ra__fn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ConnectionData_ra__fn_default_coding("RAW"); // No XER for LastActData const TTCN_Typedescriptor_t LastActData_descr_ = { "@RSL_Emulation.LastActData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t LastActData_trx__nr_xer_ = { {"trx_nr>\n", "trx_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t LastActData_trx__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t LastActData_trx__nr_descr_ = { "@RSL_Emulation.LastActData.trx_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &LastActData_trx__nr_xer_, &INTEGER_json_, &LastActData_trx__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LastActData_trx__nr_default_coding("RAW"); UNIVERSAL_CHARSTRING LastActData_chan__nr_default_coding("RAW"); UNIVERSAL_CHARSTRING LastActData_chan__act_default_coding("RAW"); // No XER for ASP__RSL__UDList const TTCN_Typedescriptor_t ASP__RSL__UDList_descr_ = { "@RSL_Emulation.ASP_RSL_UDList", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &IPA__Emulation::ASP__RSL__Unitdata_descr_, TTCN_Typedescriptor_t::DONTCARE }; const TTCN_Typedescriptor_t& RSL__Emulation__CT_descr_ = COMPONENT_descr_; IPA__Emulation::IPA__RSL__PT RSL__Emulation__CT_component_IPA__PT("IPA_PT"); RSL__DCHAN__PT RSL__Emulation__CT_component_CLIENT__PT("CLIENT_PT"); RSLEM__PROC__PT RSL__Emulation__CT_component_RSL__PROC("RSL_PROC"); RSL__CCHAN__PT RSL__Emulation__CT_component_CCHAN__PT("CCHAN_PT"); VALUE_ARRAY RSL__Emulation__CT_component_ConnectionTable; ASP__RSL__UDList RSL__Emulation__CT_component_WaitingQueue; VALUE_ARRAY RSL__Emulation__CT_component_LastActTable; INTEGER RSL__Emulation__CT_component_TrxConnNum; VALUE_ARRAY RSL__Emulation__CT_component_TrxConnMap; BOOLEAN const_main__bts__role_defval; const BOOLEAN& main__bts__role_defval = const_main__bts__role_defval; TTCN_Module module_object("RSL_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 */ RSLDC__ChanRqd::RSLDC__ChanRqd() { } RSLDC__ChanRqd::RSLDC__ChanRqd(const OCTETSTRING& par_ra, const OPTIONAL< INTEGER >& par_fn) : field_ra(par_ra), field_fn(par_fn) { } RSLDC__ChanRqd::RSLDC__ChanRqd(const RSLDC__ChanRqd& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Emulation.RSLDC_ChanRqd."); if (other_value.ra().is_bound()) field_ra = other_value.ra(); else field_ra.clean_up(); if (other_value.fn().is_bound()) field_fn = other_value.fn(); else field_fn.clean_up(); } void RSLDC__ChanRqd::clean_up() { field_ra.clean_up(); field_fn.clean_up(); } const TTCN_Typedescriptor_t* RSLDC__ChanRqd::get_descriptor() const { return &RSLDC__ChanRqd_descr_; } RSLDC__ChanRqd& RSLDC__ChanRqd::operator=(const RSLDC__ChanRqd& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Emulation.RSLDC_ChanRqd."); if (other_value.ra().is_bound()) field_ra = other_value.ra(); else field_ra.clean_up(); if (other_value.fn().is_bound()) field_fn = other_value.fn(); else field_fn.clean_up(); } return *this; } boolean RSLDC__ChanRqd::operator==(const RSLDC__ChanRqd& other_value) const { return field_ra==other_value.field_ra && field_fn==other_value.field_fn; } boolean RSLDC__ChanRqd::is_bound() const { return (field_ra.is_bound()) || (OPTIONAL_OMIT == field_fn.get_selection() || field_fn.is_bound()); } boolean RSLDC__ChanRqd::is_value() const { return field_ra.is_value() && (OPTIONAL_OMIT == field_fn.get_selection() || field_fn.is_value()); } int RSLDC__ChanRqd::size_of() const { int ret_val = 1; if (field_fn.ispresent()) ret_val++; return ret_val; } void RSLDC__ChanRqd::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ ra := "); field_ra.log(); TTCN_Logger::log_event_str(", fn := "); field_fn.log(); TTCN_Logger::log_event_str(" }"); } void RSLDC__ChanRqd::set_implicit_omit() { if (ra().is_bound()) ra().set_implicit_omit(); if (!fn().is_bound()) fn() = OMIT_VALUE; else fn().set_implicit_omit(); } void RSLDC__ChanRqd::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ra().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.RSLDC_ChanRqd: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RSL_Emulation.RSLDC_ChanRqd"); } } void RSLDC__ChanRqd::encode_text(Text_Buf& text_buf) const { field_ra.encode_text(text_buf); field_fn.encode_text(text_buf); } void RSLDC__ChanRqd::decode_text(Text_Buf& text_buf) { field_ra.decode_text(text_buf); field_fn.decode_text(text_buf); } struct RSLDC__ChanRqd_template::single_value_struct { OCTETSTRING_template field_ra; INTEGER_template field_fn; }; void RSLDC__ChanRqd_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_ra = ANY_VALUE; single_value->field_fn = ANY_OR_OMIT; } } } void RSLDC__ChanRqd_template::copy_value(const RSLDC__ChanRqd& other_value) { single_value = new single_value_struct; if (other_value.ra().is_bound()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } if (other_value.fn().is_bound()) { if (other_value.fn().ispresent()) single_value->field_fn = other_value.fn()(); else single_value->field_fn = OMIT_VALUE; } else { single_value->field_fn.clean_up(); } set_selection(SPECIFIC_VALUE); } void RSLDC__ChanRqd_template::copy_template(const RSLDC__ChanRqd_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.ra().get_selection()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fn().get_selection()) { single_value->field_fn = other_value.fn(); } else { single_value->field_fn.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 RSLDC__ChanRqd_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 RSLDC__ChanRqd_template(*other_value.implication_.precondition); implication_.implied_template = new RSLDC__ChanRqd_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 @RSL_Emulation.RSLDC_ChanRqd."); break; } set_selection(other_value); } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template() { } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(const RSLDC__ChanRqd& other_value) { copy_value(other_value); } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RSLDC__ChanRqd&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RSL_Emulation.RSLDC_ChanRqd from an unbound optional field."); } } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(RSLDC__ChanRqd_template* p_precondition, RSLDC__ChanRqd_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } RSLDC__ChanRqd_template::RSLDC__ChanRqd_template(const RSLDC__ChanRqd_template& other_value) : Base_Template() { copy_template(other_value); } RSLDC__ChanRqd_template::~RSLDC__ChanRqd_template() { clean_up(); } RSLDC__ChanRqd_template& RSLDC__ChanRqd_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RSLDC__ChanRqd_template& RSLDC__ChanRqd_template::operator=(const RSLDC__ChanRqd& other_value) { clean_up(); copy_value(other_value); return *this; } RSLDC__ChanRqd_template& RSLDC__ChanRqd_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RSLDC__ChanRqd&)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 @RSL_Emulation.RSLDC_ChanRqd."); } return *this; } RSLDC__ChanRqd_template& RSLDC__ChanRqd_template::operator=(const RSLDC__ChanRqd_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RSLDC__ChanRqd_template::match(const RSLDC__ChanRqd& 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.ra().is_bound()) return FALSE; if(!single_value->field_ra.match(other_value.ra(), legacy))return FALSE; if(!other_value.fn().is_bound()) return FALSE; if((other_value.fn().ispresent() ? !single_value->field_fn.match((const INTEGER&)other_value.fn(), legacy) : !single_value->field_fn.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 @RSL_Emulation.RSLDC_ChanRqd."); } return FALSE; } boolean RSLDC__ChanRqd_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_ra.is_bound() || (single_value->field_fn.is_omit() || single_value->field_fn.is_bound()); } boolean RSLDC__ChanRqd_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_ra.is_value() && (single_value->field_fn.is_omit() || single_value->field_fn.is_value()); } void RSLDC__ChanRqd_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; } RSLDC__ChanRqd RSLDC__ChanRqd_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 @RSL_Emulation.RSLDC_ChanRqd."); RSLDC__ChanRqd ret_val; if (single_value->field_ra.is_bound()) { ret_val.ra() = single_value->field_ra.valueof(); } if (single_value->field_fn.is_omit()) ret_val.fn() = OMIT_VALUE; else if (single_value->field_fn.is_bound()) { ret_val.fn() = single_value->field_fn.valueof(); } return ret_val; } void RSLDC__ChanRqd_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 @RSL_Emulation.RSLDC_ChanRqd."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RSLDC__ChanRqd_template[list_length]; } RSLDC__ChanRqd_template& RSLDC__ChanRqd_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 @RSL_Emulation.RSLDC_ChanRqd."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RSL_Emulation.RSLDC_ChanRqd."); return value_list.list_value[list_index]; } OCTETSTRING_template& RSLDC__ChanRqd_template::ra() { set_specific(); return single_value->field_ra; } const OCTETSTRING_template& RSLDC__ChanRqd_template::ra() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ra of a non-specific template of type @RSL_Emulation.RSLDC_ChanRqd."); return single_value->field_ra; } INTEGER_template& RSLDC__ChanRqd_template::fn() { set_specific(); return single_value->field_fn; } const INTEGER_template& RSLDC__ChanRqd_template::fn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fn of a non-specific template of type @RSL_Emulation.RSLDC_ChanRqd."); return single_value->field_fn; } int RSLDC__ChanRqd_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_fn.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 @RSL_Emulation.RSLDC_ChanRqd 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 @RSL_Emulation.RSLDC_ChanRqd containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLDC_ChanRqd containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Emulation.RSLDC_ChanRqd."); } return 0; } void RSLDC__ChanRqd_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ ra := "); single_value->field_ra.log(); TTCN_Logger::log_event_str(", fn := "); single_value->field_fn.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 RSLDC__ChanRqd_template::log_match(const RSLDC__ChanRqd& 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_ra.match(match_value.ra(), legacy)){ TTCN_Logger::log_logmatch_info(".ra"); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.fn().ispresent()){ if(!single_value->field_fn.match(match_value.fn(), legacy)){ TTCN_Logger::log_logmatch_info(".fn"); single_value->field_fn.log_match(match_value.fn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_fn.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".fn := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_fn.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("{ ra := "); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::log_event_str(", fn := "); if (match_value.fn().ispresent()) { single_value->field_fn.log_match(match_value.fn(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_fn.log(); if (single_value->field_fn.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 RSLDC__ChanRqd_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (ra().is_bound()) ra().set_implicit_omit(); if (!fn().is_bound()) fn() = OMIT_VALUE; else fn().set_implicit_omit(); } void RSLDC__ChanRqd_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_ra.encode_text(text_buf); single_value->field_fn.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 @RSL_Emulation.RSLDC_ChanRqd."); } } void RSLDC__ChanRqd_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_ra.decode_text(text_buf); single_value->field_fn.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 RSLDC__ChanRqd_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 @RSL_Emulation.RSLDC_ChanRqd."); } } void RSLDC__ChanRqd_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: { RSLDC__ChanRqd_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ra().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.RSLDC_ChanRqd: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RSLDC__ChanRqd_template* precondition = new RSLDC__ChanRqd_template; precondition->set_param(*param.get_elem(0)); RSLDC__ChanRqd_template* implied_template = new RSLDC__ChanRqd_template; implied_template->set_param(*param.get_elem(1)); *this = RSLDC__ChanRqd_template(precondition, implied_template); } break; default: param.type_error("record template", "@RSL_Emulation.RSLDC_ChanRqd"); } is_ifpresent = param.get_ifpresent(); } void RSLDC__ChanRqd_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_ra.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.RSLDC_ChanRqd"); single_value->field_fn.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.RSLDC_ChanRqd"); 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 : "@RSL_Emulation.RSLDC_ChanRqd"); } boolean RSLDC__ChanRqd_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RSLDC__ChanRqd_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(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Emulation.RSLEm_EventType comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean RSLEm__EventType::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 @RSL_Emulation.RSLEm_EventType."); return enum_value > other_value; } boolean RSLEm__EventType::operator>(const RSLEm__EventType& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType."); return enum_value > other_value.enum_value; } const char *RSLEm__EventType::enum_to_str(enum_type enum_par) { switch (enum_par) { case RSLEM__EV__TRX__UP: return "RSLEM_EV_TRX_UP"; case RSLEM__EV__TRX__DOWN: return "RSLEM_EV_TRX_DOWN"; default: return ""; } } RSLEm__EventType::enum_type RSLEm__EventType::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, "RSLEM_EV_TRX_UP")) return RSLEM__EV__TRX__UP; if (!strcmp(str_par, "RSLEM_EV_TRX_DOWN")) return RSLEM__EV__TRX__DOWN; } return UNKNOWN_VALUE; } boolean RSLEm__EventType::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int RSLEm__EventType::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 @RSL_Emulation.RSLEm_EventType.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int RSLEm__EventType::enum2int(const RSLEm__EventType& 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 @RSL_Emulation.RSLEm_EventType.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void RSLEm__EventType::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RSL_Emulation.RSLEm_EventType.", int_val); enum_value = (enum_type)int_val; } RSLEm__EventType::operator RSLEm__EventType::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RSL_Emulation.RSLEm_EventType."); return enum_value; } void RSLEm__EventType::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 RSLEm__EventType::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", "@RSL_Emulation.RSLEm_EventType"); 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 @RSL_Emulation.RSLEm_EventType."); } } void RSLEm__EventType::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType."); text_buf.push_int(enum_value); } void RSLEm__EventType::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 @RSL_Emulation.RSLEm_EventType.", enum_value); } void RSLEm__EventType_template::copy_template(const RSLEm__EventType_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 RSLEm__EventType_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 RSLEm__EventType_template(*other_value.implication_.precondition); implication_.implied_template = new RSLEm__EventType_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 @RSL_Emulation.RSLEm_EventType."); } } RSLEm__EventType_template::RSLEm__EventType_template() { } RSLEm__EventType_template::RSLEm__EventType_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RSLEm__EventType_template::RSLEm__EventType_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!RSLEm__EventType::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RSL_Emulation.RSLEm_EventType with unknown numeric value %d.", other_value); single_value = (RSLEm__EventType::enum_type)other_value; } RSLEm__EventType_template::RSLEm__EventType_template(RSLEm__EventType::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } RSLEm__EventType_template::RSLEm__EventType_template(const RSLEm__EventType& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == RSLEm__EventType::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType."); single_value = other_value.enum_value; } RSLEm__EventType_template::RSLEm__EventType_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (RSLEm__EventType::enum_type)(const RSLEm__EventType&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RSL_Emulation.RSLEm_EventType from an unbound optional field."); } } RSLEm__EventType_template::RSLEm__EventType_template(RSLEm__EventType_template* p_precondition, RSLEm__EventType_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RSLEm__EventType_template::RSLEm__EventType_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } RSLEm__EventType_template::RSLEm__EventType_template(const RSLEm__EventType_template& other_value) : Base_Template() { copy_template(other_value); } RSLEm__EventType_template::~RSLEm__EventType_template() { clean_up(); } boolean RSLEm__EventType_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean RSLEm__EventType_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != RSLEm__EventType::UNBOUND_VALUE; } void RSLEm__EventType_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; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(int other_value) { if (!RSLEm__EventType::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RSL_Emulation.RSLEm_EventType.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (RSLEm__EventType::enum_type)other_value; return *this; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(RSLEm__EventType::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(const RSLEm__EventType& other_value) { if (other_value.enum_value == RSLEm__EventType::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RSL_Emulation.RSLEm_EventType to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (RSLEm__EventType::enum_type)(const RSLEm__EventType&)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 @RSL_Emulation.RSLEm_EventType."); } return *this; } RSLEm__EventType_template& RSLEm__EventType_template::operator=(const RSLEm__EventType_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RSLEm__EventType_template::match(RSLEm__EventType::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 @RSL_Emulation.RSLEm_EventType."); } return FALSE; } boolean RSLEm__EventType_template::match(const RSLEm__EventType& other_value, boolean) const { if (other_value.enum_value == RSLEm__EventType::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RSL_Emulation.RSLEm_EventType with an unbound value."); return match(other_value.enum_value); } RSLEm__EventType::enum_type RSLEm__EventType_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 @RSL_Emulation.RSLEm_EventType."); return single_value; } void RSLEm__EventType_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 RSLEm__EventType_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RSL_Emulation.RSLEm_EventType."); } } RSLEm__EventType_template& RSLEm__EventType_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 @RSL_Emulation.RSLEm_EventType."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RSL_Emulation.RSLEm_EventType."); return value_list.list_value[list_index]; } void RSLEm__EventType_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(RSLEm__EventType::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 RSLEm__EventType_template::log_match(const RSLEm__EventType& 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 RSLEm__EventType_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 @RSL_Emulation.RSLEm_EventType."); } } void RSLEm__EventType_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (RSLEm__EventType::enum_type)text_buf.pull_int().get_val(); if (!RSLEm__EventType::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RSL_Emulation.RSLEm_EventType.", 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 RSLEm__EventType_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 @RSL_Emulation.RSLEm_EventType."); } } boolean RSLEm__EventType_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RSLEm__EventType_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; iget_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: { RSLEm__EventType_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_iget_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: { RSLEm__EventType::enum_type enum_val = RSLEm__EventType::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!RSLEm__EventType::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RSL_Emulation.RSLEm_EventType."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { RSLEm__EventType_template* precondition = new RSLEm__EventType_template; precondition->set_param(*m_p->get_elem(0)); RSLEm__EventType_template* implied_template = new RSLEm__EventType_template; implied_template->set_param(*m_p->get_elem(1)); *this = RSLEm__EventType_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RSL_Emulation.RSLEm_EventType"); } is_ifpresent = param.get_ifpresent(); } void RSLEm__EventType_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 : "@RSL_Emulation.RSLEm_EventType"); } RSLEm__Event::RSLEm__Event() { } RSLEm__Event::RSLEm__Event(const RSLEm__EventType& par_ev__type, const IPA__Types::IpaStreamId& par_sid) : field_ev__type(par_ev__type), field_sid(par_sid) { } RSLEm__Event::RSLEm__Event(const RSLEm__Event& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Emulation.RSLEm_Event."); if (other_value.ev__type().is_bound()) field_ev__type = other_value.ev__type(); else field_ev__type.clean_up(); if (other_value.sid().is_bound()) field_sid = other_value.sid(); else field_sid.clean_up(); } void RSLEm__Event::clean_up() { field_ev__type.clean_up(); field_sid.clean_up(); } const TTCN_Typedescriptor_t* RSLEm__Event::get_descriptor() const { return &RSLEm__Event_descr_; } RSLEm__Event& RSLEm__Event::operator=(const RSLEm__Event& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Emulation.RSLEm_Event."); if (other_value.ev__type().is_bound()) field_ev__type = other_value.ev__type(); else field_ev__type.clean_up(); if (other_value.sid().is_bound()) field_sid = other_value.sid(); else field_sid.clean_up(); } return *this; } boolean RSLEm__Event::operator==(const RSLEm__Event& other_value) const { return field_ev__type==other_value.field_ev__type && field_sid==other_value.field_sid; } boolean RSLEm__Event::is_bound() const { return (field_ev__type.is_bound()) || (field_sid.is_bound()); } boolean RSLEm__Event::is_value() const { return field_ev__type.is_value() && field_sid.is_value(); } void RSLEm__Event::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ ev_type := "); field_ev__type.log(); TTCN_Logger::log_event_str(", sid := "); field_sid.log(); TTCN_Logger::log_event_str(" }"); } void RSLEm__Event::set_implicit_omit() { if (ev__type().is_bound()) ev__type().set_implicit_omit(); if (sid().is_bound()) sid().set_implicit_omit(); } void RSLEm__Event::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ev__type().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sid().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ev_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ev__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.RSLEm_Event: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RSL_Emulation.RSLEm_Event"); } } void RSLEm__Event::encode_text(Text_Buf& text_buf) const { field_ev__type.encode_text(text_buf); field_sid.encode_text(text_buf); } void RSLEm__Event::decode_text(Text_Buf& text_buf) { field_ev__type.decode_text(text_buf); field_sid.decode_text(text_buf); } struct RSLEm__Event_template::single_value_struct { RSLEm__EventType_template field_ev__type; IPA__Types::IpaStreamId_template field_sid; }; void RSLEm__Event_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_ev__type = ANY_VALUE; single_value->field_sid = ANY_VALUE; } } } void RSLEm__Event_template::copy_value(const RSLEm__Event& other_value) { single_value = new single_value_struct; if (other_value.ev__type().is_bound()) { single_value->field_ev__type = other_value.ev__type(); } else { single_value->field_ev__type.clean_up(); } if (other_value.sid().is_bound()) { single_value->field_sid = other_value.sid(); } else { single_value->field_sid.clean_up(); } set_selection(SPECIFIC_VALUE); } void RSLEm__Event_template::copy_template(const RSLEm__Event_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.ev__type().get_selection()) { single_value->field_ev__type = other_value.ev__type(); } else { single_value->field_ev__type.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sid().get_selection()) { single_value->field_sid = other_value.sid(); } else { single_value->field_sid.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 RSLEm__Event_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 RSLEm__Event_template(*other_value.implication_.precondition); implication_.implied_template = new RSLEm__Event_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 @RSL_Emulation.RSLEm_Event."); break; } set_selection(other_value); } RSLEm__Event_template::RSLEm__Event_template() { } RSLEm__Event_template::RSLEm__Event_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RSLEm__Event_template::RSLEm__Event_template(const RSLEm__Event& other_value) { copy_value(other_value); } RSLEm__Event_template::RSLEm__Event_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RSLEm__Event&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RSL_Emulation.RSLEm_Event from an unbound optional field."); } } RSLEm__Event_template::RSLEm__Event_template(RSLEm__Event_template* p_precondition, RSLEm__Event_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RSLEm__Event_template::RSLEm__Event_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } RSLEm__Event_template::RSLEm__Event_template(const RSLEm__Event_template& other_value) : Base_Template() { copy_template(other_value); } RSLEm__Event_template::~RSLEm__Event_template() { clean_up(); } RSLEm__Event_template& RSLEm__Event_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RSLEm__Event_template& RSLEm__Event_template::operator=(const RSLEm__Event& other_value) { clean_up(); copy_value(other_value); return *this; } RSLEm__Event_template& RSLEm__Event_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RSLEm__Event&)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 @RSL_Emulation.RSLEm_Event."); } return *this; } RSLEm__Event_template& RSLEm__Event_template::operator=(const RSLEm__Event_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RSLEm__Event_template::match(const RSLEm__Event& 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.ev__type().is_bound()) return FALSE; if(!single_value->field_ev__type.match(other_value.ev__type(), legacy))return FALSE; if(!other_value.sid().is_bound()) return FALSE; if(!single_value->field_sid.match(other_value.sid(), 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 @RSL_Emulation.RSLEm_Event."); } return FALSE; } boolean RSLEm__Event_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_ev__type.is_bound() || single_value->field_sid.is_bound(); } boolean RSLEm__Event_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_ev__type.is_value() && single_value->field_sid.is_value(); } void RSLEm__Event_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; } RSLEm__Event RSLEm__Event_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 @RSL_Emulation.RSLEm_Event."); RSLEm__Event ret_val; if (single_value->field_ev__type.is_bound()) { ret_val.ev__type() = single_value->field_ev__type.valueof(); } if (single_value->field_sid.is_bound()) { ret_val.sid() = single_value->field_sid.valueof(); } return ret_val; } void RSLEm__Event_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 @RSL_Emulation.RSLEm_Event."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RSLEm__Event_template[list_length]; } RSLEm__Event_template& RSLEm__Event_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 @RSL_Emulation.RSLEm_Event."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RSL_Emulation.RSLEm_Event."); return value_list.list_value[list_index]; } RSLEm__EventType_template& RSLEm__Event_template::ev__type() { set_specific(); return single_value->field_ev__type; } const RSLEm__EventType_template& RSLEm__Event_template::ev__type() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ev_type of a non-specific template of type @RSL_Emulation.RSLEm_Event."); return single_value->field_ev__type; } IPA__Types::IpaStreamId_template& RSLEm__Event_template::sid() { set_specific(); return single_value->field_sid; } const IPA__Types::IpaStreamId_template& RSLEm__Event_template::sid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sid of a non-specific template of type @RSL_Emulation.RSLEm_Event."); return single_value->field_sid; } int RSLEm__Event_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 2; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event 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 @RSL_Emulation.RSLEm_Event containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.RSLEm_Event containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Emulation.RSLEm_Event."); } return 0; } void RSLEm__Event_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ ev_type := "); single_value->field_ev__type.log(); TTCN_Logger::log_event_str(", sid := "); single_value->field_sid.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 RSLEm__Event_template::log_match(const RSLEm__Event& 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_ev__type.match(match_value.ev__type(), legacy)){ TTCN_Logger::log_logmatch_info(".ev_type"); single_value->field_ev__type.log_match(match_value.ev__type(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_sid.match(match_value.sid(), legacy)){ TTCN_Logger::log_logmatch_info(".sid"); single_value->field_sid.log_match(match_value.sid(), 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("{ ev_type := "); single_value->field_ev__type.log_match(match_value.ev__type(), legacy); TTCN_Logger::log_event_str(", sid := "); single_value->field_sid.log_match(match_value.sid(), 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 RSLEm__Event_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (ev__type().is_bound()) ev__type().set_implicit_omit(); if (sid().is_bound()) sid().set_implicit_omit(); } void RSLEm__Event_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_ev__type.encode_text(text_buf); single_value->field_sid.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 @RSL_Emulation.RSLEm_Event."); } } void RSLEm__Event_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_ev__type.decode_text(text_buf); single_value->field_sid.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 RSLEm__Event_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 @RSL_Emulation.RSLEm_Event."); } } void RSLEm__Event_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: { RSLEm__Event_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ev__type().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sid().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ev_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ev__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.RSLEm_Event: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RSLEm__Event_template* precondition = new RSLEm__Event_template; precondition->set_param(*param.get_elem(0)); RSLEm__Event_template* implied_template = new RSLEm__Event_template; implied_template->set_param(*param.get_elem(1)); *this = RSLEm__Event_template(precondition, implied_template); } break; default: param.type_error("record template", "@RSL_Emulation.RSLEm_Event"); } is_ifpresent = param.get_ifpresent(); } void RSLEm__Event_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_ev__type.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.RSLEm_Event"); single_value->field_sid.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.RSLEm_Event"); 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 : "@RSL_Emulation.RSLEm_Event"); } boolean RSLEm__Event_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RSLEm__Event_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_idxitem_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 RSL__DCHAN__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } RSL__DCHAN__PT::RSL__DCHAN__PT(const char *par_port_name) : PORT(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } RSL__DCHAN__PT::~RSL__DCHAN__PT() { clear_queue(); } void RSL__DCHAN__PT::send(const RSLDC__ChanRqd& 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(" @RSL_Emulation.RSLDC_ChanRqd : "), 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, "@RSL_Emulation.RSLDC_ChanRqd"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSL__DCHAN__PT::send(const RSLDC__ChanRqd& 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 RSL__DCHAN__PT::send(const RSLDC__ChanRqd& 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, "@RSL_Emulation.RSLDC_ChanRqd"); 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(" @RSL_Emulation.RSLDC_ChanRqd : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RSL__DCHAN__PT::send(const RSLDC__ChanRqd_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RSLDC__ChanRqd& send_par_value = RSLDC__ChanRqd(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RSL__DCHAN__PT::send(const RSLDC__ChanRqd_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RSLDC__ChanRqd& send_par_value = RSLDC__ChanRqd(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RSL__DCHAN__PT::send(const RSLDC__ChanRqd_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RSLDC__ChanRqd& send_par_value = RSLDC__ChanRqd(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void RSL__DCHAN__PT::send(const RSL__Types::RSL__Message& 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(" @RSL_Types.RSL_Message : "), 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, "@RSL_Types.RSL_Message"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSL__DCHAN__PT::send(const RSL__Types::RSL__Message& 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 RSL__DCHAN__PT::send(const RSL__Types::RSL__Message& 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, "@RSL_Types.RSL_Message"); 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(" @RSL_Types.RSL_Message : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RSL__DCHAN__PT::send(const RSL__Types::RSL__Message_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RSL__Types::RSL__Message& send_par_value = RSL__Types::RSL__Message(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RSL__DCHAN__PT::send(const RSL__Types::RSL__Message_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RSL__Types::RSL__Message& send_par_value = RSL__Types::RSL__Message(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RSL__DCHAN__PT::send(const RSL__Types::RSL__Message_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RSL__Types::RSL__Message& send_par_value = RSL__Types::RSL__Message(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), 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, "@IPA_Emulation.ASP_RSL_Unitdata"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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 RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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, "@IPA_Emulation.ASP_RSL_Unitdata"); 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RSL__DCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } alt_status RSL__DCHAN__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(": @RSL_Emulation.RSLDC_ChanRqd: "), 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(": @RSL_Types.RSL_Message: "), 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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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 RSL__DCHAN__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(": @RSL_Emulation.RSLDC_ChanRqd: "), 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(": @RSL_Types.RSL_Message: "), 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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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 RSL__DCHAN__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(": @RSL_Emulation.RSLDC_ChanRqd: "), 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(": @RSL_Types.RSL_Message: "), 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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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 RSL__DCHAN__PT::receive(const RSLDC__ChanRqd_template& value_template, RSLDC__ChanRqd *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 @RSL_Emulation.RSLDC_ChanRqd.", 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(": @RSL_Emulation.RSLDC_ChanRqd : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__DCHAN__PT::check_receive(const RSLDC__ChanRqd_template& value_template, RSLDC__ChanRqd *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 @RSL_Emulation.RSLDC_ChanRqd.", 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(": @RSL_Emulation.RSLDC_ChanRqd : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSL__DCHAN__PT::trigger(const RSLDC__ChanRqd_template& value_template, RSLDC__ChanRqd *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 @RSL_Emulation.RSLDC_ChanRqd.", 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(": @RSL_Emulation.RSLDC_ChanRqd : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__DCHAN__PT::receive(const RSL__Types::RSL__Message_template& value_template, RSL__Types::RSL__Message *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 @RSL_Types.RSL_Message.", 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(": @RSL_Types.RSL_Message : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__DCHAN__PT::check_receive(const RSL__Types::RSL__Message_template& value_template, RSL__Types::RSL__Message *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 @RSL_Types.RSL_Message.", 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(": @RSL_Types.RSL_Message : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSL__DCHAN__PT::trigger(const RSL__Types::RSL__Message_template& value_template, RSL__Types::RSL__Message *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 @RSL_Types.RSL_Message.", 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(": @RSL_Types.RSL_Message : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__DCHAN__PT::receive(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__DCHAN__PT::check_receive(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSL__DCHAN__PT::trigger(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void RSL__DCHAN__PT::incoming_message(const RSLDC__ChanRqd& 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(" @RSL_Emulation.RSLDC_ChanRqd : "), 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 RSLDC__ChanRqd(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void RSL__DCHAN__PT::incoming_message(const RSL__Types::RSL__Message& 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(" @RSL_Types.RSL_Message : "), 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 RSL__Types::RSL__Message(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void RSL__DCHAN__PT::incoming_message(const IPA__Emulation::ASP__RSL__Unitdata& 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), 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 IPA__Emulation::ASP__RSL__Unitdata(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } boolean RSL__DCHAN__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@RSL_Emulation.RSLDC_ChanRqd")) { RSLDC__ChanRqd incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@RSL_Types.RSL_Message")) { RSL__Types::RSL__Message incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@IPA_Emulation.ASP_RSL_Unitdata")) { IPA__Emulation::ASP__RSL__Unitdata incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } void RSL__CCHAN__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 RSL__CCHAN__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } RSL__CCHAN__PT::RSL__CCHAN__PT(const char *par_port_name) : PORT(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } RSL__CCHAN__PT::~RSL__CCHAN__PT() { clear_queue(); } void RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), 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, "@IPA_Emulation.ASP_RSL_Unitdata"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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 RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata& 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, "@IPA_Emulation.ASP_RSL_Unitdata"); 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RSL__CCHAN__PT::send(const IPA__Emulation::ASP__RSL__Unitdata_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const IPA__Emulation::ASP__RSL__Unitdata& send_par_value = IPA__Emulation::ASP__RSL__Unitdata(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void RSL__CCHAN__PT::send(const RSLEm__Event& 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(" @RSL_Emulation.RSLEm_Event : "), 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, "@RSL_Emulation.RSLEm_Event"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSL__CCHAN__PT::send(const RSLEm__Event& 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 RSL__CCHAN__PT::send(const RSLEm__Event& 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, "@RSL_Emulation.RSLEm_Event"); 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(" @RSL_Emulation.RSLEm_Event : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RSL__CCHAN__PT::send(const RSLEm__Event_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RSLEm__Event& send_par_value = RSLEm__Event(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RSL__CCHAN__PT::send(const RSLEm__Event_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RSLEm__Event& send_par_value = RSLEm__Event(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RSL__CCHAN__PT::send(const RSLEm__Event_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RSLEm__Event& send_par_value = RSLEm__Event(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } alt_status RSL__CCHAN__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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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(": @RSL_Emulation.RSLEm_Event: "), 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 RSL__CCHAN__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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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(": @RSL_Emulation.RSLEm_Event: "), 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 RSL__CCHAN__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(": @IPA_Emulation.ASP_RSL_Unitdata: "), 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(": @RSL_Emulation.RSLEm_Event: "), 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 RSL__CCHAN__PT::receive(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__CCHAN__PT::check_receive(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSL__CCHAN__PT::trigger(const IPA__Emulation::ASP__RSL__Unitdata_template& value_template, IPA__Emulation::ASP__RSL__Unitdata *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 @IPA_Emulation.ASP_RSL_Unitdata.", 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(": @IPA_Emulation.ASP_RSL_Unitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__CCHAN__PT::receive(const RSLEm__Event_template& value_template, RSLEm__Event *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 @RSL_Emulation.RSLEm_Event.", 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(": @RSL_Emulation.RSLEm_Event : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RSL__CCHAN__PT::check_receive(const RSLEm__Event_template& value_template, RSLEm__Event *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 @RSL_Emulation.RSLEm_Event.", 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(": @RSL_Emulation.RSLEm_Event : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSL__CCHAN__PT::trigger(const RSLEm__Event_template& value_template, RSLEm__Event *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 @RSL_Emulation.RSLEm_Event.", 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(": @RSL_Emulation.RSLEm_Event : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void RSL__CCHAN__PT::incoming_message(const IPA__Emulation::ASP__RSL__Unitdata& 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(" @IPA_Emulation.ASP_RSL_Unitdata : "), 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 IPA__Emulation::ASP__RSL__Unitdata(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void RSL__CCHAN__PT::incoming_message(const RSLEm__Event& 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(" @RSL_Emulation.RSLEm_Event : "), 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 RSLEm__Event(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } boolean RSL__CCHAN__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@IPA_Emulation.ASP_RSL_Unitdata")) { IPA__Emulation::ASP__RSL__Unitdata incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@RSL_Emulation.RSLEm_Event")) { RSLEm__Event incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } void RSLEM__register_call::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); param_hdlr.encode_text(text_buf); } void RSLEM__register_call::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); param_hdlr.decode_text(text_buf); } void RSLEM__register_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_register : { "); TTCN_Logger::log_event_str("trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__register_call_redirect::set_parameters(const RSLEM__register_call& call_par) const { if (ptr_trx__nr != NULL) *ptr_trx__nr = call_par.trx__nr(); if (ptr_chan__nr != NULL) *ptr_chan__nr = call_par.chan__nr(); if (ptr_hdlr != NULL) *ptr_hdlr = call_par.hdlr(); } void RSLEM__register_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_register : { }"); } RSLEM__register_template::RSLEM__register_template() : param_trx__nr(ANY_VALUE), param_chan__nr(ANY_VALUE), param_hdlr(ANY_VALUE) { } RSLEM__register_call RSLEM__register_template::create_call() const { RSLEM__register_call ret_val; ret_val.trx__nr() = param_trx__nr.valueof(); ret_val.chan__nr() = param_chan__nr.valueof(); ret_val.hdlr() = param_hdlr.valueof(); return ret_val; } boolean RSLEM__register_template::match_call(const RSLEM__register_call& match_value, boolean legacy) const { return param_trx__nr.match(match_value.trx__nr(), legacy) && param_chan__nr.match(match_value.chan__nr(), legacy) && param_hdlr.match(match_value.hdlr(), legacy); } void RSLEM__register_template::log() const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__register_template::log_match_call(const RSLEM__register_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log_match(match_value.trx__nr(), legacy); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log_match(match_value.chan__nr(), legacy); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log_match(match_value.hdlr(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__register_template::log_match_reply(const RSLEM__register_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RSLEM__register_template::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); param_hdlr.encode_text(text_buf); } void RSLEM__register_template::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); param_hdlr.decode_text(text_buf); } void RSLEM__unregister_call::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); param_hdlr.encode_text(text_buf); } void RSLEM__unregister_call::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); param_hdlr.decode_text(text_buf); } void RSLEM__unregister_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_unregister : { "); TTCN_Logger::log_event_str("trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__unregister_call_redirect::set_parameters(const RSLEM__unregister_call& call_par) const { if (ptr_trx__nr != NULL) *ptr_trx__nr = call_par.trx__nr(); if (ptr_chan__nr != NULL) *ptr_chan__nr = call_par.chan__nr(); if (ptr_hdlr != NULL) *ptr_hdlr = call_par.hdlr(); } void RSLEM__unregister_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_unregister : { }"); } RSLEM__unregister_template::RSLEM__unregister_template() : param_trx__nr(ANY_VALUE), param_chan__nr(ANY_VALUE), param_hdlr(ANY_VALUE) { } RSLEM__unregister_call RSLEM__unregister_template::create_call() const { RSLEM__unregister_call ret_val; ret_val.trx__nr() = param_trx__nr.valueof(); ret_val.chan__nr() = param_chan__nr.valueof(); ret_val.hdlr() = param_hdlr.valueof(); return ret_val; } boolean RSLEM__unregister_template::match_call(const RSLEM__unregister_call& match_value, boolean legacy) const { return param_trx__nr.match(match_value.trx__nr(), legacy) && param_chan__nr.match(match_value.chan__nr(), legacy) && param_hdlr.match(match_value.hdlr(), legacy); } void RSLEM__unregister_template::log() const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__unregister_template::log_match_call(const RSLEM__unregister_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log_match(match_value.trx__nr(), legacy); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log_match(match_value.chan__nr(), legacy); TTCN_Logger::log_event_str(", hdlr := "); param_hdlr.log_match(match_value.hdlr(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__unregister_template::log_match_reply(const RSLEM__unregister_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RSLEM__unregister_template::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); param_hdlr.encode_text(text_buf); } void RSLEM__unregister_template::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); param_hdlr.decode_text(text_buf); } void RSLEM__suspend_call::encode_text(Text_Buf& text_buf) const { param_suspend.encode_text(text_buf); } void RSLEM__suspend_call::decode_text(Text_Buf& text_buf) { param_suspend.decode_text(text_buf); } void RSLEM__suspend_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_suspend : { "); TTCN_Logger::log_event_str("suspend := "); param_suspend.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__suspend_call_redirect::set_parameters(const RSLEM__suspend_call& call_par) const { if (ptr_suspend != NULL) *ptr_suspend = call_par.suspend(); } void RSLEM__suspend_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_suspend : { }"); } RSLEM__suspend_template::RSLEM__suspend_template() : param_suspend(ANY_VALUE) { } RSLEM__suspend_call RSLEM__suspend_template::create_call() const { RSLEM__suspend_call ret_val; ret_val.suspend() = param_suspend.valueof(); return ret_val; } boolean RSLEM__suspend_template::match_call(const RSLEM__suspend_call& match_value, boolean legacy) const { return param_suspend.match(match_value.suspend(), legacy); } void RSLEM__suspend_template::log() const { TTCN_Logger::log_event_str("{ suspend := "); param_suspend.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__suspend_template::log_match_call(const RSLEM__suspend_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ suspend := "); param_suspend.log_match(match_value.suspend(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__suspend_template::log_match_reply(const RSLEM__suspend_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RSLEM__suspend_template::encode_text(Text_Buf& text_buf) const { param_suspend.encode_text(text_buf); } void RSLEM__suspend_template::decode_text(Text_Buf& text_buf) { param_suspend.decode_text(text_buf); } void RSLEM__wait__queue_call::encode_text(Text_Buf& text_buf) const { param_enable.encode_text(text_buf); } void RSLEM__wait__queue_call::decode_text(Text_Buf& text_buf) { param_enable.decode_text(text_buf); } void RSLEM__wait__queue_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_wait_queue : { "); TTCN_Logger::log_event_str("enable := "); param_enable.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__wait__queue_call_redirect::set_parameters(const RSLEM__wait__queue_call& call_par) const { if (ptr_enable != NULL) *ptr_enable = call_par.enable(); } void RSLEM__wait__queue_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_wait_queue : { }"); } RSLEM__wait__queue_template::RSLEM__wait__queue_template() : param_enable(ANY_VALUE) { } RSLEM__wait__queue_call RSLEM__wait__queue_template::create_call() const { RSLEM__wait__queue_call ret_val; ret_val.enable() = param_enable.valueof(); return ret_val; } boolean RSLEM__wait__queue_template::match_call(const RSLEM__wait__queue_call& match_value, boolean legacy) const { return param_enable.match(match_value.enable(), legacy); } void RSLEM__wait__queue_template::log() const { TTCN_Logger::log_event_str("{ enable := "); param_enable.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__wait__queue_template::log_match_call(const RSLEM__wait__queue_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ enable := "); param_enable.log_match(match_value.enable(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__wait__queue_template::log_match_reply(const RSLEM__wait__queue_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RSLEM__wait__queue_template::encode_text(Text_Buf& text_buf) const { param_enable.encode_text(text_buf); } void RSLEM__wait__queue_template::decode_text(Text_Buf& text_buf) { param_enable.decode_text(text_buf); } void RSLEM__get__last__act_call::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); } void RSLEM__get__last__act_call::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); } void RSLEM__get__last__act_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_get_last_act : { "); TTCN_Logger::log_event_str("trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__get__last__act_call_redirect::set_parameters(const RSLEM__get__last__act_call& call_par) const { if (ptr_trx__nr != NULL) *ptr_trx__nr = call_par.trx__nr(); if (ptr_chan__nr != NULL) *ptr_chan__nr = call_par.chan__nr(); } void RSLEM__get__last__act_reply::encode_text(Text_Buf& text_buf) const { param_chan__act.encode_text(text_buf); } void RSLEM__get__last__act_reply::decode_text(Text_Buf& text_buf) { param_chan__act.decode_text(text_buf); } void RSLEM__get__last__act_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_get_last_act : { "); TTCN_Logger::log_event_str("chan_act := "); param_chan__act.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__get__last__act_reply_redirect::set_parameters(const RSLEM__get__last__act_reply& reply_par) const { if (ptr_chan__act != NULL) *ptr_chan__act = reply_par.chan__act(); } RSLEM__get__last__act_template::RSLEM__get__last__act_template() : param_trx__nr(ANY_VALUE), param_chan__nr(ANY_VALUE), param_chan__act(ANY_VALUE) { } RSLEM__get__last__act_call RSLEM__get__last__act_template::create_call() const { RSLEM__get__last__act_call ret_val; ret_val.trx__nr() = param_trx__nr.valueof(); ret_val.chan__nr() = param_chan__nr.valueof(); return ret_val; } RSLEM__get__last__act_reply RSLEM__get__last__act_template::create_reply() const { RSLEM__get__last__act_reply ret_val; ret_val.chan__act() = param_chan__act.valueof(); return ret_val; } boolean RSLEM__get__last__act_template::match_call(const RSLEM__get__last__act_call& match_value, boolean legacy) const { return param_trx__nr.match(match_value.trx__nr(), legacy) && param_chan__nr.match(match_value.chan__nr(), legacy); } boolean RSLEM__get__last__act_template::match_reply(const RSLEM__get__last__act_reply& match_value, boolean legacy) const { return param_chan__act.match(match_value.chan__act(), legacy); } void RSLEM__get__last__act_template::log() const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log(); TTCN_Logger::log_event_str(", chan_act := "); param_chan__act.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__get__last__act_template::log_match_call(const RSLEM__get__last__act_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ trx_nr := "); param_trx__nr.log_match(match_value.trx__nr(), legacy); TTCN_Logger::log_event_str(", chan_nr := "); param_chan__nr.log_match(match_value.chan__nr(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__get__last__act_template::log_match_reply(const RSLEM__get__last__act_reply& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ chan_act := "); param_chan__act.log_match(match_value.chan__act(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__get__last__act_template::encode_text(Text_Buf& text_buf) const { param_trx__nr.encode_text(text_buf); param_chan__nr.encode_text(text_buf); param_chan__act.encode_text(text_buf); } void RSLEM__get__last__act_template::decode_text(Text_Buf& text_buf) { param_trx__nr.decode_text(text_buf); param_chan__nr.decode_text(text_buf); param_chan__act.decode_text(text_buf); } void RSLEM__set__auto__chan__act__ack_call::encode_text(Text_Buf& text_buf) const { param_enable.encode_text(text_buf); } void RSLEM__set__auto__chan__act__ack_call::decode_text(Text_Buf& text_buf) { param_enable.decode_text(text_buf); } void RSLEM__set__auto__chan__act__ack_call::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_set_auto_chan_act_ack : { "); TTCN_Logger::log_event_str("enable := "); param_enable.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__set__auto__chan__act__ack_call_redirect::set_parameters(const RSLEM__set__auto__chan__act__ack_call& call_par) const { if (ptr_enable != NULL) *ptr_enable = call_par.enable(); } void RSLEM__set__auto__chan__act__ack_reply::log() const { TTCN_Logger::log_event_str("@RSL_Emulation.RSLEM_set_auto_chan_act_ack : { }"); } RSLEM__set__auto__chan__act__ack_template::RSLEM__set__auto__chan__act__ack_template() : param_enable(ANY_VALUE) { } RSLEM__set__auto__chan__act__ack_call RSLEM__set__auto__chan__act__ack_template::create_call() const { RSLEM__set__auto__chan__act__ack_call ret_val; ret_val.enable() = param_enable.valueof(); return ret_val; } boolean RSLEM__set__auto__chan__act__ack_template::match_call(const RSLEM__set__auto__chan__act__ack_call& match_value, boolean legacy) const { return param_enable.match(match_value.enable(), legacy); } void RSLEM__set__auto__chan__act__ack_template::log() const { TTCN_Logger::log_event_str("{ enable := "); param_enable.log(); TTCN_Logger::log_event_str(" }"); } void RSLEM__set__auto__chan__act__ack_template::log_match_call(const RSLEM__set__auto__chan__act__ack_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ enable := "); param_enable.log_match(match_value.enable(), legacy); TTCN_Logger::log_event_str(" }"); } void RSLEM__set__auto__chan__act__ack_template::log_match_reply(const RSLEM__set__auto__chan__act__ack_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RSLEM__set__auto__chan__act__ack_template::encode_text(Text_Buf& text_buf) const { param_enable.encode_text(text_buf); } void RSLEM__set__auto__chan__act__ack_template::decode_text(Text_Buf& text_buf) { param_enable.decode_text(text_buf); } void RSLEM__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 RSLEM__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 CALL_3: delete proc_queue_head->call_3; break; case CALL_4: delete proc_queue_head->call_4; break; case CALL_5: delete proc_queue_head->call_5; 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; case REPLY_3: delete proc_queue_head->reply_3; break; case REPLY_4: delete proc_queue_head->reply_4; break; case REPLY_5: delete proc_queue_head->reply_5; 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 RSLEM__PROC__PT::clear_queue() { while (proc_queue_head != NULL) remove_proc_queue_head(); } RSLEM__PROC__PT::RSLEM__PROC__PT(const char *par_port_name) : PORT(par_port_name) { proc_queue_head = NULL; proc_queue_tail = NULL; } RSLEM__PROC__PT::~RSLEM__PROC__PT() { clear_queue(); } void RSLEM__PROC__PT::call(const RSLEM__register_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 RSLEM__register_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, "@RSL_Emulation.RSLEM_register"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__register_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 RSLEM__PROC__PT::call(const RSLEM__register_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, "@RSL_Emulation.RSLEM_register"); const RSLEM__register_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 RSLEM__PROC__PT::call(const RSLEM__unregister_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 RSLEM__unregister_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, "@RSL_Emulation.RSLEM_unregister"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__unregister_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 RSLEM__PROC__PT::call(const RSLEM__unregister_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, "@RSL_Emulation.RSLEM_unregister"); const RSLEM__unregister_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 RSLEM__PROC__PT::call(const RSLEM__suspend_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 RSLEM__suspend_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, "@RSL_Emulation.RSLEM_suspend"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__suspend_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 RSLEM__PROC__PT::call(const RSLEM__suspend_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, "@RSL_Emulation.RSLEM_suspend"); const RSLEM__suspend_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 RSLEM__PROC__PT::call(const RSLEM__wait__queue_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 RSLEM__wait__queue_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, "@RSL_Emulation.RSLEM_wait_queue"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__wait__queue_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 RSLEM__PROC__PT::call(const RSLEM__wait__queue_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, "@RSL_Emulation.RSLEM_wait_queue"); const RSLEM__wait__queue_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 RSLEM__PROC__PT::call(const RSLEM__get__last__act_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 RSLEM__get__last__act_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, "@RSL_Emulation.RSLEM_get_last_act"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__get__last__act_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 RSLEM__PROC__PT::call(const RSLEM__get__last__act_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, "@RSL_Emulation.RSLEM_get_last_act"); const RSLEM__get__last__act_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 RSLEM__PROC__PT::call(const RSLEM__set__auto__chan__act__ack_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 RSLEM__set__auto__chan__act__ack_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, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::call(const RSLEM__set__auto__chan__act__ack_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 RSLEM__PROC__PT::call(const RSLEM__set__auto__chan__act__ack_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, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack"); const RSLEM__set__auto__chan__act__ack_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 RSLEM__PROC__PT::reply(const RSLEM__register_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 RSLEM__register_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, "@RSL_Emulation.RSLEM_register"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__register_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 RSLEM__PROC__PT::reply(const RSLEM__register_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, "@RSL_Emulation.RSLEM_register"); const RSLEM__register_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 RSLEM__PROC__PT::reply(const RSLEM__unregister_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 RSLEM__unregister_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, "@RSL_Emulation.RSLEM_unregister"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__unregister_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 RSLEM__PROC__PT::reply(const RSLEM__unregister_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, "@RSL_Emulation.RSLEM_unregister"); const RSLEM__unregister_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 RSLEM__PROC__PT::reply(const RSLEM__suspend_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 RSLEM__suspend_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, "@RSL_Emulation.RSLEM_suspend"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__suspend_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 RSLEM__PROC__PT::reply(const RSLEM__suspend_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, "@RSL_Emulation.RSLEM_suspend"); const RSLEM__suspend_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 RSLEM__PROC__PT::reply(const RSLEM__wait__queue_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 RSLEM__wait__queue_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, "@RSL_Emulation.RSLEM_wait_queue"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__wait__queue_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 RSLEM__PROC__PT::reply(const RSLEM__wait__queue_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, "@RSL_Emulation.RSLEM_wait_queue"); const RSLEM__wait__queue_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 RSLEM__PROC__PT::reply(const RSLEM__get__last__act_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 RSLEM__get__last__act_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, "@RSL_Emulation.RSLEM_get_last_act"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__get__last__act_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 RSLEM__PROC__PT::reply(const RSLEM__get__last__act_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, "@RSL_Emulation.RSLEM_get_last_act"); const RSLEM__get__last__act_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 RSLEM__PROC__PT::reply(const RSLEM__set__auto__chan__act__ack_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 RSLEM__set__auto__chan__act__ack_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, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RSLEM__PROC__PT::reply(const RSLEM__set__auto__chan__act__ack_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 RSLEM__PROC__PT::reply(const RSLEM__set__auto__chan__act__ack_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, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack"); const RSLEM__set__auto__chan__act__ack_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 RSLEM__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: case CALL_3: case CALL_4: case CALL_5: { 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 RSLEM__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: case CALL_3: case CALL_4: case CALL_5: { 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 RSLEM__PROC__PT::getcall(const RSLEM__register_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__register_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 @RSL_Emulation.RSLEM_register.", 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 RSLEM__PROC__PT::check_getcall(const RSLEM__register_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__register_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 @RSL_Emulation.RSLEM_register.", 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 RSLEM__PROC__PT::getcall(const RSLEM__unregister_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__unregister_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 @RSL_Emulation.RSLEM_unregister.", 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 RSLEM__PROC__PT::check_getcall(const RSLEM__unregister_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__unregister_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 @RSL_Emulation.RSLEM_unregister.", 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 RSLEM__PROC__PT::getcall(const RSLEM__suspend_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__suspend_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 @RSL_Emulation.RSLEM_suspend.", 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 RSLEM__PROC__PT::check_getcall(const RSLEM__suspend_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__suspend_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 @RSL_Emulation.RSLEM_suspend.", 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 RSLEM__PROC__PT::getcall(const RSLEM__wait__queue_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__wait__queue_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_3) { 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 @RSL_Emulation.RSLEM_wait_queue.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_3); 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_3); 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_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getcall(const RSLEM__wait__queue_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__wait__queue_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_3) { 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 @RSL_Emulation.RSLEM_wait_queue.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_3); 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_3); 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_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSLEM__PROC__PT::getcall(const RSLEM__get__last__act_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__get__last__act_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_4) { 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 @RSL_Emulation.RSLEM_get_last_act.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_4)) { 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_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_4); 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_4); 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_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getcall(const RSLEM__get__last__act_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__get__last__act_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_4) { 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 @RSL_Emulation.RSLEM_get_last_act.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_4)) { 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_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_4); 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_4); 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_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSLEM__PROC__PT::getcall(const RSLEM__set__auto__chan__act__ack_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__set__auto__chan__act__ack_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_5) { 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 @RSL_Emulation.RSLEM_set_auto_chan_act_ack.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_5)) { 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_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_5); 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_5); 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_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getcall(const RSLEM__set__auto__chan__act__ack_template& getcall_template, const COMPONENT_template& sender_template, const RSLEM__set__auto__chan__act__ack_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_5) { 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 @RSL_Emulation.RSLEM_set_auto_chan_act_ack.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_5)) { 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_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_5); 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_5); 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_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSLEM__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: case REPLY_3: case REPLY_4: case REPLY_5: { 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 RSLEM__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: case REPLY_3: case REPLY_4: case REPLY_5: { 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 RSLEM__PROC__PT::getreply(const RSLEM__register_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__register_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 @RSL_Emulation.RSLEM_register.", 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 RSLEM__PROC__PT::check_getreply(const RSLEM__register_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__register_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 @RSL_Emulation.RSLEM_register.", 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 RSLEM__PROC__PT::getreply(const RSLEM__unregister_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__unregister_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 @RSL_Emulation.RSLEM_unregister.", 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 RSLEM__PROC__PT::check_getreply(const RSLEM__unregister_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__unregister_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 @RSL_Emulation.RSLEM_unregister.", 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 RSLEM__PROC__PT::getreply(const RSLEM__suspend_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__suspend_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 @RSL_Emulation.RSLEM_suspend.", 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 RSLEM__PROC__PT::check_getreply(const RSLEM__suspend_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__suspend_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 @RSL_Emulation.RSLEM_suspend.", 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; } } alt_status RSLEM__PROC__PT::getreply(const RSLEM__wait__queue_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__wait__queue_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_3) { 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 @RSL_Emulation.RSLEM_wait_queue.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_3); 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_3); 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_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getreply(const RSLEM__wait__queue_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__wait__queue_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_3) { 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 @RSL_Emulation.RSLEM_wait_queue.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_3); 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_3); 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_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSLEM__PROC__PT::getreply(const RSLEM__get__last__act_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__get__last__act_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_4) { 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 @RSL_Emulation.RSLEM_get_last_act.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) { 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_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_4); 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_4); 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_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getreply(const RSLEM__get__last__act_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__get__last__act_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_4) { 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 @RSL_Emulation.RSLEM_get_last_act.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) { 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_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_4); 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_4); 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_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RSLEM__PROC__PT::getreply(const RSLEM__set__auto__chan__act__ack_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__set__auto__chan__act__ack_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_5) { 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 @RSL_Emulation.RSLEM_set_auto_chan_act_ack.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) { 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_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_5); 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_5); 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_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RSLEM__PROC__PT::check_getreply(const RSLEM__set__auto__chan__act__ack_template& getreply_template, const COMPONENT_template& sender_template, const RSLEM__set__auto__chan__act__ack_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_5) { 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 @RSL_Emulation.RSLEM_set_auto_chan_act_ack.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) { 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_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_5); 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_5); 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_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } void RSLEM__PROC__PT::incoming_call(const RSLEM__register_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 RSLEM__register_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_call(const RSLEM__unregister_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 RSLEM__unregister_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_call(const RSLEM__suspend_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 RSLEM__suspend_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_call(const RSLEM__wait__queue_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_3; new_item->call_3 = new RSLEM__wait__queue_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_call(const RSLEM__get__last__act_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_4; new_item->call_4 = new RSLEM__get__last__act_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_call(const RSLEM__set__auto__chan__act__ack_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_5; new_item->call_5 = new RSLEM__set__auto__chan__act__ack_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__register_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 RSLEM__register_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__unregister_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 RSLEM__unregister_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__suspend_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 RSLEM__suspend_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__wait__queue_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_3; new_item->reply_3 = new RSLEM__wait__queue_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__get__last__act_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_4; new_item->reply_4 = new RSLEM__get__last__act_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RSLEM__PROC__PT::incoming_reply(const RSLEM__set__auto__chan__act__ack_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_5; new_item->reply_5 = new RSLEM__set__auto__chan__act__ack_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } boolean RSLEM__PROC__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component) { if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_register")) { RSLEM__register_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_unregister")) { RSLEM__unregister_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_suspend")) { RSLEM__suspend_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_wait_queue")) { RSLEM__wait__queue_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_get_last_act")) { RSLEM__get__last__act_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack")) { RSLEM__set__auto__chan__act__ack_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else return FALSE; } boolean RSLEM__PROC__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component) { if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_register")) { RSLEM__register_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_unregister")) { RSLEM__unregister_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_suspend")) { RSLEM__suspend_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_wait_queue")) { RSLEM__wait__queue_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_get_last_act")) { RSLEM__get__last__act_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RSL_Emulation.RSLEM_set_auto_chan_act_ack")) { RSLEM__set__auto__chan__act__ack_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else return FALSE; } ConnectionData::ConnectionData() { } ConnectionData::ConnectionData(const COMPONENT& par_comp__ref, const OPTIONAL< INTEGER >& par_trx__nr, const OPTIONAL< IPA__Types::IpaStreamId >& par_stream__id, const OPTIONAL< GSM__Types::RslChannelNr >& par_chan__nr, const OPTIONAL< OCTETSTRING >& par_ra, const OPTIONAL< INTEGER >& par_ra__fn) : field_comp__ref(par_comp__ref), field_trx__nr(par_trx__nr), field_stream__id(par_stream__id), field_chan__nr(par_chan__nr), field_ra(par_ra), field_ra__fn(par_ra__fn) { } ConnectionData::ConnectionData(const ConnectionData& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Emulation.ConnectionData."); if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref(); else field_comp__ref.clean_up(); if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr(); else field_trx__nr.clean_up(); if (other_value.stream__id().is_bound()) field_stream__id = other_value.stream__id(); else field_stream__id.clean_up(); if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr(); else field_chan__nr.clean_up(); if (other_value.ra().is_bound()) field_ra = other_value.ra(); else field_ra.clean_up(); if (other_value.ra__fn().is_bound()) field_ra__fn = other_value.ra__fn(); else field_ra__fn.clean_up(); } void ConnectionData::clean_up() { field_comp__ref.clean_up(); field_trx__nr.clean_up(); field_stream__id.clean_up(); field_chan__nr.clean_up(); field_ra.clean_up(); field_ra__fn.clean_up(); } const TTCN_Typedescriptor_t* ConnectionData::get_descriptor() const { return &ConnectionData_descr_; } ConnectionData& ConnectionData::operator=(const ConnectionData& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Emulation.ConnectionData."); if (other_value.comp__ref().is_bound()) field_comp__ref = other_value.comp__ref(); else field_comp__ref.clean_up(); if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr(); else field_trx__nr.clean_up(); if (other_value.stream__id().is_bound()) field_stream__id = other_value.stream__id(); else field_stream__id.clean_up(); if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr(); else field_chan__nr.clean_up(); if (other_value.ra().is_bound()) field_ra = other_value.ra(); else field_ra.clean_up(); if (other_value.ra__fn().is_bound()) field_ra__fn = other_value.ra__fn(); else field_ra__fn.clean_up(); } return *this; } boolean ConnectionData::operator==(const ConnectionData& other_value) const { return field_comp__ref==other_value.field_comp__ref && field_trx__nr==other_value.field_trx__nr && field_stream__id==other_value.field_stream__id && field_chan__nr==other_value.field_chan__nr && field_ra==other_value.field_ra && field_ra__fn==other_value.field_ra__fn; } boolean ConnectionData::is_bound() const { return (field_comp__ref.is_bound()) || (OPTIONAL_OMIT == field_trx__nr.get_selection() || field_trx__nr.is_bound()) || (OPTIONAL_OMIT == field_stream__id.get_selection() || field_stream__id.is_bound()) || (OPTIONAL_OMIT == field_chan__nr.get_selection() || field_chan__nr.is_bound()) || (OPTIONAL_OMIT == field_ra.get_selection() || field_ra.is_bound()) || (OPTIONAL_OMIT == field_ra__fn.get_selection() || field_ra__fn.is_bound()); } boolean ConnectionData::is_value() const { return field_comp__ref.is_value() && (OPTIONAL_OMIT == field_trx__nr.get_selection() || field_trx__nr.is_value()) && (OPTIONAL_OMIT == field_stream__id.get_selection() || field_stream__id.is_value()) && (OPTIONAL_OMIT == field_chan__nr.get_selection() || field_chan__nr.is_value()) && (OPTIONAL_OMIT == field_ra.get_selection() || field_ra.is_value()) && (OPTIONAL_OMIT == field_ra__fn.get_selection() || field_ra__fn.is_value()); } int ConnectionData::size_of() const { int ret_val = 1; if (field_trx__nr.ispresent()) ret_val++; if (field_stream__id.ispresent()) ret_val++; if (field_chan__nr.ispresent()) ret_val++; if (field_ra.ispresent()) ret_val++; if (field_ra__fn.ispresent()) ret_val++; return ret_val; } void ConnectionData::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ comp_ref := "); field_comp__ref.log(); TTCN_Logger::log_event_str(", trx_nr := "); field_trx__nr.log(); TTCN_Logger::log_event_str(", stream_id := "); field_stream__id.log(); TTCN_Logger::log_event_str(", chan_nr := "); field_chan__nr.log(); TTCN_Logger::log_event_str(", ra := "); field_ra.log(); TTCN_Logger::log_event_str(", ra_fn := "); field_ra__fn.log(); TTCN_Logger::log_event_str(" }"); } void ConnectionData::set_implicit_omit() { if (comp__ref().is_bound()) comp__ref().set_implicit_omit(); if (!trx__nr().is_bound()) trx__nr() = OMIT_VALUE; else trx__nr().set_implicit_omit(); if (!stream__id().is_bound()) stream__id() = OMIT_VALUE; else stream__id().set_implicit_omit(); if (!chan__nr().is_bound()) chan__nr() = OMIT_VALUE; else chan__nr().set_implicit_omit(); if (!ra().is_bound()) ra() = OMIT_VALUE; else ra().set_implicit_omit(); if (!ra__fn().is_bound()) ra__fn() = OMIT_VALUE; else ra__fn().set_implicit_omit(); } void ConnectionData::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 (60 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) comp__ref().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) stream__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ra().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ra__fn().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_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_idxget_id()->get_name(), "trx_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { trx__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "stream_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { stream__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra_fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra__fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.ConnectionData: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RSL_Emulation.ConnectionData"); } } void ConnectionData::encode_text(Text_Buf& text_buf) const { field_comp__ref.encode_text(text_buf); field_trx__nr.encode_text(text_buf); field_stream__id.encode_text(text_buf); field_chan__nr.encode_text(text_buf); field_ra.encode_text(text_buf); field_ra__fn.encode_text(text_buf); } void ConnectionData::decode_text(Text_Buf& text_buf) { field_comp__ref.decode_text(text_buf); field_trx__nr.decode_text(text_buf); field_stream__id.decode_text(text_buf); field_chan__nr.decode_text(text_buf); field_ra.decode_text(text_buf); field_ra__fn.decode_text(text_buf); } struct ConnectionData_template::single_value_struct { COMPONENT_template field_comp__ref; INTEGER_template field_trx__nr; IPA__Types::IpaStreamId_template field_stream__id; GSM__Types::RslChannelNr_template field_chan__nr; OCTETSTRING_template field_ra; INTEGER_template field_ra__fn; }; void ConnectionData_template::set_specific() { if (template_selection != SPECIFIC_VALUE) { template_sel old_selection = template_selection; clean_up(); single_value = new single_value_struct; set_selection(SPECIFIC_VALUE); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { single_value->field_comp__ref = ANY_VALUE; single_value->field_trx__nr = ANY_OR_OMIT; single_value->field_stream__id = ANY_OR_OMIT; single_value->field_chan__nr = ANY_OR_OMIT; single_value->field_ra = ANY_OR_OMIT; single_value->field_ra__fn = ANY_OR_OMIT; } } } void ConnectionData_template::copy_value(const ConnectionData& other_value) { single_value = new single_value_struct; if (other_value.comp__ref().is_bound()) { single_value->field_comp__ref = other_value.comp__ref(); } else { single_value->field_comp__ref.clean_up(); } if (other_value.trx__nr().is_bound()) { if (other_value.trx__nr().ispresent()) single_value->field_trx__nr = other_value.trx__nr()(); else single_value->field_trx__nr = OMIT_VALUE; } else { single_value->field_trx__nr.clean_up(); } if (other_value.stream__id().is_bound()) { if (other_value.stream__id().ispresent()) single_value->field_stream__id = other_value.stream__id()(); else single_value->field_stream__id = OMIT_VALUE; } else { single_value->field_stream__id.clean_up(); } if (other_value.chan__nr().is_bound()) { if (other_value.chan__nr().ispresent()) single_value->field_chan__nr = other_value.chan__nr()(); else single_value->field_chan__nr = OMIT_VALUE; } else { single_value->field_chan__nr.clean_up(); } if (other_value.ra().is_bound()) { if (other_value.ra().ispresent()) single_value->field_ra = other_value.ra()(); else single_value->field_ra = OMIT_VALUE; } else { single_value->field_ra.clean_up(); } if (other_value.ra__fn().is_bound()) { if (other_value.ra__fn().ispresent()) single_value->field_ra__fn = other_value.ra__fn()(); else single_value->field_ra__fn = OMIT_VALUE; } else { single_value->field_ra__fn.clean_up(); } set_selection(SPECIFIC_VALUE); } void ConnectionData_template::copy_template(const ConnectionData_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.comp__ref().get_selection()) { single_value->field_comp__ref = other_value.comp__ref(); } else { single_value->field_comp__ref.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.trx__nr().get_selection()) { single_value->field_trx__nr = other_value.trx__nr(); } else { single_value->field_trx__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.stream__id().get_selection()) { single_value->field_stream__id = other_value.stream__id(); } else { single_value->field_stream__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) { single_value->field_chan__nr = other_value.chan__nr(); } else { single_value->field_chan__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ra().get_selection()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ra__fn().get_selection()) { single_value->field_ra__fn = other_value.ra__fn(); } else { single_value->field_ra__fn.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 ConnectionData_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 ConnectionData_template(*other_value.implication_.precondition); implication_.implied_template = new ConnectionData_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 @RSL_Emulation.ConnectionData."); break; } set_selection(other_value); } ConnectionData_template::ConnectionData_template() { } ConnectionData_template::ConnectionData_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } ConnectionData_template::ConnectionData_template(const ConnectionData& other_value) { copy_value(other_value); } ConnectionData_template::ConnectionData_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConnectionData&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RSL_Emulation.ConnectionData from an unbound optional field."); } } ConnectionData_template::ConnectionData_template(ConnectionData_template* p_precondition, ConnectionData_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ConnectionData_template::ConnectionData_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } ConnectionData_template::ConnectionData_template(const ConnectionData_template& other_value) : Base_Template() { copy_template(other_value); } ConnectionData_template::~ConnectionData_template() { clean_up(); } ConnectionData_template& ConnectionData_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ConnectionData_template& ConnectionData_template::operator=(const ConnectionData& other_value) { clean_up(); copy_value(other_value); return *this; } ConnectionData_template& ConnectionData_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConnectionData&)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 @RSL_Emulation.ConnectionData."); } return *this; } ConnectionData_template& ConnectionData_template::operator=(const ConnectionData_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean ConnectionData_template::match(const ConnectionData& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; switch (template_selection) { case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case OMIT_VALUE: return FALSE; case SPECIFIC_VALUE: if(!other_value.comp__ref().is_bound()) return FALSE; if(!single_value->field_comp__ref.match(other_value.comp__ref(), legacy))return FALSE; if(!other_value.trx__nr().is_bound()) return FALSE; if((other_value.trx__nr().ispresent() ? !single_value->field_trx__nr.match((const INTEGER&)other_value.trx__nr(), legacy) : !single_value->field_trx__nr.match_omit(legacy)))return FALSE; if(!other_value.stream__id().is_bound()) return FALSE; if((other_value.stream__id().ispresent() ? !single_value->field_stream__id.match((const IPA__Types::IpaStreamId&)other_value.stream__id(), legacy) : !single_value->field_stream__id.match_omit(legacy)))return FALSE; if(!other_value.chan__nr().is_bound()) return FALSE; if((other_value.chan__nr().ispresent() ? !single_value->field_chan__nr.match((const GSM__Types::RslChannelNr&)other_value.chan__nr(), legacy) : !single_value->field_chan__nr.match_omit(legacy)))return FALSE; if(!other_value.ra().is_bound()) return FALSE; if((other_value.ra().ispresent() ? !single_value->field_ra.match((const OCTETSTRING&)other_value.ra(), legacy) : !single_value->field_ra.match_omit(legacy)))return FALSE; if(!other_value.ra__fn().is_bound()) return FALSE; if((other_value.ra__fn().ispresent() ? !single_value->field_ra__fn.match((const INTEGER&)other_value.ra__fn(), legacy) : !single_value->field_ra__fn.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 @RSL_Emulation.ConnectionData."); } return FALSE; } boolean ConnectionData_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_comp__ref.is_bound() || (single_value->field_trx__nr.is_omit() || single_value->field_trx__nr.is_bound()) || (single_value->field_stream__id.is_omit() || single_value->field_stream__id.is_bound()) || (single_value->field_chan__nr.is_omit() || single_value->field_chan__nr.is_bound()) || (single_value->field_ra.is_omit() || single_value->field_ra.is_bound()) || (single_value->field_ra__fn.is_omit() || single_value->field_ra__fn.is_bound()); } boolean ConnectionData_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_comp__ref.is_value() && (single_value->field_trx__nr.is_omit() || single_value->field_trx__nr.is_value()) && (single_value->field_stream__id.is_omit() || single_value->field_stream__id.is_value()) && (single_value->field_chan__nr.is_omit() || single_value->field_chan__nr.is_value()) && (single_value->field_ra.is_omit() || single_value->field_ra.is_value()) && (single_value->field_ra__fn.is_omit() || single_value->field_ra__fn.is_value()); } void ConnectionData_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; } ConnectionData ConnectionData_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 @RSL_Emulation.ConnectionData."); ConnectionData ret_val; if (single_value->field_comp__ref.is_bound()) { ret_val.comp__ref() = single_value->field_comp__ref.valueof(); } if (single_value->field_trx__nr.is_omit()) ret_val.trx__nr() = OMIT_VALUE; else if (single_value->field_trx__nr.is_bound()) { ret_val.trx__nr() = single_value->field_trx__nr.valueof(); } if (single_value->field_stream__id.is_omit()) ret_val.stream__id() = OMIT_VALUE; else if (single_value->field_stream__id.is_bound()) { ret_val.stream__id() = single_value->field_stream__id.valueof(); } if (single_value->field_chan__nr.is_omit()) ret_val.chan__nr() = OMIT_VALUE; else if (single_value->field_chan__nr.is_bound()) { ret_val.chan__nr() = single_value->field_chan__nr.valueof(); } if (single_value->field_ra.is_omit()) ret_val.ra() = OMIT_VALUE; else if (single_value->field_ra.is_bound()) { ret_val.ra() = single_value->field_ra.valueof(); } if (single_value->field_ra__fn.is_omit()) ret_val.ra__fn() = OMIT_VALUE; else if (single_value->field_ra__fn.is_bound()) { ret_val.ra__fn() = single_value->field_ra__fn.valueof(); } return ret_val; } void ConnectionData_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 @RSL_Emulation.ConnectionData."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new ConnectionData_template[list_length]; } ConnectionData_template& ConnectionData_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 @RSL_Emulation.ConnectionData."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RSL_Emulation.ConnectionData."); return value_list.list_value[list_index]; } COMPONENT_template& ConnectionData_template::comp__ref() { set_specific(); return single_value->field_comp__ref; } const COMPONENT_template& ConnectionData_template::comp__ref() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field comp_ref of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_comp__ref; } INTEGER_template& ConnectionData_template::trx__nr() { set_specific(); return single_value->field_trx__nr; } const INTEGER_template& ConnectionData_template::trx__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field trx_nr of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_trx__nr; } IPA__Types::IpaStreamId_template& ConnectionData_template::stream__id() { set_specific(); return single_value->field_stream__id; } const IPA__Types::IpaStreamId_template& ConnectionData_template::stream__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field stream_id of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_stream__id; } GSM__Types::RslChannelNr_template& ConnectionData_template::chan__nr() { set_specific(); return single_value->field_chan__nr; } const GSM__Types::RslChannelNr_template& ConnectionData_template::chan__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field chan_nr of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_chan__nr; } OCTETSTRING_template& ConnectionData_template::ra() { set_specific(); return single_value->field_ra; } const OCTETSTRING_template& ConnectionData_template::ra() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ra of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_ra; } INTEGER_template& ConnectionData_template::ra__fn() { set_specific(); return single_value->field_ra__fn; } const INTEGER_template& ConnectionData_template::ra__fn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ra_fn of a non-specific template of type @RSL_Emulation.ConnectionData."); return single_value->field_ra__fn; } int ConnectionData_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_trx__nr.is_present()) ret_val++; if (single_value->field_stream__id.is_present()) ret_val++; if (single_value->field_chan__nr.is_present()) ret_val++; if (single_value->field_ra.is_present()) ret_val++; if (single_value->field_ra__fn.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 @RSL_Emulation.ConnectionData 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 @RSL_Emulation.ConnectionData containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.ConnectionData containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Emulation.ConnectionData."); } return 0; } void ConnectionData_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ comp_ref := "); single_value->field_comp__ref.log(); TTCN_Logger::log_event_str(", trx_nr := "); single_value->field_trx__nr.log(); TTCN_Logger::log_event_str(", stream_id := "); single_value->field_stream__id.log(); TTCN_Logger::log_event_str(", chan_nr := "); single_value->field_chan__nr.log(); TTCN_Logger::log_event_str(", ra := "); single_value->field_ra.log(); TTCN_Logger::log_event_str(", ra_fn := "); single_value->field_ra__fn.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 ConnectionData_template::log_match(const ConnectionData& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if(!single_value->field_comp__ref.match(match_value.comp__ref(), legacy)){ TTCN_Logger::log_logmatch_info(".comp_ref"); single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.trx__nr().ispresent()){ if(!single_value->field_trx__nr.match(match_value.trx__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".trx_nr"); single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_trx__nr.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".trx_nr := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_trx__nr.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.stream__id().ispresent()){ if(!single_value->field_stream__id.match(match_value.stream__id(), legacy)){ TTCN_Logger::log_logmatch_info(".stream_id"); single_value->field_stream__id.log_match(match_value.stream__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_stream__id.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".stream_id := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_stream__id.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.chan__nr().ispresent()){ if(!single_value->field_chan__nr.match(match_value.chan__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".chan_nr"); single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_chan__nr.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".chan_nr := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_chan__nr.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.ra().ispresent()){ if(!single_value->field_ra.match(match_value.ra(), legacy)){ TTCN_Logger::log_logmatch_info(".ra"); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_ra.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".ra := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_ra.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.ra__fn().ispresent()){ if(!single_value->field_ra__fn.match(match_value.ra__fn(), legacy)){ TTCN_Logger::log_logmatch_info(".ra_fn"); single_value->field_ra__fn.log_match(match_value.ra__fn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_ra__fn.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".ra_fn := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_ra__fn.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ comp_ref := "); single_value->field_comp__ref.log_match(match_value.comp__ref(), legacy); TTCN_Logger::log_event_str(", trx_nr := "); if (match_value.trx__nr().ispresent()) { single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_trx__nr.log(); if (single_value->field_trx__nr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", stream_id := "); if (match_value.stream__id().ispresent()) { single_value->field_stream__id.log_match(match_value.stream__id(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_stream__id.log(); if (single_value->field_stream__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", chan_nr := "); if (match_value.chan__nr().ispresent()) { single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_chan__nr.log(); if (single_value->field_chan__nr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", ra := "); if (match_value.ra().ispresent()) { single_value->field_ra.log_match(match_value.ra(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_ra.log(); if (single_value->field_ra.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", ra_fn := "); if (match_value.ra__fn().ispresent()) { single_value->field_ra__fn.log_match(match_value.ra__fn(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_ra__fn.log(); if (single_value->field_ra__fn.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 ConnectionData_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (comp__ref().is_bound()) comp__ref().set_implicit_omit(); if (!trx__nr().is_bound()) trx__nr() = OMIT_VALUE; else trx__nr().set_implicit_omit(); if (!stream__id().is_bound()) stream__id() = OMIT_VALUE; else stream__id().set_implicit_omit(); if (!chan__nr().is_bound()) chan__nr() = OMIT_VALUE; else chan__nr().set_implicit_omit(); if (!ra().is_bound()) ra() = OMIT_VALUE; else ra().set_implicit_omit(); if (!ra__fn().is_bound()) ra__fn() = OMIT_VALUE; else ra__fn().set_implicit_omit(); } void ConnectionData_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_comp__ref.encode_text(text_buf); single_value->field_trx__nr.encode_text(text_buf); single_value->field_stream__id.encode_text(text_buf); single_value->field_chan__nr.encode_text(text_buf); single_value->field_ra.encode_text(text_buf); single_value->field_ra__fn.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 @RSL_Emulation.ConnectionData."); } } void ConnectionData_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; single_value->field_comp__ref.decode_text(text_buf); single_value->field_trx__nr.decode_text(text_buf); single_value->field_stream__id.decode_text(text_buf); single_value->field_chan__nr.decode_text(text_buf); single_value->field_ra.decode_text(text_buf); single_value->field_ra__fn.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 ConnectionData_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 @RSL_Emulation.ConnectionData."); } } void ConnectionData_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: { ConnectionData_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) comp__ref().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) stream__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ra().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ra__fn().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_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_idxget_id()->get_name(), "trx_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { trx__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "stream_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { stream__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra_fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra__fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.ConnectionData: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { ConnectionData_template* precondition = new ConnectionData_template; precondition->set_param(*param.get_elem(0)); ConnectionData_template* implied_template = new ConnectionData_template; implied_template->set_param(*param.get_elem(1)); *this = ConnectionData_template(precondition, implied_template); } break; default: param.type_error("record template", "@RSL_Emulation.ConnectionData"); } is_ifpresent = param.get_ifpresent(); } void ConnectionData_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; single_value->field_comp__ref.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); single_value->field_trx__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); single_value->field_stream__id.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); single_value->field_chan__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); single_value->field_ra.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); single_value->field_ra__fn.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ConnectionData"); 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 : "@RSL_Emulation.ConnectionData"); } boolean ConnectionData_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ConnectionData_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& par_trx__nr, const OPTIONAL< GSM__Types::RslChannelNr >& par_chan__nr, const OPTIONAL< RSL__Types::RSL__Message >& par_chan__act) : field_trx__nr(par_trx__nr), field_chan__nr(par_chan__nr), field_chan__act(par_chan__act) { } LastActData::LastActData(const LastActData& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Emulation.LastActData."); if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr(); else field_trx__nr.clean_up(); if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr(); else field_chan__nr.clean_up(); if (other_value.chan__act().is_bound()) field_chan__act = other_value.chan__act(); else field_chan__act.clean_up(); } void LastActData::clean_up() { field_trx__nr.clean_up(); field_chan__nr.clean_up(); field_chan__act.clean_up(); } const TTCN_Typedescriptor_t* LastActData::get_descriptor() const { return &LastActData_descr_; } LastActData& LastActData::operator=(const LastActData& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Emulation.LastActData."); if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr(); else field_trx__nr.clean_up(); if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr(); else field_chan__nr.clean_up(); if (other_value.chan__act().is_bound()) field_chan__act = other_value.chan__act(); else field_chan__act.clean_up(); } return *this; } boolean LastActData::operator==(const LastActData& other_value) const { return field_trx__nr==other_value.field_trx__nr && field_chan__nr==other_value.field_chan__nr && field_chan__act==other_value.field_chan__act; } boolean LastActData::is_bound() const { return (OPTIONAL_OMIT == field_trx__nr.get_selection() || field_trx__nr.is_bound()) || (OPTIONAL_OMIT == field_chan__nr.get_selection() || field_chan__nr.is_bound()) || (OPTIONAL_OMIT == field_chan__act.get_selection() || field_chan__act.is_bound()); } boolean LastActData::is_value() const { return (OPTIONAL_OMIT == field_trx__nr.get_selection() || field_trx__nr.is_value()) && (OPTIONAL_OMIT == field_chan__nr.get_selection() || field_chan__nr.is_value()) && (OPTIONAL_OMIT == field_chan__act.get_selection() || field_chan__act.is_value()); } int LastActData::size_of() const { int ret_val = 0; if (field_trx__nr.ispresent()) ret_val++; if (field_chan__nr.ispresent()) ret_val++; if (field_chan__act.ispresent()) ret_val++; return ret_val; } void LastActData::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ trx_nr := "); field_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); field_chan__nr.log(); TTCN_Logger::log_event_str(", chan_act := "); field_chan__act.log(); TTCN_Logger::log_event_str(" }"); } void LastActData::set_implicit_omit() { if (!trx__nr().is_bound()) trx__nr() = OMIT_VALUE; else trx__nr().set_implicit_omit(); if (!chan__nr().is_bound()) chan__nr() = OMIT_VALUE; else chan__nr().set_implicit_omit(); if (!chan__act().is_bound()) chan__act() = OMIT_VALUE; else chan__act().set_implicit_omit(); } void LastActData::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 (30 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) chan__act().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "trx_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { trx__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_act")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__act().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.LastActData: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RSL_Emulation.LastActData"); } } void LastActData::encode_text(Text_Buf& text_buf) const { field_trx__nr.encode_text(text_buf); field_chan__nr.encode_text(text_buf); field_chan__act.encode_text(text_buf); } void LastActData::decode_text(Text_Buf& text_buf) { field_trx__nr.decode_text(text_buf); field_chan__nr.decode_text(text_buf); field_chan__act.decode_text(text_buf); } struct LastActData_template::single_value_struct { INTEGER_template field_trx__nr; GSM__Types::RslChannelNr_template field_chan__nr; RSL__Types::RSL__Message_template field_chan__act; }; void LastActData_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_trx__nr = ANY_OR_OMIT; single_value->field_chan__nr = ANY_OR_OMIT; single_value->field_chan__act = ANY_OR_OMIT; } } } void LastActData_template::copy_value(const LastActData& other_value) { single_value = new single_value_struct; if (other_value.trx__nr().is_bound()) { if (other_value.trx__nr().ispresent()) single_value->field_trx__nr = other_value.trx__nr()(); else single_value->field_trx__nr = OMIT_VALUE; } else { single_value->field_trx__nr.clean_up(); } if (other_value.chan__nr().is_bound()) { if (other_value.chan__nr().ispresent()) single_value->field_chan__nr = other_value.chan__nr()(); else single_value->field_chan__nr = OMIT_VALUE; } else { single_value->field_chan__nr.clean_up(); } if (other_value.chan__act().is_bound()) { if (other_value.chan__act().ispresent()) single_value->field_chan__act = other_value.chan__act()(); else single_value->field_chan__act = OMIT_VALUE; } else { single_value->field_chan__act.clean_up(); } set_selection(SPECIFIC_VALUE); } void LastActData_template::copy_template(const LastActData_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.trx__nr().get_selection()) { single_value->field_trx__nr = other_value.trx__nr(); } else { single_value->field_trx__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) { single_value->field_chan__nr = other_value.chan__nr(); } else { single_value->field_chan__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.chan__act().get_selection()) { single_value->field_chan__act = other_value.chan__act(); } else { single_value->field_chan__act.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 LastActData_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 LastActData_template(*other_value.implication_.precondition); implication_.implied_template = new LastActData_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 @RSL_Emulation.LastActData."); break; } set_selection(other_value); } LastActData_template::LastActData_template() { } LastActData_template::LastActData_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } LastActData_template::LastActData_template(const LastActData& other_value) { copy_value(other_value); } LastActData_template::LastActData_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LastActData&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RSL_Emulation.LastActData from an unbound optional field."); } } LastActData_template::LastActData_template(LastActData_template* p_precondition, LastActData_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } LastActData_template::LastActData_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } LastActData_template::LastActData_template(const LastActData_template& other_value) : Base_Template() { copy_template(other_value); } LastActData_template::~LastActData_template() { clean_up(); } LastActData_template& LastActData_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } LastActData_template& LastActData_template::operator=(const LastActData& other_value) { clean_up(); copy_value(other_value); return *this; } LastActData_template& LastActData_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LastActData&)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 @RSL_Emulation.LastActData."); } return *this; } LastActData_template& LastActData_template::operator=(const LastActData_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean LastActData_template::match(const LastActData& 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.trx__nr().is_bound()) return FALSE; if((other_value.trx__nr().ispresent() ? !single_value->field_trx__nr.match((const INTEGER&)other_value.trx__nr(), legacy) : !single_value->field_trx__nr.match_omit(legacy)))return FALSE; if(!other_value.chan__nr().is_bound()) return FALSE; if((other_value.chan__nr().ispresent() ? !single_value->field_chan__nr.match((const GSM__Types::RslChannelNr&)other_value.chan__nr(), legacy) : !single_value->field_chan__nr.match_omit(legacy)))return FALSE; if(!other_value.chan__act().is_bound()) return FALSE; if((other_value.chan__act().ispresent() ? !single_value->field_chan__act.match((const RSL__Types::RSL__Message&)other_value.chan__act(), legacy) : !single_value->field_chan__act.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 @RSL_Emulation.LastActData."); } return FALSE; } boolean LastActData_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_trx__nr.is_omit() || single_value->field_trx__nr.is_bound()) || (single_value->field_chan__nr.is_omit() || single_value->field_chan__nr.is_bound()) || (single_value->field_chan__act.is_omit() || single_value->field_chan__act.is_bound()); } boolean LastActData_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_trx__nr.is_omit() || single_value->field_trx__nr.is_value()) && (single_value->field_chan__nr.is_omit() || single_value->field_chan__nr.is_value()) && (single_value->field_chan__act.is_omit() || single_value->field_chan__act.is_value()); } void LastActData_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; } LastActData LastActData_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 @RSL_Emulation.LastActData."); LastActData ret_val; if (single_value->field_trx__nr.is_omit()) ret_val.trx__nr() = OMIT_VALUE; else if (single_value->field_trx__nr.is_bound()) { ret_val.trx__nr() = single_value->field_trx__nr.valueof(); } if (single_value->field_chan__nr.is_omit()) ret_val.chan__nr() = OMIT_VALUE; else if (single_value->field_chan__nr.is_bound()) { ret_val.chan__nr() = single_value->field_chan__nr.valueof(); } if (single_value->field_chan__act.is_omit()) ret_val.chan__act() = OMIT_VALUE; else if (single_value->field_chan__act.is_bound()) { ret_val.chan__act() = single_value->field_chan__act.valueof(); } return ret_val; } void LastActData_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 @RSL_Emulation.LastActData."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new LastActData_template[list_length]; } LastActData_template& LastActData_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 @RSL_Emulation.LastActData."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RSL_Emulation.LastActData."); return value_list.list_value[list_index]; } INTEGER_template& LastActData_template::trx__nr() { set_specific(); return single_value->field_trx__nr; } const INTEGER_template& LastActData_template::trx__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field trx_nr of a non-specific template of type @RSL_Emulation.LastActData."); return single_value->field_trx__nr; } GSM__Types::RslChannelNr_template& LastActData_template::chan__nr() { set_specific(); return single_value->field_chan__nr; } const GSM__Types::RslChannelNr_template& LastActData_template::chan__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field chan_nr of a non-specific template of type @RSL_Emulation.LastActData."); return single_value->field_chan__nr; } RSL__Types::RSL__Message_template& LastActData_template::chan__act() { set_specific(); return single_value->field_chan__act; } const RSL__Types::RSL__Message_template& LastActData_template::chan__act() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field chan_act of a non-specific template of type @RSL_Emulation.LastActData."); return single_value->field_chan__act; } int LastActData_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_trx__nr.is_present()) ret_val++; if (single_value->field_chan__nr.is_present()) ret_val++; if (single_value->field_chan__act.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 @RSL_Emulation.LastActData 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 @RSL_Emulation.LastActData containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RSL_Emulation.LastActData containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Emulation.LastActData."); } return 0; } void LastActData_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ trx_nr := "); single_value->field_trx__nr.log(); TTCN_Logger::log_event_str(", chan_nr := "); single_value->field_chan__nr.log(); TTCN_Logger::log_event_str(", chan_act := "); single_value->field_chan__act.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 LastActData_template::log_match(const LastActData& 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.trx__nr().ispresent()){ if(!single_value->field_trx__nr.match(match_value.trx__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".trx_nr"); single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_trx__nr.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".trx_nr := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_trx__nr.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.chan__nr().ispresent()){ if(!single_value->field_chan__nr.match(match_value.chan__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".chan_nr"); single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_chan__nr.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".chan_nr := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_chan__nr.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.chan__act().ispresent()){ if(!single_value->field_chan__act.match(match_value.chan__act(), legacy)){ TTCN_Logger::log_logmatch_info(".chan_act"); single_value->field_chan__act.log_match(match_value.chan__act(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_chan__act.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".chan_act := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_chan__act.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("{ trx_nr := "); if (match_value.trx__nr().ispresent()) { single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_trx__nr.log(); if (single_value->field_trx__nr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", chan_nr := "); if (match_value.chan__nr().ispresent()) { single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_chan__nr.log(); if (single_value->field_chan__nr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", chan_act := "); if (match_value.chan__act().ispresent()) { single_value->field_chan__act.log_match(match_value.chan__act(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_chan__act.log(); if (single_value->field_chan__act.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 LastActData_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!trx__nr().is_bound()) trx__nr() = OMIT_VALUE; else trx__nr().set_implicit_omit(); if (!chan__nr().is_bound()) chan__nr() = OMIT_VALUE; else chan__nr().set_implicit_omit(); if (!chan__act().is_bound()) chan__act() = OMIT_VALUE; else chan__act().set_implicit_omit(); } void LastActData_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_trx__nr.encode_text(text_buf); single_value->field_chan__nr.encode_text(text_buf); single_value->field_chan__act.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 @RSL_Emulation.LastActData."); } } void LastActData_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_trx__nr.decode_text(text_buf); single_value->field_chan__nr.decode_text(text_buf); single_value->field_chan__act.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 LastActData_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 @RSL_Emulation.LastActData."); } } void LastActData_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: { LastActData_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) chan__act().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "trx_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { trx__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "chan_act")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__act().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RSL_Emulation.LastActData: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { LastActData_template* precondition = new LastActData_template; precondition->set_param(*param.get_elem(0)); LastActData_template* implied_template = new LastActData_template; implied_template->set_param(*param.get_elem(1)); *this = LastActData_template(precondition, implied_template); } break; default: param.type_error("record template", "@RSL_Emulation.LastActData"); } is_ifpresent = param.get_ifpresent(); } void LastActData_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_trx__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.LastActData"); single_value->field_chan__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.LastActData"); single_value->field_chan__act.check_restriction(t_res, t_name ? t_name : "@RSL_Emulation.LastActData"); 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 : "@RSL_Emulation.LastActData"); } boolean LastActData_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean LastActData_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_idxref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } ASP__RSL__UDList::ASP__RSL__UDList(const ASP__RSL__UDList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } ASP__RSL__UDList::~ASP__RSL__UDList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void ASP__RSL__UDList::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."); } } ASP__RSL__UDList& ASP__RSL__UDList::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; } ASP__RSL__UDList& ASP__RSL__UDList::operator=(const ASP__RSL__UDList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean ASP__RSL__UDList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); return val_ptr->n_elements == 0 ; } boolean ASP__RSL__UDList::operator==(const ASP__RSL__UDList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); 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; } IPA__Emulation::ASP__RSL__Unitdata& ASP__RSL__UDList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RSL_Emulation.ASP_RSL_UDList 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 = (IPA__Emulation::ASP__RSL__Unitdata**)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 IPA__Emulation::ASP__RSL__Unitdata(*(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 IPA__Emulation::ASP__RSL__Unitdata; } return *val_ptr->value_elements[index_value]; } IPA__Emulation::ASP__RSL__Unitdata& ASP__RSL__UDList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Emulation.ASP_RSL_UDList."); return (*this)[(int)index_value]; } const IPA__Emulation::ASP__RSL__Unitdata& ASP__RSL__UDList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); if (index_value < 0) TTCN_error("Accessing an element of type @RSL_Emulation.ASP_RSL_UDList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RSL_Emulation.ASP_RSL_UDList: 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 IPA__Emulation::ASP__RSL__Unitdata& ASP__RSL__UDList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Emulation.ASP_RSL_UDList."); return (*this)[(int)index_value]; } ASP__RSL__UDList ASP__RSL__UDList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } ASP__RSL__UDList ASP__RSL__UDList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } ASP__RSL__UDList ASP__RSL__UDList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } ASP__RSL__UDList ASP__RSL__UDList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); 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; ASP__RSL__UDList ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new IPA__Emulation::ASP__RSL__Unitdata(*val_ptr->value_elements[i]); } } return ret_val; } ASP__RSL__UDList ASP__RSL__UDList::operator+(const ASP__RSL__UDList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RSL_Emulation.ASP_RSL_UDList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; ASP__RSL__UDList ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new IPA__Emulation::ASP__RSL__Unitdata(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new IPA__Emulation::ASP__RSL__Unitdata(*other_value.val_ptr->value_elements[i]); } } return ret_val; } ASP__RSL__UDList ASP__RSL__UDList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RSL_Emulation.ASP_RSL_UDList","element"); ASP__RSL__UDList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new IPA__Emulation::ASP__RSL__Unitdata(*val_ptr->value_elements[i+index]); } } return ret_val; } ASP__RSL__UDList ASP__RSL__UDList::replace(int index, int len, const ASP__RSL__UDList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); check_replace_arguments(val_ptr->n_elements, index, len, "@RSL_Emulation.ASP_RSL_UDList","element"); ASP__RSL__UDList 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 IPA__Emulation::ASP__RSL__Unitdata(*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 IPA__Emulation::ASP__RSL__Unitdata(*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 IPA__Emulation::ASP__RSL__Unitdata(*val_ptr->value_elements[index+i+len]); } } return ret_val; } ASP__RSL__UDList ASP__RSL__UDList::replace(int index, int len, const ASP__RSL__UDList_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 ASP__RSL__UDList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RSL_Emulation.ASP_RSL_UDList."); 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 = (IPA__Emulation::ASP__RSL__Unitdata**)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 IPA__Emulation::ASP__RSL__Unitdata(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (IPA__Emulation::ASP__RSL__Unitdata**)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 @RSL_Emulation.ASP_RSL_UDList: %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 = (IPA__Emulation::ASP__RSL__Unitdata**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean ASP__RSL__UDList::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 ASP__RSL__UDList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); return val_ptr->n_elements; } int ASP__RSL__UDList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); 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 ASP__RSL__UDList::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 ASP__RSL__UDList::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 ASP__RSL__UDList::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; iget_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; iget_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", "@RSL_Emulation.ASP_RSL_UDList"); } 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; iget_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", "@RSL_Emulation.ASP_RSL_UDList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void ASP__RSL__UDList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); 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 ASP__RSL__UDList::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 @RSL_Emulation.ASP_RSL_UDList."); val_ptr->value_elements = (IPA__Emulation::ASP__RSL__Unitdata**)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 IPA__Emulation::ASP__RSL__Unitdata; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void ASP__RSL__UDList_template::copy_value(const ASP__RSL__UDList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RSL_Emulation.ASP_RSL_UDList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (IPA__Emulation::ASP__RSL__Unitdata_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 IPA__Emulation::ASP__RSL__Unitdata_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new IPA__Emulation::ASP__RSL__Unitdata_template; } } set_selection(SPECIFIC_VALUE); } void ASP__RSL__UDList_template::copy_template(const ASP__RSL__UDList_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 = (IPA__Emulation::ASP__RSL__Unitdata_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 IPA__Emulation::ASP__RSL__Unitdata_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new IPA__Emulation::ASP__RSL__Unitdata_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 ASP__RSL__UDList_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 ASP__RSL__UDList_template(*other_value.implication_.precondition); implication_.implied_template = new ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); break; } set_selection(other_value); } boolean ASP__RSL__UDList_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 ASP__RSL__UDList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const ASP__RSL__UDList*)value_ptr)[value_index], legacy); else return ((const ASP__RSL__UDList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } ASP__RSL__UDList_template::ASP__RSL__UDList_template() { } ASP__RSL__UDList_template::ASP__RSL__UDList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } ASP__RSL__UDList_template::ASP__RSL__UDList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } ASP__RSL__UDList_template::ASP__RSL__UDList_template(const ASP__RSL__UDList& other_value) { copy_value(other_value); } ASP__RSL__UDList_template::ASP__RSL__UDList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ASP__RSL__UDList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RSL_Emulation.ASP_RSL_UDList from an unbound optional field."); } } ASP__RSL__UDList_template::ASP__RSL__UDList_template(ASP__RSL__UDList_template* p_precondition, ASP__RSL__UDList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ASP__RSL__UDList_template::ASP__RSL__UDList_template(Dynamic_Match_Interface* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } ASP__RSL__UDList_template::ASP__RSL__UDList_template(const ASP__RSL__UDList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } ASP__RSL__UDList_template::~ASP__RSL__UDList_template() { clean_up(); } void ASP__RSL__UDList_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; } ASP__RSL__UDList_template& ASP__RSL__UDList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ASP__RSL__UDList_template& ASP__RSL__UDList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } ASP__RSL__UDList_template& ASP__RSL__UDList_template::operator=(const ASP__RSL__UDList& other_value) { clean_up(); copy_value(other_value); return *this; } ASP__RSL__UDList_template& ASP__RSL__UDList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ASP__RSL__UDList&)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 @RSL_Emulation.ASP_RSL_UDList."); } return *this; } ASP__RSL__UDList_template& ASP__RSL__UDList_template::operator=(const ASP__RSL__UDList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } IPA__Emulation::ASP__RSL__Unitdata_template& ASP__RSL__UDList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RSL_Emulation.ASP_RSL_UDList 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 @RSL_Emulation.ASP_RSL_UDList."); break; } return *single_value.value_elements[index_value]; } IPA__Emulation::ASP__RSL__Unitdata_template& ASP__RSL__UDList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RSL_Emulation.ASP_RSL_UDList."); return (*this)[(int)index_value]; } const IPA__Emulation::ASP__RSL__Unitdata_template& ASP__RSL__UDList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RSL_Emulation.ASP_RSL_UDList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RSL_Emulation.ASP_RSL_UDList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RSL_Emulation.ASP_RSL_UDList: 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 IPA__Emulation::ASP__RSL__Unitdata_template& ASP__RSL__UDList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RSL_Emulation.ASP_RSL_UDList."); return (*this)[(int)index_value]; } void ASP__RSL__UDList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RSL_Emulation.ASP_RSL_UDList."); 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 = (IPA__Emulation::ASP__RSL__Unitdata_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 IPA__Emulation::ASP__RSL__Unitdata_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 IPA__Emulation::ASP__RSL__Unitdata_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 = (IPA__Emulation::ASP__RSL__Unitdata_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int ASP__RSL__UDList_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 ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList 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; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RSL_Emulation.ASP_RSL_UDList 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 @RSL_Emulation.ASP_RSL_UDList 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 @RSL_Emulation.ASP_RSL_UDList 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 @RSL_Emulation.ASP_RSL_UDList 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 @RSL_Emulation.ASP_RSL_UDList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RSL_Emulation.ASP_RSL_UDList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RSL_Emulation.ASP_RSL_UDList"); } boolean ASP__RSL__UDList_template::match(const ASP__RSL__UDList& 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 @RSL_Emulation.ASP_RSL_UDList."); } return FALSE; } boolean ASP__RSL__UDList_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; } ASP__RSL__UDList ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); ASP__RSL__UDList 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; } ASP__RSL__UDList ASP__RSL__UDList_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); } ASP__RSL__UDList ASP__RSL__UDList_template::replace(int index, int len, const ASP__RSL__UDList_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()); } ASP__RSL__UDList ASP__RSL__UDList_template::replace(int index, int len, const ASP__RSL__UDList& 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 ASP__RSL__UDList_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 ASP__RSL__UDList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RSL_Emulation.ASP_RSL_UDList."); } set_selection(template_type); } ASP__RSL__UDList_template& ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RSL_Emulation.ASP_RSL_UDList."); return value_list.list_value[list_index]; } void ASP__RSL__UDList_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 ASP__RSL__UDList_template::log_match(const ASP__RSL__UDList& 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 ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); } } void ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); single_value.value_elements = (IPA__Emulation::ASP__RSL__Unitdata_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 IPA__Emulation::ASP__RSL__Unitdata_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 ASP__RSL__UDList_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 @RSL_Emulation.ASP_RSL_UDList."); } } boolean ASP__RSL__UDList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ASP__RSL__UDList_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; iset_implicit_omit(); } } void ASP__RSL__UDList_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: { ASP__RSL__UDList_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_iget_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_iget_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_iget_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: { ASP__RSL__UDList_template* precondition = new ASP__RSL__UDList_template; precondition->set_param(*param.get_elem(0)); ASP__RSL__UDList_template* implied_template = new ASP__RSL__UDList_template; implied_template->set_param(*param.get_elem(1)); *this = ASP__RSL__UDList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RSL_Emulation.ASP_RSL_UDList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void ASP__RSL__UDList_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; icheck_restriction(t_res, t_name ? t_name : "@RSL_Emulation.ASP_RSL_UDList"); 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 : "@RSL_Emulation.ASP_RSL_UDList"); } boolean ASP__RSL__UDList_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); } } /* Bodies of functions, altsteps and testcases */ RSLDC__ChanRqd_template ts__RSLDC__ChanRqd(const OCTETSTRING& ra, const INTEGER& fn) { TTCN_Location current_location("RSL_Emulation.ttcn", 56, TTCN_Location::LOCATION_TEMPLATE, "ts_RSLDC_ChanRqd"); RSLDC__ChanRqd_template ret_val; ret_val.ra() = ra; ret_val.fn() = fn; return ret_val; } RSLDC__ChanRqd_template ts__RSLDC__ChanRqd__anyFN(const OCTETSTRING& ra) { TTCN_Location current_location("RSL_Emulation.ttcn", 61, TTCN_Location::LOCATION_TEMPLATE, "ts_RSLDC_ChanRqd_anyFN"); RSLDC__ChanRqd_template ret_val; ret_val.ra() = ra; ret_val.fn() = OMIT_VALUE; return ret_val; } RSLEm__Event_template ts__RSLEm__EV(const RSLEm__EventType& ev__type, const IPA__Types::IpaStreamId& sid) { TTCN_Location current_location("RSL_Emulation.ttcn", 76, TTCN_Location::LOCATION_TEMPLATE, "ts_RSLEm_EV"); RSLEm__Event_template ret_val; ret_val.ev__type() = ev__type; ret_val.sid() = sid; return ret_val; } RSLEm__Event_template tr__RSLEm__EV(const RSLEm__EventType_template& ev__type, const IPA__Types::IpaStreamId_template& sid) { TTCN_Location current_location("RSL_Emulation.ttcn", 81, TTCN_Location::LOCATION_TEMPLATE, "tr_RSLEm_EV"); RSLEm__Event_template ret_val; ret_val.ev__type() = ev__type; ret_val.sid() = sid; return ret_val; } RSL__Types::RSL__Message f__rx__or__fail(const RSL__Types::RSL__Message_template& exp__rx, RSL__DCHAN__PT& rsl__pt) { TTCN_Location current_location("RSL_Emulation.ttcn", 114, TTCN_Location::LOCATION_FUNCTION, "f_rx_or_fail"); current_location.update_lineno(116); /* RSL_Emulation.ttcn, line 116 */ RSL__Types::RSL__Message rx__rsl; current_location.update_lineno(117); /* RSL_Emulation.ttcn, line 117 */ TIMER T("T", 1.0e1); current_location.update_lineno(120); /* RSL_Emulation.ttcn, line 120 */ T.start(); current_location.update_lineno(121); /* RSL_Emulation.ttcn, line 121 */ { tmp_0: alt_status tmp_0_alt_flag_0 = ALT_MAYBE; alt_status tmp_0_alt_flag_1 = ALT_MAYBE; alt_status tmp_0_alt_flag_2 = ALT_MAYBE; alt_status tmp_0_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_0_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(122); /* RSL_Emulation.ttcn, line 122 */ tmp_0_alt_flag_0 = rsl__pt.receive(exp__rx, &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_0_alt_flag_0 == ALT_YES) { current_location.update_lineno(123); /* RSL_Emulation.ttcn, line 123 */ T.stop(); current_location.update_lineno(124); /* RSL_Emulation.ttcn, line 124 */ return rx__rsl; } } if (tmp_0_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(126); /* RSL_Emulation.ttcn, line 126 */ tmp_0_alt_flag_1 = rsl__pt.receive(any_compref, NULL, NULL, NULL); if (tmp_0_alt_flag_1 == ALT_YES) { current_location.update_lineno(127); /* RSL_Emulation.ttcn, line 127 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected RSL message on DCHAN"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(128); /* RSL_Emulation.ttcn, line 128 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_0_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(130); /* RSL_Emulation.ttcn, line 130 */ tmp_0_alt_flag_2 = T.timeout(NULL); if (tmp_0_alt_flag_2 == ALT_YES) { current_location.update_lineno(131); /* RSL_Emulation.ttcn, line 131 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for RSL on DCHAN"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(132); /* RSL_Emulation.ttcn, line 132 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_0_default_flag == ALT_MAYBE) { tmp_0_default_flag = TTCN_Default::try_altsteps(first_run); 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(121); /* RSL_Emulation.ttcn, line 121 */ if (tmp_0_alt_flag_0 == ALT_NO && tmp_0_alt_flag_1 == ALT_NO && tmp_0_alt_flag_2 == ALT_NO && tmp_0_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RSL_Emulation.ttcn between lines 121 and 134."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(136); /* RSL_Emulation.ttcn, line 136 */ return rx__rsl; } void f__chan__act__verify__tsc(const RSL__Types::RSL__Message& chan__act, const INTEGER_template& tsc) { TTCN_Location current_location("RSL_Emulation.ttcn", 139, TTCN_Location::LOCATION_FUNCTION, "f_chan_act_verify_tsc"); current_location.update_lineno(140); /* RSL_Emulation.ttcn, line 140 */ RSL__Types::RSL__IE__Body ie; current_location.update_lineno(141); /* RSL_Emulation.ttcn, line 141 */ { boolean tmp_3; { RSL__Types::RSL__IE__Body tmp_1; BOOLEAN tmp_2 = RSL__Types::f__rsl__find__ie(chan__act, RSL__Types::RSL__IE__Type::RSL__IE__CHAN__IDENT, tmp_1); if (tmp_1.is_bound()) ie = tmp_1; tmp_3 = tmp_2; } if (tmp_3) { current_location.update_lineno(142); /* RSL_Emulation.ttcn, line 142 */ INTEGER got__tsc(const_cast< const RSL__Types::RSL__IE__Body&>(ie).chan__ident().ch__desc().v().tsc()); current_location.update_lineno(143); /* RSL_Emulation.ttcn, line 143 */ if ((!(tsc.match(got__tsc)))) { current_location.update_lineno(144); /* RSL_Emulation.ttcn, line 144 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("RSL CHANnel ACTIVation: unexpected TSC in Channel Description: expected "),tsc.log(),TTCN_Logger::log_event_str(" got "),got__tsc.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(146); /* RSL_Emulation.ttcn, line 146 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } } } void f__chan__est(const OCTETSTRING& ra, const OCTETSTRING& est__l3, const GSM__Types::RslLinkId_template& link__id, const INTEGER& fn, const INTEGER_template& tsc, RSL__DCHAN__PT& rsl__pt, RSLEM__PROC__PT& rsl__proc__pt) { TTCN_Location current_location("RSL_Emulation.ttcn", 152, TTCN_Location::LOCATION_FUNCTION, "f_chan_est"); current_location.update_lineno(155); /* RSL_Emulation.ttcn, line 155 */ RSL__Types::RSL__Message rx__rsl; current_location.update_lineno(156); /* RSL_Emulation.ttcn, line 156 */ GSM__RR__Types::GsmRrMessage rr; current_location.update_lineno(159); /* RSL_Emulation.ttcn, line 159 */ rsl__pt.send(ts__RSLDC__ChanRqd(ra, fn), FALSE, NULL); current_location.update_lineno(162); /* RSL_Emulation.ttcn, line 162 */ rx__rsl = f__rx__or__fail(RSL__Types::tr__RSL__IMM__ASSIGN(RSL__Types::tr__RSL__IMM__ASSIGN_tn_defval), rsl__pt); current_location.update_lineno(163); /* RSL_Emulation.ttcn, line 163 */ rr = GSM__RR__Types::dec__GsmRrMessage(const_cast< const RSL__Types::RSL__Message&>(rx__rsl).ies()()[1].body().full__imm__ass__info().payload()); current_location.update_lineno(164); /* RSL_Emulation.ttcn, line 164 */ if ((!(tsc.match(const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass().chan__desc()().tsc())))) { current_location.update_lineno(165); /* RSL_Emulation.ttcn, line 165 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Immediate Assignment: unexpected TSC in Channel Description: expected "),tsc.log(),TTCN_Logger::log_event_str(" got "),const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass().chan__desc()().tsc().log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(167); /* RSL_Emulation.ttcn, line 167 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(169); /* RSL_Emulation.ttcn, line 169 */ RSL__DchanHdlr_component_g__chan__nr = const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass().chan__desc()().chan__nr(); current_location.update_lineno(170); /* RSL_Emulation.ttcn, line 170 */ rsl__pt.send(RSL__Types::ts__RSL__EST__IND(GSM__Types::RslChannelNr_template(RSL__DchanHdlr_component_g__chan__nr), GSM__Types::RslLinkId_template(link__id.valueof()), est__l3), FALSE, NULL); current_location.update_lineno(173); /* RSL_Emulation.ttcn, line 173 */ f__chan__act__verify__tsc(f__rslem__get__last__act(rsl__proc__pt, 0, GSM__Types::RslChannelNr(RSL__DchanHdlr_component_g__chan__nr)), tsc); } void f__deact__chan(const RSL__Types::RSL__Cause& cause) { TTCN_Location current_location("RSL_Emulation.ttcn", 176, TTCN_Location::LOCATION_FUNCTION, "f_deact_chan"); current_location.update_lineno(178); /* RSL_Emulation.ttcn, line 178 */ RSL__Types::RSL__Message rx__rsl; current_location.update_lineno(180); /* RSL_Emulation.ttcn, line 180 */ RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__CONN__FAIL__IND(RSL__DchanHdlr_component_g__chan__nr, cause), FALSE, NULL); current_location.update_lineno(181); /* RSL_Emulation.ttcn, line 181 */ rx__rsl = f__rx__or__fail(RSL__Types::tr__RSL__MsgTypeD(RSL__Types::RSL__MessageType_template(RSL__Types::RSL__MessageType::RSL__MT__RF__CHAN__REL)), RSL__DchanHdlr_component_RSL); } void start_f__deact__chan(const COMPONENT& component_reference, const RSL__Types::RSL__Cause& cause) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_deact_chan("); 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, "RSL_Emulation", "f_deact_chan", text_buf); cause.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__cid__by__comp__ref(const COMPONENT& comp__ref) { TTCN_Location current_location("RSL_Emulation.ttcn", 203, TTCN_Location::LOCATION_FUNCTION, "f_cid_by_comp_ref"); current_location.update_lineno(205); /* RSL_Emulation.ttcn, line 205 */ INTEGER i; current_location.update_lineno(206); /* RSL_Emulation.ttcn, line 206 */ i = 0; current_location.update_lineno(206); /* RSL_Emulation.ttcn, line 206 */ for ( ; ; ) { current_location.update_lineno(206); /* RSL_Emulation.ttcn, line 206 */ if (!(i < 64)) break; current_location.update_lineno(207); /* RSL_Emulation.ttcn, line 207 */ { boolean tmp_9; { boolean tmp_10 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_10) { const int tmp_11 = i; tmp_10 = (tmp_11 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_11); if(tmp_10) { const ConnectionData& tmp_12 = RSL__Emulation__CT_component_ConnectionTable[tmp_11]; tmp_10 = tmp_12.is_bound(); if(tmp_10) { const ConnectionData& tmp_13 = tmp_12; const COMPONENT& tmp_14 = tmp_13.comp__ref(); tmp_10 = tmp_14.is_present(); } } } tmp_9 = tmp_10; } if (tmp_9) tmp_9 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].comp__ref() == comp__ref); if (tmp_9) { current_location.update_lineno(209); /* RSL_Emulation.ttcn, line 209 */ return i; } } current_location.update_lineno(206); /* RSL_Emulation.ttcn, line 206 */ { INTEGER tmp_15; ++i; } } current_location.update_lineno(212); /* RSL_Emulation.ttcn, line 212 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No Dchan handler for comp_ref="); comp__ref.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(213); /* RSL_Emulation.ttcn, line 213 */ return -1; } void start_f__cid__by__comp__ref(const COMPONENT& component_reference, const COMPONENT& comp__ref) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_comp_ref("); 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, "RSL_Emulation", "f_cid_by_comp_ref", text_buf); comp__ref.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__cid__by__chan__nr(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr) { TTCN_Location current_location("RSL_Emulation.ttcn", 216, TTCN_Location::LOCATION_FUNCTION, "f_cid_by_chan_nr"); current_location.update_lineno(218); /* RSL_Emulation.ttcn, line 218 */ INTEGER i; current_location.update_lineno(219); /* RSL_Emulation.ttcn, line 219 */ i = 0; current_location.update_lineno(219); /* RSL_Emulation.ttcn, line 219 */ for ( ; ; ) { current_location.update_lineno(219); /* RSL_Emulation.ttcn, line 219 */ if (!(i < 64)) break; current_location.update_lineno(220); /* RSL_Emulation.ttcn, line 220 */ { boolean tmp_17; { boolean tmp_18; { boolean tmp_19 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_19) { const int tmp_20 = i; tmp_19 = (tmp_20 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_20); if(tmp_19) { const ConnectionData& tmp_21 = RSL__Emulation__CT_component_ConnectionTable[tmp_20]; tmp_19 = tmp_21.is_bound(); if(tmp_19) { const OPTIONAL< GSM__Types::RslChannelNr >& tmp_22 = tmp_21.chan__nr(); switch (tmp_22.get_selection()) { case OPTIONAL_UNBOUND: tmp_19 = FALSE; break; case OPTIONAL_OMIT: tmp_19 = FALSE; break; default: { const GSM__Types::RslChannelNr& tmp_23 = (const GSM__Types::RslChannelNr&) tmp_22; tmp_19 = tmp_23.is_present(); break;} } } } } tmp_18 = tmp_19; } if (tmp_18) tmp_18 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].chan__nr() == chan__nr); tmp_17 = tmp_18; } if (tmp_17) tmp_17 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].trx__nr() == trx__nr); if (tmp_17) { current_location.update_lineno(222); /* RSL_Emulation.ttcn, line 222 */ return i; } } current_location.update_lineno(219); /* RSL_Emulation.ttcn, line 219 */ { INTEGER tmp_24; ++i; } } current_location.update_lineno(225); /* RSL_Emulation.ttcn, line 225 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No Dchan handler for trx_nr="); trx__nr.log(); TTCN_Logger::log_event_str(" and chan_nr="); chan__nr.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(226); /* RSL_Emulation.ttcn, line 226 */ return -1; } void start_f__cid__by__chan__nr(const COMPONENT& component_reference, const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_chan_nr("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.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, "RSL_Emulation", "f_cid_by_chan_nr", text_buf); trx__nr.encode_text(text_buf); chan__nr.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__cid__by__ra__fn(const OCTETSTRING& ra, const INTEGER& fn) { TTCN_Location current_location("RSL_Emulation.ttcn", 229, TTCN_Location::LOCATION_FUNCTION, "f_cid_by_ra_fn"); current_location.update_lineno(231); /* RSL_Emulation.ttcn, line 231 */ INTEGER i; current_location.update_lineno(232); /* RSL_Emulation.ttcn, line 232 */ i = 0; current_location.update_lineno(232); /* RSL_Emulation.ttcn, line 232 */ for ( ; ; ) { current_location.update_lineno(232); /* RSL_Emulation.ttcn, line 232 */ if (!(i < 64)) break; current_location.update_lineno(233); /* RSL_Emulation.ttcn, line 233 */ { boolean tmp_26; { boolean tmp_27; { boolean tmp_28 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_28) { const int tmp_29 = i; tmp_28 = (tmp_29 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_29); if(tmp_28) { const ConnectionData& tmp_30 = RSL__Emulation__CT_component_ConnectionTable[tmp_29]; tmp_28 = tmp_30.is_bound(); if(tmp_28) { const OPTIONAL< OCTETSTRING >& tmp_31 = tmp_30.ra(); switch (tmp_31.get_selection()) { case OPTIONAL_UNBOUND: tmp_28 = FALSE; break; case OPTIONAL_OMIT: tmp_28 = FALSE; break; default: { const OCTETSTRING& tmp_32 = (const OCTETSTRING&) tmp_31; tmp_28 = tmp_32.is_present(); break;} } } } } tmp_27 = tmp_28; } if (tmp_27) tmp_27 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].ra() == ra); tmp_26 = tmp_27; } if (tmp_26) tmp_26 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].ra__fn() == fn); if (tmp_26) { current_location.update_lineno(235); /* RSL_Emulation.ttcn, line 235 */ return i; } } current_location.update_lineno(232); /* RSL_Emulation.ttcn, line 232 */ { INTEGER tmp_33; ++i; } } current_location.update_lineno(238); /* RSL_Emulation.ttcn, line 238 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No Dchan handler for ra="); ra.log(); TTCN_Logger::log_event_str(" and fn="); fn.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(239); /* RSL_Emulation.ttcn, line 239 */ return -1; } void start_f__cid__by__ra__fn(const COMPONENT& component_reference, const OCTETSTRING& ra, const INTEGER& fn) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_ra_fn("); ra.log(); TTCN_Logger::log_event_str(", "); fn.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, "RSL_Emulation", "f_cid_by_ra_fn", text_buf); ra.encode_text(text_buf); fn.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__cid__by__ra__fn2(const OCTETSTRING& ra, const RSL__Types::RSL__IE__FrameNumber& fn) { TTCN_Location current_location("RSL_Emulation.ttcn", 243, TTCN_Location::LOCATION_FUNCTION, "f_cid_by_ra_fn2"); current_location.update_lineno(245); /* RSL_Emulation.ttcn, line 245 */ INTEGER i; current_location.update_lineno(246); /* RSL_Emulation.ttcn, line 246 */ i = 0; current_location.update_lineno(246); /* RSL_Emulation.ttcn, line 246 */ for ( ; ; ) { current_location.update_lineno(246); /* RSL_Emulation.ttcn, line 246 */ if (!(i < 64)) break; current_location.update_lineno(247); /* RSL_Emulation.ttcn, line 247 */ { boolean tmp_35; { boolean tmp_36 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_36) { const int tmp_37 = i; tmp_36 = (tmp_37 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_37); if(tmp_36) { const ConnectionData& tmp_38 = RSL__Emulation__CT_component_ConnectionTable[tmp_37]; tmp_36 = tmp_38.is_bound(); if(tmp_36) { const OPTIONAL< OCTETSTRING >& tmp_39 = tmp_38.ra(); switch (tmp_39.get_selection()) { case OPTIONAL_UNBOUND: tmp_36 = FALSE; break; case OPTIONAL_OMIT: tmp_36 = FALSE; break; default: { const OCTETSTRING& tmp_40 = (const OCTETSTRING&) tmp_39; tmp_36 = tmp_40.is_present(); break;} } } } } tmp_35 = tmp_36; } if (tmp_35) tmp_35 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].ra() == ra); if (tmp_35) { current_location.update_lineno(249); /* RSL_Emulation.ttcn, line 249 */ { boolean tmp_41; { boolean tmp_42 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_42) { const int tmp_43 = i; tmp_42 = (tmp_43 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_43); if(tmp_42) { const ConnectionData& tmp_44 = RSL__Emulation__CT_component_ConnectionTable[tmp_43]; tmp_42 = tmp_44.is_bound(); if(tmp_42) { const OPTIONAL< INTEGER >& tmp_45 = tmp_44.ra__fn(); switch (tmp_45.get_selection()) { case OPTIONAL_UNBOUND: tmp_42 = FALSE; break; case OPTIONAL_OMIT: tmp_42 = FALSE; break; default: { const INTEGER& tmp_46 = (const INTEGER&) tmp_45; tmp_42 = tmp_46.is_present(); break;} } } } } tmp_41 = (!(tmp_42)); } if (!tmp_41) tmp_41 = (fn == RSL__Types::ts__RSL__IE__FrameNumber(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].ra__fn()).valueof()); if (tmp_41) { current_location.update_lineno(251); /* RSL_Emulation.ttcn, line 251 */ return i; } } } } current_location.update_lineno(246); /* RSL_Emulation.ttcn, line 246 */ { INTEGER tmp_47; ++i; } } current_location.update_lineno(255); /* RSL_Emulation.ttcn, line 255 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No Dchan handler for ra="); ra.log(); TTCN_Logger::log_event_str(" and fn="); fn.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(256); /* RSL_Emulation.ttcn, line 256 */ return -1; } void start_f__cid__by__ra__fn2(const COMPONENT& component_reference, const OCTETSTRING& ra, const RSL__Types::RSL__IE__FrameNumber& fn) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_ra_fn2("); ra.log(); TTCN_Logger::log_event_str(", "); fn.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, "RSL_Emulation", "f_cid_by_ra_fn2", text_buf); ra.encode_text(text_buf); fn.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__cid__create(const OCTETSTRING& ra, const INTEGER_template& fn, const COMPONENT& comp__ref) { TTCN_Location current_location("RSL_Emulation.ttcn", 260, TTCN_Location::LOCATION_FUNCTION, "f_cid_create"); current_location.update_lineno(262); /* RSL_Emulation.ttcn, line 262 */ INTEGER i; current_location.update_lineno(263); /* RSL_Emulation.ttcn, line 263 */ i = 0; current_location.update_lineno(263); /* RSL_Emulation.ttcn, line 263 */ for ( ; ; ) { current_location.update_lineno(263); /* RSL_Emulation.ttcn, line 263 */ if (!(i < 64)) break; current_location.update_lineno(264); /* RSL_Emulation.ttcn, line 264 */ { boolean tmp_49; { boolean tmp_50 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_50) { const int tmp_51 = i; tmp_50 = (tmp_51 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_51); if(tmp_50) { const ConnectionData& tmp_52 = RSL__Emulation__CT_component_ConnectionTable[tmp_51]; tmp_50 = tmp_52.is_bound(); if(tmp_50) { const OPTIONAL< OCTETSTRING >& tmp_53 = tmp_52.ra(); switch (tmp_53.get_selection()) { case OPTIONAL_UNBOUND: tmp_50 = FALSE; break; case OPTIONAL_OMIT: tmp_50 = FALSE; break; default: { const OCTETSTRING& tmp_54 = (const OCTETSTRING&) tmp_53; tmp_50 = tmp_54.is_present(); break;} } } } } tmp_49 = (!(tmp_50)); } if (tmp_49) { boolean tmp_55 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_55) { const int tmp_56 = i; tmp_55 = (tmp_56 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_56); if(tmp_55) { const ConnectionData& tmp_57 = RSL__Emulation__CT_component_ConnectionTable[tmp_56]; tmp_55 = tmp_57.is_bound(); if(tmp_55) { const OPTIONAL< INTEGER >& tmp_58 = tmp_57.trx__nr(); switch (tmp_58.get_selection()) { case OPTIONAL_UNBOUND: tmp_55 = FALSE; break; case OPTIONAL_OMIT: tmp_55 = FALSE; break; default: { const INTEGER& tmp_59 = (const INTEGER&) tmp_58; tmp_55 = tmp_59.is_present(); break;} } } } } tmp_49 = (!(tmp_55)); } if (tmp_49) { current_location.update_lineno(266); /* RSL_Emulation.ttcn, line 266 */ RSL__Emulation__CT_component_ConnectionTable[i].ra() = ra; current_location.update_lineno(267); /* RSL_Emulation.ttcn, line 267 */ if (fn.is_present()) { current_location.update_lineno(268); /* RSL_Emulation.ttcn, line 268 */ RSL__Emulation__CT_component_ConnectionTable[i].ra__fn() = fn.valueof(); } else { current_location.update_lineno(270); /* RSL_Emulation.ttcn, line 270 */ RSL__Emulation__CT_component_ConnectionTable[i].ra__fn() = OMIT_VALUE; } current_location.update_lineno(272); /* RSL_Emulation.ttcn, line 272 */ RSL__Emulation__CT_component_ConnectionTable[i].comp__ref() = comp__ref; current_location.update_lineno(273); /* RSL_Emulation.ttcn, line 273 */ return; } } current_location.update_lineno(263); /* RSL_Emulation.ttcn, line 263 */ { INTEGER tmp_64; ++i; } } current_location.update_lineno(276); /* RSL_Emulation.ttcn, line 276 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No free entry in conn table for "); ra.log(); fn.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } void start_f__cid__create(const COMPONENT& component_reference, const OCTETSTRING& ra, const INTEGER_template& fn, const COMPONENT& comp__ref) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_create("); ra.log(); TTCN_Logger::log_event_str(", "); fn.log(); TTCN_Logger::log_event_str(", "); 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, "RSL_Emulation", "f_cid_create", text_buf); ra.encode_text(text_buf); fn.encode_text(text_buf); comp__ref.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__cid__create__cnr(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, const COMPONENT& comp__ref) { TTCN_Location current_location("RSL_Emulation.ttcn", 280, TTCN_Location::LOCATION_FUNCTION, "f_cid_create_cnr"); current_location.update_lineno(282); /* RSL_Emulation.ttcn, line 282 */ INTEGER i; current_location.update_lineno(283); /* RSL_Emulation.ttcn, line 283 */ i = 0; current_location.update_lineno(283); /* RSL_Emulation.ttcn, line 283 */ for ( ; ; ) { current_location.update_lineno(283); /* RSL_Emulation.ttcn, line 283 */ if (!(i < 64)) break; current_location.update_lineno(284); /* RSL_Emulation.ttcn, line 284 */ { boolean tmp_66; { boolean tmp_67 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_67) { const int tmp_68 = i; tmp_67 = (tmp_68 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_68); if(tmp_67) { const ConnectionData& tmp_69 = RSL__Emulation__CT_component_ConnectionTable[tmp_68]; tmp_67 = tmp_69.is_bound(); if(tmp_67) { const OPTIONAL< OCTETSTRING >& tmp_70 = tmp_69.ra(); switch (tmp_70.get_selection()) { case OPTIONAL_UNBOUND: tmp_67 = FALSE; break; case OPTIONAL_OMIT: tmp_67 = FALSE; break; default: { const OCTETSTRING& tmp_71 = (const OCTETSTRING&) tmp_70; tmp_67 = tmp_71.is_present(); break;} } } } } tmp_66 = (!(tmp_67)); } if (tmp_66) { boolean tmp_72 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_72) { const int tmp_73 = i; tmp_72 = (tmp_73 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_73); if(tmp_72) { const ConnectionData& tmp_74 = RSL__Emulation__CT_component_ConnectionTable[tmp_73]; tmp_72 = tmp_74.is_bound(); if(tmp_72) { const OPTIONAL< INTEGER >& tmp_75 = tmp_74.trx__nr(); switch (tmp_75.get_selection()) { case OPTIONAL_UNBOUND: tmp_72 = FALSE; break; case OPTIONAL_OMIT: tmp_72 = FALSE; break; default: { const INTEGER& tmp_76 = (const INTEGER&) tmp_75; tmp_72 = tmp_76.is_present(); break;} } } } } tmp_66 = (!(tmp_72)); } if (tmp_66) { current_location.update_lineno(286); /* RSL_Emulation.ttcn, line 286 */ RSL__Emulation__CT_component_ConnectionTable[i].stream__id() = f__streamId__by__trx(trx__nr); current_location.update_lineno(287); /* RSL_Emulation.ttcn, line 287 */ RSL__Emulation__CT_component_ConnectionTable[i].trx__nr() = trx__nr; current_location.update_lineno(288); /* RSL_Emulation.ttcn, line 288 */ RSL__Emulation__CT_component_ConnectionTable[i].chan__nr() = chan__nr; current_location.update_lineno(289); /* RSL_Emulation.ttcn, line 289 */ RSL__Emulation__CT_component_ConnectionTable[i].comp__ref() = comp__ref; current_location.update_lineno(290); /* RSL_Emulation.ttcn, line 290 */ return; } } current_location.update_lineno(283); /* RSL_Emulation.ttcn, line 283 */ { INTEGER tmp_81; ++i; } } current_location.update_lineno(293); /* RSL_Emulation.ttcn, line 293 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No free entry in conn table for "); trx__nr.log(); chan__nr.log(); comp__ref.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } void start_f__cid__create__cnr(const COMPONENT& component_reference, const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, const COMPONENT& comp__ref) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_create_cnr("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); 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, "RSL_Emulation", "f_cid_create_cnr", text_buf); trx__nr.encode_text(text_buf); chan__nr.encode_text(text_buf); comp__ref.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__cid__delete__cnr(const IPA__Types::IpaStreamId& stream__id, const GSM__Types::RslChannelNr& chan__nr, const COMPONENT& comp__ref) { TTCN_Location current_location("RSL_Emulation.ttcn", 298, TTCN_Location::LOCATION_FUNCTION, "f_cid_delete_cnr"); current_location.update_lineno(300); /* RSL_Emulation.ttcn, line 300 */ INTEGER i; current_location.update_lineno(301); /* RSL_Emulation.ttcn, line 301 */ i = 0; current_location.update_lineno(301); /* RSL_Emulation.ttcn, line 301 */ for ( ; ; ) { current_location.update_lineno(301); /* RSL_Emulation.ttcn, line 301 */ if (!(i < 64)) break; { current_location.update_lineno(302); /* RSL_Emulation.ttcn, line 302 */ if ((const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].comp__ref() == NULL_COMPREF)) { current_location.update_lineno(303); /* RSL_Emulation.ttcn, line 303 */ goto tmp_83; } current_location.update_lineno(305); /* RSL_Emulation.ttcn, line 305 */ { boolean tmp_84; { boolean tmp_85; tmp_85 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].stream__id() == stream__id); if (tmp_85) tmp_85 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].chan__nr() == chan__nr); tmp_84 = tmp_85; } if (tmp_84) tmp_84 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].comp__ref() == comp__ref); if (tmp_84) { current_location.update_lineno(308); /* RSL_Emulation.ttcn, line 308 */ f__cid__clear(i); } } } tmp_83: current_location.update_lineno(301); /* RSL_Emulation.ttcn, line 301 */ { INTEGER tmp_86; ++i; } } current_location.update_lineno(311); /* RSL_Emulation.ttcn, line 311 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Unable to find entry to delete for "); stream__id.log(); chan__nr.log(); comp__ref.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(312); /* RSL_Emulation.ttcn, line 312 */ return -1; } void start_f__cid__delete__cnr(const COMPONENT& component_reference, const IPA__Types::IpaStreamId& stream__id, const GSM__Types::RslChannelNr& chan__nr, const COMPONENT& comp__ref) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_delete_cnr("); stream__id.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); 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, "RSL_Emulation", "f_cid_delete_cnr", text_buf); stream__id.encode_text(text_buf); chan__nr.encode_text(text_buf); comp__ref.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__cid__clear(const INTEGER& cid) { TTCN_Location current_location("RSL_Emulation.ttcn", 316, TTCN_Location::LOCATION_FUNCTION, "f_cid_clear"); current_location.update_lineno(318); /* RSL_Emulation.ttcn, line 318 */ RSL__Emulation__CT_component_ConnectionTable[cid].ra() = OMIT_VALUE; current_location.update_lineno(319); /* RSL_Emulation.ttcn, line 319 */ RSL__Emulation__CT_component_ConnectionTable[cid].ra__fn() = OMIT_VALUE; current_location.update_lineno(320); /* RSL_Emulation.ttcn, line 320 */ RSL__Emulation__CT_component_ConnectionTable[cid].trx__nr() = OMIT_VALUE; current_location.update_lineno(321); /* RSL_Emulation.ttcn, line 321 */ RSL__Emulation__CT_component_ConnectionTable[cid].stream__id() = OMIT_VALUE; current_location.update_lineno(322); /* RSL_Emulation.ttcn, line 322 */ RSL__Emulation__CT_component_ConnectionTable[cid].chan__nr() = OMIT_VALUE; current_location.update_lineno(323); /* RSL_Emulation.ttcn, line 323 */ RSL__Emulation__CT_component_ConnectionTable[cid].comp__ref() = NULL_COMPREF; } void start_f__cid__clear(const COMPONENT& component_reference, const INTEGER& cid) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_clear("); cid.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, "RSL_Emulation", "f_cid_clear", text_buf); cid.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__store__last__act__data(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, const RSL__Types::RSL__Message& chan__act) { TTCN_Location current_location("RSL_Emulation.ttcn", 333, TTCN_Location::LOCATION_FUNCTION, "f_store_last_act_data"); { current_location.update_lineno(335); /* RSL_Emulation.ttcn, line 335 */ INTEGER i(0); current_location.update_lineno(335); /* RSL_Emulation.ttcn, line 335 */ for ( ; ; ) { current_location.update_lineno(335); /* RSL_Emulation.ttcn, line 335 */ if (!(i < 64)) break; current_location.update_lineno(336); /* RSL_Emulation.ttcn, line 336 */ { boolean tmp_93; { boolean tmp_94 = RSL__Emulation__CT_component_LastActTable.is_bound(); if(tmp_94) { const int tmp_95 = i; tmp_94 = (tmp_95 >= 0) && (RSL__Emulation__CT_component_LastActTable.size_of() > tmp_95); if(tmp_94) { const LastActData& tmp_96 = RSL__Emulation__CT_component_LastActTable[tmp_95]; tmp_94 = tmp_96.is_bound(); if(tmp_94) { const OPTIONAL< GSM__Types::RslChannelNr >& tmp_97 = tmp_96.chan__nr(); switch (tmp_97.get_selection()) { case OPTIONAL_UNBOUND: tmp_94 = FALSE; break; case OPTIONAL_OMIT: tmp_94 = FALSE; break; default: { const GSM__Types::RslChannelNr& tmp_98 = (const GSM__Types::RslChannelNr&) tmp_97; tmp_94 = tmp_98.is_present(); break;} } } } } tmp_93 = (!(tmp_94)); } if (!tmp_93) { boolean tmp_99; tmp_99 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_LastActTable)[i].chan__nr() == chan__nr); if (tmp_99) tmp_99 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_LastActTable)[i].trx__nr() == trx__nr); tmp_93 = tmp_99; } if (tmp_93) { current_location.update_lineno(338); /* RSL_Emulation.ttcn, line 338 */ RSL__Emulation__CT_component_LastActTable[i].trx__nr() = trx__nr; current_location.update_lineno(339); /* RSL_Emulation.ttcn, line 339 */ RSL__Emulation__CT_component_LastActTable[i].chan__nr() = chan__nr; current_location.update_lineno(340); /* RSL_Emulation.ttcn, line 340 */ RSL__Emulation__CT_component_LastActTable[i].chan__act() = chan__act; current_location.update_lineno(341); /* RSL_Emulation.ttcn, line 341 */ return; } } current_location.update_lineno(335); /* RSL_Emulation.ttcn, line 335 */ { INTEGER tmp_103; ++i; } } } current_location.update_lineno(344); /* RSL_Emulation.ttcn, line 344 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No space left in LastActTable to store chan_act for "); chan__nr.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } void start_f__store__last__act__data(const COMPONENT& component_reference, const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, const RSL__Types::RSL__Message& chan__act) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_store_last_act_data("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); chan__act.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, "RSL_Emulation", "f_store_last_act_data", text_buf); trx__nr.encode_text(text_buf); chan__nr.encode_text(text_buf); chan__act.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RSL__Types::RSL__Message f__lookup__last__act(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr) { TTCN_Location current_location("RSL_Emulation.ttcn", 347, TTCN_Location::LOCATION_FUNCTION, "f_lookup_last_act"); { current_location.update_lineno(349); /* RSL_Emulation.ttcn, line 349 */ INTEGER i(0); current_location.update_lineno(349); /* RSL_Emulation.ttcn, line 349 */ for ( ; ; ) { current_location.update_lineno(349); /* RSL_Emulation.ttcn, line 349 */ if (!(i < 64)) break; current_location.update_lineno(350); /* RSL_Emulation.ttcn, line 350 */ { boolean tmp_104; { boolean tmp_105; { boolean tmp_106 = RSL__Emulation__CT_component_LastActTable.is_bound(); if(tmp_106) { const int tmp_107 = i; tmp_106 = (tmp_107 >= 0) && (RSL__Emulation__CT_component_LastActTable.size_of() > tmp_107); if(tmp_106) { const LastActData& tmp_108 = RSL__Emulation__CT_component_LastActTable[tmp_107]; tmp_106 = tmp_108.is_bound(); if(tmp_106) { const OPTIONAL< GSM__Types::RslChannelNr >& tmp_109 = tmp_108.chan__nr(); switch (tmp_109.get_selection()) { case OPTIONAL_UNBOUND: tmp_106 = FALSE; break; case OPTIONAL_OMIT: tmp_106 = FALSE; break; default: { const GSM__Types::RslChannelNr& tmp_110 = (const GSM__Types::RslChannelNr&) tmp_109; tmp_106 = tmp_110.is_present(); break;} } } } } tmp_105 = tmp_106; } if (tmp_105) tmp_105 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_LastActTable)[i].chan__nr() == chan__nr); tmp_104 = tmp_105; } if (tmp_104) tmp_104 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_LastActTable)[i].trx__nr() == trx__nr); if (tmp_104) { current_location.update_lineno(352); /* RSL_Emulation.ttcn, line 352 */ return const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_LastActTable)[i].chan__act()(); } } current_location.update_lineno(349); /* RSL_Emulation.ttcn, line 349 */ { INTEGER tmp_111; ++i; } } } current_location.update_lineno(355); /* RSL_Emulation.ttcn, line 355 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("No LastActTable entry found for TRX "); trx__nr.log(); TTCN_Logger::log_char(' '); chan__nr.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } void start_f__lookup__last__act(const COMPONENT& component_reference, const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_lookup_last_act("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.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, "RSL_Emulation", "f_lookup_last_act", text_buf); trx__nr.encode_text(text_buf); chan__nr.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__last__act__table__init() { TTCN_Location current_location("RSL_Emulation.ttcn", 358, TTCN_Location::LOCATION_FUNCTION, "f_last_act_table_init"); { current_location.update_lineno(359); /* RSL_Emulation.ttcn, line 359 */ INTEGER i(0); current_location.update_lineno(359); /* RSL_Emulation.ttcn, line 359 */ for ( ; ; ) { current_location.update_lineno(359); /* RSL_Emulation.ttcn, line 359 */ if (!(i < 64)) break; current_location.update_lineno(360); /* RSL_Emulation.ttcn, line 360 */ { LastActData& tmp_113 = RSL__Emulation__CT_component_LastActTable[i]; /* 7388 */ tmp_113.trx__nr() = OMIT_VALUE; tmp_113.chan__nr() = OMIT_VALUE; tmp_113.chan__act() = OMIT_VALUE; } current_location.update_lineno(359); /* RSL_Emulation.ttcn, line 359 */ { INTEGER tmp_114; ++i; } } } } void start_f__last__act__table__init(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_last_act_table_init("); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RSL_Emulation", "f_last_act_table_init", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__trx__conn__map__init() { TTCN_Location current_location("RSL_Emulation.ttcn", 364, TTCN_Location::LOCATION_FUNCTION, "f_trx_conn_map_init"); { current_location.update_lineno(366); /* RSL_Emulation.ttcn, line 366 */ INTEGER i(0); current_location.update_lineno(366); /* RSL_Emulation.ttcn, line 366 */ for ( ; ; ) { current_location.update_lineno(366); /* RSL_Emulation.ttcn, line 366 */ if (!(i < 4)) break; current_location.update_lineno(367); /* RSL_Emulation.ttcn, line 367 */ RSL__Emulation__CT_component_TrxConnMap[i] = -1; current_location.update_lineno(366); /* RSL_Emulation.ttcn, line 366 */ { INTEGER tmp_116; ++i; } } } } void start_f__trx__conn__map__init(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_init("); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RSL_Emulation", "f_trx_conn_map_init", text_buf); TTCN_Runtime::send_start_component(text_buf); } IPA__Types::IpaStreamId f__trx__conn__map__register(const INTEGER& conn__id, const IPA__Types::IpaCcmIdResp& id__resp) { TTCN_Location current_location("RSL_Emulation.ttcn", 371, TTCN_Location::LOCATION_FUNCTION, "f_trx_conn_map_register"); current_location.update_lineno(373); /* RSL_Emulation.ttcn, line 373 */ IPA__Types::IpaUnitId unit__id; current_location.update_lineno(374); /* RSL_Emulation.ttcn, line 374 */ INTEGER idx; current_location.update_lineno(377); /* RSL_Emulation.ttcn, line 377 */ if ((RSL__Emulation__CT_component_TrxConnNum >= 4)) { current_location.update_lineno(378); /* RSL_Emulation.ttcn, line 378 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("We cannot handle more than "); { INTEGER tmp_117(4); tmp_117.log(); } TTCN_Logger::log_event_str(" transceivers"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } current_location.update_lineno(382); /* RSL_Emulation.ttcn, line 382 */ idx = IPA__Types::f__ipa__id__resp__find__ie(id__resp, IPA__Types::IpaCcmIdTag::IPAC__IDTAG__UNITID); current_location.update_lineno(383); /* RSL_Emulation.ttcn, line 383 */ if ((idx < 0)) { current_location.update_lineno(384); /* RSL_Emulation.ttcn, line 384 */ TTCN_Logger::log_str(TTCN_USER, "IPA IDENTITY RESPONSE contains no unit-id"); TTCN_error("testcase.stop"); } current_location.update_lineno(388); /* RSL_Emulation.ttcn, line 388 */ unit__id = IPA__Types::dec__IpaUnitId(oct2char(const_cast< const IPA__Types::IpaCcmIdResp&>(id__resp)[idx].data())); current_location.update_lineno(390); /* RSL_Emulation.ttcn, line 390 */ if ((const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id() >= 4)) { current_location.update_lineno(391); /* RSL_Emulation.ttcn, line 391 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Transceiver #"); const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id().log(); TTCN_Logger::log_event_str(" does not fit"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } else { current_location.update_lineno(392); /* RSL_Emulation.ttcn, line 392 */ if ((const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_TrxConnMap)[const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id()] != -1)) { current_location.update_lineno(393); /* RSL_Emulation.ttcn, line 393 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Transceiver #"); const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id().log(); TTCN_Logger::log_event_str(" is already connected\?!\?"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } } current_location.update_lineno(397); /* RSL_Emulation.ttcn, line 397 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Mapped TRX#"); const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id().log(); TTCN_Logger::log_event_str(" to TCP/IP conn_id="); conn__id.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(398); /* RSL_Emulation.ttcn, line 398 */ RSL__Emulation__CT_component_TrxConnMap[const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id()] = conn__id; current_location.update_lineno(399); /* RSL_Emulation.ttcn, line 399 */ { INTEGER tmp_121; ++RSL__Emulation__CT_component_TrxConnNum; } current_location.update_lineno(401); /* RSL_Emulation.ttcn, line 401 */ return f__streamId__by__trx(const_cast< const IPA__Types::IpaUnitId&>(unit__id).trx__id()); } void start_f__trx__conn__map__register(const COMPONENT& component_reference, const INTEGER& conn__id, const IPA__Types::IpaCcmIdResp& id__resp) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_register("); conn__id.log(); TTCN_Logger::log_event_str(", "); id__resp.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, "RSL_Emulation", "f_trx_conn_map_register", text_buf); conn__id.encode_text(text_buf); id__resp.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } IPA__Types::IpaStreamId f__trx__conn__map__unregister(const INTEGER& conn__id) { TTCN_Location current_location("RSL_Emulation.ttcn", 404, TTCN_Location::LOCATION_FUNCTION, "f_trx_conn_map_unregister"); { current_location.update_lineno(407); /* RSL_Emulation.ttcn, line 407 */ INTEGER i(0); current_location.update_lineno(407); /* RSL_Emulation.ttcn, line 407 */ for ( ; ; ) { current_location.update_lineno(407); /* RSL_Emulation.ttcn, line 407 */ if (!(i < 4)) break; current_location.update_lineno(408); /* RSL_Emulation.ttcn, line 408 */ if ((conn__id == const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_TrxConnMap)[i])) { current_location.update_lineno(409); /* RSL_Emulation.ttcn, line 409 */ RSL__Emulation__CT_component_TrxConnMap[i] = -1; current_location.update_lineno(410); /* RSL_Emulation.ttcn, line 410 */ { INTEGER tmp_123; --RSL__Emulation__CT_component_TrxConnNum; } current_location.update_lineno(411); /* RSL_Emulation.ttcn, line 411 */ return f__streamId__by__trx(i); } current_location.update_lineno(407); /* RSL_Emulation.ttcn, line 407 */ { INTEGER tmp_124; ++i; } } } current_location.update_lineno(415); /* RSL_Emulation.ttcn, line 415 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Trying to unregister an unknown conn_id="); conn__id.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } void start_f__trx__conn__map__unregister(const COMPONENT& component_reference, const INTEGER& conn__id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_unregister("); conn__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, "RSL_Emulation", "f_trx_conn_map_unregister", text_buf); conn__id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } INTEGER f__trx__conn__map__resolve(const IPA__Types::IpaStreamId& id) { TTCN_Location current_location("RSL_Emulation.ttcn", 418, TTCN_Location::LOCATION_FUNCTION, "f_trx_conn_map_resolve"); current_location.update_lineno(420); /* RSL_Emulation.ttcn, line 420 */ INTEGER trx__nr(f__trx__by__streamId(id)); current_location.update_lineno(422); /* RSL_Emulation.ttcn, line 422 */ if ((const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_TrxConnMap)[trx__nr] == -1)) { current_location.update_lineno(423); /* RSL_Emulation.ttcn, line 423 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Transceiver #"); trx__nr.log(); TTCN_Logger::log_event_str(" is not connected"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } TTCN_error("testcase.stop"); } current_location.update_lineno(426); /* RSL_Emulation.ttcn, line 426 */ return const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_TrxConnMap)[trx__nr]; } void start_f__trx__conn__map__resolve(const COMPONENT& component_reference, const IPA__Types::IpaStreamId& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_resolve("); 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, "RSL_Emulation", "f_trx_conn_map_resolve", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } boolean operator==(null_type, const ASP__RSL__UDList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RSL_Emulation.ASP_RSL_UDList."); return other_value.val_ptr->n_elements == 0; } INTEGER f__trx__by__streamId(const IPA__Types::IpaStreamId& id) { TTCN_Location current_location("RSL_Emulation.ttcn", 456, TTCN_Location::LOCATION_FUNCTION, "f_trx_by_streamId"); current_location.update_lineno(457); /* RSL_Emulation.ttcn, line 457 */ return IPA__Types::IpaStreamId::enum2int(id); } IPA__Types::IpaStreamId f__streamId__by__trx(const INTEGER& trx__nr) { TTCN_Location current_location("RSL_Emulation.ttcn", 460, TTCN_Location::LOCATION_FUNCTION, "f_streamId_by_trx"); { const INTEGER &tmp_126 = trx__nr; switch(tmp_126.get_long_long_val()) { case(0): { current_location.update_lineno(462); /* RSL_Emulation.ttcn, line 462 */ return IPA__Types::IpaStreamId::IPAC__PROTO__RSL__TRX0; break; } case(1): { current_location.update_lineno(463); /* RSL_Emulation.ttcn, line 463 */ return IPA__Types::IpaStreamId::IPAC__PROTO__RSL__TRX1; break; } case(2): { current_location.update_lineno(464); /* RSL_Emulation.ttcn, line 464 */ return IPA__Types::IpaStreamId::IPAC__PROTO__RSL__TRX2; break; } case(3): { current_location.update_lineno(465); /* RSL_Emulation.ttcn, line 465 */ return IPA__Types::IpaStreamId::IPAC__PROTO__RSL__TRX3; break; } };} current_location.update_lineno(467); /* RSL_Emulation.ttcn, line 467 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unknown stream ID "),trx__nr.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(468); /* RSL_Emulation.ttcn, line 468 */ TTCN_Runtime::stop_component(MTC_COMPREF); } void main_(const BOOLEAN& bts__role) { TTCN_Location current_location("RSL_Emulation.ttcn", 472, TTCN_Location::LOCATION_FUNCTION, "main"); current_location.update_lineno(473); /* RSL_Emulation.ttcn, line 473 */ IPA__Emulation::ASP__IPA__Event evt; current_location.update_lineno(474); /* RSL_Emulation.ttcn, line 474 */ IPA__Emulation::ASP__RSL__Unitdata rx__rsl; current_location.update_lineno(475); /* RSL_Emulation.ttcn, line 475 */ RSL__Types::RSL__Message rx__rsl__msg; current_location.update_lineno(476); /* RSL_Emulation.ttcn, line 476 */ RSLDC__ChanRqd chan__rqd; current_location.update_lineno(477); /* RSL_Emulation.ttcn, line 477 */ COMPONENT vc__conn; current_location.update_lineno(478); /* RSL_Emulation.ttcn, line 478 */ GSM__Types::RslChannelNr chan__nr; current_location.update_lineno(479); /* RSL_Emulation.ttcn, line 479 */ INTEGER trx__nr; current_location.update_lineno(480); /* RSL_Emulation.ttcn, line 480 */ INTEGER conn__id; current_location.update_lineno(481); /* RSL_Emulation.ttcn, line 481 */ INTEGER cid; current_location.update_lineno(482); /* RSL_Emulation.ttcn, line 482 */ INTEGER i; current_location.update_lineno(484); /* RSL_Emulation.ttcn, line 484 */ BOOLEAN dchan__suspended(FALSE); current_location.update_lineno(488); /* RSL_Emulation.ttcn, line 488 */ BOOLEAN wait__queue__enabled(FALSE); current_location.update_lineno(489); /* RSL_Emulation.ttcn, line 489 */ BOOLEAN auto__chan__act__ack(TRUE); current_location.update_lineno(491); /* RSL_Emulation.ttcn, line 491 */ f__conn__table__init(); current_location.update_lineno(492); /* RSL_Emulation.ttcn, line 492 */ f__trx__conn__map__init(); current_location.update_lineno(493); /* RSL_Emulation.ttcn, line 493 */ f__last__act__table__init(); for ( ; ; ) { current_location.update_lineno(496); /* RSL_Emulation.ttcn, line 496 */ { tmp_127: alt_status tmp_127_alt_flag_0 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_1 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_2 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_3 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_4 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_5 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_6 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_7 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_8 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_9 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_10 = ALT_MAYBE; alt_status tmp_127_alt_flag_11 = ALT_MAYBE; alt_status tmp_127_alt_flag_12 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_13 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_14 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_15 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_16 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_17 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_18 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_19 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_20 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_21 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_22 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_23 = ALT_MAYBE; alt_status tmp_127_alt_flag_24 = ALT_MAYBE; alt_status tmp_127_alt_flag_25 = ALT_MAYBE; alt_status tmp_127_alt_flag_26 = ALT_MAYBE; alt_status tmp_127_alt_flag_27 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_28 = ALT_UNCHECKED; alt_status tmp_127_alt_flag_29 = ALT_MAYBE; alt_status tmp_127_alt_flag_30 = ALT_MAYBE; alt_status tmp_127_alt_flag_31 = ALT_MAYBE; alt_status tmp_127_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_127_alt_flag_0 == ALT_UNCHECKED) { current_location.update_lineno(497); /* RSL_Emulation.ttcn, line 497 */ if (bts__role) tmp_127_alt_flag_0 = ALT_MAYBE; else tmp_127_alt_flag_0 = ALT_NO; } if (tmp_127_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(497); /* RSL_Emulation.ttcn, line 497 */ tmp_127_alt_flag_0 = RSL__Emulation__CT_component_IPA__PT.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_127_alt_flag_0 == ALT_YES) break; } if (tmp_127_alt_flag_1 == ALT_UNCHECKED) { current_location.update_lineno(499); /* RSL_Emulation.ttcn, line 499 */ if ((!(bts__role))) tmp_127_alt_flag_1 = ALT_MAYBE; else tmp_127_alt_flag_1 = ALT_NO; } if (tmp_127_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(499); /* RSL_Emulation.ttcn, line 499 */ tmp_127_alt_flag_1 = RSL__Emulation__CT_component_IPA__PT.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), &(evt), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_1 == ALT_YES) { current_location.update_lineno(500); /* RSL_Emulation.ttcn, line 500 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("A new IPA/RSL connection has been established (conn_id="); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id().log(); TTCN_Logger::log_event_str("), waiting for IDENTITY RESPONSE..."); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } break; } } if (tmp_127_alt_flag_2 == ALT_UNCHECKED) { current_location.update_lineno(503); /* RSL_Emulation.ttcn, line 503 */ if ((!(bts__role))) tmp_127_alt_flag_2 = ALT_MAYBE; else tmp_127_alt_flag_2 = ALT_NO; } if (tmp_127_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(503); /* RSL_Emulation.ttcn, line 503 */ tmp_127_alt_flag_2 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__IPA__EV(IPA__Emulation::ASP__IPA__EventType_template(IPA__Emulation::ASP__IPA__EventType::ASP__IPA__EVENT__ID__RESP), IPA__Emulation::tr__ASP__IPA__EV_conn__id_defval, IPA__Emulation::tr__ASP__IPA__EV_id__resp_defval), &(evt), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_2 == ALT_YES) { current_location.update_lineno(504); /* RSL_Emulation.ttcn, line 504 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Got IDENTITY RESPONSE (conn_id="); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id().log(); TTCN_Logger::log_event_str("): "); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).id__resp().log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(506); /* RSL_Emulation.ttcn, line 506 */ IPA__Types::IpaStreamId sid(f__trx__conn__map__register(const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id(), const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).id__resp())); current_location.update_lineno(508); /* RSL_Emulation.ttcn, line 508 */ RSL__Emulation__CT_component_CCHAN__PT.send(ts__RSLEm__EV(RSLEm__EventType::RSLEM__EV__TRX__UP, sid), FALSE, NULL); break; } } if (tmp_127_alt_flag_3 == ALT_UNCHECKED) { current_location.update_lineno(510); /* RSL_Emulation.ttcn, line 510 */ if (bts__role) tmp_127_alt_flag_3 = ALT_MAYBE; else tmp_127_alt_flag_3 = ALT_NO; } if (tmp_127_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(510); /* RSL_Emulation.ttcn, line 510 */ tmp_127_alt_flag_3 = RSL__Emulation__CT_component_IPA__PT.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), &(evt), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_3 == ALT_YES) { current_location.update_lineno(511); /* RSL_Emulation.ttcn, line 511 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Lost IPA connection! (conn_id="); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id().log(); TTCN_Logger::log_event_str("): "); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).id__resp().log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(513); /* RSL_Emulation.ttcn, line 513 */ IPA__Types::IpaStreamId sid(f__trx__conn__map__unregister(const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id())); current_location.update_lineno(514); /* RSL_Emulation.ttcn, line 514 */ RSL__Emulation__CT_component_CCHAN__PT.send(ts__RSLEm__EV(RSLEm__EventType::RSLEM__EV__TRX__DOWN, sid), FALSE, NULL); break; } } if (tmp_127_alt_flag_4 == ALT_UNCHECKED) { current_location.update_lineno(516); /* RSL_Emulation.ttcn, line 516 */ if ((!(bts__role))) tmp_127_alt_flag_4 = ALT_MAYBE; else tmp_127_alt_flag_4 = ALT_NO; } if (tmp_127_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(516); /* RSL_Emulation.ttcn, line 516 */ tmp_127_alt_flag_4 = RSL__Emulation__CT_component_IPA__PT.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), &(evt), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_4 == ALT_YES) { current_location.update_lineno(517); /* RSL_Emulation.ttcn, line 517 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Lost IPA connection! (conn_id="); const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id().log(); TTCN_Logger::log_char(')'); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(519); /* RSL_Emulation.ttcn, line 519 */ IPA__Types::IpaStreamId sid(f__trx__conn__map__unregister(const_cast< const IPA__Emulation::ASP__IPA__Event&>(evt).conn__id())); current_location.update_lineno(520); /* RSL_Emulation.ttcn, line 520 */ RSL__Emulation__CT_component_CCHAN__PT.send(ts__RSLEm__EV(RSLEm__EventType::RSLEM__EV__TRX__DOWN, sid), FALSE, NULL); break; } } if (tmp_127_alt_flag_5 == ALT_UNCHECKED) { current_location.update_lineno(522); /* RSL_Emulation.ttcn, line 522 */ if (bts__role) tmp_127_alt_flag_5 = ALT_MAYBE; else tmp_127_alt_flag_5 = ALT_NO; } if (tmp_127_alt_flag_5 == ALT_MAYBE) { current_location.update_lineno(522); /* RSL_Emulation.ttcn, line 522 */ tmp_127_alt_flag_5 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__IPA__EV(IPA__Emulation::ASP__IPA__EventType_template(IPA__Emulation::ASP__IPA__EventType::ASP__IPA__EVENT__ID__ACK), 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_127_alt_flag_5 == ALT_YES) { current_location.update_lineno(523); /* RSL_Emulation.ttcn, line 523 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__PAGING__LOAD__IND(23), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); break; } } if (tmp_127_alt_flag_6 == ALT_UNCHECKED) { current_location.update_lineno(525); /* RSL_Emulation.ttcn, line 525 */ if ((!(bts__role))) tmp_127_alt_flag_6 = ALT_MAYBE; else tmp_127_alt_flag_6 = ALT_NO; } if (tmp_127_alt_flag_6 == ALT_MAYBE) { current_location.update_lineno(525); /* RSL_Emulation.ttcn, line 525 */ tmp_127_alt_flag_6 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__IPA__EV(IPA__Emulation::ASP__IPA__EventType_template(IPA__Emulation::ASP__IPA__EventType::ASP__IPA__EVENT__ID__ACK), 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_127_alt_flag_6 == ALT_YES) break; } if (tmp_127_alt_flag_7 == ALT_UNCHECKED) { current_location.update_lineno(526); /* RSL_Emulation.ttcn, line 526 */ if (bts__role) tmp_127_alt_flag_7 = ALT_MAYBE; else tmp_127_alt_flag_7 = ALT_NO; } if (tmp_127_alt_flag_7 == ALT_MAYBE) { current_location.update_lineno(526); /* RSL_Emulation.ttcn, line 526 */ tmp_127_alt_flag_7 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__IMM__ASSIGN(RSL__Types::tr__RSL__IMM__ASSIGN_tn_defval), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_7 == ALT_YES) { current_location.update_lineno(527); /* RSL_Emulation.ttcn, line 527 */ GSM__RR__Types::GsmRrMessage rr; current_location.update_lineno(528); /* RSL_Emulation.ttcn, line 528 */ OCTETSTRING ra; current_location.update_lineno(529); /* RSL_Emulation.ttcn, line 529 */ INTEGER fn; current_location.update_lineno(530); /* RSL_Emulation.ttcn, line 530 */ rr = GSM__RR__Types::dec__GsmRrMessage(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl().ies()()[1].body().full__imm__ass__info().payload()); current_location.update_lineno(531); /* RSL_Emulation.ttcn, line 531 */ { boolean tmp_132; { boolean tmp_129 = rr.is_bound(); if(tmp_129) { const GSM__RR__Types::GsmRrMessage& tmp_130 = rr; const GSM__RR__Types::RrUnion& tmp_131 = tmp_130.payload(); tmp_129 = tmp_131.is_bound(); if (tmp_129) { tmp_129 = tmp_131.ischosen(GSM__RR__Types::RrUnion::ALT_imm__ass); } } tmp_132 = tmp_129; } if (tmp_132) { current_location.update_lineno(532); /* RSL_Emulation.ttcn, line 532 */ ra = bit2oct(const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass().req__ref().ra()); current_location.update_lineno(533); /* RSL_Emulation.ttcn, line 533 */ fn = 23; current_location.update_lineno(535); /* RSL_Emulation.ttcn, line 535 */ cid = f__cid__by__ra__fn(ra, fn); current_location.update_lineno(536); /* RSL_Emulation.ttcn, line 536 */ if ((cid == -1)) { current_location.update_lineno(537); /* RSL_Emulation.ttcn, line 537 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("IMM ASS for unknown DChan"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(538); /* RSL_Emulation.ttcn, line 538 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(541); /* RSL_Emulation.ttcn, line 541 */ RSL__Emulation__CT_component_ConnectionTable[cid].trx__nr() = f__trx__by__streamId(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId()); current_location.update_lineno(542); /* RSL_Emulation.ttcn, line 542 */ RSL__Emulation__CT_component_ConnectionTable[cid].stream__id() = const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(); current_location.update_lineno(544); /* RSL_Emulation.ttcn, line 544 */ RSL__Emulation__CT_component_ConnectionTable[cid].chan__nr() = const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass().chan__desc()().chan__nr(); current_location.update_lineno(547); /* RSL_Emulation.ttcn, line 547 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].comp__ref()), NULL); } else { current_location.update_lineno(548); /* RSL_Emulation.ttcn, line 548 */ boolean tmp_142; { boolean tmp_139 = rr.is_bound(); if(tmp_139) { const GSM__RR__Types::GsmRrMessage& tmp_140 = rr; const GSM__RR__Types::RrUnion& tmp_141 = tmp_140.payload(); tmp_139 = tmp_141.is_bound(); if (tmp_139) { tmp_139 = tmp_141.ischosen(GSM__RR__Types::RrUnion::ALT_imm__ass__rej); } } tmp_142 = tmp_139; } if (tmp_142) { current_location.update_lineno(549); /* RSL_Emulation.ttcn, line 549 */ i = 0; current_location.update_lineno(549); /* RSL_Emulation.ttcn, line 549 */ for ( ; ; ) { current_location.update_lineno(549); /* RSL_Emulation.ttcn, line 549 */ if (!(i < const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass__rej().payload().size_of())) break; current_location.update_lineno(550); /* RSL_Emulation.ttcn, line 550 */ ra = bit2oct(const_cast< const GSM__RR__Types::GsmRrMessage&>(rr).payload().imm__ass__rej().payload()[i].req__ref().ra()); current_location.update_lineno(551); /* RSL_Emulation.ttcn, line 551 */ fn = 23; current_location.update_lineno(553); /* RSL_Emulation.ttcn, line 553 */ cid = f__cid__by__ra__fn(ra, fn); current_location.update_lineno(554); /* RSL_Emulation.ttcn, line 554 */ if ((cid != -1)) { current_location.update_lineno(555); /* RSL_Emulation.ttcn, line 555 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].comp__ref()), NULL); current_location.update_lineno(557); /* RSL_Emulation.ttcn, line 557 */ f__cid__clear(cid); } current_location.update_lineno(549); /* RSL_Emulation.ttcn, line 549 */ { INTEGER tmp_147; ++i; } } } } } break; } } if (tmp_127_alt_flag_8 == ALT_UNCHECKED) { current_location.update_lineno(562); /* RSL_Emulation.ttcn, line 562 */ if ((!(bts__role))) tmp_127_alt_flag_8 = ALT_MAYBE; else tmp_127_alt_flag_8 = ALT_NO; } if (tmp_127_alt_flag_8 == ALT_MAYBE) { current_location.update_lineno(562); /* RSL_Emulation.ttcn, line 562 */ tmp_127_alt_flag_8 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ANY_VALUE), RSL__Types::tr__RSL__CHAN__RQD_fn_defval, RSL__Types::tr__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_8 == ALT_YES) { current_location.update_lineno(563); /* RSL_Emulation.ttcn, line 563 */ RSL__Types::RSL__IE__RequestRef req__ref; current_location.update_lineno(564); /* RSL_Emulation.ttcn, line 564 */ req__ref = const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl().ies()()[1].body().req__ref(); current_location.update_lineno(565); /* RSL_Emulation.ttcn, line 565 */ cid = f__cid__by__ra__fn2(const_cast< const RSL__Types::RSL__IE__RequestRef&>(req__ref).ra(), const_cast< const RSL__Types::RSL__IE__RequestRef&>(req__ref).frame__nr()); current_location.update_lineno(566); /* RSL_Emulation.ttcn, line 566 */ if ((cid != -1)) { current_location.update_lineno(567); /* RSL_Emulation.ttcn, line 567 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].comp__ref()), NULL); current_location.update_lineno(568); /* RSL_Emulation.ttcn, line 568 */ f__cid__clear(cid); } else { current_location.update_lineno(570); /* RSL_Emulation.ttcn, line 570 */ RSL__Emulation__CT_component_CCHAN__PT.send(rx__rsl, FALSE, NULL); } break; } } if (tmp_127_alt_flag_9 == ALT_UNCHECKED) { current_location.update_lineno(574); /* RSL_Emulation.ttcn, line 574 */ if (bts__role) tmp_127_alt_flag_9 = ALT_MAYBE; else tmp_127_alt_flag_9 = ALT_NO; } if (tmp_127_alt_flag_9 == ALT_MAYBE) { current_location.update_lineno(574); /* RSL_Emulation.ttcn, line 574 */ tmp_127_alt_flag_9 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__PAGING__CMD(MobileL3__CommonIE__Types::MobileIdentityV_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_9 == ALT_YES) { current_location.update_lineno(576); /* RSL_Emulation.ttcn, line 576 */ i = 0; current_location.update_lineno(576); /* RSL_Emulation.ttcn, line 576 */ for ( ; ; ) { current_location.update_lineno(576); /* RSL_Emulation.ttcn, line 576 */ if (!(i < 64)) break; current_location.update_lineno(577); /* RSL_Emulation.ttcn, line 577 */ { boolean tmp_151; { boolean tmp_152 = RSL__Emulation__CT_component_ConnectionTable.is_bound(); if(tmp_152) { const int tmp_153 = i; tmp_152 = (tmp_153 >= 0) && (RSL__Emulation__CT_component_ConnectionTable.size_of() > tmp_153); if(tmp_152) { const ConnectionData& tmp_154 = RSL__Emulation__CT_component_ConnectionTable[tmp_153]; tmp_152 = tmp_154.is_bound(); if(tmp_152) { const ConnectionData& tmp_155 = tmp_154; const COMPONENT& tmp_156 = tmp_155.comp__ref(); tmp_152 = tmp_156.is_present(); } } } tmp_151 = tmp_152; } if (tmp_151) tmp_151 = (const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].comp__ref() != NULL_COMPREF); if (tmp_151) { current_location.update_lineno(578); /* RSL_Emulation.ttcn, line 578 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[i].comp__ref()), NULL); } } current_location.update_lineno(576); /* RSL_Emulation.ttcn, line 576 */ { INTEGER tmp_157; ++i; } } break; } } if (tmp_127_alt_flag_10 == ALT_MAYBE) { current_location.update_lineno(584); /* RSL_Emulation.ttcn, line 584 */ tmp_127_alt_flag_10 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__MsgTypeT(RSL__Types::RSL__MessageType_template(ANY_VALUE)), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_10 == ALT_YES) { current_location.update_lineno(585); /* RSL_Emulation.ttcn, line 585 */ RSL__Emulation__CT_component_CCHAN__PT.send(rx__rsl, FALSE, NULL); break; } } if (tmp_127_alt_flag_11 == ALT_MAYBE) { current_location.update_lineno(589); /* RSL_Emulation.ttcn, line 589 */ tmp_127_alt_flag_11 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__MsgTypeC(RSL__Types::RSL__MessageType_template(ANY_VALUE)), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_11 == ALT_YES) { current_location.update_lineno(590); /* RSL_Emulation.ttcn, line 590 */ RSL__Emulation__CT_component_CCHAN__PT.send(rx__rsl, FALSE, NULL); break; } } if (tmp_127_alt_flag_12 == ALT_UNCHECKED) { current_location.update_lineno(594); /* RSL_Emulation.ttcn, line 594 */ if (bts__role) tmp_127_alt_flag_12 = ALT_MAYBE; else tmp_127_alt_flag_12 = ALT_NO; } if (tmp_127_alt_flag_12 == ALT_MAYBE) { current_location.update_lineno(594); /* RSL_Emulation.ttcn, line 594 */ tmp_127_alt_flag_12 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__MsgTypeD(RSL__Types::RSL__MessageType_template(RSL__Types::RSL__MessageType::RSL__MT__CHAN__ACTIV)), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_12 == ALT_YES) { current_location.update_lineno(595); /* RSL_Emulation.ttcn, line 595 */ chan__nr = const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl().ies()()[0].body().chan__nr(); current_location.update_lineno(596); /* RSL_Emulation.ttcn, line 596 */ trx__nr = f__trx__by__streamId(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId()); current_location.update_lineno(597); /* RSL_Emulation.ttcn, line 597 */ f__store__last__act__data(trx__nr, chan__nr, const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl()); current_location.update_lineno(598); /* RSL_Emulation.ttcn, line 598 */ if (auto__chan__act__ack) { current_location.update_lineno(600); /* RSL_Emulation.ttcn, line 600 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__CHAN__ACT__ACK(GSM__Types::RslChannelNr_template(chan__nr), 23), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(), IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); } else { current_location.update_lineno(602); /* RSL_Emulation.ttcn, line 602 */ RSL__Emulation__CT_component_CLIENT__PT.send(rx__rsl, FALSE, NULL); } break; } } if (tmp_127_alt_flag_13 == ALT_UNCHECKED) { current_location.update_lineno(606); /* RSL_Emulation.ttcn, line 606 */ if ((!(dchan__suspended))) tmp_127_alt_flag_13 = ALT_MAYBE; else tmp_127_alt_flag_13 = ALT_NO; } if (tmp_127_alt_flag_13 == ALT_MAYBE) { current_location.update_lineno(606); /* RSL_Emulation.ttcn, line 606 */ tmp_127_alt_flag_13 = RSL__Emulation__CT_component_IPA__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__MsgTypeDR(RSL__Types::RSL__MessageType_template(ANY_VALUE)), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_13 == ALT_YES) { current_location.update_lineno(608); /* RSL_Emulation.ttcn, line 608 */ cid = f__cid__by__chan__nr(f__trx__by__streamId(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId()), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl().ies()()[0].body().chan__nr()); current_location.update_lineno(610); /* RSL_Emulation.ttcn, line 610 */ if ((cid != -1)) { current_location.update_lineno(611); /* RSL_Emulation.ttcn, line 611 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].comp__ref()), NULL); } else { current_location.update_lineno(612); /* RSL_Emulation.ttcn, line 612 */ if (wait__queue__enabled) { current_location.update_lineno(613); /* RSL_Emulation.ttcn, line 613 */ TTCN_Logger::log_str(TTCN_USER, "Storing an RSL message in the waiting queue"); current_location.update_lineno(614); /* RSL_Emulation.ttcn, line 614 */ { ASP__RSL__UDList tmp_161; { ASP__RSL__UDList tmp_162; tmp_162.set_size(1); tmp_162[0] = rx__rsl; tmp_161 = (RSL__Emulation__CT_component_WaitingQueue + tmp_162); } RSL__Emulation__CT_component_WaitingQueue = tmp_161; } } else { current_location.update_lineno(616); /* RSL_Emulation.ttcn, line 616 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Error: RSL for unknown Dchan (streamId "); const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId().log(); TTCN_Logger::log_event_str(", chan_nr "); const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl().ies()()[0].body().chan__nr().log(); TTCN_Logger::log_event_str("): "); rx__rsl.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(618); /* RSL_Emulation.ttcn, line 618 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("RSL for unknown Dchan"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(619); /* RSL_Emulation.ttcn, line 619 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } break; } } if (tmp_127_alt_flag_14 == ALT_UNCHECKED) { current_location.update_lineno(623); /* RSL_Emulation.ttcn, line 623 */ if ((!(dchan__suspended))) tmp_127_alt_flag_14 = ALT_MAYBE; else tmp_127_alt_flag_14 = ALT_NO; } if (tmp_127_alt_flag_14 == ALT_MAYBE) { current_location.update_lineno(623); /* RSL_Emulation.ttcn, line 623 */ tmp_127_alt_flag_14 = RSL__Emulation__CT_component_IPA__PT.receive(any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_14 == ALT_YES) { current_location.update_lineno(624); /* RSL_Emulation.ttcn, line 624 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unknown primitive from IPA"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(625); /* RSL_Emulation.ttcn, line 625 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_127_alt_flag_15 == ALT_UNCHECKED) { current_location.update_lineno(628); /* RSL_Emulation.ttcn, line 628 */ if (bts__role) tmp_127_alt_flag_15 = ALT_MAYBE; else tmp_127_alt_flag_15 = ALT_NO; } if (tmp_127_alt_flag_15 == ALT_MAYBE) { current_location.update_lineno(628); /* RSL_Emulation.ttcn, line 628 */ tmp_127_alt_flag_15 = RSL__Emulation__CT_component_CLIENT__PT.receive(RSLDC__ChanRqd_template(ANY_VALUE), &(chan__rqd), any_compref, &(vc__conn), NULL, NULL); if (tmp_127_alt_flag_15 == ALT_YES) { current_location.update_lineno(630); /* RSL_Emulation.ttcn, line 630 */ f__cid__create(const_cast< const RSLDC__ChanRqd&>(chan__rqd).ra(), INTEGER_template(const_cast< const RSLDC__ChanRqd&>(chan__rqd).fn()), vc__conn); current_location.update_lineno(631); /* RSL_Emulation.ttcn, line 631 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__CHAN__RQD(const_cast< const RSLDC__ChanRqd&>(chan__rqd).ra(), const_cast< const RSLDC__ChanRqd&>(chan__rqd).fn(), RSL__Types::ts__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::ts__RSL__CHAN__RQD_acc__del_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); break; } } if (tmp_127_alt_flag_16 == ALT_UNCHECKED) { current_location.update_lineno(634); /* RSL_Emulation.ttcn, line 634 */ if ((!(bts__role))) tmp_127_alt_flag_16 = ALT_MAYBE; else tmp_127_alt_flag_16 = ALT_NO; } if (tmp_127_alt_flag_16 == ALT_MAYBE) { current_location.update_lineno(634); /* RSL_Emulation.ttcn, line 634 */ tmp_127_alt_flag_16 = RSL__Emulation__CT_component_CLIENT__PT.receive(RSLDC__ChanRqd_template(ANY_VALUE), &(chan__rqd), any_compref, &(vc__conn), NULL, NULL); if (tmp_127_alt_flag_16 == ALT_YES) { current_location.update_lineno(636); /* RSL_Emulation.ttcn, line 636 */ f__cid__create(const_cast< const RSLDC__ChanRqd&>(chan__rqd).ra(), INTEGER_template(const_cast< const RSLDC__ChanRqd&>(chan__rqd).fn()), vc__conn); break; } } if (tmp_127_alt_flag_17 == ALT_UNCHECKED) { current_location.update_lineno(640); /* RSL_Emulation.ttcn, line 640 */ if (bts__role) tmp_127_alt_flag_17 = ALT_MAYBE; else tmp_127_alt_flag_17 = ALT_NO; } if (tmp_127_alt_flag_17 == ALT_MAYBE) { current_location.update_lineno(640); /* RSL_Emulation.ttcn, line 640 */ tmp_127_alt_flag_17 = RSL__Emulation__CT_component_CLIENT__PT.receive(RSL__Types::tr__RSL__MsgType(RSL__Types::RSL__MessageType_template(ANY_VALUE)), &(rx__rsl__msg), any_compref, &(vc__conn), NULL, NULL); if (tmp_127_alt_flag_17 == ALT_YES) { current_location.update_lineno(641); /* RSL_Emulation.ttcn, line 641 */ cid = f__cid__by__comp__ref(vc__conn); current_location.update_lineno(642); /* RSL_Emulation.ttcn, line 642 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(rx__rsl__msg), const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].stream__id(), IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); break; } } if (tmp_127_alt_flag_18 == ALT_UNCHECKED) { current_location.update_lineno(644); /* RSL_Emulation.ttcn, line 644 */ if ((!(bts__role))) tmp_127_alt_flag_18 = ALT_MAYBE; else tmp_127_alt_flag_18 = ALT_NO; } if (tmp_127_alt_flag_18 == ALT_MAYBE) { current_location.update_lineno(644); /* RSL_Emulation.ttcn, line 644 */ tmp_127_alt_flag_18 = RSL__Emulation__CT_component_CLIENT__PT.receive(RSL__Types::tr__RSL__MsgType(RSL__Types::RSL__MessageType_template(ANY_VALUE)), &(rx__rsl__msg), any_compref, &(vc__conn), NULL, NULL); if (tmp_127_alt_flag_18 == ALT_YES) { current_location.update_lineno(645); /* RSL_Emulation.ttcn, line 645 */ cid = f__cid__by__comp__ref(vc__conn); current_location.update_lineno(646); /* RSL_Emulation.ttcn, line 646 */ conn__id = f__trx__conn__map__resolve(IPA__Types::IpaStreamId(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].stream__id())); current_location.update_lineno(647); /* RSL_Emulation.ttcn, line 647 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(rx__rsl__msg), const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].stream__id(), INTEGER_template(conn__id)), FALSE, NULL); break; } } if (tmp_127_alt_flag_19 == ALT_UNCHECKED) { current_location.update_lineno(652); /* RSL_Emulation.ttcn, line 652 */ if (bts__role) tmp_127_alt_flag_19 = ALT_MAYBE; else tmp_127_alt_flag_19 = ALT_NO; } if (tmp_127_alt_flag_19 == ALT_MAYBE) { current_location.update_lineno(652); /* RSL_Emulation.ttcn, line 652 */ tmp_127_alt_flag_19 = RSL__Emulation__CT_component_CLIENT__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::RSL__Message_template(ANY_VALUE), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_19 == ALT_YES) { current_location.update_lineno(653); /* RSL_Emulation.ttcn, line 653 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl()), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(), IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); break; } } if (tmp_127_alt_flag_20 == ALT_UNCHECKED) { current_location.update_lineno(655); /* RSL_Emulation.ttcn, line 655 */ if ((!(bts__role))) tmp_127_alt_flag_20 = ALT_MAYBE; else tmp_127_alt_flag_20 = ALT_NO; } if (tmp_127_alt_flag_20 == ALT_MAYBE) { current_location.update_lineno(655); /* RSL_Emulation.ttcn, line 655 */ tmp_127_alt_flag_20 = RSL__Emulation__CT_component_CLIENT__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::RSL__Message_template(ANY_VALUE), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_20 == ALT_YES) { current_location.update_lineno(656); /* RSL_Emulation.ttcn, line 656 */ conn__id = f__trx__conn__map__resolve(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId()); current_location.update_lineno(657); /* RSL_Emulation.ttcn, line 657 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl()), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(), INTEGER_template(conn__id)), FALSE, NULL); break; } } if (tmp_127_alt_flag_21 == ALT_UNCHECKED) { current_location.update_lineno(661); /* RSL_Emulation.ttcn, line 661 */ if (bts__role) tmp_127_alt_flag_21 = ALT_MAYBE; else tmp_127_alt_flag_21 = ALT_NO; } if (tmp_127_alt_flag_21 == ALT_MAYBE) { current_location.update_lineno(661); /* RSL_Emulation.ttcn, line 661 */ tmp_127_alt_flag_21 = RSL__Emulation__CT_component_CCHAN__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::RSL__Message_template(ANY_VALUE), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_21 == ALT_YES) { current_location.update_lineno(662); /* RSL_Emulation.ttcn, line 662 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl()), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(), IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL); break; } } if (tmp_127_alt_flag_22 == ALT_UNCHECKED) { current_location.update_lineno(664); /* RSL_Emulation.ttcn, line 664 */ if ((!(bts__role))) tmp_127_alt_flag_22 = ALT_MAYBE; else tmp_127_alt_flag_22 = ALT_NO; } if (tmp_127_alt_flag_22 == ALT_MAYBE) { current_location.update_lineno(664); /* RSL_Emulation.ttcn, line 664 */ tmp_127_alt_flag_22 = RSL__Emulation__CT_component_CCHAN__PT.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::RSL__Message_template(ANY_VALUE), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__rsl), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_22 == ALT_YES) { current_location.update_lineno(665); /* RSL_Emulation.ttcn, line 665 */ conn__id = f__trx__conn__map__resolve(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId()); current_location.update_lineno(666); /* RSL_Emulation.ttcn, line 666 */ RSL__Emulation__CT_component_IPA__PT.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).rsl()), const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__rsl).streamId(), INTEGER_template(conn__id)), FALSE, NULL); break; } } if (tmp_127_alt_flag_23 == ALT_MAYBE) { current_location.update_lineno(670); /* RSL_Emulation.ttcn, line 670 */ { RSLEM__register_template tmp_168; tmp_168.trx__nr() = ANY_VALUE; tmp_168.chan__nr() = ANY_VALUE; tmp_168.hdlr() = ANY_VALUE; tmp_127_alt_flag_23 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_168, any_compref, RSLEM__register_call_redirect(&(trx__nr), &(chan__nr), &(vc__conn)), NULL, NULL, NULL); } if (tmp_127_alt_flag_23 == ALT_YES) { current_location.update_lineno(671); /* RSL_Emulation.ttcn, line 671 */ f__cid__create__cnr(trx__nr, chan__nr, vc__conn); current_location.update_lineno(672); /* RSL_Emulation.ttcn, line 672 */ { RSLEM__register_template tmp_169; tmp_169.trx__nr() = trx__nr; tmp_169.chan__nr() = chan__nr; tmp_169.hdlr() = vc__conn; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_169, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_24 == ALT_MAYBE) { current_location.update_lineno(675); /* RSL_Emulation.ttcn, line 675 */ { RSLEM__unregister_template tmp_170; tmp_170.trx__nr() = ANY_VALUE; tmp_170.chan__nr() = ANY_VALUE; tmp_170.hdlr() = ANY_VALUE; tmp_127_alt_flag_24 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_170, any_compref, RSLEM__unregister_call_redirect(&(trx__nr), &(chan__nr), &(vc__conn)), NULL, NULL, NULL); } if (tmp_127_alt_flag_24 == ALT_YES) { current_location.update_lineno(676); /* RSL_Emulation.ttcn, line 676 */ cid = f__cid__by__chan__nr(trx__nr, chan__nr); current_location.update_lineno(677); /* RSL_Emulation.ttcn, line 677 */ f__cid__clear(cid); current_location.update_lineno(678); /* RSL_Emulation.ttcn, line 678 */ { RSLEM__unregister_template tmp_172; tmp_172.trx__nr() = trx__nr; tmp_172.chan__nr() = chan__nr; tmp_172.hdlr() = vc__conn; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_172, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_25 == ALT_MAYBE) { current_location.update_lineno(681); /* RSL_Emulation.ttcn, line 681 */ { RSLEM__suspend_template tmp_173; tmp_173.suspend() = TRUE; tmp_127_alt_flag_25 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_173, any_compref, RSLEM__suspend_call_redirect(), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_25 == ALT_YES) { current_location.update_lineno(682); /* RSL_Emulation.ttcn, line 682 */ TTCN_Logger::log_str(TTCN_USER, "Suspending DChan"); current_location.update_lineno(683); /* RSL_Emulation.ttcn, line 683 */ dchan__suspended = TRUE; current_location.update_lineno(684); /* RSL_Emulation.ttcn, line 684 */ { RSLEM__suspend_template tmp_175; tmp_175.suspend() = TRUE; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_175, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_26 == ALT_MAYBE) { current_location.update_lineno(687); /* RSL_Emulation.ttcn, line 687 */ { RSLEM__suspend_template tmp_176; tmp_176.suspend() = FALSE; tmp_127_alt_flag_26 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_176, any_compref, RSLEM__suspend_call_redirect(), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_26 == ALT_YES) { current_location.update_lineno(688); /* RSL_Emulation.ttcn, line 688 */ TTCN_Logger::log_str(TTCN_USER, "Resuming DChan"); current_location.update_lineno(689); /* RSL_Emulation.ttcn, line 689 */ dchan__suspended = FALSE; current_location.update_lineno(690); /* RSL_Emulation.ttcn, line 690 */ { RSLEM__suspend_template tmp_178; tmp_178.suspend() = FALSE; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_178, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_27 == ALT_UNCHECKED) { current_location.update_lineno(693); /* RSL_Emulation.ttcn, line 693 */ if ((!(wait__queue__enabled))) tmp_127_alt_flag_27 = ALT_MAYBE; else tmp_127_alt_flag_27 = ALT_NO; } if (tmp_127_alt_flag_27 == ALT_MAYBE) { current_location.update_lineno(693); /* RSL_Emulation.ttcn, line 693 */ { RSLEM__wait__queue_template tmp_179; tmp_179.enable() = TRUE; tmp_127_alt_flag_27 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_179, any_compref, RSLEM__wait__queue_call_redirect(), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_27 == ALT_YES) { current_location.update_lineno(694); /* RSL_Emulation.ttcn, line 694 */ wait__queue__enabled = TRUE; current_location.update_lineno(695); /* RSL_Emulation.ttcn, line 695 */ TTCN_Logger::log_str(TTCN_USER, "Enabled queueing of DChan messages"); current_location.update_lineno(696); /* RSL_Emulation.ttcn, line 696 */ { RSLEM__wait__queue_template tmp_181; tmp_181.enable() = wait__queue__enabled; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_181, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_28 == ALT_UNCHECKED) { current_location.update_lineno(699); /* RSL_Emulation.ttcn, line 699 */ if (wait__queue__enabled) tmp_127_alt_flag_28 = ALT_MAYBE; else tmp_127_alt_flag_28 = ALT_NO; } if (tmp_127_alt_flag_28 == ALT_MAYBE) { current_location.update_lineno(699); /* RSL_Emulation.ttcn, line 699 */ { RSLEM__wait__queue_template tmp_182; tmp_182.enable() = FALSE; tmp_127_alt_flag_28 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_182, any_compref, RSLEM__wait__queue_call_redirect(), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_28 == ALT_YES) { current_location.update_lineno(701); /* RSL_Emulation.ttcn, line 701 */ f__WaitingQueue__dispatch(); current_location.update_lineno(703); /* RSL_Emulation.ttcn, line 703 */ wait__queue__enabled = FALSE; current_location.update_lineno(704); /* RSL_Emulation.ttcn, line 704 */ TTCN_Logger::log_str(TTCN_USER, "Disabled queueing of DChan messages"); current_location.update_lineno(705); /* RSL_Emulation.ttcn, line 705 */ { RSLEM__wait__queue_template tmp_184; tmp_184.enable() = wait__queue__enabled; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_184, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_29 == ALT_MAYBE) { current_location.update_lineno(708); /* RSL_Emulation.ttcn, line 708 */ { RSLEM__wait__queue_template tmp_185; tmp_185.enable() = ANY_VALUE; tmp_127_alt_flag_29 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_185, any_compref, RSLEM__wait__queue_call_redirect(), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_29 == ALT_YES) { current_location.update_lineno(709); /* RSL_Emulation.ttcn, line 709 */ TTCN_Logger::log_str(TTCN_USER, "Queueing of DChan messages is already enabled/disabled"); current_location.update_lineno(710); /* RSL_Emulation.ttcn, line 710 */ { RSLEM__wait__queue_template tmp_186; tmp_186.enable() = wait__queue__enabled; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_186, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_30 == ALT_MAYBE) { current_location.update_lineno(713); /* RSL_Emulation.ttcn, line 713 */ { RSLEM__get__last__act_template tmp_187; tmp_187.trx__nr() = ANY_VALUE; tmp_187.chan__nr() = ANY_VALUE; tmp_187.chan__act() = ANY_VALUE; tmp_127_alt_flag_30 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_187, any_compref, RSLEM__get__last__act_call_redirect(&(trx__nr), &(chan__nr)), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_30 == ALT_YES) { current_location.update_lineno(714); /* RSL_Emulation.ttcn, line 714 */ RSL__Types::RSL__Message last__chan__act(f__lookup__last__act(trx__nr, chan__nr)); current_location.update_lineno(715); /* RSL_Emulation.ttcn, line 715 */ { RSLEM__get__last__act_template tmp_188; tmp_188.trx__nr() = trx__nr; tmp_188.chan__nr() = chan__nr; tmp_188.chan__act() = last__chan__act; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_188, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_alt_flag_31 == ALT_MAYBE) { current_location.update_lineno(718); /* RSL_Emulation.ttcn, line 718 */ { RSLEM__set__auto__chan__act__ack_template tmp_189; tmp_189.enable() = ANY_VALUE; tmp_127_alt_flag_31 = RSL__Emulation__CT_component_RSL__PROC.getcall(tmp_189, any_compref, RSLEM__set__auto__chan__act__ack_call_redirect(&(auto__chan__act__ack)), &(vc__conn), NULL, NULL); } if (tmp_127_alt_flag_31 == ALT_YES) { current_location.update_lineno(719); /* RSL_Emulation.ttcn, line 719 */ { RSLEM__set__auto__chan__act__ack_template tmp_190; tmp_190.enable() = auto__chan__act__ack; RSL__Emulation__CT_component_RSL__PROC.reply(tmp_190, COMPONENT(vc__conn), NULL); } break; } } if (tmp_127_default_flag == ALT_MAYBE) { tmp_127_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_127_default_flag == ALT_YES || tmp_127_default_flag == ALT_BREAK) break; else if (tmp_127_default_flag == ALT_REPEAT) goto tmp_127; } current_location.update_lineno(496); /* RSL_Emulation.ttcn, line 496 */ if (tmp_127_alt_flag_0 == ALT_NO && tmp_127_alt_flag_1 == ALT_NO && tmp_127_alt_flag_2 == ALT_NO && tmp_127_alt_flag_3 == ALT_NO && tmp_127_alt_flag_4 == ALT_NO && tmp_127_alt_flag_5 == ALT_NO && tmp_127_alt_flag_6 == ALT_NO && tmp_127_alt_flag_7 == ALT_NO && tmp_127_alt_flag_8 == ALT_NO && tmp_127_alt_flag_9 == ALT_NO && tmp_127_alt_flag_10 == ALT_NO && tmp_127_alt_flag_11 == ALT_NO && tmp_127_alt_flag_12 == ALT_NO && tmp_127_alt_flag_13 == ALT_NO && tmp_127_alt_flag_14 == ALT_NO && tmp_127_alt_flag_15 == ALT_NO && tmp_127_alt_flag_16 == ALT_NO && tmp_127_alt_flag_17 == ALT_NO && tmp_127_alt_flag_18 == ALT_NO && tmp_127_alt_flag_19 == ALT_NO && tmp_127_alt_flag_20 == ALT_NO && tmp_127_alt_flag_21 == ALT_NO && tmp_127_alt_flag_22 == ALT_NO && tmp_127_alt_flag_23 == ALT_NO && tmp_127_alt_flag_24 == ALT_NO && tmp_127_alt_flag_25 == ALT_NO && tmp_127_alt_flag_26 == ALT_NO && tmp_127_alt_flag_27 == ALT_NO && tmp_127_alt_flag_28 == ALT_NO && tmp_127_alt_flag_29 == ALT_NO && tmp_127_alt_flag_30 == ALT_NO && tmp_127_alt_flag_31 == ALT_NO && tmp_127_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RSL_Emulation.ttcn between lines 496 and 721."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } } void start_main_(const COMPONENT& component_reference, const BOOLEAN& bts__role) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function main("); bts__role.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, "RSL_Emulation", "main", text_buf); bts__role.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__conn__table__init() { TTCN_Location current_location("RSL_Emulation.ttcn", 725, TTCN_Location::LOCATION_FUNCTION, "f_conn_table_init"); current_location.update_lineno(727); /* RSL_Emulation.ttcn, line 727 */ INTEGER i; current_location.update_lineno(730); /* RSL_Emulation.ttcn, line 730 */ i = 0; current_location.update_lineno(730); /* RSL_Emulation.ttcn, line 730 */ for ( ; ; ) { current_location.update_lineno(730); /* RSL_Emulation.ttcn, line 730 */ if (!(i < 64)) break; current_location.update_lineno(731); /* RSL_Emulation.ttcn, line 731 */ f__cid__clear(i); current_location.update_lineno(730); /* RSL_Emulation.ttcn, line 730 */ { INTEGER tmp_192; ++i; } } } void start_f__conn__table__init(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_conn_table_init("); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RSL_Emulation", "f_conn_table_init", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__WaitingQueue__dispatch() { TTCN_Location current_location("RSL_Emulation.ttcn", 735, TTCN_Location::LOCATION_FUNCTION, "f_WaitingQueue_dispatch"); current_location.update_lineno(737); /* RSL_Emulation.ttcn, line 737 */ INTEGER cid; { current_location.update_lineno(739); /* RSL_Emulation.ttcn, line 739 */ INTEGER i(0); current_location.update_lineno(739); /* RSL_Emulation.ttcn, line 739 */ for ( ; ; ) { current_location.update_lineno(739); /* RSL_Emulation.ttcn, line 739 */ if (!(i < RSL__Emulation__CT_component_WaitingQueue.lengthof())) break; current_location.update_lineno(740); /* RSL_Emulation.ttcn, line 740 */ cid = f__cid__by__chan__nr(f__trx__by__streamId(const_cast< const ASP__RSL__UDList&>(RSL__Emulation__CT_component_WaitingQueue)[i].streamId()), GSM__Types::RslChannelNr(const_cast< const ASP__RSL__UDList&>(RSL__Emulation__CT_component_WaitingQueue)[i].rsl().ies()()[0].body().chan__nr())); current_location.update_lineno(742); /* RSL_Emulation.ttcn, line 742 */ if ((cid == -1)) { current_location.update_lineno(743); /* RSL_Emulation.ttcn, line 743 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Dchan handler found for: "),const_cast< const ASP__RSL__UDList&>(RSL__Emulation__CT_component_WaitingQueue)[i].log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(744); /* RSL_Emulation.ttcn, line 744 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(748); /* RSL_Emulation.ttcn, line 748 */ RSL__Emulation__CT_component_CLIENT__PT.send(const_cast< const ASP__RSL__UDList&>(RSL__Emulation__CT_component_WaitingQueue)[i].rsl(), COMPONENT(const_cast< const VALUE_ARRAY&>(RSL__Emulation__CT_component_ConnectionTable)[cid].comp__ref()), NULL); current_location.update_lineno(739); /* RSL_Emulation.ttcn, line 739 */ { INTEGER tmp_194; ++i; } } } current_location.update_lineno(752); /* RSL_Emulation.ttcn, line 752 */ RSL__Emulation__CT_component_WaitingQueue = NULL_VALUE; } void start_f__WaitingQueue__dispatch(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_WaitingQueue_dispatch("); 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, "RSL_Emulation", "f_WaitingQueue_dispatch", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rslem__register(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 756, TTCN_Location::LOCATION_FUNCTION, "f_rslem_register"); current_location.update_lineno(758); /* RSL_Emulation.ttcn, line 758 */ { RSLEM__register_template tmp_196; tmp_196.trx__nr() = trx__nr; tmp_196.chan__nr() = chan__nr; tmp_196.hdlr() = self; PT.call(tmp_196, FALSE, NULL); } { alt_status tmp_197_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(758); /* RSL_Emulation.ttcn, line 758 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_197_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(759); /* RSL_Emulation.ttcn, line 759 */ { RSLEM__register_template tmp_198; tmp_198.trx__nr() = ANY_VALUE; tmp_198.chan__nr() = ANY_VALUE; tmp_198.hdlr() = ANY_VALUE; tmp_197_alt_flag_0 = PT.getreply(tmp_198, any_compref, RSLEM__register_reply_redirect(), NULL, NULL, NULL); } if (tmp_197_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(758); /* RSL_Emulation.ttcn, line 758 */ if (tmp_197_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 RSL_Emulation.ttcn between lines 758 and 760."); TTCN_Snapshot::take_new(TRUE); } } } void f__rslem__unregister(const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr, RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 764, TTCN_Location::LOCATION_FUNCTION, "f_rslem_unregister"); current_location.update_lineno(766); /* RSL_Emulation.ttcn, line 766 */ { RSLEM__unregister_template tmp_199; tmp_199.trx__nr() = trx__nr; tmp_199.chan__nr() = chan__nr; tmp_199.hdlr() = self; PT.call(tmp_199, FALSE, NULL); } { alt_status tmp_200_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(766); /* RSL_Emulation.ttcn, line 766 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_200_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(767); /* RSL_Emulation.ttcn, line 767 */ { RSLEM__unregister_template tmp_201; tmp_201.trx__nr() = ANY_VALUE; tmp_201.chan__nr() = ANY_VALUE; tmp_201.hdlr() = ANY_VALUE; tmp_200_alt_flag_0 = PT.getreply(tmp_201, any_compref, RSLEM__unregister_reply_redirect(), NULL, NULL, NULL); } if (tmp_200_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(766); /* RSL_Emulation.ttcn, line 766 */ if (tmp_200_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 RSL_Emulation.ttcn between lines 766 and 768."); TTCN_Snapshot::take_new(TRUE); } } } void f__rslem__suspend(RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 772, TTCN_Location::LOCATION_FUNCTION, "f_rslem_suspend"); current_location.update_lineno(774); /* RSL_Emulation.ttcn, line 774 */ { RSLEM__suspend_template tmp_202; tmp_202.suspend() = TRUE; PT.call(tmp_202, FALSE, NULL); } { alt_status tmp_203_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(774); /* RSL_Emulation.ttcn, line 774 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_203_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(775); /* RSL_Emulation.ttcn, line 775 */ { RSLEM__suspend_template tmp_204; tmp_204.suspend() = TRUE; tmp_203_alt_flag_0 = PT.getreply(tmp_204, any_compref, RSLEM__suspend_reply_redirect(), NULL, NULL, NULL); } if (tmp_203_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(774); /* RSL_Emulation.ttcn, line 774 */ if (tmp_203_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 RSL_Emulation.ttcn between lines 774 and 776."); TTCN_Snapshot::take_new(TRUE); } } } void f__rslem__resume(RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 780, TTCN_Location::LOCATION_FUNCTION, "f_rslem_resume"); current_location.update_lineno(782); /* RSL_Emulation.ttcn, line 782 */ { RSLEM__suspend_template tmp_205; tmp_205.suspend() = FALSE; PT.call(tmp_205, FALSE, NULL); } { alt_status tmp_206_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(782); /* RSL_Emulation.ttcn, line 782 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_206_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(783); /* RSL_Emulation.ttcn, line 783 */ { RSLEM__suspend_template tmp_207; tmp_207.suspend() = FALSE; tmp_206_alt_flag_0 = PT.getreply(tmp_207, any_compref, RSLEM__suspend_reply_redirect(), NULL, NULL, NULL); } if (tmp_206_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(782); /* RSL_Emulation.ttcn, line 782 */ if (tmp_206_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 RSL_Emulation.ttcn between lines 782 and 784."); TTCN_Snapshot::take_new(TRUE); } } } void f__rslem__dchan__queue__enable(RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 788, TTCN_Location::LOCATION_FUNCTION, "f_rslem_dchan_queue_enable"); current_location.update_lineno(790); /* RSL_Emulation.ttcn, line 790 */ { RSLEM__wait__queue_template tmp_208; tmp_208.enable() = TRUE; PT.call(tmp_208, FALSE, NULL); } { alt_status tmp_209_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(790); /* RSL_Emulation.ttcn, line 790 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_209_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(791); /* RSL_Emulation.ttcn, line 791 */ { RSLEM__wait__queue_template tmp_210; tmp_210.enable() = TRUE; tmp_209_alt_flag_0 = PT.getreply(tmp_210, any_compref, RSLEM__wait__queue_reply_redirect(), NULL, NULL, NULL); } if (tmp_209_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(790); /* RSL_Emulation.ttcn, line 790 */ if (tmp_209_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 RSL_Emulation.ttcn between lines 790 and 792."); TTCN_Snapshot::take_new(TRUE); } } } void f__rslem__dchan__queue__dispatch(RSLEM__PROC__PT& PT) { TTCN_Location current_location("RSL_Emulation.ttcn", 798, TTCN_Location::LOCATION_FUNCTION, "f_rslem_dchan_queue_dispatch"); current_location.update_lineno(800); /* RSL_Emulation.ttcn, line 800 */ { RSLEM__wait__queue_template tmp_211; tmp_211.enable() = FALSE; PT.call(tmp_211, FALSE, NULL); } { alt_status tmp_212_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(800); /* RSL_Emulation.ttcn, line 800 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_212_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(801); /* RSL_Emulation.ttcn, line 801 */ { RSLEM__wait__queue_template tmp_213; tmp_213.enable() = FALSE; tmp_212_alt_flag_0 = PT.getreply(tmp_213, any_compref, RSLEM__wait__queue_reply_redirect(), NULL, NULL, NULL); } if (tmp_212_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(800); /* RSL_Emulation.ttcn, line 800 */ if (tmp_212_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 RSL_Emulation.ttcn between lines 800 and 802."); TTCN_Snapshot::take_new(TRUE); } } } RSL__Types::RSL__Message f__rslem__get__last__act(RSLEM__PROC__PT& PT, const INTEGER& trx__nr, const GSM__Types::RslChannelNr& chan__nr) { TTCN_Location current_location("RSL_Emulation.ttcn", 806, TTCN_Location::LOCATION_FUNCTION, "f_rslem_get_last_act"); current_location.update_lineno(808); /* RSL_Emulation.ttcn, line 808 */ RSL__Types::RSL__Message chan__act; current_location.update_lineno(809); /* RSL_Emulation.ttcn, line 809 */ { RSLEM__get__last__act_template tmp_214; tmp_214.trx__nr() = trx__nr; tmp_214.chan__nr() = chan__nr; PT.call(tmp_214, FALSE, NULL); } { alt_status tmp_215_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(809); /* RSL_Emulation.ttcn, line 809 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_215_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(810); /* RSL_Emulation.ttcn, line 810 */ { RSLEM__get__last__act_template tmp_216; tmp_216.trx__nr() = trx__nr; tmp_216.chan__nr() = chan__nr; tmp_216.chan__act() = ANY_VALUE; tmp_215_alt_flag_0 = PT.getreply(tmp_216, any_compref, RSLEM__get__last__act_reply_redirect(&(chan__act)), NULL, NULL, NULL); } if (tmp_215_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(809); /* RSL_Emulation.ttcn, line 809 */ if (tmp_215_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 RSL_Emulation.ttcn between lines 809 and 811."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(812); /* RSL_Emulation.ttcn, line 812 */ return chan__act; } void f__rslem__set__auto__chan__act__ack(RSLEM__PROC__PT& PT, const BOOLEAN& enable) { TTCN_Location current_location("RSL_Emulation.ttcn", 815, TTCN_Location::LOCATION_FUNCTION, "f_rslem_set_auto_chan_act_ack"); current_location.update_lineno(817); /* RSL_Emulation.ttcn, line 817 */ { RSLEM__set__auto__chan__act__ack_template tmp_217; tmp_217.enable() = enable; PT.call(tmp_217, FALSE, NULL); } { alt_status tmp_218_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(817); /* RSL_Emulation.ttcn, line 817 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_218_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(818); /* RSL_Emulation.ttcn, line 818 */ { RSLEM__set__auto__chan__act__ack_template tmp_219; tmp_219.enable() = enable; tmp_218_alt_flag_0 = PT.getreply(tmp_219, any_compref, RSLEM__set__auto__chan__act__ack_reply_redirect(), NULL, NULL, NULL); } if (tmp_218_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(817); /* RSL_Emulation.ttcn, line 817 */ if (tmp_218_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 RSL_Emulation.ttcn between lines 817 and 819."); TTCN_Snapshot::take_new(TRUE); } } } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("RSL_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RSL_Emulation"); IPA__Emulation::module_object.pre_init_module(); module_object.add_function("f_rx_or_fail", (genericfunc_t)&f__rx__or__fail, NULL); module_object.add_function("f_chan_act_verify_tsc", (genericfunc_t)&f__chan__act__verify__tsc, NULL); module_object.add_function("f_chan_est", (genericfunc_t)&f__chan__est, NULL); module_object.add_function("f_deact_chan", (genericfunc_t)&f__deact__chan, (genericfunc_t)&start_f__deact__chan); module_object.add_function("f_cid_by_comp_ref", (genericfunc_t)&f__cid__by__comp__ref, (genericfunc_t)&start_f__cid__by__comp__ref); module_object.add_function("f_cid_by_chan_nr", (genericfunc_t)&f__cid__by__chan__nr, (genericfunc_t)&start_f__cid__by__chan__nr); module_object.add_function("f_cid_by_ra_fn", (genericfunc_t)&f__cid__by__ra__fn, (genericfunc_t)&start_f__cid__by__ra__fn); module_object.add_function("f_cid_by_ra_fn2", (genericfunc_t)&f__cid__by__ra__fn2, (genericfunc_t)&start_f__cid__by__ra__fn2); module_object.add_function("f_cid_create", (genericfunc_t)&f__cid__create, (genericfunc_t)&start_f__cid__create); module_object.add_function("f_cid_create_cnr", (genericfunc_t)&f__cid__create__cnr, (genericfunc_t)&start_f__cid__create__cnr); module_object.add_function("f_cid_delete_cnr", (genericfunc_t)&f__cid__delete__cnr, (genericfunc_t)&start_f__cid__delete__cnr); module_object.add_function("f_cid_clear", (genericfunc_t)&f__cid__clear, (genericfunc_t)&start_f__cid__clear); module_object.add_function("f_store_last_act_data", (genericfunc_t)&f__store__last__act__data, (genericfunc_t)&start_f__store__last__act__data); module_object.add_function("f_lookup_last_act", (genericfunc_t)&f__lookup__last__act, (genericfunc_t)&start_f__lookup__last__act); module_object.add_function("f_last_act_table_init", (genericfunc_t)&f__last__act__table__init, (genericfunc_t)&start_f__last__act__table__init); module_object.add_function("f_trx_conn_map_init", (genericfunc_t)&f__trx__conn__map__init, (genericfunc_t)&start_f__trx__conn__map__init); module_object.add_function("f_trx_conn_map_register", (genericfunc_t)&f__trx__conn__map__register, (genericfunc_t)&start_f__trx__conn__map__register); module_object.add_function("f_trx_conn_map_unregister", (genericfunc_t)&f__trx__conn__map__unregister, (genericfunc_t)&start_f__trx__conn__map__unregister); module_object.add_function("f_trx_conn_map_resolve", (genericfunc_t)&f__trx__conn__map__resolve, (genericfunc_t)&start_f__trx__conn__map__resolve); module_object.add_function("f_trx_by_streamId", (genericfunc_t)&f__trx__by__streamId, NULL); module_object.add_function("f_streamId_by_trx", (genericfunc_t)&f__streamId__by__trx, NULL); module_object.add_function("main", (genericfunc_t)&main_, (genericfunc_t)&start_main_); module_object.add_function("f_conn_table_init", (genericfunc_t)&f__conn__table__init, (genericfunc_t)&start_f__conn__table__init); module_object.add_function("f_WaitingQueue_dispatch", (genericfunc_t)&f__WaitingQueue__dispatch, (genericfunc_t)&start_f__WaitingQueue__dispatch); module_object.add_function("f_rslem_register", (genericfunc_t)&f__rslem__register, NULL); module_object.add_function("f_rslem_unregister", (genericfunc_t)&f__rslem__unregister, NULL); module_object.add_function("f_rslem_suspend", (genericfunc_t)&f__rslem__suspend, NULL); module_object.add_function("f_rslem_resume", (genericfunc_t)&f__rslem__resume, NULL); module_object.add_function("f_rslem_dchan_queue_enable", (genericfunc_t)&f__rslem__dchan__queue__enable, NULL); module_object.add_function("f_rslem_dchan_queue_dispatch", (genericfunc_t)&f__rslem__dchan__queue__dispatch, NULL); module_object.add_function("f_rslem_get_last_act", (genericfunc_t)&f__rslem__get__last__act, NULL); module_object.add_function("f_rslem_set_auto_chan_act_ack", (genericfunc_t)&f__rslem__set__auto__chan__act__ack, NULL); } void post_init_module() { TTCN_Location current_location("RSL_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RSL_Emulation"); IPA__Emulation::module_object.post_init_module(); current_location.update_lineno(82); /* RSL_Emulation.ttcn, line 82 */ template_tr__RSLEm__EV_sid_defval = ANY_VALUE; current_location.update_lineno(152); /* RSL_Emulation.ttcn, line 152 */ const_f__chan__est_fn_defval = 23; current_location.update_lineno(153); /* RSL_Emulation.ttcn, line 153 */ template_f__chan__est_tsc_defval = ANY_VALUE; current_location.update_lineno(472); /* RSL_Emulation.ttcn, line 472 */ const_main__bts__role_defval = TRUE; } boolean init_comp_type(const char *component_type, boolean init_base_comps) { (void)init_base_comps; if (!strcmp(component_type, "RSL_DchanHdlr")) { RSL__DchanHdlr_component_RSL.activate_port(); RSL__DchanHdlr_component_RSL__PROC.activate_port(); RSL__DchanHdlr_component_g__chan__nr.clean_up(); RSL__DchanHdlr_component_RSL1.activate_port(); RSL__DchanHdlr_component_RSL1__PROC.activate_port(); RSL__DchanHdlr_component_RSL2.activate_port(); RSL__DchanHdlr_component_RSL2__PROC.activate_port(); return TRUE; } else if (!strcmp(component_type, "RSL_Emulation_CT")) { RSL__Emulation__CT_component_IPA__PT.activate_port(); RSL__Emulation__CT_component_CLIENT__PT.activate_port(); RSL__Emulation__CT_component_RSL__PROC.activate_port(); RSL__Emulation__CT_component_CCHAN__PT.activate_port(); RSL__Emulation__CT_component_ConnectionTable.clean_up(); RSL__Emulation__CT_component_WaitingQueue = NULL_VALUE; RSL__Emulation__CT_component_LastActTable.clean_up(); RSL__Emulation__CT_component_TrxConnNum = 0; RSL__Emulation__CT_component_TrxConnMap.clean_up(); return TRUE; } else return FALSE; } boolean init_system_port(const char* component_type, const char* port_name) { if (!strcmp(component_type, "RSL_DchanHdlr")) { if (!strcmp(port_name, "RSL")) { RSL__DchanHdlr_component_RSL.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL1")) { RSL__DchanHdlr_component_RSL1.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL1_PROC")) { RSL__DchanHdlr_component_RSL1__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL2")) { RSL__DchanHdlr_component_RSL2.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL2_PROC")) { RSL__DchanHdlr_component_RSL2__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL_PROC")) { RSL__DchanHdlr_component_RSL__PROC.safe_start(); return TRUE; } } else if (!strcmp(component_type, "RSL_Emulation_CT")) { if (!strcmp(port_name, "CCHAN_PT")) { RSL__Emulation__CT_component_CCHAN__PT.safe_start(); return TRUE; } if (!strcmp(port_name, "CLIENT_PT")) { RSL__Emulation__CT_component_CLIENT__PT.safe_start(); return TRUE; } if (!strcmp(port_name, "IPA_PT")) { RSL__Emulation__CT_component_IPA__PT.safe_start(); return TRUE; } if (!strcmp(port_name, "RSL_PROC")) { RSL__Emulation__CT_component_RSL__PROC.safe_start(); return TRUE; } } return FALSE; } boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments) { if (!strcmp(function_name, "f_deact_chan")) { RSL__Types::RSL__Cause cause; cause.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_deact_chan("); cause.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__deact__chan(cause); TTCN_Runtime::function_finished("f_deact_chan"); return TRUE; } else if (!strcmp(function_name, "f_cid_by_comp_ref")) { 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_cid_by_comp_ref("); comp__ref.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__by__comp__ref(comp__ref); TTCN_Runtime::function_finished("f_cid_by_comp_ref"); return TRUE; } else if (!strcmp(function_name, "f_cid_by_chan_nr")) { INTEGER trx__nr; GSM__Types::RslChannelNr chan__nr; trx__nr.decode_text(function_arguments); chan__nr.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_chan_nr("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__by__chan__nr(trx__nr, chan__nr); TTCN_Runtime::function_finished("f_cid_by_chan_nr"); return TRUE; } else if (!strcmp(function_name, "f_cid_by_ra_fn")) { OCTETSTRING ra; INTEGER fn; ra.decode_text(function_arguments); fn.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_ra_fn("); ra.log(); TTCN_Logger::log_event_str(", "); fn.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__by__ra__fn(ra, fn); TTCN_Runtime::function_finished("f_cid_by_ra_fn"); return TRUE; } else if (!strcmp(function_name, "f_cid_by_ra_fn2")) { OCTETSTRING ra; RSL__Types::RSL__IE__FrameNumber fn; ra.decode_text(function_arguments); fn.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_by_ra_fn2("); ra.log(); TTCN_Logger::log_event_str(", "); fn.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__by__ra__fn2(ra, fn); TTCN_Runtime::function_finished("f_cid_by_ra_fn2"); return TRUE; } else if (!strcmp(function_name, "f_cid_create")) { OCTETSTRING ra; INTEGER_template fn; COMPONENT comp__ref; ra.decode_text(function_arguments); fn.decode_text(function_arguments); comp__ref.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_create("); ra.log(); TTCN_Logger::log_event_str(", "); fn.log(); TTCN_Logger::log_event_str(", "); comp__ref.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__create(ra, fn, comp__ref); TTCN_Runtime::function_finished("f_cid_create"); return TRUE; } else if (!strcmp(function_name, "f_cid_create_cnr")) { INTEGER trx__nr; GSM__Types::RslChannelNr chan__nr; COMPONENT comp__ref; trx__nr.decode_text(function_arguments); chan__nr.decode_text(function_arguments); comp__ref.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_create_cnr("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); comp__ref.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__create__cnr(trx__nr, chan__nr, comp__ref); TTCN_Runtime::function_finished("f_cid_create_cnr"); return TRUE; } else if (!strcmp(function_name, "f_cid_delete_cnr")) { IPA__Types::IpaStreamId stream__id; GSM__Types::RslChannelNr chan__nr; COMPONENT comp__ref; stream__id.decode_text(function_arguments); chan__nr.decode_text(function_arguments); comp__ref.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_delete_cnr("); stream__id.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); comp__ref.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__delete__cnr(stream__id, chan__nr, comp__ref); TTCN_Runtime::function_finished("f_cid_delete_cnr"); return TRUE; } else if (!strcmp(function_name, "f_cid_clear")) { INTEGER cid; cid.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cid_clear("); cid.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cid__clear(cid); TTCN_Runtime::function_finished("f_cid_clear"); return TRUE; } else if (!strcmp(function_name, "f_store_last_act_data")) { INTEGER trx__nr; GSM__Types::RslChannelNr chan__nr; RSL__Types::RSL__Message chan__act; trx__nr.decode_text(function_arguments); chan__nr.decode_text(function_arguments); chan__act.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_store_last_act_data("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(", "); chan__act.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__store__last__act__data(trx__nr, chan__nr, chan__act); TTCN_Runtime::function_finished("f_store_last_act_data"); return TRUE; } else if (!strcmp(function_name, "f_lookup_last_act")) { INTEGER trx__nr; GSM__Types::RslChannelNr chan__nr; trx__nr.decode_text(function_arguments); chan__nr.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_lookup_last_act("); trx__nr.log(); TTCN_Logger::log_event_str(", "); chan__nr.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__lookup__last__act(trx__nr, chan__nr); TTCN_Runtime::function_finished("f_lookup_last_act"); return TRUE; } else if (!strcmp(function_name, "f_last_act_table_init")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_last_act_table_init()."); TTCN_Runtime::function_started(function_arguments); f__last__act__table__init(); TTCN_Runtime::function_finished("f_last_act_table_init"); return TRUE; } else if (!strcmp(function_name, "f_trx_conn_map_init")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_trx_conn_map_init()."); TTCN_Runtime::function_started(function_arguments); f__trx__conn__map__init(); TTCN_Runtime::function_finished("f_trx_conn_map_init"); return TRUE; } else if (!strcmp(function_name, "f_trx_conn_map_register")) { INTEGER conn__id; IPA__Types::IpaCcmIdResp id__resp; conn__id.decode_text(function_arguments); id__resp.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_register("); conn__id.log(); TTCN_Logger::log_event_str(", "); id__resp.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__trx__conn__map__register(conn__id, id__resp); TTCN_Runtime::function_finished("f_trx_conn_map_register"); return TRUE; } else if (!strcmp(function_name, "f_trx_conn_map_unregister")) { INTEGER conn__id; conn__id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_unregister("); conn__id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__trx__conn__map__unregister(conn__id); TTCN_Runtime::function_finished("f_trx_conn_map_unregister"); return TRUE; } else if (!strcmp(function_name, "f_trx_conn_map_resolve")) { IPA__Types::IpaStreamId id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_trx_conn_map_resolve("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__trx__conn__map__resolve(id); TTCN_Runtime::function_finished("f_trx_conn_map_resolve"); return TRUE; } else if (!strcmp(function_name, "main")) { BOOLEAN bts__role; bts__role.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function main("); bts__role.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); main_(bts__role); TTCN_Runtime::function_finished("main"); return TRUE; } else if (!strcmp(function_name, "f_conn_table_init")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_conn_table_init()."); TTCN_Runtime::function_started(function_arguments); f__conn__table__init(); TTCN_Runtime::function_finished("f_conn_table_init"); return TRUE; } else if (!strcmp(function_name, "f_WaitingQueue_dispatch")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_WaitingQueue_dispatch()."); TTCN_Runtime::function_started(function_arguments); f__WaitingQueue__dispatch(); TTCN_Runtime::function_finished("f_WaitingQueue_dispatch"); return TRUE; } else return FALSE; } } /* end of namespace */