// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 9.0.0 // for (build@3978f7fbee0c) on Mon Jun 24 02:37:33 2024 // Copyright (c) 2000-2023 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "GTPv1U_CodecPort.hh" namespace GTPv1U__CodecPort { /* Literal string constants */ const unsigned char module_checksum[] = { 0x9c, 0x70, 0x01, 0x7e, 0xf8, 0x94, 0xbc, 0x21, 0x36, 0xa6, 0x3b, 0x41, 0xc8, 0x30, 0x06, 0x6d }; /* Global variable definitions */ const XERdescriptor_t Gtp1uPeer_connId_xer_ = { {"connId>\n", "connId>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t Gtp1uPeer_connId_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t Gtp1uPeer_connId_descr_ = { "@GTPv1U_CodecPort.Gtp1uPeer.connId", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Gtp1uPeer_connId_xer_, &INTEGER_json_, &Gtp1uPeer_connId_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t Gtp1uPeer_remName_xer_ = { {"remName>\n", "remName>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t Gtp1uPeer_remName_descr_ = { "@GTPv1U_CodecPort.Gtp1uPeer.remName", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &Gtp1uPeer_remName_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t Gtp1uPeer_remPort_xer_ = { {"remPort>\n", "remPort>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t Gtp1uPeer_remPort_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t Gtp1uPeer_remPort_descr_ = { "@GTPv1U_CodecPort.Gtp1uPeer.remPort", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Gtp1uPeer_remPort_xer_, &INTEGER_json_, &Gtp1uPeer_remPort_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for Gtp1uPeer const TTCN_Typedescriptor_t Gtp1uPeer_descr_ = { "@GTPv1U_CodecPort.Gtp1uPeer", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gtp1uUnitdata_gtpu_default_coding("RAW"); // No XER for Gtp1uUnitdata const TTCN_Typedescriptor_t Gtp1uUnitdata_descr_ = { "@GTPv1U_CodecPort.Gtp1uUnitdata", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; TTCN_Module module_object("GTPv1U_CodecPort", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_9, current_runtime_version.requires_minor_version_0, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Member functions of C++ classes */ Gtp1uPeer::Gtp1uPeer() { } Gtp1uPeer::Gtp1uPeer(const INTEGER& par_connId, const CHARSTRING& par_remName, const INTEGER& par_remPort) : field_connId(par_connId), field_remName(par_remName), field_remPort(par_remPort) { } Gtp1uPeer::Gtp1uPeer(const Gtp1uPeer& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GTPv1U_CodecPort.Gtp1uPeer."); if (other_value.connId().is_bound()) field_connId = other_value.connId(); else field_connId.clean_up(); if (other_value.remName().is_bound()) field_remName = other_value.remName(); else field_remName.clean_up(); if (other_value.remPort().is_bound()) field_remPort = other_value.remPort(); else field_remPort.clean_up(); } void Gtp1uPeer::clean_up() { field_connId.clean_up(); field_remName.clean_up(); field_remPort.clean_up(); } const TTCN_Typedescriptor_t* Gtp1uPeer::get_descriptor() const { return &Gtp1uPeer_descr_; } Gtp1uPeer& Gtp1uPeer::operator=(const Gtp1uPeer& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GTPv1U_CodecPort.Gtp1uPeer."); if (other_value.connId().is_bound()) field_connId = other_value.connId(); else field_connId.clean_up(); if (other_value.remName().is_bound()) field_remName = other_value.remName(); else field_remName.clean_up(); if (other_value.remPort().is_bound()) field_remPort = other_value.remPort(); else field_remPort.clean_up(); } return *this; } boolean Gtp1uPeer::operator==(const Gtp1uPeer& other_value) const { return field_connId==other_value.field_connId && field_remName==other_value.field_remName && field_remPort==other_value.field_remPort; } boolean Gtp1uPeer::is_bound() const { return (field_connId.is_bound()) || (field_remName.is_bound()) || (field_remPort.is_bound()); } boolean Gtp1uPeer::is_value() const { return field_connId.is_value() && field_remName.is_value() && field_remPort.is_value(); } void Gtp1uPeer::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ connId := "); field_connId.log(); TTCN_Logger::log_event_str(", remName := "); field_remName.log(); TTCN_Logger::log_event_str(", remPort := "); field_remPort.log(); TTCN_Logger::log_event_str(" }"); } void Gtp1uPeer::set_implicit_omit() { if (connId().is_bound()) connId().set_implicit_omit(); if (remName().is_bound()) remName().set_implicit_omit(); if (remPort().is_bound()) remPort().set_implicit_omit(); } void Gtp1uPeer::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) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remName().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remPort().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(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @GTPv1U_CodecPort.Gtp1uPeer: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@GTPv1U_CodecPort.Gtp1uPeer"); } } void Gtp1uPeer::encode_text(Text_Buf& text_buf) const { field_connId.encode_text(text_buf); field_remName.encode_text(text_buf); field_remPort.encode_text(text_buf); } void Gtp1uPeer::decode_text(Text_Buf& text_buf) { field_connId.decode_text(text_buf); field_remName.decode_text(text_buf); field_remPort.decode_text(text_buf); } struct Gtp1uPeer_template::single_value_struct { INTEGER_template field_connId; CHARSTRING_template field_remName; INTEGER_template field_remPort; }; void Gtp1uPeer_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_connId = ANY_VALUE; single_value->field_remName = ANY_VALUE; single_value->field_remPort = ANY_VALUE; } } } void Gtp1uPeer_template::copy_value(const Gtp1uPeer& other_value) { single_value = new single_value_struct; if (other_value.connId().is_bound()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (other_value.remName().is_bound()) { single_value->field_remName = other_value.remName(); } else { single_value->field_remName.clean_up(); } if (other_value.remPort().is_bound()) { single_value->field_remPort = other_value.remPort(); } else { single_value->field_remPort.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gtp1uPeer_template::copy_template(const Gtp1uPeer_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.connId().get_selection()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.remName().get_selection()) { single_value->field_remName = other_value.remName(); } else { single_value->field_remName.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.remPort().get_selection()) { single_value->field_remPort = other_value.remPort(); } else { single_value->field_remPort.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 Gtp1uPeer_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 Gtp1uPeer_template(*other_value.implication_.precondition); implication_.implied_template = new Gtp1uPeer_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 @GTPv1U_CodecPort.Gtp1uPeer."); break; } set_selection(other_value); } Gtp1uPeer_template::Gtp1uPeer_template() { } Gtp1uPeer_template::Gtp1uPeer_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gtp1uPeer_template::Gtp1uPeer_template(const Gtp1uPeer& other_value) { copy_value(other_value); } Gtp1uPeer_template::Gtp1uPeer_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gtp1uPeer&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @GTPv1U_CodecPort.Gtp1uPeer from an unbound optional field."); } } Gtp1uPeer_template::Gtp1uPeer_template(Gtp1uPeer_template* p_precondition, Gtp1uPeer_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gtp1uPeer_template::Gtp1uPeer_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; } Gtp1uPeer_template::Gtp1uPeer_template(const Gtp1uPeer_template& other_value) : Base_Template() { copy_template(other_value); } Gtp1uPeer_template::~Gtp1uPeer_template() { clean_up(); } Gtp1uPeer_template& Gtp1uPeer_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gtp1uPeer_template& Gtp1uPeer_template::operator=(const Gtp1uPeer& other_value) { clean_up(); copy_value(other_value); return *this; } Gtp1uPeer_template& Gtp1uPeer_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gtp1uPeer&)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 @GTPv1U_CodecPort.Gtp1uPeer."); } return *this; } Gtp1uPeer_template& Gtp1uPeer_template::operator=(const Gtp1uPeer_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gtp1uPeer_template::match(const Gtp1uPeer& 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.connId().is_bound()) return FALSE; if(!single_value->field_connId.match(other_value.connId(), legacy))return FALSE; if(!other_value.remName().is_bound()) return FALSE; if(!single_value->field_remName.match(other_value.remName(), legacy))return FALSE; if(!other_value.remPort().is_bound()) return FALSE; if(!single_value->field_remPort.match(other_value.remPort(), 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 @GTPv1U_CodecPort.Gtp1uPeer."); } return FALSE; } boolean Gtp1uPeer_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_connId.is_bound() || single_value->field_remName.is_bound() || single_value->field_remPort.is_bound(); } boolean Gtp1uPeer_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_connId.is_value() && single_value->field_remName.is_value() && single_value->field_remPort.is_value(); } void Gtp1uPeer_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; } Gtp1uPeer Gtp1uPeer_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 @GTPv1U_CodecPort.Gtp1uPeer."); Gtp1uPeer ret_val; if (single_value->field_connId.is_bound()) { ret_val.connId() = single_value->field_connId.valueof(); } if (single_value->field_remName.is_bound()) { ret_val.remName() = single_value->field_remName.valueof(); } if (single_value->field_remPort.is_bound()) { ret_val.remPort() = single_value->field_remPort.valueof(); } return ret_val; } void Gtp1uPeer_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 @GTPv1U_CodecPort.Gtp1uPeer."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gtp1uPeer_template[list_length]; } Gtp1uPeer_template& Gtp1uPeer_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 @GTPv1U_CodecPort.Gtp1uPeer."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @GTPv1U_CodecPort.Gtp1uPeer."); return value_list.list_value[list_index]; } INTEGER_template& Gtp1uPeer_template::connId() { set_specific(); return single_value->field_connId; } const INTEGER_template& Gtp1uPeer_template::connId() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field connId of a non-specific template of type @GTPv1U_CodecPort.Gtp1uPeer."); return single_value->field_connId; } CHARSTRING_template& Gtp1uPeer_template::remName() { set_specific(); return single_value->field_remName; } const CHARSTRING_template& Gtp1uPeer_template::remName() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field remName of a non-specific template of type @GTPv1U_CodecPort.Gtp1uPeer."); return single_value->field_remName; } INTEGER_template& Gtp1uPeer_template::remPort() { set_specific(); return single_value->field_remPort; } const INTEGER_template& Gtp1uPeer_template::remPort() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field remPort of a non-specific template of type @GTPv1U_CodecPort.Gtp1uPeer."); return single_value->field_remPort; } int Gtp1uPeer_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 3; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer 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 @GTPv1U_CodecPort.Gtp1uPeer containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uPeer containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @GTPv1U_CodecPort.Gtp1uPeer."); } return 0; } void Gtp1uPeer_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ connId := "); single_value->field_connId.log(); TTCN_Logger::log_event_str(", remName := "); single_value->field_remName.log(); TTCN_Logger::log_event_str(", remPort := "); single_value->field_remPort.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 Gtp1uPeer_template::log_match(const Gtp1uPeer& 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_connId.match(match_value.connId(), legacy)){ TTCN_Logger::log_logmatch_info(".connId"); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_remName.match(match_value.remName(), legacy)){ TTCN_Logger::log_logmatch_info(".remName"); single_value->field_remName.log_match(match_value.remName(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_remPort.match(match_value.remPort(), legacy)){ TTCN_Logger::log_logmatch_info(".remPort"); single_value->field_remPort.log_match(match_value.remPort(), 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("{ connId := "); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::log_event_str(", remName := "); single_value->field_remName.log_match(match_value.remName(), legacy); TTCN_Logger::log_event_str(", remPort := "); single_value->field_remPort.log_match(match_value.remPort(), 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 Gtp1uPeer_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_connId.encode_text(text_buf); single_value->field_remName.encode_text(text_buf); single_value->field_remPort.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 @GTPv1U_CodecPort.Gtp1uPeer."); } } void Gtp1uPeer_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_connId.decode_text(text_buf); single_value->field_remName.decode_text(text_buf); single_value->field_remPort.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 Gtp1uPeer_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 @GTPv1U_CodecPort.Gtp1uPeer."); } } void Gtp1uPeer_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: { Gtp1uPeer_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) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remName().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remPort().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(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @GTPv1U_CodecPort.Gtp1uPeer: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gtp1uPeer_template* precondition = new Gtp1uPeer_template; precondition->set_param(*param.get_elem(0)); Gtp1uPeer_template* implied_template = new Gtp1uPeer_template; implied_template->set_param(*param.get_elem(1)); *this = Gtp1uPeer_template(precondition, implied_template); } break; default: param.type_error("record template", "@GTPv1U_CodecPort.Gtp1uPeer"); } is_ifpresent = param.get_ifpresent(); } void Gtp1uPeer_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_connId.check_restriction(t_res, t_name ? t_name : "@GTPv1U_CodecPort.Gtp1uPeer"); single_value->field_remName.check_restriction(t_res, t_name ? t_name : "@GTPv1U_CodecPort.Gtp1uPeer"); single_value->field_remPort.check_restriction(t_res, t_name ? t_name : "@GTPv1U_CodecPort.Gtp1uPeer"); 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 : "@GTPv1U_CodecPort.Gtp1uPeer"); } boolean Gtp1uPeer_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gtp1uPeer_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) peer().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gtpu().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(), "peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtpu")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtpu().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @GTPv1U_CodecPort.Gtp1uUnitdata: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@GTPv1U_CodecPort.Gtp1uUnitdata"); } } void Gtp1uUnitdata::encode_text(Text_Buf& text_buf) const { field_peer.encode_text(text_buf); field_gtpu.encode_text(text_buf); } void Gtp1uUnitdata::decode_text(Text_Buf& text_buf) { field_peer.decode_text(text_buf); field_gtpu.decode_text(text_buf); } struct Gtp1uUnitdata_template::single_value_struct { Gtp1uPeer_template field_peer; GTPU__Types::PDU__GTPU_template field_gtpu; }; void Gtp1uUnitdata_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_peer = ANY_VALUE; single_value->field_gtpu = ANY_VALUE; } } } void Gtp1uUnitdata_template::copy_value(const Gtp1uUnitdata& other_value) { single_value = new single_value_struct; if (other_value.peer().is_bound()) { single_value->field_peer = other_value.peer(); } else { single_value->field_peer.clean_up(); } if (other_value.gtpu().is_bound()) { single_value->field_gtpu = other_value.gtpu(); } else { single_value->field_gtpu.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gtp1uUnitdata_template::copy_template(const Gtp1uUnitdata_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.peer().get_selection()) { single_value->field_peer = other_value.peer(); } else { single_value->field_peer.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtpu().get_selection()) { single_value->field_gtpu = other_value.gtpu(); } else { single_value->field_gtpu.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 Gtp1uUnitdata_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 Gtp1uUnitdata_template(*other_value.implication_.precondition); implication_.implied_template = new Gtp1uUnitdata_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 @GTPv1U_CodecPort.Gtp1uUnitdata."); break; } set_selection(other_value); } Gtp1uUnitdata_template::Gtp1uUnitdata_template() { } Gtp1uUnitdata_template::Gtp1uUnitdata_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gtp1uUnitdata_template::Gtp1uUnitdata_template(const Gtp1uUnitdata& other_value) { copy_value(other_value); } Gtp1uUnitdata_template::Gtp1uUnitdata_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gtp1uUnitdata&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @GTPv1U_CodecPort.Gtp1uUnitdata from an unbound optional field."); } } Gtp1uUnitdata_template::Gtp1uUnitdata_template(Gtp1uUnitdata_template* p_precondition, Gtp1uUnitdata_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gtp1uUnitdata_template::Gtp1uUnitdata_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; } Gtp1uUnitdata_template::Gtp1uUnitdata_template(const Gtp1uUnitdata_template& other_value) : Base_Template() { copy_template(other_value); } Gtp1uUnitdata_template::~Gtp1uUnitdata_template() { clean_up(); } Gtp1uUnitdata_template& Gtp1uUnitdata_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gtp1uUnitdata_template& Gtp1uUnitdata_template::operator=(const Gtp1uUnitdata& other_value) { clean_up(); copy_value(other_value); return *this; } Gtp1uUnitdata_template& Gtp1uUnitdata_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gtp1uUnitdata&)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 @GTPv1U_CodecPort.Gtp1uUnitdata."); } return *this; } Gtp1uUnitdata_template& Gtp1uUnitdata_template::operator=(const Gtp1uUnitdata_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gtp1uUnitdata_template::match(const Gtp1uUnitdata& 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.peer().is_bound()) return FALSE; if(!single_value->field_peer.match(other_value.peer(), legacy))return FALSE; if(!other_value.gtpu().is_bound()) return FALSE; if(!single_value->field_gtpu.match(other_value.gtpu(), 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 @GTPv1U_CodecPort.Gtp1uUnitdata."); } return FALSE; } boolean Gtp1uUnitdata_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_peer.is_bound() || single_value->field_gtpu.is_bound(); } boolean Gtp1uUnitdata_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_peer.is_value() && single_value->field_gtpu.is_value(); } void Gtp1uUnitdata_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; } Gtp1uUnitdata Gtp1uUnitdata_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 @GTPv1U_CodecPort.Gtp1uUnitdata."); Gtp1uUnitdata ret_val; if (single_value->field_peer.is_bound()) { ret_val.peer() = single_value->field_peer.valueof(); } if (single_value->field_gtpu.is_bound()) { ret_val.gtpu() = single_value->field_gtpu.valueof(); } return ret_val; } void Gtp1uUnitdata_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 @GTPv1U_CodecPort.Gtp1uUnitdata."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gtp1uUnitdata_template[list_length]; } Gtp1uUnitdata_template& Gtp1uUnitdata_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 @GTPv1U_CodecPort.Gtp1uUnitdata."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @GTPv1U_CodecPort.Gtp1uUnitdata."); return value_list.list_value[list_index]; } Gtp1uPeer_template& Gtp1uUnitdata_template::peer() { set_specific(); return single_value->field_peer; } const Gtp1uPeer_template& Gtp1uUnitdata_template::peer() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field peer of a non-specific template of type @GTPv1U_CodecPort.Gtp1uUnitdata."); return single_value->field_peer; } GTPU__Types::PDU__GTPU_template& Gtp1uUnitdata_template::gtpu() { set_specific(); return single_value->field_gtpu; } const GTPU__Types::PDU__GTPU_template& Gtp1uUnitdata_template::gtpu() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtpu of a non-specific template of type @GTPv1U_CodecPort.Gtp1uUnitdata."); return single_value->field_gtpu; } int Gtp1uUnitdata_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata 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 @GTPv1U_CodecPort.Gtp1uUnitdata 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 @GTPv1U_CodecPort.Gtp1uUnitdata containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @GTPv1U_CodecPort.Gtp1uUnitdata containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @GTPv1U_CodecPort.Gtp1uUnitdata."); } return 0; } void Gtp1uUnitdata_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ peer := "); single_value->field_peer.log(); TTCN_Logger::log_event_str(", gtpu := "); single_value->field_gtpu.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 Gtp1uUnitdata_template::log_match(const Gtp1uUnitdata& 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_peer.match(match_value.peer(), legacy)){ TTCN_Logger::log_logmatch_info(".peer"); single_value->field_peer.log_match(match_value.peer(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtpu.match(match_value.gtpu(), legacy)){ TTCN_Logger::log_logmatch_info(".gtpu"); single_value->field_gtpu.log_match(match_value.gtpu(), 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("{ peer := "); single_value->field_peer.log_match(match_value.peer(), legacy); TTCN_Logger::log_event_str(", gtpu := "); single_value->field_gtpu.log_match(match_value.gtpu(), 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 Gtp1uUnitdata_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_peer.encode_text(text_buf); single_value->field_gtpu.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 @GTPv1U_CodecPort.Gtp1uUnitdata."); } } void Gtp1uUnitdata_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_peer.decode_text(text_buf); single_value->field_gtpu.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 Gtp1uUnitdata_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 @GTPv1U_CodecPort.Gtp1uUnitdata."); } } void Gtp1uUnitdata_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: { Gtp1uUnitdata_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) peer().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gtpu().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(), "peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtpu")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtpu().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @GTPv1U_CodecPort.Gtp1uUnitdata: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gtp1uUnitdata_template* precondition = new Gtp1uUnitdata_template; precondition->set_param(*param.get_elem(0)); Gtp1uUnitdata_template* implied_template = new Gtp1uUnitdata_template; implied_template->set_param(*param.get_elem(1)); *this = Gtp1uUnitdata_template(precondition, implied_template); } break; default: param.type_error("record template", "@GTPv1U_CodecPort.Gtp1uUnitdata"); } is_ifpresent = param.get_ifpresent(); } void Gtp1uUnitdata_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_peer.check_restriction(t_res, t_name ? t_name : "@GTPv1U_CodecPort.Gtp1uUnitdata"); single_value->field_gtpu.check_restriction(t_res, t_name ? t_name : "@GTPv1U_CodecPort.Gtp1uUnitdata"); 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 : "@GTPv1U_CodecPort.Gtp1uUnitdata"); } boolean Gtp1uUnitdata_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gtp1uUnitdata_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 GTPU__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } GTPU__PT::GTPU__PT(const char *par_port_name) : IPL4asp__PortType::IPL4asp__PT_PROVIDER(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } GTPU__PT::~GTPU__PT() { clear_queue(); } void GTPU__PT::send(const Gtp1uUnitdata& 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(" @GTPv1U_CodecPort.Gtp1uUnitdata : "), send_par.log(), TTCN_Logger::end_event_log2str())); } IPL4asp__Types::ASP__SendTo mapped_par; f__enc__Gtp1uUD(send_par, mapped_par); if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALSEND)) { TTCN_Logger::log_dualport_map(0, "@IPL4asp_Types.ASP_SendTo", (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALSEND, TRUE), mapped_par.log(), TTCN_Logger::end_event_log2str()), 0); } if (destination_component == SYSTEM_COMPREF) outgoing_send(mapped_par); else { Text_Buf text_buf; prepare_message(text_buf, "@IPL4asp_Types.ASP_SendTo"); mapped_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void GTPU__PT::send(const Gtp1uUnitdata& send_par, FLOAT* timestamp_redirect) { send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void GTPU__PT::send(const Gtp1uUnitdata_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const Gtp1uUnitdata& send_par_value = Gtp1uUnitdata(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void GTPU__PT::send(const Gtp1uUnitdata_template& send_par, FLOAT* timestamp_redirect) { const Gtp1uUnitdata& send_par_value = Gtp1uUnitdata(send_par.valueof()); send(send_par_value, COMPONENT(get_default_destination()), timestamp_redirect); } PORT* GTPU__PT::get_provider_port() { (void)get_default_destination(); return this; } alt_status GTPU__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(": @GTPv1U_CodecPort.Gtp1uUnitdata: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), 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(": @Socket_API_Definitions.PortEvent: "), 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 GTPU__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(": @GTPv1U_CodecPort.Gtp1uUnitdata: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), 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(": @Socket_API_Definitions.PortEvent: "), 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 GTPU__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(": @GTPv1U_CodecPort.Gtp1uUnitdata: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), 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(": @Socket_API_Definitions.PortEvent: "), 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 GTPU__PT::receive(const Gtp1uUnitdata_template& value_template, Gtp1uUnitdata *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 @GTPv1U_CodecPort.Gtp1uUnitdata.", 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(": @GTPv1U_CodecPort.Gtp1uUnitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status GTPU__PT::check_receive(const Gtp1uUnitdata_template& value_template, Gtp1uUnitdata *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 @GTPv1U_CodecPort.Gtp1uUnitdata.", 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(": @GTPv1U_CodecPort.Gtp1uUnitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status GTPU__PT::trigger(const Gtp1uUnitdata_template& value_template, Gtp1uUnitdata *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 @GTPv1U_CodecPort.Gtp1uUnitdata.", 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(": @GTPv1U_CodecPort.Gtp1uUnitdata : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status GTPU__PT::receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status GTPU__PT::check_receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status GTPU__PT::trigger(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status GTPU__PT::receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_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 @Socket_API_Definitions.PortEvent.", 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status GTPU__PT::check_receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_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 @Socket_API_Definitions.PortEvent.", 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status GTPU__PT::trigger(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_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 @Socket_API_Definitions.PortEvent.", 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void GTPU__PT::incoming_message(const IPL4asp__Types::ASP__RecvFrom& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count+1, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @IPL4asp_Types.ASP_RecvFrom : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } Gtp1uUnitdata *mapped_par = new Gtp1uUnitdata; try { f__dec__Gtp1uUD(incoming_par, *mapped_par); } catch (...) { delete mapped_par; throw; } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALRECV)) { TTCN_Logger::log_dualport_map(1, "@GTPv1U_CodecPort.Gtp1uUnitdata", (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALRECV, TRUE), mapped_par->log(), TTCN_Logger::end_event_log2str()), msg_tail_count); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = mapped_par; new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void GTPU__PT::incoming_message(const Socket__API__Definitions::PortEvent& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @Socket_API_Definitions.PortEvent : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_2; new_item->message_2 = new Socket__API__Definitions::PortEvent(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void GTPU__PT::incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& 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(" @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), 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 IPL4asp__Types::ASP__ConnId__ReadyToRelease(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void GTPU__PT::incoming_message(const IPL4asp__Types::ASP__RecvFrom& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void GTPU__PT::incoming_message(const Socket__API__Definitions::PortEvent& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void GTPU__PT::incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } boolean GTPU__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@IPL4asp_Types.ASP_RecvFrom")) { IPL4asp__Types::ASP__RecvFrom incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@Socket_API_Definitions.PortEvent")) { Socket__API__Definitions::PortEvent incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@IPL4asp_Types.ASP_ConnId_ReadyToRelease")) { IPL4asp__Types::ASP__ConnId__ReadyToRelease incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } /* Bodies of functions, altsteps and testcases */ void f__enc__Gtp1uUD(const Gtp1uUnitdata& in__ud, IPL4asp__Types::ASP__SendTo& out__ud) { TTCN_Location current_location("GTPv1U_CodecPort.ttcn", 43, TTCN_Location::LOCATION_FUNCTION, "f_enc_Gtp1uUD"); out__ud.clean_up(); current_location.update_lineno(44); /* GTPv1U_CodecPort.ttcn, line 44 */ out__ud.connId() = const_cast< const Gtp1uUnitdata&>(in__ud).peer().connId(); current_location.update_lineno(45); /* GTPv1U_CodecPort.ttcn, line 45 */ out__ud.remName() = const_cast< const Gtp1uUnitdata&>(in__ud).peer().remName(); current_location.update_lineno(46); /* GTPv1U_CodecPort.ttcn, line 46 */ out__ud.remPort() = const_cast< const Gtp1uUnitdata&>(in__ud).peer().remPort(); current_location.update_lineno(47); /* GTPv1U_CodecPort.ttcn, line 47 */ { Socket__API__Definitions::ProtoTuple& tmp_4 = out__ud.proto(); /* 7388 */ tmp_4.udp() = NULL_VALUE; } current_location.update_lineno(48); /* GTPv1U_CodecPort.ttcn, line 48 */ out__ud.msg() = GTPU__Types::enc__PDU__GTPU(const_cast< const Gtp1uUnitdata&>(in__ud).gtpu()); } void f__dec__Gtp1uUD(const IPL4asp__Types::ASP__RecvFrom& in__ud, Gtp1uUnitdata& out__ud) { TTCN_Location current_location("GTPv1U_CodecPort.ttcn", 51, TTCN_Location::LOCATION_FUNCTION, "f_dec_Gtp1uUD"); out__ud.clean_up(); current_location.update_lineno(52); /* GTPv1U_CodecPort.ttcn, line 52 */ out__ud.peer().connId() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(in__ud).connId(); current_location.update_lineno(53); /* GTPv1U_CodecPort.ttcn, line 53 */ out__ud.peer().remName() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(in__ud).remName(); current_location.update_lineno(54); /* GTPv1U_CodecPort.ttcn, line 54 */ out__ud.peer().remPort() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(in__ud).remPort(); current_location.update_lineno(55); /* GTPv1U_CodecPort.ttcn, line 55 */ out__ud.gtpu() = GTPU__Types::dec__PDU__GTPU(const_cast< const IPL4asp__Types::ASP__RecvFrom&>(in__ud).msg()); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("GTPv1U_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "GTPv1U_CodecPort"); IPL4asp__PortType::module_object.pre_init_module(); GTPU__Types::module_object.pre_init_module(); Misc__Helpers::module_object.pre_init_module(); module_object.add_function("f_enc_Gtp1uUD", (genericfunc_t)&f__enc__Gtp1uUD, NULL); module_object.add_function("f_dec_Gtp1uUD", (genericfunc_t)&f__dec__Gtp1uUD, NULL); } void post_init_module() { TTCN_Location current_location("GTPv1U_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "GTPv1U_CodecPort"); IPL4asp__PortType::module_object.post_init_module(); GTPU__Types::module_object.post_init_module(); Misc__Helpers::module_object.post_init_module(); } } /* end of namespace */