// 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 "ConnHdlr.hh" namespace ConnHdlr { /* Literal string constants */ const unsigned char hs_2_nibbles[] = { 0, 1 }, hs_3_nibbles[] = { 16 }, hs_0_nibbles[] = { 17, 17, 1 }, hs_1_nibbles[] = { 34, 34, 2 }; extern const HEXSTRING hs_2(3, hs_2_nibbles), hs_3(2, hs_3_nibbles), hs_0(5, hs_0_nibbles), hs_1(5, hs_1_nibbles); const unsigned char os_8_octets[] = { 0 }, os_4_octets[] = { 0, 0, 0, 0, 0, 0, 0, 0 }, os_7_octets[] = { 0, 241, 16 }, os_1_octets[] = { 16, 16, 16, 16 }, os_6_octets[] = { 23 }, os_0_octets[] = { 34, 0, 34, 0 }, os_5_octets[] = { 42, 42 }, os_2_octets[] = { 48, 48, 48, 48 }, os_3_octets[] = { 68, 0, 68, 0 }; extern const OCTETSTRING os_8(1, os_8_octets), os_4(8, os_4_octets), os_7(3, os_7_octets), os_1(4, os_1_octets), os_6(1, os_6_octets), os_0(4, os_0_octets), os_5(2, os_5_octets), os_2(4, os_2_octets), os_3(4, os_3_octets); extern const CHARSTRING cs_11(12, "\aosmocom\003org"), cs_23(6, " != -1"), cs_8(9, "127.0.0.1"), cs_7(9, "127.0.0.2"), cs_9(9, "127.0.0.3"), cs_10(9, "127.0.0.4"), cs_5(9, "127.1.1.1"), cs_2(9, "127.1.2.1"), cs_3(9, "127.1.2.2"), cs_6(9, "127.1.3.1"), cs_15(12, "192.168.1.23"), cs_20(2, "42"), cs_17(3, "542"), cs_1(4, "@mgw"), cs_13(13, "ConnHdlr.ttcn"), cs_18(11, "FORCED_FAIL"), cs_22(25, "MSC using unexpected CID "), cs_16(30, "Rx Unexpected RLSD to our RLSD"), cs_24(24, "Timeout waiting for MGCP"), cs_4(13, "VND.3GPP.IUFP"), cs_21(7, "X-OSMUX"), cs_19('Z'), cs_12(6, "enable"), cs_14(4, "omit"), cs_0(10, "rtpbridge/"); const unsigned char module_checksum[] = { 0x6a, 0xc3, 0x4c, 0xfb, 0xd8, 0x33, 0x68, 0x1a, 0x80, 0xa8, 0x9a, 0xa4, 0xf3, 0x10, 0x6a, 0x09 }; /* Global variable definitions */ const TTCN_Typedescriptor_t& ConnHdlr_descr_ = COMPONENT_descr_; INTEGER ConnHdlr_component_g__sccp__conn__id; const XERdescriptor_t TestHdlrParams_hnb__idx_xer_ = { {"hnb_idx>\n", "hnb_idx>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TestHdlrParams_hnb__idx_descr_ = { "@ConnHdlr.TestHdlrParams.hnb_idx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TestHdlrParams_hnb__idx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_cn__idx_xer_ = { {"cn_idx>\n", "cn_idx>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TestHdlrParams_cn__idx_descr_ = { "@ConnHdlr.TestHdlrParams.cn_idx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TestHdlrParams_cn__idx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_imsi_xer_ = { {"imsi>\n", "imsi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TestHdlrParams_imsi_descr_ = { "@ConnHdlr.TestHdlrParams.imsi", NULL, &HEXSTRING_raw_, NULL, &TestHdlrParams_imsi_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_ps__domain_xer_ = { {"ps_domain>\n", "ps_domain>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int TestHdlrParams_ps__domain_oer_ext_arr_[0] = {}; const int TestHdlrParams_ps__domain_oer_p_[0] = {}; const TTCN_OERdescriptor_t TestHdlrParams_ps__domain_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TestHdlrParams_ps__domain_oer_ext_arr_, 0, TestHdlrParams_ps__domain_oer_p_}; const TTCN_Typedescriptor_t TestHdlrParams_ps__domain_descr_ = { "@ConnHdlr.TestHdlrParams.ps_domain", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &TestHdlrParams_ps__domain_xer_, &BOOLEAN_json_, &TestHdlrParams_ps__domain_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_got__crcx__count_xer_ = { {"got_crcx_count>\n", "got_crcx_count>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_got__crcx__count_descr_ = { "@ConnHdlr.MgcpParameters.got_crcx_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgcpParameters_got__crcx__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_got__dlcx__count_xer_ = { {"got_dlcx_count>\n", "got_dlcx_count>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_got__dlcx__count_descr_ = { "@ConnHdlr.MgcpParameters.got_dlcx_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgcpParameters_got__dlcx__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_mgcp__ep_xer_ = { {"mgcp_ep>\n", "mgcp_ep>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_mgcp__ep_descr_ = { "@ConnHdlr.MgcpParameters.mgcp_ep", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgcpParameters_mgcp__ep_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MgcpParameters_mgcp__ep_default_coding("TEXT"); const XERdescriptor_t MgwResponse_resp_xer_ = { {"resp>\n", "resp>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgwResponse_resp_descr_ = { "@ConnHdlr.MgwResponse.resp", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgwResponse_resp_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgwResponse_mgw__rtp__ip_xer_ = { {"mgw_rtp_ip>\n", "mgw_rtp_ip>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgwResponse_mgw__rtp__ip_descr_ = { "@ConnHdlr.MgwResponse.mgw_rtp_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgwResponse_mgw__rtp__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgwResponse_mgw__rtp__port_xer_ = { {"mgw_rtp_port>\n", "mgw_rtp_port>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgwResponse_mgw__rtp__port_descr_ = { "@ConnHdlr.MgwResponse.mgw_rtp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgwResponse_mgw__rtp__port_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgwResponse_mgcp__connection__id_xer_ = { {"mgcp_connection_id>\n", "mgcp_connection_id>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgwResponse_mgcp__connection__id_descr_ = { "@ConnHdlr.MgwResponse.mgcp_connection_id", NULL, &HEXSTRING_raw_, NULL, &MgwResponse_mgcp__connection__id_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for MgwResponse const TTCN_Typedescriptor_t MgwResponse_descr_ = { "@ConnHdlr.MgwResponse", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgwResponse_mgw__rtp__ip__mdcx_xer_ = { {"mgw_rtp_ip_mdcx>\n", "mgw_rtp_ip_mdcx>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgwResponse_mgw__rtp__ip__mdcx_descr_ = { "@ConnHdlr.MgwResponse.mgw_rtp_ip_mdcx", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgwResponse_mgw__rtp__ip__mdcx_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_rtp__payload__type_xer_ = { {"rtp_payload_type>\n", "rtp_payload_type>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_rtp__payload__type_descr_ = { "@ConnHdlr.MgcpParameters.rtp_payload_type", &INTEGER_ber_, &Osmocom__Types::uint7__t_raw_, &INTEGER_text_, &MgcpParameters_rtp__payload__type_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MgcpParameters_rtp__payload__type_default_coding("RAW"); const XERdescriptor_t MgcpParameters_rtp__sdp__format_xer_ = { {"rtp_sdp_format>\n", "rtp_sdp_format>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_rtp__sdp__format_descr_ = { "@ConnHdlr.MgcpParameters.rtp_sdp_format", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgcpParameters_rtp__sdp__format_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_hnb__rtp__ip_xer_ = { {"hnb_rtp_ip>\n", "hnb_rtp_ip>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_hnb__rtp__ip_descr_ = { "@ConnHdlr.MgcpParameters.hnb_rtp_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgcpParameters_hnb__rtp__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_hnb__rtp__port_xer_ = { {"hnb_rtp_port>\n", "hnb_rtp_port>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t MgcpParameters_hnb__rtp__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t MgcpParameters_hnb__rtp__port_descr_ = { "@ConnHdlr.MgcpParameters.hnb_rtp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgcpParameters_hnb__rtp__port_xer_, &INTEGER_json_, &MgcpParameters_hnb__rtp__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_cn__rtp__ip_xer_ = { {"cn_rtp_ip>\n", "cn_rtp_ip>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_cn__rtp__ip_descr_ = { "@ConnHdlr.MgcpParameters.cn_rtp_ip", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MgcpParameters_cn__rtp__ip_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_cn__rtp__port_xer_ = { {"cn_rtp_port>\n", "cn_rtp_port>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t MgcpParameters_cn__rtp__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t MgcpParameters_cn__rtp__port_descr_ = { "@ConnHdlr.MgcpParameters.cn_rtp_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgcpParameters_cn__rtp__port_xer_, &INTEGER_json_, &MgcpParameters_cn__rtp__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_use__osmux_xer_ = { {"use_osmux>\n", "use_osmux>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int MgcpParameters_use__osmux_oer_ext_arr_[0] = {}; const int MgcpParameters_use__osmux_oer_p_[0] = {}; const TTCN_OERdescriptor_t MgcpParameters_use__osmux_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MgcpParameters_use__osmux_oer_ext_arr_, 0, MgcpParameters_use__osmux_oer_p_}; const TTCN_Typedescriptor_t MgcpParameters_use__osmux_descr_ = { "@ConnHdlr.MgcpParameters.use_osmux", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &MgcpParameters_use__osmux_xer_, &BOOLEAN_json_, &MgcpParameters_use__osmux_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_got__osmux__count_xer_ = { {"got_osmux_count>\n", "got_osmux_count>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_got__osmux__count_descr_ = { "@ConnHdlr.MgcpParameters.got_osmux_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MgcpParameters_got__osmux__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for MgcpParameters const TTCN_Typedescriptor_t MgcpParameters_descr_ = { "@ConnHdlr.MgcpParameters", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MgcpParameters_mgcp__call__id_xer_ = { {"mgcp_call_id>\n", "mgcp_call_id>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MgcpParameters_mgcp__call__id_descr_ = { "@ConnHdlr.MgcpParameters.mgcp_call_id", NULL, &HEXSTRING_raw_, NULL, &MgcpParameters_mgcp__call__id_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t FTeid_addr_xer_ = { {"addr>\n", "addr>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t FTeid_addr_descr_ = { "@ConnHdlr.FTeid.addr", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &FTeid_addr_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t FTeid_teid_xer_ = { {"teid>\n", "teid>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int FTeid_teid_oer_ext_arr_[0] = {}; const int FTeid_teid_oer_p_[0] = {}; const TTCN_OERdescriptor_t FTeid_teid_oer_ = { -1, TRUE, 4, FALSE, 0, 0, FTeid_teid_oer_ext_arr_, 0, FTeid_teid_oer_p_}; const TTCN_Typedescriptor_t FTeid_teid_descr_ = { "@ConnHdlr.FTeid.teid", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &FTeid_teid_xer_, &OCTETSTRING_json_, &FTeid_teid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING FTeid_teid_default_coding("RAW"); // No XER for FTeid const TTCN_Typedescriptor_t FTeid_descr_ = { "@ConnHdlr.FTeid", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for FTeids const TTCN_Typedescriptor_t FTeids_descr_ = { "@ConnHdlr.FTeids", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for GtpParameters const TTCN_Typedescriptor_t GtpParameters_descr_ = { "@ConnHdlr.GtpParameters", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_expect__separate__sccp__cr_xer_ = { {"expect_separate_sccp_cr>\n", "expect_separate_sccp_cr>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int TestHdlrParams_expect__separate__sccp__cr_oer_ext_arr_[0] = {}; const int TestHdlrParams_expect__separate__sccp__cr_oer_p_[0] = {}; const TTCN_OERdescriptor_t TestHdlrParams_expect__separate__sccp__cr_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TestHdlrParams_expect__separate__sccp__cr_oer_ext_arr_, 0, TestHdlrParams_expect__separate__sccp__cr_oer_p_}; const TTCN_Typedescriptor_t TestHdlrParams_expect__separate__sccp__cr_descr_ = { "@ConnHdlr.TestHdlrParams.expect_separate_sccp_cr", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &TestHdlrParams_expect__separate__sccp__cr_xer_, &BOOLEAN_json_, &TestHdlrParams_expect__separate__sccp__cr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_tx__sccp__cr__data__len_xer_ = { {"tx_sccp_cr_data_len>\n", "tx_sccp_cr_data_len>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TestHdlrParams_tx__sccp__cr__data__len_descr_ = { "@ConnHdlr.TestHdlrParams.tx_sccp_cr_data_len", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TestHdlrParams_tx__sccp__cr__data__len_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_expect__compl__l3__success_xer_ = { {"expect_compl_l3_success>\n", "expect_compl_l3_success>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int TestHdlrParams_expect__compl__l3__success_oer_ext_arr_[0] = {}; const int TestHdlrParams_expect__compl__l3__success_oer_p_[0] = {}; const TTCN_OERdescriptor_t TestHdlrParams_expect__compl__l3__success_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TestHdlrParams_expect__compl__l3__success_oer_ext_arr_, 0, TestHdlrParams_expect__compl__l3__success_oer_p_}; const TTCN_Typedescriptor_t TestHdlrParams_expect__compl__l3__success_descr_ = { "@ConnHdlr.TestHdlrParams.expect_compl_l3_success", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &TestHdlrParams_expect__compl__l3__success_xer_, &BOOLEAN_json_, &TestHdlrParams_expect__compl__l3__success_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PfcpParameters_pfcp__enabled_xer_ = { {"pfcp_enabled>\n", "pfcp_enabled>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int PfcpParameters_pfcp__enabled_oer_ext_arr_[0] = {}; const int PfcpParameters_pfcp__enabled_oer_p_[0] = {}; const TTCN_OERdescriptor_t PfcpParameters_pfcp__enabled_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PfcpParameters_pfcp__enabled_oer_ext_arr_, 0, PfcpParameters_pfcp__enabled_oer_p_}; const TTCN_Typedescriptor_t PfcpParameters_pfcp__enabled_descr_ = { "@ConnHdlr.PfcpParameters.pfcp_enabled", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PfcpParameters_pfcp__enabled_xer_, &BOOLEAN_json_, &PfcpParameters_pfcp__enabled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PfcpParameters_pfcp__local__addr_xer_ = { {"pfcp_local_addr>\n", "pfcp_local_addr>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PfcpParameters_pfcp__local__addr_descr_ = { "@ConnHdlr.PfcpParameters.pfcp_local_addr", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &PfcpParameters_pfcp__local__addr_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PfcpParameters_upf__node__id_default_coding("RAW"); UNIVERSAL_CHARSTRING PfcpParameters_upf__f__seid_default_coding("RAW"); // No XER for PfcpParameters const TTCN_Typedescriptor_t PfcpParameters_descr_ = { "@ConnHdlr.PfcpParameters", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PfcpParameters_hnbgw__f__seid_default_coding("RAW"); UNIVERSAL_CHARSTRING TestHdlrParams_rab__rel__cause_default_coding(""); const XERdescriptor_t TestHdlrParams_hnbgw__timer__x31_xer_ = { {"hnbgw_timer_x31>\n", "hnbgw_timer_x31>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TestHdlrParams_hnbgw__timer__x31_descr_ = { "@ConnHdlr.TestHdlrParams.hnbgw_timer_x31", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TestHdlrParams_hnbgw__timer__x31_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TestHdlrParams_sigc__id_default_coding(""); const XERdescriptor_t TestHdlrParams_t__guard_xer_ = { {"t_guard>\n", "t_guard>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int TestHdlrParams_t__guard_oer_ext_arr_[0] = {}; const int TestHdlrParams_t__guard_oer_p_[0] = {}; const TTCN_OERdescriptor_t TestHdlrParams_t__guard_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TestHdlrParams_t__guard_oer_ext_arr_, 0, TestHdlrParams_t__guard_oer_p_}; const TTCN_Typedescriptor_t TestHdlrParams_t__guard_descr_ = { "@ConnHdlr.TestHdlrParams.t_guard", &FLOAT_ber_, &FLOAT_raw_, NULL, &TestHdlrParams_t__guard_xer_, &FLOAT_json_, &TestHdlrParams_t__guard_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for TestHdlrParams const TTCN_Typedescriptor_t TestHdlrParams_descr_ = { "@ConnHdlr.TestHdlrParams", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HnbConfig_lai_default_coding("RAW"); const XERdescriptor_t HnbConfig_rac_xer_ = { {"rac>\n", "rac>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t HnbConfig_rac_descr_ = { "@ConnHdlr.HnbConfig.rac", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &HnbConfig_rac_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HnbConfig_rac_default_coding("RAW"); const XERdescriptor_t HnbConfig_sac_xer_ = { {"sac>\n", "sac>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t HnbConfig_sac_descr_ = { "@ConnHdlr.HnbConfig.sac", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HnbConfig_sac_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t HnbConfig_cell__id_xer_ = { {"cell_id>\n", "cell_id>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t HnbConfig_cell__id_descr_ = { "@ConnHdlr.HnbConfig.cell_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HnbConfig_cell__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for HnbConfig const TTCN_Typedescriptor_t HnbConfig_descr_ = { "@ConnHdlr.HnbConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TestHdlrParams_nas__pdu_xer_ = { {"nas_pdu>\n", "nas_pdu>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int TestHdlrParams_nas__pdu_oer_ext_arr_[0] = {}; const int TestHdlrParams_nas__pdu_oer_p_[0] = {}; const TTCN_OERdescriptor_t TestHdlrParams_nas__pdu_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TestHdlrParams_nas__pdu_oer_ext_arr_, 0, TestHdlrParams_nas__pdu_oer_p_}; const TTCN_Typedescriptor_t TestHdlrParams_nas__pdu_descr_ = { "@ConnHdlr.TestHdlrParams.nas_pdu", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &TestHdlrParams_nas__pdu_xer_, &OCTETSTRING_json_, &TestHdlrParams_nas__pdu_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; TestHdlrParams ConnHdlr_component_g__pars; TIMER ConnHdlr_component_g__Tguard("g_Tguard"); TELNETasp__PortType::TELNETasp__PT ConnHdlr_component_HNBGWVTY("HNBGWVTY"); // No XER for ConnHdlrList const TTCN_Typedescriptor_t ConnHdlrList_descr_ = { "@ConnHdlr.ConnHdlrList", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &COMPONENT_descr_, TTCN_Typedescriptor_t::DONTCARE }; INTEGER const_f__mgcp__endp__str_endp__idx_defval; const INTEGER& f__mgcp__endp__str_endp__idx_defval = const_f__mgcp__endp__str_endp__idx_defval; INTEGER const_t__MgcpParams_endp__idx_defval; const INTEGER& t__MgcpParams_endp__idx_defval = const_t__MgcpParams_endp__idx_defval; GtpParameters_template template_t__GtpParams; const GtpParameters_template& t__GtpParams = template_t__GtpParams; OCTETSTRING const_c__SEID0; const OCTETSTRING& c__SEID0 = const_c__SEID0; BOOLEAN const_t__PfcpParams_pfcp__enabled_defval; const BOOLEAN& t__PfcpParams_pfcp__enabled_defval = const_t__PfcpParams_pfcp__enabled_defval; CHARSTRING const_t__PfcpParams_pfcp__local__addr_defval; const CHARSTRING& t__PfcpParams_pfcp__local__addr_defval = const_t__PfcpParams_pfcp__local__addr_defval; CHARSTRING const_t__PfcpParams_pfcp__upf__node__id_defval; const CHARSTRING& t__PfcpParams_pfcp__upf__node__id_defval = const_t__PfcpParams_pfcp__upf__node__id_defval; INTEGER const_t__PfcpParams_upf__f__seid_defval; const INTEGER& t__PfcpParams_upf__f__seid_defval = const_t__PfcpParams_upf__f__seid_defval; BOOLEAN const_t__pars_ps__domain_defval; const BOOLEAN& t__pars_ps__domain_defval = const_t__pars_ps__domain_defval; INTEGER const_t__pars_hnb__idx_defval; const INTEGER& t__pars_hnb__idx_defval = const_t__pars_hnb__idx_defval; BOOLEAN const_t__pars_expect__separate__sccp__cr_defval; const BOOLEAN& t__pars_expect__separate__sccp__cr_defval = const_t__pars_expect__separate__sccp__cr_defval; INTEGER const_t__pars_tx__sccp__cr__data__len_defval; const INTEGER& t__pars_tx__sccp__cr__data__len_defval = const_t__pars_tx__sccp__cr__data__len_defval; BOOLEAN const_t__pars_expect__compl__l3__success_defval; const BOOLEAN& t__pars_expect__compl__l3__success_defval = const_t__pars_expect__compl__l3__success_defval; INTEGER const_t__pars_cn__idx_defval; const INTEGER& t__pars_cn__idx_defval = const_t__pars_cn__idx_defval; MgcpParameters_template template_t__pars_mgcp__pars_defval; const MgcpParameters_template& t__pars_mgcp__pars_defval = template_t__pars_mgcp__pars_defval; PfcpParameters_template template_t__pars_pfcp__pars_defval; const PfcpParameters_template& t__pars_pfcp__pars_defval = template_t__pars_pfcp__pars_defval; RANAP__IEs::Cause_template template_t__pars_rab__rel__cause_defval; const RANAP__IEs::Cause_template& t__pars_rab__rel__cause_defval = template_t__pars_rab__rel__cause_defval; INTEGER const_t__pars_hnbgw__timer__x31_defval; const INTEGER& t__pars_hnbgw__timer__x31_defval = const_t__pars_hnbgw__timer__x31_defval; FLOAT const_t__pars_t__guard_defval; const FLOAT& t__pars_t__guard_defval = const_t__pars_t__guard_defval; // No XER for void__fn const TTCN_Typedescriptor_t void__fn_descr_ = { "@ConnHdlr.void_fn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; RANAP__PDU__Descriptions::RANAP__PDU_template template_f__iuh2iu_exp__rx_defval; const RANAP__PDU__Descriptions::RANAP__PDU_template& f__iuh2iu_exp__rx_defval = template_f__iuh2iu_exp__rx_defval; RANAP__PDU__Descriptions::RANAP__PDU_template template_f__iu2iuh_exp__rx_defval; const RANAP__PDU__Descriptions::RANAP__PDU_template& f__iu2iuh_exp__rx_defval = template_f__iu2iuh_exp__rx_defval; RANAP__PDU__Descriptions::RANAP__PDU_template template_f__iuh2iu__connect_exp__rx_defval; const RANAP__PDU__Descriptions::RANAP__PDU_template& f__iuh2iu__connect_exp__rx_defval = template_f__iuh2iu__connect_exp__rx_defval; RANAP__PDU__Descriptions::RANAP__PDU_template template_f__iuh2iu__disconnect_exp__rx_defval; const RANAP__PDU__Descriptions::RANAP__PDU_template& f__iuh2iu__disconnect_exp__rx_defval = template_f__iuh2iu__disconnect_exp__rx_defval; BOOLEAN const_f__cn__iu__release__procedure_mgcp__teardown_defval; const BOOLEAN& f__cn__iu__release__procedure_mgcp__teardown_defval = const_f__cn__iu__release__procedure_mgcp__teardown_defval; BOOLEAN const_f__cn__iu__release__procedure_pfcp__teardown_defval; const BOOLEAN& f__cn__iu__release__procedure_pfcp__teardown_defval = const_f__cn__iu__release__procedure_pfcp__teardown_defval; FLOAT const_f__pfcp__expect_wait__time_defval; const FLOAT& f__pfcp__expect_wait__time_defval = const_f__pfcp__expect_wait__time_defval; BOOLEAN const_f__perform__compl__l3_do__clear_defval; const BOOLEAN& f__perform__compl__l3_do__clear_defval = const_f__perform__compl__l3_do__clear_defval; BOOLEAN const_f__perform__compl__l3_expect__success_defval; const BOOLEAN& f__perform__compl__l3_expect__success_defval = const_f__perform__compl__l3_expect__success_defval; TTCN_Module module_object("ConnHdlr", __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 */ MgwResponse::MgwResponse() { } MgwResponse::MgwResponse(const INTEGER& par_resp, const CHARSTRING& par_mgw__rtp__ip, const OPTIONAL< CHARSTRING >& par_mgw__rtp__ip__mdcx, const INTEGER& par_mgw__rtp__port, const HEXSTRING& par_mgcp__connection__id) : field_resp(par_resp), field_mgw__rtp__ip(par_mgw__rtp__ip), field_mgw__rtp__ip__mdcx(par_mgw__rtp__ip__mdcx), field_mgw__rtp__port(par_mgw__rtp__port), field_mgcp__connection__id(par_mgcp__connection__id) { } MgwResponse::MgwResponse(const MgwResponse& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @ConnHdlr.MgwResponse."); if (other_value.resp().is_bound()) field_resp = other_value.resp(); else field_resp.clean_up(); if (other_value.mgw__rtp__ip().is_bound()) field_mgw__rtp__ip = other_value.mgw__rtp__ip(); else field_mgw__rtp__ip.clean_up(); if (other_value.mgw__rtp__ip__mdcx().is_bound()) field_mgw__rtp__ip__mdcx = other_value.mgw__rtp__ip__mdcx(); else field_mgw__rtp__ip__mdcx.clean_up(); if (other_value.mgw__rtp__port().is_bound()) field_mgw__rtp__port = other_value.mgw__rtp__port(); else field_mgw__rtp__port.clean_up(); if (other_value.mgcp__connection__id().is_bound()) field_mgcp__connection__id = other_value.mgcp__connection__id(); else field_mgcp__connection__id.clean_up(); } void MgwResponse::clean_up() { field_resp.clean_up(); field_mgw__rtp__ip.clean_up(); field_mgw__rtp__ip__mdcx.clean_up(); field_mgw__rtp__port.clean_up(); field_mgcp__connection__id.clean_up(); } const TTCN_Typedescriptor_t* MgwResponse::get_descriptor() const { return &MgwResponse_descr_; } MgwResponse& MgwResponse::operator=(const MgwResponse& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @ConnHdlr.MgwResponse."); if (other_value.resp().is_bound()) field_resp = other_value.resp(); else field_resp.clean_up(); if (other_value.mgw__rtp__ip().is_bound()) field_mgw__rtp__ip = other_value.mgw__rtp__ip(); else field_mgw__rtp__ip.clean_up(); if (other_value.mgw__rtp__ip__mdcx().is_bound()) field_mgw__rtp__ip__mdcx = other_value.mgw__rtp__ip__mdcx(); else field_mgw__rtp__ip__mdcx.clean_up(); if (other_value.mgw__rtp__port().is_bound()) field_mgw__rtp__port = other_value.mgw__rtp__port(); else field_mgw__rtp__port.clean_up(); if (other_value.mgcp__connection__id().is_bound()) field_mgcp__connection__id = other_value.mgcp__connection__id(); else field_mgcp__connection__id.clean_up(); } return *this; } boolean MgwResponse::operator==(const MgwResponse& other_value) const { return field_resp==other_value.field_resp && field_mgw__rtp__ip==other_value.field_mgw__rtp__ip && field_mgw__rtp__ip__mdcx==other_value.field_mgw__rtp__ip__mdcx && field_mgw__rtp__port==other_value.field_mgw__rtp__port && field_mgcp__connection__id==other_value.field_mgcp__connection__id; } boolean MgwResponse::is_bound() const { return (field_resp.is_bound()) || (field_mgw__rtp__ip.is_bound()) || (OPTIONAL_OMIT == field_mgw__rtp__ip__mdcx.get_selection() || field_mgw__rtp__ip__mdcx.is_bound()) || (field_mgw__rtp__port.is_bound()) || (field_mgcp__connection__id.is_bound()); } boolean MgwResponse::is_value() const { return field_resp.is_value() && field_mgw__rtp__ip.is_value() && (OPTIONAL_OMIT == field_mgw__rtp__ip__mdcx.get_selection() || field_mgw__rtp__ip__mdcx.is_value()) && field_mgw__rtp__port.is_value() && field_mgcp__connection__id.is_value(); } int MgwResponse::size_of() const { int ret_val = 4; if (field_mgw__rtp__ip__mdcx.ispresent()) ret_val++; return ret_val; } void MgwResponse::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ resp := "); field_resp.log(); TTCN_Logger::log_event_str(", mgw_rtp_ip := "); field_mgw__rtp__ip.log(); TTCN_Logger::log_event_str(", mgw_rtp_ip_mdcx := "); field_mgw__rtp__ip__mdcx.log(); TTCN_Logger::log_event_str(", mgw_rtp_port := "); field_mgw__rtp__port.log(); TTCN_Logger::log_event_str(", mgcp_connection_id := "); field_mgcp__connection__id.log(); TTCN_Logger::log_event_str(" }"); } void MgwResponse::set_implicit_omit() { if (resp().is_bound()) resp().set_implicit_omit(); if (mgw__rtp__ip().is_bound()) mgw__rtp__ip().set_implicit_omit(); if (!mgw__rtp__ip__mdcx().is_bound()) mgw__rtp__ip__mdcx() = OMIT_VALUE; else mgw__rtp__ip__mdcx().set_implicit_omit(); if (mgw__rtp__port().is_bound()) mgw__rtp__port().set_implicit_omit(); if (mgcp__connection__id().is_bound()) mgcp__connection__id().set_implicit_omit(); } void MgwResponse::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 (50 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) resp().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__ip().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__ip__mdcx().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__port().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgcp__connection__id().set_param(*param.get_elem(4)); 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(), "resp")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { resp().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_ip_mdcx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__ip__mdcx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_connection_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__connection__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.MgwResponse: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.MgwResponse"); } } void MgwResponse::encode_text(Text_Buf& text_buf) const { field_resp.encode_text(text_buf); field_mgw__rtp__ip.encode_text(text_buf); field_mgw__rtp__ip__mdcx.encode_text(text_buf); field_mgw__rtp__port.encode_text(text_buf); field_mgcp__connection__id.encode_text(text_buf); } void MgwResponse::decode_text(Text_Buf& text_buf) { field_resp.decode_text(text_buf); field_mgw__rtp__ip.decode_text(text_buf); field_mgw__rtp__ip__mdcx.decode_text(text_buf); field_mgw__rtp__port.decode_text(text_buf); field_mgcp__connection__id.decode_text(text_buf); } struct MgwResponse_template::single_value_struct { INTEGER_template field_resp; CHARSTRING_template field_mgw__rtp__ip; CHARSTRING_template field_mgw__rtp__ip__mdcx; INTEGER_template field_mgw__rtp__port; HEXSTRING_template field_mgcp__connection__id; }; void MgwResponse_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_resp = ANY_VALUE; single_value->field_mgw__rtp__ip = ANY_VALUE; single_value->field_mgw__rtp__ip__mdcx = ANY_OR_OMIT; single_value->field_mgw__rtp__port = ANY_VALUE; single_value->field_mgcp__connection__id = ANY_VALUE; } } } void MgwResponse_template::copy_value(const MgwResponse& other_value) { single_value = new single_value_struct; if (other_value.resp().is_bound()) { single_value->field_resp = other_value.resp(); } else { single_value->field_resp.clean_up(); } if (other_value.mgw__rtp__ip().is_bound()) { single_value->field_mgw__rtp__ip = other_value.mgw__rtp__ip(); } else { single_value->field_mgw__rtp__ip.clean_up(); } if (other_value.mgw__rtp__ip__mdcx().is_bound()) { if (other_value.mgw__rtp__ip__mdcx().ispresent()) single_value->field_mgw__rtp__ip__mdcx = other_value.mgw__rtp__ip__mdcx()(); else single_value->field_mgw__rtp__ip__mdcx = OMIT_VALUE; } else { single_value->field_mgw__rtp__ip__mdcx.clean_up(); } if (other_value.mgw__rtp__port().is_bound()) { single_value->field_mgw__rtp__port = other_value.mgw__rtp__port(); } else { single_value->field_mgw__rtp__port.clean_up(); } if (other_value.mgcp__connection__id().is_bound()) { single_value->field_mgcp__connection__id = other_value.mgcp__connection__id(); } else { single_value->field_mgcp__connection__id.clean_up(); } set_selection(SPECIFIC_VALUE); } void MgwResponse_template::copy_template(const MgwResponse_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.resp().get_selection()) { single_value->field_resp = other_value.resp(); } else { single_value->field_resp.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgw__rtp__ip().get_selection()) { single_value->field_mgw__rtp__ip = other_value.mgw__rtp__ip(); } else { single_value->field_mgw__rtp__ip.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgw__rtp__ip__mdcx().get_selection()) { single_value->field_mgw__rtp__ip__mdcx = other_value.mgw__rtp__ip__mdcx(); } else { single_value->field_mgw__rtp__ip__mdcx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgw__rtp__port().get_selection()) { single_value->field_mgw__rtp__port = other_value.mgw__rtp__port(); } else { single_value->field_mgw__rtp__port.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgcp__connection__id().get_selection()) { single_value->field_mgcp__connection__id = other_value.mgcp__connection__id(); } else { single_value->field_mgcp__connection__id.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 MgwResponse_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 MgwResponse_template(*other_value.implication_.precondition); implication_.implied_template = new MgwResponse_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 @ConnHdlr.MgwResponse."); break; } set_selection(other_value); } MgwResponse_template::MgwResponse_template() { } MgwResponse_template::MgwResponse_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MgwResponse_template::MgwResponse_template(const MgwResponse& other_value) { copy_value(other_value); } MgwResponse_template::MgwResponse_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MgwResponse&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.MgwResponse from an unbound optional field."); } } MgwResponse_template::MgwResponse_template(MgwResponse_template* p_precondition, MgwResponse_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MgwResponse_template::MgwResponse_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; } MgwResponse_template::MgwResponse_template(const MgwResponse_template& other_value) : Base_Template() { copy_template(other_value); } MgwResponse_template::~MgwResponse_template() { clean_up(); } MgwResponse_template& MgwResponse_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MgwResponse_template& MgwResponse_template::operator=(const MgwResponse& other_value) { clean_up(); copy_value(other_value); return *this; } MgwResponse_template& MgwResponse_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MgwResponse&)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 @ConnHdlr.MgwResponse."); } return *this; } MgwResponse_template& MgwResponse_template::operator=(const MgwResponse_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MgwResponse_template::match(const MgwResponse& 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.resp().is_bound()) return FALSE; if(!single_value->field_resp.match(other_value.resp(), legacy))return FALSE; if(!other_value.mgw__rtp__ip().is_bound()) return FALSE; if(!single_value->field_mgw__rtp__ip.match(other_value.mgw__rtp__ip(), legacy))return FALSE; if(!other_value.mgw__rtp__ip__mdcx().is_bound()) return FALSE; if((other_value.mgw__rtp__ip__mdcx().ispresent() ? !single_value->field_mgw__rtp__ip__mdcx.match((const CHARSTRING&)other_value.mgw__rtp__ip__mdcx(), legacy) : !single_value->field_mgw__rtp__ip__mdcx.match_omit(legacy)))return FALSE; if(!other_value.mgw__rtp__port().is_bound()) return FALSE; if(!single_value->field_mgw__rtp__port.match(other_value.mgw__rtp__port(), legacy))return FALSE; if(!other_value.mgcp__connection__id().is_bound()) return FALSE; if(!single_value->field_mgcp__connection__id.match(other_value.mgcp__connection__id(), 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 @ConnHdlr.MgwResponse."); } return FALSE; } boolean MgwResponse_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_resp.is_bound() || single_value->field_mgw__rtp__ip.is_bound() || (single_value->field_mgw__rtp__ip__mdcx.is_omit() || single_value->field_mgw__rtp__ip__mdcx.is_bound()) || single_value->field_mgw__rtp__port.is_bound() || single_value->field_mgcp__connection__id.is_bound(); } boolean MgwResponse_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_resp.is_value() && single_value->field_mgw__rtp__ip.is_value() && (single_value->field_mgw__rtp__ip__mdcx.is_omit() || single_value->field_mgw__rtp__ip__mdcx.is_value()) && single_value->field_mgw__rtp__port.is_value() && single_value->field_mgcp__connection__id.is_value(); } void MgwResponse_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; } MgwResponse MgwResponse_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 @ConnHdlr.MgwResponse."); MgwResponse ret_val; if (single_value->field_resp.is_bound()) { ret_val.resp() = single_value->field_resp.valueof(); } if (single_value->field_mgw__rtp__ip.is_bound()) { ret_val.mgw__rtp__ip() = single_value->field_mgw__rtp__ip.valueof(); } if (single_value->field_mgw__rtp__ip__mdcx.is_omit()) ret_val.mgw__rtp__ip__mdcx() = OMIT_VALUE; else if (single_value->field_mgw__rtp__ip__mdcx.is_bound()) { ret_val.mgw__rtp__ip__mdcx() = single_value->field_mgw__rtp__ip__mdcx.valueof(); } if (single_value->field_mgw__rtp__port.is_bound()) { ret_val.mgw__rtp__port() = single_value->field_mgw__rtp__port.valueof(); } if (single_value->field_mgcp__connection__id.is_bound()) { ret_val.mgcp__connection__id() = single_value->field_mgcp__connection__id.valueof(); } return ret_val; } void MgwResponse_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 @ConnHdlr.MgwResponse."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MgwResponse_template[list_length]; } MgwResponse_template& MgwResponse_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 @ConnHdlr.MgwResponse."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.MgwResponse."); return value_list.list_value[list_index]; } INTEGER_template& MgwResponse_template::resp() { set_specific(); return single_value->field_resp; } const INTEGER_template& MgwResponse_template::resp() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field resp of a non-specific template of type @ConnHdlr.MgwResponse."); return single_value->field_resp; } CHARSTRING_template& MgwResponse_template::mgw__rtp__ip() { set_specific(); return single_value->field_mgw__rtp__ip; } const CHARSTRING_template& MgwResponse_template::mgw__rtp__ip() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgw_rtp_ip of a non-specific template of type @ConnHdlr.MgwResponse."); return single_value->field_mgw__rtp__ip; } CHARSTRING_template& MgwResponse_template::mgw__rtp__ip__mdcx() { set_specific(); return single_value->field_mgw__rtp__ip__mdcx; } const CHARSTRING_template& MgwResponse_template::mgw__rtp__ip__mdcx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgw_rtp_ip_mdcx of a non-specific template of type @ConnHdlr.MgwResponse."); return single_value->field_mgw__rtp__ip__mdcx; } INTEGER_template& MgwResponse_template::mgw__rtp__port() { set_specific(); return single_value->field_mgw__rtp__port; } const INTEGER_template& MgwResponse_template::mgw__rtp__port() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgw_rtp_port of a non-specific template of type @ConnHdlr.MgwResponse."); return single_value->field_mgw__rtp__port; } HEXSTRING_template& MgwResponse_template::mgcp__connection__id() { set_specific(); return single_value->field_mgcp__connection__id; } const HEXSTRING_template& MgwResponse_template::mgcp__connection__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgcp_connection_id of a non-specific template of type @ConnHdlr.MgwResponse."); return single_value->field_mgcp__connection__id; } int MgwResponse_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_mgw__rtp__ip__mdcx.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 @ConnHdlr.MgwResponse 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 @ConnHdlr.MgwResponse containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgwResponse containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.MgwResponse."); } return 0; } void MgwResponse_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ resp := "); single_value->field_resp.log(); TTCN_Logger::log_event_str(", mgw_rtp_ip := "); single_value->field_mgw__rtp__ip.log(); TTCN_Logger::log_event_str(", mgw_rtp_ip_mdcx := "); single_value->field_mgw__rtp__ip__mdcx.log(); TTCN_Logger::log_event_str(", mgw_rtp_port := "); single_value->field_mgw__rtp__port.log(); TTCN_Logger::log_event_str(", mgcp_connection_id := "); single_value->field_mgcp__connection__id.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 MgwResponse_template::log_match(const MgwResponse& 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_resp.match(match_value.resp(), legacy)){ TTCN_Logger::log_logmatch_info(".resp"); single_value->field_resp.log_match(match_value.resp(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mgw__rtp__ip.match(match_value.mgw__rtp__ip(), legacy)){ TTCN_Logger::log_logmatch_info(".mgw_rtp_ip"); single_value->field_mgw__rtp__ip.log_match(match_value.mgw__rtp__ip(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.mgw__rtp__ip__mdcx().ispresent()){ if(!single_value->field_mgw__rtp__ip__mdcx.match(match_value.mgw__rtp__ip__mdcx(), legacy)){ TTCN_Logger::log_logmatch_info(".mgw_rtp_ip_mdcx"); single_value->field_mgw__rtp__ip__mdcx.log_match(match_value.mgw__rtp__ip__mdcx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_mgw__rtp__ip__mdcx.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".mgw_rtp_ip_mdcx := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_mgw__rtp__ip__mdcx.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_mgw__rtp__port.match(match_value.mgw__rtp__port(), legacy)){ TTCN_Logger::log_logmatch_info(".mgw_rtp_port"); single_value->field_mgw__rtp__port.log_match(match_value.mgw__rtp__port(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mgcp__connection__id.match(match_value.mgcp__connection__id(), legacy)){ TTCN_Logger::log_logmatch_info(".mgcp_connection_id"); single_value->field_mgcp__connection__id.log_match(match_value.mgcp__connection__id(), 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("{ resp := "); single_value->field_resp.log_match(match_value.resp(), legacy); TTCN_Logger::log_event_str(", mgw_rtp_ip := "); single_value->field_mgw__rtp__ip.log_match(match_value.mgw__rtp__ip(), legacy); TTCN_Logger::log_event_str(", mgw_rtp_ip_mdcx := "); if (match_value.mgw__rtp__ip__mdcx().ispresent()) { single_value->field_mgw__rtp__ip__mdcx.log_match(match_value.mgw__rtp__ip__mdcx(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_mgw__rtp__ip__mdcx.log(); if (single_value->field_mgw__rtp__ip__mdcx.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", mgw_rtp_port := "); single_value->field_mgw__rtp__port.log_match(match_value.mgw__rtp__port(), legacy); TTCN_Logger::log_event_str(", mgcp_connection_id := "); single_value->field_mgcp__connection__id.log_match(match_value.mgcp__connection__id(), 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 MgwResponse_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (resp().is_bound()) resp().set_implicit_omit(); if (mgw__rtp__ip().is_bound()) mgw__rtp__ip().set_implicit_omit(); if (!mgw__rtp__ip__mdcx().is_bound()) mgw__rtp__ip__mdcx() = OMIT_VALUE; else mgw__rtp__ip__mdcx().set_implicit_omit(); if (mgw__rtp__port().is_bound()) mgw__rtp__port().set_implicit_omit(); if (mgcp__connection__id().is_bound()) mgcp__connection__id().set_implicit_omit(); } void MgwResponse_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_resp.encode_text(text_buf); single_value->field_mgw__rtp__ip.encode_text(text_buf); single_value->field_mgw__rtp__ip__mdcx.encode_text(text_buf); single_value->field_mgw__rtp__port.encode_text(text_buf); single_value->field_mgcp__connection__id.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 @ConnHdlr.MgwResponse."); } } void MgwResponse_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_resp.decode_text(text_buf); single_value->field_mgw__rtp__ip.decode_text(text_buf); single_value->field_mgw__rtp__ip__mdcx.decode_text(text_buf); single_value->field_mgw__rtp__port.decode_text(text_buf); single_value->field_mgcp__connection__id.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 MgwResponse_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 @ConnHdlr.MgwResponse."); } } void MgwResponse_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: { MgwResponse_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) resp().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__ip().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__ip__mdcx().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mgw__rtp__port().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgcp__connection__id().set_param(*param.get_elem(4)); 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(), "resp")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { resp().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_ip_mdcx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__ip__mdcx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_connection_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__connection__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.MgwResponse: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MgwResponse_template* precondition = new MgwResponse_template; precondition->set_param(*param.get_elem(0)); MgwResponse_template* implied_template = new MgwResponse_template; implied_template->set_param(*param.get_elem(1)); *this = MgwResponse_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.MgwResponse"); } is_ifpresent = param.get_ifpresent(); } void MgwResponse_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_resp.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgwResponse"); single_value->field_mgw__rtp__ip.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgwResponse"); single_value->field_mgw__rtp__ip__mdcx.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgwResponse"); single_value->field_mgw__rtp__port.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgwResponse"); single_value->field_mgcp__connection__id.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgwResponse"); 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 : "@ConnHdlr.MgwResponse"); } boolean MgwResponse_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MgwResponse_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_mgcp__call__id, const CHARSTRING& par_mgcp__ep, const MgwResponse& par_mgw__conn__ran, const MgwResponse& par_mgw__conn__cn, const INTEGER& par_rtp__payload__type, const CHARSTRING& par_rtp__sdp__format, const CHARSTRING& par_hnb__rtp__ip, const INTEGER& par_hnb__rtp__port, const CHARSTRING& par_cn__rtp__ip, const INTEGER& par_cn__rtp__port, const BOOLEAN& par_use__osmux, const INTEGER& par_got__osmux__count) : field_got__crcx__count(par_got__crcx__count), field_got__dlcx__count(par_got__dlcx__count), field_mgcp__call__id(par_mgcp__call__id), field_mgcp__ep(par_mgcp__ep), field_mgw__conn__ran(par_mgw__conn__ran), field_mgw__conn__cn(par_mgw__conn__cn), field_rtp__payload__type(par_rtp__payload__type), field_rtp__sdp__format(par_rtp__sdp__format), field_hnb__rtp__ip(par_hnb__rtp__ip), field_hnb__rtp__port(par_hnb__rtp__port), field_cn__rtp__ip(par_cn__rtp__ip), field_cn__rtp__port(par_cn__rtp__port), field_use__osmux(par_use__osmux), field_got__osmux__count(par_got__osmux__count) { } MgcpParameters::MgcpParameters(const MgcpParameters& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @ConnHdlr.MgcpParameters."); if (other_value.got__crcx__count().is_bound()) field_got__crcx__count = other_value.got__crcx__count(); else field_got__crcx__count.clean_up(); if (other_value.got__dlcx__count().is_bound()) field_got__dlcx__count = other_value.got__dlcx__count(); else field_got__dlcx__count.clean_up(); if (other_value.mgcp__call__id().is_bound()) field_mgcp__call__id = other_value.mgcp__call__id(); else field_mgcp__call__id.clean_up(); if (other_value.mgcp__ep().is_bound()) field_mgcp__ep = other_value.mgcp__ep(); else field_mgcp__ep.clean_up(); if (other_value.mgw__conn__ran().is_bound()) field_mgw__conn__ran = other_value.mgw__conn__ran(); else field_mgw__conn__ran.clean_up(); if (other_value.mgw__conn__cn().is_bound()) field_mgw__conn__cn = other_value.mgw__conn__cn(); else field_mgw__conn__cn.clean_up(); if (other_value.rtp__payload__type().is_bound()) field_rtp__payload__type = other_value.rtp__payload__type(); else field_rtp__payload__type.clean_up(); if (other_value.rtp__sdp__format().is_bound()) field_rtp__sdp__format = other_value.rtp__sdp__format(); else field_rtp__sdp__format.clean_up(); if (other_value.hnb__rtp__ip().is_bound()) field_hnb__rtp__ip = other_value.hnb__rtp__ip(); else field_hnb__rtp__ip.clean_up(); if (other_value.hnb__rtp__port().is_bound()) field_hnb__rtp__port = other_value.hnb__rtp__port(); else field_hnb__rtp__port.clean_up(); if (other_value.cn__rtp__ip().is_bound()) field_cn__rtp__ip = other_value.cn__rtp__ip(); else field_cn__rtp__ip.clean_up(); if (other_value.cn__rtp__port().is_bound()) field_cn__rtp__port = other_value.cn__rtp__port(); else field_cn__rtp__port.clean_up(); if (other_value.use__osmux().is_bound()) field_use__osmux = other_value.use__osmux(); else field_use__osmux.clean_up(); if (other_value.got__osmux__count().is_bound()) field_got__osmux__count = other_value.got__osmux__count(); else field_got__osmux__count.clean_up(); } void MgcpParameters::clean_up() { field_got__crcx__count.clean_up(); field_got__dlcx__count.clean_up(); field_mgcp__call__id.clean_up(); field_mgcp__ep.clean_up(); field_mgw__conn__ran.clean_up(); field_mgw__conn__cn.clean_up(); field_rtp__payload__type.clean_up(); field_rtp__sdp__format.clean_up(); field_hnb__rtp__ip.clean_up(); field_hnb__rtp__port.clean_up(); field_cn__rtp__ip.clean_up(); field_cn__rtp__port.clean_up(); field_use__osmux.clean_up(); field_got__osmux__count.clean_up(); } const TTCN_Typedescriptor_t* MgcpParameters::get_descriptor() const { return &MgcpParameters_descr_; } MgcpParameters& MgcpParameters::operator=(const MgcpParameters& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @ConnHdlr.MgcpParameters."); if (other_value.got__crcx__count().is_bound()) field_got__crcx__count = other_value.got__crcx__count(); else field_got__crcx__count.clean_up(); if (other_value.got__dlcx__count().is_bound()) field_got__dlcx__count = other_value.got__dlcx__count(); else field_got__dlcx__count.clean_up(); if (other_value.mgcp__call__id().is_bound()) field_mgcp__call__id = other_value.mgcp__call__id(); else field_mgcp__call__id.clean_up(); if (other_value.mgcp__ep().is_bound()) field_mgcp__ep = other_value.mgcp__ep(); else field_mgcp__ep.clean_up(); if (other_value.mgw__conn__ran().is_bound()) field_mgw__conn__ran = other_value.mgw__conn__ran(); else field_mgw__conn__ran.clean_up(); if (other_value.mgw__conn__cn().is_bound()) field_mgw__conn__cn = other_value.mgw__conn__cn(); else field_mgw__conn__cn.clean_up(); if (other_value.rtp__payload__type().is_bound()) field_rtp__payload__type = other_value.rtp__payload__type(); else field_rtp__payload__type.clean_up(); if (other_value.rtp__sdp__format().is_bound()) field_rtp__sdp__format = other_value.rtp__sdp__format(); else field_rtp__sdp__format.clean_up(); if (other_value.hnb__rtp__ip().is_bound()) field_hnb__rtp__ip = other_value.hnb__rtp__ip(); else field_hnb__rtp__ip.clean_up(); if (other_value.hnb__rtp__port().is_bound()) field_hnb__rtp__port = other_value.hnb__rtp__port(); else field_hnb__rtp__port.clean_up(); if (other_value.cn__rtp__ip().is_bound()) field_cn__rtp__ip = other_value.cn__rtp__ip(); else field_cn__rtp__ip.clean_up(); if (other_value.cn__rtp__port().is_bound()) field_cn__rtp__port = other_value.cn__rtp__port(); else field_cn__rtp__port.clean_up(); if (other_value.use__osmux().is_bound()) field_use__osmux = other_value.use__osmux(); else field_use__osmux.clean_up(); if (other_value.got__osmux__count().is_bound()) field_got__osmux__count = other_value.got__osmux__count(); else field_got__osmux__count.clean_up(); } return *this; } boolean MgcpParameters::operator==(const MgcpParameters& other_value) const { return field_got__crcx__count==other_value.field_got__crcx__count && field_got__dlcx__count==other_value.field_got__dlcx__count && field_mgcp__call__id==other_value.field_mgcp__call__id && field_mgcp__ep==other_value.field_mgcp__ep && field_mgw__conn__ran==other_value.field_mgw__conn__ran && field_mgw__conn__cn==other_value.field_mgw__conn__cn && field_rtp__payload__type==other_value.field_rtp__payload__type && field_rtp__sdp__format==other_value.field_rtp__sdp__format && field_hnb__rtp__ip==other_value.field_hnb__rtp__ip && field_hnb__rtp__port==other_value.field_hnb__rtp__port && field_cn__rtp__ip==other_value.field_cn__rtp__ip && field_cn__rtp__port==other_value.field_cn__rtp__port && field_use__osmux==other_value.field_use__osmux && field_got__osmux__count==other_value.field_got__osmux__count; } boolean MgcpParameters::is_bound() const { return (field_got__crcx__count.is_bound()) || (field_got__dlcx__count.is_bound()) || (OPTIONAL_OMIT == field_mgcp__call__id.get_selection() || field_mgcp__call__id.is_bound()) || (field_mgcp__ep.is_bound()) || (field_mgw__conn__ran.is_bound()) || (field_mgw__conn__cn.is_bound()) || (field_rtp__payload__type.is_bound()) || (field_rtp__sdp__format.is_bound()) || (field_hnb__rtp__ip.is_bound()) || (field_hnb__rtp__port.is_bound()) || (field_cn__rtp__ip.is_bound()) || (field_cn__rtp__port.is_bound()) || (field_use__osmux.is_bound()) || (field_got__osmux__count.is_bound()); } boolean MgcpParameters::is_value() const { return field_got__crcx__count.is_value() && field_got__dlcx__count.is_value() && (OPTIONAL_OMIT == field_mgcp__call__id.get_selection() || field_mgcp__call__id.is_value()) && field_mgcp__ep.is_value() && field_mgw__conn__ran.is_value() && field_mgw__conn__cn.is_value() && field_rtp__payload__type.is_value() && field_rtp__sdp__format.is_value() && field_hnb__rtp__ip.is_value() && field_hnb__rtp__port.is_value() && field_cn__rtp__ip.is_value() && field_cn__rtp__port.is_value() && field_use__osmux.is_value() && field_got__osmux__count.is_value(); } int MgcpParameters::size_of() const { int ret_val = 13; if (field_mgcp__call__id.ispresent()) ret_val++; return ret_val; } void MgcpParameters::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ got_crcx_count := "); field_got__crcx__count.log(); TTCN_Logger::log_event_str(", got_dlcx_count := "); field_got__dlcx__count.log(); TTCN_Logger::log_event_str(", mgcp_call_id := "); field_mgcp__call__id.log(); TTCN_Logger::log_event_str(", mgcp_ep := "); field_mgcp__ep.log(); TTCN_Logger::log_event_str(", mgw_conn_ran := "); field_mgw__conn__ran.log(); TTCN_Logger::log_event_str(", mgw_conn_cn := "); field_mgw__conn__cn.log(); TTCN_Logger::log_event_str(", rtp_payload_type := "); field_rtp__payload__type.log(); TTCN_Logger::log_event_str(", rtp_sdp_format := "); field_rtp__sdp__format.log(); TTCN_Logger::log_event_str(", hnb_rtp_ip := "); field_hnb__rtp__ip.log(); TTCN_Logger::log_event_str(", hnb_rtp_port := "); field_hnb__rtp__port.log(); TTCN_Logger::log_event_str(", cn_rtp_ip := "); field_cn__rtp__ip.log(); TTCN_Logger::log_event_str(", cn_rtp_port := "); field_cn__rtp__port.log(); TTCN_Logger::log_event_str(", use_osmux := "); field_use__osmux.log(); TTCN_Logger::log_event_str(", got_osmux_count := "); field_got__osmux__count.log(); TTCN_Logger::log_event_str(" }"); } void MgcpParameters::set_implicit_omit() { if (got__crcx__count().is_bound()) got__crcx__count().set_implicit_omit(); if (got__dlcx__count().is_bound()) got__dlcx__count().set_implicit_omit(); if (!mgcp__call__id().is_bound()) mgcp__call__id() = OMIT_VALUE; else mgcp__call__id().set_implicit_omit(); if (mgcp__ep().is_bound()) mgcp__ep().set_implicit_omit(); if (mgw__conn__ran().is_bound()) mgw__conn__ran().set_implicit_omit(); if (mgw__conn__cn().is_bound()) mgw__conn__cn().set_implicit_omit(); if (rtp__payload__type().is_bound()) rtp__payload__type().set_implicit_omit(); if (rtp__sdp__format().is_bound()) rtp__sdp__format().set_implicit_omit(); if (hnb__rtp__ip().is_bound()) hnb__rtp__ip().set_implicit_omit(); if (hnb__rtp__port().is_bound()) hnb__rtp__port().set_implicit_omit(); if (cn__rtp__ip().is_bound()) cn__rtp__ip().set_implicit_omit(); if (cn__rtp__port().is_bound()) cn__rtp__port().set_implicit_omit(); if (use__osmux().is_bound()) use__osmux().set_implicit_omit(); if (got__osmux__count().is_bound()) got__osmux__count().set_implicit_omit(); } void MgcpParameters::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 (140 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) got__crcx__count().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) got__dlcx__count().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mgcp__call__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mgcp__ep().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgw__conn__ran().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mgw__conn__cn().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rtp__payload__type().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rtp__sdp__format().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) hnb__rtp__ip().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) hnb__rtp__port().set_param(*param.get_elem(9)); if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) cn__rtp__ip().set_param(*param.get_elem(10)); if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cn__rtp__port().set_param(*param.get_elem(11)); if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) use__osmux().set_param(*param.get_elem(12)); if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) got__osmux__count().set_param(*param.get_elem(13)); 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(), "got_crcx_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__crcx__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "got_dlcx_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__dlcx__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_call_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__call__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_ep")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__ep().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_conn_ran")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__conn__ran().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_conn_cn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__conn__cn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rtp_payload_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rtp__payload__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rtp_sdp_format")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rtp__sdp__format().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "use_osmux")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { use__osmux().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "got_osmux_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__osmux__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.MgcpParameters: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.MgcpParameters"); } } void MgcpParameters::encode_text(Text_Buf& text_buf) const { field_got__crcx__count.encode_text(text_buf); field_got__dlcx__count.encode_text(text_buf); field_mgcp__call__id.encode_text(text_buf); field_mgcp__ep.encode_text(text_buf); field_mgw__conn__ran.encode_text(text_buf); field_mgw__conn__cn.encode_text(text_buf); field_rtp__payload__type.encode_text(text_buf); field_rtp__sdp__format.encode_text(text_buf); field_hnb__rtp__ip.encode_text(text_buf); field_hnb__rtp__port.encode_text(text_buf); field_cn__rtp__ip.encode_text(text_buf); field_cn__rtp__port.encode_text(text_buf); field_use__osmux.encode_text(text_buf); field_got__osmux__count.encode_text(text_buf); } void MgcpParameters::decode_text(Text_Buf& text_buf) { field_got__crcx__count.decode_text(text_buf); field_got__dlcx__count.decode_text(text_buf); field_mgcp__call__id.decode_text(text_buf); field_mgcp__ep.decode_text(text_buf); field_mgw__conn__ran.decode_text(text_buf); field_mgw__conn__cn.decode_text(text_buf); field_rtp__payload__type.decode_text(text_buf); field_rtp__sdp__format.decode_text(text_buf); field_hnb__rtp__ip.decode_text(text_buf); field_hnb__rtp__port.decode_text(text_buf); field_cn__rtp__ip.decode_text(text_buf); field_cn__rtp__port.decode_text(text_buf); field_use__osmux.decode_text(text_buf); field_got__osmux__count.decode_text(text_buf); } struct MgcpParameters_template::single_value_struct { INTEGER_template field_got__crcx__count; INTEGER_template field_got__dlcx__count; HEXSTRING_template field_mgcp__call__id; CHARSTRING_template field_mgcp__ep; MgwResponse_template field_mgw__conn__ran; MgwResponse_template field_mgw__conn__cn; INTEGER_template field_rtp__payload__type; CHARSTRING_template field_rtp__sdp__format; CHARSTRING_template field_hnb__rtp__ip; INTEGER_template field_hnb__rtp__port; CHARSTRING_template field_cn__rtp__ip; INTEGER_template field_cn__rtp__port; BOOLEAN_template field_use__osmux; INTEGER_template field_got__osmux__count; }; void MgcpParameters_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_got__crcx__count = ANY_VALUE; single_value->field_got__dlcx__count = ANY_VALUE; single_value->field_mgcp__call__id = ANY_OR_OMIT; single_value->field_mgcp__ep = ANY_VALUE; single_value->field_mgw__conn__ran = ANY_VALUE; single_value->field_mgw__conn__cn = ANY_VALUE; single_value->field_rtp__payload__type = ANY_VALUE; single_value->field_rtp__sdp__format = ANY_VALUE; single_value->field_hnb__rtp__ip = ANY_VALUE; single_value->field_hnb__rtp__port = ANY_VALUE; single_value->field_cn__rtp__ip = ANY_VALUE; single_value->field_cn__rtp__port = ANY_VALUE; single_value->field_use__osmux = ANY_VALUE; single_value->field_got__osmux__count = ANY_VALUE; } } } void MgcpParameters_template::copy_value(const MgcpParameters& other_value) { single_value = new single_value_struct; if (other_value.got__crcx__count().is_bound()) { single_value->field_got__crcx__count = other_value.got__crcx__count(); } else { single_value->field_got__crcx__count.clean_up(); } if (other_value.got__dlcx__count().is_bound()) { single_value->field_got__dlcx__count = other_value.got__dlcx__count(); } else { single_value->field_got__dlcx__count.clean_up(); } if (other_value.mgcp__call__id().is_bound()) { if (other_value.mgcp__call__id().ispresent()) single_value->field_mgcp__call__id = other_value.mgcp__call__id()(); else single_value->field_mgcp__call__id = OMIT_VALUE; } else { single_value->field_mgcp__call__id.clean_up(); } if (other_value.mgcp__ep().is_bound()) { single_value->field_mgcp__ep = other_value.mgcp__ep(); } else { single_value->field_mgcp__ep.clean_up(); } if (other_value.mgw__conn__ran().is_bound()) { single_value->field_mgw__conn__ran = other_value.mgw__conn__ran(); } else { single_value->field_mgw__conn__ran.clean_up(); } if (other_value.mgw__conn__cn().is_bound()) { single_value->field_mgw__conn__cn = other_value.mgw__conn__cn(); } else { single_value->field_mgw__conn__cn.clean_up(); } if (other_value.rtp__payload__type().is_bound()) { single_value->field_rtp__payload__type = other_value.rtp__payload__type(); } else { single_value->field_rtp__payload__type.clean_up(); } if (other_value.rtp__sdp__format().is_bound()) { single_value->field_rtp__sdp__format = other_value.rtp__sdp__format(); } else { single_value->field_rtp__sdp__format.clean_up(); } if (other_value.hnb__rtp__ip().is_bound()) { single_value->field_hnb__rtp__ip = other_value.hnb__rtp__ip(); } else { single_value->field_hnb__rtp__ip.clean_up(); } if (other_value.hnb__rtp__port().is_bound()) { single_value->field_hnb__rtp__port = other_value.hnb__rtp__port(); } else { single_value->field_hnb__rtp__port.clean_up(); } if (other_value.cn__rtp__ip().is_bound()) { single_value->field_cn__rtp__ip = other_value.cn__rtp__ip(); } else { single_value->field_cn__rtp__ip.clean_up(); } if (other_value.cn__rtp__port().is_bound()) { single_value->field_cn__rtp__port = other_value.cn__rtp__port(); } else { single_value->field_cn__rtp__port.clean_up(); } if (other_value.use__osmux().is_bound()) { single_value->field_use__osmux = other_value.use__osmux(); } else { single_value->field_use__osmux.clean_up(); } if (other_value.got__osmux__count().is_bound()) { single_value->field_got__osmux__count = other_value.got__osmux__count(); } else { single_value->field_got__osmux__count.clean_up(); } set_selection(SPECIFIC_VALUE); } void MgcpParameters_template::copy_template(const MgcpParameters_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.got__crcx__count().get_selection()) { single_value->field_got__crcx__count = other_value.got__crcx__count(); } else { single_value->field_got__crcx__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.got__dlcx__count().get_selection()) { single_value->field_got__dlcx__count = other_value.got__dlcx__count(); } else { single_value->field_got__dlcx__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgcp__call__id().get_selection()) { single_value->field_mgcp__call__id = other_value.mgcp__call__id(); } else { single_value->field_mgcp__call__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgcp__ep().get_selection()) { single_value->field_mgcp__ep = other_value.mgcp__ep(); } else { single_value->field_mgcp__ep.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgw__conn__ran().get_selection()) { single_value->field_mgw__conn__ran = other_value.mgw__conn__ran(); } else { single_value->field_mgw__conn__ran.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgw__conn__cn().get_selection()) { single_value->field_mgw__conn__cn = other_value.mgw__conn__cn(); } else { single_value->field_mgw__conn__cn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rtp__payload__type().get_selection()) { single_value->field_rtp__payload__type = other_value.rtp__payload__type(); } else { single_value->field_rtp__payload__type.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rtp__sdp__format().get_selection()) { single_value->field_rtp__sdp__format = other_value.rtp__sdp__format(); } else { single_value->field_rtp__sdp__format.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hnb__rtp__ip().get_selection()) { single_value->field_hnb__rtp__ip = other_value.hnb__rtp__ip(); } else { single_value->field_hnb__rtp__ip.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hnb__rtp__port().get_selection()) { single_value->field_hnb__rtp__port = other_value.hnb__rtp__port(); } else { single_value->field_hnb__rtp__port.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cn__rtp__ip().get_selection()) { single_value->field_cn__rtp__ip = other_value.cn__rtp__ip(); } else { single_value->field_cn__rtp__ip.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cn__rtp__port().get_selection()) { single_value->field_cn__rtp__port = other_value.cn__rtp__port(); } else { single_value->field_cn__rtp__port.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.use__osmux().get_selection()) { single_value->field_use__osmux = other_value.use__osmux(); } else { single_value->field_use__osmux.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.got__osmux__count().get_selection()) { single_value->field_got__osmux__count = other_value.got__osmux__count(); } else { single_value->field_got__osmux__count.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 MgcpParameters_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 MgcpParameters_template(*other_value.implication_.precondition); implication_.implied_template = new MgcpParameters_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 @ConnHdlr.MgcpParameters."); break; } set_selection(other_value); } MgcpParameters_template::MgcpParameters_template() { } MgcpParameters_template::MgcpParameters_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MgcpParameters_template::MgcpParameters_template(const MgcpParameters& other_value) { copy_value(other_value); } MgcpParameters_template::MgcpParameters_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MgcpParameters&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.MgcpParameters from an unbound optional field."); } } MgcpParameters_template::MgcpParameters_template(MgcpParameters_template* p_precondition, MgcpParameters_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MgcpParameters_template::MgcpParameters_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; } MgcpParameters_template::MgcpParameters_template(const MgcpParameters_template& other_value) : Base_Template() { copy_template(other_value); } MgcpParameters_template::~MgcpParameters_template() { clean_up(); } MgcpParameters_template& MgcpParameters_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MgcpParameters_template& MgcpParameters_template::operator=(const MgcpParameters& other_value) { clean_up(); copy_value(other_value); return *this; } MgcpParameters_template& MgcpParameters_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MgcpParameters&)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 @ConnHdlr.MgcpParameters."); } return *this; } MgcpParameters_template& MgcpParameters_template::operator=(const MgcpParameters_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MgcpParameters_template::match(const MgcpParameters& 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.got__crcx__count().is_bound()) return FALSE; if(!single_value->field_got__crcx__count.match(other_value.got__crcx__count(), legacy))return FALSE; if(!other_value.got__dlcx__count().is_bound()) return FALSE; if(!single_value->field_got__dlcx__count.match(other_value.got__dlcx__count(), legacy))return FALSE; if(!other_value.mgcp__call__id().is_bound()) return FALSE; if((other_value.mgcp__call__id().ispresent() ? !single_value->field_mgcp__call__id.match((const HEXSTRING&)other_value.mgcp__call__id(), legacy) : !single_value->field_mgcp__call__id.match_omit(legacy)))return FALSE; if(!other_value.mgcp__ep().is_bound()) return FALSE; if(!single_value->field_mgcp__ep.match(other_value.mgcp__ep(), legacy))return FALSE; if(!other_value.mgw__conn__ran().is_bound()) return FALSE; if(!single_value->field_mgw__conn__ran.match(other_value.mgw__conn__ran(), legacy))return FALSE; if(!other_value.mgw__conn__cn().is_bound()) return FALSE; if(!single_value->field_mgw__conn__cn.match(other_value.mgw__conn__cn(), legacy))return FALSE; if(!other_value.rtp__payload__type().is_bound()) return FALSE; if(!single_value->field_rtp__payload__type.match(other_value.rtp__payload__type(), legacy))return FALSE; if(!other_value.rtp__sdp__format().is_bound()) return FALSE; if(!single_value->field_rtp__sdp__format.match(other_value.rtp__sdp__format(), legacy))return FALSE; if(!other_value.hnb__rtp__ip().is_bound()) return FALSE; if(!single_value->field_hnb__rtp__ip.match(other_value.hnb__rtp__ip(), legacy))return FALSE; if(!other_value.hnb__rtp__port().is_bound()) return FALSE; if(!single_value->field_hnb__rtp__port.match(other_value.hnb__rtp__port(), legacy))return FALSE; if(!other_value.cn__rtp__ip().is_bound()) return FALSE; if(!single_value->field_cn__rtp__ip.match(other_value.cn__rtp__ip(), legacy))return FALSE; if(!other_value.cn__rtp__port().is_bound()) return FALSE; if(!single_value->field_cn__rtp__port.match(other_value.cn__rtp__port(), legacy))return FALSE; if(!other_value.use__osmux().is_bound()) return FALSE; if(!single_value->field_use__osmux.match(other_value.use__osmux(), legacy))return FALSE; if(!other_value.got__osmux__count().is_bound()) return FALSE; if(!single_value->field_got__osmux__count.match(other_value.got__osmux__count(), 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 @ConnHdlr.MgcpParameters."); } return FALSE; } boolean MgcpParameters_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_got__crcx__count.is_bound() || single_value->field_got__dlcx__count.is_bound() || (single_value->field_mgcp__call__id.is_omit() || single_value->field_mgcp__call__id.is_bound()) || single_value->field_mgcp__ep.is_bound() || single_value->field_mgw__conn__ran.is_bound() || single_value->field_mgw__conn__cn.is_bound() || single_value->field_rtp__payload__type.is_bound() || single_value->field_rtp__sdp__format.is_bound() || single_value->field_hnb__rtp__ip.is_bound() || single_value->field_hnb__rtp__port.is_bound() || single_value->field_cn__rtp__ip.is_bound() || single_value->field_cn__rtp__port.is_bound() || single_value->field_use__osmux.is_bound() || single_value->field_got__osmux__count.is_bound(); } boolean MgcpParameters_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_got__crcx__count.is_value() && single_value->field_got__dlcx__count.is_value() && (single_value->field_mgcp__call__id.is_omit() || single_value->field_mgcp__call__id.is_value()) && single_value->field_mgcp__ep.is_value() && single_value->field_mgw__conn__ran.is_value() && single_value->field_mgw__conn__cn.is_value() && single_value->field_rtp__payload__type.is_value() && single_value->field_rtp__sdp__format.is_value() && single_value->field_hnb__rtp__ip.is_value() && single_value->field_hnb__rtp__port.is_value() && single_value->field_cn__rtp__ip.is_value() && single_value->field_cn__rtp__port.is_value() && single_value->field_use__osmux.is_value() && single_value->field_got__osmux__count.is_value(); } void MgcpParameters_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; } MgcpParameters MgcpParameters_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 @ConnHdlr.MgcpParameters."); MgcpParameters ret_val; if (single_value->field_got__crcx__count.is_bound()) { ret_val.got__crcx__count() = single_value->field_got__crcx__count.valueof(); } if (single_value->field_got__dlcx__count.is_bound()) { ret_val.got__dlcx__count() = single_value->field_got__dlcx__count.valueof(); } if (single_value->field_mgcp__call__id.is_omit()) ret_val.mgcp__call__id() = OMIT_VALUE; else if (single_value->field_mgcp__call__id.is_bound()) { ret_val.mgcp__call__id() = single_value->field_mgcp__call__id.valueof(); } if (single_value->field_mgcp__ep.is_bound()) { ret_val.mgcp__ep() = single_value->field_mgcp__ep.valueof(); } if (single_value->field_mgw__conn__ran.is_bound()) { ret_val.mgw__conn__ran() = single_value->field_mgw__conn__ran.valueof(); } if (single_value->field_mgw__conn__cn.is_bound()) { ret_val.mgw__conn__cn() = single_value->field_mgw__conn__cn.valueof(); } if (single_value->field_rtp__payload__type.is_bound()) { ret_val.rtp__payload__type() = single_value->field_rtp__payload__type.valueof(); } if (single_value->field_rtp__sdp__format.is_bound()) { ret_val.rtp__sdp__format() = single_value->field_rtp__sdp__format.valueof(); } if (single_value->field_hnb__rtp__ip.is_bound()) { ret_val.hnb__rtp__ip() = single_value->field_hnb__rtp__ip.valueof(); } if (single_value->field_hnb__rtp__port.is_bound()) { ret_val.hnb__rtp__port() = single_value->field_hnb__rtp__port.valueof(); } if (single_value->field_cn__rtp__ip.is_bound()) { ret_val.cn__rtp__ip() = single_value->field_cn__rtp__ip.valueof(); } if (single_value->field_cn__rtp__port.is_bound()) { ret_val.cn__rtp__port() = single_value->field_cn__rtp__port.valueof(); } if (single_value->field_use__osmux.is_bound()) { ret_val.use__osmux() = single_value->field_use__osmux.valueof(); } if (single_value->field_got__osmux__count.is_bound()) { ret_val.got__osmux__count() = single_value->field_got__osmux__count.valueof(); } return ret_val; } void MgcpParameters_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 @ConnHdlr.MgcpParameters."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MgcpParameters_template[list_length]; } MgcpParameters_template& MgcpParameters_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 @ConnHdlr.MgcpParameters."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.MgcpParameters."); return value_list.list_value[list_index]; } INTEGER_template& MgcpParameters_template::got__crcx__count() { set_specific(); return single_value->field_got__crcx__count; } const INTEGER_template& MgcpParameters_template::got__crcx__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field got_crcx_count of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_got__crcx__count; } INTEGER_template& MgcpParameters_template::got__dlcx__count() { set_specific(); return single_value->field_got__dlcx__count; } const INTEGER_template& MgcpParameters_template::got__dlcx__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field got_dlcx_count of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_got__dlcx__count; } HEXSTRING_template& MgcpParameters_template::mgcp__call__id() { set_specific(); return single_value->field_mgcp__call__id; } const HEXSTRING_template& MgcpParameters_template::mgcp__call__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgcp_call_id of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_mgcp__call__id; } CHARSTRING_template& MgcpParameters_template::mgcp__ep() { set_specific(); return single_value->field_mgcp__ep; } const CHARSTRING_template& MgcpParameters_template::mgcp__ep() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgcp_ep of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_mgcp__ep; } MgwResponse_template& MgcpParameters_template::mgw__conn__ran() { set_specific(); return single_value->field_mgw__conn__ran; } const MgwResponse_template& MgcpParameters_template::mgw__conn__ran() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgw_conn_ran of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_mgw__conn__ran; } MgwResponse_template& MgcpParameters_template::mgw__conn__cn() { set_specific(); return single_value->field_mgw__conn__cn; } const MgwResponse_template& MgcpParameters_template::mgw__conn__cn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgw_conn_cn of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_mgw__conn__cn; } INTEGER_template& MgcpParameters_template::rtp__payload__type() { set_specific(); return single_value->field_rtp__payload__type; } const INTEGER_template& MgcpParameters_template::rtp__payload__type() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rtp_payload_type of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_rtp__payload__type; } CHARSTRING_template& MgcpParameters_template::rtp__sdp__format() { set_specific(); return single_value->field_rtp__sdp__format; } const CHARSTRING_template& MgcpParameters_template::rtp__sdp__format() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rtp_sdp_format of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_rtp__sdp__format; } CHARSTRING_template& MgcpParameters_template::hnb__rtp__ip() { set_specific(); return single_value->field_hnb__rtp__ip; } const CHARSTRING_template& MgcpParameters_template::hnb__rtp__ip() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb_rtp_ip of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_hnb__rtp__ip; } INTEGER_template& MgcpParameters_template::hnb__rtp__port() { set_specific(); return single_value->field_hnb__rtp__port; } const INTEGER_template& MgcpParameters_template::hnb__rtp__port() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb_rtp_port of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_hnb__rtp__port; } CHARSTRING_template& MgcpParameters_template::cn__rtp__ip() { set_specific(); return single_value->field_cn__rtp__ip; } const CHARSTRING_template& MgcpParameters_template::cn__rtp__ip() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cn_rtp_ip of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_cn__rtp__ip; } INTEGER_template& MgcpParameters_template::cn__rtp__port() { set_specific(); return single_value->field_cn__rtp__port; } const INTEGER_template& MgcpParameters_template::cn__rtp__port() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cn_rtp_port of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_cn__rtp__port; } BOOLEAN_template& MgcpParameters_template::use__osmux() { set_specific(); return single_value->field_use__osmux; } const BOOLEAN_template& MgcpParameters_template::use__osmux() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field use_osmux of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_use__osmux; } INTEGER_template& MgcpParameters_template::got__osmux__count() { set_specific(); return single_value->field_got__osmux__count; } const INTEGER_template& MgcpParameters_template::got__osmux__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field got_osmux_count of a non-specific template of type @ConnHdlr.MgcpParameters."); return single_value->field_got__osmux__count; } int MgcpParameters_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 13; if (single_value->field_mgcp__call__id.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 @ConnHdlr.MgcpParameters 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 @ConnHdlr.MgcpParameters containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.MgcpParameters containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.MgcpParameters."); } return 0; } void MgcpParameters_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ got_crcx_count := "); single_value->field_got__crcx__count.log(); TTCN_Logger::log_event_str(", got_dlcx_count := "); single_value->field_got__dlcx__count.log(); TTCN_Logger::log_event_str(", mgcp_call_id := "); single_value->field_mgcp__call__id.log(); TTCN_Logger::log_event_str(", mgcp_ep := "); single_value->field_mgcp__ep.log(); TTCN_Logger::log_event_str(", mgw_conn_ran := "); single_value->field_mgw__conn__ran.log(); TTCN_Logger::log_event_str(", mgw_conn_cn := "); single_value->field_mgw__conn__cn.log(); TTCN_Logger::log_event_str(", rtp_payload_type := "); single_value->field_rtp__payload__type.log(); TTCN_Logger::log_event_str(", rtp_sdp_format := "); single_value->field_rtp__sdp__format.log(); TTCN_Logger::log_event_str(", hnb_rtp_ip := "); single_value->field_hnb__rtp__ip.log(); TTCN_Logger::log_event_str(", hnb_rtp_port := "); single_value->field_hnb__rtp__port.log(); TTCN_Logger::log_event_str(", cn_rtp_ip := "); single_value->field_cn__rtp__ip.log(); TTCN_Logger::log_event_str(", cn_rtp_port := "); single_value->field_cn__rtp__port.log(); TTCN_Logger::log_event_str(", use_osmux := "); single_value->field_use__osmux.log(); TTCN_Logger::log_event_str(", got_osmux_count := "); single_value->field_got__osmux__count.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 MgcpParameters_template::log_match(const MgcpParameters& 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_got__crcx__count.match(match_value.got__crcx__count(), legacy)){ TTCN_Logger::log_logmatch_info(".got_crcx_count"); single_value->field_got__crcx__count.log_match(match_value.got__crcx__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_got__dlcx__count.match(match_value.got__dlcx__count(), legacy)){ TTCN_Logger::log_logmatch_info(".got_dlcx_count"); single_value->field_got__dlcx__count.log_match(match_value.got__dlcx__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.mgcp__call__id().ispresent()){ if(!single_value->field_mgcp__call__id.match(match_value.mgcp__call__id(), legacy)){ TTCN_Logger::log_logmatch_info(".mgcp_call_id"); single_value->field_mgcp__call__id.log_match(match_value.mgcp__call__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_mgcp__call__id.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".mgcp_call_id := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_mgcp__call__id.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_mgcp__ep.match(match_value.mgcp__ep(), legacy)){ TTCN_Logger::log_logmatch_info(".mgcp_ep"); single_value->field_mgcp__ep.log_match(match_value.mgcp__ep(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mgw__conn__ran.match(match_value.mgw__conn__ran(), legacy)){ TTCN_Logger::log_logmatch_info(".mgw_conn_ran"); single_value->field_mgw__conn__ran.log_match(match_value.mgw__conn__ran(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mgw__conn__cn.match(match_value.mgw__conn__cn(), legacy)){ TTCN_Logger::log_logmatch_info(".mgw_conn_cn"); single_value->field_mgw__conn__cn.log_match(match_value.mgw__conn__cn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rtp__payload__type.match(match_value.rtp__payload__type(), legacy)){ TTCN_Logger::log_logmatch_info(".rtp_payload_type"); single_value->field_rtp__payload__type.log_match(match_value.rtp__payload__type(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rtp__sdp__format.match(match_value.rtp__sdp__format(), legacy)){ TTCN_Logger::log_logmatch_info(".rtp_sdp_format"); single_value->field_rtp__sdp__format.log_match(match_value.rtp__sdp__format(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_hnb__rtp__ip.match(match_value.hnb__rtp__ip(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb_rtp_ip"); single_value->field_hnb__rtp__ip.log_match(match_value.hnb__rtp__ip(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_hnb__rtp__port.match(match_value.hnb__rtp__port(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb_rtp_port"); single_value->field_hnb__rtp__port.log_match(match_value.hnb__rtp__port(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cn__rtp__ip.match(match_value.cn__rtp__ip(), legacy)){ TTCN_Logger::log_logmatch_info(".cn_rtp_ip"); single_value->field_cn__rtp__ip.log_match(match_value.cn__rtp__ip(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cn__rtp__port.match(match_value.cn__rtp__port(), legacy)){ TTCN_Logger::log_logmatch_info(".cn_rtp_port"); single_value->field_cn__rtp__port.log_match(match_value.cn__rtp__port(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_use__osmux.match(match_value.use__osmux(), legacy)){ TTCN_Logger::log_logmatch_info(".use_osmux"); single_value->field_use__osmux.log_match(match_value.use__osmux(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_got__osmux__count.match(match_value.got__osmux__count(), legacy)){ TTCN_Logger::log_logmatch_info(".got_osmux_count"); single_value->field_got__osmux__count.log_match(match_value.got__osmux__count(), 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("{ got_crcx_count := "); single_value->field_got__crcx__count.log_match(match_value.got__crcx__count(), legacy); TTCN_Logger::log_event_str(", got_dlcx_count := "); single_value->field_got__dlcx__count.log_match(match_value.got__dlcx__count(), legacy); TTCN_Logger::log_event_str(", mgcp_call_id := "); if (match_value.mgcp__call__id().ispresent()) { single_value->field_mgcp__call__id.log_match(match_value.mgcp__call__id(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_mgcp__call__id.log(); if (single_value->field_mgcp__call__id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", mgcp_ep := "); single_value->field_mgcp__ep.log_match(match_value.mgcp__ep(), legacy); TTCN_Logger::log_event_str(", mgw_conn_ran := "); single_value->field_mgw__conn__ran.log_match(match_value.mgw__conn__ran(), legacy); TTCN_Logger::log_event_str(", mgw_conn_cn := "); single_value->field_mgw__conn__cn.log_match(match_value.mgw__conn__cn(), legacy); TTCN_Logger::log_event_str(", rtp_payload_type := "); single_value->field_rtp__payload__type.log_match(match_value.rtp__payload__type(), legacy); TTCN_Logger::log_event_str(", rtp_sdp_format := "); single_value->field_rtp__sdp__format.log_match(match_value.rtp__sdp__format(), legacy); TTCN_Logger::log_event_str(", hnb_rtp_ip := "); single_value->field_hnb__rtp__ip.log_match(match_value.hnb__rtp__ip(), legacy); TTCN_Logger::log_event_str(", hnb_rtp_port := "); single_value->field_hnb__rtp__port.log_match(match_value.hnb__rtp__port(), legacy); TTCN_Logger::log_event_str(", cn_rtp_ip := "); single_value->field_cn__rtp__ip.log_match(match_value.cn__rtp__ip(), legacy); TTCN_Logger::log_event_str(", cn_rtp_port := "); single_value->field_cn__rtp__port.log_match(match_value.cn__rtp__port(), legacy); TTCN_Logger::log_event_str(", use_osmux := "); single_value->field_use__osmux.log_match(match_value.use__osmux(), legacy); TTCN_Logger::log_event_str(", got_osmux_count := "); single_value->field_got__osmux__count.log_match(match_value.got__osmux__count(), 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 MgcpParameters_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (got__crcx__count().is_bound()) got__crcx__count().set_implicit_omit(); if (got__dlcx__count().is_bound()) got__dlcx__count().set_implicit_omit(); if (!mgcp__call__id().is_bound()) mgcp__call__id() = OMIT_VALUE; else mgcp__call__id().set_implicit_omit(); if (mgcp__ep().is_bound()) mgcp__ep().set_implicit_omit(); if (mgw__conn__ran().is_bound()) mgw__conn__ran().set_implicit_omit(); if (mgw__conn__cn().is_bound()) mgw__conn__cn().set_implicit_omit(); if (rtp__payload__type().is_bound()) rtp__payload__type().set_implicit_omit(); if (rtp__sdp__format().is_bound()) rtp__sdp__format().set_implicit_omit(); if (hnb__rtp__ip().is_bound()) hnb__rtp__ip().set_implicit_omit(); if (hnb__rtp__port().is_bound()) hnb__rtp__port().set_implicit_omit(); if (cn__rtp__ip().is_bound()) cn__rtp__ip().set_implicit_omit(); if (cn__rtp__port().is_bound()) cn__rtp__port().set_implicit_omit(); if (use__osmux().is_bound()) use__osmux().set_implicit_omit(); if (got__osmux__count().is_bound()) got__osmux__count().set_implicit_omit(); } void MgcpParameters_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_got__crcx__count.encode_text(text_buf); single_value->field_got__dlcx__count.encode_text(text_buf); single_value->field_mgcp__call__id.encode_text(text_buf); single_value->field_mgcp__ep.encode_text(text_buf); single_value->field_mgw__conn__ran.encode_text(text_buf); single_value->field_mgw__conn__cn.encode_text(text_buf); single_value->field_rtp__payload__type.encode_text(text_buf); single_value->field_rtp__sdp__format.encode_text(text_buf); single_value->field_hnb__rtp__ip.encode_text(text_buf); single_value->field_hnb__rtp__port.encode_text(text_buf); single_value->field_cn__rtp__ip.encode_text(text_buf); single_value->field_cn__rtp__port.encode_text(text_buf); single_value->field_use__osmux.encode_text(text_buf); single_value->field_got__osmux__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 @ConnHdlr.MgcpParameters."); } } void MgcpParameters_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_got__crcx__count.decode_text(text_buf); single_value->field_got__dlcx__count.decode_text(text_buf); single_value->field_mgcp__call__id.decode_text(text_buf); single_value->field_mgcp__ep.decode_text(text_buf); single_value->field_mgw__conn__ran.decode_text(text_buf); single_value->field_mgw__conn__cn.decode_text(text_buf); single_value->field_rtp__payload__type.decode_text(text_buf); single_value->field_rtp__sdp__format.decode_text(text_buf); single_value->field_hnb__rtp__ip.decode_text(text_buf); single_value->field_hnb__rtp__port.decode_text(text_buf); single_value->field_cn__rtp__ip.decode_text(text_buf); single_value->field_cn__rtp__port.decode_text(text_buf); single_value->field_use__osmux.decode_text(text_buf); single_value->field_got__osmux__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 MgcpParameters_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 @ConnHdlr.MgcpParameters."); } } void MgcpParameters_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: { MgcpParameters_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) got__crcx__count().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) got__dlcx__count().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mgcp__call__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mgcp__ep().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgw__conn__ran().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mgw__conn__cn().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rtp__payload__type().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rtp__sdp__format().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) hnb__rtp__ip().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) hnb__rtp__port().set_param(*param.get_elem(9)); if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) cn__rtp__ip().set_param(*param.get_elem(10)); if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cn__rtp__port().set_param(*param.get_elem(11)); if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) use__osmux().set_param(*param.get_elem(12)); if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) got__osmux__count().set_param(*param.get_elem(13)); 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(), "got_crcx_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__crcx__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "got_dlcx_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__dlcx__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_call_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__call__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_ep")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__ep().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_conn_ran")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__conn__ran().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgw_conn_cn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgw__conn__cn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rtp_payload_type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rtp__payload__type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rtp_sdp_format")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rtp__sdp__format().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_rtp_ip")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__rtp__ip().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_rtp_port")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__rtp__port().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "use_osmux")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { use__osmux().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "got_osmux_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { got__osmux__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.MgcpParameters: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MgcpParameters_template* precondition = new MgcpParameters_template; precondition->set_param(*param.get_elem(0)); MgcpParameters_template* implied_template = new MgcpParameters_template; implied_template->set_param(*param.get_elem(1)); *this = MgcpParameters_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.MgcpParameters"); } is_ifpresent = param.get_ifpresent(); } void MgcpParameters_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_got__crcx__count.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_got__dlcx__count.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_mgcp__call__id.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_mgcp__ep.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_mgw__conn__ran.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_mgw__conn__cn.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_rtp__payload__type.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_rtp__sdp__format.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_hnb__rtp__ip.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_hnb__rtp__port.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_cn__rtp__ip.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_cn__rtp__port.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_use__osmux.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); single_value->field_got__osmux__count.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.MgcpParameters"); 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 : "@ConnHdlr.MgcpParameters"); } boolean MgcpParameters_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MgcpParameters_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) addr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) teid().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(), "addr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { addr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.FTeid: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.FTeid"); } } void FTeid::encode_text(Text_Buf& text_buf) const { field_addr.encode_text(text_buf); field_teid.encode_text(text_buf); } void FTeid::decode_text(Text_Buf& text_buf) { field_addr.decode_text(text_buf); field_teid.decode_text(text_buf); } struct FTeid_template::single_value_struct { CHARSTRING_template field_addr; OCTETSTRING_template field_teid; }; void FTeid_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_addr = ANY_VALUE; single_value->field_teid = ANY_VALUE; } } } void FTeid_template::copy_value(const FTeid& other_value) { single_value = new single_value_struct; if (other_value.addr().is_bound()) { single_value->field_addr = other_value.addr(); } else { single_value->field_addr.clean_up(); } if (other_value.teid().is_bound()) { single_value->field_teid = other_value.teid(); } else { single_value->field_teid.clean_up(); } set_selection(SPECIFIC_VALUE); } void FTeid_template::copy_template(const FTeid_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.addr().get_selection()) { single_value->field_addr = other_value.addr(); } else { single_value->field_addr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.teid().get_selection()) { single_value->field_teid = other_value.teid(); } else { single_value->field_teid.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 FTeid_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 FTeid_template(*other_value.implication_.precondition); implication_.implied_template = new FTeid_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 @ConnHdlr.FTeid."); break; } set_selection(other_value); } FTeid_template::FTeid_template() { } FTeid_template::FTeid_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } FTeid_template::FTeid_template(const FTeid& other_value) { copy_value(other_value); } FTeid_template::FTeid_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const FTeid&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.FTeid from an unbound optional field."); } } FTeid_template::FTeid_template(FTeid_template* p_precondition, FTeid_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } FTeid_template::FTeid_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; } FTeid_template::FTeid_template(const FTeid_template& other_value) : Base_Template() { copy_template(other_value); } FTeid_template::~FTeid_template() { clean_up(); } FTeid_template& FTeid_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } FTeid_template& FTeid_template::operator=(const FTeid& other_value) { clean_up(); copy_value(other_value); return *this; } FTeid_template& FTeid_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const FTeid&)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 @ConnHdlr.FTeid."); } return *this; } FTeid_template& FTeid_template::operator=(const FTeid_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean FTeid_template::match(const FTeid& 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.addr().is_bound()) return FALSE; if(!single_value->field_addr.match(other_value.addr(), legacy))return FALSE; if(!other_value.teid().is_bound()) return FALSE; if(!single_value->field_teid.match(other_value.teid(), 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 @ConnHdlr.FTeid."); } return FALSE; } boolean FTeid_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_addr.is_bound() || single_value->field_teid.is_bound(); } boolean FTeid_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_addr.is_value() && single_value->field_teid.is_value(); } void FTeid_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; } FTeid FTeid_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 @ConnHdlr.FTeid."); FTeid ret_val; if (single_value->field_addr.is_bound()) { ret_val.addr() = single_value->field_addr.valueof(); } if (single_value->field_teid.is_bound()) { ret_val.teid() = single_value->field_teid.valueof(); } return ret_val; } void FTeid_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 @ConnHdlr.FTeid."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new FTeid_template[list_length]; } FTeid_template& FTeid_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 @ConnHdlr.FTeid."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.FTeid."); return value_list.list_value[list_index]; } CHARSTRING_template& FTeid_template::addr() { set_specific(); return single_value->field_addr; } const CHARSTRING_template& FTeid_template::addr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field addr of a non-specific template of type @ConnHdlr.FTeid."); return single_value->field_addr; } OCTETSTRING_template& FTeid_template::teid() { set_specific(); return single_value->field_teid; } const OCTETSTRING_template& FTeid_template::teid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field teid of a non-specific template of type @ConnHdlr.FTeid."); return single_value->field_teid; } int FTeid_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 2; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @ConnHdlr.FTeid 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 @ConnHdlr.FTeid containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeid containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.FTeid."); } return 0; } void FTeid_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ addr := "); single_value->field_addr.log(); TTCN_Logger::log_event_str(", teid := "); single_value->field_teid.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 FTeid_template::log_match(const FTeid& 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_addr.match(match_value.addr(), legacy)){ TTCN_Logger::log_logmatch_info(".addr"); single_value->field_addr.log_match(match_value.addr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_teid.match(match_value.teid(), legacy)){ TTCN_Logger::log_logmatch_info(".teid"); single_value->field_teid.log_match(match_value.teid(), 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("{ addr := "); single_value->field_addr.log_match(match_value.addr(), legacy); TTCN_Logger::log_event_str(", teid := "); single_value->field_teid.log_match(match_value.teid(), 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 FTeid_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (addr().is_bound()) addr().set_implicit_omit(); if (teid().is_bound()) teid().set_implicit_omit(); } void FTeid_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_addr.encode_text(text_buf); single_value->field_teid.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 @ConnHdlr.FTeid."); } } void FTeid_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_addr.decode_text(text_buf); single_value->field_teid.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 FTeid_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 @ConnHdlr.FTeid."); } } void FTeid_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: { FTeid_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) addr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) teid().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(), "addr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { addr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.FTeid: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { FTeid_template* precondition = new FTeid_template; precondition->set_param(*param.get_elem(0)); FTeid_template* implied_template = new FTeid_template; implied_template->set_param(*param.get_elem(1)); *this = FTeid_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.FTeid"); } is_ifpresent = param.get_ifpresent(); } void FTeid_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_addr.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.FTeid"); single_value->field_teid.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.FTeid"); 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 : "@ConnHdlr.FTeid"); } boolean FTeid_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean FTeid_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) local().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remote().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(), "local")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { local().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remote")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remote().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.FTeids: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.FTeids"); } } void FTeids::encode_text(Text_Buf& text_buf) const { field_local.encode_text(text_buf); field_remote.encode_text(text_buf); } void FTeids::decode_text(Text_Buf& text_buf) { field_local.decode_text(text_buf); field_remote.decode_text(text_buf); } struct FTeids_template::single_value_struct { FTeid_template field_local; FTeid_template field_remote; }; void FTeids_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_local = ANY_VALUE; single_value->field_remote = ANY_VALUE; } } } void FTeids_template::copy_value(const FTeids& other_value) { single_value = new single_value_struct; if (other_value.local().is_bound()) { single_value->field_local = other_value.local(); } else { single_value->field_local.clean_up(); } if (other_value.remote().is_bound()) { single_value->field_remote = other_value.remote(); } else { single_value->field_remote.clean_up(); } set_selection(SPECIFIC_VALUE); } void FTeids_template::copy_template(const FTeids_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.local().get_selection()) { single_value->field_local = other_value.local(); } else { single_value->field_local.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.remote().get_selection()) { single_value->field_remote = other_value.remote(); } else { single_value->field_remote.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 FTeids_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 FTeids_template(*other_value.implication_.precondition); implication_.implied_template = new FTeids_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 @ConnHdlr.FTeids."); break; } set_selection(other_value); } FTeids_template::FTeids_template() { } FTeids_template::FTeids_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } FTeids_template::FTeids_template(const FTeids& other_value) { copy_value(other_value); } FTeids_template::FTeids_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const FTeids&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.FTeids from an unbound optional field."); } } FTeids_template::FTeids_template(FTeids_template* p_precondition, FTeids_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } FTeids_template::FTeids_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; } FTeids_template::FTeids_template(const FTeids_template& other_value) : Base_Template() { copy_template(other_value); } FTeids_template::~FTeids_template() { clean_up(); } FTeids_template& FTeids_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } FTeids_template& FTeids_template::operator=(const FTeids& other_value) { clean_up(); copy_value(other_value); return *this; } FTeids_template& FTeids_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const FTeids&)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 @ConnHdlr.FTeids."); } return *this; } FTeids_template& FTeids_template::operator=(const FTeids_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean FTeids_template::match(const FTeids& 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.local().is_bound()) return FALSE; if(!single_value->field_local.match(other_value.local(), legacy))return FALSE; if(!other_value.remote().is_bound()) return FALSE; if(!single_value->field_remote.match(other_value.remote(), 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 @ConnHdlr.FTeids."); } return FALSE; } boolean FTeids_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_local.is_bound() || single_value->field_remote.is_bound(); } boolean FTeids_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_local.is_value() && single_value->field_remote.is_value(); } void FTeids_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; } FTeids FTeids_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 @ConnHdlr.FTeids."); FTeids ret_val; if (single_value->field_local.is_bound()) { ret_val.local() = single_value->field_local.valueof(); } if (single_value->field_remote.is_bound()) { ret_val.remote() = single_value->field_remote.valueof(); } return ret_val; } void FTeids_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 @ConnHdlr.FTeids."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new FTeids_template[list_length]; } FTeids_template& FTeids_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 @ConnHdlr.FTeids."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.FTeids."); return value_list.list_value[list_index]; } FTeid_template& FTeids_template::local() { set_specific(); return single_value->field_local; } const FTeid_template& FTeids_template::local() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field local of a non-specific template of type @ConnHdlr.FTeids."); return single_value->field_local; } FTeid_template& FTeids_template::remote() { set_specific(); return single_value->field_remote; } const FTeid_template& FTeids_template::remote() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field remote of a non-specific template of type @ConnHdlr.FTeids."); return single_value->field_remote; } int FTeids_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 2; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @ConnHdlr.FTeids 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 @ConnHdlr.FTeids containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.FTeids containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.FTeids."); } return 0; } void FTeids_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ local := "); single_value->field_local.log(); TTCN_Logger::log_event_str(", remote := "); single_value->field_remote.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 FTeids_template::log_match(const FTeids& 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_local.match(match_value.local(), legacy)){ TTCN_Logger::log_logmatch_info(".local"); single_value->field_local.log_match(match_value.local(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_remote.match(match_value.remote(), legacy)){ TTCN_Logger::log_logmatch_info(".remote"); single_value->field_remote.log_match(match_value.remote(), 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("{ local := "); single_value->field_local.log_match(match_value.local(), legacy); TTCN_Logger::log_event_str(", remote := "); single_value->field_remote.log_match(match_value.remote(), 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 FTeids_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (local().is_bound()) local().set_implicit_omit(); if (remote().is_bound()) remote().set_implicit_omit(); } void FTeids_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_local.encode_text(text_buf); single_value->field_remote.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 @ConnHdlr.FTeids."); } } void FTeids_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_local.decode_text(text_buf); single_value->field_remote.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 FTeids_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 @ConnHdlr.FTeids."); } } void FTeids_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: { FTeids_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) local().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remote().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(), "local")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { local().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remote")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remote().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.FTeids: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { FTeids_template* precondition = new FTeids_template; precondition->set_param(*param.get_elem(0)); FTeids_template* implied_template = new FTeids_template; implied_template->set_param(*param.get_elem(1)); *this = FTeids_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.FTeids"); } is_ifpresent = param.get_ifpresent(); } void FTeids_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_local.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.FTeids"); single_value->field_remote.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.FTeids"); 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 : "@ConnHdlr.FTeids"); } boolean FTeids_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean FTeids_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) core().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) access().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(), "core")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { core().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "access")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { access().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.GtpParameters: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.GtpParameters"); } } void GtpParameters::encode_text(Text_Buf& text_buf) const { field_core.encode_text(text_buf); field_access.encode_text(text_buf); } void GtpParameters::decode_text(Text_Buf& text_buf) { field_core.decode_text(text_buf); field_access.decode_text(text_buf); } struct GtpParameters_template::single_value_struct { FTeids_template field_core; FTeids_template field_access; }; void GtpParameters_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_core = ANY_VALUE; single_value->field_access = ANY_VALUE; } } } void GtpParameters_template::copy_value(const GtpParameters& other_value) { single_value = new single_value_struct; if (other_value.core().is_bound()) { single_value->field_core = other_value.core(); } else { single_value->field_core.clean_up(); } if (other_value.access().is_bound()) { single_value->field_access = other_value.access(); } else { single_value->field_access.clean_up(); } set_selection(SPECIFIC_VALUE); } void GtpParameters_template::copy_template(const GtpParameters_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.core().get_selection()) { single_value->field_core = other_value.core(); } else { single_value->field_core.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.access().get_selection()) { single_value->field_access = other_value.access(); } else { single_value->field_access.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 GtpParameters_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 GtpParameters_template(*other_value.implication_.precondition); implication_.implied_template = new GtpParameters_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 @ConnHdlr.GtpParameters."); break; } set_selection(other_value); } GtpParameters_template::GtpParameters_template() { } GtpParameters_template::GtpParameters_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GtpParameters_template::GtpParameters_template(const GtpParameters& other_value) { copy_value(other_value); } GtpParameters_template::GtpParameters_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GtpParameters&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.GtpParameters from an unbound optional field."); } } GtpParameters_template::GtpParameters_template(GtpParameters_template* p_precondition, GtpParameters_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GtpParameters_template::GtpParameters_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; } GtpParameters_template::GtpParameters_template(const GtpParameters_template& other_value) : Base_Template() { copy_template(other_value); } GtpParameters_template::~GtpParameters_template() { clean_up(); } GtpParameters_template& GtpParameters_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GtpParameters_template& GtpParameters_template::operator=(const GtpParameters& other_value) { clean_up(); copy_value(other_value); return *this; } GtpParameters_template& GtpParameters_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GtpParameters&)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 @ConnHdlr.GtpParameters."); } return *this; } GtpParameters_template& GtpParameters_template::operator=(const GtpParameters_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GtpParameters_template::match(const GtpParameters& 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.core().is_bound()) return FALSE; if(!single_value->field_core.match(other_value.core(), legacy))return FALSE; if(!other_value.access().is_bound()) return FALSE; if(!single_value->field_access.match(other_value.access(), 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 @ConnHdlr.GtpParameters."); } return FALSE; } boolean GtpParameters_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_core.is_bound() || single_value->field_access.is_bound(); } boolean GtpParameters_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_core.is_value() && single_value->field_access.is_value(); } void GtpParameters_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; } GtpParameters GtpParameters_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 @ConnHdlr.GtpParameters."); GtpParameters ret_val; if (single_value->field_core.is_bound()) { ret_val.core() = single_value->field_core.valueof(); } if (single_value->field_access.is_bound()) { ret_val.access() = single_value->field_access.valueof(); } return ret_val; } void GtpParameters_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 @ConnHdlr.GtpParameters."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GtpParameters_template[list_length]; } GtpParameters_template& GtpParameters_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 @ConnHdlr.GtpParameters."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.GtpParameters."); return value_list.list_value[list_index]; } FTeids_template& GtpParameters_template::core() { set_specific(); return single_value->field_core; } const FTeids_template& GtpParameters_template::core() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field core of a non-specific template of type @ConnHdlr.GtpParameters."); return single_value->field_core; } FTeids_template& GtpParameters_template::access() { set_specific(); return single_value->field_access; } const FTeids_template& GtpParameters_template::access() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field access of a non-specific template of type @ConnHdlr.GtpParameters."); return single_value->field_access; } int GtpParameters_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 2; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters 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 @ConnHdlr.GtpParameters containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.GtpParameters containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.GtpParameters."); } return 0; } void GtpParameters_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ core := "); single_value->field_core.log(); TTCN_Logger::log_event_str(", access := "); single_value->field_access.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 GtpParameters_template::log_match(const GtpParameters& 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_core.match(match_value.core(), legacy)){ TTCN_Logger::log_logmatch_info(".core"); single_value->field_core.log_match(match_value.core(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_access.match(match_value.access(), legacy)){ TTCN_Logger::log_logmatch_info(".access"); single_value->field_access.log_match(match_value.access(), 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("{ core := "); single_value->field_core.log_match(match_value.core(), legacy); TTCN_Logger::log_event_str(", access := "); single_value->field_access.log_match(match_value.access(), 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 GtpParameters_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (core().is_bound()) core().set_implicit_omit(); if (access().is_bound()) access().set_implicit_omit(); } void GtpParameters_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_core.encode_text(text_buf); single_value->field_access.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 @ConnHdlr.GtpParameters."); } } void GtpParameters_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_core.decode_text(text_buf); single_value->field_access.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 GtpParameters_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 @ConnHdlr.GtpParameters."); } } void GtpParameters_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: { GtpParameters_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) core().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) access().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(), "core")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { core().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "access")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { access().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.GtpParameters: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GtpParameters_template* precondition = new GtpParameters_template; precondition->set_param(*param.get_elem(0)); GtpParameters_template* implied_template = new GtpParameters_template; implied_template->set_param(*param.get_elem(1)); *this = GtpParameters_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.GtpParameters"); } is_ifpresent = param.get_ifpresent(); } void GtpParameters_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_core.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.GtpParameters"); single_value->field_access.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.GtpParameters"); 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 : "@ConnHdlr.GtpParameters"); } boolean GtpParameters_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GtpParameters_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_hnbgw__f__seid) : field_pfcp__enabled(par_pfcp__enabled), field_pfcp__local__addr(par_pfcp__local__addr), field_upf__node__id(par_upf__node__id), field_upf__f__seid(par_upf__f__seid), field_hnbgw__f__seid(par_hnbgw__f__seid) { } PfcpParameters::PfcpParameters(const PfcpParameters& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @ConnHdlr.PfcpParameters."); if (other_value.pfcp__enabled().is_bound()) field_pfcp__enabled = other_value.pfcp__enabled(); else field_pfcp__enabled.clean_up(); if (other_value.pfcp__local__addr().is_bound()) field_pfcp__local__addr = other_value.pfcp__local__addr(); else field_pfcp__local__addr.clean_up(); if (other_value.upf__node__id().is_bound()) field_upf__node__id = other_value.upf__node__id(); else field_upf__node__id.clean_up(); if (other_value.upf__f__seid().is_bound()) field_upf__f__seid = other_value.upf__f__seid(); else field_upf__f__seid.clean_up(); if (other_value.hnbgw__f__seid().is_bound()) field_hnbgw__f__seid = other_value.hnbgw__f__seid(); else field_hnbgw__f__seid.clean_up(); } void PfcpParameters::clean_up() { field_pfcp__enabled.clean_up(); field_pfcp__local__addr.clean_up(); field_upf__node__id.clean_up(); field_upf__f__seid.clean_up(); field_hnbgw__f__seid.clean_up(); } const TTCN_Typedescriptor_t* PfcpParameters::get_descriptor() const { return &PfcpParameters_descr_; } PfcpParameters& PfcpParameters::operator=(const PfcpParameters& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @ConnHdlr.PfcpParameters."); if (other_value.pfcp__enabled().is_bound()) field_pfcp__enabled = other_value.pfcp__enabled(); else field_pfcp__enabled.clean_up(); if (other_value.pfcp__local__addr().is_bound()) field_pfcp__local__addr = other_value.pfcp__local__addr(); else field_pfcp__local__addr.clean_up(); if (other_value.upf__node__id().is_bound()) field_upf__node__id = other_value.upf__node__id(); else field_upf__node__id.clean_up(); if (other_value.upf__f__seid().is_bound()) field_upf__f__seid = other_value.upf__f__seid(); else field_upf__f__seid.clean_up(); if (other_value.hnbgw__f__seid().is_bound()) field_hnbgw__f__seid = other_value.hnbgw__f__seid(); else field_hnbgw__f__seid.clean_up(); } return *this; } boolean PfcpParameters::operator==(const PfcpParameters& other_value) const { return field_pfcp__enabled==other_value.field_pfcp__enabled && field_pfcp__local__addr==other_value.field_pfcp__local__addr && field_upf__node__id==other_value.field_upf__node__id && field_upf__f__seid==other_value.field_upf__f__seid && field_hnbgw__f__seid==other_value.field_hnbgw__f__seid; } boolean PfcpParameters::is_bound() const { return (field_pfcp__enabled.is_bound()) || (field_pfcp__local__addr.is_bound()) || (field_upf__node__id.is_bound()) || (field_upf__f__seid.is_bound()) || (OPTIONAL_OMIT == field_hnbgw__f__seid.get_selection() || field_hnbgw__f__seid.is_bound()); } boolean PfcpParameters::is_value() const { return field_pfcp__enabled.is_value() && field_pfcp__local__addr.is_value() && field_upf__node__id.is_value() && field_upf__f__seid.is_value() && (OPTIONAL_OMIT == field_hnbgw__f__seid.get_selection() || field_hnbgw__f__seid.is_value()); } int PfcpParameters::size_of() const { int ret_val = 4; if (field_hnbgw__f__seid.ispresent()) ret_val++; return ret_val; } void PfcpParameters::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pfcp_enabled := "); field_pfcp__enabled.log(); TTCN_Logger::log_event_str(", pfcp_local_addr := "); field_pfcp__local__addr.log(); TTCN_Logger::log_event_str(", upf_node_id := "); field_upf__node__id.log(); TTCN_Logger::log_event_str(", upf_f_seid := "); field_upf__f__seid.log(); TTCN_Logger::log_event_str(", hnbgw_f_seid := "); field_hnbgw__f__seid.log(); TTCN_Logger::log_event_str(" }"); } void PfcpParameters::set_implicit_omit() { if (pfcp__enabled().is_bound()) pfcp__enabled().set_implicit_omit(); if (pfcp__local__addr().is_bound()) pfcp__local__addr().set_implicit_omit(); if (upf__node__id().is_bound()) upf__node__id().set_implicit_omit(); if (upf__f__seid().is_bound()) upf__f__seid().set_implicit_omit(); if (!hnbgw__f__seid().is_bound()) hnbgw__f__seid() = OMIT_VALUE; else hnbgw__f__seid().set_implicit_omit(); } void PfcpParameters::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 (50 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) pfcp__enabled().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pfcp__local__addr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) upf__node__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) upf__f__seid().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) hnbgw__f__seid().set_param(*param.get_elem(4)); 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(), "pfcp_enabled")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__enabled().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pfcp_local_addr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__local__addr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "upf_node_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { upf__node__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "upf_f_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { upf__f__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnbgw_f_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnbgw__f__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.PfcpParameters: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.PfcpParameters"); } } void PfcpParameters::encode_text(Text_Buf& text_buf) const { field_pfcp__enabled.encode_text(text_buf); field_pfcp__local__addr.encode_text(text_buf); field_upf__node__id.encode_text(text_buf); field_upf__f__seid.encode_text(text_buf); field_hnbgw__f__seid.encode_text(text_buf); } void PfcpParameters::decode_text(Text_Buf& text_buf) { field_pfcp__enabled.decode_text(text_buf); field_pfcp__local__addr.decode_text(text_buf); field_upf__node__id.decode_text(text_buf); field_upf__f__seid.decode_text(text_buf); field_hnbgw__f__seid.decode_text(text_buf); } struct PfcpParameters_template::single_value_struct { BOOLEAN_template field_pfcp__enabled; CHARSTRING_template field_pfcp__local__addr; PFCP__Types::Node__ID_template field_upf__node__id; PFCP__Types::F__SEID_template field_upf__f__seid; PFCP__Types::F__SEID_template field_hnbgw__f__seid; }; void PfcpParameters_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_pfcp__enabled = ANY_VALUE; single_value->field_pfcp__local__addr = ANY_VALUE; single_value->field_upf__node__id = ANY_VALUE; single_value->field_upf__f__seid = ANY_VALUE; single_value->field_hnbgw__f__seid = ANY_OR_OMIT; } } } void PfcpParameters_template::copy_value(const PfcpParameters& other_value) { single_value = new single_value_struct; if (other_value.pfcp__enabled().is_bound()) { single_value->field_pfcp__enabled = other_value.pfcp__enabled(); } else { single_value->field_pfcp__enabled.clean_up(); } if (other_value.pfcp__local__addr().is_bound()) { single_value->field_pfcp__local__addr = other_value.pfcp__local__addr(); } else { single_value->field_pfcp__local__addr.clean_up(); } if (other_value.upf__node__id().is_bound()) { single_value->field_upf__node__id = other_value.upf__node__id(); } else { single_value->field_upf__node__id.clean_up(); } if (other_value.upf__f__seid().is_bound()) { single_value->field_upf__f__seid = other_value.upf__f__seid(); } else { single_value->field_upf__f__seid.clean_up(); } if (other_value.hnbgw__f__seid().is_bound()) { if (other_value.hnbgw__f__seid().ispresent()) single_value->field_hnbgw__f__seid = other_value.hnbgw__f__seid()(); else single_value->field_hnbgw__f__seid = OMIT_VALUE; } else { single_value->field_hnbgw__f__seid.clean_up(); } set_selection(SPECIFIC_VALUE); } void PfcpParameters_template::copy_template(const PfcpParameters_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pfcp__enabled().get_selection()) { single_value->field_pfcp__enabled = other_value.pfcp__enabled(); } else { single_value->field_pfcp__enabled.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pfcp__local__addr().get_selection()) { single_value->field_pfcp__local__addr = other_value.pfcp__local__addr(); } else { single_value->field_pfcp__local__addr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.upf__node__id().get_selection()) { single_value->field_upf__node__id = other_value.upf__node__id(); } else { single_value->field_upf__node__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.upf__f__seid().get_selection()) { single_value->field_upf__f__seid = other_value.upf__f__seid(); } else { single_value->field_upf__f__seid.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hnbgw__f__seid().get_selection()) { single_value->field_hnbgw__f__seid = other_value.hnbgw__f__seid(); } else { single_value->field_hnbgw__f__seid.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 PfcpParameters_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 PfcpParameters_template(*other_value.implication_.precondition); implication_.implied_template = new PfcpParameters_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 @ConnHdlr.PfcpParameters."); break; } set_selection(other_value); } PfcpParameters_template::PfcpParameters_template() { } PfcpParameters_template::PfcpParameters_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PfcpParameters_template::PfcpParameters_template(const PfcpParameters& other_value) { copy_value(other_value); } PfcpParameters_template::PfcpParameters_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PfcpParameters&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.PfcpParameters from an unbound optional field."); } } PfcpParameters_template::PfcpParameters_template(PfcpParameters_template* p_precondition, PfcpParameters_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PfcpParameters_template::PfcpParameters_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; } PfcpParameters_template::PfcpParameters_template(const PfcpParameters_template& other_value) : Base_Template() { copy_template(other_value); } PfcpParameters_template::~PfcpParameters_template() { clean_up(); } PfcpParameters_template& PfcpParameters_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PfcpParameters_template& PfcpParameters_template::operator=(const PfcpParameters& other_value) { clean_up(); copy_value(other_value); return *this; } PfcpParameters_template& PfcpParameters_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PfcpParameters&)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 @ConnHdlr.PfcpParameters."); } return *this; } PfcpParameters_template& PfcpParameters_template::operator=(const PfcpParameters_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PfcpParameters_template::match(const PfcpParameters& 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.pfcp__enabled().is_bound()) return FALSE; if(!single_value->field_pfcp__enabled.match(other_value.pfcp__enabled(), legacy))return FALSE; if(!other_value.pfcp__local__addr().is_bound()) return FALSE; if(!single_value->field_pfcp__local__addr.match(other_value.pfcp__local__addr(), legacy))return FALSE; if(!other_value.upf__node__id().is_bound()) return FALSE; if(!single_value->field_upf__node__id.match(other_value.upf__node__id(), legacy))return FALSE; if(!other_value.upf__f__seid().is_bound()) return FALSE; if(!single_value->field_upf__f__seid.match(other_value.upf__f__seid(), legacy))return FALSE; if(!other_value.hnbgw__f__seid().is_bound()) return FALSE; if((other_value.hnbgw__f__seid().ispresent() ? !single_value->field_hnbgw__f__seid.match((const PFCP__Types::F__SEID&)other_value.hnbgw__f__seid(), legacy) : !single_value->field_hnbgw__f__seid.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 @ConnHdlr.PfcpParameters."); } return FALSE; } boolean PfcpParameters_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pfcp__enabled.is_bound() || single_value->field_pfcp__local__addr.is_bound() || single_value->field_upf__node__id.is_bound() || single_value->field_upf__f__seid.is_bound() || (single_value->field_hnbgw__f__seid.is_omit() || single_value->field_hnbgw__f__seid.is_bound()); } boolean PfcpParameters_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pfcp__enabled.is_value() && single_value->field_pfcp__local__addr.is_value() && single_value->field_upf__node__id.is_value() && single_value->field_upf__f__seid.is_value() && (single_value->field_hnbgw__f__seid.is_omit() || single_value->field_hnbgw__f__seid.is_value()); } void PfcpParameters_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; } PfcpParameters PfcpParameters_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 @ConnHdlr.PfcpParameters."); PfcpParameters ret_val; if (single_value->field_pfcp__enabled.is_bound()) { ret_val.pfcp__enabled() = single_value->field_pfcp__enabled.valueof(); } if (single_value->field_pfcp__local__addr.is_bound()) { ret_val.pfcp__local__addr() = single_value->field_pfcp__local__addr.valueof(); } if (single_value->field_upf__node__id.is_bound()) { ret_val.upf__node__id() = single_value->field_upf__node__id.valueof(); } if (single_value->field_upf__f__seid.is_bound()) { ret_val.upf__f__seid() = single_value->field_upf__f__seid.valueof(); } if (single_value->field_hnbgw__f__seid.is_omit()) ret_val.hnbgw__f__seid() = OMIT_VALUE; else if (single_value->field_hnbgw__f__seid.is_bound()) { ret_val.hnbgw__f__seid() = single_value->field_hnbgw__f__seid.valueof(); } return ret_val; } void PfcpParameters_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 @ConnHdlr.PfcpParameters."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PfcpParameters_template[list_length]; } PfcpParameters_template& PfcpParameters_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 @ConnHdlr.PfcpParameters."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.PfcpParameters."); return value_list.list_value[list_index]; } BOOLEAN_template& PfcpParameters_template::pfcp__enabled() { set_specific(); return single_value->field_pfcp__enabled; } const BOOLEAN_template& PfcpParameters_template::pfcp__enabled() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pfcp_enabled of a non-specific template of type @ConnHdlr.PfcpParameters."); return single_value->field_pfcp__enabled; } CHARSTRING_template& PfcpParameters_template::pfcp__local__addr() { set_specific(); return single_value->field_pfcp__local__addr; } const CHARSTRING_template& PfcpParameters_template::pfcp__local__addr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pfcp_local_addr of a non-specific template of type @ConnHdlr.PfcpParameters."); return single_value->field_pfcp__local__addr; } PFCP__Types::Node__ID_template& PfcpParameters_template::upf__node__id() { set_specific(); return single_value->field_upf__node__id; } const PFCP__Types::Node__ID_template& PfcpParameters_template::upf__node__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field upf_node_id of a non-specific template of type @ConnHdlr.PfcpParameters."); return single_value->field_upf__node__id; } PFCP__Types::F__SEID_template& PfcpParameters_template::upf__f__seid() { set_specific(); return single_value->field_upf__f__seid; } const PFCP__Types::F__SEID_template& PfcpParameters_template::upf__f__seid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field upf_f_seid of a non-specific template of type @ConnHdlr.PfcpParameters."); return single_value->field_upf__f__seid; } PFCP__Types::F__SEID_template& PfcpParameters_template::hnbgw__f__seid() { set_specific(); return single_value->field_hnbgw__f__seid; } const PFCP__Types::F__SEID_template& PfcpParameters_template::hnbgw__f__seid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnbgw_f_seid of a non-specific template of type @ConnHdlr.PfcpParameters."); return single_value->field_hnbgw__f__seid; } int PfcpParameters_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_hnbgw__f__seid.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 @ConnHdlr.PfcpParameters 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 @ConnHdlr.PfcpParameters containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.PfcpParameters containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.PfcpParameters."); } return 0; } void PfcpParameters_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pfcp_enabled := "); single_value->field_pfcp__enabled.log(); TTCN_Logger::log_event_str(", pfcp_local_addr := "); single_value->field_pfcp__local__addr.log(); TTCN_Logger::log_event_str(", upf_node_id := "); single_value->field_upf__node__id.log(); TTCN_Logger::log_event_str(", upf_f_seid := "); single_value->field_upf__f__seid.log(); TTCN_Logger::log_event_str(", hnbgw_f_seid := "); single_value->field_hnbgw__f__seid.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 PfcpParameters_template::log_match(const PfcpParameters& 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_pfcp__enabled.match(match_value.pfcp__enabled(), legacy)){ TTCN_Logger::log_logmatch_info(".pfcp_enabled"); single_value->field_pfcp__enabled.log_match(match_value.pfcp__enabled(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pfcp__local__addr.match(match_value.pfcp__local__addr(), legacy)){ TTCN_Logger::log_logmatch_info(".pfcp_local_addr"); single_value->field_pfcp__local__addr.log_match(match_value.pfcp__local__addr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_upf__node__id.match(match_value.upf__node__id(), legacy)){ TTCN_Logger::log_logmatch_info(".upf_node_id"); single_value->field_upf__node__id.log_match(match_value.upf__node__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_upf__f__seid.match(match_value.upf__f__seid(), legacy)){ TTCN_Logger::log_logmatch_info(".upf_f_seid"); single_value->field_upf__f__seid.log_match(match_value.upf__f__seid(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.hnbgw__f__seid().ispresent()){ if(!single_value->field_hnbgw__f__seid.match(match_value.hnbgw__f__seid(), legacy)){ TTCN_Logger::log_logmatch_info(".hnbgw_f_seid"); single_value->field_hnbgw__f__seid.log_match(match_value.hnbgw__f__seid(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_hnbgw__f__seid.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".hnbgw_f_seid := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_hnbgw__f__seid.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("{ pfcp_enabled := "); single_value->field_pfcp__enabled.log_match(match_value.pfcp__enabled(), legacy); TTCN_Logger::log_event_str(", pfcp_local_addr := "); single_value->field_pfcp__local__addr.log_match(match_value.pfcp__local__addr(), legacy); TTCN_Logger::log_event_str(", upf_node_id := "); single_value->field_upf__node__id.log_match(match_value.upf__node__id(), legacy); TTCN_Logger::log_event_str(", upf_f_seid := "); single_value->field_upf__f__seid.log_match(match_value.upf__f__seid(), legacy); TTCN_Logger::log_event_str(", hnbgw_f_seid := "); if (match_value.hnbgw__f__seid().ispresent()) { single_value->field_hnbgw__f__seid.log_match(match_value.hnbgw__f__seid(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_hnbgw__f__seid.log(); if (single_value->field_hnbgw__f__seid.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 PfcpParameters_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (pfcp__enabled().is_bound()) pfcp__enabled().set_implicit_omit(); if (pfcp__local__addr().is_bound()) pfcp__local__addr().set_implicit_omit(); if (upf__node__id().is_bound()) upf__node__id().set_implicit_omit(); if (upf__f__seid().is_bound()) upf__f__seid().set_implicit_omit(); if (!hnbgw__f__seid().is_bound()) hnbgw__f__seid() = OMIT_VALUE; else hnbgw__f__seid().set_implicit_omit(); } void PfcpParameters_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pfcp__enabled.encode_text(text_buf); single_value->field_pfcp__local__addr.encode_text(text_buf); single_value->field_upf__node__id.encode_text(text_buf); single_value->field_upf__f__seid.encode_text(text_buf); single_value->field_hnbgw__f__seid.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 @ConnHdlr.PfcpParameters."); } } void PfcpParameters_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_pfcp__enabled.decode_text(text_buf); single_value->field_pfcp__local__addr.decode_text(text_buf); single_value->field_upf__node__id.decode_text(text_buf); single_value->field_upf__f__seid.decode_text(text_buf); single_value->field_hnbgw__f__seid.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 PfcpParameters_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 @ConnHdlr.PfcpParameters."); } } void PfcpParameters_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: { PfcpParameters_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) pfcp__enabled().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pfcp__local__addr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) upf__node__id().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) upf__f__seid().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) hnbgw__f__seid().set_param(*param.get_elem(4)); 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(), "pfcp_enabled")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__enabled().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pfcp_local_addr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__local__addr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "upf_node_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { upf__node__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "upf_f_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { upf__f__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnbgw_f_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnbgw__f__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.PfcpParameters: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PfcpParameters_template* precondition = new PfcpParameters_template; precondition->set_param(*param.get_elem(0)); PfcpParameters_template* implied_template = new PfcpParameters_template; implied_template->set_param(*param.get_elem(1)); *this = PfcpParameters_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.PfcpParameters"); } is_ifpresent = param.get_ifpresent(); } void PfcpParameters_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_pfcp__enabled.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.PfcpParameters"); single_value->field_pfcp__local__addr.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.PfcpParameters"); single_value->field_upf__node__id.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.PfcpParameters"); single_value->field_upf__f__seid.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.PfcpParameters"); single_value->field_hnbgw__f__seid.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.PfcpParameters"); 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 : "@ConnHdlr.PfcpParameters"); } boolean PfcpParameters_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PfcpParameters_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_hnb, const BOOLEAN& par_expect__separate__sccp__cr, const INTEGER& par_tx__sccp__cr__data__len, const BOOLEAN& par_expect__compl__l3__success, const PfcpParameters& par_pfcp__pars, const OPTIONAL< OCTETSTRING >& par_nas__pdu, const OPTIONAL< SCCPasp__Types::SCCP__PAR__Address >& par_sccp__addr__msc, const OPTIONAL< SCCPasp__Types::SCCP__PAR__Address >& par_sccp__addr__hnbgw, const RANAP__IEs::Cause& par_rab__rel__cause, const INTEGER& par_hnbgw__timer__x31, const BITSTRING& par_sigc__id, const FLOAT& par_t__guard) : field_hnb__idx(par_hnb__idx), field_cn__idx(par_cn__idx), field_imsi(par_imsi), field_ps__domain(par_ps__domain), field_mgcp__pars(par_mgcp__pars), field_gtp__pars(par_gtp__pars), field_hnb(par_hnb), field_expect__separate__sccp__cr(par_expect__separate__sccp__cr), field_tx__sccp__cr__data__len(par_tx__sccp__cr__data__len), field_expect__compl__l3__success(par_expect__compl__l3__success), field_pfcp__pars(par_pfcp__pars), field_nas__pdu(par_nas__pdu), field_sccp__addr__msc(par_sccp__addr__msc), field_sccp__addr__hnbgw(par_sccp__addr__hnbgw), field_rab__rel__cause(par_rab__rel__cause), field_hnbgw__timer__x31(par_hnbgw__timer__x31), field_sigc__id(par_sigc__id), field_t__guard(par_t__guard) { } TestHdlrParams::TestHdlrParams(const TestHdlrParams& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @ConnHdlr.TestHdlrParams."); if (other_value.hnb__idx().is_bound()) field_hnb__idx = other_value.hnb__idx(); else field_hnb__idx.clean_up(); if (other_value.cn__idx().is_bound()) field_cn__idx = other_value.cn__idx(); else field_cn__idx.clean_up(); if (other_value.imsi().is_bound()) field_imsi = other_value.imsi(); else field_imsi.clean_up(); if (other_value.ps__domain().is_bound()) field_ps__domain = other_value.ps__domain(); else field_ps__domain.clean_up(); if (other_value.mgcp__pars().is_bound()) field_mgcp__pars = other_value.mgcp__pars(); else field_mgcp__pars.clean_up(); if (other_value.gtp__pars().is_bound()) field_gtp__pars = other_value.gtp__pars(); else field_gtp__pars.clean_up(); if (other_value.hnb().is_bound()) field_hnb = other_value.hnb(); else field_hnb.clean_up(); if (other_value.expect__separate__sccp__cr().is_bound()) field_expect__separate__sccp__cr = other_value.expect__separate__sccp__cr(); else field_expect__separate__sccp__cr.clean_up(); if (other_value.tx__sccp__cr__data__len().is_bound()) field_tx__sccp__cr__data__len = other_value.tx__sccp__cr__data__len(); else field_tx__sccp__cr__data__len.clean_up(); if (other_value.expect__compl__l3__success().is_bound()) field_expect__compl__l3__success = other_value.expect__compl__l3__success(); else field_expect__compl__l3__success.clean_up(); if (other_value.pfcp__pars().is_bound()) field_pfcp__pars = other_value.pfcp__pars(); else field_pfcp__pars.clean_up(); if (other_value.nas__pdu().is_bound()) field_nas__pdu = other_value.nas__pdu(); else field_nas__pdu.clean_up(); if (other_value.sccp__addr__msc().is_bound()) field_sccp__addr__msc = other_value.sccp__addr__msc(); else field_sccp__addr__msc.clean_up(); if (other_value.sccp__addr__hnbgw().is_bound()) field_sccp__addr__hnbgw = other_value.sccp__addr__hnbgw(); else field_sccp__addr__hnbgw.clean_up(); if (other_value.rab__rel__cause().is_bound()) field_rab__rel__cause = other_value.rab__rel__cause(); else field_rab__rel__cause.clean_up(); if (other_value.hnbgw__timer__x31().is_bound()) field_hnbgw__timer__x31 = other_value.hnbgw__timer__x31(); else field_hnbgw__timer__x31.clean_up(); if (other_value.sigc__id().is_bound()) field_sigc__id = other_value.sigc__id(); else field_sigc__id.clean_up(); if (other_value.t__guard().is_bound()) field_t__guard = other_value.t__guard(); else field_t__guard.clean_up(); } void TestHdlrParams::clean_up() { field_hnb__idx.clean_up(); field_cn__idx.clean_up(); field_imsi.clean_up(); field_ps__domain.clean_up(); field_mgcp__pars.clean_up(); field_gtp__pars.clean_up(); field_hnb.clean_up(); field_expect__separate__sccp__cr.clean_up(); field_tx__sccp__cr__data__len.clean_up(); field_expect__compl__l3__success.clean_up(); field_pfcp__pars.clean_up(); field_nas__pdu.clean_up(); field_sccp__addr__msc.clean_up(); field_sccp__addr__hnbgw.clean_up(); field_rab__rel__cause.clean_up(); field_hnbgw__timer__x31.clean_up(); field_sigc__id.clean_up(); field_t__guard.clean_up(); } const TTCN_Typedescriptor_t* TestHdlrParams::get_descriptor() const { return &TestHdlrParams_descr_; } TestHdlrParams& TestHdlrParams::operator=(const TestHdlrParams& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @ConnHdlr.TestHdlrParams."); if (other_value.hnb__idx().is_bound()) field_hnb__idx = other_value.hnb__idx(); else field_hnb__idx.clean_up(); if (other_value.cn__idx().is_bound()) field_cn__idx = other_value.cn__idx(); else field_cn__idx.clean_up(); if (other_value.imsi().is_bound()) field_imsi = other_value.imsi(); else field_imsi.clean_up(); if (other_value.ps__domain().is_bound()) field_ps__domain = other_value.ps__domain(); else field_ps__domain.clean_up(); if (other_value.mgcp__pars().is_bound()) field_mgcp__pars = other_value.mgcp__pars(); else field_mgcp__pars.clean_up(); if (other_value.gtp__pars().is_bound()) field_gtp__pars = other_value.gtp__pars(); else field_gtp__pars.clean_up(); if (other_value.hnb().is_bound()) field_hnb = other_value.hnb(); else field_hnb.clean_up(); if (other_value.expect__separate__sccp__cr().is_bound()) field_expect__separate__sccp__cr = other_value.expect__separate__sccp__cr(); else field_expect__separate__sccp__cr.clean_up(); if (other_value.tx__sccp__cr__data__len().is_bound()) field_tx__sccp__cr__data__len = other_value.tx__sccp__cr__data__len(); else field_tx__sccp__cr__data__len.clean_up(); if (other_value.expect__compl__l3__success().is_bound()) field_expect__compl__l3__success = other_value.expect__compl__l3__success(); else field_expect__compl__l3__success.clean_up(); if (other_value.pfcp__pars().is_bound()) field_pfcp__pars = other_value.pfcp__pars(); else field_pfcp__pars.clean_up(); if (other_value.nas__pdu().is_bound()) field_nas__pdu = other_value.nas__pdu(); else field_nas__pdu.clean_up(); if (other_value.sccp__addr__msc().is_bound()) field_sccp__addr__msc = other_value.sccp__addr__msc(); else field_sccp__addr__msc.clean_up(); if (other_value.sccp__addr__hnbgw().is_bound()) field_sccp__addr__hnbgw = other_value.sccp__addr__hnbgw(); else field_sccp__addr__hnbgw.clean_up(); if (other_value.rab__rel__cause().is_bound()) field_rab__rel__cause = other_value.rab__rel__cause(); else field_rab__rel__cause.clean_up(); if (other_value.hnbgw__timer__x31().is_bound()) field_hnbgw__timer__x31 = other_value.hnbgw__timer__x31(); else field_hnbgw__timer__x31.clean_up(); if (other_value.sigc__id().is_bound()) field_sigc__id = other_value.sigc__id(); else field_sigc__id.clean_up(); if (other_value.t__guard().is_bound()) field_t__guard = other_value.t__guard(); else field_t__guard.clean_up(); } return *this; } boolean TestHdlrParams::operator==(const TestHdlrParams& other_value) const { return field_hnb__idx==other_value.field_hnb__idx && field_cn__idx==other_value.field_cn__idx && field_imsi==other_value.field_imsi && field_ps__domain==other_value.field_ps__domain && field_mgcp__pars==other_value.field_mgcp__pars && field_gtp__pars==other_value.field_gtp__pars && field_hnb==other_value.field_hnb && field_expect__separate__sccp__cr==other_value.field_expect__separate__sccp__cr && field_tx__sccp__cr__data__len==other_value.field_tx__sccp__cr__data__len && field_expect__compl__l3__success==other_value.field_expect__compl__l3__success && field_pfcp__pars==other_value.field_pfcp__pars && field_nas__pdu==other_value.field_nas__pdu && field_sccp__addr__msc==other_value.field_sccp__addr__msc && field_sccp__addr__hnbgw==other_value.field_sccp__addr__hnbgw && field_rab__rel__cause==other_value.field_rab__rel__cause && field_hnbgw__timer__x31==other_value.field_hnbgw__timer__x31 && field_sigc__id==other_value.field_sigc__id && field_t__guard==other_value.field_t__guard; } boolean TestHdlrParams::is_bound() const { return (field_hnb__idx.is_bound()) || (field_cn__idx.is_bound()) || (field_imsi.is_bound()) || (field_ps__domain.is_bound()) || (field_mgcp__pars.is_bound()) || (field_gtp__pars.is_bound()) || (OPTIONAL_OMIT == field_hnb.get_selection() || field_hnb.is_bound()) || (field_expect__separate__sccp__cr.is_bound()) || (field_tx__sccp__cr__data__len.is_bound()) || (field_expect__compl__l3__success.is_bound()) || (field_pfcp__pars.is_bound()) || (OPTIONAL_OMIT == field_nas__pdu.get_selection() || field_nas__pdu.is_bound()) || (OPTIONAL_OMIT == field_sccp__addr__msc.get_selection() || field_sccp__addr__msc.is_bound()) || (OPTIONAL_OMIT == field_sccp__addr__hnbgw.get_selection() || field_sccp__addr__hnbgw.is_bound()) || (field_rab__rel__cause.is_bound()) || (field_hnbgw__timer__x31.is_bound()) || (field_sigc__id.is_bound()) || (field_t__guard.is_bound()); } boolean TestHdlrParams::is_value() const { return field_hnb__idx.is_value() && field_cn__idx.is_value() && field_imsi.is_value() && field_ps__domain.is_value() && field_mgcp__pars.is_value() && field_gtp__pars.is_value() && (OPTIONAL_OMIT == field_hnb.get_selection() || field_hnb.is_value()) && field_expect__separate__sccp__cr.is_value() && field_tx__sccp__cr__data__len.is_value() && field_expect__compl__l3__success.is_value() && field_pfcp__pars.is_value() && (OPTIONAL_OMIT == field_nas__pdu.get_selection() || field_nas__pdu.is_value()) && (OPTIONAL_OMIT == field_sccp__addr__msc.get_selection() || field_sccp__addr__msc.is_value()) && (OPTIONAL_OMIT == field_sccp__addr__hnbgw.get_selection() || field_sccp__addr__hnbgw.is_value()) && field_rab__rel__cause.is_value() && field_hnbgw__timer__x31.is_value() && field_sigc__id.is_value() && field_t__guard.is_value(); } int TestHdlrParams::size_of() const { int ret_val = 14; if (field_hnb.ispresent()) ret_val++; if (field_nas__pdu.ispresent()) ret_val++; if (field_sccp__addr__msc.ispresent()) ret_val++; if (field_sccp__addr__hnbgw.ispresent()) ret_val++; return ret_val; } void TestHdlrParams::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ hnb_idx := "); field_hnb__idx.log(); TTCN_Logger::log_event_str(", cn_idx := "); field_cn__idx.log(); TTCN_Logger::log_event_str(", imsi := "); field_imsi.log(); TTCN_Logger::log_event_str(", ps_domain := "); field_ps__domain.log(); TTCN_Logger::log_event_str(", mgcp_pars := "); field_mgcp__pars.log(); TTCN_Logger::log_event_str(", gtp_pars := "); field_gtp__pars.log(); TTCN_Logger::log_event_str(", hnb := "); field_hnb.log(); TTCN_Logger::log_event_str(", expect_separate_sccp_cr := "); field_expect__separate__sccp__cr.log(); TTCN_Logger::log_event_str(", tx_sccp_cr_data_len := "); field_tx__sccp__cr__data__len.log(); TTCN_Logger::log_event_str(", expect_compl_l3_success := "); field_expect__compl__l3__success.log(); TTCN_Logger::log_event_str(", pfcp_pars := "); field_pfcp__pars.log(); TTCN_Logger::log_event_str(", nas_pdu := "); field_nas__pdu.log(); TTCN_Logger::log_event_str(", sccp_addr_msc := "); field_sccp__addr__msc.log(); TTCN_Logger::log_event_str(", sccp_addr_hnbgw := "); field_sccp__addr__hnbgw.log(); TTCN_Logger::log_event_str(", rab_rel_cause := "); field_rab__rel__cause.log(); TTCN_Logger::log_event_str(", hnbgw_timer_x31 := "); field_hnbgw__timer__x31.log(); TTCN_Logger::log_event_str(", sigc_id := "); field_sigc__id.log(); TTCN_Logger::log_event_str(", t_guard := "); field_t__guard.log(); TTCN_Logger::log_event_str(" }"); } void TestHdlrParams::set_implicit_omit() { if (hnb__idx().is_bound()) hnb__idx().set_implicit_omit(); if (cn__idx().is_bound()) cn__idx().set_implicit_omit(); if (imsi().is_bound()) imsi().set_implicit_omit(); if (ps__domain().is_bound()) ps__domain().set_implicit_omit(); if (mgcp__pars().is_bound()) mgcp__pars().set_implicit_omit(); if (gtp__pars().is_bound()) gtp__pars().set_implicit_omit(); if (!hnb().is_bound()) hnb() = OMIT_VALUE; else hnb().set_implicit_omit(); if (expect__separate__sccp__cr().is_bound()) expect__separate__sccp__cr().set_implicit_omit(); if (tx__sccp__cr__data__len().is_bound()) tx__sccp__cr__data__len().set_implicit_omit(); if (expect__compl__l3__success().is_bound()) expect__compl__l3__success().set_implicit_omit(); if (pfcp__pars().is_bound()) pfcp__pars().set_implicit_omit(); if (!nas__pdu().is_bound()) nas__pdu() = OMIT_VALUE; else nas__pdu().set_implicit_omit(); if (!sccp__addr__msc().is_bound()) sccp__addr__msc() = OMIT_VALUE; else sccp__addr__msc().set_implicit_omit(); if (!sccp__addr__hnbgw().is_bound()) sccp__addr__hnbgw() = OMIT_VALUE; else sccp__addr__hnbgw().set_implicit_omit(); if (rab__rel__cause().is_bound()) rab__rel__cause().set_implicit_omit(); if (hnbgw__timer__x31().is_bound()) hnbgw__timer__x31().set_implicit_omit(); if (sigc__id().is_bound()) sigc__id().set_implicit_omit(); if (t__guard().is_bound()) t__guard().set_implicit_omit(); } void TestHdlrParams::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 (180 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hnb__idx().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cn__idx().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ps__domain().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgcp__pars().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) gtp__pars().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) hnb().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) expect__separate__sccp__cr().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tx__sccp__cr__data__len().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) expect__compl__l3__success().set_param(*param.get_elem(9)); if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) pfcp__pars().set_param(*param.get_elem(10)); if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) nas__pdu().set_param(*param.get_elem(11)); if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) sccp__addr__msc().set_param(*param.get_elem(12)); if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) sccp__addr__hnbgw().set_param(*param.get_elem(13)); if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) rab__rel__cause().set_param(*param.get_elem(14)); if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) hnbgw__timer__x31().set_param(*param.get_elem(15)); if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) sigc__id().set_param(*param.get_elem(16)); if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) t__guard().set_param(*param.get_elem(17)); 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(), "hnb_idx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__idx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_idx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__idx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "imsi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { imsi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ps_domain")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ps__domain().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "expect_separate_sccp_cr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { expect__separate__sccp__cr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_sccp_cr_data_len")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__sccp__cr__data__len().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "expect_compl_l3_success")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { expect__compl__l3__success().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pfcp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "nas_pdu")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { nas__pdu().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sccp_addr_msc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sccp__addr__msc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sccp_addr_hnbgw")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sccp__addr__hnbgw().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rab_rel_cause")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rab__rel__cause().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnbgw_timer_x31")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnbgw__timer__x31().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sigc_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sigc__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "t_guard")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { t__guard().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.TestHdlrParams: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.TestHdlrParams"); } } void TestHdlrParams::encode_text(Text_Buf& text_buf) const { field_hnb__idx.encode_text(text_buf); field_cn__idx.encode_text(text_buf); field_imsi.encode_text(text_buf); field_ps__domain.encode_text(text_buf); field_mgcp__pars.encode_text(text_buf); field_gtp__pars.encode_text(text_buf); field_hnb.encode_text(text_buf); field_expect__separate__sccp__cr.encode_text(text_buf); field_tx__sccp__cr__data__len.encode_text(text_buf); field_expect__compl__l3__success.encode_text(text_buf); field_pfcp__pars.encode_text(text_buf); field_nas__pdu.encode_text(text_buf); field_sccp__addr__msc.encode_text(text_buf); field_sccp__addr__hnbgw.encode_text(text_buf); field_rab__rel__cause.encode_text(text_buf); field_hnbgw__timer__x31.encode_text(text_buf); field_sigc__id.encode_text(text_buf); field_t__guard.encode_text(text_buf); } void TestHdlrParams::decode_text(Text_Buf& text_buf) { field_hnb__idx.decode_text(text_buf); field_cn__idx.decode_text(text_buf); field_imsi.decode_text(text_buf); field_ps__domain.decode_text(text_buf); field_mgcp__pars.decode_text(text_buf); field_gtp__pars.decode_text(text_buf); field_hnb.decode_text(text_buf); field_expect__separate__sccp__cr.decode_text(text_buf); field_tx__sccp__cr__data__len.decode_text(text_buf); field_expect__compl__l3__success.decode_text(text_buf); field_pfcp__pars.decode_text(text_buf); field_nas__pdu.decode_text(text_buf); field_sccp__addr__msc.decode_text(text_buf); field_sccp__addr__hnbgw.decode_text(text_buf); field_rab__rel__cause.decode_text(text_buf); field_hnbgw__timer__x31.decode_text(text_buf); field_sigc__id.decode_text(text_buf); field_t__guard.decode_text(text_buf); } struct TestHdlrParams_template::single_value_struct { INTEGER_template field_hnb__idx; INTEGER_template field_cn__idx; HEXSTRING_template field_imsi; BOOLEAN_template field_ps__domain; MgcpParameters_template field_mgcp__pars; GtpParameters_template field_gtp__pars; HnbConfig_template field_hnb; BOOLEAN_template field_expect__separate__sccp__cr; INTEGER_template field_tx__sccp__cr__data__len; BOOLEAN_template field_expect__compl__l3__success; PfcpParameters_template field_pfcp__pars; OCTETSTRING_template field_nas__pdu; SCCPasp__Types::SCCP__PAR__Address_template field_sccp__addr__msc; SCCPasp__Types::SCCP__PAR__Address_template field_sccp__addr__hnbgw; RANAP__IEs::Cause_template field_rab__rel__cause; INTEGER_template field_hnbgw__timer__x31; BITSTRING_template field_sigc__id; FLOAT_template field_t__guard; }; void TestHdlrParams_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_hnb__idx = ANY_VALUE; single_value->field_cn__idx = ANY_VALUE; single_value->field_imsi = ANY_VALUE; single_value->field_ps__domain = ANY_VALUE; single_value->field_mgcp__pars = ANY_VALUE; single_value->field_gtp__pars = ANY_VALUE; single_value->field_hnb = ANY_OR_OMIT; single_value->field_expect__separate__sccp__cr = ANY_VALUE; single_value->field_tx__sccp__cr__data__len = ANY_VALUE; single_value->field_expect__compl__l3__success = ANY_VALUE; single_value->field_pfcp__pars = ANY_VALUE; single_value->field_nas__pdu = ANY_OR_OMIT; single_value->field_sccp__addr__msc = ANY_OR_OMIT; single_value->field_sccp__addr__hnbgw = ANY_OR_OMIT; single_value->field_rab__rel__cause = ANY_VALUE; single_value->field_hnbgw__timer__x31 = ANY_VALUE; single_value->field_sigc__id = ANY_VALUE; single_value->field_t__guard = ANY_VALUE; } } } void TestHdlrParams_template::copy_value(const TestHdlrParams& other_value) { single_value = new single_value_struct; if (other_value.hnb__idx().is_bound()) { single_value->field_hnb__idx = other_value.hnb__idx(); } else { single_value->field_hnb__idx.clean_up(); } if (other_value.cn__idx().is_bound()) { single_value->field_cn__idx = other_value.cn__idx(); } else { single_value->field_cn__idx.clean_up(); } if (other_value.imsi().is_bound()) { single_value->field_imsi = other_value.imsi(); } else { single_value->field_imsi.clean_up(); } if (other_value.ps__domain().is_bound()) { single_value->field_ps__domain = other_value.ps__domain(); } else { single_value->field_ps__domain.clean_up(); } if (other_value.mgcp__pars().is_bound()) { single_value->field_mgcp__pars = other_value.mgcp__pars(); } else { single_value->field_mgcp__pars.clean_up(); } if (other_value.gtp__pars().is_bound()) { single_value->field_gtp__pars = other_value.gtp__pars(); } else { single_value->field_gtp__pars.clean_up(); } if (other_value.hnb().is_bound()) { if (other_value.hnb().ispresent()) single_value->field_hnb = other_value.hnb()(); else single_value->field_hnb = OMIT_VALUE; } else { single_value->field_hnb.clean_up(); } if (other_value.expect__separate__sccp__cr().is_bound()) { single_value->field_expect__separate__sccp__cr = other_value.expect__separate__sccp__cr(); } else { single_value->field_expect__separate__sccp__cr.clean_up(); } if (other_value.tx__sccp__cr__data__len().is_bound()) { single_value->field_tx__sccp__cr__data__len = other_value.tx__sccp__cr__data__len(); } else { single_value->field_tx__sccp__cr__data__len.clean_up(); } if (other_value.expect__compl__l3__success().is_bound()) { single_value->field_expect__compl__l3__success = other_value.expect__compl__l3__success(); } else { single_value->field_expect__compl__l3__success.clean_up(); } if (other_value.pfcp__pars().is_bound()) { single_value->field_pfcp__pars = other_value.pfcp__pars(); } else { single_value->field_pfcp__pars.clean_up(); } if (other_value.nas__pdu().is_bound()) { if (other_value.nas__pdu().ispresent()) single_value->field_nas__pdu = other_value.nas__pdu()(); else single_value->field_nas__pdu = OMIT_VALUE; } else { single_value->field_nas__pdu.clean_up(); } if (other_value.sccp__addr__msc().is_bound()) { if (other_value.sccp__addr__msc().ispresent()) single_value->field_sccp__addr__msc = other_value.sccp__addr__msc()(); else single_value->field_sccp__addr__msc = OMIT_VALUE; } else { single_value->field_sccp__addr__msc.clean_up(); } if (other_value.sccp__addr__hnbgw().is_bound()) { if (other_value.sccp__addr__hnbgw().ispresent()) single_value->field_sccp__addr__hnbgw = other_value.sccp__addr__hnbgw()(); else single_value->field_sccp__addr__hnbgw = OMIT_VALUE; } else { single_value->field_sccp__addr__hnbgw.clean_up(); } if (other_value.rab__rel__cause().is_bound()) { single_value->field_rab__rel__cause = other_value.rab__rel__cause(); } else { single_value->field_rab__rel__cause.clean_up(); } if (other_value.hnbgw__timer__x31().is_bound()) { single_value->field_hnbgw__timer__x31 = other_value.hnbgw__timer__x31(); } else { single_value->field_hnbgw__timer__x31.clean_up(); } if (other_value.sigc__id().is_bound()) { single_value->field_sigc__id = other_value.sigc__id(); } else { single_value->field_sigc__id.clean_up(); } if (other_value.t__guard().is_bound()) { single_value->field_t__guard = other_value.t__guard(); } else { single_value->field_t__guard.clean_up(); } set_selection(SPECIFIC_VALUE); } void TestHdlrParams_template::copy_template(const TestHdlrParams_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.hnb__idx().get_selection()) { single_value->field_hnb__idx = other_value.hnb__idx(); } else { single_value->field_hnb__idx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cn__idx().get_selection()) { single_value->field_cn__idx = other_value.cn__idx(); } else { single_value->field_cn__idx.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.imsi().get_selection()) { single_value->field_imsi = other_value.imsi(); } else { single_value->field_imsi.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ps__domain().get_selection()) { single_value->field_ps__domain = other_value.ps__domain(); } else { single_value->field_ps__domain.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mgcp__pars().get_selection()) { single_value->field_mgcp__pars = other_value.mgcp__pars(); } else { single_value->field_mgcp__pars.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtp__pars().get_selection()) { single_value->field_gtp__pars = other_value.gtp__pars(); } else { single_value->field_gtp__pars.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hnb().get_selection()) { single_value->field_hnb = other_value.hnb(); } else { single_value->field_hnb.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.expect__separate__sccp__cr().get_selection()) { single_value->field_expect__separate__sccp__cr = other_value.expect__separate__sccp__cr(); } else { single_value->field_expect__separate__sccp__cr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tx__sccp__cr__data__len().get_selection()) { single_value->field_tx__sccp__cr__data__len = other_value.tx__sccp__cr__data__len(); } else { single_value->field_tx__sccp__cr__data__len.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.expect__compl__l3__success().get_selection()) { single_value->field_expect__compl__l3__success = other_value.expect__compl__l3__success(); } else { single_value->field_expect__compl__l3__success.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pfcp__pars().get_selection()) { single_value->field_pfcp__pars = other_value.pfcp__pars(); } else { single_value->field_pfcp__pars.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.nas__pdu().get_selection()) { single_value->field_nas__pdu = other_value.nas__pdu(); } else { single_value->field_nas__pdu.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sccp__addr__msc().get_selection()) { single_value->field_sccp__addr__msc = other_value.sccp__addr__msc(); } else { single_value->field_sccp__addr__msc.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sccp__addr__hnbgw().get_selection()) { single_value->field_sccp__addr__hnbgw = other_value.sccp__addr__hnbgw(); } else { single_value->field_sccp__addr__hnbgw.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rab__rel__cause().get_selection()) { single_value->field_rab__rel__cause = other_value.rab__rel__cause(); } else { single_value->field_rab__rel__cause.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hnbgw__timer__x31().get_selection()) { single_value->field_hnbgw__timer__x31 = other_value.hnbgw__timer__x31(); } else { single_value->field_hnbgw__timer__x31.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sigc__id().get_selection()) { single_value->field_sigc__id = other_value.sigc__id(); } else { single_value->field_sigc__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.t__guard().get_selection()) { single_value->field_t__guard = other_value.t__guard(); } else { single_value->field_t__guard.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 TestHdlrParams_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 TestHdlrParams_template(*other_value.implication_.precondition); implication_.implied_template = new TestHdlrParams_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 @ConnHdlr.TestHdlrParams."); break; } set_selection(other_value); } TestHdlrParams_template::TestHdlrParams_template() { } TestHdlrParams_template::TestHdlrParams_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TestHdlrParams_template::TestHdlrParams_template(const TestHdlrParams& other_value) { copy_value(other_value); } TestHdlrParams_template::TestHdlrParams_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TestHdlrParams&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.TestHdlrParams from an unbound optional field."); } } TestHdlrParams_template::TestHdlrParams_template(TestHdlrParams_template* p_precondition, TestHdlrParams_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TestHdlrParams_template::TestHdlrParams_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; } TestHdlrParams_template::TestHdlrParams_template(const TestHdlrParams_template& other_value) : Base_Template() { copy_template(other_value); } TestHdlrParams_template::~TestHdlrParams_template() { clean_up(); } TestHdlrParams_template& TestHdlrParams_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TestHdlrParams_template& TestHdlrParams_template::operator=(const TestHdlrParams& other_value) { clean_up(); copy_value(other_value); return *this; } TestHdlrParams_template& TestHdlrParams_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TestHdlrParams&)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 @ConnHdlr.TestHdlrParams."); } return *this; } TestHdlrParams_template& TestHdlrParams_template::operator=(const TestHdlrParams_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TestHdlrParams_template::match(const TestHdlrParams& 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.hnb__idx().is_bound()) return FALSE; if(!single_value->field_hnb__idx.match(other_value.hnb__idx(), legacy))return FALSE; if(!other_value.cn__idx().is_bound()) return FALSE; if(!single_value->field_cn__idx.match(other_value.cn__idx(), legacy))return FALSE; if(!other_value.imsi().is_bound()) return FALSE; if(!single_value->field_imsi.match(other_value.imsi(), legacy))return FALSE; if(!other_value.ps__domain().is_bound()) return FALSE; if(!single_value->field_ps__domain.match(other_value.ps__domain(), legacy))return FALSE; if(!other_value.mgcp__pars().is_bound()) return FALSE; if(!single_value->field_mgcp__pars.match(other_value.mgcp__pars(), legacy))return FALSE; if(!other_value.gtp__pars().is_bound()) return FALSE; if(!single_value->field_gtp__pars.match(other_value.gtp__pars(), legacy))return FALSE; if(!other_value.hnb().is_bound()) return FALSE; if((other_value.hnb().ispresent() ? !single_value->field_hnb.match((const HnbConfig&)other_value.hnb(), legacy) : !single_value->field_hnb.match_omit(legacy)))return FALSE; if(!other_value.expect__separate__sccp__cr().is_bound()) return FALSE; if(!single_value->field_expect__separate__sccp__cr.match(other_value.expect__separate__sccp__cr(), legacy))return FALSE; if(!other_value.tx__sccp__cr__data__len().is_bound()) return FALSE; if(!single_value->field_tx__sccp__cr__data__len.match(other_value.tx__sccp__cr__data__len(), legacy))return FALSE; if(!other_value.expect__compl__l3__success().is_bound()) return FALSE; if(!single_value->field_expect__compl__l3__success.match(other_value.expect__compl__l3__success(), legacy))return FALSE; if(!other_value.pfcp__pars().is_bound()) return FALSE; if(!single_value->field_pfcp__pars.match(other_value.pfcp__pars(), legacy))return FALSE; if(!other_value.nas__pdu().is_bound()) return FALSE; if((other_value.nas__pdu().ispresent() ? !single_value->field_nas__pdu.match((const OCTETSTRING&)other_value.nas__pdu(), legacy) : !single_value->field_nas__pdu.match_omit(legacy)))return FALSE; if(!other_value.sccp__addr__msc().is_bound()) return FALSE; if((other_value.sccp__addr__msc().ispresent() ? !single_value->field_sccp__addr__msc.match((const SCCPasp__Types::SCCP__PAR__Address&)other_value.sccp__addr__msc(), legacy) : !single_value->field_sccp__addr__msc.match_omit(legacy)))return FALSE; if(!other_value.sccp__addr__hnbgw().is_bound()) return FALSE; if((other_value.sccp__addr__hnbgw().ispresent() ? !single_value->field_sccp__addr__hnbgw.match((const SCCPasp__Types::SCCP__PAR__Address&)other_value.sccp__addr__hnbgw(), legacy) : !single_value->field_sccp__addr__hnbgw.match_omit(legacy)))return FALSE; if(!other_value.rab__rel__cause().is_bound()) return FALSE; if(!single_value->field_rab__rel__cause.match(other_value.rab__rel__cause(), legacy))return FALSE; if(!other_value.hnbgw__timer__x31().is_bound()) return FALSE; if(!single_value->field_hnbgw__timer__x31.match(other_value.hnbgw__timer__x31(), legacy))return FALSE; if(!other_value.sigc__id().is_bound()) return FALSE; if(!single_value->field_sigc__id.match(other_value.sigc__id(), legacy))return FALSE; if(!other_value.t__guard().is_bound()) return FALSE; if(!single_value->field_t__guard.match(other_value.t__guard(), 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 @ConnHdlr.TestHdlrParams."); } return FALSE; } boolean TestHdlrParams_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_hnb__idx.is_bound() || single_value->field_cn__idx.is_bound() || single_value->field_imsi.is_bound() || single_value->field_ps__domain.is_bound() || single_value->field_mgcp__pars.is_bound() || single_value->field_gtp__pars.is_bound() || (single_value->field_hnb.is_omit() || single_value->field_hnb.is_bound()) || single_value->field_expect__separate__sccp__cr.is_bound() || single_value->field_tx__sccp__cr__data__len.is_bound() || single_value->field_expect__compl__l3__success.is_bound() || single_value->field_pfcp__pars.is_bound() || (single_value->field_nas__pdu.is_omit() || single_value->field_nas__pdu.is_bound()) || (single_value->field_sccp__addr__msc.is_omit() || single_value->field_sccp__addr__msc.is_bound()) || (single_value->field_sccp__addr__hnbgw.is_omit() || single_value->field_sccp__addr__hnbgw.is_bound()) || single_value->field_rab__rel__cause.is_bound() || single_value->field_hnbgw__timer__x31.is_bound() || single_value->field_sigc__id.is_bound() || single_value->field_t__guard.is_bound(); } boolean TestHdlrParams_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_hnb__idx.is_value() && single_value->field_cn__idx.is_value() && single_value->field_imsi.is_value() && single_value->field_ps__domain.is_value() && single_value->field_mgcp__pars.is_value() && single_value->field_gtp__pars.is_value() && (single_value->field_hnb.is_omit() || single_value->field_hnb.is_value()) && single_value->field_expect__separate__sccp__cr.is_value() && single_value->field_tx__sccp__cr__data__len.is_value() && single_value->field_expect__compl__l3__success.is_value() && single_value->field_pfcp__pars.is_value() && (single_value->field_nas__pdu.is_omit() || single_value->field_nas__pdu.is_value()) && (single_value->field_sccp__addr__msc.is_omit() || single_value->field_sccp__addr__msc.is_value()) && (single_value->field_sccp__addr__hnbgw.is_omit() || single_value->field_sccp__addr__hnbgw.is_value()) && single_value->field_rab__rel__cause.is_value() && single_value->field_hnbgw__timer__x31.is_value() && single_value->field_sigc__id.is_value() && single_value->field_t__guard.is_value(); } void TestHdlrParams_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; } TestHdlrParams TestHdlrParams_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 @ConnHdlr.TestHdlrParams."); TestHdlrParams ret_val; if (single_value->field_hnb__idx.is_bound()) { ret_val.hnb__idx() = single_value->field_hnb__idx.valueof(); } if (single_value->field_cn__idx.is_bound()) { ret_val.cn__idx() = single_value->field_cn__idx.valueof(); } if (single_value->field_imsi.is_bound()) { ret_val.imsi() = single_value->field_imsi.valueof(); } if (single_value->field_ps__domain.is_bound()) { ret_val.ps__domain() = single_value->field_ps__domain.valueof(); } if (single_value->field_mgcp__pars.is_bound()) { ret_val.mgcp__pars() = single_value->field_mgcp__pars.valueof(); } if (single_value->field_gtp__pars.is_bound()) { ret_val.gtp__pars() = single_value->field_gtp__pars.valueof(); } if (single_value->field_hnb.is_omit()) ret_val.hnb() = OMIT_VALUE; else if (single_value->field_hnb.is_bound()) { ret_val.hnb() = single_value->field_hnb.valueof(); } if (single_value->field_expect__separate__sccp__cr.is_bound()) { ret_val.expect__separate__sccp__cr() = single_value->field_expect__separate__sccp__cr.valueof(); } if (single_value->field_tx__sccp__cr__data__len.is_bound()) { ret_val.tx__sccp__cr__data__len() = single_value->field_tx__sccp__cr__data__len.valueof(); } if (single_value->field_expect__compl__l3__success.is_bound()) { ret_val.expect__compl__l3__success() = single_value->field_expect__compl__l3__success.valueof(); } if (single_value->field_pfcp__pars.is_bound()) { ret_val.pfcp__pars() = single_value->field_pfcp__pars.valueof(); } if (single_value->field_nas__pdu.is_omit()) ret_val.nas__pdu() = OMIT_VALUE; else if (single_value->field_nas__pdu.is_bound()) { ret_val.nas__pdu() = single_value->field_nas__pdu.valueof(); } if (single_value->field_sccp__addr__msc.is_omit()) ret_val.sccp__addr__msc() = OMIT_VALUE; else if (single_value->field_sccp__addr__msc.is_bound()) { ret_val.sccp__addr__msc() = single_value->field_sccp__addr__msc.valueof(); } if (single_value->field_sccp__addr__hnbgw.is_omit()) ret_val.sccp__addr__hnbgw() = OMIT_VALUE; else if (single_value->field_sccp__addr__hnbgw.is_bound()) { ret_val.sccp__addr__hnbgw() = single_value->field_sccp__addr__hnbgw.valueof(); } if (single_value->field_rab__rel__cause.is_bound()) { ret_val.rab__rel__cause() = single_value->field_rab__rel__cause.valueof(); } if (single_value->field_hnbgw__timer__x31.is_bound()) { ret_val.hnbgw__timer__x31() = single_value->field_hnbgw__timer__x31.valueof(); } if (single_value->field_sigc__id.is_bound()) { ret_val.sigc__id() = single_value->field_sigc__id.valueof(); } if (single_value->field_t__guard.is_bound()) { ret_val.t__guard() = single_value->field_t__guard.valueof(); } return ret_val; } void TestHdlrParams_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 @ConnHdlr.TestHdlrParams."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TestHdlrParams_template[list_length]; } TestHdlrParams_template& TestHdlrParams_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 @ConnHdlr.TestHdlrParams."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.TestHdlrParams."); return value_list.list_value[list_index]; } INTEGER_template& TestHdlrParams_template::hnb__idx() { set_specific(); return single_value->field_hnb__idx; } const INTEGER_template& TestHdlrParams_template::hnb__idx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb_idx of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_hnb__idx; } INTEGER_template& TestHdlrParams_template::cn__idx() { set_specific(); return single_value->field_cn__idx; } const INTEGER_template& TestHdlrParams_template::cn__idx() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cn_idx of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_cn__idx; } HEXSTRING_template& TestHdlrParams_template::imsi() { set_specific(); return single_value->field_imsi; } const HEXSTRING_template& TestHdlrParams_template::imsi() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field imsi of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_imsi; } BOOLEAN_template& TestHdlrParams_template::ps__domain() { set_specific(); return single_value->field_ps__domain; } const BOOLEAN_template& TestHdlrParams_template::ps__domain() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ps_domain of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_ps__domain; } MgcpParameters_template& TestHdlrParams_template::mgcp__pars() { set_specific(); return single_value->field_mgcp__pars; } const MgcpParameters_template& TestHdlrParams_template::mgcp__pars() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mgcp_pars of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_mgcp__pars; } GtpParameters_template& TestHdlrParams_template::gtp__pars() { set_specific(); return single_value->field_gtp__pars; } const GtpParameters_template& TestHdlrParams_template::gtp__pars() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp_pars of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_gtp__pars; } HnbConfig_template& TestHdlrParams_template::hnb() { set_specific(); return single_value->field_hnb; } const HnbConfig_template& TestHdlrParams_template::hnb() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_hnb; } BOOLEAN_template& TestHdlrParams_template::expect__separate__sccp__cr() { set_specific(); return single_value->field_expect__separate__sccp__cr; } const BOOLEAN_template& TestHdlrParams_template::expect__separate__sccp__cr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field expect_separate_sccp_cr of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_expect__separate__sccp__cr; } INTEGER_template& TestHdlrParams_template::tx__sccp__cr__data__len() { set_specific(); return single_value->field_tx__sccp__cr__data__len; } const INTEGER_template& TestHdlrParams_template::tx__sccp__cr__data__len() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tx_sccp_cr_data_len of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_tx__sccp__cr__data__len; } BOOLEAN_template& TestHdlrParams_template::expect__compl__l3__success() { set_specific(); return single_value->field_expect__compl__l3__success; } const BOOLEAN_template& TestHdlrParams_template::expect__compl__l3__success() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field expect_compl_l3_success of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_expect__compl__l3__success; } PfcpParameters_template& TestHdlrParams_template::pfcp__pars() { set_specific(); return single_value->field_pfcp__pars; } const PfcpParameters_template& TestHdlrParams_template::pfcp__pars() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pfcp_pars of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_pfcp__pars; } OCTETSTRING_template& TestHdlrParams_template::nas__pdu() { set_specific(); return single_value->field_nas__pdu; } const OCTETSTRING_template& TestHdlrParams_template::nas__pdu() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field nas_pdu of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_nas__pdu; } SCCPasp__Types::SCCP__PAR__Address_template& TestHdlrParams_template::sccp__addr__msc() { set_specific(); return single_value->field_sccp__addr__msc; } const SCCPasp__Types::SCCP__PAR__Address_template& TestHdlrParams_template::sccp__addr__msc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sccp_addr_msc of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_sccp__addr__msc; } SCCPasp__Types::SCCP__PAR__Address_template& TestHdlrParams_template::sccp__addr__hnbgw() { set_specific(); return single_value->field_sccp__addr__hnbgw; } const SCCPasp__Types::SCCP__PAR__Address_template& TestHdlrParams_template::sccp__addr__hnbgw() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sccp_addr_hnbgw of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_sccp__addr__hnbgw; } RANAP__IEs::Cause_template& TestHdlrParams_template::rab__rel__cause() { set_specific(); return single_value->field_rab__rel__cause; } const RANAP__IEs::Cause_template& TestHdlrParams_template::rab__rel__cause() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rab_rel_cause of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_rab__rel__cause; } INTEGER_template& TestHdlrParams_template::hnbgw__timer__x31() { set_specific(); return single_value->field_hnbgw__timer__x31; } const INTEGER_template& TestHdlrParams_template::hnbgw__timer__x31() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnbgw_timer_x31 of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_hnbgw__timer__x31; } BITSTRING_template& TestHdlrParams_template::sigc__id() { set_specific(); return single_value->field_sigc__id; } const BITSTRING_template& TestHdlrParams_template::sigc__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sigc_id of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_sigc__id; } FLOAT_template& TestHdlrParams_template::t__guard() { set_specific(); return single_value->field_t__guard; } const FLOAT_template& TestHdlrParams_template::t__guard() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field t_guard of a non-specific template of type @ConnHdlr.TestHdlrParams."); return single_value->field_t__guard; } int TestHdlrParams_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 14; if (single_value->field_hnb.is_present()) ret_val++; if (single_value->field_nas__pdu.is_present()) ret_val++; if (single_value->field_sccp__addr__msc.is_present()) ret_val++; if (single_value->field_sccp__addr__hnbgw.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 @ConnHdlr.TestHdlrParams 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 @ConnHdlr.TestHdlrParams containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.TestHdlrParams containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.TestHdlrParams."); } return 0; } void TestHdlrParams_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ hnb_idx := "); single_value->field_hnb__idx.log(); TTCN_Logger::log_event_str(", cn_idx := "); single_value->field_cn__idx.log(); TTCN_Logger::log_event_str(", imsi := "); single_value->field_imsi.log(); TTCN_Logger::log_event_str(", ps_domain := "); single_value->field_ps__domain.log(); TTCN_Logger::log_event_str(", mgcp_pars := "); single_value->field_mgcp__pars.log(); TTCN_Logger::log_event_str(", gtp_pars := "); single_value->field_gtp__pars.log(); TTCN_Logger::log_event_str(", hnb := "); single_value->field_hnb.log(); TTCN_Logger::log_event_str(", expect_separate_sccp_cr := "); single_value->field_expect__separate__sccp__cr.log(); TTCN_Logger::log_event_str(", tx_sccp_cr_data_len := "); single_value->field_tx__sccp__cr__data__len.log(); TTCN_Logger::log_event_str(", expect_compl_l3_success := "); single_value->field_expect__compl__l3__success.log(); TTCN_Logger::log_event_str(", pfcp_pars := "); single_value->field_pfcp__pars.log(); TTCN_Logger::log_event_str(", nas_pdu := "); single_value->field_nas__pdu.log(); TTCN_Logger::log_event_str(", sccp_addr_msc := "); single_value->field_sccp__addr__msc.log(); TTCN_Logger::log_event_str(", sccp_addr_hnbgw := "); single_value->field_sccp__addr__hnbgw.log(); TTCN_Logger::log_event_str(", rab_rel_cause := "); single_value->field_rab__rel__cause.log(); TTCN_Logger::log_event_str(", hnbgw_timer_x31 := "); single_value->field_hnbgw__timer__x31.log(); TTCN_Logger::log_event_str(", sigc_id := "); single_value->field_sigc__id.log(); TTCN_Logger::log_event_str(", t_guard := "); single_value->field_t__guard.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 TestHdlrParams_template::log_match(const TestHdlrParams& 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_hnb__idx.match(match_value.hnb__idx(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb_idx"); single_value->field_hnb__idx.log_match(match_value.hnb__idx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cn__idx.match(match_value.cn__idx(), legacy)){ TTCN_Logger::log_logmatch_info(".cn_idx"); single_value->field_cn__idx.log_match(match_value.cn__idx(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_imsi.match(match_value.imsi(), legacy)){ TTCN_Logger::log_logmatch_info(".imsi"); single_value->field_imsi.log_match(match_value.imsi(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ps__domain.match(match_value.ps__domain(), legacy)){ TTCN_Logger::log_logmatch_info(".ps_domain"); single_value->field_ps__domain.log_match(match_value.ps__domain(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mgcp__pars.match(match_value.mgcp__pars(), legacy)){ TTCN_Logger::log_logmatch_info(".mgcp_pars"); single_value->field_mgcp__pars.log_match(match_value.mgcp__pars(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtp__pars.match(match_value.gtp__pars(), legacy)){ TTCN_Logger::log_logmatch_info(".gtp_pars"); single_value->field_gtp__pars.log_match(match_value.gtp__pars(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.hnb().ispresent()){ if(!single_value->field_hnb.match(match_value.hnb(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb"); single_value->field_hnb.log_match(match_value.hnb(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_hnb.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".hnb := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_hnb.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_expect__separate__sccp__cr.match(match_value.expect__separate__sccp__cr(), legacy)){ TTCN_Logger::log_logmatch_info(".expect_separate_sccp_cr"); single_value->field_expect__separate__sccp__cr.log_match(match_value.expect__separate__sccp__cr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_tx__sccp__cr__data__len.match(match_value.tx__sccp__cr__data__len(), legacy)){ TTCN_Logger::log_logmatch_info(".tx_sccp_cr_data_len"); single_value->field_tx__sccp__cr__data__len.log_match(match_value.tx__sccp__cr__data__len(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_expect__compl__l3__success.match(match_value.expect__compl__l3__success(), legacy)){ TTCN_Logger::log_logmatch_info(".expect_compl_l3_success"); single_value->field_expect__compl__l3__success.log_match(match_value.expect__compl__l3__success(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pfcp__pars.match(match_value.pfcp__pars(), legacy)){ TTCN_Logger::log_logmatch_info(".pfcp_pars"); single_value->field_pfcp__pars.log_match(match_value.pfcp__pars(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.nas__pdu().ispresent()){ if(!single_value->field_nas__pdu.match(match_value.nas__pdu(), legacy)){ TTCN_Logger::log_logmatch_info(".nas_pdu"); single_value->field_nas__pdu.log_match(match_value.nas__pdu(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_nas__pdu.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".nas_pdu := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_nas__pdu.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.sccp__addr__msc().ispresent()){ if(!single_value->field_sccp__addr__msc.match(match_value.sccp__addr__msc(), legacy)){ TTCN_Logger::log_logmatch_info(".sccp_addr_msc"); single_value->field_sccp__addr__msc.log_match(match_value.sccp__addr__msc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_sccp__addr__msc.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".sccp_addr_msc := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_sccp__addr__msc.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.sccp__addr__hnbgw().ispresent()){ if(!single_value->field_sccp__addr__hnbgw.match(match_value.sccp__addr__hnbgw(), legacy)){ TTCN_Logger::log_logmatch_info(".sccp_addr_hnbgw"); single_value->field_sccp__addr__hnbgw.log_match(match_value.sccp__addr__hnbgw(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_sccp__addr__hnbgw.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".sccp_addr_hnbgw := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_sccp__addr__hnbgw.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_rab__rel__cause.match(match_value.rab__rel__cause(), legacy)){ TTCN_Logger::log_logmatch_info(".rab_rel_cause"); single_value->field_rab__rel__cause.log_match(match_value.rab__rel__cause(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_hnbgw__timer__x31.match(match_value.hnbgw__timer__x31(), legacy)){ TTCN_Logger::log_logmatch_info(".hnbgw_timer_x31"); single_value->field_hnbgw__timer__x31.log_match(match_value.hnbgw__timer__x31(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_sigc__id.match(match_value.sigc__id(), legacy)){ TTCN_Logger::log_logmatch_info(".sigc_id"); single_value->field_sigc__id.log_match(match_value.sigc__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_t__guard.match(match_value.t__guard(), legacy)){ TTCN_Logger::log_logmatch_info(".t_guard"); single_value->field_t__guard.log_match(match_value.t__guard(), 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("{ hnb_idx := "); single_value->field_hnb__idx.log_match(match_value.hnb__idx(), legacy); TTCN_Logger::log_event_str(", cn_idx := "); single_value->field_cn__idx.log_match(match_value.cn__idx(), legacy); TTCN_Logger::log_event_str(", imsi := "); single_value->field_imsi.log_match(match_value.imsi(), legacy); TTCN_Logger::log_event_str(", ps_domain := "); single_value->field_ps__domain.log_match(match_value.ps__domain(), legacy); TTCN_Logger::log_event_str(", mgcp_pars := "); single_value->field_mgcp__pars.log_match(match_value.mgcp__pars(), legacy); TTCN_Logger::log_event_str(", gtp_pars := "); single_value->field_gtp__pars.log_match(match_value.gtp__pars(), legacy); TTCN_Logger::log_event_str(", hnb := "); if (match_value.hnb().ispresent()) { single_value->field_hnb.log_match(match_value.hnb(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_hnb.log(); if (single_value->field_hnb.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", expect_separate_sccp_cr := "); single_value->field_expect__separate__sccp__cr.log_match(match_value.expect__separate__sccp__cr(), legacy); TTCN_Logger::log_event_str(", tx_sccp_cr_data_len := "); single_value->field_tx__sccp__cr__data__len.log_match(match_value.tx__sccp__cr__data__len(), legacy); TTCN_Logger::log_event_str(", expect_compl_l3_success := "); single_value->field_expect__compl__l3__success.log_match(match_value.expect__compl__l3__success(), legacy); TTCN_Logger::log_event_str(", pfcp_pars := "); single_value->field_pfcp__pars.log_match(match_value.pfcp__pars(), legacy); TTCN_Logger::log_event_str(", nas_pdu := "); if (match_value.nas__pdu().ispresent()) { single_value->field_nas__pdu.log_match(match_value.nas__pdu(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_nas__pdu.log(); if (single_value->field_nas__pdu.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", sccp_addr_msc := "); if (match_value.sccp__addr__msc().ispresent()) { single_value->field_sccp__addr__msc.log_match(match_value.sccp__addr__msc(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_sccp__addr__msc.log(); if (single_value->field_sccp__addr__msc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", sccp_addr_hnbgw := "); if (match_value.sccp__addr__hnbgw().ispresent()) { single_value->field_sccp__addr__hnbgw.log_match(match_value.sccp__addr__hnbgw(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_sccp__addr__hnbgw.log(); if (single_value->field_sccp__addr__hnbgw.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", rab_rel_cause := "); single_value->field_rab__rel__cause.log_match(match_value.rab__rel__cause(), legacy); TTCN_Logger::log_event_str(", hnbgw_timer_x31 := "); single_value->field_hnbgw__timer__x31.log_match(match_value.hnbgw__timer__x31(), legacy); TTCN_Logger::log_event_str(", sigc_id := "); single_value->field_sigc__id.log_match(match_value.sigc__id(), legacy); TTCN_Logger::log_event_str(", t_guard := "); single_value->field_t__guard.log_match(match_value.t__guard(), 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 TestHdlrParams_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (hnb__idx().is_bound()) hnb__idx().set_implicit_omit(); if (cn__idx().is_bound()) cn__idx().set_implicit_omit(); if (imsi().is_bound()) imsi().set_implicit_omit(); if (ps__domain().is_bound()) ps__domain().set_implicit_omit(); if (mgcp__pars().is_bound()) mgcp__pars().set_implicit_omit(); if (gtp__pars().is_bound()) gtp__pars().set_implicit_omit(); if (!hnb().is_bound()) hnb() = OMIT_VALUE; else hnb().set_implicit_omit(); if (expect__separate__sccp__cr().is_bound()) expect__separate__sccp__cr().set_implicit_omit(); if (tx__sccp__cr__data__len().is_bound()) tx__sccp__cr__data__len().set_implicit_omit(); if (expect__compl__l3__success().is_bound()) expect__compl__l3__success().set_implicit_omit(); if (pfcp__pars().is_bound()) pfcp__pars().set_implicit_omit(); if (!nas__pdu().is_bound()) nas__pdu() = OMIT_VALUE; else nas__pdu().set_implicit_omit(); if (!sccp__addr__msc().is_bound()) sccp__addr__msc() = OMIT_VALUE; else sccp__addr__msc().set_implicit_omit(); if (!sccp__addr__hnbgw().is_bound()) sccp__addr__hnbgw() = OMIT_VALUE; else sccp__addr__hnbgw().set_implicit_omit(); if (rab__rel__cause().is_bound()) rab__rel__cause().set_implicit_omit(); if (hnbgw__timer__x31().is_bound()) hnbgw__timer__x31().set_implicit_omit(); if (sigc__id().is_bound()) sigc__id().set_implicit_omit(); if (t__guard().is_bound()) t__guard().set_implicit_omit(); } void TestHdlrParams_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_hnb__idx.encode_text(text_buf); single_value->field_cn__idx.encode_text(text_buf); single_value->field_imsi.encode_text(text_buf); single_value->field_ps__domain.encode_text(text_buf); single_value->field_mgcp__pars.encode_text(text_buf); single_value->field_gtp__pars.encode_text(text_buf); single_value->field_hnb.encode_text(text_buf); single_value->field_expect__separate__sccp__cr.encode_text(text_buf); single_value->field_tx__sccp__cr__data__len.encode_text(text_buf); single_value->field_expect__compl__l3__success.encode_text(text_buf); single_value->field_pfcp__pars.encode_text(text_buf); single_value->field_nas__pdu.encode_text(text_buf); single_value->field_sccp__addr__msc.encode_text(text_buf); single_value->field_sccp__addr__hnbgw.encode_text(text_buf); single_value->field_rab__rel__cause.encode_text(text_buf); single_value->field_hnbgw__timer__x31.encode_text(text_buf); single_value->field_sigc__id.encode_text(text_buf); single_value->field_t__guard.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 @ConnHdlr.TestHdlrParams."); } } void TestHdlrParams_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_hnb__idx.decode_text(text_buf); single_value->field_cn__idx.decode_text(text_buf); single_value->field_imsi.decode_text(text_buf); single_value->field_ps__domain.decode_text(text_buf); single_value->field_mgcp__pars.decode_text(text_buf); single_value->field_gtp__pars.decode_text(text_buf); single_value->field_hnb.decode_text(text_buf); single_value->field_expect__separate__sccp__cr.decode_text(text_buf); single_value->field_tx__sccp__cr__data__len.decode_text(text_buf); single_value->field_expect__compl__l3__success.decode_text(text_buf); single_value->field_pfcp__pars.decode_text(text_buf); single_value->field_nas__pdu.decode_text(text_buf); single_value->field_sccp__addr__msc.decode_text(text_buf); single_value->field_sccp__addr__hnbgw.decode_text(text_buf); single_value->field_rab__rel__cause.decode_text(text_buf); single_value->field_hnbgw__timer__x31.decode_text(text_buf); single_value->field_sigc__id.decode_text(text_buf); single_value->field_t__guard.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 TestHdlrParams_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 @ConnHdlr.TestHdlrParams."); } } void TestHdlrParams_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: { TestHdlrParams_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) hnb__idx().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cn__idx().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imsi().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ps__domain().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mgcp__pars().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) gtp__pars().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) hnb().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) expect__separate__sccp__cr().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tx__sccp__cr__data__len().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) expect__compl__l3__success().set_param(*param.get_elem(9)); if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) pfcp__pars().set_param(*param.get_elem(10)); if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) nas__pdu().set_param(*param.get_elem(11)); if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) sccp__addr__msc().set_param(*param.get_elem(12)); if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) sccp__addr__hnbgw().set_param(*param.get_elem(13)); if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) rab__rel__cause().set_param(*param.get_elem(14)); if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) hnbgw__timer__x31().set_param(*param.get_elem(15)); if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) sigc__id().set_param(*param.get_elem(16)); if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) t__guard().set_param(*param.get_elem(17)); 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(), "hnb_idx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__idx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_idx")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__idx().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "imsi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { imsi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ps_domain")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ps__domain().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mgcp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mgcp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnb")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "expect_separate_sccp_cr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { expect__separate__sccp__cr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tx_sccp_cr_data_len")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tx__sccp__cr__data__len().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "expect_compl_l3_success")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { expect__compl__l3__success().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pfcp_pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "nas_pdu")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { nas__pdu().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sccp_addr_msc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sccp__addr__msc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sccp_addr_hnbgw")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sccp__addr__hnbgw().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rab_rel_cause")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rab__rel__cause().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hnbgw_timer_x31")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnbgw__timer__x31().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sigc_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sigc__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "t_guard")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { t__guard().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.TestHdlrParams: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TestHdlrParams_template* precondition = new TestHdlrParams_template; precondition->set_param(*param.get_elem(0)); TestHdlrParams_template* implied_template = new TestHdlrParams_template; implied_template->set_param(*param.get_elem(1)); *this = TestHdlrParams_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.TestHdlrParams"); } is_ifpresent = param.get_ifpresent(); } void TestHdlrParams_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_hnb__idx.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_cn__idx.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_imsi.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_ps__domain.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_mgcp__pars.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_gtp__pars.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_hnb.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_expect__separate__sccp__cr.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_tx__sccp__cr__data__len.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_expect__compl__l3__success.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_pfcp__pars.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_nas__pdu.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_sccp__addr__msc.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_sccp__addr__hnbgw.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_rab__rel__cause.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_hnbgw__timer__x31.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_sigc__id.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); single_value->field_t__guard.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.TestHdlrParams"); 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 : "@ConnHdlr.TestHdlrParams"); } boolean TestHdlrParams_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TestHdlrParams_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) lai().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sac().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(3)); 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(), "lai")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lai().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rac")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rac().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sac")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sac().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cell_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cell__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.HnbConfig: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@ConnHdlr.HnbConfig"); } } void HnbConfig::encode_text(Text_Buf& text_buf) const { field_lai.encode_text(text_buf); field_rac.encode_text(text_buf); field_sac.encode_text(text_buf); field_cell__id.encode_text(text_buf); } void HnbConfig::decode_text(Text_Buf& text_buf) { field_lai.decode_text(text_buf); field_rac.decode_text(text_buf); field_sac.decode_text(text_buf); field_cell__id.decode_text(text_buf); } struct HnbConfig_template::single_value_struct { GSM__Types::LocationAreaIdentification_template field_lai; INTEGER_template field_rac; INTEGER_template field_sac; INTEGER_template field_cell__id; }; void HnbConfig_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_lai = ANY_VALUE; single_value->field_rac = ANY_VALUE; single_value->field_sac = ANY_VALUE; single_value->field_cell__id = ANY_VALUE; } } } void HnbConfig_template::copy_value(const HnbConfig& other_value) { single_value = new single_value_struct; if (other_value.lai().is_bound()) { single_value->field_lai = other_value.lai(); } else { single_value->field_lai.clean_up(); } if (other_value.rac().is_bound()) { single_value->field_rac = other_value.rac(); } else { single_value->field_rac.clean_up(); } if (other_value.sac().is_bound()) { single_value->field_sac = other_value.sac(); } else { single_value->field_sac.clean_up(); } if (other_value.cell__id().is_bound()) { single_value->field_cell__id = other_value.cell__id(); } else { single_value->field_cell__id.clean_up(); } set_selection(SPECIFIC_VALUE); } void HnbConfig_template::copy_template(const HnbConfig_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.lai().get_selection()) { single_value->field_lai = other_value.lai(); } else { single_value->field_lai.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rac().get_selection()) { single_value->field_rac = other_value.rac(); } else { single_value->field_rac.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sac().get_selection()) { single_value->field_sac = other_value.sac(); } else { single_value->field_sac.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) { single_value->field_cell__id = other_value.cell__id(); } else { single_value->field_cell__id.clean_up(); } 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 HnbConfig_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 HnbConfig_template(*other_value.implication_.precondition); implication_.implied_template = new HnbConfig_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 @ConnHdlr.HnbConfig."); break; } set_selection(other_value); } HnbConfig_template::HnbConfig_template() { } HnbConfig_template::HnbConfig_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HnbConfig_template::HnbConfig_template(const HnbConfig& other_value) { copy_value(other_value); } HnbConfig_template::HnbConfig_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HnbConfig&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.HnbConfig from an unbound optional field."); } } HnbConfig_template::HnbConfig_template(HnbConfig_template* p_precondition, HnbConfig_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HnbConfig_template::HnbConfig_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; } HnbConfig_template::HnbConfig_template(const HnbConfig_template& other_value) : Base_Template() { copy_template(other_value); } HnbConfig_template::~HnbConfig_template() { clean_up(); } HnbConfig_template& HnbConfig_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HnbConfig_template& HnbConfig_template::operator=(const HnbConfig& other_value) { clean_up(); copy_value(other_value); return *this; } HnbConfig_template& HnbConfig_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HnbConfig&)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 @ConnHdlr.HnbConfig."); } return *this; } HnbConfig_template& HnbConfig_template::operator=(const HnbConfig_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HnbConfig_template::match(const HnbConfig& 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.lai().is_bound()) return FALSE; if(!single_value->field_lai.match(other_value.lai(), legacy))return FALSE; if(!other_value.rac().is_bound()) return FALSE; if(!single_value->field_rac.match(other_value.rac(), legacy))return FALSE; if(!other_value.sac().is_bound()) return FALSE; if(!single_value->field_sac.match(other_value.sac(), legacy))return FALSE; if(!other_value.cell__id().is_bound()) return FALSE; if(!single_value->field_cell__id.match(other_value.cell__id(), legacy))return FALSE; 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 @ConnHdlr.HnbConfig."); } return FALSE; } boolean HnbConfig_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_lai.is_bound() || single_value->field_rac.is_bound() || single_value->field_sac.is_bound() || single_value->field_cell__id.is_bound(); } boolean HnbConfig_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_lai.is_value() && single_value->field_rac.is_value() && single_value->field_sac.is_value() && single_value->field_cell__id.is_value(); } void HnbConfig_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; } HnbConfig HnbConfig_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 @ConnHdlr.HnbConfig."); HnbConfig ret_val; if (single_value->field_lai.is_bound()) { ret_val.lai() = single_value->field_lai.valueof(); } if (single_value->field_rac.is_bound()) { ret_val.rac() = single_value->field_rac.valueof(); } if (single_value->field_sac.is_bound()) { ret_val.sac() = single_value->field_sac.valueof(); } if (single_value->field_cell__id.is_bound()) { ret_val.cell__id() = single_value->field_cell__id.valueof(); } return ret_val; } void HnbConfig_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 @ConnHdlr.HnbConfig."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HnbConfig_template[list_length]; } HnbConfig_template& HnbConfig_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 @ConnHdlr.HnbConfig."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.HnbConfig."); return value_list.list_value[list_index]; } GSM__Types::LocationAreaIdentification_template& HnbConfig_template::lai() { set_specific(); return single_value->field_lai; } const GSM__Types::LocationAreaIdentification_template& HnbConfig_template::lai() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lai of a non-specific template of type @ConnHdlr.HnbConfig."); return single_value->field_lai; } INTEGER_template& HnbConfig_template::rac() { set_specific(); return single_value->field_rac; } const INTEGER_template& HnbConfig_template::rac() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rac of a non-specific template of type @ConnHdlr.HnbConfig."); return single_value->field_rac; } INTEGER_template& HnbConfig_template::sac() { set_specific(); return single_value->field_sac; } const INTEGER_template& HnbConfig_template::sac() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sac of a non-specific template of type @ConnHdlr.HnbConfig."); return single_value->field_sac; } INTEGER_template& HnbConfig_template::cell__id() { set_specific(); return single_value->field_cell__id; } const INTEGER_template& HnbConfig_template::cell__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cell_id of a non-specific template of type @ConnHdlr.HnbConfig."); return single_value->field_cell__id; } int HnbConfig_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig 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 @ConnHdlr.HnbConfig containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @ConnHdlr.HnbConfig containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @ConnHdlr.HnbConfig."); } return 0; } void HnbConfig_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ lai := "); single_value->field_lai.log(); TTCN_Logger::log_event_str(", rac := "); single_value->field_rac.log(); TTCN_Logger::log_event_str(", sac := "); single_value->field_sac.log(); TTCN_Logger::log_event_str(", cell_id := "); single_value->field_cell__id.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 HnbConfig_template::log_match(const HnbConfig& 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_lai.match(match_value.lai(), legacy)){ TTCN_Logger::log_logmatch_info(".lai"); single_value->field_lai.log_match(match_value.lai(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rac.match(match_value.rac(), legacy)){ TTCN_Logger::log_logmatch_info(".rac"); single_value->field_rac.log_match(match_value.rac(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_sac.match(match_value.sac(), legacy)){ TTCN_Logger::log_logmatch_info(".sac"); single_value->field_sac.log_match(match_value.sac(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cell__id.match(match_value.cell__id(), legacy)){ TTCN_Logger::log_logmatch_info(".cell_id"); single_value->field_cell__id.log_match(match_value.cell__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } }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("{ lai := "); single_value->field_lai.log_match(match_value.lai(), legacy); TTCN_Logger::log_event_str(", rac := "); single_value->field_rac.log_match(match_value.rac(), legacy); TTCN_Logger::log_event_str(", sac := "); single_value->field_sac.log_match(match_value.sac(), legacy); TTCN_Logger::log_event_str(", cell_id := "); single_value->field_cell__id.log_match(match_value.cell__id(), legacy); TTCN_Logger::log_event_str(" }"); } 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 HnbConfig_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (lai().is_bound()) lai().set_implicit_omit(); if (rac().is_bound()) rac().set_implicit_omit(); if (sac().is_bound()) sac().set_implicit_omit(); if (cell__id().is_bound()) cell__id().set_implicit_omit(); } void HnbConfig_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_lai.encode_text(text_buf); single_value->field_rac.encode_text(text_buf); single_value->field_sac.encode_text(text_buf); single_value->field_cell__id.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 @ConnHdlr.HnbConfig."); } } void HnbConfig_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_lai.decode_text(text_buf); single_value->field_rac.decode_text(text_buf); single_value->field_sac.decode_text(text_buf); single_value->field_cell__id.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 HnbConfig_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 @ConnHdlr.HnbConfig."); } } void HnbConfig_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: { HnbConfig_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) lai().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sac().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(3)); 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(), "lai")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lai().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rac")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rac().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sac")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sac().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cell_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cell__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @ConnHdlr.HnbConfig: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HnbConfig_template* precondition = new HnbConfig_template; precondition->set_param(*param.get_elem(0)); HnbConfig_template* implied_template = new HnbConfig_template; implied_template->set_param(*param.get_elem(1)); *this = HnbConfig_template(precondition, implied_template); } break; default: param.type_error("record template", "@ConnHdlr.HnbConfig"); } is_ifpresent = param.get_ifpresent(); } void HnbConfig_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_lai.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.HnbConfig"); single_value->field_rac.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.HnbConfig"); single_value->field_sac.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.HnbConfig"); single_value->field_cell__id.check_restriction(t_res, t_name ? t_name : "@ConnHdlr.HnbConfig"); 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 : "@ConnHdlr.HnbConfig"); } boolean HnbConfig_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HnbConfig_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; } ConnHdlrList::ConnHdlrList(const ConnHdlrList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @ConnHdlr.ConnHdlrList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } ConnHdlrList::~ConnHdlrList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void ConnHdlrList::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."); } } ConnHdlrList& ConnHdlrList::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; } ConnHdlrList& ConnHdlrList::operator=(const ConnHdlrList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @ConnHdlr.ConnHdlrList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean ConnHdlrList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @ConnHdlr.ConnHdlrList."); return val_ptr->n_elements == 0 ; } boolean ConnHdlrList::operator==(const ConnHdlrList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @ConnHdlr.ConnHdlrList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @ConnHdlr.ConnHdlrList."); 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; } COMPONENT& ConnHdlrList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @ConnHdlr.ConnHdlrList 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 = (COMPONENT**)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 COMPONENT(*(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 COMPONENT; } return *val_ptr->value_elements[index_value]; } COMPONENT& ConnHdlrList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @ConnHdlr.ConnHdlrList."); return (*this)[(int)index_value]; } const COMPONENT& ConnHdlrList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @ConnHdlr.ConnHdlrList."); if (index_value < 0) TTCN_error("Accessing an element of type @ConnHdlr.ConnHdlrList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @ConnHdlr.ConnHdlrList: 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 COMPONENT& ConnHdlrList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @ConnHdlr.ConnHdlrList."); return (*this)[(int)index_value]; } ConnHdlrList ConnHdlrList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } ConnHdlrList ConnHdlrList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } ConnHdlrList ConnHdlrList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } ConnHdlrList ConnHdlrList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @ConnHdlr.ConnHdlrList."); 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; ConnHdlrList 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 COMPONENT(*val_ptr->value_elements[i]); } } return ret_val; } ConnHdlrList ConnHdlrList::operator+(const ConnHdlrList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @ConnHdlr.ConnHdlrList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; ConnHdlrList 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 COMPONENT(*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 COMPONENT(*other_value.val_ptr->value_elements[i]); } } return ret_val; } ConnHdlrList ConnHdlrList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @ConnHdlr.ConnHdlrList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@ConnHdlr.ConnHdlrList","element"); ConnHdlrList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new COMPONENT(*val_ptr->value_elements[i+index]); } } return ret_val; } ConnHdlrList ConnHdlrList::replace(int index, int len, const ConnHdlrList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @ConnHdlr.ConnHdlrList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @ConnHdlr.ConnHdlrList."); check_replace_arguments(val_ptr->n_elements, index, len, "@ConnHdlr.ConnHdlrList","element"); ConnHdlrList 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 COMPONENT(*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 COMPONENT(*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 COMPONENT(*val_ptr->value_elements[index+i+len]); } } return ret_val; } ConnHdlrList ConnHdlrList::replace(int index, int len, const ConnHdlrList_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 ConnHdlrList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @ConnHdlr.ConnHdlrList."); 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 = (COMPONENT**)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 COMPONENT(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (COMPONENT**)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 @ConnHdlr.ConnHdlrList: %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 = (COMPONENT**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean ConnHdlrList::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 ConnHdlrList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @ConnHdlr.ConnHdlrList."); return val_ptr->n_elements; } int ConnHdlrList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @ConnHdlr.ConnHdlrList."); 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 ConnHdlrList::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 ConnHdlrList::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 ConnHdlrList::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", "@ConnHdlr.ConnHdlrList"); } 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", "@ConnHdlr.ConnHdlrList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void ConnHdlrList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @ConnHdlr.ConnHdlrList."); 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 ConnHdlrList::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 @ConnHdlr.ConnHdlrList."); val_ptr->value_elements = (COMPONENT**)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 COMPONENT; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void ConnHdlrList_template::copy_value(const ConnHdlrList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @ConnHdlr.ConnHdlrList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (COMPONENT_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 COMPONENT_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new COMPONENT_template; } } set_selection(SPECIFIC_VALUE); } void ConnHdlrList_template::copy_template(const ConnHdlrList_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 = (COMPONENT_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 COMPONENT_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new COMPONENT_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 ConnHdlrList_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 ConnHdlrList_template(*other_value.implication_.precondition); implication_.implied_template = new ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); break; } set_selection(other_value); } boolean ConnHdlrList_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 ConnHdlrList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const ConnHdlrList*)value_ptr)[value_index], legacy); else return ((const ConnHdlrList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } ConnHdlrList_template::ConnHdlrList_template() { } ConnHdlrList_template::ConnHdlrList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } ConnHdlrList_template::ConnHdlrList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } ConnHdlrList_template::ConnHdlrList_template(const ConnHdlrList& other_value) { copy_value(other_value); } ConnHdlrList_template::ConnHdlrList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConnHdlrList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @ConnHdlr.ConnHdlrList from an unbound optional field."); } } ConnHdlrList_template::ConnHdlrList_template(ConnHdlrList_template* p_precondition, ConnHdlrList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ConnHdlrList_template::ConnHdlrList_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; } ConnHdlrList_template::ConnHdlrList_template(const ConnHdlrList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } ConnHdlrList_template::~ConnHdlrList_template() { clean_up(); } void ConnHdlrList_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; } ConnHdlrList_template& ConnHdlrList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ConnHdlrList_template& ConnHdlrList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } ConnHdlrList_template& ConnHdlrList_template::operator=(const ConnHdlrList& other_value) { clean_up(); copy_value(other_value); return *this; } ConnHdlrList_template& ConnHdlrList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConnHdlrList&)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 @ConnHdlr.ConnHdlrList."); } return *this; } ConnHdlrList_template& ConnHdlrList_template::operator=(const ConnHdlrList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } COMPONENT_template& ConnHdlrList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList."); break; } return *single_value.value_elements[index_value]; } COMPONENT_template& ConnHdlrList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @ConnHdlr.ConnHdlrList."); return (*this)[(int)index_value]; } const COMPONENT_template& ConnHdlrList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @ConnHdlr.ConnHdlrList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @ConnHdlr.ConnHdlrList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @ConnHdlr.ConnHdlrList: 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 COMPONENT_template& ConnHdlrList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @ConnHdlr.ConnHdlrList."); return (*this)[(int)index_value]; } void ConnHdlrList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @ConnHdlr.ConnHdlrList."); 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 = (COMPONENT_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 COMPONENT_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 COMPONENT_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 = (COMPONENT_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int ConnHdlrList_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 ConnHdlrList_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 @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList 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 @ConnHdlr.ConnHdlrList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @ConnHdlr.ConnHdlrList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @ConnHdlr.ConnHdlrList"); } boolean ConnHdlrList_template::match(const ConnHdlrList& 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 @ConnHdlr.ConnHdlrList."); } return FALSE; } boolean ConnHdlrList_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; } ConnHdlrList ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); ConnHdlrList 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; } ConnHdlrList ConnHdlrList_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); } ConnHdlrList ConnHdlrList_template::replace(int index, int len, const ConnHdlrList_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()); } ConnHdlrList ConnHdlrList_template::replace(int index, int len, const ConnHdlrList& 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 ConnHdlrList_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 ConnHdlrList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @ConnHdlr.ConnHdlrList."); } set_selection(template_type); } ConnHdlrList_template& ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @ConnHdlr.ConnHdlrList."); return value_list.list_value[list_index]; } void ConnHdlrList_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 ConnHdlrList_template::log_match(const ConnHdlrList& 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 ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); } } void ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); single_value.value_elements = (COMPONENT_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 COMPONENT_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 ConnHdlrList_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 @ConnHdlr.ConnHdlrList."); } } boolean ConnHdlrList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ConnHdlrList_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 ConnHdlrList_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: { ConnHdlrList_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: { ConnHdlrList_template* precondition = new ConnHdlrList_template; precondition->set_param(*param.get_elem(0)); ConnHdlrList_template* implied_template = new ConnHdlrList_template; implied_template->set_param(*param.get_elem(1)); *this = ConnHdlrList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@ConnHdlr.ConnHdlrList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void ConnHdlrList_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 : "@ConnHdlr.ConnHdlrList"); 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 : "@ConnHdlr.ConnHdlrList"); } boolean ConnHdlrList_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); } } void__fn::void__fn() { referred_function = NULL; } void__fn::void__fn(function_pointer other_value) { referred_function = other_value; } void__fn::void__fn(const void__fn& other_value) : Base_Type(){ other_value.must_bound("Copying an unbound @ConnHdlr.void_fn value."); referred_function = other_value.referred_function; } void__fn& void__fn::operator=(function_pointer other_value) { referred_function = other_value; return *this; } void__fn& void__fn::operator=(const void__fn& other_value) { other_value.must_bound("Assignment of an unbound value."); referred_function = other_value.referred_function; return *this; } boolean void__fn::operator==(function_pointer other_value) const { must_bound("Unbound left operand of @ConnHdlr.void_fn comparison."); return referred_function == other_value; } boolean void__fn::operator==(const void__fn& other_value) const { must_bound("Unbound left operand of @ConnHdlr.void_fn comparison."); other_value.must_bound("Unbound right operand of @ConnHdlr.void_fn comparison."); return referred_function == other_value.referred_function; } void void__fn::invoke(const CHARSTRING& id) const { must_bound("Call of unbound function."); if(referred_function == (void__fn::function_pointer)Module_List::get_fat_null()) TTCN_error("null reference cannot be invoked."); referred_function(id); } void void__fn::start(const COMPONENT& component_reference, const CHARSTRING& id) const { ((void__fn::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, id); } void void__fn::log() const { Module_List::log_function((genericfunc_t)referred_function); } void void__fn::set_param(Module_Param& param) { param.error("Not supported."); } void void__fn::encode_text(Text_Buf& text_buf) const { Module_List::encode_function(text_buf,(genericfunc_t)referred_function); } void void__fn::decode_text(Text_Buf& text_buf) { Module_List::decode_function(text_buf,(genericfunc_t*)&referred_function); } boolean operator==(void__fn::function_pointer value, const void__fn& other_value) { other_value.must_bound("Unbound right operand of @ConnHdlr.void_fn comparison."); return value == other_value.referred_function; } void void__fn_template::copy_template(const void__fn_template& other_value) { switch(other_value.template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new void__fn_template[value_list.n_values]; for(unsigned int i = 0; i < value_list.n_values; i++) value_list.list_value[i] = other_value.value_list.list_value[i]; break; default: TTCN_error("Copying an unitialized/unsupported @ConnHdlr.void_fn template."); } set_selection(other_value); } void__fn_template::void__fn_template() { } void__fn_template::void__fn_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } void__fn_template::void__fn_template(void__fn::function_pointer other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } void__fn_template::void__fn_template(const void__fn& other_value) :Base_Template(SPECIFIC_VALUE) { other_value.must_bound("Creating a template from an unbound @ConnHdlr.void_fn value."); single_value = other_value.referred_function; } void__fn_template::void__fn_template(const OPTIONAL& other_value) { if(other_value.ispresent()) { set_selection(SPECIFIC_VALUE); single_value = ((const void__fn&)other_value()).referred_function; } else set_selection(OMIT_VALUE); } void__fn_template::void__fn_template(const void__fn_template& other_value) :Base_Template() { copy_template(other_value); } void__fn_template::~void__fn_template() { clean_up(); } void void__fn_template::clean_up(){ if(template_selection == VALUE_LIST || template_selection == COMPLEMENTED_LIST) delete[] value_list.list_value; template_selection = UNINITIALIZED_TEMPLATE; } void__fn_template& void__fn_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } void__fn_template& void__fn_template::operator=(void__fn::function_pointer other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this;} void__fn_template& void__fn_template::operator=(const void__fn& other_value) { other_value.must_bound("Assignment of an unbound @ConnHdlr.void_fn value to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.referred_function; return *this; } void__fn_template& void__fn_template::operator=(const OPTIONAL& other_value) { clean_up(); if(other_value.ispresent()) { set_selection(SPECIFIC_VALUE); single_value = ((const void__fn&)other_value()).referred_function; } else set_selection(OMIT_VALUE); return *this;} void__fn_template& void__fn_template::operator=(const void__fn_template& other_value) { if(&other_value != this) { clean_up();copy_template(other_value); } return *this; } boolean void__fn_template::match(void__fn::function_pointer other_value, boolean) const { switch(template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for(unsigned int i = 0; i < value_list.n_values; i++) if(value_list.list_value[i].match(other_value)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; default: TTCN_error("Matching with an unitialized/unsupported @ConnHdlr.void_fn template."); }; return FALSE; } boolean void__fn_template::match(const void__fn& other_value, boolean) const { if (!other_value.is_bound()) return FALSE; return match(other_value.referred_function); } void__fn void__fn_template::valueof() const { if(template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific @ConnHdlr.void_fn template."); return single_value; } void void__fn_template::set_type(template_sel template_type, unsigned int list_length) { if(template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST) TTCN_error("Setting an invalid type for an @ConnHdlr.void_fn template."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new void__fn_template[list_length]; } void__fn_template& void__fn_template::list_item(unsigned int list_index) const { if(template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST) TTCN_error("Accessing a list element of a non-list template of type @ConnHdlr.void_fn"); if(list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @ConnHdlr.void_fn."); return value_list.list_value[list_index]; } void void__fn_template::log() const { switch(template_selection) { case SPECIFIC_VALUE: Module_List::log_function((genericfunc_t)single_value); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case VALUE_LIST: TTCN_Logger::log_char('('); for(unsigned int i = 0; i < value_list.n_values; i++) { if(i > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[i].log(); } TTCN_Logger::log_char(')'); break; default: log_generic(); } log_ifpresent(); } void void__fn_template::log_match(const void__fn& match_value, boolean legacy) const { log(); TTCN_Logger::log_event_str(" with "); match_value.log(); if(match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void void__fn_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch(template_selection) { case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case SPECIFIC_VALUE: Module_List::encode_function(text_buf, (genericfunc_t)single_value); break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for(unsigned int i = 0; i < value_list.n_values; i++) value_list.list_value[i].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @ConnHdlr.void_fn."); } } void void__fn_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch(template_selection) { case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case SPECIFIC_VALUE: Module_List::decode_function(text_buf,(genericfunc_t*)&single_value); break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new void__fn_template[value_list.n_values]; for(unsigned int i = 0; i < value_list.n_values; i++) value_list.list_value[i].decode_text(text_buf); default: TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @ConnHdlr.void_fn."); } } boolean void__fn_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean void__fn_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; in_elements == 0; } CHARSTRING f__mgcp__endp__str(const INTEGER& endp__idx) { TTCN_Location current_location("ConnHdlr.ttcn", 125, TTCN_Location::LOCATION_FUNCTION, "f_mgcp_endp_str"); current_location.update_lineno(127); /* ConnHdlr.ttcn, line 127 */ return ((cs_0 + int2str(endp__idx)) + cs_1); } MgcpParameters_template t__MgcpParams(const INTEGER& endp__idx) { TTCN_Location current_location("ConnHdlr.ttcn", 130, TTCN_Location::LOCATION_TEMPLATE, "t_MgcpParams"); MgcpParameters_template ret_val; ret_val.got__crcx__count() = 0; ret_val.got__dlcx__count() = 0; ret_val.mgcp__call__id() = OMIT_VALUE; ret_val.mgcp__ep() = f__mgcp__endp__str(endp__idx); { MgwResponse_template& tmp_0 = ret_val.mgw__conn__ran(); tmp_0.resp() = 1; tmp_0.mgw__rtp__ip() = cs_2; tmp_0.mgw__rtp__ip__mdcx() = OMIT_VALUE; tmp_0.mgw__rtp__port() = 10000; tmp_0.mgcp__connection__id() = hs_0; } { MgwResponse_template& tmp_1 = ret_val.mgw__conn__cn(); tmp_1.resp() = 1; tmp_1.mgw__rtp__ip() = cs_3; tmp_1.mgw__rtp__ip__mdcx() = OMIT_VALUE; tmp_1.mgw__rtp__port() = 20000; tmp_1.mgcp__connection__id() = hs_1; } ret_val.rtp__payload__type() = 112; ret_val.rtp__sdp__format() = cs_4; ret_val.hnb__rtp__ip() = cs_5; ret_val.hnb__rtp__port() = 10001; ret_val.cn__rtp__ip() = cs_6; ret_val.cn__rtp__port() = 20001; ret_val.use__osmux() = FALSE; ret_val.got__osmux__count() = 0; return ret_val; } PfcpParameters_template t__PfcpParams(const BOOLEAN& pfcp__enabled, const CHARSTRING& pfcp__local__addr, const CHARSTRING& pfcp__upf__node__id, const INTEGER& upf__f__seid) { TTCN_Location current_location("ConnHdlr.ttcn", 217, TTCN_Location::LOCATION_TEMPLATE, "t_PfcpParams"); PfcpParameters_template ret_val; ret_val.pfcp__enabled() = pfcp__enabled; ret_val.pfcp__local__addr() = pfcp__local__addr; ret_val.upf__node__id() = PFCP__Templates::ts__PFCP__Node__ID__fqdn(pfcp__upf__node__id).valueof(); ret_val.upf__f__seid() = PFCP__Templates::ts__PFCP__F__SEID__ipv4(OCTETSTRING_template(Native__Functions::f__inet__addr(pfcp__local__addr)), OCTETSTRING_template(int2oct(upf__f__seid, 8))); ret_val.hnbgw__f__seid() = OMIT_VALUE; return ret_val; } TestHdlrParams_template t__pars(const INTEGER& imsi__suffix, const BOOLEAN& ps__domain, const INTEGER& hnb__idx, const BOOLEAN& expect__separate__sccp__cr, const INTEGER& tx__sccp__cr__data__len, const BOOLEAN& expect__compl__l3__success, const INTEGER& cn__idx, const MgcpParameters_template& mgcp__pars, const PfcpParameters_template& pfcp__pars, const RANAP__IEs::Cause_template& rab__rel__cause, const INTEGER& hnbgw__timer__x31, const FLOAT& t__guard) { TTCN_Location current_location("ConnHdlr.ttcn", 261, TTCN_Location::LOCATION_TEMPLATE, "t_pars"); TestHdlrParams_template ret_val; ret_val.hnb__idx() = hnb__idx; ret_val.cn__idx() = cn__idx; ret_val.imsi() = Osmocom__Types::f__gen__imsi(imsi__suffix); ret_val.ps__domain() = ps__domain; ret_val.mgcp__pars() = mgcp__pars; ret_val.gtp__pars() = t__GtpParams; ret_val.hnb() = OMIT_VALUE; ret_val.expect__separate__sccp__cr() = expect__separate__sccp__cr; ret_val.tx__sccp__cr__data__len() = tx__sccp__cr__data__len; ret_val.expect__compl__l3__success() = expect__compl__l3__success; ret_val.pfcp__pars() = pfcp__pars; ret_val.nas__pdu() = OMIT_VALUE; ret_val.sccp__addr__msc() = OMIT_VALUE; ret_val.sccp__addr__hnbgw() = OMIT_VALUE; ret_val.rab__rel__cause() = rab__rel__cause; ret_val.hnbgw__timer__x31() = hnbgw__timer__x31; ret_val.sigc__id() = int2bit(Osmocom__Types::f__rnd__int(1000), 24); ret_val.t__guard() = t__guard; return ret_val; } void f__create__ranap__exp(const OCTETSTRING& l3__enc) { TTCN_Location current_location("ConnHdlr.ttcn", 295, TTCN_Location::LOCATION_FUNCTION, "f_create_ranap_exp"); current_location.update_lineno(296); /* ConnHdlr.ttcn, line 296 */ { RAN__Emulation::RAN__register_template tmp_8; tmp_8.l3() = l3__enc; tmp_8.hdlr() = self; RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN__PROC.call(tmp_8, FALSE, NULL); } { alt_status tmp_9_alt_flag_0 = ALT_MAYBE; current_location.update_lineno(296); /* ConnHdlr.ttcn, line 296 */ TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_9_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(297); /* ConnHdlr.ttcn, line 297 */ { RAN__Emulation::RAN__register_template tmp_10; tmp_10.l3() = ANY_VALUE; tmp_10.hdlr() = ANY_VALUE; tmp_9_alt_flag_0 = RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN__PROC.getreply(tmp_10, any_compref, RAN__Emulation::RAN__register_reply_redirect(), NULL, NULL, NULL); } if (tmp_9_alt_flag_0 == ALT_YES) break; } current_location.update_lineno(296); /* ConnHdlr.ttcn, line 296 */ if (tmp_9_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 ConnHdlr.ttcn between lines 296 and 298."); TTCN_Snapshot::take_new(TRUE); } } } void start_f__create__ranap__exp(const COMPONENT& component_reference, const OCTETSTRING& l3__enc) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_ranap_exp("); l3__enc.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, "ConnHdlr", "f_create_ranap_exp", text_buf); l3__enc.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__handler__init(const void__fn& fn, const CHARSTRING& id, const TestHdlrParams& pars) { TTCN_Location current_location("ConnHdlr.ttcn", 304, TTCN_Location::LOCATION_FUNCTION, "f_handler_init"); current_location.update_lineno(306); /* ConnHdlr.ttcn, line 306 */ ConnHdlr_component_g__pars = pars; current_location.update_lineno(309); /* ConnHdlr.ttcn, line 309 */ ConnHdlr_component_g__Tguard.start(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).t__guard()); current_location.update_lineno(310); /* ConnHdlr.ttcn, line 310 */ activate_as__Tguard__ConnHdlr(); current_location.update_lineno(312); /* ConnHdlr.ttcn, line 312 */ { Map_Params tmp_12(0); TTCN_Runtime::map_port(self, ConnHdlr_component_HNBGWVTY.get_name(), SYSTEM_COMPREF, "HNBGWVTY", tmp_12); } current_location.update_lineno(313); /* ConnHdlr.ttcn, line 313 */ Osmocom__VTY__Functions::f__vty__set__prompts(ConnHdlr_component_HNBGWVTY, Osmocom__VTY__Functions::f__vty__set__prompts_prompt__prefix_defval); current_location.update_lineno(314); /* ConnHdlr.ttcn, line 314 */ Osmocom__VTY__Functions::f__vty__transceive(ConnHdlr_component_HNBGWVTY, cs_12, Osmocom__VTY__Functions::f__vty__transceive_strict_defval); current_location.update_lineno(318); /* ConnHdlr.ttcn, line 318 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(320); /* ConnHdlr.ttcn, line 320 */ fn.invoke(id); } void start_f__handler__init(const COMPONENT& component_reference, const void__fn& fn, const CHARSTRING& id, const TestHdlrParams& pars) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_handler_init("); fn.log(); TTCN_Logger::log_event_str(", "); id.log(); TTCN_Logger::log_event_str(", "); pars.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, "ConnHdlr", "f_handler_init", text_buf); fn.encode_text(text_buf); id.encode_text(text_buf); pars.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } alt_status as__Tguard__ConnHdlr_instance(boolean first_alt_run) { TTCN_Location current_location("ConnHdlr.ttcn", 324, TTCN_Location::LOCATION_ALTSTEP, "as_Tguard_ConnHdlr"); alt_status ret_val = ALT_NO; current_location.update_lineno(325); /* ConnHdlr.ttcn, line 325 */ switch (ConnHdlr_component_g__Tguard.timeout(NULL)) { case ALT_YES: { current_location.update_lineno(326); /* ConnHdlr.ttcn, line 326 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout of T_guard"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(327); /* ConnHdlr.ttcn, line 327 */ TTCN_Runtime::stop_component(MTC_COMPREF); } case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__Tguard__ConnHdlr(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__Tguard__ConnHdlr_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_Tguard_ConnHdlr."); else block_flag = TRUE; } } Default_Base *activate_as__Tguard__ConnHdlr() { return new as__Tguard__ConnHdlr_Default(); } RANAP__PDU__Descriptions::RANAP__PDU f__bssap__expect(const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Location current_location("ConnHdlr.ttcn", 331, TTCN_Location::LOCATION_FUNCTION, "f_bssap_expect"); current_location.update_lineno(333); /* ConnHdlr.ttcn, line 333 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(334); /* ConnHdlr.ttcn, line 334 */ TIMER T("T", 5.0); current_location.update_lineno(335); /* ConnHdlr.ttcn, line 335 */ T.start(); current_location.update_lineno(336); /* ConnHdlr.ttcn, line 336 */ { tmp_13: alt_status tmp_13_alt_flag_0 = ALT_MAYBE; alt_status tmp_13_alt_flag_1 = ALT_MAYBE; alt_status tmp_13_alt_flag_2 = ALT_MAYBE; alt_status tmp_13_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_13_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(337); /* ConnHdlr.ttcn, line 337 */ tmp_13_alt_flag_0 = RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.receive(exp__rx, &(rx), any_compref, NULL, NULL, NULL); if (tmp_13_alt_flag_0 == ALT_YES) { current_location.update_lineno(338); /* ConnHdlr.ttcn, line 338 */ TTCN_Runtime::setverdict(PASS); break; } } if (tmp_13_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(340); /* ConnHdlr.ttcn, line 340 */ tmp_13_alt_flag_1 = RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.receive(RANAP__PDU__Descriptions::RANAP__PDU_template(ANY_VALUE), &(rx), any_compref, NULL, NULL, NULL); if (tmp_13_alt_flag_1 == ALT_YES) { current_location.update_lineno(341); /* ConnHdlr.ttcn, line 341 */ Misc__Helpers::f__shutdown(cs_13, 341, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Got an unexpected RANAP message on RAN_CONN port: "),rx.log(),TTCN_Logger::log_event_str(" vs exp "),exp__rx.log(),TTCN_Logger::end_event_log2str())); break; } } if (tmp_13_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(344); /* ConnHdlr.ttcn, line 344 */ tmp_13_alt_flag_2 = T.timeout(NULL); if (tmp_13_alt_flag_2 == ALT_YES) { current_location.update_lineno(345); /* ConnHdlr.ttcn, line 345 */ Misc__Helpers::f__shutdown(cs_13, 345, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for RANAP on RAN_CONN port: "),exp__rx.log(),TTCN_Logger::end_event_log2str())); break; } } if (tmp_13_default_flag == ALT_MAYBE) { tmp_13_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_13_default_flag == ALT_YES || tmp_13_default_flag == ALT_BREAK) break; else if (tmp_13_default_flag == ALT_REPEAT) goto tmp_13; } current_location.update_lineno(336); /* ConnHdlr.ttcn, line 336 */ if (tmp_13_alt_flag_0 == ALT_NO && tmp_13_alt_flag_1 == ALT_NO && tmp_13_alt_flag_2 == ALT_NO && tmp_13_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 336 and 348."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(349); /* ConnHdlr.ttcn, line 349 */ T.stop(); current_location.update_lineno(350); /* ConnHdlr.ttcn, line 350 */ return rx; } void start_f__bssap__expect(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_bssap_expect("); exp__rx.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, "ConnHdlr", "f_bssap_expect", text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__iuh2iu(const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx_shadow(exp__rx); TTCN_Location current_location("ConnHdlr.ttcn", 354, TTCN_Location::LOCATION_FUNCTION, "f_iuh2iu"); current_location.update_lineno(356); /* ConnHdlr.ttcn, line 356 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(357); /* ConnHdlr.ttcn, line 357 */ TIMER T("T", 5.0); current_location.update_lineno(359); /* ConnHdlr.ttcn, line 359 */ if (exp__rx_shadow.get_istemplate_kind((const char*)cs_14)) { current_location.update_lineno(360); /* ConnHdlr.ttcn, line 360 */ exp__rx_shadow = tx; } current_location.update_lineno(363); /* ConnHdlr.ttcn, line 363 */ RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tx, FALSE, NULL); current_location.update_lineno(365); /* ConnHdlr.ttcn, line 365 */ RANAP__PDU__Descriptions::RANAP__PDU_template tmp_15; tmp_15 = exp__rx_shadow; tmp_15.check_restriction(TR_PRESENT); return f__bssap__expect(tmp_15); } void start_f__iuh2iu(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.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, "ConnHdlr", "f_iuh2iu", text_buf); tx.encode_text(text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__iu2iuh(const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx_shadow(exp__rx); TTCN_Location current_location("ConnHdlr.ttcn", 369, TTCN_Location::LOCATION_FUNCTION, "f_iu2iuh"); current_location.update_lineno(371); /* ConnHdlr.ttcn, line 371 */ if (exp__rx_shadow.get_istemplate_kind((const char*)cs_14)) { current_location.update_lineno(372); /* ConnHdlr.ttcn, line 372 */ exp__rx_shadow = tx; } current_location.update_lineno(375); /* ConnHdlr.ttcn, line 375 */ RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.send(tx, FALSE, NULL); current_location.update_lineno(377); /* ConnHdlr.ttcn, line 377 */ RANAP__PDU__Descriptions::RANAP__PDU_template tmp_17; tmp_17 = exp__rx_shadow; tmp_17.check_restriction(TR_PRESENT); return f__rua__expect(tmp_17); } void start_f__iu2iuh(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iu2iuh("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.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, "ConnHdlr", "f_iu2iuh", text_buf); tx.encode_text(text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__rua__expect(const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Location current_location("ConnHdlr.ttcn", 381, TTCN_Location::LOCATION_FUNCTION, "f_rua_expect"); current_location.update_lineno(383); /* ConnHdlr.ttcn, line 383 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(384); /* ConnHdlr.ttcn, line 384 */ TIMER T("T", 5.0); current_location.update_lineno(385); /* ConnHdlr.ttcn, line 385 */ T.start(); current_location.update_lineno(386); /* ConnHdlr.ttcn, line 386 */ { tmp_18: alt_status tmp_18_alt_flag_0 = ALT_MAYBE; alt_status tmp_18_alt_flag_1 = ALT_MAYBE; alt_status tmp_18_alt_flag_2 = ALT_MAYBE; alt_status tmp_18_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_18_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(387); /* ConnHdlr.ttcn, line 387 */ tmp_18_alt_flag_0 = RUA__Emulation::RUA__ConnHdlr_component_RUA.receive(exp__rx, &(rx), any_compref, NULL, NULL, NULL); if (tmp_18_alt_flag_0 == ALT_YES) { current_location.update_lineno(388); /* ConnHdlr.ttcn, line 388 */ TTCN_Runtime::setverdict(PASS); break; } } if (tmp_18_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(390); /* ConnHdlr.ttcn, line 390 */ tmp_18_alt_flag_1 = RUA__Emulation::RUA__ConnHdlr_component_RUA.receive(RANAP__PDU__Descriptions::RANAP__PDU_template(ANY_VALUE), &(rx), any_compref, NULL, NULL, NULL); if (tmp_18_alt_flag_1 == ALT_YES) { current_location.update_lineno(391); /* ConnHdlr.ttcn, line 391 */ Misc__Helpers::f__shutdown(cs_13, 391, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Got an unexpected RUA message: "),rx.log(),TTCN_Logger::log_event_str(" vs exp "),exp__rx.log(),TTCN_Logger::end_event_log2str())); break; } } if (tmp_18_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(394); /* ConnHdlr.ttcn, line 394 */ tmp_18_alt_flag_2 = T.timeout(NULL); if (tmp_18_alt_flag_2 == ALT_YES) { current_location.update_lineno(395); /* ConnHdlr.ttcn, line 395 */ Misc__Helpers::f__shutdown(cs_13, 395, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for Iuh "),exp__rx.log(),TTCN_Logger::end_event_log2str())); break; } } if (tmp_18_default_flag == ALT_MAYBE) { tmp_18_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_18_default_flag == ALT_YES || tmp_18_default_flag == ALT_BREAK) break; else if (tmp_18_default_flag == ALT_REPEAT) goto tmp_18; } current_location.update_lineno(386); /* ConnHdlr.ttcn, line 386 */ if (tmp_18_alt_flag_0 == ALT_NO && tmp_18_alt_flag_1 == ALT_NO && tmp_18_alt_flag_2 == ALT_NO && tmp_18_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 386 and 398."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(399); /* ConnHdlr.ttcn, line 399 */ T.stop(); current_location.update_lineno(400); /* ConnHdlr.ttcn, line 400 */ return rx; } void start_f__rua__expect(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rua_expect("); exp__rx.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, "ConnHdlr", "f_rua_expect", text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__iuh2iu__connect(const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx_shadow(exp__rx); TTCN_Location current_location("ConnHdlr.ttcn", 404, TTCN_Location::LOCATION_FUNCTION, "f_iuh2iu_connect"); current_location.update_lineno(406); /* ConnHdlr.ttcn, line 406 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(407); /* ConnHdlr.ttcn, line 407 */ TIMER T("T", 5.0); current_location.update_lineno(409); /* ConnHdlr.ttcn, line 409 */ if (exp__rx_shadow.get_istemplate_kind((const char*)cs_14)) { current_location.update_lineno(410); /* ConnHdlr.ttcn, line 410 */ exp__rx_shadow = tx; } current_location.update_lineno(414); /* ConnHdlr.ttcn, line 414 */ if (const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).expect__separate__sccp__cr()) { current_location.update_lineno(415); /* ConnHdlr.ttcn, line 415 */ RAN__Emulation::f__ran__register__sccp__cr__without__payload(); } else { current_location.update_lineno(417); /* ConnHdlr.ttcn, line 417 */ OCTETSTRING_template nas(RANAP__Templates::f__ranap__extract__l3(tx.valueof())); current_location.update_lineno(418); /* ConnHdlr.ttcn, line 418 */ RAN__Emulation::f__ran__register__exp(nas.valueof()); } current_location.update_lineno(422); /* ConnHdlr.ttcn, line 422 */ { RUA__Emulation::RUA__Conn__Req_template tmp_20; tmp_20.ps__domain() = const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).ps__domain(); tmp_20.ranap() = tx; RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tmp_20, FALSE, NULL); } current_location.update_lineno(424); /* ConnHdlr.ttcn, line 424 */ if (const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).expect__separate__sccp__cr()) { current_location.update_lineno(426); /* ConnHdlr.ttcn, line 426 */ { tmp_21: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.receive(RAN__Emulation::tr__RANAP__Conn__Ind(RAN__Emulation::tr__RANAP__Conn__Ind_peer_defval, RAN__Emulation::tr__RANAP__Conn__Ind_own_defval, RAN__Emulation::tr__RANAP__Conn__Ind_ranap_defval), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(first_run); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_21; } current_location.update_lineno(426); /* ConnHdlr.ttcn, line 426 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file ConnHdlr.ttcn, line 426."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } current_location.update_lineno(430); /* ConnHdlr.ttcn, line 430 */ RANAP__PDU__Descriptions::RANAP__PDU_template tmp_22; tmp_22 = exp__rx_shadow; tmp_22.check_restriction(TR_PRESENT); return f__bssap__expect(tmp_22); } void start_f__iuh2iu__connect(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu_connect("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.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, "ConnHdlr", "f_iuh2iu_connect", text_buf); tx.encode_text(text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__iuh2iu__disconnect(const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RUA__IEs::Cause& cause, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx_shadow(exp__rx); TTCN_Location current_location("ConnHdlr.ttcn", 447, TTCN_Location::LOCATION_FUNCTION, "f_iuh2iu_disconnect"); current_location.update_lineno(450); /* ConnHdlr.ttcn, line 450 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(451); /* ConnHdlr.ttcn, line 451 */ TIMER T("T", (int2float(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).hnbgw__timer__x31()) + 1.0)); current_location.update_lineno(453); /* ConnHdlr.ttcn, line 453 */ if (exp__rx_shadow.get_istemplate_kind((const char*)cs_14)) { current_location.update_lineno(454); /* ConnHdlr.ttcn, line 454 */ exp__rx_shadow = tx; } current_location.update_lineno(458); /* ConnHdlr.ttcn, line 458 */ { RUA__Emulation::RUA__Disc__Req_template tmp_24; tmp_24.cause() = cause; tmp_24.ranap() = tx; RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tmp_24, FALSE, NULL); } current_location.update_lineno(461); /* ConnHdlr.ttcn, line 461 */ RANAP__PDU__Descriptions::RANAP__PDU_template tmp_26; tmp_26 = exp__rx_shadow; tmp_26.check_restriction(TR_PRESENT); rx = f__bssap__expect(tmp_26); current_location.update_lineno(462); /* ConnHdlr.ttcn, line 462 */ return rx; } void start_f__iuh2iu__disconnect(const COMPONENT& component_reference, const RANAP__PDU__Descriptions::RANAP__PDU_template& tx, const RUA__IEs::Cause& cause, const RANAP__PDU__Descriptions::RANAP__PDU_template& exp__rx) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu_disconnect("); tx.log(); TTCN_Logger::log_event_str(", "); cause.log(); TTCN_Logger::log_event_str(", "); exp__rx.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, "ConnHdlr", "f_iuh2iu_disconnect", text_buf); tx.encode_text(text_buf); cause.encode_text(text_buf); exp__rx.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } RANAP__PDU__Descriptions::RANAP__PDU f__build__initial__ue__with__nas(const TestHdlrParams& pars, const OCTETSTRING& nas) { TTCN_Location current_location("ConnHdlr.ttcn", 465, TTCN_Location::LOCATION_FUNCTION, "f_build_initial_ue_with_nas"); current_location.update_lineno(467); /* ConnHdlr.ttcn, line 467 */ RANAP__IEs::LAI lai; lai.pLMNidentity() = hex2oct(const_cast< const TestHdlrParams&>(pars).hnb()().lai().mcc__mnc()); lai.lAC() = int2oct(const_cast< const TestHdlrParams&>(pars).hnb()().lai().lac(), 2); lai.iE__Extensions() = OMIT_VALUE; current_location.update_lineno(472); /* ConnHdlr.ttcn, line 472 */ RANAP__IEs::SAI sai; sai.pLMNidentity() = const_cast< const RANAP__IEs::LAI&>(lai).pLMNidentity(); sai.lAC() = const_cast< const RANAP__IEs::LAI&>(lai).lAC(); sai.sAC() = int2oct(const_cast< const TestHdlrParams&>(pars).hnb()().sac(), 2); sai.iE__Extensions() = OMIT_VALUE; current_location.update_lineno(478); /* ConnHdlr.ttcn, line 478 */ RANAP__IEs::GlobalRNC__ID grnc__id; grnc__id.pLMNidentity() = const_cast< const RANAP__IEs::LAI&>(lai).pLMNidentity(); grnc__id.rNC__ID() = 2342; current_location.update_lineno(482); /* ConnHdlr.ttcn, line 482 */ RANAP__PDU__Descriptions::RANAP__PDU_template ret; current_location.update_lineno(483); /* ConnHdlr.ttcn, line 483 */ if (const_cast< const TestHdlrParams&>(pars).ps__domain()) { current_location.update_lineno(484); /* ConnHdlr.ttcn, line 484 */ OCTETSTRING rac(int2oct(const_cast< const TestHdlrParams&>(pars).hnb()().rac(), 1)); current_location.update_lineno(485); /* ConnHdlr.ttcn, line 485 */ ret = RANAP__Templates::ts__RANAP__initialUE__PS(RANAP__IEs::LAI_template(lai), OCTETSTRING_template(rac), RANAP__IEs::SAI_template(sai), OCTETSTRING_template(nas), BITSTRING_template(const_cast< const TestHdlrParams&>(pars).sigc__id()), RANAP__IEs::GlobalRNC__ID_template(grnc__id), RANAP__Templates::ts__RANAP__initialUE__PS_exts_defval); } else { current_location.update_lineno(487); /* ConnHdlr.ttcn, line 487 */ ret = RANAP__Templates::ts__RANAP__initialUE__CS(RANAP__IEs::LAI_template(lai), RANAP__IEs::SAI_template(sai), OCTETSTRING_template(nas), BITSTRING_template(const_cast< const TestHdlrParams&>(pars).sigc__id()), RANAP__IEs::GlobalRNC__ID_template(grnc__id), RANAP__Templates::ts__RANAP__initialUE__CS_exts_defval); } current_location.update_lineno(489); /* ConnHdlr.ttcn, line 489 */ return ret.valueof(); } RANAP__PDU__Descriptions::RANAP__PDU f__build__initial__ue(const TestHdlrParams& pars) { TTCN_Location current_location("ConnHdlr.ttcn", 493, TTCN_Location::LOCATION_FUNCTION, "f_build_initial_ue"); current_location.update_lineno(495); /* ConnHdlr.ttcn, line 495 */ OCTETSTRING nas; current_location.update_lineno(497); /* ConnHdlr.ttcn, line 497 */ if ((const_cast< const TestHdlrParams&>(pars).tx__sccp__cr__data__len() == 0)) { current_location.update_lineno(498); /* ConnHdlr.ttcn, line 498 */ OCTETSTRING tmsi(Osmocom__Types::f__gen__tmsi(0, Osmocom__Types::f__gen__tmsi_nri__v_defval, Osmocom__Types::f__gen__tmsi_nri__bitlen_defval, Osmocom__Types::f__gen__tmsi_base__tmsi_defval)); current_location.update_lineno(499); /* ConnHdlr.ttcn, line 499 */ MobileL3__CommonIE__Types::MobileIdentityLV mi__lv(L3__Templates::ts__MI__IMSI__LV(const_cast< const TestHdlrParams&>(pars).imsi()).valueof()); current_location.update_lineno(500); /* ConnHdlr.ttcn, line 500 */ if (const_cast< const TestHdlrParams&>(pars).ps__domain()) { current_location.update_lineno(501); /* ConnHdlr.ttcn, line 501 */ MobileL3__Types::PDU__L3__MS__SGSN l3__pdu; current_location.update_lineno(502); /* ConnHdlr.ttcn, line 502 */ l3__pdu = L3__Templates::ts__GMM__ATTACH__REQ(mi__lv, L3__Common::f__RAI(hs_2, hs_3, os_5, os_6), L3__Templates::ts__GMM__ATTACH__REQ_combined_defval, L3__Templates::ts__GMM__ATTACH__REQ_follow__on__pending_defval, L3__Templates::ts__GMM__ATTACH__REQ_cm2__tlv_defval, L3__Templates::ts__GMM__ATTACH__REQ_cm3__tlv_defval, L3__Templates::ts__GMM__ATTACH__REQ_nri_defval, L3__Templates::ts__GMM__ATTACH__REQ_p__tmsi__sig_defval, L3__Templates::ts__GMM__ATTACH__REQ_p__tmsi__type_defval, L3__Templates::ts__GMM__ATTACH__REQ_add__p__tmsi_defval, L3__Templates::ts__GMM__ATTACH__REQ_add__rai_defval).valueof(); current_location.update_lineno(503); /* ConnHdlr.ttcn, line 503 */ nas = MobileL3__Types::enc__PDU__L3__MS__SGSN(l3__pdu); } else { current_location.update_lineno(505); /* ConnHdlr.ttcn, line 505 */ MobileL3__Types::PDU__ML3__MS__NW l3__pdu; current_location.update_lineno(506); /* ConnHdlr.ttcn, line 506 */ l3__pdu = L3__Templates::ts__LU__REQ(L3__Templates::LU__Type__IMSI__Attach, MobileL3__CommonIE__Types::MobileIdentityLV_template(mi__lv), OCTETSTRING_template(os_7)).valueof(); current_location.update_lineno(507); /* ConnHdlr.ttcn, line 507 */ nas = MobileL3__Types::enc__PDU__ML3__MS__NW(l3__pdu); } } else { current_location.update_lineno(514); /* ConnHdlr.ttcn, line 514 */ RANAP__PDU__Descriptions::RANAP__PDU initial__ue(f__build__initial__ue__with__nas(pars, os_8)); current_location.update_lineno(516); /* ConnHdlr.ttcn, line 516 */ OCTETSTRING ranap__plus__one__byte__nas(RANAP__Types::enc__RANAP__PDU(initial__ue)); current_location.update_lineno(517); /* ConnHdlr.ttcn, line 517 */ INTEGER ranap__length((ranap__plus__one__byte__nas.lengthof() - 1)); current_location.update_lineno(519); /* ConnHdlr.ttcn, line 519 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("ranap_plus_one_byte_nas = "); { INTEGER tmp_33(ranap__plus__one__byte__nas.lengthof()); tmp_33.log(); } TTCN_Logger::log_event_str(" bytes, "); initial__ue.log(); TTCN_Logger::log_event_str(" = "); ranap__plus__one__byte__nas.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(521); /* ConnHdlr.ttcn, line 521 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("ranap_length = "); ranap__length.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(526); /* ConnHdlr.ttcn, line 526 */ nas = Osmocom__Types::f__rnd__octstring((const_cast< const TestHdlrParams&>(pars).tx__sccp__cr__data__len() - ranap__length)); } current_location.update_lineno(529); /* ConnHdlr.ttcn, line 529 */ RANAP__PDU__Descriptions::RANAP__PDU ret(f__build__initial__ue__with__nas(pars, nas)); current_location.update_lineno(531); /* ConnHdlr.ttcn, line 531 */ if ((const_cast< const TestHdlrParams&>(pars).tx__sccp__cr__data__len() != 0)) { { current_location.update_lineno(532); /* ConnHdlr.ttcn, line 532 */ INTEGER attempts(0); current_location.update_lineno(532); /* ConnHdlr.ttcn, line 532 */ for ( ; ; ) { current_location.update_lineno(532); /* ConnHdlr.ttcn, line 532 */ if (!(attempts < 2)) break; current_location.update_lineno(533); /* ConnHdlr.ttcn, line 533 */ OCTETSTRING check__len(RANAP__Types::enc__RANAP__PDU(ret)); current_location.update_lineno(534); /* ConnHdlr.ttcn, line 534 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("final RANAP PDU length = "); { INTEGER tmp_35(check__len.lengthof()); tmp_35.log(); } TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(535); /* ConnHdlr.ttcn, line 535 */ if ((check__len.lengthof() == const_cast< const TestHdlrParams&>(pars).tx__sccp__cr__data__len())) { current_location.update_lineno(536); /* ConnHdlr.ttcn, line 536 */ return ret; } current_location.update_lineno(538); /* ConnHdlr.ttcn, line 538 */ nas = Osmocom__Types::f__rnd__octstring((nas.lengthof() + (const_cast< const TestHdlrParams&>(pars).tx__sccp__cr__data__len() - check__len.lengthof()))); current_location.update_lineno(539); /* ConnHdlr.ttcn, line 539 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("that was off, changed NAS length to "); { INTEGER tmp_37(nas.lengthof()); tmp_37.log(); } TTCN_Logger::log_event_str(" and trying again"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(540); /* ConnHdlr.ttcn, line 540 */ ret = f__build__initial__ue__with__nas(pars, nas); current_location.update_lineno(532); /* ConnHdlr.ttcn, line 532 */ { INTEGER tmp_39; ++attempts; } } } current_location.update_lineno(542); /* ConnHdlr.ttcn, line 542 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Ended up with wrong Optional Data length"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(543); /* ConnHdlr.ttcn, line 543 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(545); /* ConnHdlr.ttcn, line 545 */ return ret; } RANAP__PDU__Descriptions::RANAP__PDU f__build__rab__ass__resp(const TestHdlrParams& ) { TTCN_Location current_location("ConnHdlr.ttcn", 549, TTCN_Location::LOCATION_FUNCTION, "f_build_rab_ass_resp"); current_location.update_lineno(550); /* ConnHdlr.ttcn, line 550 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template rab__sml; current_location.update_lineno(552); /* ConnHdlr.ttcn, line 552 */ rab__sml = RANAP__Templates::ts__RAB__SMdL(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(cs_15), RANAP__Templates::t__RAB__binding__port(1234)); current_location.update_lineno(554); /* ConnHdlr.ttcn, line 554 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_41; tmp_41 = rab__sml; tmp_41.check_restriction(TR_OMIT); return RANAP__Templates::ts__RANAP__RabAssResp(tmp_41, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } void f__cn__iu__release__procedure(const BOOLEAN& mgcp__teardown, const BOOLEAN& pfcp__teardown) { TTCN_Location current_location("ConnHdlr.ttcn", 558, TTCN_Location::LOCATION_FUNCTION, "f_cn_iu_release_procedure"); current_location.update_lineno(559); /* ConnHdlr.ttcn, line 559 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(560); /* ConnHdlr.ttcn, line 560 */ TIMER T("T"); current_location.update_lineno(562); /* ConnHdlr.ttcn, line 562 */ tx = RANAP__Templates::ts__RANAP__IuReleaseCommand(RANAP__IEs::Cause_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).rab__rel__cause()), RANAP__Templates::ts__RANAP__IuReleaseCommand_exts_defval).valueof(); current_location.update_lineno(563); /* ConnHdlr.ttcn, line 563 */ f__iu2iuh(RANAP__PDU__Descriptions::RANAP__PDU_template(tx), f__iu2iuh_exp__rx_defval); current_location.update_lineno(565); /* ConnHdlr.ttcn, line 565 */ if (mgcp__teardown) { current_location.update_lineno(566); /* ConnHdlr.ttcn, line 566 */ T.start(5.0); current_location.update_lineno(567); /* ConnHdlr.ttcn, line 567 */ { tmp_43: alt_status tmp_43_alt_flag_0 = ALT_MAYBE; alt_status tmp_43_alt_flag_1 = ALT_MAYBE; alt_status tmp_43_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_43_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(568); /* ConnHdlr.ttcn, line 568 */ tmp_43_alt_flag_0 = as__mgcp__dlcx_instance(first_run); if (tmp_43_alt_flag_0 == ALT_REPEAT) goto tmp_43; if (tmp_43_alt_flag_0 == ALT_BREAK) break; if (tmp_43_alt_flag_0 == ALT_YES) break; } if (tmp_43_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(569); /* ConnHdlr.ttcn, line 569 */ tmp_43_alt_flag_1 = T.timeout(NULL); if (tmp_43_alt_flag_1 == ALT_YES) { current_location.update_lineno(570); /* ConnHdlr.ttcn, line 570 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for DLCX"),TTCN_Logger::end_event_log2str())); break; } } if (tmp_43_default_flag == ALT_MAYBE) { tmp_43_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_43_default_flag == ALT_YES || tmp_43_default_flag == ALT_BREAK) break; else if (tmp_43_default_flag == ALT_REPEAT) goto tmp_43; } current_location.update_lineno(567); /* ConnHdlr.ttcn, line 567 */ if (tmp_43_alt_flag_0 == ALT_NO && tmp_43_alt_flag_1 == ALT_NO && tmp_43_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 567 and 572."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(573); /* ConnHdlr.ttcn, line 573 */ T.stop(); } current_location.update_lineno(575); /* ConnHdlr.ttcn, line 575 */ if (pfcp__teardown) { current_location.update_lineno(576); /* ConnHdlr.ttcn, line 576 */ T.start(5.0); current_location.update_lineno(577); /* ConnHdlr.ttcn, line 577 */ { tmp_44: alt_status tmp_44_alt_flag_0 = ALT_MAYBE; alt_status tmp_44_alt_flag_1 = ALT_MAYBE; alt_status tmp_44_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_44_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(578); /* ConnHdlr.ttcn, line 578 */ tmp_44_alt_flag_0 = as__pfcp__handle__del__req_instance(first_run); if (tmp_44_alt_flag_0 == ALT_REPEAT) goto tmp_44; if (tmp_44_alt_flag_0 == ALT_BREAK) break; if (tmp_44_alt_flag_0 == ALT_YES) break; } if (tmp_44_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(579); /* ConnHdlr.ttcn, line 579 */ tmp_44_alt_flag_1 = T.timeout(NULL); if (tmp_44_alt_flag_1 == ALT_YES) { current_location.update_lineno(580); /* ConnHdlr.ttcn, line 580 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for PFCP Del Sess Req"),TTCN_Logger::end_event_log2str())); break; } } if (tmp_44_default_flag == ALT_MAYBE) { tmp_44_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_44_default_flag == ALT_YES || tmp_44_default_flag == ALT_BREAK) break; else if (tmp_44_default_flag == ALT_REPEAT) goto tmp_44; } current_location.update_lineno(577); /* ConnHdlr.ttcn, line 577 */ if (tmp_44_alt_flag_0 == ALT_NO && tmp_44_alt_flag_1 == ALT_NO && tmp_44_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 577 and 582."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(583); /* ConnHdlr.ttcn, line 583 */ T.stop(); } current_location.update_lineno(586); /* ConnHdlr.ttcn, line 586 */ tx = RANAP__Templates::ts__RANAP__IuReleaseComplete(RANAP__Templates::ts__RANAP__IuReleaseComplete_ies_defval, RANAP__Templates::ts__RANAP__IuReleaseComplete_exts_defval).valueof(); current_location.update_lineno(587); /* ConnHdlr.ttcn, line 587 */ { RUA__IEs::Cause tmp_46; tmp_46.radioNetwork() = RUA__IEs::CauseRadioNetwork::normal; f__iuh2iu__disconnect(RANAP__PDU__Descriptions::RANAP__PDU_template(tx), tmp_46, f__iuh2iu__disconnect_exp__rx_defval); } current_location.update_lineno(590); /* ConnHdlr.ttcn, line 590 */ RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.send(RAN__Emulation::ts__MSC__CONN__PRIM__DISC__REQ(INTEGER_template(SCCP__Templates::sccp__par__reason__end__user__originated)), FALSE, NULL); current_location.update_lineno(594); /* ConnHdlr.ttcn, line 594 */ T.start(2.0); current_location.update_lineno(595); /* ConnHdlr.ttcn, line 595 */ { tmp_47: alt_status tmp_47_alt_flag_0 = ALT_MAYBE; alt_status tmp_47_alt_flag_1 = ALT_MAYBE; alt_status tmp_47_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_47_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(596); /* ConnHdlr.ttcn, line 596 */ tmp_47_alt_flag_0 = RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.receive(RAN__Emulation::tr__MSC__CONN__PRIM__DISC__IND, NULL, any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_0 == ALT_YES) { current_location.update_lineno(597); /* ConnHdlr.ttcn, line 597 */ Misc__Helpers::f__shutdown(cs_13, 597, FAIL, cs_16); break; } } if (tmp_47_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(599); /* ConnHdlr.ttcn, line 599 */ tmp_47_alt_flag_1 = T.timeout(NULL); if (tmp_47_alt_flag_1 == ALT_YES) { current_location.update_lineno(600); /* ConnHdlr.ttcn, line 600 */ TTCN_Runtime::setverdict(PASS); break; } } if (tmp_47_default_flag == ALT_MAYBE) { tmp_47_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_47_default_flag == ALT_YES || tmp_47_default_flag == ALT_BREAK) break; else if (tmp_47_default_flag == ALT_REPEAT) goto tmp_47; } current_location.update_lineno(595); /* ConnHdlr.ttcn, line 595 */ if (tmp_47_alt_flag_0 == ALT_NO && tmp_47_alt_flag_1 == ALT_NO && tmp_47_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 595 and 602."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } void start_f__cn__iu__release__procedure(const COMPONENT& component_reference, const BOOLEAN& mgcp__teardown, const BOOLEAN& pfcp__teardown) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cn_iu_release_procedure("); mgcp__teardown.log(); TTCN_Logger::log_event_str(", "); pfcp__teardown.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, "ConnHdlr", "f_cn_iu_release_procedure", text_buf); mgcp__teardown.encode_text(text_buf); pfcp__teardown.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } MGCP__Types::MgcpResponse_template f__handle__crcx(MgcpParameters& pars, const MGCP__Types::MgcpCommand& mgcp__cmd) { TTCN_Location current_location("ConnHdlr.ttcn", 608, TTCN_Location::LOCATION_FUNCTION, "f_handle_crcx"); current_location.update_lineno(609); /* ConnHdlr.ttcn, line 609 */ MgwResponse conn(const_cast< const MgcpParameters&>(pars).mgw__conn__ran()); current_location.update_lineno(610); /* ConnHdlr.ttcn, line 610 */ if ((const_cast< const MgcpParameters&>(pars).got__crcx__count() > 0)) { current_location.update_lineno(611); /* ConnHdlr.ttcn, line 611 */ conn = const_cast< const MgcpParameters&>(pars).mgw__conn__cn(); } current_location.update_lineno(613); /* ConnHdlr.ttcn, line 613 */ { INTEGER tmp_49; tmp_49 = (const_cast< const MgcpParameters&>(pars).got__crcx__count() + 1); pars.got__crcx__count() = tmp_49; } current_location.update_lineno(615); /* ConnHdlr.ttcn, line 615 */ MGCP__Types::MgcpMessage mgcp__msg; mgcp__msg.command() = mgcp__cmd; current_location.update_lineno(618); /* ConnHdlr.ttcn, line 618 */ MGCP__Types::MgcpResponse_template mgcp__resp; current_location.update_lineno(619); /* ConnHdlr.ttcn, line 619 */ INTEGER osmux__cid; current_location.update_lineno(620); /* ConnHdlr.ttcn, line 620 */ HEXSTRING call__id(MGCP__Templates::f__MgcpCmd__extract__call__id(mgcp__cmd)); current_location.update_lineno(621); /* ConnHdlr.ttcn, line 621 */ { boolean tmp_53; { boolean tmp_50 = pars.is_bound(); if(tmp_50) { const OPTIONAL< HEXSTRING >& tmp_51 = pars.mgcp__call__id(); switch (tmp_51.get_selection()) { case OPTIONAL_UNBOUND: tmp_50 = FALSE; break; case OPTIONAL_OMIT: tmp_50 = FALSE; break; default: { const HEXSTRING& tmp_52 = (const HEXSTRING&) tmp_51; tmp_50 = tmp_52.is_present(); break;} } } tmp_53 = tmp_50; } if (tmp_53) { current_location.update_lineno(622); /* ConnHdlr.ttcn, line 622 */ if ((const_cast< const MgcpParameters&>(pars).mgcp__call__id() != call__id)) { current_location.update_lineno(623); /* ConnHdlr.ttcn, line 623 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("CRCX contained unexpected call id. Expected:"),const_cast< const MgcpParameters&>(pars).mgcp__call__id().log(),TTCN_Logger::log_event_str(" got:"),call__id.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(624); /* ConnHdlr.ttcn, line 624 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } else { current_location.update_lineno(627); /* ConnHdlr.ttcn, line 627 */ pars.mgcp__call__id() = call__id; } } current_location.update_lineno(633); /* ConnHdlr.ttcn, line 633 */ if ((MGCP__Templates::t__MGCP__EP__wildcard.match(const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().ep()) == FALSE)) { current_location.update_lineno(634); /* ConnHdlr.ttcn, line 634 */ pars.mgcp__ep() = const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().ep(); } current_location.update_lineno(637); /* ConnHdlr.ttcn, line 637 */ if ((const_cast< const MgwResponse&>(conn).resp() == -1)) { current_location.update_lineno(639); /* ConnHdlr.ttcn, line 639 */ MGCP__Types::MgcpResponse mgcp__rsp; { MGCP__Types::MgcpResponseLine& tmp_56 = mgcp__rsp.line(); tmp_56.code() = cs_17; tmp_56.trans__id() = const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().trans__id(); tmp_56.string() = cs_18; } mgcp__rsp.sdp() = OMIT_VALUE; current_location.update_lineno(648); /* ConnHdlr.ttcn, line 648 */ MGCP__Types::MgcpParameter mgcp__rsp__param; mgcp__rsp__param.code() = cs_19; mgcp__rsp__param.val() = const_cast< const MgcpParameters&>(pars).mgcp__ep(); current_location.update_lineno(652); /* ConnHdlr.ttcn, line 652 */ mgcp__rsp.params()()[0] = mgcp__rsp__param; current_location.update_lineno(653); /* ConnHdlr.ttcn, line 653 */ return MGCP__Types::MgcpResponse_template(mgcp__rsp); } current_location.update_lineno(656); /* ConnHdlr.ttcn, line 656 */ if ((const_cast< const MgwResponse&>(conn).resp() == 0)) { current_location.update_lineno(658); /* ConnHdlr.ttcn, line 658 */ return MGCP__Types::MgcpResponse_template(OMIT_VALUE); } current_location.update_lineno(661); /* ConnHdlr.ttcn, line 661 */ if ((const_cast< const MgwResponse&>(conn).resp() != 1)) { current_location.update_lineno(662); /* ConnHdlr.ttcn, line 662 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected value for pars.mgw_conn_*.resp, expect -1, 0 or 1"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(663); /* ConnHdlr.ttcn, line 663 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(666); /* ConnHdlr.ttcn, line 666 */ SDP__Types::SDP__Message sdp; { SDP__Types::SDP__fmt__list tmp_58; tmp_58.set_size(1); tmp_58[0] = int2str(const_cast< const MgcpParameters&>(pars).rtp__payload__type()); SDP__Types::SDP__attribute__list tmp_59; tmp_59.set_size(2); tmp_59[0] = SDP__Templates::ts__SDP__rtpmap(const_cast< const MgcpParameters&>(pars).rtp__payload__type(), const_cast< const MgcpParameters&>(pars).rtp__sdp__format()).valueof(); tmp_59[1] = SDP__Templates::ts__SDP__ptime(20).valueof(); sdp = SDP__Templates::ts__SDP(const_cast< const MgwResponse&>(conn).mgw__rtp__ip(), const_cast< const MgwResponse&>(conn).mgw__rtp__ip(), hex2str(const_cast< const MgcpParameters&>(pars).mgcp__call__id()()), cs_20, const_cast< const MgwResponse&>(conn).mgw__rtp__port(), tmp_58, tmp_59).valueof(); } current_location.update_lineno(674); /* ConnHdlr.ttcn, line 674 */ if (MGCP__Templates::f__mgcp__contains__par(mgcp__msg, cs_21)) { current_location.update_lineno(675); /* ConnHdlr.ttcn, line 675 */ if ((!(const_cast< const MgcpParameters&>(pars).use__osmux()))) { current_location.update_lineno(676); /* ConnHdlr.ttcn, line 676 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("MSC sent X-Osmux parameter in MGCP, but not expecting any Osmux"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(677); /* ConnHdlr.ttcn, line 677 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(679); /* ConnHdlr.ttcn, line 679 */ { INTEGER tmp_60; tmp_60 = (const_cast< const MgcpParameters&>(pars).got__osmux__count() + 1); pars.got__osmux__count() = tmp_60; } current_location.update_lineno(681); /* ConnHdlr.ttcn, line 681 */ osmux__cid = MGCP__Templates::f__MgcpCmd__extract__osmux__cid(mgcp__cmd); current_location.update_lineno(682); /* ConnHdlr.ttcn, line 682 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("f_handle_crcx(): got Osmux CID: "); osmux__cid.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(683); /* ConnHdlr.ttcn, line 683 */ if ((osmux__cid != -1)) { current_location.update_lineno(684); /* ConnHdlr.ttcn, line 684 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),((cs_22 + int2str(osmux__cid)) + cs_23).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(685); /* ConnHdlr.ttcn, line 685 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(688); /* ConnHdlr.ttcn, line 688 */ osmux__cid = 0; current_location.update_lineno(689); /* ConnHdlr.ttcn, line 689 */ mgcp__resp = MGCP__Templates::ts__CRCX__ACK__osmux(const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().trans__id(), const_cast< const MgwResponse&>(conn).mgcp__connection__id(), osmux__cid, SDP__Types::SDP__Message_template(sdp)); } else { current_location.update_lineno(691); /* ConnHdlr.ttcn, line 691 */ mgcp__resp = MGCP__Templates::ts__CRCX__ACK(const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().trans__id(), const_cast< const MgwResponse&>(conn).mgcp__connection__id(), SDP__Types::SDP__Message_template(sdp)); } current_location.update_lineno(694); /* ConnHdlr.ttcn, line 694 */ MGCP__Templates::f__mgcp__par__append(mgcp__resp.params(), MGCP__Templates::ts__MgcpParSpecEP(const_cast< const MgcpParameters&>(pars).mgcp__ep())); current_location.update_lineno(696); /* ConnHdlr.ttcn, line 696 */ return mgcp__resp; } void f__rab__ass__req__cs() { TTCN_Location current_location("ConnHdlr.ttcn", 699, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_req_cs"); current_location.update_lineno(700); /* ConnHdlr.ttcn, line 700 */ MGCP__Types::MgcpCommand mgcp__cmd; current_location.update_lineno(701); /* ConnHdlr.ttcn, line 701 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(702); /* ConnHdlr.ttcn, line 702 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template rab__sml; current_location.update_lineno(703); /* ConnHdlr.ttcn, line 703 */ TIMER T("T", 5.0); current_location.update_lineno(710); /* ConnHdlr.ttcn, line 710 */ Mutex::f__Mutex__lock(cs_13, 710, Mutex::f__Mutex__lock_Tval_defval); current_location.update_lineno(712); /* ConnHdlr.ttcn, line 712 */ { MGCP__Emulation::ExpectCriteria tmp_65; tmp_65.connid() = OMIT_VALUE; tmp_65.endpoint() = OMIT_VALUE; tmp_65.transid() = OMIT_VALUE; MGCP__Emulation::f__create__mgcp__expect(tmp_65); } current_location.update_lineno(715); /* ConnHdlr.ttcn, line 715 */ rab__sml = RANAP__Templates::ts__RAB__SML(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().cn__rtp__ip()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().cn__rtp__port())); current_location.update_lineno(716); /* ConnHdlr.ttcn, line 716 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_68; tmp_68 = rab__sml; tmp_68.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_68, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(717); /* ConnHdlr.ttcn, line 717 */ RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.send(tx, FALSE, NULL); current_location.update_lineno(718); /* ConnHdlr.ttcn, line 718 */ T.start(); current_location.update_lineno(721); /* ConnHdlr.ttcn, line 721 */ { tmp_69: alt_status tmp_69_alt_flag_0 = ALT_MAYBE; alt_status tmp_69_alt_flag_1 = ALT_MAYBE; alt_status tmp_69_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_69_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(722); /* ConnHdlr.ttcn, line 722 */ tmp_69_alt_flag_0 = MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.receive(MGCP__Templates::tr__CRCX(MGCP__Templates::tr__CRCX_ep_defval, MGCP__Templates::tr__CRCX_sdp_defval), &(mgcp__cmd), any_compref, NULL, NULL, NULL); if (tmp_69_alt_flag_0 == ALT_YES) { current_location.update_lineno(723); /* ConnHdlr.ttcn, line 723 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("CRCX1"); mgcp__cmd.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(726); /* ConnHdlr.ttcn, line 726 */ Mutex::f__Mutex__unlock(cs_13, 726); current_location.update_lineno(727); /* ConnHdlr.ttcn, line 727 */ MGCP__Types::MgcpResponse_template mgcp__rsp(f__handle__crcx(ConnHdlr_component_g__pars.mgcp__pars(), mgcp__cmd)); current_location.update_lineno(728); /* ConnHdlr.ttcn, line 728 */ MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.send(mgcp__rsp.valueof(), FALSE, NULL); break; } } if (tmp_69_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(730); /* ConnHdlr.ttcn, line 730 */ tmp_69_alt_flag_1 = T.timeout(NULL); if (tmp_69_alt_flag_1 == ALT_YES) { current_location.update_lineno(732); /* ConnHdlr.ttcn, line 732 */ Misc__Helpers::f__shutdown(cs_13, 732, FAIL, cs_24); break; } } if (tmp_69_default_flag == ALT_MAYBE) { tmp_69_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_69_default_flag == ALT_YES || tmp_69_default_flag == ALT_BREAK) break; else if (tmp_69_default_flag == ALT_REPEAT) goto tmp_69; } current_location.update_lineno(721); /* ConnHdlr.ttcn, line 721 */ if (tmp_69_alt_flag_0 == ALT_NO && tmp_69_alt_flag_1 == ALT_NO && tmp_69_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 721 and 734."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(735); /* ConnHdlr.ttcn, line 735 */ T.stop(); current_location.update_lineno(738); /* ConnHdlr.ttcn, line 738 */ rab__sml = RANAP__Templates::ts__RAB__SML(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__port())); current_location.update_lineno(739); /* ConnHdlr.ttcn, line 739 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_72; tmp_72 = rab__sml; tmp_72.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_72, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(741); /* ConnHdlr.ttcn, line 741 */ f__rua__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(tx)); } void start_f__rab__ass__req__cs(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_req_cs("); 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, "ConnHdlr", "f_rab_ass_req_cs", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rab__ass__resp__cs() { TTCN_Location current_location("ConnHdlr.ttcn", 744, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_resp_cs"); current_location.update_lineno(745); /* ConnHdlr.ttcn, line 745 */ MGCP__Types::MgcpCommand mgcp__cmd; current_location.update_lineno(746); /* ConnHdlr.ttcn, line 746 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(747); /* ConnHdlr.ttcn, line 747 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template rab__smdl; current_location.update_lineno(750); /* ConnHdlr.ttcn, line 750 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__ip()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__port())); current_location.update_lineno(751); /* ConnHdlr.ttcn, line 751 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_75; tmp_75 = rab__smdl; tmp_75.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssResp(tmp_75, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } current_location.update_lineno(752); /* ConnHdlr.ttcn, line 752 */ RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tx, FALSE, NULL); current_location.update_lineno(754); /* ConnHdlr.ttcn, line 754 */ { size_t tmp_76_state[2]; tmp_76_state[0]=2; tmp_76_state[1]=2; alt_status tmp_76_alt_flag[3]; tmp_76: for(size_t tmp_i=0; tmp_i<2; tmp_i++) tmp_76_alt_flag[tmp_i]=ALT_UNCHECKED; tmp_76_alt_flag[2]=ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for( ; ; ) { if(tmp_76_state[0]==1 && tmp_76_state[1]==1) break; current_location.update_lineno(756); /* ConnHdlr.ttcn, line 756 */ if(tmp_76_alt_flag[0]==ALT_UNCHECKED) { if(tmp_76_state[0]==2) { tmp_76_alt_flag[0]=ALT_MAYBE; } else tmp_76_alt_flag[0]=ALT_NO; } if(tmp_76_alt_flag[0]==ALT_MAYBE) { tmp_76_alt_flag[0]=MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.receive(MGCP__Templates::tr__MDCX(SDP__Templates::tr__SDP(CHARSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__ip()), INTEGER_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__port()))), &(mgcp__cmd), any_compref, NULL, NULL, NULL); if(tmp_76_alt_flag[0]==ALT_YES) { current_location.update_lineno(757); /* ConnHdlr.ttcn, line 757 */ CHARSTRING mgw__rtp__ip; current_location.update_lineno(758); /* ConnHdlr.ttcn, line 758 */ BOOLEAN exp__rua__rab__reass(FALSE); current_location.update_lineno(759); /* ConnHdlr.ttcn, line 759 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("MDCX1"); mgcp__cmd.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(760); /* ConnHdlr.ttcn, line 760 */ { boolean tmp_84; { boolean tmp_77 = ConnHdlr_component_g__pars.is_bound(); if(tmp_77) { const TestHdlrParams& tmp_78 = ConnHdlr_component_g__pars; const MgcpParameters& tmp_79 = tmp_78.mgcp__pars(); tmp_77 = tmp_79.is_bound(); if(tmp_77) { const MgcpParameters& tmp_80 = tmp_79; const MgwResponse& tmp_81 = tmp_80.mgw__conn__ran(); tmp_77 = tmp_81.is_bound(); if(tmp_77) { const OPTIONAL< CHARSTRING >& tmp_82 = tmp_81.mgw__rtp__ip__mdcx(); switch (tmp_82.get_selection()) { case OPTIONAL_UNBOUND: tmp_77 = FALSE; break; case OPTIONAL_OMIT: tmp_77 = FALSE; break; default: { const CHARSTRING& tmp_83 = (const CHARSTRING&) tmp_82; tmp_77 = tmp_83.is_present(); break;} } } } } tmp_84 = tmp_77; } if (tmp_84) { current_location.update_lineno(761); /* ConnHdlr.ttcn, line 761 */ mgw__rtp__ip = const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip__mdcx(); current_location.update_lineno(762); /* ConnHdlr.ttcn, line 762 */ if ((const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip() != const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip__mdcx())) { current_location.update_lineno(763); /* ConnHdlr.ttcn, line 763 */ exp__rua__rab__reass = TRUE; } } else { current_location.update_lineno(766); /* ConnHdlr.ttcn, line 766 */ mgw__rtp__ip = const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip(); } } current_location.update_lineno(770); /* ConnHdlr.ttcn, line 770 */ SDP__Types::SDP__Message sdp; { SDP__Types::SDP__fmt__list tmp_88; tmp_88.set_size(1); tmp_88[0] = int2str(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().rtp__payload__type()); SDP__Types::SDP__attribute__list tmp_89; tmp_89.set_size(2); tmp_89[0] = SDP__Templates::ts__SDP__rtpmap(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().rtp__payload__type(), const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().rtp__sdp__format()).valueof(); tmp_89[1] = SDP__Templates::ts__SDP__ptime(20).valueof(); sdp = SDP__Templates::ts__SDP(mgw__rtp__ip, mgw__rtp__ip, hex2str(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgcp__call__id()()), cs_20, const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__port(), tmp_88, tmp_89).valueof(); } current_location.update_lineno(772); /* ConnHdlr.ttcn, line 772 */ MGCP__Types::MgcpResponse_template mgcp__rsp(MGCP__Templates::ts__MDCX__ACK(const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().trans__id(), const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgcp__connection__id(), SDP__Types::SDP__Message_template(sdp))); current_location.update_lineno(773); /* ConnHdlr.ttcn, line 773 */ MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.send(mgcp__rsp.valueof(), FALSE, NULL); current_location.update_lineno(776); /* ConnHdlr.ttcn, line 776 */ if (exp__rua__rab__reass) { current_location.update_lineno(777); /* ConnHdlr.ttcn, line 777 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template rab__sml; current_location.update_lineno(779); /* ConnHdlr.ttcn, line 779 */ rab__sml = RANAP__Templates::ts__RAB__SML(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__ip__mdcx()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__ran().mgw__rtp__port())); current_location.update_lineno(780); /* ConnHdlr.ttcn, line 780 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_92; tmp_92 = rab__sml; tmp_92.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_92, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(782); /* ConnHdlr.ttcn, line 782 */ f__rua__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(tx)); current_location.update_lineno(784); /* ConnHdlr.ttcn, line 784 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__ip()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().hnb__rtp__port())); current_location.update_lineno(785); /* ConnHdlr.ttcn, line 785 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_95; tmp_95 = rab__smdl; tmp_95.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssResp(tmp_95, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } current_location.update_lineno(786); /* ConnHdlr.ttcn, line 786 */ RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tx, FALSE, NULL); } tmp_76_state[0]=1; goto tmp_76; } } current_location.update_lineno(791); /* ConnHdlr.ttcn, line 791 */ if(tmp_76_alt_flag[1]==ALT_UNCHECKED) { if(tmp_76_state[1]==2) { tmp_76_alt_flag[1]=ALT_MAYBE; } else tmp_76_alt_flag[1]=ALT_NO; } if(tmp_76_alt_flag[1]==ALT_MAYBE) { tmp_76_alt_flag[1]=MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.receive(MGCP__Templates::tr__CRCX(CHARSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgcp__ep()), SDP__Templates::tr__SDP(CHARSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().cn__rtp__ip()), INTEGER_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().cn__rtp__port()))), &(mgcp__cmd), any_compref, NULL, NULL, NULL); if(tmp_76_alt_flag[1]==ALT_YES) { current_location.update_lineno(792); /* ConnHdlr.ttcn, line 792 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("CRCX2"); mgcp__cmd.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(794); /* ConnHdlr.ttcn, line 794 */ MGCP__Types::MgcpResponse_template mgcp__rsp(f__handle__crcx(ConnHdlr_component_g__pars.mgcp__pars(), mgcp__cmd)); current_location.update_lineno(795); /* ConnHdlr.ttcn, line 795 */ MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.send(mgcp__rsp.valueof(), FALSE, NULL); tmp_76_state[1]=1; goto tmp_76; } } if(tmp_76_alt_flag[2]==ALT_MAYBE) { tmp_76_alt_flag[2]=TTCN_Default::try_altsteps(first_run); if(tmp_76_alt_flag[2]==ALT_YES || tmp_76_alt_flag[2]==ALT_BREAK) break; else if(tmp_76_alt_flag[2]==ALT_REPEAT) goto tmp_76; } current_location.update_lineno(754); /* ConnHdlr.ttcn, line 754 */ for(size_t tmp_i=0; tmp_i<3; tmp_i++) if(tmp_76_alt_flag[tmp_i]!=ALT_NO) goto tmp_76_newsnapshot; TTCN_error("None of the branches can be chosen in the interleave statement in file ConnHdlr.ttcn between lines 754 and 797."); tmp_76_newsnapshot: TTCN_Snapshot::take_new(TRUE); first_run = FALSE; continue; current_location.update_lineno(754); /* ConnHdlr.ttcn, line 754 */ } } current_location.update_lineno(800); /* ConnHdlr.ttcn, line 800 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__cn().mgw__rtp__ip()), RANAP__Templates::t__RAB__binding__port(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgw__conn__cn().mgw__rtp__port())); current_location.update_lineno(801); /* ConnHdlr.ttcn, line 801 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_98; tmp_98 = rab__smdl; tmp_98.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssResp(tmp_98, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } current_location.update_lineno(803); /* ConnHdlr.ttcn, line 803 */ f__bssap__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(tx)); } void start_f__rab__ass__resp__cs(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_resp_cs("); 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, "ConnHdlr", "f_rab_ass_resp_cs", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__create__rab__cs() { TTCN_Location current_location("ConnHdlr.ttcn", 806, TTCN_Location::LOCATION_FUNCTION, "f_create_rab_cs"); current_location.update_lineno(807); /* ConnHdlr.ttcn, line 807 */ f__rab__ass__req__cs(); current_location.update_lineno(808); /* ConnHdlr.ttcn, line 808 */ f__rab__ass__resp__cs(); } void start_f__create__rab__cs(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_rab_cs("); 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, "ConnHdlr", "f_create_rab_cs", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rab__ass__req__ps__with__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 811, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_req_ps_with_pfcp"); current_location.update_lineno(812); /* ConnHdlr.ttcn, line 812 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(813); /* ConnHdlr.ttcn, line 813 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(814); /* ConnHdlr.ttcn, line 814 */ PFCP__Types::PDU__PFCP m; current_location.update_lineno(823); /* ConnHdlr.ttcn, line 823 */ Mutex::f__Mutex__lock(cs_13, 823, Mutex::f__Mutex__lock_Tval_defval); current_location.update_lineno(827); /* ConnHdlr.ttcn, line 827 */ PFCP__Emulation::f__PFCPEM__subscribe__seid(os_4); current_location.update_lineno(830); /* ConnHdlr.ttcn, line 830 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template rab__sml; current_location.update_lineno(831); /* ConnHdlr.ttcn, line 831 */ rab__sml = RANAP__Templates::ts__RAB__SML__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().remote().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().remote().teid())); current_location.update_lineno(832); /* ConnHdlr.ttcn, line 832 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_101; tmp_101 = rab__sml; tmp_101.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_101, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(833); /* ConnHdlr.ttcn, line 833 */ RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.send(tx, FALSE, NULL); current_location.update_lineno(836); /* ConnHdlr.ttcn, line 836 */ m = f__pfcp__expect(PFCP__Templates::tr__PFCP__Session__Est__Req(PFCP__Templates::tr__PFCP__Session__Est__Req_node__id_defval, PFCP__Templates::tr__PFCP__Session__Est__Req_cp__f__seid_defval, PFCP__Templates::tr__PFCP__Session__Est__Req_create__pdr_defval, PFCP__Templates::tr__PFCP__Session__Est__Req_create__far_defval), f__pfcp__expect_wait__time_defval); current_location.update_lineno(838); /* ConnHdlr.ttcn, line 838 */ PFCP__Emulation::f__PFCPEM__subscribe__seid(OCTETSTRING(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__f__seid().seid())); current_location.update_lineno(842); /* ConnHdlr.ttcn, line 842 */ PFCP__Emulation::f__PFCPEM__unsubscribe__seid(os_4); current_location.update_lineno(843); /* ConnHdlr.ttcn, line 843 */ Mutex::f__Mutex__unlock(cs_13, 843); current_location.update_lineno(845); /* ConnHdlr.ttcn, line 845 */ PFCP__Types::PFCP__Session__Establishment__Request serq(const_cast< const PFCP__Types::PDU__PFCP&>(m).message__body().pfcp__session__establishment__request()); current_location.update_lineno(847); /* ConnHdlr.ttcn, line 847 */ ConnHdlr_component_g__pars.pfcp__pars().hnbgw__f__seid() = const_cast< const PFCP__Types::PFCP__Session__Establishment__Request&>(serq).CP__F__SEID(); current_location.update_lineno(851); /* ConnHdlr.ttcn, line 851 */ PFCP__Types::F__TEID_template f__teid1(PFCP__Templates::ts__PFCP__F__TEID__ipv4(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().local().teid(), Native__Functions::f__inet__addr(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().local().addr()))); current_location.update_lineno(853); /* ConnHdlr.ttcn, line 853 */ PFCP__Types::F__TEID_template f__teid2(PFCP__Templates::ts__PFCP__F__TEID__ipv4(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().local().teid(), Native__Functions::f__inet__addr(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().local().addr()))); current_location.update_lineno(855); /* ConnHdlr.ttcn, line 855 */ PFCP__Types::Created__PDR_template pdr1; { PFCP__Types::F__TEID_template tmp_104; tmp_104 = f__teid1; tmp_104.check_restriction(TR_VALUE); pdr1 = PFCP__Templates::ts__PFCP__Created__PDR(const_cast< const PFCP__Types::PFCP__Session__Establishment__Request&>(serq).create__PDR__list()[0].grouped__ie().pdr__id(), tmp_104); } current_location.update_lineno(857); /* ConnHdlr.ttcn, line 857 */ PFCP__Types::Created__PDR_template pdr2; { PFCP__Types::F__TEID_template tmp_105; tmp_105 = f__teid2; tmp_105.check_restriction(TR_VALUE); pdr2 = PFCP__Templates::ts__PFCP__Created__PDR(const_cast< const PFCP__Types::PFCP__Session__Establishment__Request&>(serq).create__PDR__list()[1].grouped__ie().pdr__id(), tmp_105); } current_location.update_lineno(859); /* ConnHdlr.ttcn, line 859 */ PFCP__Types::PDU__PFCP_template r; { PFCP__Types::PFCP__Session__Establishment__Response_created__PDR__list_template tmp_106; tmp_106.set_size(2); tmp_106[0] = pdr1; tmp_106[1] = pdr2; tmp_106.check_restriction(TR_VALUE); r = PFCP__Templates::ts__PFCP__Session__Est__Resp(INTEGER_template(const_cast< const PFCP__Types::PDU__PFCP&>(m).sequence__number()), PFCP__Types::Node__ID_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__node__id()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().hnbgw__f__seid()().seid()), PFCP__Types::F__SEID_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__f__seid()), tmp_106, PFCP__Templates::ts__PFCP__Session__Est__Resp_cause_defval); } current_location.update_lineno(864); /* ConnHdlr.ttcn, line 864 */ PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.send(r, FALSE, NULL); current_location.update_lineno(867); /* ConnHdlr.ttcn, line 867 */ rab__sml = RANAP__Templates::ts__RAB__SML__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().local().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().local().teid())); current_location.update_lineno(869); /* ConnHdlr.ttcn, line 869 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_109; tmp_109 = rab__sml; tmp_109.check_restriction(TR_OMIT); rx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_109, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(870); /* ConnHdlr.ttcn, line 870 */ f__rua__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(rx)); } void start_f__rab__ass__req__ps__with__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_req_ps_with_pfcp("); 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, "ConnHdlr", "f_rab_ass_req_ps_with_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rab__ass__resp__ps__with__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 873, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_resp_ps_with_pfcp"); current_location.update_lineno(874); /* ConnHdlr.ttcn, line 874 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(875); /* ConnHdlr.ttcn, line 875 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(876); /* ConnHdlr.ttcn, line 876 */ PFCP__Types::PDU__PFCP_template r; current_location.update_lineno(877); /* ConnHdlr.ttcn, line 877 */ PFCP__Types::PDU__PFCP m; current_location.update_lineno(880); /* ConnHdlr.ttcn, line 880 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template rab__smdl; current_location.update_lineno(881); /* ConnHdlr.ttcn, line 881 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().remote().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().remote().teid())); current_location.update_lineno(883); /* ConnHdlr.ttcn, line 883 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_112; tmp_112 = rab__smdl; tmp_112.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssResp(tmp_112, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } current_location.update_lineno(884); /* ConnHdlr.ttcn, line 884 */ RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tx, FALSE, NULL); current_location.update_lineno(886); /* ConnHdlr.ttcn, line 886 */ m = f__pfcp__expect(PFCP__Templates::tr__PFCP__Session__Mod__Req(OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__f__seid().seid()), PFCP__Templates::tr__PFCP__Session__Mod__Req_update__far_defval), f__pfcp__expect_wait__time_defval); current_location.update_lineno(887); /* ConnHdlr.ttcn, line 887 */ r = PFCP__Templates::ts__PFCP__Session__Mod__Resp(INTEGER_template(const_cast< const PFCP__Types::PDU__PFCP&>(m).sequence__number()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().hnbgw__f__seid()().seid()), PFCP__Templates::ts__PFCP__Session__Mod__Resp_cause_defval); current_location.update_lineno(888); /* ConnHdlr.ttcn, line 888 */ PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.send(r, FALSE, NULL); current_location.update_lineno(890); /* ConnHdlr.ttcn, line 890 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().local().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().local().teid())); current_location.update_lineno(891); /* ConnHdlr.ttcn, line 891 */ { RANAP__PDU__Descriptions::RANAP__PDU_template tmp_116; tmp_116 = RANAP__Templates::tr__RANAP__RabAssResp(rab__smdl, RANAP__Templates::tr__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::tr__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::tr__RANAP__RabAssResp_exts_defval); tmp_116.check_restriction(TR_PRESENT); f__bssap__expect(tmp_116); } } void start_f__rab__ass__resp__ps__with__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_resp_ps_with_pfcp("); 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, "ConnHdlr", "f_rab_ass_resp_ps_with_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__create__rab__ps__with__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 894, TTCN_Location::LOCATION_FUNCTION, "f_create_rab_ps_with_pfcp"); current_location.update_lineno(895); /* ConnHdlr.ttcn, line 895 */ f__rab__ass__req__ps__with__pfcp(); current_location.update_lineno(896); /* ConnHdlr.ttcn, line 896 */ f__rab__ass__resp__ps__with__pfcp(); } void start_f__create__rab__ps__with__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_rab_ps_with_pfcp("); 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, "ConnHdlr", "f_create_rab_ps_with_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rab__ass__req__ps__without__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 899, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_req_ps_without_pfcp"); current_location.update_lineno(900); /* ConnHdlr.ttcn, line 900 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(901); /* ConnHdlr.ttcn, line 901 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(904); /* ConnHdlr.ttcn, line 904 */ PFCP__Emulation::f__PFCPEM__subscribe__bcast(); current_location.update_lineno(905); /* ConnHdlr.ttcn, line 905 */ activate_as__disallow__pfcp(); current_location.update_lineno(907); /* ConnHdlr.ttcn, line 907 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template rab__sml; current_location.update_lineno(908); /* ConnHdlr.ttcn, line 908 */ rab__sml = RANAP__Templates::ts__RAB__SML__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().remote().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().core().remote().teid())); current_location.update_lineno(909); /* ConnHdlr.ttcn, line 909 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_119; tmp_119 = rab__sml; tmp_119.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_119, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(910); /* ConnHdlr.ttcn, line 910 */ RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.send(tx, FALSE, NULL); current_location.update_lineno(913); /* ConnHdlr.ttcn, line 913 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerPairList_RANAP__PDU__Contents_inst1_template tmp_121; tmp_121 = rab__sml; tmp_121.check_restriction(TR_OMIT); rx = RANAP__Templates::ts__RANAP__RabAssReq(tmp_121, RANAP__Templates::ts__RANAP__RabAssReq_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssReq_exts_defval).valueof(); } current_location.update_lineno(914); /* ConnHdlr.ttcn, line 914 */ f__rua__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(rx)); } void start_f__rab__ass__req__ps__without__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_req_ps_without_pfcp("); 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, "ConnHdlr", "f_rab_ass_req_ps_without_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__rab__ass__resp__ps__without__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 917, TTCN_Location::LOCATION_FUNCTION, "f_rab_ass_resp_ps_without_pfcp"); current_location.update_lineno(918); /* ConnHdlr.ttcn, line 918 */ RANAP__PDU__Descriptions::RANAP__PDU tx; current_location.update_lineno(919); /* ConnHdlr.ttcn, line 919 */ RANAP__PDU__Descriptions::RANAP__PDU rx; current_location.update_lineno(922); /* ConnHdlr.ttcn, line 922 */ RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template rab__smdl; current_location.update_lineno(923); /* ConnHdlr.ttcn, line 923 */ rab__smdl = RANAP__Templates::ts__RAB__SMdL__ps(RANAP__Templates::t__RAB__id(23), RANAP__Templates::f__ts__RAB__TLA(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().remote().addr()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).gtp__pars().access().remote().teid())); current_location.update_lineno(925); /* ConnHdlr.ttcn, line 925 */ { RANAP__PDU__Contents::_root_RANAP__Containers_ProtocolIE__ContainerList_RANAP__PDU__Contents_inst19_template tmp_124; tmp_124 = rab__smdl; tmp_124.check_restriction(TR_OMIT); tx = RANAP__Templates::ts__RANAP__RabAssResp(tmp_124, RANAP__Templates::ts__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::ts__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::ts__RANAP__RabAssResp_exts_defval).valueof(); } current_location.update_lineno(926); /* ConnHdlr.ttcn, line 926 */ RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tx, FALSE, NULL); current_location.update_lineno(929); /* ConnHdlr.ttcn, line 929 */ { RANAP__PDU__Descriptions::RANAP__PDU_template tmp_125; tmp_125 = RANAP__Templates::tr__RANAP__RabAssResp(rab__smdl, RANAP__Templates::tr__RANAP__RabAssResp_rab__rl_defval, RANAP__Templates::tr__RANAP__RabAssResp_rab__fl_defval, RANAP__Templates::tr__RANAP__RabAssResp_exts_defval); tmp_125.check_restriction(TR_PRESENT); f__bssap__expect(tmp_125); } } void start_f__rab__ass__resp__ps__without__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rab_ass_resp_ps_without_pfcp("); 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, "ConnHdlr", "f_rab_ass_resp_ps_without_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__create__rab__ps__without__pfcp() { TTCN_Location current_location("ConnHdlr.ttcn", 932, TTCN_Location::LOCATION_FUNCTION, "f_create_rab_ps_without_pfcp"); current_location.update_lineno(933); /* ConnHdlr.ttcn, line 933 */ f__rab__ass__req__ps__without__pfcp(); current_location.update_lineno(934); /* ConnHdlr.ttcn, line 934 */ f__rab__ass__resp__ps__without__pfcp(); } void start_f__create__rab__ps__without__pfcp(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_rab_ps_without_pfcp("); 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, "ConnHdlr", "f_create_rab_ps_without_pfcp", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__create__rab__ps() { TTCN_Location current_location("ConnHdlr.ttcn", 937, TTCN_Location::LOCATION_FUNCTION, "f_create_rab_ps"); current_location.update_lineno(938); /* ConnHdlr.ttcn, line 938 */ if (const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().pfcp__enabled()) { current_location.update_lineno(939); /* ConnHdlr.ttcn, line 939 */ f__create__rab__ps__with__pfcp(); } else { current_location.update_lineno(941); /* ConnHdlr.ttcn, line 941 */ f__create__rab__ps__without__pfcp(); } } void start_f__create__rab__ps(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_rab_ps("); 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, "ConnHdlr", "f_create_rab_ps", text_buf); TTCN_Runtime::send_start_component(text_buf); } alt_status as__mgcp__dlcx_instance(boolean first_alt_run) { TTCN_Location current_location("ConnHdlr.ttcn", 945, TTCN_Location::LOCATION_ALTSTEP, "as_mgcp_dlcx"); current_location.update_lineno(946); /* ConnHdlr.ttcn, line 946 */ MGCP__Types::MgcpCommand mgcp__cmd; alt_status ret_val = ALT_NO; current_location.update_lineno(948); /* ConnHdlr.ttcn, line 948 */ switch (MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.receive(MGCP__Templates::tr__DLCX(CHARSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().mgcp__ep())), &(mgcp__cmd), any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(949); /* ConnHdlr.ttcn, line 949 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("DLCX"); mgcp__cmd.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(950); /* ConnHdlr.ttcn, line 950 */ MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.send(MGCP__Templates::ts__DLCX__ACK2(const_cast< const MGCP__Types::MgcpCommand&>(mgcp__cmd).line().trans__id()), FALSE, NULL); current_location.update_lineno(951); /* ConnHdlr.ttcn, line 951 */ { INTEGER tmp_126; tmp_126 = (const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().got__dlcx__count() + 1); ConnHdlr_component_g__pars.mgcp__pars().got__dlcx__count() = tmp_126; } current_location.update_lineno(952); /* ConnHdlr.ttcn, line 952 */ if ((const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().got__dlcx__count() != const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).mgcp__pars().got__crcx__count())) { current_location.update_lineno(953); /* ConnHdlr.ttcn, line 953 */ return ALT_REPEAT; } current_location.update_lineno(955); /* ConnHdlr.ttcn, line 955 */ TTCN_Runtime::setverdict(PASS); } return ALT_YES; case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__mgcp__dlcx(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__mgcp__dlcx_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_mgcp_dlcx."); else block_flag = TRUE; } } Default_Base *activate_as__mgcp__dlcx() { return new as__mgcp__dlcx_Default(); } PFCP__Types::PDU__PFCP f__pfcp__expect(const PFCP__Types::PDU__PFCP_template& exp__rx, const FLOAT& wait__time) { TTCN_Location current_location("ConnHdlr.ttcn", 959, TTCN_Location::LOCATION_FUNCTION, "f_pfcp_expect"); current_location.update_lineno(961); /* ConnHdlr.ttcn, line 961 */ PFCP__Types::PDU__PFCP rx; current_location.update_lineno(962); /* ConnHdlr.ttcn, line 962 */ TIMER T("T", wait__time); current_location.update_lineno(963); /* ConnHdlr.ttcn, line 963 */ T.start(); current_location.update_lineno(964); /* ConnHdlr.ttcn, line 964 */ { tmp_127: alt_status tmp_127_alt_flag_0 = ALT_MAYBE; alt_status tmp_127_alt_flag_1 = ALT_MAYBE; alt_status tmp_127_alt_flag_2 = ALT_MAYBE; alt_status tmp_127_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_127_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(965); /* ConnHdlr.ttcn, line 965 */ tmp_127_alt_flag_0 = PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.receive(exp__rx, &(rx), any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_0 == ALT_YES) { current_location.update_lineno(966); /* ConnHdlr.ttcn, line 966 */ TTCN_Runtime::setverdict(PASS); break; } } if (tmp_127_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(968); /* ConnHdlr.ttcn, line 968 */ tmp_127_alt_flag_1 = PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.receive(PFCP__Types::PDU__PFCP_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL); if (tmp_127_alt_flag_1 == ALT_YES) { current_location.update_lineno(969); /* ConnHdlr.ttcn, line 969 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Got an unexpected PFCP message, was waiting for "),exp__rx.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(970); /* ConnHdlr.ttcn, line 970 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_127_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(972); /* ConnHdlr.ttcn, line 972 */ tmp_127_alt_flag_2 = T.timeout(NULL); if (tmp_127_alt_flag_2 == ALT_YES) { current_location.update_lineno(973); /* ConnHdlr.ttcn, line 973 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for PFCP "),exp__rx.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(974); /* ConnHdlr.ttcn, line 974 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_127_default_flag == ALT_MAYBE) { tmp_127_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_127_default_flag == ALT_YES || tmp_127_default_flag == ALT_BREAK) break; else if (tmp_127_default_flag == ALT_REPEAT) goto tmp_127; } current_location.update_lineno(964); /* ConnHdlr.ttcn, line 964 */ if (tmp_127_alt_flag_0 == ALT_NO && tmp_127_alt_flag_1 == ALT_NO && tmp_127_alt_flag_2 == ALT_NO && tmp_127_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file ConnHdlr.ttcn between lines 964 and 976."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(977); /* ConnHdlr.ttcn, line 977 */ T.stop(); current_location.update_lineno(978); /* ConnHdlr.ttcn, line 978 */ return rx; } void start_f__pfcp__expect(const COMPONENT& component_reference, const PFCP__Types::PDU__PFCP_template& exp__rx, const FLOAT& wait__time) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_pfcp_expect("); exp__rx.log(); TTCN_Logger::log_event_str(", "); wait__time.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, "ConnHdlr", "f_pfcp_expect", text_buf); exp__rx.encode_text(text_buf); wait__time.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } alt_status as__disallow__pfcp_instance(boolean first_alt_run) { TTCN_Location current_location("ConnHdlr.ttcn", 981, TTCN_Location::LOCATION_ALTSTEP, "as_disallow_pfcp"); alt_status ret_val = ALT_NO; current_location.update_lineno(982); /* ConnHdlr.ttcn, line 982 */ switch (PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.receive(PFCP__Types::PDU__PFCP_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(983); /* ConnHdlr.ttcn, line 983 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received PFCP message, but no PFCP communication expected"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(984); /* ConnHdlr.ttcn, line 984 */ TTCN_Runtime::stop_component(MTC_COMPREF); } case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__disallow__pfcp(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__disallow__pfcp_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_disallow_pfcp."); else block_flag = TRUE; } } Default_Base *activate_as__disallow__pfcp() { return new as__disallow__pfcp_Default(); } alt_status as__pfcp__handle__del__req_instance(boolean first_alt_run) { TTCN_Location current_location("ConnHdlr.ttcn", 988, TTCN_Location::LOCATION_ALTSTEP, "as_pfcp_handle_del_req"); current_location.update_lineno(990); /* ConnHdlr.ttcn, line 990 */ PFCP__Types::PDU__PFCP_template exp__rx; static PFCP__Types::PDU__PFCP_template exp__rx_init; if (first_alt_run) { exp__rx_init = PFCP__Templates::tr__PFCP__Session__Del__Req(OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__f__seid().seid())); } exp__rx = exp__rx_init; current_location.update_lineno(991); /* ConnHdlr.ttcn, line 991 */ PFCP__Types::PDU__PFCP m; alt_status ret_val = ALT_NO; current_location.update_lineno(993); /* ConnHdlr.ttcn, line 993 */ switch (PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.receive(exp__rx, &(m), any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(994); /* ConnHdlr.ttcn, line 994 */ PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Session__Del__Resp(INTEGER_template(const_cast< const PFCP__Types::PDU__PFCP&>(m).sequence__number()), OCTETSTRING_template(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().hnbgw__f__seid()().seid()), PFCP__Templates::ts__PFCP__Session__Del__Resp_cause_defval), FALSE, NULL); current_location.update_lineno(996); /* ConnHdlr.ttcn, line 996 */ PFCP__Emulation::f__PFCPEM__unsubscribe__seid(OCTETSTRING(const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).pfcp__pars().upf__f__seid().seid())); } return ALT_YES; case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } current_location.update_lineno(998); /* ConnHdlr.ttcn, line 998 */ switch (PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.receive(PFCP__Types::PDU__PFCP_template(ANY_VALUE), &(m), any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(999); /* ConnHdlr.ttcn, line 999 */ Misc__Helpers::f__shutdown(cs_13, 999, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Got an unexpected PFCP message: "),m.log(),TTCN_Logger::log_event_str(" vs exp "),exp__rx.log(),TTCN_Logger::end_event_log2str())); } return ALT_YES; case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__pfcp__handle__del__req(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__pfcp__handle__del__req_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_pfcp_handle_del_req."); else block_flag = TRUE; } } Default_Base *activate_as__pfcp__handle__del__req() { return new as__pfcp__handle__del__req_Default(); } void f__perform__compl__l3(const OCTETSTRING& nas, const BOOLEAN& , const BOOLEAN& expect__success) { TTCN_Location current_location("ConnHdlr.ttcn", 1004, TTCN_Location::LOCATION_FUNCTION, "f_perform_compl_l3"); current_location.update_lineno(1006); /* ConnHdlr.ttcn, line 1006 */ TIMER T("T", 1.0e1); current_location.update_lineno(1008); /* ConnHdlr.ttcn, line 1008 */ if (expect__success) { current_location.update_lineno(1010); /* ConnHdlr.ttcn, line 1010 */ if (const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).expect__separate__sccp__cr()) { current_location.update_lineno(1011); /* ConnHdlr.ttcn, line 1011 */ RAN__Emulation::f__ran__register__sccp__cr__without__payload(); } else { current_location.update_lineno(1013); /* ConnHdlr.ttcn, line 1013 */ RAN__Emulation::f__ran__register__exp(nas); } } current_location.update_lineno(1018); /* ConnHdlr.ttcn, line 1018 */ RANAP__PDU__Descriptions::RANAP__PDU tx(f__build__initial__ue__with__nas(ConnHdlr_component_g__pars, nas)); current_location.update_lineno(1019); /* ConnHdlr.ttcn, line 1019 */ { RUA__Emulation::RUA__Conn__Req_template tmp_128; tmp_128.ps__domain() = const_cast< const TestHdlrParams&>(ConnHdlr_component_g__pars).ps__domain(); tmp_128.ranap() = tx; RUA__Emulation::RUA__ConnHdlr_component_RUA.send(tmp_128, FALSE, NULL); } current_location.update_lineno(1021); /* ConnHdlr.ttcn, line 1021 */ if (expect__success) { current_location.update_lineno(1023); /* ConnHdlr.ttcn, line 1023 */ f__bssap__expect(RANAP__PDU__Descriptions::RANAP__PDU_template(tx)); } else { current_location.update_lineno(1025); /* ConnHdlr.ttcn, line 1025 */ { tmp_129: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = RUA__Emulation::RUA__ConnHdlr_component_RUA.receive(RUA__Emulation::RUA__Disc__Ind_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(first_run); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_129; } current_location.update_lineno(1025); /* ConnHdlr.ttcn, line 1025 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file ConnHdlr.ttcn, line 1025."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } } void start_f__perform__compl__l3(const COMPONENT& component_reference, const OCTETSTRING& nas, const BOOLEAN& do__clear, const BOOLEAN& expect__success) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_perform_compl_l3("); nas.log(); TTCN_Logger::log_event_str(", "); do__clear.log(); TTCN_Logger::log_event_str(", "); expect__success.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, "ConnHdlr", "f_perform_compl_l3", text_buf); nas.encode_text(text_buf); do__clear.encode_text(text_buf); expect__success.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("ConnHdlr.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "ConnHdlr"); GSM__Types::module_object.pre_init_module(); Osmocom__CTRL__Adapter::module_object.pre_init_module(); StatsD__Checker::module_object.pre_init_module(); RUA__Emulation::module_object.pre_init_module(); RAN__Adapter::module_object.pre_init_module(); MGCP__Emulation::module_object.pre_init_module(); PFCP__Emulation::module_object.pre_init_module(); L3__Templates::module_object.pre_init_module(); L3__Common::module_object.pre_init_module(); Mutex::module_object.pre_init_module(); module_object.add_function("f_mgcp_endp_str", (genericfunc_t)&f__mgcp__endp__str, NULL); current_location.update_lineno(207); /* ConnHdlr.ttcn, line 207 */ const_c__SEID0 = os_4; module_object.add_function("f_create_ranap_exp", (genericfunc_t)&f__create__ranap__exp, (genericfunc_t)&start_f__create__ranap__exp); module_object.add_function("f_handler_init", (genericfunc_t)&f__handler__init, (genericfunc_t)&start_f__handler__init); module_object.add_altstep("as_Tguard_ConnHdlr", (genericfunc_t)&as__Tguard__ConnHdlr_instance, (genericfunc_t )&activate_as__Tguard__ConnHdlr, (genericfunc_t )&as__Tguard__ConnHdlr); module_object.add_function("f_bssap_expect", (genericfunc_t)&f__bssap__expect, (genericfunc_t)&start_f__bssap__expect); module_object.add_function("f_iuh2iu", (genericfunc_t)&f__iuh2iu, (genericfunc_t)&start_f__iuh2iu); module_object.add_function("f_iu2iuh", (genericfunc_t)&f__iu2iuh, (genericfunc_t)&start_f__iu2iuh); module_object.add_function("f_rua_expect", (genericfunc_t)&f__rua__expect, (genericfunc_t)&start_f__rua__expect); module_object.add_function("f_iuh2iu_connect", (genericfunc_t)&f__iuh2iu__connect, (genericfunc_t)&start_f__iuh2iu__connect); module_object.add_function("f_iuh2iu_disconnect", (genericfunc_t)&f__iuh2iu__disconnect, (genericfunc_t)&start_f__iuh2iu__disconnect); module_object.add_function("f_build_initial_ue_with_nas", (genericfunc_t)&f__build__initial__ue__with__nas, NULL); module_object.add_function("f_build_initial_ue", (genericfunc_t)&f__build__initial__ue, NULL); module_object.add_function("f_build_rab_ass_resp", (genericfunc_t)&f__build__rab__ass__resp, NULL); module_object.add_function("f_cn_iu_release_procedure", (genericfunc_t)&f__cn__iu__release__procedure, (genericfunc_t)&start_f__cn__iu__release__procedure); module_object.add_function("f_handle_crcx", (genericfunc_t)&f__handle__crcx, NULL); module_object.add_function("f_rab_ass_req_cs", (genericfunc_t)&f__rab__ass__req__cs, (genericfunc_t)&start_f__rab__ass__req__cs); module_object.add_function("f_rab_ass_resp_cs", (genericfunc_t)&f__rab__ass__resp__cs, (genericfunc_t)&start_f__rab__ass__resp__cs); module_object.add_function("f_create_rab_cs", (genericfunc_t)&f__create__rab__cs, (genericfunc_t)&start_f__create__rab__cs); module_object.add_function("f_rab_ass_req_ps_with_pfcp", (genericfunc_t)&f__rab__ass__req__ps__with__pfcp, (genericfunc_t)&start_f__rab__ass__req__ps__with__pfcp); module_object.add_function("f_rab_ass_resp_ps_with_pfcp", (genericfunc_t)&f__rab__ass__resp__ps__with__pfcp, (genericfunc_t)&start_f__rab__ass__resp__ps__with__pfcp); module_object.add_function("f_create_rab_ps_with_pfcp", (genericfunc_t)&f__create__rab__ps__with__pfcp, (genericfunc_t)&start_f__create__rab__ps__with__pfcp); module_object.add_function("f_rab_ass_req_ps_without_pfcp", (genericfunc_t)&f__rab__ass__req__ps__without__pfcp, (genericfunc_t)&start_f__rab__ass__req__ps__without__pfcp); module_object.add_function("f_rab_ass_resp_ps_without_pfcp", (genericfunc_t)&f__rab__ass__resp__ps__without__pfcp, (genericfunc_t)&start_f__rab__ass__resp__ps__without__pfcp); module_object.add_function("f_create_rab_ps_without_pfcp", (genericfunc_t)&f__create__rab__ps__without__pfcp, (genericfunc_t)&start_f__create__rab__ps__without__pfcp); module_object.add_function("f_create_rab_ps", (genericfunc_t)&f__create__rab__ps, (genericfunc_t)&start_f__create__rab__ps); module_object.add_altstep("as_mgcp_dlcx", (genericfunc_t)&as__mgcp__dlcx_instance, (genericfunc_t )&activate_as__mgcp__dlcx, (genericfunc_t )&as__mgcp__dlcx); module_object.add_function("f_pfcp_expect", (genericfunc_t)&f__pfcp__expect, (genericfunc_t)&start_f__pfcp__expect); module_object.add_altstep("as_disallow_pfcp", (genericfunc_t)&as__disallow__pfcp_instance, (genericfunc_t )&activate_as__disallow__pfcp, (genericfunc_t )&as__disallow__pfcp); module_object.add_altstep("as_pfcp_handle_del_req", (genericfunc_t)&as__pfcp__handle__del__req_instance, (genericfunc_t )&activate_as__pfcp__handle__del__req, (genericfunc_t )&as__pfcp__handle__del__req); module_object.add_function("f_perform_compl_l3", (genericfunc_t)&f__perform__compl__l3, (genericfunc_t)&start_f__perform__compl__l3); } void post_init_module() { TTCN_Location current_location("ConnHdlr.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "ConnHdlr"); GSM__Types::module_object.post_init_module(); Osmocom__CTRL__Adapter::module_object.post_init_module(); StatsD__Checker::module_object.post_init_module(); RUA__Emulation::module_object.post_init_module(); RAN__Adapter::module_object.post_init_module(); MGCP__Emulation::module_object.post_init_module(); PFCP__Emulation::module_object.post_init_module(); L3__Templates::module_object.post_init_module(); L3__Common::module_object.post_init_module(); Mutex::module_object.post_init_module(); current_location.update_lineno(125); /* ConnHdlr.ttcn, line 125 */ const_f__mgcp__endp__str_endp__idx_defval = 1; current_location.update_lineno(131); /* ConnHdlr.ttcn, line 131 */ const_t__MgcpParams_endp__idx_defval = 1; current_location.update_lineno(184); /* ConnHdlr.ttcn, line 184 */ { FTeids_template& tmp_2 = template_t__GtpParams.core(); { FTeid_template& tmp_3 = tmp_2.local(); tmp_3.addr() = cs_7; tmp_3.teid() = os_0; } { FTeid_template& tmp_4 = tmp_2.remote(); tmp_4.addr() = cs_8; tmp_4.teid() = os_1; } } { FTeids_template& tmp_5 = template_t__GtpParams.access(); { FTeid_template& tmp_6 = tmp_5.local(); tmp_6.addr() = cs_9; tmp_6.teid() = os_2; } { FTeid_template& tmp_7 = tmp_5.remote(); tmp_7.addr() = cs_10; tmp_7.teid() = os_3; } } current_location.update_lineno(217); /* ConnHdlr.ttcn, line 217 */ const_t__PfcpParams_pfcp__enabled_defval = FALSE; current_location.update_lineno(218); /* ConnHdlr.ttcn, line 218 */ const_t__PfcpParams_pfcp__local__addr_defval = cs_8; current_location.update_lineno(219); /* ConnHdlr.ttcn, line 219 */ const_t__PfcpParams_pfcp__upf__node__id_defval = cs_11; current_location.update_lineno(220); /* ConnHdlr.ttcn, line 220 */ const_t__PfcpParams_upf__f__seid_defval = 1; current_location.update_lineno(263); /* ConnHdlr.ttcn, line 263 */ const_t__pars_ps__domain_defval = FALSE; current_location.update_lineno(264); /* ConnHdlr.ttcn, line 264 */ const_t__pars_hnb__idx_defval = 0; current_location.update_lineno(265); /* ConnHdlr.ttcn, line 265 */ const_t__pars_expect__separate__sccp__cr_defval = FALSE; current_location.update_lineno(266); /* ConnHdlr.ttcn, line 266 */ const_t__pars_tx__sccp__cr__data__len_defval = 0; current_location.update_lineno(267); /* ConnHdlr.ttcn, line 267 */ const_t__pars_expect__compl__l3__success_defval = TRUE; current_location.update_lineno(268); /* ConnHdlr.ttcn, line 268 */ const_t__pars_cn__idx_defval = 0; current_location.update_lineno(269); /* ConnHdlr.ttcn, line 269 */ template_t__pars_mgcp__pars_defval = t__MgcpParams(t__MgcpParams_endp__idx_defval); current_location.update_lineno(270); /* ConnHdlr.ttcn, line 270 */ template_t__pars_pfcp__pars_defval = t__PfcpParams(t__PfcpParams_pfcp__enabled_defval, t__PfcpParams_pfcp__local__addr_defval, t__PfcpParams_pfcp__upf__node__id_defval, t__PfcpParams_upf__f__seid_defval); current_location.update_lineno(271); /* ConnHdlr.ttcn, line 271 */ template_t__pars_rab__rel__cause_defval = RANAP__Templates::ts__RanapCause__nas__normal; current_location.update_lineno(272); /* ConnHdlr.ttcn, line 272 */ const_t__pars_hnbgw__timer__x31_defval = 5; current_location.update_lineno(273); /* ConnHdlr.ttcn, line 273 */ const_t__pars_t__guard_defval = 2.0e1; current_location.update_lineno(354); /* ConnHdlr.ttcn, line 354 */ template_f__iuh2iu_exp__rx_defval = OMIT_VALUE; current_location.update_lineno(369); /* ConnHdlr.ttcn, line 369 */ template_f__iu2iuh_exp__rx_defval = OMIT_VALUE; current_location.update_lineno(404); /* ConnHdlr.ttcn, line 404 */ template_f__iuh2iu__connect_exp__rx_defval = OMIT_VALUE; current_location.update_lineno(448); /* ConnHdlr.ttcn, line 448 */ template_f__iuh2iu__disconnect_exp__rx_defval = OMIT_VALUE; current_location.update_lineno(558); /* ConnHdlr.ttcn, line 558 */ const_f__cn__iu__release__procedure_mgcp__teardown_defval = FALSE; current_location.update_lineno(558); /* ConnHdlr.ttcn, line 558 */ const_f__cn__iu__release__procedure_pfcp__teardown_defval = FALSE; current_location.update_lineno(959); /* ConnHdlr.ttcn, line 959 */ const_f__pfcp__expect_wait__time_defval = 5.0; current_location.update_lineno(1004); /* ConnHdlr.ttcn, line 1004 */ const_f__perform__compl__l3_do__clear_defval = TRUE; current_location.update_lineno(1004); /* ConnHdlr.ttcn, line 1004 */ const_f__perform__compl__l3_expect__success_defval = TRUE; } boolean init_comp_type(const char *component_type, boolean init_base_comps) { (void)init_base_comps; if (!strcmp(component_type, "ConnHdlr")) { if (init_base_comps) { Module_List::initialize_component("MGCP_Emulation", "MGCP_ConnHdlr", FALSE); Module_List::initialize_component("Mutex", "MutexCT", FALSE); Module_List::initialize_component("PFCP_Emulation", "PFCP_ConnHdlr", FALSE); Module_List::initialize_component("RUA_Emulation", "RUA_ConnHdlr", FALSE); Module_List::initialize_component("RAN_Emulation", "RAN_ConnHdlr", FALSE); Module_List::initialize_component("StatsD_Checker", "StatsD_ConnHdlr", FALSE); } ConnHdlr_component_g__sccp__conn__id.clean_up(); ConnHdlr_component_g__pars.clean_up(); ConnHdlr_component_HNBGWVTY.activate_port(); return TRUE; } else return FALSE; } boolean init_system_port(const char* component_type, const char* port_name) { if (!strcmp(component_type, "ConnHdlr")) { if (!strcmp(port_name, "HNBGWVTY")) { ConnHdlr_component_HNBGWVTY.safe_start(); return TRUE; } if (!strcmp(port_name, "LOCK")) { Mutex::MutexCT_component_LOCK.safe_start(); return TRUE; } if (!strcmp(port_name, "MGCP")) { MGCP__Emulation::MGCP__ConnHdlr_component_MGCP.safe_start(); return TRUE; } if (!strcmp(port_name, "MGCP_MULTI")) { MGCP__Emulation::MGCP__ConnHdlr_component_MGCP__MULTI.safe_start(); return TRUE; } if (!strcmp(port_name, "MGCP_PROC")) { MGCP__Emulation::MGCP__ConnHdlr_component_MGCP__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "PFCP")) { PFCP__Emulation::PFCP__ConnHdlr_component_PFCP.safe_start(); return TRUE; } if (!strcmp(port_name, "PFCP_PROC")) { PFCP__Emulation::PFCP__ConnHdlr_component_PFCP__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "RAN_CONN")) { RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN.safe_start(); return TRUE; } if (!strcmp(port_name, "RAN_CONN_PROC")) { RAN__Emulation::RAN__ConnHdlr_component_RAN__CONN__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "RUA")) { RUA__Emulation::RUA__ConnHdlr_component_RUA.safe_start(); return TRUE; } if (!strcmp(port_name, "STATSD_PROC")) { StatsD__Checker::StatsD__ConnHdlr_component_STATSD__PROC.safe_start(); return TRUE; } if (!strcmp(port_name, "UNLOCK")) { Mutex::MutexCT_component_UNLOCK.safe_start(); return TRUE; } } return FALSE; } boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments) { if (!strcmp(function_name, "f_create_ranap_exp")) { OCTETSTRING l3__enc; l3__enc.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_ranap_exp("); l3__enc.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__create__ranap__exp(l3__enc); TTCN_Runtime::function_finished("f_create_ranap_exp"); return TRUE; } else if (!strcmp(function_name, "f_handler_init")) { void__fn fn; CHARSTRING id; TestHdlrParams pars; fn.decode_text(function_arguments); id.decode_text(function_arguments); pars.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_handler_init("); fn.log(); TTCN_Logger::log_event_str(", "); id.log(); TTCN_Logger::log_event_str(", "); pars.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__handler__init(fn, id, pars); TTCN_Runtime::function_finished("f_handler_init"); return TRUE; } else if (!strcmp(function_name, "f_bssap_expect")) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_bssap_expect("); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__bssap__expect(exp__rx); TTCN_Runtime::function_finished("f_bssap_expect"); return TRUE; } else if (!strcmp(function_name, "f_iuh2iu")) { RANAP__PDU__Descriptions::RANAP__PDU_template tx; RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; tx.decode_text(function_arguments); exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__iuh2iu(tx, exp__rx); TTCN_Runtime::function_finished("f_iuh2iu"); return TRUE; } else if (!strcmp(function_name, "f_iu2iuh")) { RANAP__PDU__Descriptions::RANAP__PDU_template tx; RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; tx.decode_text(function_arguments); exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iu2iuh("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__iu2iuh(tx, exp__rx); TTCN_Runtime::function_finished("f_iu2iuh"); return TRUE; } else if (!strcmp(function_name, "f_rua_expect")) { RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_rua_expect("); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__rua__expect(exp__rx); TTCN_Runtime::function_finished("f_rua_expect"); return TRUE; } else if (!strcmp(function_name, "f_iuh2iu_connect")) { RANAP__PDU__Descriptions::RANAP__PDU_template tx; RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; tx.decode_text(function_arguments); exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu_connect("); tx.log(); TTCN_Logger::log_event_str(", "); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__iuh2iu__connect(tx, exp__rx); TTCN_Runtime::function_finished("f_iuh2iu_connect"); return TRUE; } else if (!strcmp(function_name, "f_iuh2iu_disconnect")) { RANAP__PDU__Descriptions::RANAP__PDU_template tx; RUA__IEs::Cause cause; RANAP__PDU__Descriptions::RANAP__PDU_template exp__rx; tx.decode_text(function_arguments); cause.decode_text(function_arguments); exp__rx.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_iuh2iu_disconnect("); tx.log(); TTCN_Logger::log_event_str(", "); cause.log(); TTCN_Logger::log_event_str(", "); exp__rx.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__iuh2iu__disconnect(tx, cause, exp__rx); TTCN_Runtime::function_finished("f_iuh2iu_disconnect"); return TRUE; } else if (!strcmp(function_name, "f_cn_iu_release_procedure")) { BOOLEAN mgcp__teardown; BOOLEAN pfcp__teardown; mgcp__teardown.decode_text(function_arguments); pfcp__teardown.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_cn_iu_release_procedure("); mgcp__teardown.log(); TTCN_Logger::log_event_str(", "); pfcp__teardown.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__cn__iu__release__procedure(mgcp__teardown, pfcp__teardown); TTCN_Runtime::function_finished("f_cn_iu_release_procedure"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_req_cs")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_req_cs()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__req__cs(); TTCN_Runtime::function_finished("f_rab_ass_req_cs"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_resp_cs")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_resp_cs()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__resp__cs(); TTCN_Runtime::function_finished("f_rab_ass_resp_cs"); return TRUE; } else if (!strcmp(function_name, "f_create_rab_cs")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_rab_cs()."); TTCN_Runtime::function_started(function_arguments); f__create__rab__cs(); TTCN_Runtime::function_finished("f_create_rab_cs"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_req_ps_with_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_req_ps_with_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__req__ps__with__pfcp(); TTCN_Runtime::function_finished("f_rab_ass_req_ps_with_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_resp_ps_with_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_resp_ps_with_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__resp__ps__with__pfcp(); TTCN_Runtime::function_finished("f_rab_ass_resp_ps_with_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_create_rab_ps_with_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_rab_ps_with_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__create__rab__ps__with__pfcp(); TTCN_Runtime::function_finished("f_create_rab_ps_with_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_req_ps_without_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_req_ps_without_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__req__ps__without__pfcp(); TTCN_Runtime::function_finished("f_rab_ass_req_ps_without_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_rab_ass_resp_ps_without_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rab_ass_resp_ps_without_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__rab__ass__resp__ps__without__pfcp(); TTCN_Runtime::function_finished("f_rab_ass_resp_ps_without_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_create_rab_ps_without_pfcp")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_rab_ps_without_pfcp()."); TTCN_Runtime::function_started(function_arguments); f__create__rab__ps__without__pfcp(); TTCN_Runtime::function_finished("f_create_rab_ps_without_pfcp"); return TRUE; } else if (!strcmp(function_name, "f_create_rab_ps")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_rab_ps()."); TTCN_Runtime::function_started(function_arguments); f__create__rab__ps(); TTCN_Runtime::function_finished("f_create_rab_ps"); return TRUE; } else if (!strcmp(function_name, "f_pfcp_expect")) { PFCP__Types::PDU__PFCP_template exp__rx; FLOAT wait__time; exp__rx.decode_text(function_arguments); wait__time.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_pfcp_expect("); exp__rx.log(); TTCN_Logger::log_event_str(", "); wait__time.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__pfcp__expect(exp__rx, wait__time); TTCN_Runtime::function_finished("f_pfcp_expect"); return TRUE; } else if (!strcmp(function_name, "f_perform_compl_l3")) { OCTETSTRING nas; BOOLEAN do__clear; BOOLEAN expect__success; nas.decode_text(function_arguments); do__clear.decode_text(function_arguments); expect__success.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_perform_compl_l3("); nas.log(); TTCN_Logger::log_event_str(", "); do__clear.log(); TTCN_Logger::log_event_str(", "); expect__success.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__perform__compl__l3(nas, do__clear, expect__success); TTCN_Runtime::function_finished("f_perform_compl_l3"); return TRUE; } else return FALSE; } } /* end of namespace */