// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 11.1.0 // The generation of user and time information were disabled by the -D flag. // Copyright (c) 2000-2025 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "RTP_Emulation.hh" namespace RTP__Emulation { /* Literal string constants */ const unsigned char bs_1_bits[] = { 0 }, bs_0_bits[] = { 123, 181, 125, 247 }; extern const BITSTRING bs_1(1, bs_1_bits), bs_0(32, bs_0_bits); const unsigned char os_0_octets[] = { 1, 2, 3, 4 }; extern const OCTETSTRING os_1(0, NULL), os_0(4, os_0_octets); extern const CHARSTRING cs_0(9, "Connected"); const unsigned char module_checksum[] = { 0x3b, 0x13, 0xca, 0xa8, 0xc1, 0x3a, 0xfe, 0x4b, 0xdf, 0xe7, 0x09, 0xee, 0xef, 0xaa, 0x01, 0xeb }; /* Global variable definitions */ const TTCN_Typedescriptor_t& RTP__Emulation__CT_descr_ = COMPONENT_descr_; RTP__CodecPort::RTP__CODEC__PT RTP__Emulation__CT_component_RTP("RTP"); INTEGER RTP__Emulation__CT_component_g__rtp__conn__id; RTP__CodecPort::RTP__CODEC__PT RTP__Emulation__CT_component_RTCP("RTCP"); INTEGER RTP__Emulation__CT_component_g__rtcp__conn__id; RTPEM__CTRL__PT RTP__Emulation__CT_component_CTRL("CTRL"); RTPEM__DATA__PT RTP__Emulation__CT_component_DATA("DATA"); const XERdescriptor_t RtpemConfig_tx__samplerate__hz_xer_ = { {"tx_samplerate_hz>\n", "tx_samplerate_hz>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemConfig_tx__samplerate__hz_descr_ = { "@RTP_Emulation.RtpemConfig.tx_samplerate_hz", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemConfig_tx__samplerate__hz_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemConfig_tx__duration__ms_xer_ = { {"tx_duration_ms>\n", "tx_duration_ms>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemConfig_tx__duration__ms_descr_ = { "@RTP_Emulation.RtpemConfig.tx_duration_ms", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemConfig_tx__duration__ms_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemConfig_tx__ssrc_xer_ = { {"tx_ssrc>\n", "tx_ssrc>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RtpemConfig_tx__ssrc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RtpemConfig_tx__ssrc_descr_ = { "@RTP_Emulation.RtpemConfig.tx_ssrc", &BITSTRING_ber_, &General__Types::BIT32__BO__LAST_raw_, NULL, &RtpemConfig_tx__ssrc_xer_, &BITSTRING_json_, &RtpemConfig_tx__ssrc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RtpemConfig_tx__ssrc_default_coding("RAW"); // No XER for RtpemConfig_tx__payloads const TTCN_Typedescriptor_t RtpemConfig_tx__payloads_descr_ = { "@RTP_Emulation.RtpemConfig.tx_payloads", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &RtpemConfigPayload_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemConfigPayload_payload__type_xer_ = { {"payload_type>\n", "payload_type>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RtpemConfigPayload_payload__type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RtpemConfigPayload_payload__type_descr_ = { "@RTP_Emulation.RtpemConfigPayload.payload_type", &INTEGER_ber_, &General__Types::INT7b_raw_, &INTEGER_text_, &RtpemConfigPayload_payload__type_xer_, &INTEGER_json_, &RtpemConfigPayload_payload__type_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RtpemConfigPayload_payload__type_default_coding("RAW"); // No XER for RtpemConfigPayload const TTCN_Typedescriptor_t RtpemConfigPayload_descr_ = { "@RTP_Emulation.RtpemConfigPayload", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemConfigPayload_fixed__payload_xer_ = { {"fixed_payload>\n", "fixed_payload>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int RtpemConfigPayload_fixed__payload_oer_ext_arr_[0] = {}; const int RtpemConfigPayload_fixed__payload_oer_p_[0] = {}; const TTCN_OERdescriptor_t RtpemConfigPayload_fixed__payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RtpemConfigPayload_fixed__payload_oer_ext_arr_, 0, RtpemConfigPayload_fixed__payload_oer_p_}; const TTCN_Typedescriptor_t RtpemConfigPayload_fixed__payload_descr_ = { "@RTP_Emulation.RtpemConfigPayload.fixed_payload", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &RtpemConfigPayload_fixed__payload_xer_, &OCTETSTRING_json_, &RtpemConfigPayload_fixed__payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for RtpemConfig_rx__payloads const TTCN_Typedescriptor_t RtpemConfig_rx__payloads_descr_ = { "@RTP_Emulation.RtpemConfig.rx_payloads", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &RtpemConfigPayload_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemConfig_iuup__mode_xer_ = { {"iuup_mode>\n", "iuup_mode>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int RtpemConfig_iuup__mode_oer_ext_arr_[0] = {}; const int RtpemConfig_iuup__mode_oer_p_[0] = {}; const TTCN_OERdescriptor_t RtpemConfig_iuup__mode_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RtpemConfig_iuup__mode_oer_ext_arr_, 0, RtpemConfig_iuup__mode_oer_p_}; const TTCN_Typedescriptor_t RtpemConfig_iuup__mode_descr_ = { "@RTP_Emulation.RtpemConfig.iuup_mode", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &RtpemConfig_iuup__mode_xer_, &BOOLEAN_json_, &RtpemConfig_iuup__mode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for RtpemConfig const TTCN_Typedescriptor_t RtpemConfig_descr_ = { "@RTP_Emulation.RtpemConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; RtpemConfig RTP__Emulation__CT_component_g__cfg; const XERdescriptor_t RtpemStats_num__pkts__tx_xer_ = { {"num_pkts_tx>\n", "num_pkts_tx>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__tx_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_tx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__tx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_bytes__payload__tx_xer_ = { {"bytes_payload_tx>\n", "bytes_payload_tx>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_bytes__payload__tx_descr_ = { "@RTP_Emulation.RtpemStats.bytes_payload_tx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_bytes__payload__tx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx_xer_ = { {"num_pkts_rx>\n", "num_pkts_rx>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_bytes__payload__rx_xer_ = { {"bytes_payload_rx>\n", "bytes_payload_rx>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_bytes__payload__rx_descr_ = { "@RTP_Emulation.RtpemStats.bytes_payload_rx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_bytes__payload__rx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx__err__seq_xer_ = { {"num_pkts_rx_err_seq>\n", "num_pkts_rx_err_seq>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx__err__seq_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx_err_seq", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx__err__seq_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx__err__ts_xer_ = { {"num_pkts_rx_err_ts>\n", "num_pkts_rx_err_ts>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx__err__ts_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx_err_ts", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx__err__ts_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx__err__pt_xer_ = { {"num_pkts_rx_err_pt>\n", "num_pkts_rx_err_pt>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx__err__pt_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx_err_pt", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx__err__pt_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx__err__disabled_xer_ = { {"num_pkts_rx_err_disabled>\n", "num_pkts_rx_err_disabled>\n"}, {26, 26}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx__err__disabled_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx_err_disabled", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx__err__disabled_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RtpemStats_num__pkts__rx__err__payload_xer_ = { {"num_pkts_rx_err_payload>\n", "num_pkts_rx_err_payload>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t RtpemStats_num__pkts__rx__err__payload_descr_ = { "@RTP_Emulation.RtpemStats.num_pkts_rx_err_payload", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &RtpemStats_num__pkts__rx__err__payload_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for RtpemStats const TTCN_Typedescriptor_t RtpemStats_descr_ = { "@RTP_Emulation.RtpemStats", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; RtpemStats RTP__Emulation__CT_component_g__stats__rtp; RtpemStats RTP__Emulation__CT_component_g__stats__rtcp; CHARSTRING RTP__Emulation__CT_component_g__remote__host; INTEGER RTP__Emulation__CT_component_g__remote__port; CHARSTRING RTP__Emulation__CT_component_g__local__host; INTEGER RTP__Emulation__CT_component_g__local__port; BOOLEAN RTP__Emulation__CT_component_g__loopback; BOOLEAN RTP__Emulation__CT_component_g__rx__enabled; BOOLEAN RTP__Emulation__CT_component_g__tx__connected; INTEGER RTP__Emulation__CT_component_g__tx__next__seq; INTEGER RTP__Emulation__CT_component_g__tx__next__ts; INTEGER RTP__Emulation__CT_component_g__rx__payload__type; INTEGER RTP__Emulation__CT_component_g__rx__last__seq; INTEGER RTP__Emulation__CT_component_g__rx__last__ts; IuUP__Emulation::IuUP__Entity RTP__Emulation__CT_component_g__iuup__ent; BOOLEAN RTP__Emulation__CT_component_g__conn__refuse__expect; BOOLEAN RTP__Emulation__CT_component_g__conn__refuse__received; // No XER for RtpemMode const TTCN_Typedescriptor_t RtpemMode_descr_ = { "@RTP_Emulation.RtpemMode", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; RtpemStats const_c__RtpemStatsReset; const RtpemStats& c__RtpemStatsReset = const_c__RtpemStatsReset; RtpemConfig const_c__RtpemDefaultCfg; const RtpemConfig& c__RtpemDefaultCfg = const_c__RtpemDefaultCfg; BOOLEAN const_f__rtpem__stats__get_rtcp_defval; const BOOLEAN& f__rtpem__stats__get_rtcp_defval = const_f__rtpem__stats__get_rtcp_defval; INTEGER const_f__rtpem__stats__compare__value_tolerance_defval; const INTEGER& f__rtpem__stats__compare__value_tolerance_defval = const_f__rtpem__stats__compare__value_tolerance_defval; INTEGER const_f__rtpem__stats__compare_tolerance_defval; const INTEGER& f__rtpem__stats__compare_tolerance_defval = const_f__rtpem__stats__compare_tolerance_defval; BITSTRING const_ts__RTP_marker_defval; const BITSTRING& ts__RTP_marker_defval = const_ts__RTP_marker_defval; BITSTRING const_f__tx__rtp_marker_defval; const BITSTRING& f__tx__rtp_marker_defval = const_f__tx__rtp_marker_defval; TTCN_Module module_object("RTP_Emulation", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_11, current_runtime_version.requires_minor_version_1, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Member functions of C++ classes */ const RtpemConfigPayload RtpemConfig_tx__payloads::UNBOUND_ELEM; RtpemConfig_tx__payloads::RtpemConfig_tx__payloads() { val_ptr = NULL; } RtpemConfig_tx__payloads::RtpemConfig_tx__payloads(null_type) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } RtpemConfig_tx__payloads::RtpemConfig_tx__payloads(const RtpemConfig_tx__payloads& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } RtpemConfig_tx__payloads::~RtpemConfig_tx__payloads() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void RtpemConfig_tx__payloads::clean_up() { if (val_ptr != NULL) { if (val_ptr->ref_count > 1) { val_ptr->ref_count--; val_ptr = NULL; } else if (val_ptr->ref_count == 1) { for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL) delete val_ptr->value_elements[elem_count]; free_pointers((void**)val_ptr->value_elements); delete val_ptr; val_ptr = NULL; } else TTCN_error("Internal error: Invalid reference counter in a record of/set of value."); } } RtpemConfig_tx__payloads& RtpemConfig_tx__payloads::operator=(null_type) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; return *this; } RtpemConfig_tx__payloads& RtpemConfig_tx__payloads::operator=(const RtpemConfig_tx__payloads& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean RtpemConfig_tx__payloads::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); return val_ptr->n_elements == 0 ; } boolean RtpemConfig_tx__payloads::operator==(const RtpemConfig_tx__payloads& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (val_ptr == other_value.val_ptr) return TRUE; if (val_ptr->n_elements != (other_value.val_ptr)->n_elements) return FALSE; for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ if ((other_value.val_ptr)->value_elements[elem_count] != NULL){ if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE; } else return FALSE; } else { if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE; } } return TRUE; } RtpemConfigPayload& RtpemConfig_tx__payloads::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RTP_Emulation.RtpemConfig.tx_payloads using a negative index: %d.", index_value); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements; new_val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new RtpemConfigPayload(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (index_value >= val_ptr->n_elements) set_size(index_value + 1); if (val_ptr->value_elements[index_value] == NULL) { val_ptr->value_elements[index_value] = new RtpemConfigPayload; } return *val_ptr->value_elements[index_value]; } RtpemConfigPayload& RtpemConfig_tx__payloads::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RTP_Emulation.RtpemConfig.tx_payloads."); return (*this)[(int)index_value]; } const RtpemConfigPayload& RtpemConfig_tx__payloads::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (index_value < 0) TTCN_error("Accessing an element of type @RTP_Emulation.RtpemConfig.tx_payloads using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RTP_Emulation.RtpemConfig.tx_payloads: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements); return (val_ptr->value_elements[index_value] == NULL) ? UNBOUND_ELEM : *val_ptr->value_elements[index_value]; } const RtpemConfigPayload& RtpemConfig_tx__payloads::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RTP_Emulation.RtpemConfig.tx_payloads."); return (*this)[(int)index_value]; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (val_ptr->n_elements == 0) return *this; int rc; if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements; else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements); if (rc == 0) return *this; RtpemConfig_tx__payloads ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new RtpemConfigPayload(*val_ptr->value_elements[i]); } } return ret_val; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::operator+(const RtpemConfig_tx__payloads& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RTP_Emulation.RtpemConfig.tx_payloads concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; RtpemConfig_tx__payloads ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new RtpemConfigPayload(*other_value.val_ptr->value_elements[i]); } } return ret_val; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RTP_Emulation.RtpemConfig.tx_payloads","element"); RtpemConfig_tx__payloads ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i+index]); } } return ret_val; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::replace(int index, int len, const RtpemConfig_tx__payloads& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); check_replace_arguments(val_ptr->n_elements, index, len, "@RTP_Emulation.RtpemConfig.tx_payloads","element"); RtpemConfig_tx__payloads ret_val; ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len); for (int i = 0; i < index; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i]); } } for (int i = 0; i < repl.val_ptr->n_elements; i++) { if (repl.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+index] = new RtpemConfigPayload(*repl.val_ptr->value_elements[i]); } } for (int i = 0; i < val_ptr->n_elements - index - len; i++) { if (val_ptr->value_elements[index+i+len] != NULL) { ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new RtpemConfigPayload(*val_ptr->value_elements[index+i+len]); } } return ret_val; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads::replace(int index, int len, const RtpemConfig_tx__payloads_template& repl) const { if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return replace(index, len, repl.valueof()); } void RtpemConfig_tx__payloads::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements; new_val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) { if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new RtpemConfigPayload(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (RtpemConfigPayload**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); #ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RTP_Emulation.RtpemConfig.tx_payloads: %d",new_size); #endif val_ptr->n_elements = new_size; } else if (new_size < val_ptr->n_elements) { for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count]; val_ptr->value_elements = (RtpemConfigPayload**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean RtpemConfig_tx__payloads::is_value() const { if (val_ptr == NULL) return FALSE; for(int i = 0; i < val_ptr->n_elements; ++i) { if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE; } return TRUE; } int RtpemConfig_tx__payloads::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); return val_ptr->n_elements; } int RtpemConfig_tx__payloads::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length; return 0; } void RtpemConfig_tx__payloads::log() const { if (val_ptr == NULL) {; TTCN_Logger::log_event_unbound(); return; } switch (val_ptr->n_elements) { case 0: TTCN_Logger::log_event_str("{ }"); break; default: TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); (*this)[elem_count].log(); } TTCN_Logger::log_event_str(" }"); } } void RtpemConfig_tx__payloads::set_implicit_omit() { if (val_ptr == NULL) return; for (int i = 0; i < val_ptr->n_elements; i++) { if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit(); } } void RtpemConfig_tx__payloads::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value"); switch (param.get_operation_type()) { case Module_Param::OT_ASSIGN: if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) { *this = NULL_VALUE; return; } switch (param.get_type()) { case Module_Param::MP_Value_List: set_size(param.get_size()); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed) { (*this)[i].set_param(*curr); if (!(*this)[i].is_bound()) { delete val_ptr->value_elements[i]; val_ptr->value_elements[i] = NULL; } } } break; case Module_Param::MP_Indexed_List: for (size_t i=0; iget_id()->get_index()].set_param(*curr); if (!(*this)[curr->get_id()->get_index()].is_bound()) { delete val_ptr->value_elements[curr->get_id()->get_index()]; val_ptr->value_elements[curr->get_id()->get_index()] = NULL; } } break; default: param.type_error("record of value", "@RTP_Emulation.RtpemConfig.tx_payloads"); } break; case Module_Param::OT_CONCAT: switch (param.get_type()) { case Module_Param::MP_Value_List: { if (!is_bound()) *this = NULL_VALUE; int start_idx = lengthof(); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed)) { (*this)[start_idx+(int)i].set_param(*curr); } } } break; case Module_Param::MP_Indexed_List: param.error("Cannot concatenate an indexed value list"); break; default: param.type_error("record of value", "@RTP_Emulation.RtpemConfig.tx_payloads"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void RtpemConfig_tx__payloads::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); text_buf.push_int(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) (*this)[elem_count].encode_text(text_buf); } void RtpemConfig_tx__payloads::decode_text(Text_Buf& text_buf) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = text_buf.pull_int().get_val(); if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RTP_Emulation.RtpemConfig.tx_payloads."); val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { val_ptr->value_elements[elem_count] = new RtpemConfigPayload; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void RtpemConfig_tx__payloads_template::copy_value(const RtpemConfig_tx__payloads& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RTP_Emulation.RtpemConfig.tx_payloads with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (other_value[elem_count].is_bound()) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } } set_selection(SPECIFIC_VALUE); } void RtpemConfig_tx__payloads_template::copy_template(const RtpemConfig_tx__payloads_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.n_elements = other_value.single_value.n_elements; single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new RtpemConfig_tx__payloads_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 RtpemConfig_tx__payloads_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemConfig_tx__payloads_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 @RTP_Emulation.RtpemConfig.tx_payloads."); break; } set_selection(other_value); } boolean RtpemConfig_tx__payloads_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy) { if (value_index >= 0) return ((const RtpemConfig_tx__payloads_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const RtpemConfig_tx__payloads*)value_ptr)[value_index], legacy); else return ((const RtpemConfig_tx__payloads_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template() { } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(const RtpemConfig_tx__payloads& other_value) { copy_value(other_value); } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig_tx__payloads&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RTP_Emulation.RtpemConfig.tx_payloads from an unbound optional field."); } } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(RtpemConfig_tx__payloads_template* p_precondition, RtpemConfig_tx__payloads_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(Dynamic_Match_Interface* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } RtpemConfig_tx__payloads_template::RtpemConfig_tx__payloads_template(const RtpemConfig_tx__payloads_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } RtpemConfig_tx__payloads_template::~RtpemConfig_tx__payloads_template() { clean_up(); } void RtpemConfig_tx__payloads_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; free_pointers((void**)single_value.value_elements); break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: delete [] value_list.list_value; break; case IMPLICATION_MATCH: delete implication_.precondition; delete implication_.implied_template; break; case DYNAMIC_MATCH: dyn_match->ref_count--; if (dyn_match->ref_count == 0) { delete dyn_match->ptr; delete dyn_match; } break; default: break; } template_selection = UNINITIALIZED_TEMPLATE; } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::operator=(const RtpemConfig_tx__payloads& other_value) { clean_up(); copy_value(other_value); return *this; } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig_tx__payloads&)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 @RTP_Emulation.RtpemConfig.tx_payloads."); } return *this; } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::operator=(const RtpemConfig_tx__payloads_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } RtpemConfigPayload_template& RtpemConfig_tx__payloads_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RTP_Emulation.RtpemConfig.tx_payloads using a negative index: %d.", index_value); switch (template_selection) { case SPECIFIC_VALUE: if(index_value < single_value.n_elements) break; // no break case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case UNINITIALIZED_TEMPLATE: set_size(index_value + 1); break; default: TTCN_error("Accessing an element of a non-specific template for type @RTP_Emulation.RtpemConfig.tx_payloads."); break; } return *single_value.value_elements[index_value]; } RtpemConfigPayload_template& RtpemConfig_tx__payloads_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); return (*this)[(int)index_value]; } const RtpemConfigPayload_template& RtpemConfig_tx__payloads_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RTP_Emulation.RtpemConfig.tx_payloads using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RTP_Emulation.RtpemConfig.tx_payloads."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RTP_Emulation.RtpemConfig.tx_payloads: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements); return *single_value.value_elements[index_value]; } const RtpemConfigPayload_template& RtpemConfig_tx__payloads_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); return (*this)[(int)index_value]; } void RtpemConfig_tx__payloads_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); template_sel old_selection = template_selection; if (old_selection != SPECIFIC_VALUE) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; } if (new_size > single_value.n_elements) { single_value.value_elements = (RtpemConfigPayload_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new RtpemConfigPayload_template(ANY_VALUE); } else { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } single_value.n_elements = new_size; } else if (new_size < single_value.n_elements) { for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; single_value.value_elements = (RtpemConfigPayload_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int RtpemConfig_tx__payloads_template::n_elem() const { switch (template_selection) { case SPECIFIC_VALUE: return single_value.n_elements; break; case VALUE_LIST: return value_list.n_values; break; default: TTCN_error("Performing n_elem"); } } int RtpemConfig_tx__payloads_template::size_of(boolean is_size) const { const char* op_name = is_size ? "size" : "length"; int min_size; boolean has_any_or_none; if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads which has an ifpresent attribute.", op_name); switch (template_selection) { case SPECIFIC_VALUE: { min_size = 0; has_any_or_none = FALSE; int elem_count = single_value.n_elements; if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; } for (int i=0; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads containing omit element.", op_name); case ANY_OR_OMIT: has_any_or_none = TRUE; break; default: min_size++; break; } } } break; case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads containing omit value.", op_name); case ANY_VALUE: case ANY_OR_OMIT: min_size = 0; has_any_or_none = TRUE; break; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads containing an empty list.", op_name); int item_size = value_list.list_value[0].size_of(is_size); for (unsigned int i = 1; i < value_list.n_values; i++) { if (value_list.list_value[i].size_of(is_size)!=item_size) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads containing a value list with different sizes.", op_name); } min_size = item_size; has_any_or_none = FALSE; break; } case COMPLEMENTED_LIST: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.tx_payloads containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.tx_payloads.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RTP_Emulation.RtpemConfig.tx_payloads"); } boolean RtpemConfig_tx__payloads_template::match(const RtpemConfig_tx__payloads& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; int value_length = other_value.size_of(); if (!match_length(value_length)) return FALSE; switch (template_selection) { case SPECIFIC_VALUE: return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy); case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching with an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.tx_payloads."); } return FALSE; } boolean RtpemConfig_tx__payloads_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (!single_value.value_elements[elem_count]->is_value()) return FALSE; return TRUE; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads_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 @RTP_Emulation.RtpemConfig.tx_payloads."); RtpemConfig_tx__payloads ret_val; ret_val.set_size(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (single_value.value_elements[elem_count]->is_bound()) { ret_val[elem_count] = single_value.value_elements[elem_count]->valueof(); } return ret_val; } RtpemConfig_tx__payloads RtpemConfig_tx__payloads_template::substr(int index, int returncount) const { if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value."); return valueof().substr(index, returncount); } RtpemConfig_tx__payloads RtpemConfig_tx__payloads_template::replace(int index, int len, const RtpemConfig_tx__payloads_template& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl.valueof()); } RtpemConfig_tx__payloads RtpemConfig_tx__payloads_template::replace(int index, int len, const RtpemConfig_tx__payloads& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl); } void RtpemConfig_tx__payloads_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = list_length; value_list.list_value = new RtpemConfig_tx__payloads_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); } set_selection(template_type); } RtpemConfig_tx__payloads_template& RtpemConfig_tx__payloads_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RTP_Emulation.RtpemConfig.tx_payloads."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RTP_Emulation.RtpemConfig.tx_payloads."); return value_list.list_value[list_index]; } void RtpemConfig_tx__payloads_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: if (single_value.n_elements > 0) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation("); single_value.value_elements[elem_count]->log(); if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')'); } TTCN_Logger::log_event_str(" }"); } else TTCN_Logger::log_event_str("{ }"); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) { if (list_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[list_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_restricted(); log_ifpresent(); } void RtpemConfig_tx__payloads_template::log_match(const RtpemConfig_tx__payloads& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); }else{ if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){ TTCN_Logger::log_logmatch_info("[%d]", elem_count); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } log_match_length(single_value.n_elements); } else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); } TTCN_Logger::log_event_str(" }"); log_match_length(single_value.n_elements); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void RtpemConfig_tx__payloads_template::encode_text(Text_Buf& text_buf) const { encode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) single_value.value_elements[elem_count]->encode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.tx_payloads."); } } void RtpemConfig_tx__payloads_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value.n_elements = text_buf.pull_int().get_val(); if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; single_value.value_elements[elem_count]->decode_text(text_buf); } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new RtpemConfig_tx__payloads_template[value_list.n_values]; for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @RTP_Emulation.RtpemConfig.tx_payloads."); } } boolean RtpemConfig_tx__payloads_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemConfig_tx__payloads_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iset_implicit_omit(); } } void RtpemConfig_tx__payloads_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template"); switch (param.get_type()) { case Module_Param::MP_Omit: *this = OMIT_VALUE; break; case Module_Param::MP_Any: *this = ANY_VALUE; break; case Module_Param::MP_AnyOrNone: *this = ANY_OR_OMIT; break; case Module_Param::MP_List_Template: case Module_Param::MP_ComplementList_Template: case Module_Param::MP_ConjunctList_Template: { RtpemConfig_tx__payloads_template temp; temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { RtpemConfig_tx__payloads_template* precondition = new RtpemConfig_tx__payloads_template; precondition->set_param(*param.get_elem(0)); RtpemConfig_tx__payloads_template* implied_template = new RtpemConfig_tx__payloads_template; implied_template->set_param(*param.get_elem(1)); *this = RtpemConfig_tx__payloads_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RTP_Emulation.RtpemConfig.tx_payloads"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void RtpemConfig_tx__payloads_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; for (int i=0; icheck_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig.tx_payloads"); 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 : "@RTP_Emulation.RtpemConfig.tx_payloads"); } boolean RtpemConfig_tx__payloads_template::get_istemplate_kind(const char* type) const { if (!strcmp(type, "AnyElement")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_VALUE) { return TRUE; } } return FALSE; } else if (!strcmp(type, "AnyElementsOrNone")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) { return TRUE; } } return FALSE; } else if (!strcmp(type, "permutation")) { return number_of_permutations; } else if (!strcmp(type, "length")) { return length_restriction_type != NO_LENGTH_RESTRICTION; } else { return Base_Template::get_istemplate_kind(type); } } RtpemConfigPayload::RtpemConfigPayload() { } RtpemConfigPayload::RtpemConfigPayload(const INTEGER& par_payload__type, const OPTIONAL< OCTETSTRING >& par_fixed__payload) : field_payload__type(par_payload__type), field_fixed__payload(par_fixed__payload) { } RtpemConfigPayload::RtpemConfigPayload(const RtpemConfigPayload& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RTP_Emulation.RtpemConfigPayload."); if (other_value.payload__type().is_bound()) field_payload__type = other_value.payload__type(); else field_payload__type.clean_up(); if (other_value.fixed__payload().is_bound()) field_fixed__payload = other_value.fixed__payload(); else field_fixed__payload.clean_up(); } void RtpemConfigPayload::clean_up() { field_payload__type.clean_up(); field_fixed__payload.clean_up(); } const TTCN_Typedescriptor_t* RtpemConfigPayload::get_descriptor() const { return &RtpemConfigPayload_descr_; } RtpemConfigPayload& RtpemConfigPayload::operator=(const RtpemConfigPayload& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RTP_Emulation.RtpemConfigPayload."); if (other_value.payload__type().is_bound()) field_payload__type = other_value.payload__type(); else field_payload__type.clean_up(); if (other_value.fixed__payload().is_bound()) field_fixed__payload = other_value.fixed__payload(); else field_fixed__payload.clean_up(); } return *this; } boolean RtpemConfigPayload::operator==(const RtpemConfigPayload& other_value) const { return field_payload__type==other_value.field_payload__type && field_fixed__payload==other_value.field_fixed__payload; } boolean RtpemConfigPayload::is_bound() const { return (field_payload__type.is_bound()) || (OPTIONAL_OMIT == field_fixed__payload.get_selection() || field_fixed__payload.is_bound()); } boolean RtpemConfigPayload::is_value() const { return field_payload__type.is_value() && (OPTIONAL_OMIT == field_fixed__payload.get_selection() || field_fixed__payload.is_value()); } int RtpemConfigPayload::size_of() const { int ret_val = 1; if (field_fixed__payload.ispresent()) ret_val++; return ret_val; } void RtpemConfigPayload::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ payload_type := "); field_payload__type.log(); TTCN_Logger::log_event_str(", fixed_payload := "); field_fixed__payload.log(); TTCN_Logger::log_event_str(" }"); } void RtpemConfigPayload::set_implicit_omit() { if (payload__type().is_bound()) payload__type().set_implicit_omit(); if (!fixed__payload().is_bound()) fixed__payload() = OMIT_VALUE; else fixed__payload().set_implicit_omit(); } void RtpemConfigPayload::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) payload__type().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fixed__payload().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(), "payload_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { payload__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fixed_payload")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fixed__payload().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemConfigPayload: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RTP_Emulation.RtpemConfigPayload"); } } void RtpemConfigPayload::encode_text(Text_Buf& text_buf) const { field_payload__type.encode_text(text_buf); field_fixed__payload.encode_text(text_buf); } void RtpemConfigPayload::decode_text(Text_Buf& text_buf) { field_payload__type.decode_text(text_buf); field_fixed__payload.decode_text(text_buf); } struct RtpemConfigPayload_template::single_value_struct { INTEGER_template field_payload__type; OCTETSTRING_template field_fixed__payload; }; void RtpemConfigPayload_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_payload__type = ANY_VALUE; single_value->field_fixed__payload = ANY_OR_OMIT; } } } void RtpemConfigPayload_template::copy_value(const RtpemConfigPayload& other_value) { single_value = new single_value_struct; if (other_value.payload__type().is_bound()) { single_value->field_payload__type = other_value.payload__type(); } else { single_value->field_payload__type.clean_up(); } if (other_value.fixed__payload().is_bound()) { if (other_value.fixed__payload().ispresent()) single_value->field_fixed__payload = other_value.fixed__payload()(); else single_value->field_fixed__payload = OMIT_VALUE; } else { single_value->field_fixed__payload.clean_up(); } set_selection(SPECIFIC_VALUE); } void RtpemConfigPayload_template::copy_template(const RtpemConfigPayload_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.payload__type().get_selection()) { single_value->field_payload__type = other_value.payload__type(); } else { single_value->field_payload__type.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fixed__payload().get_selection()) { single_value->field_fixed__payload = other_value.fixed__payload(); } else { single_value->field_fixed__payload.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 RtpemConfigPayload_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 RtpemConfigPayload_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemConfigPayload_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 @RTP_Emulation.RtpemConfigPayload."); break; } set_selection(other_value); } RtpemConfigPayload_template::RtpemConfigPayload_template() { } RtpemConfigPayload_template::RtpemConfigPayload_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RtpemConfigPayload_template::RtpemConfigPayload_template(const RtpemConfigPayload& other_value) { copy_value(other_value); } RtpemConfigPayload_template::RtpemConfigPayload_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfigPayload&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RTP_Emulation.RtpemConfigPayload from an unbound optional field."); } } RtpemConfigPayload_template::RtpemConfigPayload_template(RtpemConfigPayload_template* p_precondition, RtpemConfigPayload_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemConfigPayload_template::RtpemConfigPayload_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; } RtpemConfigPayload_template::RtpemConfigPayload_template(const RtpemConfigPayload_template& other_value) : Base_Template() { copy_template(other_value); } RtpemConfigPayload_template::~RtpemConfigPayload_template() { clean_up(); } RtpemConfigPayload_template& RtpemConfigPayload_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemConfigPayload_template& RtpemConfigPayload_template::operator=(const RtpemConfigPayload& other_value) { clean_up(); copy_value(other_value); return *this; } RtpemConfigPayload_template& RtpemConfigPayload_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfigPayload&)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 @RTP_Emulation.RtpemConfigPayload."); } return *this; } RtpemConfigPayload_template& RtpemConfigPayload_template::operator=(const RtpemConfigPayload_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RtpemConfigPayload_template::match(const RtpemConfigPayload& 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.payload__type().is_bound()) return FALSE; if(!single_value->field_payload__type.match(other_value.payload__type(), legacy))return FALSE; if(!other_value.fixed__payload().is_bound()) return FALSE; if((other_value.fixed__payload().ispresent() ? !single_value->field_fixed__payload.match((const OCTETSTRING&)other_value.fixed__payload(), legacy) : !single_value->field_fixed__payload.match_omit(legacy)))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfigPayload."); } return FALSE; } boolean RtpemConfigPayload_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_payload__type.is_bound() || (single_value->field_fixed__payload.is_omit() || single_value->field_fixed__payload.is_bound()); } boolean RtpemConfigPayload_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_payload__type.is_value() && (single_value->field_fixed__payload.is_omit() || single_value->field_fixed__payload.is_value()); } void RtpemConfigPayload_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; } RtpemConfigPayload RtpemConfigPayload_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 @RTP_Emulation.RtpemConfigPayload."); RtpemConfigPayload ret_val; if (single_value->field_payload__type.is_bound()) { ret_val.payload__type() = single_value->field_payload__type.valueof(); } if (single_value->field_fixed__payload.is_omit()) ret_val.fixed__payload() = OMIT_VALUE; else if (single_value->field_fixed__payload.is_bound()) { ret_val.fixed__payload() = single_value->field_fixed__payload.valueof(); } return ret_val; } void RtpemConfigPayload_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 @RTP_Emulation.RtpemConfigPayload."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RtpemConfigPayload_template[list_length]; } RtpemConfigPayload_template& RtpemConfigPayload_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 @RTP_Emulation.RtpemConfigPayload."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RTP_Emulation.RtpemConfigPayload."); return value_list.list_value[list_index]; } INTEGER_template& RtpemConfigPayload_template::payload__type() { set_specific(); return single_value->field_payload__type; } const INTEGER_template& RtpemConfigPayload_template::payload__type() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field payload_type of a non-specific template of type @RTP_Emulation.RtpemConfigPayload."); return single_value->field_payload__type; } OCTETSTRING_template& RtpemConfigPayload_template::fixed__payload() { set_specific(); return single_value->field_fixed__payload; } const OCTETSTRING_template& RtpemConfigPayload_template::fixed__payload() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fixed_payload of a non-specific template of type @RTP_Emulation.RtpemConfigPayload."); return single_value->field_fixed__payload; } int RtpemConfigPayload_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_fixed__payload.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload 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 @RTP_Emulation.RtpemConfigPayload containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfigPayload containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfigPayload."); } return 0; } void RtpemConfigPayload_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ payload_type := "); single_value->field_payload__type.log(); TTCN_Logger::log_event_str(", fixed_payload := "); single_value->field_fixed__payload.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 RtpemConfigPayload_template::log_match(const RtpemConfigPayload& 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_payload__type.match(match_value.payload__type(), legacy)){ TTCN_Logger::log_logmatch_info(".payload_type"); single_value->field_payload__type.log_match(match_value.payload__type(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.fixed__payload().ispresent()){ if(!single_value->field_fixed__payload.match(match_value.fixed__payload(), legacy)){ TTCN_Logger::log_logmatch_info(".fixed_payload"); single_value->field_fixed__payload.log_match(match_value.fixed__payload(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_fixed__payload.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".fixed_payload := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_fixed__payload.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ payload_type := "); single_value->field_payload__type.log_match(match_value.payload__type(), legacy); TTCN_Logger::log_event_str(", fixed_payload := "); if (match_value.fixed__payload().ispresent()) { single_value->field_fixed__payload.log_match(match_value.fixed__payload(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_fixed__payload.log(); if (single_value->field_fixed__payload.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void RtpemConfigPayload_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (payload__type().is_bound()) payload__type().set_implicit_omit(); if (!fixed__payload().is_bound()) fixed__payload() = OMIT_VALUE; else fixed__payload().set_implicit_omit(); } void RtpemConfigPayload_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_payload__type.encode_text(text_buf); single_value->field_fixed__payload.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 @RTP_Emulation.RtpemConfigPayload."); } } void RtpemConfigPayload_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_payload__type.decode_text(text_buf); single_value->field_fixed__payload.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 RtpemConfigPayload_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 @RTP_Emulation.RtpemConfigPayload."); } } void RtpemConfigPayload_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: { RtpemConfigPayload_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) payload__type().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fixed__payload().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(), "payload_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { payload__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fixed_payload")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fixed__payload().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemConfigPayload: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RtpemConfigPayload_template* precondition = new RtpemConfigPayload_template; precondition->set_param(*param.get_elem(0)); RtpemConfigPayload_template* implied_template = new RtpemConfigPayload_template; implied_template->set_param(*param.get_elem(1)); *this = RtpemConfigPayload_template(precondition, implied_template); } break; default: param.type_error("record template", "@RTP_Emulation.RtpemConfigPayload"); } is_ifpresent = param.get_ifpresent(); } void RtpemConfigPayload_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_payload__type.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfigPayload"); single_value->field_fixed__payload.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfigPayload"); 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 : "@RTP_Emulation.RtpemConfigPayload"); } boolean RtpemConfigPayload_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemConfigPayload_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idxref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } RtpemConfig_rx__payloads::RtpemConfig_rx__payloads(const RtpemConfig_rx__payloads& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } RtpemConfig_rx__payloads::~RtpemConfig_rx__payloads() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void RtpemConfig_rx__payloads::clean_up() { if (val_ptr != NULL) { if (val_ptr->ref_count > 1) { val_ptr->ref_count--; val_ptr = NULL; } else if (val_ptr->ref_count == 1) { for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL) delete val_ptr->value_elements[elem_count]; free_pointers((void**)val_ptr->value_elements); delete val_ptr; val_ptr = NULL; } else TTCN_error("Internal error: Invalid reference counter in a record of/set of value."); } } RtpemConfig_rx__payloads& RtpemConfig_rx__payloads::operator=(null_type) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; return *this; } RtpemConfig_rx__payloads& RtpemConfig_rx__payloads::operator=(const RtpemConfig_rx__payloads& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean RtpemConfig_rx__payloads::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); return val_ptr->n_elements == 0 ; } boolean RtpemConfig_rx__payloads::operator==(const RtpemConfig_rx__payloads& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (val_ptr == other_value.val_ptr) return TRUE; if (val_ptr->n_elements != (other_value.val_ptr)->n_elements) return FALSE; for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ if ((other_value.val_ptr)->value_elements[elem_count] != NULL){ if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE; } else return FALSE; } else { if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE; } } return TRUE; } RtpemConfigPayload& RtpemConfig_rx__payloads::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RTP_Emulation.RtpemConfig.rx_payloads using a negative index: %d.", index_value); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements; new_val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new RtpemConfigPayload(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (index_value >= val_ptr->n_elements) set_size(index_value + 1); if (val_ptr->value_elements[index_value] == NULL) { val_ptr->value_elements[index_value] = new RtpemConfigPayload; } return *val_ptr->value_elements[index_value]; } RtpemConfigPayload& RtpemConfig_rx__payloads::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RTP_Emulation.RtpemConfig.rx_payloads."); return (*this)[(int)index_value]; } const RtpemConfigPayload& RtpemConfig_rx__payloads::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (index_value < 0) TTCN_error("Accessing an element of type @RTP_Emulation.RtpemConfig.rx_payloads using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RTP_Emulation.RtpemConfig.rx_payloads: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements); return (val_ptr->value_elements[index_value] == NULL) ? UNBOUND_ELEM : *val_ptr->value_elements[index_value]; } const RtpemConfigPayload& RtpemConfig_rx__payloads::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RTP_Emulation.RtpemConfig.rx_payloads."); return (*this)[(int)index_value]; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (val_ptr->n_elements == 0) return *this; int rc; if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements; else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements); if (rc == 0) return *this; RtpemConfig_rx__payloads ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new RtpemConfigPayload(*val_ptr->value_elements[i]); } } return ret_val; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::operator+(const RtpemConfig_rx__payloads& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RTP_Emulation.RtpemConfig.rx_payloads concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; RtpemConfig_rx__payloads ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new RtpemConfigPayload(*other_value.val_ptr->value_elements[i]); } } return ret_val; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RTP_Emulation.RtpemConfig.rx_payloads","element"); RtpemConfig_rx__payloads ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i+index]); } } return ret_val; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::replace(int index, int len, const RtpemConfig_rx__payloads& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); check_replace_arguments(val_ptr->n_elements, index, len, "@RTP_Emulation.RtpemConfig.rx_payloads","element"); RtpemConfig_rx__payloads ret_val; ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len); for (int i = 0; i < index; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new RtpemConfigPayload(*val_ptr->value_elements[i]); } } for (int i = 0; i < repl.val_ptr->n_elements; i++) { if (repl.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+index] = new RtpemConfigPayload(*repl.val_ptr->value_elements[i]); } } for (int i = 0; i < val_ptr->n_elements - index - len; i++) { if (val_ptr->value_elements[index+i+len] != NULL) { ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new RtpemConfigPayload(*val_ptr->value_elements[index+i+len]); } } return ret_val; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads::replace(int index, int len, const RtpemConfig_rx__payloads_template& repl) const { if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return replace(index, len, repl.valueof()); } void RtpemConfig_rx__payloads::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements; new_val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) { if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new RtpemConfigPayload(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (RtpemConfigPayload**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); #ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RTP_Emulation.RtpemConfig.rx_payloads: %d",new_size); #endif val_ptr->n_elements = new_size; } else if (new_size < val_ptr->n_elements) { for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count]; val_ptr->value_elements = (RtpemConfigPayload**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean RtpemConfig_rx__payloads::is_value() const { if (val_ptr == NULL) return FALSE; for(int i = 0; i < val_ptr->n_elements; ++i) { if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE; } return TRUE; } int RtpemConfig_rx__payloads::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); return val_ptr->n_elements; } int RtpemConfig_rx__payloads::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length; return 0; } void RtpemConfig_rx__payloads::log() const { if (val_ptr == NULL) {; TTCN_Logger::log_event_unbound(); return; } switch (val_ptr->n_elements) { case 0: TTCN_Logger::log_event_str("{ }"); break; default: TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); (*this)[elem_count].log(); } TTCN_Logger::log_event_str(" }"); } } void RtpemConfig_rx__payloads::set_implicit_omit() { if (val_ptr == NULL) return; for (int i = 0; i < val_ptr->n_elements; i++) { if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit(); } } void RtpemConfig_rx__payloads::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value"); switch (param.get_operation_type()) { case Module_Param::OT_ASSIGN: if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) { *this = NULL_VALUE; return; } switch (param.get_type()) { case Module_Param::MP_Value_List: set_size(param.get_size()); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed) { (*this)[i].set_param(*curr); if (!(*this)[i].is_bound()) { delete val_ptr->value_elements[i]; val_ptr->value_elements[i] = NULL; } } } break; case Module_Param::MP_Indexed_List: for (size_t i=0; iget_id()->get_index()].set_param(*curr); if (!(*this)[curr->get_id()->get_index()].is_bound()) { delete val_ptr->value_elements[curr->get_id()->get_index()]; val_ptr->value_elements[curr->get_id()->get_index()] = NULL; } } break; default: param.type_error("record of value", "@RTP_Emulation.RtpemConfig.rx_payloads"); } break; case Module_Param::OT_CONCAT: switch (param.get_type()) { case Module_Param::MP_Value_List: { if (!is_bound()) *this = NULL_VALUE; int start_idx = lengthof(); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed)) { (*this)[start_idx+(int)i].set_param(*curr); } } } break; case Module_Param::MP_Indexed_List: param.error("Cannot concatenate an indexed value list"); break; default: param.type_error("record of value", "@RTP_Emulation.RtpemConfig.rx_payloads"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void RtpemConfig_rx__payloads::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); text_buf.push_int(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) (*this)[elem_count].encode_text(text_buf); } void RtpemConfig_rx__payloads::decode_text(Text_Buf& text_buf) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = text_buf.pull_int().get_val(); if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RTP_Emulation.RtpemConfig.rx_payloads."); val_ptr->value_elements = (RtpemConfigPayload**)allocate_pointers(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { val_ptr->value_elements[elem_count] = new RtpemConfigPayload; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void RtpemConfig_rx__payloads_template::copy_value(const RtpemConfig_rx__payloads& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RTP_Emulation.RtpemConfig.rx_payloads with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (other_value[elem_count].is_bound()) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } } set_selection(SPECIFIC_VALUE); } void RtpemConfig_rx__payloads_template::copy_template(const RtpemConfig_rx__payloads_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.n_elements = other_value.single_value.n_elements; single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new RtpemConfig_rx__payloads_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 RtpemConfig_rx__payloads_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemConfig_rx__payloads_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 @RTP_Emulation.RtpemConfig.rx_payloads."); break; } set_selection(other_value); } boolean RtpemConfig_rx__payloads_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy) { if (value_index >= 0) return ((const RtpemConfig_rx__payloads_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const RtpemConfig_rx__payloads*)value_ptr)[value_index], legacy); else return ((const RtpemConfig_rx__payloads_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template() { } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(const RtpemConfig_rx__payloads& other_value) { copy_value(other_value); } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig_rx__payloads&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RTP_Emulation.RtpemConfig.rx_payloads from an unbound optional field."); } } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(RtpemConfig_rx__payloads_template* p_precondition, RtpemConfig_rx__payloads_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(Dynamic_Match_Interface* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } RtpemConfig_rx__payloads_template::RtpemConfig_rx__payloads_template(const RtpemConfig_rx__payloads_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } RtpemConfig_rx__payloads_template::~RtpemConfig_rx__payloads_template() { clean_up(); } void RtpemConfig_rx__payloads_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; free_pointers((void**)single_value.value_elements); break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: delete [] value_list.list_value; break; case IMPLICATION_MATCH: delete implication_.precondition; delete implication_.implied_template; break; case DYNAMIC_MATCH: dyn_match->ref_count--; if (dyn_match->ref_count == 0) { delete dyn_match->ptr; delete dyn_match; } break; default: break; } template_selection = UNINITIALIZED_TEMPLATE; } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::operator=(const RtpemConfig_rx__payloads& other_value) { clean_up(); copy_value(other_value); return *this; } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig_rx__payloads&)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 @RTP_Emulation.RtpemConfig.rx_payloads."); } return *this; } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::operator=(const RtpemConfig_rx__payloads_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } RtpemConfigPayload_template& RtpemConfig_rx__payloads_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RTP_Emulation.RtpemConfig.rx_payloads using a negative index: %d.", index_value); switch (template_selection) { case SPECIFIC_VALUE: if(index_value < single_value.n_elements) break; // no break case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case UNINITIALIZED_TEMPLATE: set_size(index_value + 1); break; default: TTCN_error("Accessing an element of a non-specific template for type @RTP_Emulation.RtpemConfig.rx_payloads."); break; } return *single_value.value_elements[index_value]; } RtpemConfigPayload_template& RtpemConfig_rx__payloads_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); return (*this)[(int)index_value]; } const RtpemConfigPayload_template& RtpemConfig_rx__payloads_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RTP_Emulation.RtpemConfig.rx_payloads using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RTP_Emulation.RtpemConfig.rx_payloads."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RTP_Emulation.RtpemConfig.rx_payloads: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements); return *single_value.value_elements[index_value]; } const RtpemConfigPayload_template& RtpemConfig_rx__payloads_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); return (*this)[(int)index_value]; } void RtpemConfig_rx__payloads_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); template_sel old_selection = template_selection; if (old_selection != SPECIFIC_VALUE) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; } if (new_size > single_value.n_elements) { single_value.value_elements = (RtpemConfigPayload_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new RtpemConfigPayload_template(ANY_VALUE); } else { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new RtpemConfigPayload_template; } single_value.n_elements = new_size; } else if (new_size < single_value.n_elements) { for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; single_value.value_elements = (RtpemConfigPayload_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int RtpemConfig_rx__payloads_template::n_elem() const { switch (template_selection) { case SPECIFIC_VALUE: return single_value.n_elements; break; case VALUE_LIST: return value_list.n_values; break; default: TTCN_error("Performing n_elem"); } } int RtpemConfig_rx__payloads_template::size_of(boolean is_size) const { const char* op_name = is_size ? "size" : "length"; int min_size; boolean has_any_or_none; if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads which has an ifpresent attribute.", op_name); switch (template_selection) { case SPECIFIC_VALUE: { min_size = 0; has_any_or_none = FALSE; int elem_count = single_value.n_elements; if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; } for (int i=0; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads containing omit element.", op_name); case ANY_OR_OMIT: has_any_or_none = TRUE; break; default: min_size++; break; } } } break; case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads containing omit value.", op_name); case ANY_VALUE: case ANY_OR_OMIT: min_size = 0; has_any_or_none = TRUE; break; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads containing an empty list.", op_name); int item_size = value_list.list_value[0].size_of(is_size); for (unsigned int i = 1; i < value_list.n_values; i++) { if (value_list.list_value[i].size_of(is_size)!=item_size) TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads containing a value list with different sizes.", op_name); } min_size = item_size; has_any_or_none = FALSE; break; } case COMPLEMENTED_LIST: TTCN_error("Performing %sof() operation on a template of type @RTP_Emulation.RtpemConfig.rx_payloads containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.rx_payloads.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RTP_Emulation.RtpemConfig.rx_payloads"); } boolean RtpemConfig_rx__payloads_template::match(const RtpemConfig_rx__payloads& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; int value_length = other_value.size_of(); if (!match_length(value_length)) return FALSE; switch (template_selection) { case SPECIFIC_VALUE: return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy); case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching with an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.rx_payloads."); } return FALSE; } boolean RtpemConfig_rx__payloads_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (!single_value.value_elements[elem_count]->is_value()) return FALSE; return TRUE; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads_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 @RTP_Emulation.RtpemConfig.rx_payloads."); RtpemConfig_rx__payloads ret_val; ret_val.set_size(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (single_value.value_elements[elem_count]->is_bound()) { ret_val[elem_count] = single_value.value_elements[elem_count]->valueof(); } return ret_val; } RtpemConfig_rx__payloads RtpemConfig_rx__payloads_template::substr(int index, int returncount) const { if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value."); return valueof().substr(index, returncount); } RtpemConfig_rx__payloads RtpemConfig_rx__payloads_template::replace(int index, int len, const RtpemConfig_rx__payloads_template& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl.valueof()); } RtpemConfig_rx__payloads RtpemConfig_rx__payloads_template::replace(int index, int len, const RtpemConfig_rx__payloads& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl); } void RtpemConfig_rx__payloads_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = list_length; value_list.list_value = new RtpemConfig_rx__payloads_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); } set_selection(template_type); } RtpemConfig_rx__payloads_template& RtpemConfig_rx__payloads_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RTP_Emulation.RtpemConfig.rx_payloads."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RTP_Emulation.RtpemConfig.rx_payloads."); return value_list.list_value[list_index]; } void RtpemConfig_rx__payloads_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: if (single_value.n_elements > 0) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation("); single_value.value_elements[elem_count]->log(); if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')'); } TTCN_Logger::log_event_str(" }"); } else TTCN_Logger::log_event_str("{ }"); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) { if (list_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[list_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_restricted(); log_ifpresent(); } void RtpemConfig_rx__payloads_template::log_match(const RtpemConfig_rx__payloads& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); }else{ if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){ TTCN_Logger::log_logmatch_info("[%d]", elem_count); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } log_match_length(single_value.n_elements); } else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); } TTCN_Logger::log_event_str(" }"); log_match_length(single_value.n_elements); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void RtpemConfig_rx__payloads_template::encode_text(Text_Buf& text_buf) const { encode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) single_value.value_elements[elem_count]->encode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig.rx_payloads."); } } void RtpemConfig_rx__payloads_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value.n_elements = text_buf.pull_int().get_val(); if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); single_value.value_elements = (RtpemConfigPayload_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { single_value.value_elements[elem_count] = new RtpemConfigPayload_template; single_value.value_elements[elem_count]->decode_text(text_buf); } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new RtpemConfig_rx__payloads_template[value_list.n_values]; for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @RTP_Emulation.RtpemConfig.rx_payloads."); } } boolean RtpemConfig_rx__payloads_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemConfig_rx__payloads_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iset_implicit_omit(); } } void RtpemConfig_rx__payloads_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template"); switch (param.get_type()) { case Module_Param::MP_Omit: *this = OMIT_VALUE; break; case Module_Param::MP_Any: *this = ANY_VALUE; break; case Module_Param::MP_AnyOrNone: *this = ANY_OR_OMIT; break; case Module_Param::MP_List_Template: case Module_Param::MP_ComplementList_Template: case Module_Param::MP_ConjunctList_Template: { RtpemConfig_rx__payloads_template temp; temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { RtpemConfig_rx__payloads_template* precondition = new RtpemConfig_rx__payloads_template; precondition->set_param(*param.get_elem(0)); RtpemConfig_rx__payloads_template* implied_template = new RtpemConfig_rx__payloads_template; implied_template->set_param(*param.get_elem(1)); *this = RtpemConfig_rx__payloads_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RTP_Emulation.RtpemConfig.rx_payloads"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void RtpemConfig_rx__payloads_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; for (int i=0; icheck_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig.rx_payloads"); 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 : "@RTP_Emulation.RtpemConfig.rx_payloads"); } boolean RtpemConfig_rx__payloads_template::get_istemplate_kind(const char* type) const { if (!strcmp(type, "AnyElement")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_VALUE) { return TRUE; } } return FALSE; } else if (!strcmp(type, "AnyElementsOrNone")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) { return TRUE; } } return FALSE; } else if (!strcmp(type, "permutation")) { return number_of_permutations; } else if (!strcmp(type, "length")) { return length_restriction_type != NO_LENGTH_RESTRICTION; } else { return Base_Template::get_istemplate_kind(type); } } RtpemConfig::RtpemConfig() { } RtpemConfig::RtpemConfig(const INTEGER& par_tx__samplerate__hz, const INTEGER& par_tx__duration__ms, const BITSTRING& par_tx__ssrc, const RtpemConfig_tx__payloads& par_tx__payloads, const RtpemConfig_rx__payloads& par_rx__payloads, const BOOLEAN& par_iuup__mode, const IuUP__Emulation::IuUP__Config& par_iuup__cfg) : field_tx__samplerate__hz(par_tx__samplerate__hz), field_tx__duration__ms(par_tx__duration__ms), field_tx__ssrc(par_tx__ssrc), field_tx__payloads(par_tx__payloads), field_rx__payloads(par_rx__payloads), field_iuup__mode(par_iuup__mode), field_iuup__cfg(par_iuup__cfg) { } RtpemConfig::RtpemConfig(const RtpemConfig& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RTP_Emulation.RtpemConfig."); if (other_value.tx__samplerate__hz().is_bound()) field_tx__samplerate__hz = other_value.tx__samplerate__hz(); else field_tx__samplerate__hz.clean_up(); if (other_value.tx__duration__ms().is_bound()) field_tx__duration__ms = other_value.tx__duration__ms(); else field_tx__duration__ms.clean_up(); if (other_value.tx__ssrc().is_bound()) field_tx__ssrc = other_value.tx__ssrc(); else field_tx__ssrc.clean_up(); if (other_value.tx__payloads().is_bound()) field_tx__payloads = other_value.tx__payloads(); else field_tx__payloads.clean_up(); if (other_value.rx__payloads().is_bound()) field_rx__payloads = other_value.rx__payloads(); else field_rx__payloads.clean_up(); if (other_value.iuup__mode().is_bound()) field_iuup__mode = other_value.iuup__mode(); else field_iuup__mode.clean_up(); if (other_value.iuup__cfg().is_bound()) field_iuup__cfg = other_value.iuup__cfg(); else field_iuup__cfg.clean_up(); } void RtpemConfig::clean_up() { field_tx__samplerate__hz.clean_up(); field_tx__duration__ms.clean_up(); field_tx__ssrc.clean_up(); field_tx__payloads.clean_up(); field_rx__payloads.clean_up(); field_iuup__mode.clean_up(); field_iuup__cfg.clean_up(); } const TTCN_Typedescriptor_t* RtpemConfig::get_descriptor() const { return &RtpemConfig_descr_; } RtpemConfig& RtpemConfig::operator=(const RtpemConfig& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RTP_Emulation.RtpemConfig."); if (other_value.tx__samplerate__hz().is_bound()) field_tx__samplerate__hz = other_value.tx__samplerate__hz(); else field_tx__samplerate__hz.clean_up(); if (other_value.tx__duration__ms().is_bound()) field_tx__duration__ms = other_value.tx__duration__ms(); else field_tx__duration__ms.clean_up(); if (other_value.tx__ssrc().is_bound()) field_tx__ssrc = other_value.tx__ssrc(); else field_tx__ssrc.clean_up(); if (other_value.tx__payloads().is_bound()) field_tx__payloads = other_value.tx__payloads(); else field_tx__payloads.clean_up(); if (other_value.rx__payloads().is_bound()) field_rx__payloads = other_value.rx__payloads(); else field_rx__payloads.clean_up(); if (other_value.iuup__mode().is_bound()) field_iuup__mode = other_value.iuup__mode(); else field_iuup__mode.clean_up(); if (other_value.iuup__cfg().is_bound()) field_iuup__cfg = other_value.iuup__cfg(); else field_iuup__cfg.clean_up(); } return *this; } boolean RtpemConfig::operator==(const RtpemConfig& other_value) const { return field_tx__samplerate__hz==other_value.field_tx__samplerate__hz && field_tx__duration__ms==other_value.field_tx__duration__ms && field_tx__ssrc==other_value.field_tx__ssrc && field_tx__payloads==other_value.field_tx__payloads && field_rx__payloads==other_value.field_rx__payloads && field_iuup__mode==other_value.field_iuup__mode && field_iuup__cfg==other_value.field_iuup__cfg; } boolean RtpemConfig::is_bound() const { return (field_tx__samplerate__hz.is_bound()) || (field_tx__duration__ms.is_bound()) || (field_tx__ssrc.is_bound()) || (field_tx__payloads.is_bound()) || (field_rx__payloads.is_bound()) || (field_iuup__mode.is_bound()) || (field_iuup__cfg.is_bound()); } boolean RtpemConfig::is_value() const { return field_tx__samplerate__hz.is_value() && field_tx__duration__ms.is_value() && field_tx__ssrc.is_value() && field_tx__payloads.is_value() && field_rx__payloads.is_value() && field_iuup__mode.is_value() && field_iuup__cfg.is_value(); } void RtpemConfig::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ tx_samplerate_hz := "); field_tx__samplerate__hz.log(); TTCN_Logger::log_event_str(", tx_duration_ms := "); field_tx__duration__ms.log(); TTCN_Logger::log_event_str(", tx_ssrc := "); field_tx__ssrc.log(); TTCN_Logger::log_event_str(", tx_payloads := "); field_tx__payloads.log(); TTCN_Logger::log_event_str(", rx_payloads := "); field_rx__payloads.log(); TTCN_Logger::log_event_str(", iuup_mode := "); field_iuup__mode.log(); TTCN_Logger::log_event_str(", iuup_cfg := "); field_iuup__cfg.log(); TTCN_Logger::log_event_str(" }"); } void RtpemConfig::set_implicit_omit() { if (tx__samplerate__hz().is_bound()) tx__samplerate__hz().set_implicit_omit(); if (tx__duration__ms().is_bound()) tx__duration__ms().set_implicit_omit(); if (tx__ssrc().is_bound()) tx__ssrc().set_implicit_omit(); if (tx__payloads().is_bound()) tx__payloads().set_implicit_omit(); if (rx__payloads().is_bound()) rx__payloads().set_implicit_omit(); if (iuup__mode().is_bound()) iuup__mode().set_implicit_omit(); if (iuup__cfg().is_bound()) iuup__cfg().set_implicit_omit(); } void RtpemConfig::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 (70 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tx__samplerate__hz().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__duration__ms().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tx__ssrc().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tx__payloads().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rx__payloads().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) iuup__mode().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) iuup__cfg().set_param(*param.get_elem(6)); 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(), "tx_samplerate_hz")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__samplerate__hz().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_duration_ms")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__duration__ms().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_ssrc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__ssrc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_payloads")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__payloads().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rx_payloads")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rx__payloads().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iuup_mode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iuup__mode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iuup_cfg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iuup__cfg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemConfig: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RTP_Emulation.RtpemConfig"); } } void RtpemConfig::encode_text(Text_Buf& text_buf) const { field_tx__samplerate__hz.encode_text(text_buf); field_tx__duration__ms.encode_text(text_buf); field_tx__ssrc.encode_text(text_buf); field_tx__payloads.encode_text(text_buf); field_rx__payloads.encode_text(text_buf); field_iuup__mode.encode_text(text_buf); field_iuup__cfg.encode_text(text_buf); } void RtpemConfig::decode_text(Text_Buf& text_buf) { field_tx__samplerate__hz.decode_text(text_buf); field_tx__duration__ms.decode_text(text_buf); field_tx__ssrc.decode_text(text_buf); field_tx__payloads.decode_text(text_buf); field_rx__payloads.decode_text(text_buf); field_iuup__mode.decode_text(text_buf); field_iuup__cfg.decode_text(text_buf); } struct RtpemConfig_template::single_value_struct { INTEGER_template field_tx__samplerate__hz; INTEGER_template field_tx__duration__ms; BITSTRING_template field_tx__ssrc; RtpemConfig_tx__payloads_template field_tx__payloads; RtpemConfig_rx__payloads_template field_rx__payloads; BOOLEAN_template field_iuup__mode; IuUP__Emulation::IuUP__Config_template field_iuup__cfg; }; void RtpemConfig_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_tx__samplerate__hz = ANY_VALUE; single_value->field_tx__duration__ms = ANY_VALUE; single_value->field_tx__ssrc = ANY_VALUE; single_value->field_tx__payloads = ANY_VALUE; single_value->field_rx__payloads = ANY_VALUE; single_value->field_iuup__mode = ANY_VALUE; single_value->field_iuup__cfg = ANY_VALUE; } } } void RtpemConfig_template::copy_value(const RtpemConfig& other_value) { single_value = new single_value_struct; if (other_value.tx__samplerate__hz().is_bound()) { single_value->field_tx__samplerate__hz = other_value.tx__samplerate__hz(); } else { single_value->field_tx__samplerate__hz.clean_up(); } if (other_value.tx__duration__ms().is_bound()) { single_value->field_tx__duration__ms = other_value.tx__duration__ms(); } else { single_value->field_tx__duration__ms.clean_up(); } if (other_value.tx__ssrc().is_bound()) { single_value->field_tx__ssrc = other_value.tx__ssrc(); } else { single_value->field_tx__ssrc.clean_up(); } if (other_value.tx__payloads().is_bound()) { single_value->field_tx__payloads = other_value.tx__payloads(); } else { single_value->field_tx__payloads.clean_up(); } if (other_value.rx__payloads().is_bound()) { single_value->field_rx__payloads = other_value.rx__payloads(); } else { single_value->field_rx__payloads.clean_up(); } if (other_value.iuup__mode().is_bound()) { single_value->field_iuup__mode = other_value.iuup__mode(); } else { single_value->field_iuup__mode.clean_up(); } if (other_value.iuup__cfg().is_bound()) { single_value->field_iuup__cfg = other_value.iuup__cfg(); } else { single_value->field_iuup__cfg.clean_up(); } set_selection(SPECIFIC_VALUE); } void RtpemConfig_template::copy_template(const RtpemConfig_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tx__samplerate__hz().get_selection()) { single_value->field_tx__samplerate__hz = other_value.tx__samplerate__hz(); } else { single_value->field_tx__samplerate__hz.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tx__duration__ms().get_selection()) { single_value->field_tx__duration__ms = other_value.tx__duration__ms(); } else { single_value->field_tx__duration__ms.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tx__ssrc().get_selection()) { single_value->field_tx__ssrc = other_value.tx__ssrc(); } else { single_value->field_tx__ssrc.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tx__payloads().get_selection()) { single_value->field_tx__payloads = other_value.tx__payloads(); } else { single_value->field_tx__payloads.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rx__payloads().get_selection()) { single_value->field_rx__payloads = other_value.rx__payloads(); } else { single_value->field_rx__payloads.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iuup__mode().get_selection()) { single_value->field_iuup__mode = other_value.iuup__mode(); } else { single_value->field_iuup__mode.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iuup__cfg().get_selection()) { single_value->field_iuup__cfg = other_value.iuup__cfg(); } else { single_value->field_iuup__cfg.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 RtpemConfig_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 RtpemConfig_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemConfig_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 @RTP_Emulation.RtpemConfig."); break; } set_selection(other_value); } RtpemConfig_template::RtpemConfig_template() { } RtpemConfig_template::RtpemConfig_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RtpemConfig_template::RtpemConfig_template(const RtpemConfig& other_value) { copy_value(other_value); } RtpemConfig_template::RtpemConfig_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RTP_Emulation.RtpemConfig from an unbound optional field."); } } RtpemConfig_template::RtpemConfig_template(RtpemConfig_template* p_precondition, RtpemConfig_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemConfig_template::RtpemConfig_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; } RtpemConfig_template::RtpemConfig_template(const RtpemConfig_template& other_value) : Base_Template() { copy_template(other_value); } RtpemConfig_template::~RtpemConfig_template() { clean_up(); } RtpemConfig_template& RtpemConfig_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemConfig_template& RtpemConfig_template::operator=(const RtpemConfig& other_value) { clean_up(); copy_value(other_value); return *this; } RtpemConfig_template& RtpemConfig_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemConfig&)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 @RTP_Emulation.RtpemConfig."); } return *this; } RtpemConfig_template& RtpemConfig_template::operator=(const RtpemConfig_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RtpemConfig_template::match(const RtpemConfig& 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.tx__samplerate__hz().is_bound()) return FALSE; if(!single_value->field_tx__samplerate__hz.match(other_value.tx__samplerate__hz(), legacy))return FALSE; if(!other_value.tx__duration__ms().is_bound()) return FALSE; if(!single_value->field_tx__duration__ms.match(other_value.tx__duration__ms(), legacy))return FALSE; if(!other_value.tx__ssrc().is_bound()) return FALSE; if(!single_value->field_tx__ssrc.match(other_value.tx__ssrc(), legacy))return FALSE; if(!other_value.tx__payloads().is_bound()) return FALSE; if(!single_value->field_tx__payloads.match(other_value.tx__payloads(), legacy))return FALSE; if(!other_value.rx__payloads().is_bound()) return FALSE; if(!single_value->field_rx__payloads.match(other_value.rx__payloads(), legacy))return FALSE; if(!other_value.iuup__mode().is_bound()) return FALSE; if(!single_value->field_iuup__mode.match(other_value.iuup__mode(), legacy))return FALSE; if(!other_value.iuup__cfg().is_bound()) return FALSE; if(!single_value->field_iuup__cfg.match(other_value.iuup__cfg(), 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 @RTP_Emulation.RtpemConfig."); } return FALSE; } boolean RtpemConfig_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tx__samplerate__hz.is_bound() || single_value->field_tx__duration__ms.is_bound() || single_value->field_tx__ssrc.is_bound() || single_value->field_tx__payloads.is_bound() || single_value->field_rx__payloads.is_bound() || single_value->field_iuup__mode.is_bound() || single_value->field_iuup__cfg.is_bound(); } boolean RtpemConfig_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tx__samplerate__hz.is_value() && single_value->field_tx__duration__ms.is_value() && single_value->field_tx__ssrc.is_value() && single_value->field_tx__payloads.is_value() && single_value->field_rx__payloads.is_value() && single_value->field_iuup__mode.is_value() && single_value->field_iuup__cfg.is_value(); } void RtpemConfig_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; } RtpemConfig RtpemConfig_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 @RTP_Emulation.RtpemConfig."); RtpemConfig ret_val; if (single_value->field_tx__samplerate__hz.is_bound()) { ret_val.tx__samplerate__hz() = single_value->field_tx__samplerate__hz.valueof(); } if (single_value->field_tx__duration__ms.is_bound()) { ret_val.tx__duration__ms() = single_value->field_tx__duration__ms.valueof(); } if (single_value->field_tx__ssrc.is_bound()) { ret_val.tx__ssrc() = single_value->field_tx__ssrc.valueof(); } if (single_value->field_tx__payloads.is_bound()) { ret_val.tx__payloads() = single_value->field_tx__payloads.valueof(); } if (single_value->field_rx__payloads.is_bound()) { ret_val.rx__payloads() = single_value->field_rx__payloads.valueof(); } if (single_value->field_iuup__mode.is_bound()) { ret_val.iuup__mode() = single_value->field_iuup__mode.valueof(); } if (single_value->field_iuup__cfg.is_bound()) { ret_val.iuup__cfg() = single_value->field_iuup__cfg.valueof(); } return ret_val; } void RtpemConfig_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 @RTP_Emulation.RtpemConfig."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RtpemConfig_template[list_length]; } RtpemConfig_template& RtpemConfig_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 @RTP_Emulation.RtpemConfig."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RTP_Emulation.RtpemConfig."); return value_list.list_value[list_index]; } INTEGER_template& RtpemConfig_template::tx__samplerate__hz() { set_specific(); return single_value->field_tx__samplerate__hz; } const INTEGER_template& RtpemConfig_template::tx__samplerate__hz() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tx_samplerate_hz of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_tx__samplerate__hz; } INTEGER_template& RtpemConfig_template::tx__duration__ms() { set_specific(); return single_value->field_tx__duration__ms; } const INTEGER_template& RtpemConfig_template::tx__duration__ms() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tx_duration_ms of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_tx__duration__ms; } BITSTRING_template& RtpemConfig_template::tx__ssrc() { set_specific(); return single_value->field_tx__ssrc; } const BITSTRING_template& RtpemConfig_template::tx__ssrc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tx_ssrc of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_tx__ssrc; } RtpemConfig_tx__payloads_template& RtpemConfig_template::tx__payloads() { set_specific(); return single_value->field_tx__payloads; } const RtpemConfig_tx__payloads_template& RtpemConfig_template::tx__payloads() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tx_payloads of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_tx__payloads; } RtpemConfig_rx__payloads_template& RtpemConfig_template::rx__payloads() { set_specific(); return single_value->field_rx__payloads; } const RtpemConfig_rx__payloads_template& RtpemConfig_template::rx__payloads() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rx_payloads of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_rx__payloads; } BOOLEAN_template& RtpemConfig_template::iuup__mode() { set_specific(); return single_value->field_iuup__mode; } const BOOLEAN_template& RtpemConfig_template::iuup__mode() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iuup_mode of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_iuup__mode; } IuUP__Emulation::IuUP__Config_template& RtpemConfig_template::iuup__cfg() { set_specific(); return single_value->field_iuup__cfg; } const IuUP__Emulation::IuUP__Config_template& RtpemConfig_template::iuup__cfg() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iuup_cfg of a non-specific template of type @RTP_Emulation.RtpemConfig."); return single_value->field_iuup__cfg; } int RtpemConfig_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 7; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig 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 @RTP_Emulation.RtpemConfig containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemConfig containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RTP_Emulation.RtpemConfig."); } return 0; } void RtpemConfig_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tx_samplerate_hz := "); single_value->field_tx__samplerate__hz.log(); TTCN_Logger::log_event_str(", tx_duration_ms := "); single_value->field_tx__duration__ms.log(); TTCN_Logger::log_event_str(", tx_ssrc := "); single_value->field_tx__ssrc.log(); TTCN_Logger::log_event_str(", tx_payloads := "); single_value->field_tx__payloads.log(); TTCN_Logger::log_event_str(", rx_payloads := "); single_value->field_rx__payloads.log(); TTCN_Logger::log_event_str(", iuup_mode := "); single_value->field_iuup__mode.log(); TTCN_Logger::log_event_str(", iuup_cfg := "); single_value->field_iuup__cfg.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 RtpemConfig_template::log_match(const RtpemConfig& 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_tx__samplerate__hz.match(match_value.tx__samplerate__hz(), legacy)){ TTCN_Logger::log_logmatch_info(".tx_samplerate_hz"); single_value->field_tx__samplerate__hz.log_match(match_value.tx__samplerate__hz(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_tx__duration__ms.match(match_value.tx__duration__ms(), legacy)){ TTCN_Logger::log_logmatch_info(".tx_duration_ms"); single_value->field_tx__duration__ms.log_match(match_value.tx__duration__ms(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_tx__ssrc.match(match_value.tx__ssrc(), legacy)){ TTCN_Logger::log_logmatch_info(".tx_ssrc"); single_value->field_tx__ssrc.log_match(match_value.tx__ssrc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_tx__payloads.match(match_value.tx__payloads(), legacy)){ TTCN_Logger::log_logmatch_info(".tx_payloads"); single_value->field_tx__payloads.log_match(match_value.tx__payloads(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rx__payloads.match(match_value.rx__payloads(), legacy)){ TTCN_Logger::log_logmatch_info(".rx_payloads"); single_value->field_rx__payloads.log_match(match_value.rx__payloads(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_iuup__mode.match(match_value.iuup__mode(), legacy)){ TTCN_Logger::log_logmatch_info(".iuup_mode"); single_value->field_iuup__mode.log_match(match_value.iuup__mode(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_iuup__cfg.match(match_value.iuup__cfg(), legacy)){ TTCN_Logger::log_logmatch_info(".iuup_cfg"); single_value->field_iuup__cfg.log_match(match_value.iuup__cfg(), 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("{ tx_samplerate_hz := "); single_value->field_tx__samplerate__hz.log_match(match_value.tx__samplerate__hz(), legacy); TTCN_Logger::log_event_str(", tx_duration_ms := "); single_value->field_tx__duration__ms.log_match(match_value.tx__duration__ms(), legacy); TTCN_Logger::log_event_str(", tx_ssrc := "); single_value->field_tx__ssrc.log_match(match_value.tx__ssrc(), legacy); TTCN_Logger::log_event_str(", tx_payloads := "); single_value->field_tx__payloads.log_match(match_value.tx__payloads(), legacy); TTCN_Logger::log_event_str(", rx_payloads := "); single_value->field_rx__payloads.log_match(match_value.rx__payloads(), legacy); TTCN_Logger::log_event_str(", iuup_mode := "); single_value->field_iuup__mode.log_match(match_value.iuup__mode(), legacy); TTCN_Logger::log_event_str(", iuup_cfg := "); single_value->field_iuup__cfg.log_match(match_value.iuup__cfg(), 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 RtpemConfig_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tx__samplerate__hz().is_bound()) tx__samplerate__hz().set_implicit_omit(); if (tx__duration__ms().is_bound()) tx__duration__ms().set_implicit_omit(); if (tx__ssrc().is_bound()) tx__ssrc().set_implicit_omit(); if (tx__payloads().is_bound()) tx__payloads().set_implicit_omit(); if (rx__payloads().is_bound()) rx__payloads().set_implicit_omit(); if (iuup__mode().is_bound()) iuup__mode().set_implicit_omit(); if (iuup__cfg().is_bound()) iuup__cfg().set_implicit_omit(); } void RtpemConfig_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tx__samplerate__hz.encode_text(text_buf); single_value->field_tx__duration__ms.encode_text(text_buf); single_value->field_tx__ssrc.encode_text(text_buf); single_value->field_tx__payloads.encode_text(text_buf); single_value->field_rx__payloads.encode_text(text_buf); single_value->field_iuup__mode.encode_text(text_buf); single_value->field_iuup__cfg.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 @RTP_Emulation.RtpemConfig."); } } void RtpemConfig_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_tx__samplerate__hz.decode_text(text_buf); single_value->field_tx__duration__ms.decode_text(text_buf); single_value->field_tx__ssrc.decode_text(text_buf); single_value->field_tx__payloads.decode_text(text_buf); single_value->field_rx__payloads.decode_text(text_buf); single_value->field_iuup__mode.decode_text(text_buf); single_value->field_iuup__cfg.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 RtpemConfig_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 @RTP_Emulation.RtpemConfig."); } } void RtpemConfig_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: { RtpemConfig_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) tx__samplerate__hz().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__duration__ms().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tx__ssrc().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tx__payloads().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rx__payloads().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) iuup__mode().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) iuup__cfg().set_param(*param.get_elem(6)); 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(), "tx_samplerate_hz")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__samplerate__hz().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_duration_ms")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__duration__ms().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_ssrc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__ssrc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_payloads")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__payloads().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rx_payloads")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rx__payloads().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iuup_mode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iuup__mode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iuup_cfg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iuup__cfg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemConfig: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RtpemConfig_template* precondition = new RtpemConfig_template; precondition->set_param(*param.get_elem(0)); RtpemConfig_template* implied_template = new RtpemConfig_template; implied_template->set_param(*param.get_elem(1)); *this = RtpemConfig_template(precondition, implied_template); } break; default: param.type_error("record template", "@RTP_Emulation.RtpemConfig"); } is_ifpresent = param.get_ifpresent(); } void RtpemConfig_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_tx__samplerate__hz.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_tx__duration__ms.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_tx__ssrc.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_tx__payloads.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_rx__payloads.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_iuup__mode.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); single_value->field_iuup__cfg.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemConfig"); 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 : "@RTP_Emulation.RtpemConfig"); } boolean RtpemConfig_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemConfig_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) num__pkts__tx().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__tx().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__rx().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__seq().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__ts().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__pt().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__disabled().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__payload().set_param(*param.get_elem(8)); 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(), "num_pkts_tx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__tx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bytes_payload_tx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bytes__payload__tx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bytes_payload_rx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bytes__payload__rx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_seq")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__seq().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_ts")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__ts().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_pt")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__pt().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_disabled")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__disabled().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_payload")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__payload().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemStats: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RTP_Emulation.RtpemStats"); } } void RtpemStats::encode_text(Text_Buf& text_buf) const { field_num__pkts__tx.encode_text(text_buf); field_bytes__payload__tx.encode_text(text_buf); field_num__pkts__rx.encode_text(text_buf); field_bytes__payload__rx.encode_text(text_buf); field_num__pkts__rx__err__seq.encode_text(text_buf); field_num__pkts__rx__err__ts.encode_text(text_buf); field_num__pkts__rx__err__pt.encode_text(text_buf); field_num__pkts__rx__err__disabled.encode_text(text_buf); field_num__pkts__rx__err__payload.encode_text(text_buf); } void RtpemStats::decode_text(Text_Buf& text_buf) { field_num__pkts__tx.decode_text(text_buf); field_bytes__payload__tx.decode_text(text_buf); field_num__pkts__rx.decode_text(text_buf); field_bytes__payload__rx.decode_text(text_buf); field_num__pkts__rx__err__seq.decode_text(text_buf); field_num__pkts__rx__err__ts.decode_text(text_buf); field_num__pkts__rx__err__pt.decode_text(text_buf); field_num__pkts__rx__err__disabled.decode_text(text_buf); field_num__pkts__rx__err__payload.decode_text(text_buf); } struct RtpemStats_template::single_value_struct { INTEGER_template field_num__pkts__tx; INTEGER_template field_bytes__payload__tx; INTEGER_template field_num__pkts__rx; INTEGER_template field_bytes__payload__rx; INTEGER_template field_num__pkts__rx__err__seq; INTEGER_template field_num__pkts__rx__err__ts; INTEGER_template field_num__pkts__rx__err__pt; INTEGER_template field_num__pkts__rx__err__disabled; INTEGER_template field_num__pkts__rx__err__payload; }; void RtpemStats_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_num__pkts__tx = ANY_VALUE; single_value->field_bytes__payload__tx = ANY_VALUE; single_value->field_num__pkts__rx = ANY_VALUE; single_value->field_bytes__payload__rx = ANY_VALUE; single_value->field_num__pkts__rx__err__seq = ANY_VALUE; single_value->field_num__pkts__rx__err__ts = ANY_VALUE; single_value->field_num__pkts__rx__err__pt = ANY_VALUE; single_value->field_num__pkts__rx__err__disabled = ANY_VALUE; single_value->field_num__pkts__rx__err__payload = ANY_VALUE; } } } void RtpemStats_template::copy_value(const RtpemStats& other_value) { single_value = new single_value_struct; if (other_value.num__pkts__tx().is_bound()) { single_value->field_num__pkts__tx = other_value.num__pkts__tx(); } else { single_value->field_num__pkts__tx.clean_up(); } if (other_value.bytes__payload__tx().is_bound()) { single_value->field_bytes__payload__tx = other_value.bytes__payload__tx(); } else { single_value->field_bytes__payload__tx.clean_up(); } if (other_value.num__pkts__rx().is_bound()) { single_value->field_num__pkts__rx = other_value.num__pkts__rx(); } else { single_value->field_num__pkts__rx.clean_up(); } if (other_value.bytes__payload__rx().is_bound()) { single_value->field_bytes__payload__rx = other_value.bytes__payload__rx(); } else { single_value->field_bytes__payload__rx.clean_up(); } if (other_value.num__pkts__rx__err__seq().is_bound()) { single_value->field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq(); } else { single_value->field_num__pkts__rx__err__seq.clean_up(); } if (other_value.num__pkts__rx__err__ts().is_bound()) { single_value->field_num__pkts__rx__err__ts = other_value.num__pkts__rx__err__ts(); } else { single_value->field_num__pkts__rx__err__ts.clean_up(); } if (other_value.num__pkts__rx__err__pt().is_bound()) { single_value->field_num__pkts__rx__err__pt = other_value.num__pkts__rx__err__pt(); } else { single_value->field_num__pkts__rx__err__pt.clean_up(); } if (other_value.num__pkts__rx__err__disabled().is_bound()) { single_value->field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled(); } else { single_value->field_num__pkts__rx__err__disabled.clean_up(); } if (other_value.num__pkts__rx__err__payload().is_bound()) { single_value->field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload(); } else { single_value->field_num__pkts__rx__err__payload.clean_up(); } set_selection(SPECIFIC_VALUE); } void RtpemStats_template::copy_template(const RtpemStats_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__tx().get_selection()) { single_value->field_num__pkts__tx = other_value.num__pkts__tx(); } else { single_value->field_num__pkts__tx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.bytes__payload__tx().get_selection()) { single_value->field_bytes__payload__tx = other_value.bytes__payload__tx(); } else { single_value->field_bytes__payload__tx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx().get_selection()) { single_value->field_num__pkts__rx = other_value.num__pkts__rx(); } else { single_value->field_num__pkts__rx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.bytes__payload__rx().get_selection()) { single_value->field_bytes__payload__rx = other_value.bytes__payload__rx(); } else { single_value->field_bytes__payload__rx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__seq().get_selection()) { single_value->field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq(); } else { single_value->field_num__pkts__rx__err__seq.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__ts().get_selection()) { single_value->field_num__pkts__rx__err__ts = other_value.num__pkts__rx__err__ts(); } else { single_value->field_num__pkts__rx__err__ts.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__pt().get_selection()) { single_value->field_num__pkts__rx__err__pt = other_value.num__pkts__rx__err__pt(); } else { single_value->field_num__pkts__rx__err__pt.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__disabled().get_selection()) { single_value->field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled(); } else { single_value->field_num__pkts__rx__err__disabled.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__payload().get_selection()) { single_value->field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload(); } else { single_value->field_num__pkts__rx__err__payload.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 RtpemStats_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 RtpemStats_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemStats_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 @RTP_Emulation.RtpemStats."); break; } set_selection(other_value); } RtpemStats_template::RtpemStats_template() { } RtpemStats_template::RtpemStats_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RtpemStats_template::RtpemStats_template(const RtpemStats& other_value) { copy_value(other_value); } RtpemStats_template::RtpemStats_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemStats&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RTP_Emulation.RtpemStats from an unbound optional field."); } } RtpemStats_template::RtpemStats_template(RtpemStats_template* p_precondition, RtpemStats_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemStats_template::RtpemStats_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; } RtpemStats_template::RtpemStats_template(const RtpemStats_template& other_value) : Base_Template() { copy_template(other_value); } RtpemStats_template::~RtpemStats_template() { clean_up(); } RtpemStats_template& RtpemStats_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemStats_template& RtpemStats_template::operator=(const RtpemStats& other_value) { clean_up(); copy_value(other_value); return *this; } RtpemStats_template& RtpemStats_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RtpemStats&)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 @RTP_Emulation.RtpemStats."); } return *this; } RtpemStats_template& RtpemStats_template::operator=(const RtpemStats_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RtpemStats_template::match(const RtpemStats& 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.num__pkts__tx().is_bound()) return FALSE; if(!single_value->field_num__pkts__tx.match(other_value.num__pkts__tx(), legacy))return FALSE; if(!other_value.bytes__payload__tx().is_bound()) return FALSE; if(!single_value->field_bytes__payload__tx.match(other_value.bytes__payload__tx(), legacy))return FALSE; if(!other_value.num__pkts__rx().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx.match(other_value.num__pkts__rx(), legacy))return FALSE; if(!other_value.bytes__payload__rx().is_bound()) return FALSE; if(!single_value->field_bytes__payload__rx.match(other_value.bytes__payload__rx(), legacy))return FALSE; if(!other_value.num__pkts__rx__err__seq().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx__err__seq.match(other_value.num__pkts__rx__err__seq(), legacy))return FALSE; if(!other_value.num__pkts__rx__err__ts().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx__err__ts.match(other_value.num__pkts__rx__err__ts(), legacy))return FALSE; if(!other_value.num__pkts__rx__err__pt().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx__err__pt.match(other_value.num__pkts__rx__err__pt(), legacy))return FALSE; if(!other_value.num__pkts__rx__err__disabled().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx__err__disabled.match(other_value.num__pkts__rx__err__disabled(), legacy))return FALSE; if(!other_value.num__pkts__rx__err__payload().is_bound()) return FALSE; if(!single_value->field_num__pkts__rx__err__payload.match(other_value.num__pkts__rx__err__payload(), 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 @RTP_Emulation.RtpemStats."); } return FALSE; } boolean RtpemStats_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_num__pkts__tx.is_bound() || single_value->field_bytes__payload__tx.is_bound() || single_value->field_num__pkts__rx.is_bound() || single_value->field_bytes__payload__rx.is_bound() || single_value->field_num__pkts__rx__err__seq.is_bound() || single_value->field_num__pkts__rx__err__ts.is_bound() || single_value->field_num__pkts__rx__err__pt.is_bound() || single_value->field_num__pkts__rx__err__disabled.is_bound() || single_value->field_num__pkts__rx__err__payload.is_bound(); } boolean RtpemStats_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_num__pkts__tx.is_value() && single_value->field_bytes__payload__tx.is_value() && single_value->field_num__pkts__rx.is_value() && single_value->field_bytes__payload__rx.is_value() && single_value->field_num__pkts__rx__err__seq.is_value() && single_value->field_num__pkts__rx__err__ts.is_value() && single_value->field_num__pkts__rx__err__pt.is_value() && single_value->field_num__pkts__rx__err__disabled.is_value() && single_value->field_num__pkts__rx__err__payload.is_value(); } void RtpemStats_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; } RtpemStats RtpemStats_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 @RTP_Emulation.RtpemStats."); RtpemStats ret_val; if (single_value->field_num__pkts__tx.is_bound()) { ret_val.num__pkts__tx() = single_value->field_num__pkts__tx.valueof(); } if (single_value->field_bytes__payload__tx.is_bound()) { ret_val.bytes__payload__tx() = single_value->field_bytes__payload__tx.valueof(); } if (single_value->field_num__pkts__rx.is_bound()) { ret_val.num__pkts__rx() = single_value->field_num__pkts__rx.valueof(); } if (single_value->field_bytes__payload__rx.is_bound()) { ret_val.bytes__payload__rx() = single_value->field_bytes__payload__rx.valueof(); } if (single_value->field_num__pkts__rx__err__seq.is_bound()) { ret_val.num__pkts__rx__err__seq() = single_value->field_num__pkts__rx__err__seq.valueof(); } if (single_value->field_num__pkts__rx__err__ts.is_bound()) { ret_val.num__pkts__rx__err__ts() = single_value->field_num__pkts__rx__err__ts.valueof(); } if (single_value->field_num__pkts__rx__err__pt.is_bound()) { ret_val.num__pkts__rx__err__pt() = single_value->field_num__pkts__rx__err__pt.valueof(); } if (single_value->field_num__pkts__rx__err__disabled.is_bound()) { ret_val.num__pkts__rx__err__disabled() = single_value->field_num__pkts__rx__err__disabled.valueof(); } if (single_value->field_num__pkts__rx__err__payload.is_bound()) { ret_val.num__pkts__rx__err__payload() = single_value->field_num__pkts__rx__err__payload.valueof(); } return ret_val; } void RtpemStats_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 @RTP_Emulation.RtpemStats."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RtpemStats_template[list_length]; } RtpemStats_template& RtpemStats_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 @RTP_Emulation.RtpemStats."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RTP_Emulation.RtpemStats."); return value_list.list_value[list_index]; } INTEGER_template& RtpemStats_template::num__pkts__tx() { set_specific(); return single_value->field_num__pkts__tx; } const INTEGER_template& RtpemStats_template::num__pkts__tx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_tx of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__tx; } INTEGER_template& RtpemStats_template::bytes__payload__tx() { set_specific(); return single_value->field_bytes__payload__tx; } const INTEGER_template& RtpemStats_template::bytes__payload__tx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bytes_payload_tx of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_bytes__payload__tx; } INTEGER_template& RtpemStats_template::num__pkts__rx() { set_specific(); return single_value->field_num__pkts__rx; } const INTEGER_template& RtpemStats_template::num__pkts__rx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx; } INTEGER_template& RtpemStats_template::bytes__payload__rx() { set_specific(); return single_value->field_bytes__payload__rx; } const INTEGER_template& RtpemStats_template::bytes__payload__rx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bytes_payload_rx of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_bytes__payload__rx; } INTEGER_template& RtpemStats_template::num__pkts__rx__err__seq() { set_specific(); return single_value->field_num__pkts__rx__err__seq; } const INTEGER_template& RtpemStats_template::num__pkts__rx__err__seq() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx_err_seq of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx__err__seq; } INTEGER_template& RtpemStats_template::num__pkts__rx__err__ts() { set_specific(); return single_value->field_num__pkts__rx__err__ts; } const INTEGER_template& RtpemStats_template::num__pkts__rx__err__ts() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx_err_ts of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx__err__ts; } INTEGER_template& RtpemStats_template::num__pkts__rx__err__pt() { set_specific(); return single_value->field_num__pkts__rx__err__pt; } const INTEGER_template& RtpemStats_template::num__pkts__rx__err__pt() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx_err_pt of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx__err__pt; } INTEGER_template& RtpemStats_template::num__pkts__rx__err__disabled() { set_specific(); return single_value->field_num__pkts__rx__err__disabled; } const INTEGER_template& RtpemStats_template::num__pkts__rx__err__disabled() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx_err_disabled of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx__err__disabled; } INTEGER_template& RtpemStats_template::num__pkts__rx__err__payload() { set_specific(); return single_value->field_num__pkts__rx__err__payload; } const INTEGER_template& RtpemStats_template::num__pkts__rx__err__payload() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field num_pkts_rx_err_payload of a non-specific template of type @RTP_Emulation.RtpemStats."); return single_value->field_num__pkts__rx__err__payload; } int RtpemStats_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 9; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats 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 @RTP_Emulation.RtpemStats containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RTP_Emulation.RtpemStats containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RTP_Emulation.RtpemStats."); } return 0; } void RtpemStats_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ num_pkts_tx := "); single_value->field_num__pkts__tx.log(); TTCN_Logger::log_event_str(", bytes_payload_tx := "); single_value->field_bytes__payload__tx.log(); TTCN_Logger::log_event_str(", num_pkts_rx := "); single_value->field_num__pkts__rx.log(); TTCN_Logger::log_event_str(", bytes_payload_rx := "); single_value->field_bytes__payload__rx.log(); TTCN_Logger::log_event_str(", num_pkts_rx_err_seq := "); single_value->field_num__pkts__rx__err__seq.log(); TTCN_Logger::log_event_str(", num_pkts_rx_err_ts := "); single_value->field_num__pkts__rx__err__ts.log(); TTCN_Logger::log_event_str(", num_pkts_rx_err_pt := "); single_value->field_num__pkts__rx__err__pt.log(); TTCN_Logger::log_event_str(", num_pkts_rx_err_disabled := "); single_value->field_num__pkts__rx__err__disabled.log(); TTCN_Logger::log_event_str(", num_pkts_rx_err_payload := "); single_value->field_num__pkts__rx__err__payload.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 RtpemStats_template::log_match(const RtpemStats& 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_num__pkts__tx.match(match_value.num__pkts__tx(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_tx"); single_value->field_num__pkts__tx.log_match(match_value.num__pkts__tx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_bytes__payload__tx.match(match_value.bytes__payload__tx(), legacy)){ TTCN_Logger::log_logmatch_info(".bytes_payload_tx"); single_value->field_bytes__payload__tx.log_match(match_value.bytes__payload__tx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx.match(match_value.num__pkts__rx(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx"); single_value->field_num__pkts__rx.log_match(match_value.num__pkts__rx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_bytes__payload__rx.match(match_value.bytes__payload__rx(), legacy)){ TTCN_Logger::log_logmatch_info(".bytes_payload_rx"); single_value->field_bytes__payload__rx.log_match(match_value.bytes__payload__rx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx__err__seq.match(match_value.num__pkts__rx__err__seq(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_seq"); single_value->field_num__pkts__rx__err__seq.log_match(match_value.num__pkts__rx__err__seq(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx__err__ts.match(match_value.num__pkts__rx__err__ts(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_ts"); single_value->field_num__pkts__rx__err__ts.log_match(match_value.num__pkts__rx__err__ts(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx__err__pt.match(match_value.num__pkts__rx__err__pt(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_pt"); single_value->field_num__pkts__rx__err__pt.log_match(match_value.num__pkts__rx__err__pt(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx__err__disabled.match(match_value.num__pkts__rx__err__disabled(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_disabled"); single_value->field_num__pkts__rx__err__disabled.log_match(match_value.num__pkts__rx__err__disabled(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_num__pkts__rx__err__payload.match(match_value.num__pkts__rx__err__payload(), legacy)){ TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_payload"); single_value->field_num__pkts__rx__err__payload.log_match(match_value.num__pkts__rx__err__payload(), 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("{ num_pkts_tx := "); single_value->field_num__pkts__tx.log_match(match_value.num__pkts__tx(), legacy); TTCN_Logger::log_event_str(", bytes_payload_tx := "); single_value->field_bytes__payload__tx.log_match(match_value.bytes__payload__tx(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx := "); single_value->field_num__pkts__rx.log_match(match_value.num__pkts__rx(), legacy); TTCN_Logger::log_event_str(", bytes_payload_rx := "); single_value->field_bytes__payload__rx.log_match(match_value.bytes__payload__rx(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx_err_seq := "); single_value->field_num__pkts__rx__err__seq.log_match(match_value.num__pkts__rx__err__seq(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx_err_ts := "); single_value->field_num__pkts__rx__err__ts.log_match(match_value.num__pkts__rx__err__ts(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx_err_pt := "); single_value->field_num__pkts__rx__err__pt.log_match(match_value.num__pkts__rx__err__pt(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx_err_disabled := "); single_value->field_num__pkts__rx__err__disabled.log_match(match_value.num__pkts__rx__err__disabled(), legacy); TTCN_Logger::log_event_str(", num_pkts_rx_err_payload := "); single_value->field_num__pkts__rx__err__payload.log_match(match_value.num__pkts__rx__err__payload(), 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 RtpemStats_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (num__pkts__tx().is_bound()) num__pkts__tx().set_implicit_omit(); if (bytes__payload__tx().is_bound()) bytes__payload__tx().set_implicit_omit(); if (num__pkts__rx().is_bound()) num__pkts__rx().set_implicit_omit(); if (bytes__payload__rx().is_bound()) bytes__payload__rx().set_implicit_omit(); if (num__pkts__rx__err__seq().is_bound()) num__pkts__rx__err__seq().set_implicit_omit(); if (num__pkts__rx__err__ts().is_bound()) num__pkts__rx__err__ts().set_implicit_omit(); if (num__pkts__rx__err__pt().is_bound()) num__pkts__rx__err__pt().set_implicit_omit(); if (num__pkts__rx__err__disabled().is_bound()) num__pkts__rx__err__disabled().set_implicit_omit(); if (num__pkts__rx__err__payload().is_bound()) num__pkts__rx__err__payload().set_implicit_omit(); } void RtpemStats_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_num__pkts__tx.encode_text(text_buf); single_value->field_bytes__payload__tx.encode_text(text_buf); single_value->field_num__pkts__rx.encode_text(text_buf); single_value->field_bytes__payload__rx.encode_text(text_buf); single_value->field_num__pkts__rx__err__seq.encode_text(text_buf); single_value->field_num__pkts__rx__err__ts.encode_text(text_buf); single_value->field_num__pkts__rx__err__pt.encode_text(text_buf); single_value->field_num__pkts__rx__err__disabled.encode_text(text_buf); single_value->field_num__pkts__rx__err__payload.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 @RTP_Emulation.RtpemStats."); } } void RtpemStats_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_num__pkts__tx.decode_text(text_buf); single_value->field_bytes__payload__tx.decode_text(text_buf); single_value->field_num__pkts__rx.decode_text(text_buf); single_value->field_bytes__payload__rx.decode_text(text_buf); single_value->field_num__pkts__rx__err__seq.decode_text(text_buf); single_value->field_num__pkts__rx__err__ts.decode_text(text_buf); single_value->field_num__pkts__rx__err__pt.decode_text(text_buf); single_value->field_num__pkts__rx__err__disabled.decode_text(text_buf); single_value->field_num__pkts__rx__err__payload.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 RtpemStats_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 @RTP_Emulation.RtpemStats."); } } void RtpemStats_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: { RtpemStats_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) num__pkts__tx().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__tx().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__rx().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__seq().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__ts().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__pt().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__disabled().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__payload().set_param(*param.get_elem(8)); 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(), "num_pkts_tx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__tx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bytes_payload_tx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bytes__payload__tx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bytes_payload_rx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bytes__payload__rx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_seq")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__seq().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_ts")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__ts().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_pt")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__pt().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_disabled")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__disabled().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "num_pkts_rx_err_payload")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { num__pkts__rx__err__payload().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RTP_Emulation.RtpemStats: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RtpemStats_template* precondition = new RtpemStats_template; precondition->set_param(*param.get_elem(0)); RtpemStats_template* implied_template = new RtpemStats_template; implied_template->set_param(*param.get_elem(1)); *this = RtpemStats_template(precondition, implied_template); } break; default: param.type_error("record template", "@RTP_Emulation.RtpemStats"); } is_ifpresent = param.get_ifpresent(); } void RtpemStats_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_num__pkts__tx.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_bytes__payload__tx.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_bytes__payload__rx.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx__err__seq.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx__err__ts.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx__err__pt.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx__err__disabled.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); single_value->field_num__pkts__rx__err__payload.check_restriction(t_res, t_name ? t_name : "@RTP_Emulation.RtpemStats"); 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 : "@RTP_Emulation.RtpemStats"); } boolean RtpemStats_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemStats_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RTP_Emulation.RtpemMode."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RTP_Emulation.RtpemMode comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean RtpemMode::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RTP_Emulation.RtpemMode."); return enum_value > other_value; } boolean RtpemMode::operator>(const RtpemMode& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RTP_Emulation.RtpemMode."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RTP_Emulation.RtpemMode."); return enum_value > other_value.enum_value; } const char *RtpemMode::enum_to_str(enum_type enum_par) { switch (enum_par) { case RTPEM__MODE__NONE: return "RTPEM_MODE_NONE"; case RTPEM__MODE__TXONLY: return "RTPEM_MODE_TXONLY"; case RTPEM__MODE__RXONLY: return "RTPEM_MODE_RXONLY"; case RTPEM__MODE__BIDIR: return "RTPEM_MODE_BIDIR"; case RTPEM__MODE__LOOPBACK: return "RTPEM_MODE_LOOPBACK"; default: return ""; } } RtpemMode::enum_type RtpemMode::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "RTPEM_MODE_NONE")) return RTPEM__MODE__NONE; if (!strcmp(str_par, "RTPEM_MODE_TXONLY")) return RTPEM__MODE__TXONLY; if (!strcmp(str_par, "RTPEM_MODE_RXONLY")) return RTPEM__MODE__RXONLY; if (!strcmp(str_par, "RTPEM_MODE_BIDIR")) return RTPEM__MODE__BIDIR; if (!strcmp(str_par, "RTPEM_MODE_LOOPBACK")) return RTPEM__MODE__LOOPBACK; } return UNKNOWN_VALUE; } boolean RtpemMode::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: case 4: return TRUE; default: return FALSE; } } int RtpemMode::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RTP_Emulation.RtpemMode.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int RtpemMode::enum2int(const RtpemMode& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RTP_Emulation.RtpemMode.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void RtpemMode::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RTP_Emulation.RtpemMode.", int_val); enum_value = (enum_type)int_val; } RtpemMode::operator RtpemMode::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RTP_Emulation.RtpemMode."); return enum_value; } void RtpemMode::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void RtpemMode::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RTP_Emulation.RtpemMode"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RTP_Emulation.RtpemMode."); } } void RtpemMode::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RTP_Emulation.RtpemMode."); text_buf.push_int(enum_value); } void RtpemMode::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RTP_Emulation.RtpemMode.", enum_value); } void RtpemMode_template::copy_template(const RtpemMode_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new RtpemMode_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 RtpemMode_template(*other_value.implication_.precondition); implication_.implied_template = new RtpemMode_template(*other_value.implication_.implied_template); break; case DYNAMIC_MATCH: dyn_match = other_value.dyn_match; dyn_match->ref_count++; break; default: TTCN_error("Copying an uninitialized/unsupported template of enumerated type @RTP_Emulation.RtpemMode."); } } RtpemMode_template::RtpemMode_template() { } RtpemMode_template::RtpemMode_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RtpemMode_template::RtpemMode_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!RtpemMode::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RTP_Emulation.RtpemMode with unknown numeric value %d.", other_value); single_value = (RtpemMode::enum_type)other_value; } RtpemMode_template::RtpemMode_template(RtpemMode::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } RtpemMode_template::RtpemMode_template(const RtpemMode& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == RtpemMode::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RTP_Emulation.RtpemMode."); single_value = other_value.enum_value; } RtpemMode_template::RtpemMode_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (RtpemMode::enum_type)(const RtpemMode&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RTP_Emulation.RtpemMode from an unbound optional field."); } } RtpemMode_template::RtpemMode_template(RtpemMode_template* p_precondition, RtpemMode_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RtpemMode_template::RtpemMode_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; } RtpemMode_template::RtpemMode_template(const RtpemMode_template& other_value) : Base_Template() { copy_template(other_value); } RtpemMode_template::~RtpemMode_template() { clean_up(); } boolean RtpemMode_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean RtpemMode_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != RtpemMode::UNBOUND_VALUE; } void RtpemMode_template::clean_up() { switch (template_selection) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: delete [] value_list.list_value; break; case IMPLICATION_MATCH: delete implication_.precondition; delete implication_.implied_template; break; case DYNAMIC_MATCH: dyn_match->ref_count--; if (dyn_match->ref_count == 0) { delete dyn_match->ptr; delete dyn_match; } break; default: break; } template_selection = UNINITIALIZED_TEMPLATE; } RtpemMode_template& RtpemMode_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RtpemMode_template& RtpemMode_template::operator=(int other_value) { if (!RtpemMode::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RTP_Emulation.RtpemMode.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (RtpemMode::enum_type)other_value; return *this; } RtpemMode_template& RtpemMode_template::operator=(RtpemMode::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } RtpemMode_template& RtpemMode_template::operator=(const RtpemMode& other_value) { if (other_value.enum_value == RtpemMode::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RTP_Emulation.RtpemMode to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } RtpemMode_template& RtpemMode_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (RtpemMode::enum_type)(const RtpemMode&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RTP_Emulation.RtpemMode."); } return *this; } RtpemMode_template& RtpemMode_template::operator=(const RtpemMode_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RtpemMode_template::match(RtpemMode::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of enumerated type @RTP_Emulation.RtpemMode."); } return FALSE; } boolean RtpemMode_template::match(const RtpemMode& other_value, boolean) const { if (other_value.enum_value == RtpemMode::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RTP_Emulation.RtpemMode with an unbound value."); return match(other_value.enum_value); } RtpemMode::enum_type RtpemMode_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RTP_Emulation.RtpemMode."); return single_value; } void RtpemMode_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RtpemMode_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RTP_Emulation.RtpemMode."); } } RtpemMode_template& RtpemMode_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RTP_Emulation.RtpemMode."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RTP_Emulation.RtpemMode."); return value_list.list_value[list_index]; } void RtpemMode_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(RtpemMode::enum_to_str(single_value), single_value); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_ifpresent(); } void RtpemMode_template::log_match(const RtpemMode& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void RtpemMode_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RTP_Emulation.RtpemMode."); } } void RtpemMode_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (RtpemMode::enum_type)text_buf.pull_int().get_val(); if (!RtpemMode::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RTP_Emulation.RtpemMode.", single_value); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new RtpemMode_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RTP_Emulation.RtpemMode."); } } boolean RtpemMode_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RtpemMode_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iget_type()) { case Module_Param::MP_Omit: *this = OMIT_VALUE; break; case Module_Param::MP_Any: *this = ANY_VALUE; break; case Module_Param::MP_AnyOrNone: *this = ANY_OR_OMIT; break; case Module_Param::MP_List_Template: case Module_Param::MP_ComplementList_Template: case Module_Param::MP_ConjunctList_Template: { RtpemMode_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { RtpemMode::enum_type enum_val = RtpemMode::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!RtpemMode::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RTP_Emulation.RtpemMode."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { RtpemMode_template* precondition = new RtpemMode_template; precondition->set_param(*m_p->get_elem(0)); RtpemMode_template* implied_template = new RtpemMode_template; implied_template->set_param(*m_p->get_elem(1)); *this = RtpemMode_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RTP_Emulation.RtpemMode"); } is_ifpresent = param.get_ifpresent(); } void RtpemMode_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; case TR_PRESENT: if (!match_omit(legacy)) return; break; default: return; } TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@RTP_Emulation.RtpemMode"); } void RTPEM__bind_call::encode_text(Text_Buf& text_buf) const { param_local__host.encode_text(text_buf); param_local__port.encode_text(text_buf); } void RTPEM__bind_call::decode_text(Text_Buf& text_buf) { param_local__host.decode_text(text_buf); param_local__port.decode_text(text_buf); } void RTPEM__bind_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_bind : { "); TTCN_Logger::log_event_str("local_host := "); param_local__host.log(); TTCN_Logger::log_event_str(", local_port := "); param_local__port.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__bind_call_redirect::set_parameters(const RTPEM__bind_call& call_par) const { if (ptr_local__host != NULL) *ptr_local__host = call_par.local__host(); if (ptr_local__port != NULL) *ptr_local__port = call_par.local__port(); } void RTPEM__bind_reply::encode_text(Text_Buf& text_buf) const { param_local__port.encode_text(text_buf); } void RTPEM__bind_reply::decode_text(Text_Buf& text_buf) { param_local__port.decode_text(text_buf); } void RTPEM__bind_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_bind : { "); TTCN_Logger::log_event_str("local_port := "); param_local__port.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__bind_reply_redirect::set_parameters(const RTPEM__bind_reply& reply_par) const { if (ptr_local__port != NULL) *ptr_local__port = reply_par.local__port(); } RTPEM__bind_template::RTPEM__bind_template() : param_local__host(ANY_VALUE), param_local__port(ANY_VALUE) { } RTPEM__bind_call RTPEM__bind_template::create_call() const { RTPEM__bind_call ret_val; ret_val.local__host() = param_local__host.valueof(); ret_val.local__port() = param_local__port.valueof(); return ret_val; } RTPEM__bind_reply RTPEM__bind_template::create_reply() const { RTPEM__bind_reply ret_val; ret_val.local__port() = param_local__port.valueof(); return ret_val; } boolean RTPEM__bind_template::match_call(const RTPEM__bind_call& match_value, boolean legacy) const { return param_local__host.match(match_value.local__host(), legacy) && param_local__port.match(match_value.local__port(), legacy); } boolean RTPEM__bind_template::match_reply(const RTPEM__bind_reply& match_value, boolean legacy) const { return param_local__port.match(match_value.local__port(), legacy); } void RTPEM__bind_template::log() const { TTCN_Logger::log_event_str("{ local_host := "); param_local__host.log(); TTCN_Logger::log_event_str(", local_port := "); param_local__port.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__bind_template::log_match_call(const RTPEM__bind_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ local_host := "); param_local__host.log_match(match_value.local__host(), legacy); TTCN_Logger::log_event_str(", local_port := "); param_local__port.log_match(match_value.local__port(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__bind_template::log_match_reply(const RTPEM__bind_reply& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ local_port := "); param_local__port.log_match(match_value.local__port(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__bind_template::encode_text(Text_Buf& text_buf) const { param_local__host.encode_text(text_buf); param_local__port.encode_text(text_buf); } void RTPEM__bind_template::decode_text(Text_Buf& text_buf) { param_local__host.decode_text(text_buf); param_local__port.decode_text(text_buf); } void RTPEM__connect_call::encode_text(Text_Buf& text_buf) const { param_remote__host.encode_text(text_buf); param_remote__port.encode_text(text_buf); } void RTPEM__connect_call::decode_text(Text_Buf& text_buf) { param_remote__host.decode_text(text_buf); param_remote__port.decode_text(text_buf); } void RTPEM__connect_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_connect : { "); TTCN_Logger::log_event_str("remote_host := "); param_remote__host.log(); TTCN_Logger::log_event_str(", remote_port := "); param_remote__port.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__connect_call_redirect::set_parameters(const RTPEM__connect_call& call_par) const { if (ptr_remote__host != NULL) *ptr_remote__host = call_par.remote__host(); if (ptr_remote__port != NULL) *ptr_remote__port = call_par.remote__port(); } void RTPEM__connect_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_connect : { }"); } RTPEM__connect_template::RTPEM__connect_template() : param_remote__host(ANY_VALUE), param_remote__port(ANY_VALUE) { } RTPEM__connect_call RTPEM__connect_template::create_call() const { RTPEM__connect_call ret_val; ret_val.remote__host() = param_remote__host.valueof(); ret_val.remote__port() = param_remote__port.valueof(); return ret_val; } boolean RTPEM__connect_template::match_call(const RTPEM__connect_call& match_value, boolean legacy) const { return param_remote__host.match(match_value.remote__host(), legacy) && param_remote__port.match(match_value.remote__port(), legacy); } void RTPEM__connect_template::log() const { TTCN_Logger::log_event_str("{ remote_host := "); param_remote__host.log(); TTCN_Logger::log_event_str(", remote_port := "); param_remote__port.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__connect_template::log_match_call(const RTPEM__connect_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ remote_host := "); param_remote__host.log_match(match_value.remote__host(), legacy); TTCN_Logger::log_event_str(", remote_port := "); param_remote__port.log_match(match_value.remote__port(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__connect_template::log_match_reply(const RTPEM__connect_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RTPEM__connect_template::encode_text(Text_Buf& text_buf) const { param_remote__host.encode_text(text_buf); param_remote__port.encode_text(text_buf); } void RTPEM__connect_template::decode_text(Text_Buf& text_buf) { param_remote__host.decode_text(text_buf); param_remote__port.decode_text(text_buf); } void RTPEM__mode_call::encode_text(Text_Buf& text_buf) const { param_mode.encode_text(text_buf); } void RTPEM__mode_call::decode_text(Text_Buf& text_buf) { param_mode.decode_text(text_buf); } void RTPEM__mode_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_mode : { "); TTCN_Logger::log_event_str("mode := "); param_mode.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__mode_call_redirect::set_parameters(const RTPEM__mode_call& call_par) const { if (ptr_mode != NULL) *ptr_mode = call_par.mode(); } void RTPEM__mode_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_mode : { }"); } RTPEM__mode_template::RTPEM__mode_template() : param_mode(ANY_VALUE) { } RTPEM__mode_call RTPEM__mode_template::create_call() const { RTPEM__mode_call ret_val; ret_val.mode() = param_mode.valueof(); return ret_val; } boolean RTPEM__mode_template::match_call(const RTPEM__mode_call& match_value, boolean legacy) const { return param_mode.match(match_value.mode(), legacy); } void RTPEM__mode_template::log() const { TTCN_Logger::log_event_str("{ mode := "); param_mode.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__mode_template::log_match_call(const RTPEM__mode_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ mode := "); param_mode.log_match(match_value.mode(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__mode_template::log_match_reply(const RTPEM__mode_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RTPEM__mode_template::encode_text(Text_Buf& text_buf) const { param_mode.encode_text(text_buf); } void RTPEM__mode_template::decode_text(Text_Buf& text_buf) { param_mode.decode_text(text_buf); } void RTPEM__configure_call::encode_text(Text_Buf& text_buf) const { param_cfg.encode_text(text_buf); } void RTPEM__configure_call::decode_text(Text_Buf& text_buf) { param_cfg.decode_text(text_buf); } void RTPEM__configure_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_configure : { "); TTCN_Logger::log_event_str("cfg := "); param_cfg.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__configure_call_redirect::set_parameters(const RTPEM__configure_call& call_par) const { if (ptr_cfg != NULL) *ptr_cfg = call_par.cfg(); } void RTPEM__configure_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_configure : { }"); } RTPEM__configure_template::RTPEM__configure_template() : param_cfg(ANY_VALUE) { } RTPEM__configure_call RTPEM__configure_template::create_call() const { RTPEM__configure_call ret_val; ret_val.cfg() = param_cfg.valueof(); return ret_val; } boolean RTPEM__configure_template::match_call(const RTPEM__configure_call& match_value, boolean legacy) const { return param_cfg.match(match_value.cfg(), legacy); } void RTPEM__configure_template::log() const { TTCN_Logger::log_event_str("{ cfg := "); param_cfg.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__configure_template::log_match_call(const RTPEM__configure_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ cfg := "); param_cfg.log_match(match_value.cfg(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__configure_template::log_match_reply(const RTPEM__configure_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RTPEM__configure_template::encode_text(Text_Buf& text_buf) const { param_cfg.encode_text(text_buf); } void RTPEM__configure_template::decode_text(Text_Buf& text_buf) { param_cfg.decode_text(text_buf); } void RTPEM__stats__get_call::encode_text(Text_Buf& text_buf) const { param_rtcp.encode_text(text_buf); } void RTPEM__stats__get_call::decode_text(Text_Buf& text_buf) { param_rtcp.decode_text(text_buf); } void RTPEM__stats__get_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_stats_get : { "); TTCN_Logger::log_event_str("rtcp := "); param_rtcp.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__stats__get_call_redirect::set_parameters(const RTPEM__stats__get_call& call_par) const { if (ptr_rtcp != NULL) *ptr_rtcp = call_par.rtcp(); } void RTPEM__stats__get_reply::encode_text(Text_Buf& text_buf) const { param_stats.encode_text(text_buf); } void RTPEM__stats__get_reply::decode_text(Text_Buf& text_buf) { param_stats.decode_text(text_buf); } void RTPEM__stats__get_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_stats_get : { "); TTCN_Logger::log_event_str("stats := "); param_stats.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__stats__get_reply_redirect::set_parameters(const RTPEM__stats__get_reply& reply_par) const { if (ptr_stats != NULL) *ptr_stats = reply_par.stats(); } RTPEM__stats__get_template::RTPEM__stats__get_template() : param_stats(ANY_VALUE), param_rtcp(ANY_VALUE) { } RTPEM__stats__get_call RTPEM__stats__get_template::create_call() const { RTPEM__stats__get_call ret_val; ret_val.rtcp() = param_rtcp.valueof(); return ret_val; } RTPEM__stats__get_reply RTPEM__stats__get_template::create_reply() const { RTPEM__stats__get_reply ret_val; ret_val.stats() = param_stats.valueof(); return ret_val; } boolean RTPEM__stats__get_template::match_call(const RTPEM__stats__get_call& match_value, boolean legacy) const { return param_rtcp.match(match_value.rtcp(), legacy); } boolean RTPEM__stats__get_template::match_reply(const RTPEM__stats__get_reply& match_value, boolean legacy) const { return param_stats.match(match_value.stats(), legacy); } void RTPEM__stats__get_template::log() const { TTCN_Logger::log_event_str("{ stats := "); param_stats.log(); TTCN_Logger::log_event_str(", rtcp := "); param_rtcp.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__stats__get_template::log_match_call(const RTPEM__stats__get_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ rtcp := "); param_rtcp.log_match(match_value.rtcp(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__stats__get_template::log_match_reply(const RTPEM__stats__get_reply& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ stats := "); param_stats.log_match(match_value.stats(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__stats__get_template::encode_text(Text_Buf& text_buf) const { param_stats.encode_text(text_buf); param_rtcp.encode_text(text_buf); } void RTPEM__stats__get_template::decode_text(Text_Buf& text_buf) { param_stats.decode_text(text_buf); param_rtcp.decode_text(text_buf); } void RTPEM__conn__refuse__expect_call::encode_text(Text_Buf& text_buf) const { param_expect.encode_text(text_buf); } void RTPEM__conn__refuse__expect_call::decode_text(Text_Buf& text_buf) { param_expect.decode_text(text_buf); } void RTPEM__conn__refuse__expect_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_conn_refuse_expect : { "); TTCN_Logger::log_event_str("expect := "); param_expect.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__expect_call_redirect::set_parameters(const RTPEM__conn__refuse__expect_call& call_par) const { if (ptr_expect != NULL) *ptr_expect = call_par.expect(); } void RTPEM__conn__refuse__expect_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_conn_refuse_expect : { }"); } RTPEM__conn__refuse__expect_template::RTPEM__conn__refuse__expect_template() : param_expect(ANY_VALUE) { } RTPEM__conn__refuse__expect_call RTPEM__conn__refuse__expect_template::create_call() const { RTPEM__conn__refuse__expect_call ret_val; ret_val.expect() = param_expect.valueof(); return ret_val; } boolean RTPEM__conn__refuse__expect_template::match_call(const RTPEM__conn__refuse__expect_call& match_value, boolean legacy) const { return param_expect.match(match_value.expect(), legacy); } void RTPEM__conn__refuse__expect_template::log() const { TTCN_Logger::log_event_str("{ expect := "); param_expect.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__expect_template::log_match_call(const RTPEM__conn__refuse__expect_call& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ expect := "); param_expect.log_match(match_value.expect(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__expect_template::log_match_reply(const RTPEM__conn__refuse__expect_reply& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RTPEM__conn__refuse__expect_template::encode_text(Text_Buf& text_buf) const { param_expect.encode_text(text_buf); } void RTPEM__conn__refuse__expect_template::decode_text(Text_Buf& text_buf) { param_expect.decode_text(text_buf); } void RTPEM__conn__refuse__received_call::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_conn_refuse_received : { }"); } void RTPEM__conn__refuse__received_reply::encode_text(Text_Buf& text_buf) const { param_received.encode_text(text_buf); } void RTPEM__conn__refuse__received_reply::decode_text(Text_Buf& text_buf) { param_received.decode_text(text_buf); } void RTPEM__conn__refuse__received_reply::log() const { TTCN_Logger::log_event_str("@RTP_Emulation.RTPEM_conn_refuse_received : { "); TTCN_Logger::log_event_str("received := "); param_received.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__received_reply_redirect::set_parameters(const RTPEM__conn__refuse__received_reply& reply_par) const { if (ptr_received != NULL) *ptr_received = reply_par.received(); } RTPEM__conn__refuse__received_template::RTPEM__conn__refuse__received_template() : param_received(ANY_VALUE) { } RTPEM__conn__refuse__received_reply RTPEM__conn__refuse__received_template::create_reply() const { RTPEM__conn__refuse__received_reply ret_val; ret_val.received() = param_received.valueof(); return ret_val; } boolean RTPEM__conn__refuse__received_template::match_reply(const RTPEM__conn__refuse__received_reply& match_value, boolean legacy) const { return param_received.match(match_value.received(), legacy); } void RTPEM__conn__refuse__received_template::log() const { TTCN_Logger::log_event_str("{ received := "); param_received.log(); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__received_template::log_match_call(const RTPEM__conn__refuse__received_call& , boolean) const { TTCN_Logger::log_event_str("{ } with { } matched"); } void RTPEM__conn__refuse__received_template::log_match_reply(const RTPEM__conn__refuse__received_reply& match_value, boolean legacy) const { TTCN_Logger::log_event_str("{ received := "); param_received.log_match(match_value.received(), legacy); TTCN_Logger::log_event_str(" }"); } void RTPEM__conn__refuse__received_template::encode_text(Text_Buf& text_buf) const { param_received.encode_text(text_buf); } void RTPEM__conn__refuse__received_template::decode_text(Text_Buf& text_buf) { param_received.decode_text(text_buf); } void RTPEM__CTRL__PT::append_to_proc_queue(proc_queue_item *new_item) { new_item->next_item = NULL; if (proc_queue_tail != NULL) proc_queue_tail->next_item = new_item; else proc_queue_head = new_item; proc_queue_tail = new_item; } void RTPEM__CTRL__PT::remove_proc_queue_head() { switch (proc_queue_head->item_selection) { case CALL_0: delete proc_queue_head->call_0; break; case CALL_1: delete proc_queue_head->call_1; break; case CALL_2: delete proc_queue_head->call_2; break; case CALL_3: delete proc_queue_head->call_3; break; case CALL_4: delete proc_queue_head->call_4; break; case CALL_5: delete proc_queue_head->call_5; break; case CALL_6: delete proc_queue_head->call_6; break; case REPLY_0: delete proc_queue_head->reply_0; break; case REPLY_1: delete proc_queue_head->reply_1; break; case REPLY_2: delete proc_queue_head->reply_2; break; case REPLY_3: delete proc_queue_head->reply_3; break; case REPLY_4: delete proc_queue_head->reply_4; break; case REPLY_5: delete proc_queue_head->reply_5; break; case REPLY_6: delete proc_queue_head->reply_6; break; default: TTCN_error("Internal error: Invalid signature selector in the queue of port %s.", port_name); } proc_queue_item *next_item = proc_queue_head->next_item; delete proc_queue_head; proc_queue_head = next_item; if (next_item == NULL) proc_queue_tail = NULL; TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__op, port_name, 0, ++proc_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));} void RTPEM__CTRL__PT::clear_queue() { while (proc_queue_head != NULL) remove_proc_queue_head(); } RTPEM__CTRL__PT::RTPEM__CTRL__PT(const char *par_port_name) : PORT(par_port_name) { proc_queue_head = NULL; proc_queue_tail = NULL; } RTPEM__CTRL__PT::~RTPEM__CTRL__PT() { clear_queue(); } void RTPEM__CTRL__PT::call(const RTPEM__bind_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__bind_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_bind"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__bind_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__bind_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_bind"); const RTPEM__bind_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__connect_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__connect_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_connect"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__connect_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__connect_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_connect"); const RTPEM__connect_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__mode_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__mode_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_mode"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__mode_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__mode_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_mode"); const RTPEM__mode_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__configure_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__configure_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_configure"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__configure_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__configure_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_configure"); const RTPEM__configure_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__stats__get_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__stats__get_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_stats_get"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__stats__get_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__stats__get_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_stats_get"); const RTPEM__stats__get_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__expect_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__conn__refuse__expect_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_expect"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__expect_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__expect_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_expect"); const RTPEM__conn__refuse__expect_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__received_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation."); const RTPEM__conn__refuse__received_call& call_tmp = call_template.create_call(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component, CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name); else { Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_received"); call_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__received_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::call(const RTPEM__conn__refuse__received_template& call_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_call(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_received"); const RTPEM__conn__refuse__received_call& call_tmp = call_template.create_call(); call_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str())); } else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__bind_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__bind_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_bind"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__bind_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__bind_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_bind"); const RTPEM__bind_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__connect_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__connect_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_connect"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__connect_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__connect_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_connect"); const RTPEM__connect_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__mode_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__mode_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_mode"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__mode_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__mode_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_mode"); const RTPEM__mode_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__configure_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__configure_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_configure"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__configure_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__configure_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_configure"); const RTPEM__configure_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__stats__get_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__stats__get_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_stats_get"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__stats__get_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__stats__get_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_stats_get"); const RTPEM__stats__get_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__expect_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__conn__refuse__expect_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_expect"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__expect_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__expect_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_expect"); const RTPEM__conn__refuse__expect_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__received_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation."); const RTPEM__conn__refuse__received_reply& reply_tmp = reply_template.create_reply(); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name); else { Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_received"); reply_tmp.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__received_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect); } void RTPEM__CTRL__PT::reply(const RTPEM__conn__refuse__received_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_reply(text_buf, "@RTP_Emulation.RTPEM_conn_refuse_received"); const RTPEM__conn__refuse__received_reply& reply_tmp = reply_template.create_reply(); reply_tmp.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str())); } else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect); } alt_status RTPEM__CTRL__PT::getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else switch (proc_queue_head->item_selection) { case CALL_0: case CALL_1: case CALL_2: case CALL_3: case CALL_4: case CALL_5: case CALL_6: { if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, CHARSTRING(0, NULL), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } default: TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name); return ALT_NO; } } alt_status RTPEM__CTRL__PT::check_getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else switch (proc_queue_head->item_selection) { case CALL_0: case CALL_1: case CALL_2: case CALL_3: case CALL_4: case CALL_5: case CALL_6: { if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, CHARSTRING(0, NULL), msg_head_count+1); } return ALT_YES; } default: TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name); return ALT_NO; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__bind_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__bind_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_0) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_bind.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_0)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_0); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_0); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__bind_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__bind_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_0) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_bind.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_0)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_0); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_0); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__connect_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__connect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_1) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_connect.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_1)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_1); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_1); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__connect_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__connect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_1) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_connect.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_1)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_1); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_1); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__mode_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__mode_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_2) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_mode.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_2)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_2); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_2); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__mode_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__mode_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_2) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_mode.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_2)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_2); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_2); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__configure_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__configure_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_3) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_configure.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_3)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_3); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_3); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__configure_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__configure_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_3) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_configure.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_3)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_3); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_3); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__stats__get_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__stats__get_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_4) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_stats_get.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_4)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_4); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_4); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__stats__get_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__stats__get_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_4) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_stats_get.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_4)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_4); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_4); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__conn__refuse__expect_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__expect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_5) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_conn_refuse_expect.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_5)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_5); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_5); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__conn__refuse__expect_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__expect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_5) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_conn_refuse_expect.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_5)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_5); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_5); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getcall(const RTPEM__conn__refuse__received_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__received_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_6) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_conn_refuse_received.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_6)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_6); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_6); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getcall(const RTPEM__conn__refuse__received_template& getcall_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__received_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause, (TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else if (proc_queue_head->item_selection != CALL_6) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @RTP_Emulation.RTPEM_conn_refuse_received.", port_name); return ALT_NO; } else if (!getcall_template.match_call(*proc_queue_head->call_6)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->call_6); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getcall_template.log_match_call(*proc_queue_head->call_6); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else switch (proc_queue_head->item_selection) { case REPLY_0: case REPLY_1: case REPLY_2: case REPLY_3: case REPLY_4: case REPLY_5: case REPLY_6: { if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, CHARSTRING(0, NULL), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } default: TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name); return ALT_NO; } } alt_status RTPEM__CTRL__PT::check_getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else switch (proc_queue_head->item_selection) { case REPLY_0: case REPLY_1: case REPLY_2: case REPLY_3: case REPLY_4: case REPLY_5: case REPLY_6: { if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, CHARSTRING(0, NULL), msg_head_count+1); } return ALT_YES; } default: TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name); return ALT_NO; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__bind_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__bind_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_0) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_bind.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_0); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_0); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__bind_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__bind_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_0) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_bind.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_0); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_0); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__connect_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__connect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_1) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_connect.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_1); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_1); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__connect_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__connect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_1) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_connect.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_1); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_1); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__mode_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__mode_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_2) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_mode.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_2)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_2); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_2); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__mode_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__mode_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_2) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_mode.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_2)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_2); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_2); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__configure_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__configure_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_3) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_configure.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_3); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_3); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__configure_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__configure_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_3) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_configure.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_3); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_3); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__stats__get_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__stats__get_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_4) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_stats_get.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_4); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_4); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__stats__get_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__stats__get_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_4) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_stats_get.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_4); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_4); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__conn__refuse__expect_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__expect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_5) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_conn_refuse_expect.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_5); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_5); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__conn__refuse__expect_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__expect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_5) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_conn_refuse_expect.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_5); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_5); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__CTRL__PT::getreply(const RTPEM__conn__refuse__received_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__received_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_6) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_conn_refuse_received.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_6)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_6); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_6); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_proc_queue_head(); return ALT_YES; } } alt_status RTPEM__CTRL__PT::check_getreply(const RTPEM__conn__refuse__received_template& getreply_template, const COMPONENT_template& sender_template, const RTPEM__conn__refuse__received_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (proc_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(proc_queue_head->sender_component)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name); sender_template.log_match(proc_queue_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (proc_queue_head->item_selection != REPLY_6) { TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @RTP_Emulation.RTPEM_conn_refuse_received.", port_name); return ALT_NO; } else if (!getreply_template.match_reply(*proc_queue_head->reply_6)) { const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__, port_name, proc_queue_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { param_ref.set_parameters(*proc_queue_head->reply_6); if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component; TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name); getreply_template.log_match_reply(*proc_queue_head->reply_6); TTCN_Logger::end_event(); } log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE, (TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } void RTPEM__CTRL__PT::incoming_call(const RTPEM__bind_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_0; new_item->call_0 = new RTPEM__bind_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__connect_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_1; new_item->call_1 = new RTPEM__connect_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__mode_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_2; new_item->call_2 = new RTPEM__mode_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__configure_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_3; new_item->call_3 = new RTPEM__configure_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__stats__get_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_4; new_item->call_4 = new RTPEM__stats__get_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__conn__refuse__expect_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_5; new_item->call_5 = new RTPEM__conn__refuse__expect_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_call(const RTPEM__conn__refuse__received_call& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a call has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = CALL_6; new_item->call_6 = new RTPEM__conn__refuse__received_call(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__bind_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_0; new_item->reply_0 = new RTPEM__bind_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__connect_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_1; new_item->reply_1 = new RTPEM__connect_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__mode_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_2; new_item->reply_2 = new RTPEM__mode_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__configure_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_3; new_item->reply_3 = new RTPEM__configure_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__stats__get_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_4; new_item->reply_4 = new RTPEM__stats__get_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__conn__refuse__expect_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_5; new_item->reply_5 = new RTPEM__conn__refuse__expect_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } void RTPEM__CTRL__PT::incoming_reply(const RTPEM__conn__refuse__received_reply& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a reply has arrived on it.", port_name); } } proc_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str())); } proc_queue_item *new_item = new proc_queue_item; new_item->item_selection = REPLY_6; new_item->reply_6 = new RTPEM__conn__refuse__received_reply(incoming_par); new_item->sender_component = sender_component; append_to_proc_queue(new_item); } boolean RTPEM__CTRL__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component) { if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_bind")) { RTPEM__bind_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_connect")) { RTPEM__connect_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_mode")) { RTPEM__mode_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_configure")) { RTPEM__configure_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_stats_get")) { RTPEM__stats__get_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_conn_refuse_expect")) { RTPEM__conn__refuse__expect_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_conn_refuse_received")) { RTPEM__conn__refuse__received_call incoming_par; incoming_par.decode_text(incoming_buf); incoming_call(incoming_par, sender_component); return TRUE; } else return FALSE; } boolean RTPEM__CTRL__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component) { if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_bind")) { RTPEM__bind_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_connect")) { RTPEM__connect_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_mode")) { RTPEM__mode_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_configure")) { RTPEM__configure_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_stats_get")) { RTPEM__stats__get_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_conn_refuse_expect")) { RTPEM__conn__refuse__expect_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else if (!strcmp(signature_name, "@RTP_Emulation.RTPEM_conn_refuse_received")) { RTPEM__conn__refuse__received_reply incoming_par; incoming_par.decode_text(incoming_buf); incoming_reply(incoming_par, sender_component); return TRUE; } else return FALSE; } void RTPEM__DATA__PT::remove_msg_queue_head() { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; switch (my_head->item_selection) { case MESSAGE_0: delete (my_head)->message_0; break; case MESSAGE_1: delete (my_head)->message_1; break; default: TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name); } msg_queue_item_base *next_item = msg_queue_head->next_item; delete (msg_queue_item*)msg_queue_head; msg_queue_head = next_item; if (next_item == NULL) msg_queue_tail = NULL; TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));} void RTPEM__DATA__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } RTPEM__DATA__PT::RTPEM__DATA__PT(const char *par_port_name) : PORT(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } RTPEM__DATA__PT::~RTPEM__DATA__PT() { clear_queue(); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP& 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(" @RTP_Types.PDU_RTP : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@RTP_Types.PDU_RTP"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@RTP_Types.PDU_RTP"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @RTP_Types.PDU_RTP : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTP& send_par_value = RTP__Types::PDU__RTP(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTP& send_par_value = RTP__Types::PDU__RTP(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTP_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTP& send_par_value = RTP__Types::PDU__RTP(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP& 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(" @RTP_Types.PDU_RTCP : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@RTP_Types.PDU_RTCP"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@RTP_Types.PDU_RTCP"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @RTP_Types.PDU_RTCP : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTCP& send_par_value = RTP__Types::PDU__RTCP(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTCP& send_par_value = RTP__Types::PDU__RTCP(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void RTPEM__DATA__PT::send(const RTP__Types::PDU__RTCP_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RTP__Types::PDU__RTCP& send_par_value = RTP__Types::PDU__RTCP(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } alt_status RTPEM__DATA__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(": @RTP_Types.PDU_RTP: "), 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(": @RTP_Types.PDU_RTCP: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status RTPEM__DATA__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(": @RTP_Types.PDU_RTP: "), 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(": @RTP_Types.PDU_RTCP: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } return ALT_YES; } } alt_status RTPEM__DATA__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(": @RTP_Types.PDU_RTP: "), 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(": @RTP_Types.PDU_RTCP: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status RTPEM__DATA__PT::receive(const RTP__Types::PDU__RTP_template& value_template, RTP__Types::PDU__RTP *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 @RTP_Types.PDU_RTP.", 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(": @RTP_Types.PDU_RTP : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RTPEM__DATA__PT::check_receive(const RTP__Types::PDU__RTP_template& value_template, RTP__Types::PDU__RTP *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 @RTP_Types.PDU_RTP.", 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(": @RTP_Types.PDU_RTP : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__DATA__PT::trigger(const RTP__Types::PDU__RTP_template& value_template, RTP__Types::PDU__RTP *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 @RTP_Types.PDU_RTP.", 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(": @RTP_Types.PDU_RTP : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RTPEM__DATA__PT::receive(const RTP__Types::PDU__RTCP_template& value_template, RTP__Types::PDU__RTCP *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 @RTP_Types.PDU_RTCP.", 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(": @RTP_Types.PDU_RTCP : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status RTPEM__DATA__PT::check_receive(const RTP__Types::PDU__RTCP_template& value_template, RTP__Types::PDU__RTCP *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 @RTP_Types.PDU_RTCP.", 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(": @RTP_Types.PDU_RTCP : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status RTPEM__DATA__PT::trigger(const RTP__Types::PDU__RTCP_template& value_template, RTP__Types::PDU__RTCP *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 @RTP_Types.PDU_RTCP.", 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(": @RTP_Types.PDU_RTCP : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void RTPEM__DATA__PT::incoming_message(const RTP__Types::PDU__RTP& 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(" @RTP_Types.PDU_RTP : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = new RTP__Types::PDU__RTP(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void RTPEM__DATA__PT::incoming_message(const RTP__Types::PDU__RTCP& 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(" @RTP_Types.PDU_RTCP : "), 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 RTP__Types::PDU__RTCP(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } boolean RTPEM__DATA__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@RTP_Types.PDU_RTP")) { RTP__Types::PDU__RTP incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@RTP_Types.PDU_RTCP")) { RTP__Types::PDU__RTCP 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 */ boolean operator==(null_type, const RtpemConfig_tx__payloads& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.tx_payloads."); return other_value.val_ptr->n_elements == 0; } boolean operator==(null_type, const RtpemConfig_rx__payloads& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RTP_Emulation.RtpemConfig.rx_payloads."); return other_value.val_ptr->n_elements == 0; } void f__rtpem__bind(RTPEM__CTRL__PT& pt, const CHARSTRING& local__host, INTEGER& local__port) { TTCN_Location current_location("RTP_Emulation.ttcn", 200, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_bind"); current_location.update_lineno(201); /* RTP_Emulation.ttcn, line 201 */ { RTPEM__bind_template tmp_4; tmp_4.local__host() = local__host; tmp_4.local__port() = local__port; pt.call(tmp_4, FALSE, NULL); } { alt_status tmp_5_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(201); /* RTP_Emulation.ttcn, line 201 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_5_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(202); /* RTP_Emulation.ttcn, line 202 */ { RTPEM__bind_template tmp_6; tmp_6.local__host() = local__host; tmp_6.local__port() = ANY_VALUE; tmp_5_alt_flag_0 = pt.getreply(tmp_6, any_compref, RTPEM__bind_reply_redirect(&(local__port)), NULL, NULL, NULL); } if (tmp_5_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(201); /* RTP_Emulation.ttcn, line 201 */ if (tmp_5_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 201 and 203."); TTCN_Snapshot::take_new(TRUE); } } } void f__rtpem__connect(RTPEM__CTRL__PT& pt, const CHARSTRING& remote__host, const INTEGER& remote__port) { TTCN_Location current_location("RTP_Emulation.ttcn", 205, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_connect"); current_location.update_lineno(206); /* RTP_Emulation.ttcn, line 206 */ { RTPEM__connect_template tmp_7; tmp_7.remote__host() = remote__host; tmp_7.remote__port() = remote__port; pt.call(tmp_7, FALSE, NULL); } { alt_status tmp_8_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(206); /* RTP_Emulation.ttcn, line 206 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_8_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(207); /* RTP_Emulation.ttcn, line 207 */ { RTPEM__connect_template tmp_9; tmp_9.remote__host() = remote__host; tmp_9.remote__port() = remote__port; tmp_8_alt_flag_0 = pt.getreply(tmp_9, any_compref, RTPEM__connect_reply_redirect(), NULL, NULL, NULL); } if (tmp_8_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(206); /* RTP_Emulation.ttcn, line 206 */ if (tmp_8_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 206 and 208."); TTCN_Snapshot::take_new(TRUE); } } } void f__rtpem__mode(RTPEM__CTRL__PT& pt, const RtpemMode& mode) { TTCN_Location current_location("RTP_Emulation.ttcn", 210, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_mode"); current_location.update_lineno(211); /* RTP_Emulation.ttcn, line 211 */ { RTPEM__mode_template tmp_10; tmp_10.mode() = mode; pt.call(tmp_10, FALSE, NULL); } { alt_status tmp_11_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(211); /* RTP_Emulation.ttcn, line 211 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_11_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(212); /* RTP_Emulation.ttcn, line 212 */ { RTPEM__mode_template tmp_12; tmp_12.mode() = mode; tmp_11_alt_flag_0 = pt.getreply(tmp_12, any_compref, RTPEM__mode_reply_redirect(), NULL, NULL, NULL); } if (tmp_11_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(211); /* RTP_Emulation.ttcn, line 211 */ if (tmp_11_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 211 and 213."); TTCN_Snapshot::take_new(TRUE); } } } void f__rtpem__configure(RTPEM__CTRL__PT& pt, const RtpemConfig& cfg) { TTCN_Location current_location("RTP_Emulation.ttcn", 215, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_configure"); current_location.update_lineno(216); /* RTP_Emulation.ttcn, line 216 */ { RTPEM__configure_template tmp_13; tmp_13.cfg() = cfg; pt.call(tmp_13, FALSE, NULL); } { alt_status tmp_14_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(216); /* RTP_Emulation.ttcn, line 216 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_14_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(217); /* RTP_Emulation.ttcn, line 217 */ { RTPEM__configure_template tmp_15; tmp_15.cfg() = cfg; tmp_14_alt_flag_0 = pt.getreply(tmp_15, any_compref, RTPEM__configure_reply_redirect(), NULL, NULL, NULL); } if (tmp_14_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(216); /* RTP_Emulation.ttcn, line 216 */ if (tmp_14_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 216 and 218."); TTCN_Snapshot::take_new(TRUE); } } } RtpemStats f__rtpem__stats__get(RTPEM__CTRL__PT& pt, const BOOLEAN& rtcp) { TTCN_Location current_location("RTP_Emulation.ttcn", 220, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_stats_get"); current_location.update_lineno(221); /* RTP_Emulation.ttcn, line 221 */ RtpemStats stats; current_location.update_lineno(222); /* RTP_Emulation.ttcn, line 222 */ { RTPEM__stats__get_template tmp_16; tmp_16.rtcp() = rtcp; pt.call(tmp_16, FALSE, NULL); } { alt_status tmp_17_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(222); /* RTP_Emulation.ttcn, line 222 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_17_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(223); /* RTP_Emulation.ttcn, line 223 */ { RTPEM__stats__get_template tmp_18; tmp_18.stats() = ANY_VALUE; tmp_18.rtcp() = rtcp; tmp_17_alt_flag_0 = pt.getreply(tmp_18, any_compref, RTPEM__stats__get_reply_redirect(&(stats)), NULL, NULL, NULL); } if (tmp_17_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(222); /* RTP_Emulation.ttcn, line 222 */ if (tmp_17_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 222 and 224."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(225); /* RTP_Emulation.ttcn, line 225 */ return stats; } BOOLEAN f__rtpem__stats__compare__value(const INTEGER& a, const INTEGER& b, const INTEGER& tolerance) { TTCN_Location current_location("RTP_Emulation.ttcn", 228, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_stats_compare_value"); current_location.update_lineno(229); /* RTP_Emulation.ttcn, line 229 */ INTEGER temp; current_location.update_lineno(231); /* RTP_Emulation.ttcn, line 231 */ temp = (a - b); current_location.update_lineno(232); /* RTP_Emulation.ttcn, line 232 */ if ((temp < 0)) { current_location.update_lineno(233); /* RTP_Emulation.ttcn, line 233 */ { INTEGER tmp_20; tmp_20 = (-(temp)); temp = tmp_20; } } current_location.update_lineno(236); /* RTP_Emulation.ttcn, line 236 */ if ((temp > tolerance)) { current_location.update_lineno(237); /* RTP_Emulation.ttcn, line 237 */ return FALSE; } current_location.update_lineno(240); /* RTP_Emulation.ttcn, line 240 */ return TRUE; } BOOLEAN f__rtpem__stats__compare(const RtpemStats& a, const RtpemStats& b, const INTEGER& tolerance) { TTCN_Location current_location("RTP_Emulation.ttcn", 247, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_stats_compare"); current_location.update_lineno(248); /* RTP_Emulation.ttcn, line 248 */ INTEGER plen; current_location.update_lineno(250); /* RTP_Emulation.ttcn, line 250 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("stats A: "); a.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(251); /* RTP_Emulation.ttcn, line 251 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("stats B: "); b.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(252); /* RTP_Emulation.ttcn, line 252 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("tolerance: "); tolerance.log(); TTCN_Logger::log_event_str(" packets"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(254); /* RTP_Emulation.ttcn, line 254 */ if ((f__rtpem__stats__compare__value(const_cast< const RtpemStats&>(a).num__pkts__tx(), const_cast< const RtpemStats&>(b).num__pkts__rx(), tolerance) == FALSE)) { current_location.update_lineno(255); /* RTP_Emulation.ttcn, line 255 */ return FALSE; } current_location.update_lineno(258); /* RTP_Emulation.ttcn, line 258 */ if ((f__rtpem__stats__compare__value(const_cast< const RtpemStats&>(a).num__pkts__rx(), const_cast< const RtpemStats&>(b).num__pkts__tx(), tolerance) == FALSE)) { current_location.update_lineno(259); /* RTP_Emulation.ttcn, line 259 */ return FALSE; } current_location.update_lineno(262); /* RTP_Emulation.ttcn, line 262 */ if ((const_cast< const RtpemStats&>(a).num__pkts__tx() > 0)) { current_location.update_lineno(263); /* RTP_Emulation.ttcn, line 263 */ plen = (const_cast< const RtpemStats&>(a).bytes__payload__tx() / const_cast< const RtpemStats&>(a).num__pkts__tx()); } else { current_location.update_lineno(265); /* RTP_Emulation.ttcn, line 265 */ plen = 0; } current_location.update_lineno(268); /* RTP_Emulation.ttcn, line 268 */ if ((f__rtpem__stats__compare__value(const_cast< const RtpemStats&>(a).bytes__payload__tx(), const_cast< const RtpemStats&>(b).bytes__payload__rx(), (tolerance * plen)) == FALSE)) { current_location.update_lineno(269); /* RTP_Emulation.ttcn, line 269 */ return FALSE; } current_location.update_lineno(272); /* RTP_Emulation.ttcn, line 272 */ if ((f__rtpem__stats__compare__value(const_cast< const RtpemStats&>(a).bytes__payload__rx(), const_cast< const RtpemStats&>(b).bytes__payload__tx(), (tolerance * plen)) == FALSE)) { current_location.update_lineno(273); /* RTP_Emulation.ttcn, line 273 */ return FALSE; } current_location.update_lineno(276); /* RTP_Emulation.ttcn, line 276 */ return TRUE; } void f__rtpem__stats__err__check(const RtpemStats& s) { TTCN_Location current_location("RTP_Emulation.ttcn", 282, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_stats_err_check"); current_location.update_lineno(283); /* RTP_Emulation.ttcn, line 283 */ BOOLEAN do__stop(FALSE); current_location.update_lineno(284); /* RTP_Emulation.ttcn, line 284 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("stats: "); s.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(288); /* RTP_Emulation.ttcn, line 288 */ { boolean tmp_23; tmp_23 = (const_cast< const RtpemStats&>(s).num__pkts__tx() < 1); if (tmp_23) tmp_23 = (const_cast< const RtpemStats&>(s).num__pkts__rx() < 1); if (tmp_23) { current_location.update_lineno(289); /* RTP_Emulation.ttcn, line 289 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("no RTP packet activity detected (packets)"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(290); /* RTP_Emulation.ttcn, line 290 */ do__stop = TRUE; } } current_location.update_lineno(292); /* RTP_Emulation.ttcn, line 292 */ { boolean tmp_25; tmp_25 = (const_cast< const RtpemStats&>(s).bytes__payload__tx() < 1); if (tmp_25) tmp_25 = (const_cast< const RtpemStats&>(s).bytes__payload__rx() < 1); if (tmp_25) { current_location.update_lineno(293); /* RTP_Emulation.ttcn, line 293 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("no RTP packet activity detected (bytes)"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(294); /* RTP_Emulation.ttcn, line 294 */ do__stop = TRUE; } } current_location.update_lineno(298); /* RTP_Emulation.ttcn, line 298 */ if ((const_cast< const RtpemStats&>(s).num__pkts__rx__err__seq() != 0)) { current_location.update_lineno(299); /* RTP_Emulation.ttcn, line 299 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(TTCN_Logger::begin_event_log2str(),const_cast< const RtpemStats&>(s).num__pkts__rx__err__seq().log(),TTCN_Logger::log_event_str(" RTP packet sequence number errors occurred"),TTCN_Logger::end_event_log2str()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(300); /* RTP_Emulation.ttcn, line 300 */ do__stop = TRUE; } current_location.update_lineno(302); /* RTP_Emulation.ttcn, line 302 */ if ((const_cast< const RtpemStats&>(s).num__pkts__rx__err__ts() != 0)) { current_location.update_lineno(303); /* RTP_Emulation.ttcn, line 303 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(TTCN_Logger::begin_event_log2str(),const_cast< const RtpemStats&>(s).num__pkts__rx__err__ts().log(),TTCN_Logger::log_event_str(" RTP packet timestamp errors occurred"),TTCN_Logger::end_event_log2str()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(304); /* RTP_Emulation.ttcn, line 304 */ do__stop = TRUE; } current_location.update_lineno(306); /* RTP_Emulation.ttcn, line 306 */ if ((const_cast< const RtpemStats&>(s).num__pkts__rx__err__pt() != 0)) { current_location.update_lineno(307); /* RTP_Emulation.ttcn, line 307 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(TTCN_Logger::begin_event_log2str(),const_cast< const RtpemStats&>(s).num__pkts__rx__err__pt().log(),TTCN_Logger::log_event_str(" RTP packet payload type errors occurred"),TTCN_Logger::end_event_log2str()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(308); /* RTP_Emulation.ttcn, line 308 */ do__stop = TRUE; } current_location.update_lineno(310); /* RTP_Emulation.ttcn, line 310 */ if ((const_cast< const RtpemStats&>(s).num__pkts__rx__err__disabled() != 0)) { current_location.update_lineno(311); /* RTP_Emulation.ttcn, line 311 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(TTCN_Logger::begin_event_log2str(),const_cast< const RtpemStats&>(s).num__pkts__rx__err__disabled().log(),TTCN_Logger::log_event_str(" RTP packets received while RX was disabled"),TTCN_Logger::end_event_log2str()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(312); /* RTP_Emulation.ttcn, line 312 */ do__stop = TRUE; } current_location.update_lineno(314); /* RTP_Emulation.ttcn, line 314 */ if ((const_cast< const RtpemStats&>(s).num__pkts__rx__err__payload() != 0)) { current_location.update_lineno(315); /* RTP_Emulation.ttcn, line 315 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(TTCN_Logger::begin_event_log2str(),const_cast< const RtpemStats&>(s).num__pkts__rx__err__payload().log(),TTCN_Logger::log_event_str(" RTP packets with mismatching payload received"),TTCN_Logger::end_event_log2str()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(316); /* RTP_Emulation.ttcn, line 316 */ do__stop = TRUE; } current_location.update_lineno(319); /* RTP_Emulation.ttcn, line 319 */ if (do__stop) { current_location.update_lineno(320); /* RTP_Emulation.ttcn, line 320 */ if ((self == MTC_COMPREF)) { current_location.update_lineno(324); /* RTP_Emulation.ttcn, line 324 */ TTCN_Runtime::stop_component(ALL_COMPREF); } current_location.update_lineno(326); /* RTP_Emulation.ttcn, line 326 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } void f__rtpem__conn__refuse__expect(RTPEM__CTRL__PT& pt) { TTCN_Location current_location("RTP_Emulation.ttcn", 330, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_conn_refuse_expect"); current_location.update_lineno(331); /* RTP_Emulation.ttcn, line 331 */ { RTPEM__conn__refuse__expect_template tmp_32; tmp_32.expect() = TRUE; pt.call(tmp_32, FALSE, NULL); } { alt_status tmp_33_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(331); /* RTP_Emulation.ttcn, line 331 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_33_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(332); /* RTP_Emulation.ttcn, line 332 */ { RTPEM__conn__refuse__expect_template tmp_34; tmp_34.expect() = TRUE; tmp_33_alt_flag_0 = pt.getreply(tmp_34, any_compref, RTPEM__conn__refuse__expect_reply_redirect(), NULL, NULL, NULL); } if (tmp_33_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(331); /* RTP_Emulation.ttcn, line 331 */ if (tmp_33_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 331 and 333."); TTCN_Snapshot::take_new(TRUE); } } } void f__rtpem__conn__refuse__verify(RTPEM__CTRL__PT& pt) { TTCN_Location current_location("RTP_Emulation.ttcn", 336, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_conn_refuse_verify"); current_location.update_lineno(337); /* RTP_Emulation.ttcn, line 337 */ { RTPEM__conn__refuse__received_template tmp_35; tmp_35.received() = ANY_VALUE; pt.call(tmp_35, FALSE, NULL); } { alt_status tmp_36_alt_flag_0 = ALT_MAYBE; alt_status tmp_36_alt_flag_1 = ALT_MAYBE; current_location.update_lineno(337); /* RTP_Emulation.ttcn, line 337 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_36_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(338); /* RTP_Emulation.ttcn, line 338 */ { RTPEM__conn__refuse__received_template tmp_37; tmp_37.received() = TRUE; tmp_36_alt_flag_0 = pt.getreply(tmp_37, any_compref, RTPEM__conn__refuse__received_reply_redirect(), NULL, NULL, NULL); } if (tmp_36_alt_flag_0 == ALT_YES) break; } if (tmp_36_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(339); /* RTP_Emulation.ttcn, line 339 */ { RTPEM__conn__refuse__received_template tmp_38; tmp_38.received() = FALSE; tmp_36_alt_flag_1 = pt.getreply(tmp_38, any_compref, RTPEM__conn__refuse__received_reply_redirect(), NULL, NULL, NULL); } if (tmp_36_alt_flag_1 == ALT_YES) { current_location.update_lineno(340); /* RTP_Emulation.ttcn, line 340 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Expected to receive connection refused"),TTCN_Logger::end_event_log2str())); break; } } current_location.update_lineno(337); /* RTP_Emulation.ttcn, line 337 */ if (tmp_36_alt_flag_0 == ALT_NO && tmp_36_alt_flag_1 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file RTP_Emulation.ttcn between lines 337 and 342."); TTCN_Snapshot::take_new(TRUE); } } } RTP__Types::PDU__RTP_template ts__RTP(const BITSTRING& ssrc, const INTEGER& pt, const INTEGER& seq, const INTEGER& ts, const OCTETSTRING& payload, const BITSTRING& marker) { TTCN_Location current_location("RTP_Emulation.ttcn", 345, TTCN_Location::LOCATION_TEMPLATE, "ts_RTP"); RTP__Types::PDU__RTP_template ret_val; ret_val.version() = 2; ret_val.padding__ind() = bs_1; ret_val.extension__ind() = bs_1; ret_val.CSRC__count() = 0; ret_val.marker__bit() = marker; ret_val.payload__type() = pt; ret_val.sequence__number() = seq; ret_val.time__stamp() = int2bit(ts, 32); ret_val.SSRC__id() = ssrc; ret_val.CSRCs() = OMIT_VALUE; ret_val.ext__header() = OMIT_VALUE; ret_val.data() = payload; return ret_val; } void f__tx__rtp(const OCTETSTRING& payload, const INTEGER& rtp__payload__type, const BITSTRING& marker) { OCTETSTRING payload_shadow(payload); TTCN_Location current_location("RTP_Emulation.ttcn", 361, TTCN_Location::LOCATION_FUNCTION, "f_tx_rtp"); current_location.update_lineno(362); /* RTP_Emulation.ttcn, line 362 */ if (const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).iuup__mode()) { current_location.update_lineno(363); /* RTP_Emulation.ttcn, line 363 */ payload_shadow = IuUP__Emulation::f__IuUP__Em__tx__encap(RTP__Emulation__CT_component_g__iuup__ent, payload_shadow); current_location.update_lineno(364); /* RTP_Emulation.ttcn, line 364 */ if ((payload_shadow.lengthof() == 0)) { current_location.update_lineno(366); /* RTP_Emulation.ttcn, line 366 */ return; } } current_location.update_lineno(369); /* RTP_Emulation.ttcn, line 369 */ RTP__Types::PDU__RTP rtp(ts__RTP(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__ssrc(), rtp__payload__type, RTP__Emulation__CT_component_g__tx__next__seq, RTP__Emulation__CT_component_g__tx__next__ts, payload_shadow, marker).valueof()); current_location.update_lineno(371); /* RTP_Emulation.ttcn, line 371 */ { RTP__Types::RTP__messages__union_template tmp_40; tmp_40.rtp() = rtp; RTP__Emulation__CT_component_RTP.send(RTP__CodecPort::t__RTP__Send(INTEGER_template(RTP__Emulation__CT_component_g__rtp__conn__id), tmp_40), FALSE, NULL); } current_location.update_lineno(373); /* RTP_Emulation.ttcn, line 373 */ { INTEGER tmp_41; ++RTP__Emulation__CT_component_g__tx__next__seq; } current_location.update_lineno(374); /* RTP_Emulation.ttcn, line 374 */ { INTEGER tmp_42; tmp_42 = (RTP__Emulation__CT_component_g__tx__next__ts + (const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__samplerate__hz() / (1000 / const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__duration__ms()))); RTP__Emulation__CT_component_g__tx__next__ts = tmp_42; } } void start_f__tx__rtp(const COMPONENT& component_reference, const OCTETSTRING& payload, const INTEGER& rtp__payload__type, const BITSTRING& marker) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tx_rtp("); payload.log(); TTCN_Logger::log_event_str(", "); rtp__payload__type.log(); TTCN_Logger::log_event_str(", "); marker.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RTP_Emulation", "f_tx_rtp", text_buf); payload.encode_text(text_buf); rtp__payload__type.encode_text(text_buf); marker.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__check__fixed__rx__payloads(const INTEGER& rtp__payload__type, const OCTETSTRING& rtp__data) { TTCN_Location current_location("RTP_Emulation.ttcn", 377, TTCN_Location::LOCATION_FUNCTION, "f_check_fixed_rx_payloads"); current_location.update_lineno(378); /* RTP_Emulation.ttcn, line 378 */ BOOLEAN payload__type__match(FALSE); current_location.update_lineno(401); /* RTP_Emulation.ttcn, line 401 */ if ((const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).rx__payloads().lengthof() == 0)) { current_location.update_lineno(402); /* RTP_Emulation.ttcn, line 402 */ return; } { current_location.update_lineno(406); /* RTP_Emulation.ttcn, line 406 */ INTEGER i(0); current_location.update_lineno(406); /* RTP_Emulation.ttcn, line 406 */ for ( ; ; ) { current_location.update_lineno(406); /* RTP_Emulation.ttcn, line 406 */ if (!(i < const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).rx__payloads().lengthof())) break; current_location.update_lineno(407); /* RTP_Emulation.ttcn, line 407 */ if ((rtp__payload__type == const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).rx__payloads()[i].payload__type())) { current_location.update_lineno(408); /* RTP_Emulation.ttcn, line 408 */ { boolean tmp_50; { boolean tmp_43 = RTP__Emulation__CT_component_g__cfg.is_bound(); if(tmp_43) { const RtpemConfig& tmp_44 = RTP__Emulation__CT_component_g__cfg; const RtpemConfig_rx__payloads& tmp_45 = tmp_44.rx__payloads(); tmp_43 = tmp_45.is_bound(); if(tmp_43) { const int tmp_46 = i; tmp_43 = (tmp_46 >= 0) && (tmp_45.size_of() > tmp_46); if(tmp_43) { const RtpemConfigPayload& tmp_47 = tmp_45[tmp_46]; tmp_43 = tmp_47.is_bound(); if(tmp_43) { const OPTIONAL< OCTETSTRING >& tmp_48 = tmp_47.fixed__payload(); switch (tmp_48.get_selection()) { case OPTIONAL_UNBOUND: tmp_43 = FALSE; break; case OPTIONAL_OMIT: tmp_43 = FALSE; break; default: { const OCTETSTRING& tmp_49 = (const OCTETSTRING&) tmp_48; tmp_43 = tmp_49.is_present(); break;} } } } } } tmp_50 = (!(tmp_43)); } if (tmp_50) { current_location.update_lineno(410); /* RTP_Emulation.ttcn, line 410 */ return; } } current_location.update_lineno(412); /* RTP_Emulation.ttcn, line 412 */ if ((const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).rx__payloads()[i].fixed__payload() == rtp__data)) { current_location.update_lineno(414); /* RTP_Emulation.ttcn, line 414 */ return; } current_location.update_lineno(419); /* RTP_Emulation.ttcn, line 419 */ payload__type__match = TRUE; } current_location.update_lineno(406); /* RTP_Emulation.ttcn, line 406 */ { INTEGER tmp_52; ++i; } } } current_location.update_lineno(423); /* RTP_Emulation.ttcn, line 423 */ { INTEGER tmp_53; tmp_53 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__rx__err__payload() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__rx__err__payload() = tmp_53; } current_location.update_lineno(424); /* RTP_Emulation.ttcn, line 424 */ if ((!(payload__type__match))) { current_location.update_lineno(425); /* RTP_Emulation.ttcn, line 425 */ { INTEGER tmp_54; tmp_54 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__rx__err__pt() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__rx__err__pt() = tmp_54; } } } void start_f__check__fixed__rx__payloads(const COMPONENT& component_reference, const INTEGER& rtp__payload__type, const OCTETSTRING& rtp__data) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_check_fixed_rx_payloads("); rtp__payload__type.log(); TTCN_Logger::log_event_str(", "); rtp__data.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RTP_Emulation", "f_check_fixed_rx_payloads", text_buf); rtp__payload__type.encode_text(text_buf); rtp__data.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__main() { TTCN_Location current_location("RTP_Emulation.ttcn", 429, TTCN_Location::LOCATION_FUNCTION, "f_main"); current_location.update_lineno(431); /* RTP_Emulation.ttcn, line 431 */ Socket__API__Definitions::Result res; current_location.update_lineno(432); /* RTP_Emulation.ttcn, line 432 */ BOOLEAN is__rtcp; current_location.update_lineno(434); /* RTP_Emulation.ttcn, line 434 */ TIMER T__transmit("T_transmit", (int2float(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__duration__ms()) / 1.0e3)); current_location.update_lineno(435); /* RTP_Emulation.ttcn, line 435 */ RTP__CodecPort::RTP__RecvFrom rx__rtp; current_location.update_lineno(436); /* RTP_Emulation.ttcn, line 436 */ RtpemConfig cfg; current_location.update_lineno(437); /* RTP_Emulation.ttcn, line 437 */ RTP__CodecPort::RTP__RecvFrom_template tr; tr.connId() = ANY_VALUE; tr.remName() = ANY_VALUE; tr.remPort() = ANY_VALUE; tr.locName() = ANY_VALUE; tr.locPort() = ANY_VALUE; tr.msg() = ANY_VALUE; current_location.update_lineno(445); /* RTP_Emulation.ttcn, line 445 */ RTP__CodecPort::RTP__RecvFrom_template tr__rtp(tr); current_location.update_lineno(446); /* RTP_Emulation.ttcn, line 446 */ RTP__CodecPort::RTP__RecvFrom_template tr__rtcp(tr); current_location.update_lineno(447); /* RTP_Emulation.ttcn, line 447 */ { RTP__Types::RTP__messages__union_template& tmp_56 = tr__rtp.msg(); tmp_56.rtp() = ANY_VALUE; } current_location.update_lineno(448); /* RTP_Emulation.ttcn, line 448 */ { RTP__Types::RTP__messages__union_template& tmp_58 = tr__rtcp.msg(); tmp_58.rtcp() = ANY_VALUE; } current_location.update_lineno(450); /* RTP_Emulation.ttcn, line 450 */ Socket__API__Definitions::PortEvent_template tr__conn__refuse; { Socket__API__Definitions::Result_template& tmp_59 = tr__conn__refuse.result(); tmp_59.errorCode() = Socket__API__Definitions::PortError::ERROR__SOCKET; tmp_59.connId() = ANY_VALUE; tmp_59.os__error__code() = 111; tmp_59.os__error__text() = ANY_VALUE; } current_location.update_lineno(455); /* RTP_Emulation.ttcn, line 455 */ RTP__Emulation__CT_component_g__iuup__ent = IuUP__Emulation::t__IuUP__Entity(IuUP__Emulation::IuUP__Config_template(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).iuup__cfg())).valueof(); for ( ; ; ) { tmp_61: current_location.update_lineno(458); /* RTP_Emulation.ttcn, line 458 */ { tmp_62: alt_status tmp_62_alt_flag_0 = ALT_MAYBE; alt_status tmp_62_alt_flag_1 = ALT_MAYBE; alt_status tmp_62_alt_flag_2 = ALT_MAYBE; alt_status tmp_62_alt_flag_3 = ALT_MAYBE; alt_status tmp_62_alt_flag_4 = ALT_MAYBE; alt_status tmp_62_alt_flag_5 = ALT_MAYBE; alt_status tmp_62_alt_flag_6 = ALT_MAYBE; alt_status tmp_62_alt_flag_7 = ALT_MAYBE; alt_status tmp_62_alt_flag_8 = ALT_MAYBE; alt_status tmp_62_alt_flag_9 = ALT_MAYBE; alt_status tmp_62_alt_flag_10 = ALT_MAYBE; alt_status tmp_62_alt_flag_11 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_12 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_13 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_14 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_15 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_16 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_17 = ALT_UNCHECKED; alt_status tmp_62_alt_flag_18 = ALT_MAYBE; alt_status tmp_62_alt_flag_19 = ALT_MAYBE; alt_status tmp_62_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_62_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(460); /* RTP_Emulation.ttcn, line 460 */ { RTPEM__bind_template tmp_63; tmp_63.local__host() = ANY_VALUE; tmp_63.local__port() = ANY_VALUE; tmp_62_alt_flag_0 = RTP__Emulation__CT_component_CTRL.getcall(tmp_63, any_compref, RTPEM__bind_call_redirect(&(RTP__Emulation__CT_component_g__local__host), &(RTP__Emulation__CT_component_g__local__port)), NULL, NULL, NULL); } if (tmp_62_alt_flag_0 == ALT_YES) { current_location.update_lineno(461); /* RTP_Emulation.ttcn, line 461 */ if ((rem(RTP__Emulation__CT_component_g__local__port, 2) == 1)) { current_location.update_lineno(463); /* RTP_Emulation.ttcn, line 463 */ TTCN_Logger::log_str(TTCN_USER, "Local Port is not an even port number!"); current_location.update_lineno(464); /* RTP_Emulation.ttcn, line 464 */ goto tmp_61; } current_location.update_lineno(467); /* RTP_Emulation.ttcn, line 467 */ RTP__Emulation__CT_component_g__tx__connected = FALSE; current_location.update_lineno(469); /* RTP_Emulation.ttcn, line 469 */ if ((RTP__Emulation__CT_component_g__rtp__conn__id != -1)) { current_location.update_lineno(470); /* RTP_Emulation.ttcn, line 470 */ Socket__API__Definitions::ProtoTuple tmp_66; tmp_66.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__close(RTP__Emulation__CT_component_RTP, RTP__Emulation__CT_component_g__rtp__conn__id, tmp_66); current_location.update_lineno(471); /* RTP_Emulation.ttcn, line 471 */ RTP__Emulation__CT_component_g__rtp__conn__id = -1; } current_location.update_lineno(473); /* RTP_Emulation.ttcn, line 473 */ Socket__API__Definitions::ProtoTuple tmp_69; tmp_69.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__listen(RTP__Emulation__CT_component_RTP, RTP__Emulation__CT_component_g__local__host, RTP__Emulation__CT_component_g__local__port, tmp_69, RTP__CodecPort__CtrlFunct::f__IPL4__listen_options_defval); current_location.update_lineno(475); /* RTP_Emulation.ttcn, line 475 */ { boolean tmp_73; { boolean tmp_70 = res.is_bound(); if(tmp_70) { const OPTIONAL< INTEGER >& tmp_71 = res.connId(); switch (tmp_71.get_selection()) { case OPTIONAL_UNBOUND: tmp_70 = FALSE; break; case OPTIONAL_OMIT: tmp_70 = FALSE; break; default: { const INTEGER& tmp_72 = (const INTEGER&) tmp_71; tmp_70 = tmp_72.is_present(); break;} } } tmp_73 = (!(tmp_70)); } if (tmp_73) { current_location.update_lineno(476); /* RTP_Emulation.ttcn, line 476 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Could not listen on RTP socket, check your configuration"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(477); /* RTP_Emulation.ttcn, line 477 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(479); /* RTP_Emulation.ttcn, line 479 */ RTP__Emulation__CT_component_g__rtp__conn__id = const_cast< const Socket__API__Definitions::Result&>(res).connId(); current_location.update_lineno(480); /* RTP_Emulation.ttcn, line 480 */ tr__rtp.connId() = RTP__Emulation__CT_component_g__rtp__conn__id; current_location.update_lineno(482); /* RTP_Emulation.ttcn, line 482 */ if ((RTP__Emulation__CT_component_g__rtcp__conn__id != -1)) { current_location.update_lineno(483); /* RTP_Emulation.ttcn, line 483 */ Socket__API__Definitions::ProtoTuple tmp_77; tmp_77.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__close(RTP__Emulation__CT_component_RTCP, RTP__Emulation__CT_component_g__rtcp__conn__id, tmp_77); current_location.update_lineno(484); /* RTP_Emulation.ttcn, line 484 */ RTP__Emulation__CT_component_g__rtcp__conn__id = -1; } current_location.update_lineno(486); /* RTP_Emulation.ttcn, line 486 */ Socket__API__Definitions::ProtoTuple tmp_80; tmp_80.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__listen(RTP__Emulation__CT_component_RTCP, RTP__Emulation__CT_component_g__local__host, (RTP__Emulation__CT_component_g__local__port + 1), tmp_80, RTP__CodecPort__CtrlFunct::f__IPL4__listen_options_defval); current_location.update_lineno(488); /* RTP_Emulation.ttcn, line 488 */ { boolean tmp_84; { boolean tmp_81 = res.is_bound(); if(tmp_81) { const OPTIONAL< INTEGER >& tmp_82 = res.connId(); switch (tmp_82.get_selection()) { case OPTIONAL_UNBOUND: tmp_81 = FALSE; break; case OPTIONAL_OMIT: tmp_81 = FALSE; break; default: { const INTEGER& tmp_83 = (const INTEGER&) tmp_82; tmp_81 = tmp_83.is_present(); break;} } } tmp_84 = (!(tmp_81)); } if (tmp_84) { current_location.update_lineno(489); /* RTP_Emulation.ttcn, line 489 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Could not listen on RTCP socket, check your configuration"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(490); /* RTP_Emulation.ttcn, line 490 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(492); /* RTP_Emulation.ttcn, line 492 */ RTP__Emulation__CT_component_g__rtcp__conn__id = const_cast< const Socket__API__Definitions::Result&>(res).connId(); current_location.update_lineno(493); /* RTP_Emulation.ttcn, line 493 */ tr__rtcp.connId() = RTP__Emulation__CT_component_g__rtcp__conn__id; current_location.update_lineno(494); /* RTP_Emulation.ttcn, line 494 */ { RTPEM__bind_template tmp_87; tmp_87.local__host() = RTP__Emulation__CT_component_g__local__host; tmp_87.local__port() = RTP__Emulation__CT_component_g__local__port; RTP__Emulation__CT_component_CTRL.reply(tmp_87, FALSE, NULL); } break; } } if (tmp_62_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(496); /* RTP_Emulation.ttcn, line 496 */ { RTPEM__connect_template tmp_88; tmp_88.remote__host() = ANY_VALUE; tmp_88.remote__port() = ANY_VALUE; tmp_62_alt_flag_1 = RTP__Emulation__CT_component_CTRL.getcall(tmp_88, any_compref, RTPEM__connect_call_redirect(&(RTP__Emulation__CT_component_g__remote__host), &(RTP__Emulation__CT_component_g__remote__port)), NULL, NULL, NULL); } if (tmp_62_alt_flag_1 == ALT_YES) { current_location.update_lineno(497); /* RTP_Emulation.ttcn, line 497 */ if ((rem(RTP__Emulation__CT_component_g__remote__port, 2) == 1)) { current_location.update_lineno(499); /* RTP_Emulation.ttcn, line 499 */ TTCN_Logger::log_str(TTCN_USER, "Remote Port is not an even number!"); current_location.update_lineno(500); /* RTP_Emulation.ttcn, line 500 */ goto tmp_61; } current_location.update_lineno(502); /* RTP_Emulation.ttcn, line 502 */ Socket__API__Definitions::ProtoTuple tmp_90; tmp_90.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__connect(RTP__Emulation__CT_component_RTP, RTP__Emulation__CT_component_g__remote__host, RTP__Emulation__CT_component_g__remote__port, RTP__Emulation__CT_component_g__local__host, RTP__Emulation__CT_component_g__local__port, RTP__Emulation__CT_component_g__rtp__conn__id, tmp_90, RTP__CodecPort__CtrlFunct::f__IPL4__connect_options_defval); current_location.update_lineno(506); /* RTP_Emulation.ttcn, line 506 */ { boolean tmp_94; { boolean tmp_91 = res.is_bound(); if(tmp_91) { const OPTIONAL< INTEGER >& tmp_92 = res.connId(); switch (tmp_92.get_selection()) { case OPTIONAL_UNBOUND: tmp_91 = FALSE; break; case OPTIONAL_OMIT: tmp_91 = FALSE; break; default: { const INTEGER& tmp_93 = (const INTEGER&) tmp_92; tmp_91 = tmp_93.is_present(); break;} } } tmp_94 = (!(tmp_91)); } if (tmp_94) { current_location.update_lineno(507); /* RTP_Emulation.ttcn, line 507 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Could not connect to RTP socket, check your configuration"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(508); /* RTP_Emulation.ttcn, line 508 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(510); /* RTP_Emulation.ttcn, line 510 */ Socket__API__Definitions::ProtoTuple tmp_96; tmp_96.udp() = NULL_VALUE; res = RTP__CodecPort__CtrlFunct::f__IPL4__connect(RTP__Emulation__CT_component_RTCP, RTP__Emulation__CT_component_g__remote__host, (RTP__Emulation__CT_component_g__remote__port + 1), RTP__Emulation__CT_component_g__local__host, (RTP__Emulation__CT_component_g__local__port + 1), RTP__Emulation__CT_component_g__rtcp__conn__id, tmp_96, RTP__CodecPort__CtrlFunct::f__IPL4__connect_options_defval); current_location.update_lineno(514); /* RTP_Emulation.ttcn, line 514 */ { boolean tmp_100; { boolean tmp_97 = res.is_bound(); if(tmp_97) { const OPTIONAL< INTEGER >& tmp_98 = res.connId(); switch (tmp_98.get_selection()) { case OPTIONAL_UNBOUND: tmp_97 = FALSE; break; case OPTIONAL_OMIT: tmp_97 = FALSE; break; default: { const INTEGER& tmp_99 = (const INTEGER&) tmp_98; tmp_97 = tmp_99.is_present(); break;} } } tmp_100 = (!(tmp_97)); } if (tmp_100) { current_location.update_lineno(515); /* RTP_Emulation.ttcn, line 515 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Could not connect to RTCP socket, check your configuration"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(516); /* RTP_Emulation.ttcn, line 516 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(518); /* RTP_Emulation.ttcn, line 518 */ RTP__Emulation__CT_component_g__tx__connected = TRUE; current_location.update_lineno(520); /* RTP_Emulation.ttcn, line 520 */ { boolean tmp_105; { boolean tmp_102 = RTP__Emulation__CT_component_g__iuup__ent.is_bound(); if(tmp_102) { const OPTIONAL< IuUP__Types::IuUP__PDU >& tmp_103 = RTP__Emulation__CT_component_g__iuup__ent.pending__tx__pdu(); switch (tmp_103.get_selection()) { case OPTIONAL_UNBOUND: tmp_102 = FALSE; break; case OPTIONAL_OMIT: tmp_102 = FALSE; break; default: { const IuUP__Types::IuUP__PDU& tmp_104 = (const IuUP__Types::IuUP__PDU&) tmp_103; tmp_102 = tmp_104.is_value(); break;} } } tmp_105 = tmp_102; } if (tmp_105) { current_location.update_lineno(521); /* RTP_Emulation.ttcn, line 521 */ f__tx__rtp(os_1, INTEGER(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads()[0].payload__type()), f__tx__rtp_marker_defval); } } current_location.update_lineno(523); /* RTP_Emulation.ttcn, line 523 */ { RTPEM__connect_template tmp_106; tmp_106.remote__host() = RTP__Emulation__CT_component_g__remote__host; tmp_106.remote__port() = RTP__Emulation__CT_component_g__remote__port; RTP__Emulation__CT_component_CTRL.reply(tmp_106, FALSE, NULL); } break; } } if (tmp_62_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(525); /* RTP_Emulation.ttcn, line 525 */ { RTPEM__mode_template tmp_107; tmp_107.mode() = RtpemMode::RTPEM__MODE__NONE; tmp_62_alt_flag_2 = RTP__Emulation__CT_component_CTRL.getcall(tmp_107, any_compref, RTPEM__mode_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_2 == ALT_YES) { current_location.update_lineno(526); /* RTP_Emulation.ttcn, line 526 */ T__transmit.stop(); current_location.update_lineno(527); /* RTP_Emulation.ttcn, line 527 */ RTP__Emulation__CT_component_g__rx__enabled = FALSE; current_location.update_lineno(528); /* RTP_Emulation.ttcn, line 528 */ RTP__Emulation__CT_component_g__loopback = FALSE; current_location.update_lineno(529); /* RTP_Emulation.ttcn, line 529 */ { RTPEM__mode_template tmp_110; tmp_110.mode() = RtpemMode::RTPEM__MODE__NONE; RTP__Emulation__CT_component_CTRL.reply(tmp_110, FALSE, NULL); } break; } } if (tmp_62_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(531); /* RTP_Emulation.ttcn, line 531 */ { RTPEM__mode_template tmp_111; tmp_111.mode() = RtpemMode::RTPEM__MODE__TXONLY; tmp_62_alt_flag_3 = RTP__Emulation__CT_component_CTRL.getcall(tmp_111, any_compref, RTPEM__mode_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_3 == ALT_YES) { current_location.update_lineno(533); /* RTP_Emulation.ttcn, line 533 */ T__transmit.start(); current_location.update_lineno(534); /* RTP_Emulation.ttcn, line 534 */ RTP__Emulation__CT_component_g__rx__enabled = FALSE; current_location.update_lineno(535); /* RTP_Emulation.ttcn, line 535 */ RTP__Emulation__CT_component_g__loopback = FALSE; current_location.update_lineno(536); /* RTP_Emulation.ttcn, line 536 */ { RTPEM__mode_template tmp_114; tmp_114.mode() = RtpemMode::RTPEM__MODE__TXONLY; RTP__Emulation__CT_component_CTRL.reply(tmp_114, FALSE, NULL); } break; } } if (tmp_62_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(538); /* RTP_Emulation.ttcn, line 538 */ { RTPEM__mode_template tmp_115; tmp_115.mode() = RtpemMode::RTPEM__MODE__RXONLY; tmp_62_alt_flag_4 = RTP__Emulation__CT_component_CTRL.getcall(tmp_115, any_compref, RTPEM__mode_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_4 == ALT_YES) { current_location.update_lineno(540); /* RTP_Emulation.ttcn, line 540 */ T__transmit.stop(); current_location.update_lineno(541); /* RTP_Emulation.ttcn, line 541 */ if ((RTP__Emulation__CT_component_g__rx__enabled == FALSE)) { current_location.update_lineno(543); /* RTP_Emulation.ttcn, line 543 */ RTP__Emulation__CT_component_RTP.clear(); current_location.update_lineno(544); /* RTP_Emulation.ttcn, line 544 */ RTP__Emulation__CT_component_RTCP.clear(); current_location.update_lineno(545); /* RTP_Emulation.ttcn, line 545 */ RTP__Emulation__CT_component_g__rx__enabled = TRUE; } current_location.update_lineno(547); /* RTP_Emulation.ttcn, line 547 */ RTP__Emulation__CT_component_g__loopback = FALSE; current_location.update_lineno(548); /* RTP_Emulation.ttcn, line 548 */ { RTPEM__mode_template tmp_118; tmp_118.mode() = RtpemMode::RTPEM__MODE__RXONLY; RTP__Emulation__CT_component_CTRL.reply(tmp_118, FALSE, NULL); } break; } } if (tmp_62_alt_flag_5 == ALT_MAYBE) { current_location.update_lineno(550); /* RTP_Emulation.ttcn, line 550 */ { RTPEM__mode_template tmp_119; tmp_119.mode() = RtpemMode::RTPEM__MODE__BIDIR; tmp_62_alt_flag_5 = RTP__Emulation__CT_component_CTRL.getcall(tmp_119, any_compref, RTPEM__mode_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_5 == ALT_YES) { current_location.update_lineno(551); /* RTP_Emulation.ttcn, line 551 */ T__transmit.start(); current_location.update_lineno(552); /* RTP_Emulation.ttcn, line 552 */ if ((RTP__Emulation__CT_component_g__rx__enabled == FALSE)) { current_location.update_lineno(554); /* RTP_Emulation.ttcn, line 554 */ RTP__Emulation__CT_component_RTP.clear(); current_location.update_lineno(555); /* RTP_Emulation.ttcn, line 555 */ RTP__Emulation__CT_component_RTCP.clear(); current_location.update_lineno(556); /* RTP_Emulation.ttcn, line 556 */ RTP__Emulation__CT_component_g__rx__enabled = TRUE; } current_location.update_lineno(558); /* RTP_Emulation.ttcn, line 558 */ RTP__Emulation__CT_component_g__loopback = FALSE; current_location.update_lineno(559); /* RTP_Emulation.ttcn, line 559 */ { RTPEM__mode_template tmp_122; tmp_122.mode() = RtpemMode::RTPEM__MODE__BIDIR; RTP__Emulation__CT_component_CTRL.reply(tmp_122, FALSE, NULL); } break; } } if (tmp_62_alt_flag_6 == ALT_MAYBE) { current_location.update_lineno(561); /* RTP_Emulation.ttcn, line 561 */ { RTPEM__mode_template tmp_123; tmp_123.mode() = RtpemMode::RTPEM__MODE__LOOPBACK; tmp_62_alt_flag_6 = RTP__Emulation__CT_component_CTRL.getcall(tmp_123, any_compref, RTPEM__mode_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_6 == ALT_YES) { current_location.update_lineno(562); /* RTP_Emulation.ttcn, line 562 */ T__transmit.stop(); current_location.update_lineno(563); /* RTP_Emulation.ttcn, line 563 */ if ((RTP__Emulation__CT_component_g__rx__enabled == FALSE)) { current_location.update_lineno(565); /* RTP_Emulation.ttcn, line 565 */ RTP__Emulation__CT_component_RTP.clear(); current_location.update_lineno(566); /* RTP_Emulation.ttcn, line 566 */ RTP__Emulation__CT_component_RTCP.clear(); current_location.update_lineno(567); /* RTP_Emulation.ttcn, line 567 */ RTP__Emulation__CT_component_g__rx__enabled = TRUE; } current_location.update_lineno(569); /* RTP_Emulation.ttcn, line 569 */ RTP__Emulation__CT_component_g__loopback = TRUE; current_location.update_lineno(570); /* RTP_Emulation.ttcn, line 570 */ { RTPEM__mode_template tmp_126; tmp_126.mode() = RtpemMode::RTPEM__MODE__LOOPBACK; RTP__Emulation__CT_component_CTRL.reply(tmp_126, FALSE, NULL); } break; } } if (tmp_62_alt_flag_7 == ALT_MAYBE) { current_location.update_lineno(572); /* RTP_Emulation.ttcn, line 572 */ { RTPEM__configure_template tmp_127; tmp_127.cfg() = ANY_VALUE; tmp_62_alt_flag_7 = RTP__Emulation__CT_component_CTRL.getcall(tmp_127, any_compref, RTPEM__configure_call_redirect(&(cfg)), NULL, NULL, NULL); } if (tmp_62_alt_flag_7 == ALT_YES) { current_location.update_lineno(573); /* RTP_Emulation.ttcn, line 573 */ RTP__Emulation__CT_component_g__cfg = cfg; current_location.update_lineno(574); /* RTP_Emulation.ttcn, line 574 */ RTP__Emulation__CT_component_g__iuup__ent.cfg() = const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).iuup__cfg(); current_location.update_lineno(575); /* RTP_Emulation.ttcn, line 575 */ { RTPEM__configure_template tmp_130; tmp_130.cfg() = cfg; RTP__Emulation__CT_component_CTRL.reply(tmp_130, FALSE, NULL); } break; } } if (tmp_62_alt_flag_8 == ALT_MAYBE) { current_location.update_lineno(577); /* RTP_Emulation.ttcn, line 577 */ { RTPEM__stats__get_template tmp_131; tmp_131.stats() = ANY_VALUE; tmp_131.rtcp() = ANY_VALUE; tmp_62_alt_flag_8 = RTP__Emulation__CT_component_CTRL.getcall(tmp_131, any_compref, RTPEM__stats__get_call_redirect(&(is__rtcp)), NULL, NULL, NULL); } if (tmp_62_alt_flag_8 == ALT_YES) { current_location.update_lineno(578); /* RTP_Emulation.ttcn, line 578 */ if (is__rtcp) { current_location.update_lineno(579); /* RTP_Emulation.ttcn, line 579 */ { RTPEM__stats__get_template tmp_132; tmp_132.stats() = RTP__Emulation__CT_component_g__stats__rtcp; tmp_132.rtcp() = is__rtcp; RTP__Emulation__CT_component_CTRL.reply(tmp_132, FALSE, NULL); } } else { current_location.update_lineno(581); /* RTP_Emulation.ttcn, line 581 */ { RTPEM__stats__get_template tmp_133; tmp_133.stats() = RTP__Emulation__CT_component_g__stats__rtp; tmp_133.rtcp() = is__rtcp; RTP__Emulation__CT_component_CTRL.reply(tmp_133, FALSE, NULL); } } break; } } if (tmp_62_alt_flag_9 == ALT_MAYBE) { current_location.update_lineno(584); /* RTP_Emulation.ttcn, line 584 */ { RTPEM__conn__refuse__expect_template tmp_134; tmp_134.expect() = ANY_VALUE; tmp_62_alt_flag_9 = RTP__Emulation__CT_component_CTRL.getcall(tmp_134, any_compref, RTPEM__conn__refuse__expect_call_redirect(&(RTP__Emulation__CT_component_g__conn__refuse__expect)), NULL, NULL, NULL); } if (tmp_62_alt_flag_9 == ALT_YES) { current_location.update_lineno(585); /* RTP_Emulation.ttcn, line 585 */ { RTPEM__conn__refuse__expect_template tmp_135; tmp_135.expect() = RTP__Emulation__CT_component_g__conn__refuse__expect; RTP__Emulation__CT_component_CTRL.reply(tmp_135, FALSE, NULL); } break; } } if (tmp_62_alt_flag_10 == ALT_MAYBE) { current_location.update_lineno(587); /* RTP_Emulation.ttcn, line 587 */ { RTPEM__conn__refuse__received_template tmp_136; tmp_136.received() = ANY_VALUE; tmp_62_alt_flag_10 = RTP__Emulation__CT_component_CTRL.getcall(tmp_136, any_compref, RTPEM__conn__refuse__received_call_redirect(), NULL, NULL, NULL); } if (tmp_62_alt_flag_10 == ALT_YES) { current_location.update_lineno(588); /* RTP_Emulation.ttcn, line 588 */ { RTPEM__conn__refuse__received_template tmp_137; tmp_137.received() = RTP__Emulation__CT_component_g__conn__refuse__received; RTP__Emulation__CT_component_CTRL.reply(tmp_137, FALSE, NULL); } break; } } if (tmp_62_alt_flag_11 == ALT_UNCHECKED) { current_location.update_lineno(593); /* RTP_Emulation.ttcn, line 593 */ if ((!(RTP__Emulation__CT_component_g__rx__enabled))) tmp_62_alt_flag_11 = ALT_MAYBE; else tmp_62_alt_flag_11 = ALT_NO; } if (tmp_62_alt_flag_11 == ALT_MAYBE) { current_location.update_lineno(593); /* RTP_Emulation.ttcn, line 593 */ tmp_62_alt_flag_11 = RTP__Emulation__CT_component_RTP.receive(tr__rtp, &(rx__rtp), any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_11 == ALT_YES) { current_location.update_lineno(595); /* RTP_Emulation.ttcn, line 595 */ if (const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).iuup__mode()) { current_location.update_lineno(597); /* RTP_Emulation.ttcn, line 597 */ rx__rtp.msg().rtp().data() = IuUP__Emulation::f__IuUP__Em__rx__decaps(RTP__Emulation__CT_component_g__iuup__ent, const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data()); current_location.update_lineno(598); /* RTP_Emulation.ttcn, line 598 */ if ((const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data().lengthof() != 0)) { current_location.update_lineno(600); /* RTP_Emulation.ttcn, line 600 */ { INTEGER tmp_139; tmp_139 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__rx__err__disabled() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__rx__err__disabled() = tmp_139; } } else { current_location.update_lineno(601); /* RTP_Emulation.ttcn, line 601 */ boolean tmp_140; tmp_140 = RTP__Emulation__CT_component_g__tx__connected; if (tmp_140) { boolean tmp_141 = RTP__Emulation__CT_component_g__iuup__ent.is_bound(); if(tmp_141) { const OPTIONAL< IuUP__Types::IuUP__PDU >& tmp_142 = RTP__Emulation__CT_component_g__iuup__ent.pending__tx__pdu(); switch (tmp_142.get_selection()) { case OPTIONAL_UNBOUND: tmp_141 = FALSE; break; case OPTIONAL_OMIT: tmp_141 = FALSE; break; default: { const IuUP__Types::IuUP__PDU& tmp_143 = (const IuUP__Types::IuUP__PDU&) tmp_142; tmp_141 = tmp_143.is_value(); break;} } } tmp_140 = tmp_141; } if (tmp_140) { current_location.update_lineno(603); /* RTP_Emulation.ttcn, line 603 */ f__tx__rtp(os_1, INTEGER(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads()[0].payload__type()), f__tx__rtp_marker_defval); } } } else { current_location.update_lineno(606); /* RTP_Emulation.ttcn, line 606 */ { INTEGER tmp_144; tmp_144 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__rx__err__disabled() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__rx__err__disabled() = tmp_144; } } break; } } if (tmp_62_alt_flag_12 == ALT_UNCHECKED) { current_location.update_lineno(609); /* RTP_Emulation.ttcn, line 609 */ if ((!(RTP__Emulation__CT_component_g__rx__enabled))) tmp_62_alt_flag_12 = ALT_MAYBE; else tmp_62_alt_flag_12 = ALT_NO; } if (tmp_62_alt_flag_12 == ALT_MAYBE) { current_location.update_lineno(609); /* RTP_Emulation.ttcn, line 609 */ tmp_62_alt_flag_12 = RTP__Emulation__CT_component_RTCP.receive(tr__rtcp, NULL, any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_12 == ALT_YES) { current_location.update_lineno(610); /* RTP_Emulation.ttcn, line 610 */ { INTEGER tmp_145; tmp_145 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtcp).num__pkts__rx__err__disabled() + 1); RTP__Emulation__CT_component_g__stats__rtcp.num__pkts__rx__err__disabled() = tmp_145; } break; } } if (tmp_62_alt_flag_13 == ALT_UNCHECKED) { current_location.update_lineno(614); /* RTP_Emulation.ttcn, line 614 */ if (RTP__Emulation__CT_component_g__rx__enabled) tmp_62_alt_flag_13 = ALT_MAYBE; else tmp_62_alt_flag_13 = ALT_NO; } if (tmp_62_alt_flag_13 == ALT_MAYBE) { current_location.update_lineno(614); /* RTP_Emulation.ttcn, line 614 */ tmp_62_alt_flag_13 = RTP__Emulation__CT_component_RTP.receive(tr__rtp, &(rx__rtp), any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_13 == ALT_YES) { current_location.update_lineno(616); /* RTP_Emulation.ttcn, line 616 */ { INTEGER tmp_146; tmp_146 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__rx() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__rx() = tmp_146; } current_location.update_lineno(617); /* RTP_Emulation.ttcn, line 617 */ { INTEGER tmp_147; tmp_147 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).bytes__payload__rx() + const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data().lengthof()); RTP__Emulation__CT_component_g__stats__rtp.bytes__payload__rx() = tmp_147; } current_location.update_lineno(619); /* RTP_Emulation.ttcn, line 619 */ if (const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).iuup__mode()) { current_location.update_lineno(620); /* RTP_Emulation.ttcn, line 620 */ rx__rtp.msg().rtp().data() = IuUP__Emulation::f__IuUP__Em__rx__decaps(RTP__Emulation__CT_component_g__iuup__ent, const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data()); current_location.update_lineno(622); /* RTP_Emulation.ttcn, line 622 */ if ((const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data().lengthof() == 0)) { current_location.update_lineno(623); /* RTP_Emulation.ttcn, line 623 */ { boolean tmp_149; tmp_149 = RTP__Emulation__CT_component_g__tx__connected; if (tmp_149) { boolean tmp_150 = RTP__Emulation__CT_component_g__iuup__ent.is_bound(); if(tmp_150) { const OPTIONAL< IuUP__Types::IuUP__PDU >& tmp_151 = RTP__Emulation__CT_component_g__iuup__ent.pending__tx__pdu(); switch (tmp_151.get_selection()) { case OPTIONAL_UNBOUND: tmp_150 = FALSE; break; case OPTIONAL_OMIT: tmp_150 = FALSE; break; default: { const IuUP__Types::IuUP__PDU& tmp_152 = (const IuUP__Types::IuUP__PDU&) tmp_151; tmp_150 = tmp_152.is_value(); break;} } } tmp_149 = tmp_150; } if (tmp_149) { current_location.update_lineno(624); /* RTP_Emulation.ttcn, line 624 */ f__tx__rtp(os_1, INTEGER(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads()[0].payload__type()), f__tx__rtp_marker_defval); } } current_location.update_lineno(626); /* RTP_Emulation.ttcn, line 626 */ goto tmp_62; } } current_location.update_lineno(630); /* RTP_Emulation.ttcn, line 630 */ if (RTP__Emulation__CT_component_g__loopback) { current_location.update_lineno(631); /* RTP_Emulation.ttcn, line 631 */ f__tx__rtp(const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data(), const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().payload__type(), f__tx__rtp_marker_defval); current_location.update_lineno(633); /* RTP_Emulation.ttcn, line 633 */ { INTEGER tmp_153; tmp_153 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__tx() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__tx() = tmp_153; } current_location.update_lineno(634); /* RTP_Emulation.ttcn, line 634 */ { INTEGER tmp_154; tmp_154 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).bytes__payload__tx() + const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data().lengthof()); RTP__Emulation__CT_component_g__stats__rtp.bytes__payload__tx() = tmp_154; } } else { current_location.update_lineno(638); /* RTP_Emulation.ttcn, line 638 */ f__check__fixed__rx__payloads(const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().payload__type(), const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp().data()); } current_location.update_lineno(641); /* RTP_Emulation.ttcn, line 641 */ if (RTP__Emulation__CT_component_DATA.check_port_state(cs_0)) { current_location.update_lineno(642); /* RTP_Emulation.ttcn, line 642 */ RTP__Emulation__CT_component_DATA.send(const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtp(), FALSE, NULL); } break; } } if (tmp_62_alt_flag_14 == ALT_UNCHECKED) { current_location.update_lineno(645); /* RTP_Emulation.ttcn, line 645 */ if (RTP__Emulation__CT_component_g__rx__enabled) tmp_62_alt_flag_14 = ALT_MAYBE; else tmp_62_alt_flag_14 = ALT_NO; } if (tmp_62_alt_flag_14 == ALT_MAYBE) { current_location.update_lineno(645); /* RTP_Emulation.ttcn, line 645 */ tmp_62_alt_flag_14 = RTP__Emulation__CT_component_RTCP.receive(tr__rtcp, &(rx__rtp), any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_14 == ALT_YES) { current_location.update_lineno(647); /* RTP_Emulation.ttcn, line 647 */ { INTEGER tmp_155; tmp_155 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtcp).num__pkts__rx() + 1); RTP__Emulation__CT_component_g__stats__rtcp.num__pkts__rx() = tmp_155; } current_location.update_lineno(648); /* RTP_Emulation.ttcn, line 648 */ if (RTP__Emulation__CT_component_DATA.check_port_state(cs_0)) { current_location.update_lineno(649); /* RTP_Emulation.ttcn, line 649 */ RTP__Emulation__CT_component_DATA.send(const_cast< const RTP__CodecPort::RTP__RecvFrom&>(rx__rtp).msg().rtcp(), FALSE, NULL); } break; } } if (tmp_62_alt_flag_15 == ALT_UNCHECKED) { current_location.update_lineno(654); /* RTP_Emulation.ttcn, line 654 */ if (RTP__Emulation__CT_component_g__tx__connected) tmp_62_alt_flag_15 = ALT_MAYBE; else tmp_62_alt_flag_15 = ALT_NO; } if (tmp_62_alt_flag_15 == ALT_MAYBE) { current_location.update_lineno(654); /* RTP_Emulation.ttcn, line 654 */ tmp_62_alt_flag_15 = T__transmit.timeout(NULL); if (tmp_62_alt_flag_15 == ALT_YES) { current_location.update_lineno(655); /* RTP_Emulation.ttcn, line 655 */ OCTETSTRING payload(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads()[mod(RTP__Emulation__CT_component_g__tx__next__seq, const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads().lengthof())].fixed__payload()); current_location.update_lineno(656); /* RTP_Emulation.ttcn, line 656 */ INTEGER rtp__payload__type(const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads()[mod(RTP__Emulation__CT_component_g__tx__next__seq, const_cast< const RtpemConfig&>(RTP__Emulation__CT_component_g__cfg).tx__payloads().lengthof())].payload__type()); current_location.update_lineno(658); /* RTP_Emulation.ttcn, line 658 */ f__tx__rtp(payload, rtp__payload__type, f__tx__rtp_marker_defval); current_location.update_lineno(659); /* RTP_Emulation.ttcn, line 659 */ T__transmit.start(); current_location.update_lineno(661); /* RTP_Emulation.ttcn, line 661 */ { INTEGER tmp_156; tmp_156 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).num__pkts__tx() + 1); RTP__Emulation__CT_component_g__stats__rtp.num__pkts__tx() = tmp_156; } current_location.update_lineno(662); /* RTP_Emulation.ttcn, line 662 */ { INTEGER tmp_157; tmp_157 = (const_cast< const RtpemStats&>(RTP__Emulation__CT_component_g__stats__rtp).bytes__payload__tx() + payload.lengthof()); RTP__Emulation__CT_component_g__stats__rtp.bytes__payload__tx() = tmp_157; } break; } } if (tmp_62_alt_flag_16 == ALT_UNCHECKED) { current_location.update_lineno(666); /* RTP_Emulation.ttcn, line 666 */ if (RTP__Emulation__CT_component_g__conn__refuse__expect) tmp_62_alt_flag_16 = ALT_MAYBE; else tmp_62_alt_flag_16 = ALT_NO; } if (tmp_62_alt_flag_16 == ALT_MAYBE) { current_location.update_lineno(666); /* RTP_Emulation.ttcn, line 666 */ tmp_62_alt_flag_16 = RTP__Emulation__CT_component_RTP.receive(tr__conn__refuse, NULL, any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_16 == ALT_YES) { current_location.update_lineno(667); /* RTP_Emulation.ttcn, line 667 */ TTCN_Logger::log_str(TTCN_USER, "Connection refused (expected)"); current_location.update_lineno(668); /* RTP_Emulation.ttcn, line 668 */ RTP__Emulation__CT_component_g__conn__refuse__received = TRUE; break; } } if (tmp_62_alt_flag_17 == ALT_UNCHECKED) { current_location.update_lineno(670); /* RTP_Emulation.ttcn, line 670 */ if ((!(RTP__Emulation__CT_component_g__conn__refuse__expect))) tmp_62_alt_flag_17 = ALT_MAYBE; else tmp_62_alt_flag_17 = ALT_NO; } if (tmp_62_alt_flag_17 == ALT_MAYBE) { current_location.update_lineno(670); /* RTP_Emulation.ttcn, line 670 */ tmp_62_alt_flag_17 = RTP__Emulation__CT_component_RTP.receive(tr__conn__refuse, NULL, any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_17 == ALT_YES) { current_location.update_lineno(671); /* RTP_Emulation.ttcn, line 671 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Connection refused (unexpected)"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(672); /* RTP_Emulation.ttcn, line 672 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_62_alt_flag_18 == ALT_MAYBE) { current_location.update_lineno(676); /* RTP_Emulation.ttcn, line 676 */ tmp_62_alt_flag_18 = RTP__Emulation__CT_component_RTP.receive(any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_18 == ALT_YES) { current_location.update_lineno(677); /* RTP_Emulation.ttcn, line 677 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected type from RTP"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(678); /* RTP_Emulation.ttcn, line 678 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_62_alt_flag_19 == ALT_MAYBE) { current_location.update_lineno(680); /* RTP_Emulation.ttcn, line 680 */ tmp_62_alt_flag_19 = RTP__Emulation__CT_component_RTCP.receive(any_compref, NULL, NULL, NULL); if (tmp_62_alt_flag_19 == ALT_YES) { current_location.update_lineno(681); /* RTP_Emulation.ttcn, line 681 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected type from RTCP"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(682); /* RTP_Emulation.ttcn, line 682 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_62_default_flag == ALT_MAYBE) { tmp_62_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_62_default_flag == ALT_YES || tmp_62_default_flag == ALT_BREAK) break; else if (tmp_62_default_flag == ALT_REPEAT) goto tmp_62; } current_location.update_lineno(458); /* RTP_Emulation.ttcn, line 458 */ if (tmp_62_alt_flag_0 == ALT_NO && tmp_62_alt_flag_1 == ALT_NO && tmp_62_alt_flag_2 == ALT_NO && tmp_62_alt_flag_3 == ALT_NO && tmp_62_alt_flag_4 == ALT_NO && tmp_62_alt_flag_5 == ALT_NO && tmp_62_alt_flag_6 == ALT_NO && tmp_62_alt_flag_7 == ALT_NO && tmp_62_alt_flag_8 == ALT_NO && tmp_62_alt_flag_9 == ALT_NO && tmp_62_alt_flag_10 == ALT_NO && tmp_62_alt_flag_11 == ALT_NO && tmp_62_alt_flag_12 == ALT_NO && tmp_62_alt_flag_13 == ALT_NO && tmp_62_alt_flag_14 == ALT_NO && tmp_62_alt_flag_15 == ALT_NO && tmp_62_alt_flag_16 == ALT_NO && tmp_62_alt_flag_17 == ALT_NO && tmp_62_alt_flag_18 == ALT_NO && tmp_62_alt_flag_19 == ALT_NO && tmp_62_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file RTP_Emulation.ttcn between lines 458 and 684."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } } void start_f__main(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_main("); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "RTP_Emulation", "f_main", text_buf); TTCN_Runtime::send_start_component(text_buf); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("RTP_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RTP_Emulation"); RTP__CodecPort__CtrlFunct::module_object.pre_init_module(); IuUP__Emulation::module_object.pre_init_module(); current_location.update_lineno(146); /* RTP_Emulation.ttcn, line 146 */ const_c__RtpemStatsReset.num__pkts__tx() = 0; const_c__RtpemStatsReset.bytes__payload__tx() = 0; const_c__RtpemStatsReset.num__pkts__rx() = 0; const_c__RtpemStatsReset.bytes__payload__rx() = 0; const_c__RtpemStatsReset.num__pkts__rx__err__seq() = 0; const_c__RtpemStatsReset.num__pkts__rx__err__ts() = 0; const_c__RtpemStatsReset.num__pkts__rx__err__pt() = 0; const_c__RtpemStatsReset.num__pkts__rx__err__disabled() = 0; const_c__RtpemStatsReset.num__pkts__rx__err__payload() = 0; current_location.update_lineno(173); /* RTP_Emulation.ttcn, line 173 */ const_c__RtpemDefaultCfg.tx__samplerate__hz() = 8000; const_c__RtpemDefaultCfg.tx__duration__ms() = 20; const_c__RtpemDefaultCfg.tx__ssrc() = bs_0; { RtpemConfig_tx__payloads& tmp_0 = const_c__RtpemDefaultCfg.tx__payloads(); tmp_0.set_size(1); { RtpemConfigPayload& tmp_1 = tmp_0[0]; tmp_1.payload__type() = 0; tmp_1.fixed__payload() = os_0; } } { RtpemConfig_rx__payloads& tmp_2 = const_c__RtpemDefaultCfg.rx__payloads(); tmp_2.set_size(1); { RtpemConfigPayload& tmp_3 = tmp_2[0]; tmp_3.payload__type() = 0; tmp_3.fixed__payload() = os_0; } } const_c__RtpemDefaultCfg.iuup__mode() = FALSE; const_c__RtpemDefaultCfg.iuup__cfg() = IuUP__Emulation::c__IuUP__Config__def; module_object.add_function("f_rtpem_bind", (genericfunc_t)&f__rtpem__bind, NULL); module_object.add_function("f_rtpem_connect", (genericfunc_t)&f__rtpem__connect, NULL); module_object.add_function("f_rtpem_mode", (genericfunc_t)&f__rtpem__mode, NULL); module_object.add_function("f_rtpem_configure", (genericfunc_t)&f__rtpem__configure, NULL); module_object.add_function("f_rtpem_stats_get", (genericfunc_t)&f__rtpem__stats__get, NULL); module_object.add_function("f_rtpem_stats_compare_value", (genericfunc_t)&f__rtpem__stats__compare__value, NULL); module_object.add_function("f_rtpem_stats_compare", (genericfunc_t)&f__rtpem__stats__compare, NULL); module_object.add_function("f_rtpem_stats_err_check", (genericfunc_t)&f__rtpem__stats__err__check, NULL); module_object.add_function("f_rtpem_conn_refuse_expect", (genericfunc_t)&f__rtpem__conn__refuse__expect, NULL); module_object.add_function("f_rtpem_conn_refuse_verify", (genericfunc_t)&f__rtpem__conn__refuse__verify, NULL); module_object.add_function("f_tx_rtp", (genericfunc_t)&f__tx__rtp, (genericfunc_t)&start_f__tx__rtp); module_object.add_function("f_check_fixed_rx_payloads", (genericfunc_t)&f__check__fixed__rx__payloads, (genericfunc_t)&start_f__check__fixed__rx__payloads); module_object.add_function("f_main", (genericfunc_t)&f__main, (genericfunc_t)&start_f__main); } void post_init_module() { TTCN_Location current_location("RTP_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "RTP_Emulation"); RTP__CodecPort__CtrlFunct::module_object.post_init_module(); IuUP__Emulation::module_object.post_init_module(); current_location.update_lineno(220); /* RTP_Emulation.ttcn, line 220 */ const_f__rtpem__stats__get_rtcp_defval = FALSE; current_location.update_lineno(228); /* RTP_Emulation.ttcn, line 228 */ const_f__rtpem__stats__compare__value_tolerance_defval = 0; current_location.update_lineno(247); /* RTP_Emulation.ttcn, line 247 */ const_f__rtpem__stats__compare_tolerance_defval = 0; current_location.update_lineno(346); /* RTP_Emulation.ttcn, line 346 */ const_ts__RTP_marker_defval = bs_1; current_location.update_lineno(361); /* RTP_Emulation.ttcn, line 361 */ const_f__tx__rtp_marker_defval = bs_1; } boolean init_comp_type(const char *component_type, boolean init_base_comps) { (void)init_base_comps; if (!strcmp(component_type, "RTP_Emulation_CT")) { RTP__Emulation__CT_component_RTP.activate_port(); RTP__Emulation__CT_component_g__rtp__conn__id = -1; RTP__Emulation__CT_component_RTCP.activate_port(); RTP__Emulation__CT_component_g__rtcp__conn__id = -1; RTP__Emulation__CT_component_CTRL.activate_port(); RTP__Emulation__CT_component_DATA.activate_port(); RTP__Emulation__CT_component_g__cfg = c__RtpemDefaultCfg; RTP__Emulation__CT_component_g__stats__rtp = c__RtpemStatsReset; RTP__Emulation__CT_component_g__stats__rtcp = c__RtpemStatsReset; RTP__Emulation__CT_component_g__remote__host.clean_up(); RTP__Emulation__CT_component_g__remote__port.clean_up(); RTP__Emulation__CT_component_g__local__host.clean_up(); RTP__Emulation__CT_component_g__local__port.clean_up(); RTP__Emulation__CT_component_g__loopback = FALSE; RTP__Emulation__CT_component_g__rx__enabled = FALSE; RTP__Emulation__CT_component_g__tx__connected = FALSE; RTP__Emulation__CT_component_g__tx__next__seq = 0; RTP__Emulation__CT_component_g__tx__next__ts = 0; RTP__Emulation__CT_component_g__rx__payload__type = 0; RTP__Emulation__CT_component_g__rx__last__seq.clean_up(); RTP__Emulation__CT_component_g__rx__last__ts.clean_up(); RTP__Emulation__CT_component_g__iuup__ent.clean_up(); RTP__Emulation__CT_component_g__conn__refuse__expect = FALSE; RTP__Emulation__CT_component_g__conn__refuse__received = FALSE; return TRUE; } else return FALSE; } boolean init_system_port(const char* component_type, const char* port_name) { if (!strcmp(component_type, "RTP_Emulation_CT")) { if (!strcmp(port_name, "CTRL")) { RTP__Emulation__CT_component_CTRL.safe_start(); return TRUE; } if (!strcmp(port_name, "DATA")) { RTP__Emulation__CT_component_DATA.safe_start(); return TRUE; } if (!strcmp(port_name, "RTCP")) { RTP__Emulation__CT_component_RTCP.safe_start(); return TRUE; } if (!strcmp(port_name, "RTP")) { RTP__Emulation__CT_component_RTP.safe_start(); return TRUE; } } return FALSE; } boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments) { if (!strcmp(function_name, "f_tx_rtp")) { OCTETSTRING payload; INTEGER rtp__payload__type; BITSTRING marker; payload.decode_text(function_arguments); rtp__payload__type.decode_text(function_arguments); marker.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tx_rtp("); payload.log(); TTCN_Logger::log_event_str(", "); rtp__payload__type.log(); TTCN_Logger::log_event_str(", "); marker.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tx__rtp(payload, rtp__payload__type, marker); TTCN_Runtime::function_finished("f_tx_rtp"); return TRUE; } else if (!strcmp(function_name, "f_check_fixed_rx_payloads")) { INTEGER rtp__payload__type; OCTETSTRING rtp__data; rtp__payload__type.decode_text(function_arguments); rtp__data.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_check_fixed_rx_payloads("); rtp__payload__type.log(); TTCN_Logger::log_event_str(", "); rtp__data.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__check__fixed__rx__payloads(rtp__payload__type, rtp__data); TTCN_Runtime::function_finished("f_check_fixed_rx_payloads"); return TRUE; } else if (!strcmp(function_name, "f_main")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_main()."); TTCN_Runtime::function_started(function_arguments); f__main(); TTCN_Runtime::function_finished("f_main"); return TRUE; } else return FALSE; } } /* end of namespace */