// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 9.0.0 // for (build@df34402ede0d) on Tue Jun 25 17:59:45 2024 // Copyright (c) 2000-2023 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "UPF_Tests.hh" namespace UPF__Tests { /* Literal string constants */ const unsigned char os_2_octets[] = { 0, 0, 0, 0 }, os_3_octets[] = { 0, 0, 0, 0, 0, 0, 0, 0 }, os_0_octets[] = { 23 }, os_1_octets[] = { 42 }; extern const OCTETSTRING os_2(4, os_2_octets), os_3(8, os_3_octets), os_0(1, os_0_octets), os_1(1, os_1_octets); extern const CHARSTRING cs_58(0, NULL), cs_60(12, "\aexample\003com"), cs_29('\n'), cs_7(' '), cs_55(3, " = "), cs_63(20, " but osmo-upf chose "), cs_57(26, " not found in PFCP message"), cs_62(29, "' should have yielded GTP IP "), cs_50(8, "() start"), cs_11(','), cs_35('/'), cs_10(8, "00000000"), cs_9(16, "0000000000000000"), cs_0(9, "127.0.0.1"), cs_1(9, "127.0.0.2"), cs_59(9, "127.0.0.3"), cs_2(9, "127.0.1.1"), cs_3(9, "127.0.1.2"), cs_4(9, "127.0.2.1"), cs_5(9, "127.0.2.2"), cs_51(13, "192.168.23.42"), cs_6(':'), cs_8(3, ":0x"), cs_30(11, "ESTABLISHED"), cs_36(10, "FAR-active"), cs_12(3, "GTP"), cs_15(12, "GTP-access-l"), cs_13(12, "GTP-access-r"), cs_37(10, "GTP-active"), cs_26(10, "GTP-core-l"), cs_24(10, "GTP-core-r"), cs_22(9, "IP-core-l"), cs_42(6, "Mapped"), cs_61(18, "Network Instance '"), cs_56(7, "PDR Id "), cs_17(10, "PDR-access"), cs_34(10, "PDR-active"), cs_21(8, "PDR-core"), cs_18(9, "PFCP-peer"), cs_19(6, "SEID-l"), cs_32(6, "SEID-r"), cs_16(13, "TEID-access-l"), cs_14(13, "TEID-access-r"), cs_27(11, "TEID-core-l"), cs_25(11, "TEID-core-r"), cs_44(7, "VirtCPF"), cs_52(6, "access"), cs_64(7, "access2"), cs_46(11, "add access "), cs_47(12, "add access2 "), cs_48(9, "add core "), cs_49(10, "add core2 "), cs_45(5, "clear"), cs_53(4, "core"), cs_65(5, "core2"), cs_43(6, "enable"), cs_40(3, "end"), cs_41(3, "foo"), cs_39(7, "netinst"), cs_54(38, "osmo-upf has chosen local F-TEID: PDR-"), cs_31(4, "peer"), cs_28(8, "show gtp"), cs_38(12, "show session"), cs_33(5, "state"), cs_20(6, "tunend"), cs_23(6, "tunmap"); const unsigned char module_checksum[] = { 0xcb, 0x26, 0xc0, 0xdd, 0xe0, 0xfb, 0x01, 0x53, 0x59, 0x40, 0x34, 0x45, 0x00, 0x54, 0x23, 0xb9 }; /* Global variable definitions */ CHARSTRING modulepar_mp__pfcp__ip__upf; const CHARSTRING& mp__pfcp__ip__upf = modulepar_mp__pfcp__ip__upf; CHARSTRING modulepar_mp__pfcp__ip__local; const CHARSTRING& mp__pfcp__ip__local = modulepar_mp__pfcp__ip__local; CHARSTRING modulepar_mp__netinst__access__ip__1; const CHARSTRING& mp__netinst__access__ip__1 = modulepar_mp__netinst__access__ip__1; CHARSTRING modulepar_mp__netinst__access__ip__2; const CHARSTRING& mp__netinst__access__ip__2 = modulepar_mp__netinst__access__ip__2; CHARSTRING modulepar_mp__netinst__core__ip__1; const CHARSTRING& mp__netinst__core__ip__1 = modulepar_mp__netinst__core__ip__1; CHARSTRING modulepar_mp__netinst__core__ip__2; const CHARSTRING& mp__netinst__core__ip__2 = modulepar_mp__netinst__core__ip__2; BOOLEAN modulepar_mp__verify__gtp__actions; const BOOLEAN& mp__verify__gtp__actions = modulepar_mp__verify__gtp__actions; const TTCN_Typedescriptor_t& test__CT_descr_ = COMPONENT_descr_; PFCP__Emulation::PFCPEM__PT test__CT_component_PFCP("PFCP"); TELNETasp__PortType::TELNETasp__PT test__CT_component_UPFVTY("UPFVTY"); TIMER test__CT_component_T__guard("T_guard", 1.5e1); CHARSTRING const_f__get__name__val_sep_defval; const CHARSTRING& f__get__name__val_sep_defval = const_f__get__name__val_sep_defval; CHARSTRING const_f__get__name__val_delim_defval; const CHARSTRING& f__get__name__val_delim_defval = const_f__get__name__val_delim_defval; CHARSTRING const_f__get__name__val__2int_delim_defval; const CHARSTRING& f__get__name__val__2int_delim_defval = const_f__get__name__val__2int_delim_defval; const XERdescriptor_t PFCP__session_up__seid_xer_ = { {"up_seid>\n", "up_seid>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int PFCP__session_up__seid_oer_ext_arr_[0] = {}; const int PFCP__session_up__seid_oer_p_[0] = {}; const TTCN_OERdescriptor_t PFCP__session_up__seid_oer_ = { -1, TRUE, 8, FALSE, 0, 0, PFCP__session_up__seid_oer_ext_arr_, 0, PFCP__session_up__seid_oer_p_}; const TTCN_Typedescriptor_t PFCP__session_up__seid_descr_ = { "@UPF_Tests.PFCP_session.up_seid", &OCTETSTRING_ber_, &General__Types::OCT8_raw_, &OCTETSTRING_text_, &PFCP__session_up__seid_xer_, &OCTETSTRING_json_, &PFCP__session_up__seid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PFCP__session_up__seid_default_coding("RAW"); const XERdescriptor_t PFCP__session_cp__seid_xer_ = { {"cp_seid>\n", "cp_seid>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int PFCP__session_cp__seid_oer_ext_arr_[0] = {}; const int PFCP__session_cp__seid_oer_p_[0] = {}; const TTCN_OERdescriptor_t PFCP__session_cp__seid_oer_ = { -1, TRUE, 8, FALSE, 0, 0, PFCP__session_cp__seid_oer_ext_arr_, 0, PFCP__session_cp__seid_oer_p_}; const TTCN_Typedescriptor_t PFCP__session_cp__seid_descr_ = { "@UPF_Tests.PFCP_session.cp_seid", &OCTETSTRING_ber_, &General__Types::OCT8_raw_, &OCTETSTRING_text_, &PFCP__session_cp__seid_xer_, &OCTETSTRING_json_, &PFCP__session_cp__seid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PFCP__session_cp__seid_default_coding("RAW"); const XERdescriptor_t GTP__Action_kind_xer_ = { {"kind>\n", "kind>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action_kind_descr_ = { "@UPF_Tests.GTP_Action.kind", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, >P__Action_kind_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tun_pdr__id_xer_ = { {"pdr_id>\n", "pdr_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tun_pdr__id_descr_ = { "@UPF_Tests.GTP_Action_tun.pdr_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, >P__Action__tun_pdr__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tun_gtp__ip__l_xer_ = { {"gtp_ip_l>\n", "gtp_ip_l>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tun_gtp__ip__l_descr_ = { "@UPF_Tests.GTP_Action_tun.gtp_ip_l", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, >P__Action__tun_gtp__ip__l_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tun_teid__l_xer_ = { {"teid_l>\n", "teid_l>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int GTP__Action__tun_teid__l_oer_ext_arr_[0] = {}; const int GTP__Action__tun_teid__l_oer_p_[0] = {}; const TTCN_OERdescriptor_t GTP__Action__tun_teid__l_oer_ = { -1, TRUE, 4, FALSE, 0, 0, GTP__Action__tun_teid__l_oer_ext_arr_, 0, GTP__Action__tun_teid__l_oer_p_}; const TTCN_Typedescriptor_t GTP__Action__tun_teid__l_descr_ = { "@UPF_Tests.GTP_Action_tun.teid_l", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, >P__Action__tun_teid__l_xer_, &OCTETSTRING_json_, >P__Action__tun_teid__l_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GTP__Action__tun_teid__l_default_coding("RAW"); const XERdescriptor_t GTP__Action__tun_far__id_xer_ = { {"far_id>\n", "far_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tun_far__id_descr_ = { "@UPF_Tests.GTP_Action_tun.far_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, >P__Action__tun_far__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tun_gtp__ip__r_xer_ = { {"gtp_ip_r>\n", "gtp_ip_r>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tun_gtp__ip__r_descr_ = { "@UPF_Tests.GTP_Action_tun.gtp_ip_r", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, >P__Action__tun_gtp__ip__r_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tun_teid__r_xer_ = { {"teid_r>\n", "teid_r>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int GTP__Action__tun_teid__r_oer_ext_arr_[0] = {}; const int GTP__Action__tun_teid__r_oer_p_[0] = {}; const TTCN_OERdescriptor_t GTP__Action__tun_teid__r_oer_ = { -1, TRUE, 4, FALSE, 0, 0, GTP__Action__tun_teid__r_oer_ext_arr_, 0, GTP__Action__tun_teid__r_oer_p_}; const TTCN_Typedescriptor_t GTP__Action__tun_teid__r_descr_ = { "@UPF_Tests.GTP_Action_tun.teid_r", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, >P__Action__tun_teid__r_xer_, &OCTETSTRING_json_, >P__Action__tun_teid__r_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GTP__Action__tun_teid__r_default_coding("RAW"); // No XER for GTP__Action__tun const TTCN_Typedescriptor_t GTP__Action__tun_descr_ = { "@UPF_Tests.GTP_Action_tun", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for GTP__Action__core const TTCN_Typedescriptor_t GTP__Action__core_descr_ = { "@UPF_Tests.GTP_Action_core", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tunend_pdr__id_xer_ = { {"pdr_id>\n", "pdr_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tunend_pdr__id_descr_ = { "@UPF_Tests.GTP_Action_tunend.pdr_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, >P__Action__tunend_pdr__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tunend_ip__l_xer_ = { {"ip_l>\n", "ip_l>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tunend_ip__l_descr_ = { "@UPF_Tests.GTP_Action_tunend.ip_l", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, >P__Action__tunend_ip__l_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action__tunend_far__id_xer_ = { {"far_id>\n", "far_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action__tunend_far__id_descr_ = { "@UPF_Tests.GTP_Action_tunend.far_id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, >P__Action__tunend_far__id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for GTP__Action__tunend const TTCN_Typedescriptor_t GTP__Action__tunend_descr_ = { "@UPF_Tests.GTP_Action_tunend", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action_pfcp__peer_xer_ = { {"pfcp_peer>\n", "pfcp_peer>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t GTP__Action_pfcp__peer_descr_ = { "@UPF_Tests.GTP_Action.pfcp_peer", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, >P__Action_pfcp__peer_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t GTP__Action_seid__l_xer_ = { {"seid_l>\n", "seid_l>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int GTP__Action_seid__l_oer_ext_arr_[0] = {}; const int GTP__Action_seid__l_oer_p_[0] = {}; const TTCN_OERdescriptor_t GTP__Action_seid__l_oer_ = { -1, TRUE, 8, FALSE, 0, 0, GTP__Action_seid__l_oer_ext_arr_, 0, GTP__Action_seid__l_oer_p_}; const TTCN_Typedescriptor_t GTP__Action_seid__l_descr_ = { "@UPF_Tests.GTP_Action.seid_l", &OCTETSTRING_ber_, &General__Types::OCT8_raw_, &OCTETSTRING_text_, >P__Action_seid__l_xer_, &OCTETSTRING_json_, >P__Action_seid__l_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GTP__Action_seid__l_default_coding("RAW"); // No XER for GTP__Action const TTCN_Typedescriptor_t GTP__Action_descr_ = { "@UPF_Tests.GTP_Action", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for PFCP__session const TTCN_Typedescriptor_t PFCP__session_descr_ = { "@UPF_Tests.PFCP_session", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for GTP__Action__List const TTCN_Typedescriptor_t GTP__Action__List_descr_ = { "@UPF_Tests.GTP_Action_List", NULL, NULL, NULL, NULL, NULL, NULL, NULL, >P__Action_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_peer_xer_ = { {"peer>\n", "peer>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_peer_descr_ = { "@UPF_Tests.PFCP_Session_Status.peer", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &PFCP__Session__Status_peer_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_seid__r_xer_ = { {"seid_r>\n", "seid_r>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int PFCP__Session__Status_seid__r_oer_ext_arr_[0] = {}; const int PFCP__Session__Status_seid__r_oer_p_[0] = {}; const TTCN_OERdescriptor_t PFCP__Session__Status_seid__r_oer_ = { -1, TRUE, 8, FALSE, 0, 0, PFCP__Session__Status_seid__r_oer_ext_arr_, 0, PFCP__Session__Status_seid__r_oer_p_}; const TTCN_Typedescriptor_t PFCP__Session__Status_seid__r_descr_ = { "@UPF_Tests.PFCP_Session_Status.seid_r", &OCTETSTRING_ber_, &General__Types::OCT8_raw_, &OCTETSTRING_text_, &PFCP__Session__Status_seid__r_xer_, &OCTETSTRING_json_, &PFCP__Session__Status_seid__r_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PFCP__Session__Status_seid__r_default_coding("RAW"); const XERdescriptor_t PFCP__Session__Status_seid__l_xer_ = { {"seid_l>\n", "seid_l>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int PFCP__Session__Status_seid__l_oer_ext_arr_[0] = {}; const int PFCP__Session__Status_seid__l_oer_p_[0] = {}; const TTCN_OERdescriptor_t PFCP__Session__Status_seid__l_oer_ = { -1, TRUE, 8, FALSE, 0, 0, PFCP__Session__Status_seid__l_oer_ext_arr_, 0, PFCP__Session__Status_seid__l_oer_p_}; const TTCN_Typedescriptor_t PFCP__Session__Status_seid__l_descr_ = { "@UPF_Tests.PFCP_Session_Status.seid_l", &OCTETSTRING_ber_, &General__Types::OCT8_raw_, &OCTETSTRING_text_, &PFCP__Session__Status_seid__l_xer_, &OCTETSTRING_json_, &PFCP__Session__Status_seid__l_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PFCP__Session__Status_seid__l_default_coding("RAW"); const XERdescriptor_t PFCP__Session__Status_state_xer_ = { {"state>\n", "state>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_state_descr_ = { "@UPF_Tests.PFCP_Session_Status.state", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &PFCP__Session__Status_state_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_pdr__active__count_xer_ = { {"pdr_active_count>\n", "pdr_active_count>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_pdr__active__count_descr_ = { "@UPF_Tests.PFCP_Session_Status.pdr_active_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PFCP__Session__Status_pdr__active__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_pdr__count_xer_ = { {"pdr_count>\n", "pdr_count>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_pdr__count_descr_ = { "@UPF_Tests.PFCP_Session_Status.pdr_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PFCP__Session__Status_pdr__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_far__active__count_xer_ = { {"far_active_count>\n", "far_active_count>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_far__active__count_descr_ = { "@UPF_Tests.PFCP_Session_Status.far_active_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PFCP__Session__Status_far__active__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_far__count_xer_ = { {"far_count>\n", "far_count>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_far__count_descr_ = { "@UPF_Tests.PFCP_Session_Status.far_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PFCP__Session__Status_far__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t PFCP__Session__Status_gtp__active__count_xer_ = { {"gtp_active_count>\n", "gtp_active_count>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t PFCP__Session__Status_gtp__active__count_descr_ = { "@UPF_Tests.PFCP_Session_Status.gtp_active_count", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PFCP__Session__Status_gtp__active__count_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for PFCP__Session__Status const TTCN_Typedescriptor_t PFCP__Session__Status_descr_ = { "@UPF_Tests.PFCP_Session_Status", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; PFCP__Session__Status_template template_PFCP__session__active; const PFCP__Session__Status_template& PFCP__session__active = template_PFCP__session__active; PFCP__Session__Status_template template_PFCP__session__inactive; const PFCP__Session__Status_template& PFCP__session__inactive = template_PFCP__session__inactive; // No XER for PFCP__Session__Status__List const TTCN_Typedescriptor_t PFCP__Session__Status__List_descr_ = { "@UPF_Tests.PFCP_Session_Status_List", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &PFCP__Session__Status_descr_, TTCN_Typedescriptor_t::DONTCARE }; CHARSTRING const_f__init__vty_id_defval; const CHARSTRING& f__init__vty_id_defval = const_f__init__vty_id_defval; FLOAT const_f__init_guard__timeout_defval; const FLOAT& f__init_guard__timeout_defval = const_f__init_guard__timeout_defval; // No XER for void__fn const TTCN_Typedescriptor_t void__fn_descr_ = { "@UPF_Tests.void_fn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; CPF__ConnectionHandler::TestHdlrParams_template template_f__start__handler_pars__tmpl_defval; const CPF__ConnectionHandler::TestHdlrParams_template& f__start__handler_pars__tmpl_defval = template_f__start__handler_pars__tmpl_defval; UNIVERSAL_CHARSTRING PFCP__Ruleset_pdr_default_coding("RAW"); UNIVERSAL_CHARSTRING PFCP__Ruleset_far_default_coding("RAW"); // No XER for PFCP__Ruleset const TTCN_Typedescriptor_t PFCP__Ruleset_descr_ = { "@UPF_Tests.PFCP_Ruleset", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; CHARSTRING const_f__ruleset__add__GTP__encaps_ue__addr__v4_defval; const CHARSTRING& f__ruleset__add__GTP__encaps_ue__addr__v4_defval = const_f__ruleset__add__GTP__encaps_ue__addr__v4_defval; CHARSTRING const_f__ruleset__tunend_netinst__access_defval; const CHARSTRING& f__ruleset__tunend_netinst__access_defval = const_f__ruleset__tunend_netinst__access_defval; BOOLEAN const_f__ruleset__tunmap_core__gtp__known_defval; const BOOLEAN& f__ruleset__tunmap_core__gtp__known_defval = const_f__ruleset__tunmap_core__gtp__known_defval; CHARSTRING const_f__ruleset__tunmap_netinst__access_defval; const CHARSTRING& f__ruleset__tunmap_netinst__access_defval = const_f__ruleset__tunmap_netinst__access_defval; CHARSTRING const_f__ruleset__tunmap_netinst__core_defval; const CHARSTRING& f__ruleset__tunmap_netinst__core_defval = const_f__ruleset__tunmap_netinst__core_defval; TTCN_Module module_object("UPF_Tests", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, init_comp_type, init_system_port, start_ptc_function, module_control_part); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_9, current_runtime_version.requires_minor_version_0, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Member functions of C++ classes */ as__Tguard_Default::as__Tguard_Default() : Default_Base("as_Tguard") { } alt_status as__Tguard_Default::call_altstep() { return as__Tguard_instance(); } GTP__Action__tun::GTP__Action__tun() { } GTP__Action__tun::GTP__Action__tun(const INTEGER& par_pdr__id, const CHARSTRING& par_gtp__ip__l, const OCTETSTRING& par_teid__l, const INTEGER& par_far__id, const CHARSTRING& par_gtp__ip__r, const OCTETSTRING& par_teid__r) : field_pdr__id(par_pdr__id), field_gtp__ip__l(par_gtp__ip__l), field_teid__l(par_teid__l), field_far__id(par_far__id), field_gtp__ip__r(par_gtp__ip__r), field_teid__r(par_teid__r) { } GTP__Action__tun::GTP__Action__tun(const GTP__Action__tun& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @UPF_Tests.GTP_Action_tun."); if (other_value.pdr__id().is_bound()) field_pdr__id = other_value.pdr__id(); else field_pdr__id.clean_up(); if (other_value.gtp__ip__l().is_bound()) field_gtp__ip__l = other_value.gtp__ip__l(); else field_gtp__ip__l.clean_up(); if (other_value.teid__l().is_bound()) field_teid__l = other_value.teid__l(); else field_teid__l.clean_up(); if (other_value.far__id().is_bound()) field_far__id = other_value.far__id(); else field_far__id.clean_up(); if (other_value.gtp__ip__r().is_bound()) field_gtp__ip__r = other_value.gtp__ip__r(); else field_gtp__ip__r.clean_up(); if (other_value.teid__r().is_bound()) field_teid__r = other_value.teid__r(); else field_teid__r.clean_up(); } void GTP__Action__tun::clean_up() { field_pdr__id.clean_up(); field_gtp__ip__l.clean_up(); field_teid__l.clean_up(); field_far__id.clean_up(); field_gtp__ip__r.clean_up(); field_teid__r.clean_up(); } const TTCN_Typedescriptor_t* GTP__Action__tun::get_descriptor() const { return >P__Action__tun_descr_; } GTP__Action__tun& GTP__Action__tun::operator=(const GTP__Action__tun& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @UPF_Tests.GTP_Action_tun."); if (other_value.pdr__id().is_bound()) field_pdr__id = other_value.pdr__id(); else field_pdr__id.clean_up(); if (other_value.gtp__ip__l().is_bound()) field_gtp__ip__l = other_value.gtp__ip__l(); else field_gtp__ip__l.clean_up(); if (other_value.teid__l().is_bound()) field_teid__l = other_value.teid__l(); else field_teid__l.clean_up(); if (other_value.far__id().is_bound()) field_far__id = other_value.far__id(); else field_far__id.clean_up(); if (other_value.gtp__ip__r().is_bound()) field_gtp__ip__r = other_value.gtp__ip__r(); else field_gtp__ip__r.clean_up(); if (other_value.teid__r().is_bound()) field_teid__r = other_value.teid__r(); else field_teid__r.clean_up(); } return *this; } boolean GTP__Action__tun::operator==(const GTP__Action__tun& other_value) const { return field_pdr__id==other_value.field_pdr__id && field_gtp__ip__l==other_value.field_gtp__ip__l && field_teid__l==other_value.field_teid__l && field_far__id==other_value.field_far__id && field_gtp__ip__r==other_value.field_gtp__ip__r && field_teid__r==other_value.field_teid__r; } boolean GTP__Action__tun::is_bound() const { return (field_pdr__id.is_bound()) || (field_gtp__ip__l.is_bound()) || (field_teid__l.is_bound()) || (field_far__id.is_bound()) || (field_gtp__ip__r.is_bound()) || (field_teid__r.is_bound()); } boolean GTP__Action__tun::is_value() const { return field_pdr__id.is_value() && field_gtp__ip__l.is_value() && field_teid__l.is_value() && field_far__id.is_value() && field_gtp__ip__r.is_value() && field_teid__r.is_value(); } void GTP__Action__tun::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pdr_id := "); field_pdr__id.log(); TTCN_Logger::log_event_str(", gtp_ip_l := "); field_gtp__ip__l.log(); TTCN_Logger::log_event_str(", teid_l := "); field_teid__l.log(); TTCN_Logger::log_event_str(", far_id := "); field_far__id.log(); TTCN_Logger::log_event_str(", gtp_ip_r := "); field_gtp__ip__r.log(); TTCN_Logger::log_event_str(", teid_r := "); field_teid__r.log(); TTCN_Logger::log_event_str(" }"); } void GTP__Action__tun::set_implicit_omit() { if (pdr__id().is_bound()) pdr__id().set_implicit_omit(); if (gtp__ip__l().is_bound()) gtp__ip__l().set_implicit_omit(); if (teid__l().is_bound()) teid__l().set_implicit_omit(); if (far__id().is_bound()) far__id().set_implicit_omit(); if (gtp__ip__r().is_bound()) gtp__ip__r().set_implicit_omit(); if (teid__r().is_bound()) teid__r().set_implicit_omit(); } void GTP__Action__tun::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (60 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) pdr__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gtp__ip__l().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) teid__l().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) far__id().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gtp__ip__r().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) teid__r().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_ip_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__ip__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_ip_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__ip__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action_tun: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.GTP_Action_tun"); } } void GTP__Action__tun::encode_text(Text_Buf& text_buf) const { field_pdr__id.encode_text(text_buf); field_gtp__ip__l.encode_text(text_buf); field_teid__l.encode_text(text_buf); field_far__id.encode_text(text_buf); field_gtp__ip__r.encode_text(text_buf); field_teid__r.encode_text(text_buf); } void GTP__Action__tun::decode_text(Text_Buf& text_buf) { field_pdr__id.decode_text(text_buf); field_gtp__ip__l.decode_text(text_buf); field_teid__l.decode_text(text_buf); field_far__id.decode_text(text_buf); field_gtp__ip__r.decode_text(text_buf); field_teid__r.decode_text(text_buf); } struct GTP__Action__tun_template::single_value_struct { INTEGER_template field_pdr__id; CHARSTRING_template field_gtp__ip__l; OCTETSTRING_template field_teid__l; INTEGER_template field_far__id; CHARSTRING_template field_gtp__ip__r; OCTETSTRING_template field_teid__r; }; void GTP__Action__tun_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_pdr__id = ANY_VALUE; single_value->field_gtp__ip__l = ANY_VALUE; single_value->field_teid__l = ANY_VALUE; single_value->field_far__id = ANY_VALUE; single_value->field_gtp__ip__r = ANY_VALUE; single_value->field_teid__r = ANY_VALUE; } } } void GTP__Action__tun_template::copy_value(const GTP__Action__tun& other_value) { single_value = new single_value_struct; if (other_value.pdr__id().is_bound()) { single_value->field_pdr__id = other_value.pdr__id(); } else { single_value->field_pdr__id.clean_up(); } if (other_value.gtp__ip__l().is_bound()) { single_value->field_gtp__ip__l = other_value.gtp__ip__l(); } else { single_value->field_gtp__ip__l.clean_up(); } if (other_value.teid__l().is_bound()) { single_value->field_teid__l = other_value.teid__l(); } else { single_value->field_teid__l.clean_up(); } if (other_value.far__id().is_bound()) { single_value->field_far__id = other_value.far__id(); } else { single_value->field_far__id.clean_up(); } if (other_value.gtp__ip__r().is_bound()) { single_value->field_gtp__ip__r = other_value.gtp__ip__r(); } else { single_value->field_gtp__ip__r.clean_up(); } if (other_value.teid__r().is_bound()) { single_value->field_teid__r = other_value.teid__r(); } else { single_value->field_teid__r.clean_up(); } set_selection(SPECIFIC_VALUE); } void GTP__Action__tun_template::copy_template(const GTP__Action__tun_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pdr__id().get_selection()) { single_value->field_pdr__id = other_value.pdr__id(); } else { single_value->field_pdr__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtp__ip__l().get_selection()) { single_value->field_gtp__ip__l = other_value.gtp__ip__l(); } else { single_value->field_gtp__ip__l.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.teid__l().get_selection()) { single_value->field_teid__l = other_value.teid__l(); } else { single_value->field_teid__l.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.far__id().get_selection()) { single_value->field_far__id = other_value.far__id(); } else { single_value->field_far__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtp__ip__r().get_selection()) { single_value->field_gtp__ip__r = other_value.gtp__ip__r(); } else { single_value->field_gtp__ip__r.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.teid__r().get_selection()) { single_value->field_teid__r = other_value.teid__r(); } else { single_value->field_teid__r.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 GTP__Action__tun_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 GTP__Action__tun_template(*other_value.implication_.precondition); implication_.implied_template = new GTP__Action__tun_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 @UPF_Tests.GTP_Action_tun."); break; } set_selection(other_value); } GTP__Action__tun_template::GTP__Action__tun_template() { } GTP__Action__tun_template::GTP__Action__tun_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GTP__Action__tun_template::GTP__Action__tun_template(const GTP__Action__tun& other_value) { copy_value(other_value); } GTP__Action__tun_template::GTP__Action__tun_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__tun&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.GTP_Action_tun from an unbound optional field."); } } GTP__Action__tun_template::GTP__Action__tun_template(GTP__Action__tun_template* p_precondition, GTP__Action__tun_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GTP__Action__tun_template::GTP__Action__tun_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; } GTP__Action__tun_template::GTP__Action__tun_template(const GTP__Action__tun_template& other_value) : Base_Template() { copy_template(other_value); } GTP__Action__tun_template::~GTP__Action__tun_template() { clean_up(); } GTP__Action__tun_template& GTP__Action__tun_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GTP__Action__tun_template& GTP__Action__tun_template::operator=(const GTP__Action__tun& other_value) { clean_up(); copy_value(other_value); return *this; } GTP__Action__tun_template& GTP__Action__tun_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__tun&)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 @UPF_Tests.GTP_Action_tun."); } return *this; } GTP__Action__tun_template& GTP__Action__tun_template::operator=(const GTP__Action__tun_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GTP__Action__tun_template::match(const GTP__Action__tun& 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.pdr__id().is_bound()) return FALSE; if(!single_value->field_pdr__id.match(other_value.pdr__id(), legacy))return FALSE; if(!other_value.gtp__ip__l().is_bound()) return FALSE; if(!single_value->field_gtp__ip__l.match(other_value.gtp__ip__l(), legacy))return FALSE; if(!other_value.teid__l().is_bound()) return FALSE; if(!single_value->field_teid__l.match(other_value.teid__l(), legacy))return FALSE; if(!other_value.far__id().is_bound()) return FALSE; if(!single_value->field_far__id.match(other_value.far__id(), legacy))return FALSE; if(!other_value.gtp__ip__r().is_bound()) return FALSE; if(!single_value->field_gtp__ip__r.match(other_value.gtp__ip__r(), legacy))return FALSE; if(!other_value.teid__r().is_bound()) return FALSE; if(!single_value->field_teid__r.match(other_value.teid__r(), 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 @UPF_Tests.GTP_Action_tun."); } return FALSE; } boolean GTP__Action__tun_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pdr__id.is_bound() || single_value->field_gtp__ip__l.is_bound() || single_value->field_teid__l.is_bound() || single_value->field_far__id.is_bound() || single_value->field_gtp__ip__r.is_bound() || single_value->field_teid__r.is_bound(); } boolean GTP__Action__tun_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pdr__id.is_value() && single_value->field_gtp__ip__l.is_value() && single_value->field_teid__l.is_value() && single_value->field_far__id.is_value() && single_value->field_gtp__ip__r.is_value() && single_value->field_teid__r.is_value(); } void GTP__Action__tun_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; } GTP__Action__tun GTP__Action__tun_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 @UPF_Tests.GTP_Action_tun."); GTP__Action__tun ret_val; if (single_value->field_pdr__id.is_bound()) { ret_val.pdr__id() = single_value->field_pdr__id.valueof(); } if (single_value->field_gtp__ip__l.is_bound()) { ret_val.gtp__ip__l() = single_value->field_gtp__ip__l.valueof(); } if (single_value->field_teid__l.is_bound()) { ret_val.teid__l() = single_value->field_teid__l.valueof(); } if (single_value->field_far__id.is_bound()) { ret_val.far__id() = single_value->field_far__id.valueof(); } if (single_value->field_gtp__ip__r.is_bound()) { ret_val.gtp__ip__r() = single_value->field_gtp__ip__r.valueof(); } if (single_value->field_teid__r.is_bound()) { ret_val.teid__r() = single_value->field_teid__r.valueof(); } return ret_val; } void GTP__Action__tun_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 @UPF_Tests.GTP_Action_tun."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GTP__Action__tun_template[list_length]; } GTP__Action__tun_template& GTP__Action__tun_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 @UPF_Tests.GTP_Action_tun."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.GTP_Action_tun."); return value_list.list_value[list_index]; } INTEGER_template& GTP__Action__tun_template::pdr__id() { set_specific(); return single_value->field_pdr__id; } const INTEGER_template& GTP__Action__tun_template::pdr__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pdr_id of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_pdr__id; } CHARSTRING_template& GTP__Action__tun_template::gtp__ip__l() { set_specific(); return single_value->field_gtp__ip__l; } const CHARSTRING_template& GTP__Action__tun_template::gtp__ip__l() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp_ip_l of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_gtp__ip__l; } OCTETSTRING_template& GTP__Action__tun_template::teid__l() { set_specific(); return single_value->field_teid__l; } const OCTETSTRING_template& GTP__Action__tun_template::teid__l() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field teid_l of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_teid__l; } INTEGER_template& GTP__Action__tun_template::far__id() { set_specific(); return single_value->field_far__id; } const INTEGER_template& GTP__Action__tun_template::far__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field far_id of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_far__id; } CHARSTRING_template& GTP__Action__tun_template::gtp__ip__r() { set_specific(); return single_value->field_gtp__ip__r; } const CHARSTRING_template& GTP__Action__tun_template::gtp__ip__r() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp_ip_r of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_gtp__ip__r; } OCTETSTRING_template& GTP__Action__tun_template::teid__r() { set_specific(); return single_value->field_teid__r; } const OCTETSTRING_template& GTP__Action__tun_template::teid__r() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field teid_r of a non-specific template of type @UPF_Tests.GTP_Action_tun."); return single_value->field_teid__r; } int GTP__Action__tun_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 6; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun 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 @UPF_Tests.GTP_Action_tun containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tun containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.GTP_Action_tun."); } return 0; } void GTP__Action__tun_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pdr_id := "); single_value->field_pdr__id.log(); TTCN_Logger::log_event_str(", gtp_ip_l := "); single_value->field_gtp__ip__l.log(); TTCN_Logger::log_event_str(", teid_l := "); single_value->field_teid__l.log(); TTCN_Logger::log_event_str(", far_id := "); single_value->field_far__id.log(); TTCN_Logger::log_event_str(", gtp_ip_r := "); single_value->field_gtp__ip__r.log(); TTCN_Logger::log_event_str(", teid_r := "); single_value->field_teid__r.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 GTP__Action__tun_template::log_match(const GTP__Action__tun& 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_pdr__id.match(match_value.pdr__id(), legacy)){ TTCN_Logger::log_logmatch_info(".pdr_id"); single_value->field_pdr__id.log_match(match_value.pdr__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtp__ip__l.match(match_value.gtp__ip__l(), legacy)){ TTCN_Logger::log_logmatch_info(".gtp_ip_l"); single_value->field_gtp__ip__l.log_match(match_value.gtp__ip__l(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_teid__l.match(match_value.teid__l(), legacy)){ TTCN_Logger::log_logmatch_info(".teid_l"); single_value->field_teid__l.log_match(match_value.teid__l(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_far__id.match(match_value.far__id(), legacy)){ TTCN_Logger::log_logmatch_info(".far_id"); single_value->field_far__id.log_match(match_value.far__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtp__ip__r.match(match_value.gtp__ip__r(), legacy)){ TTCN_Logger::log_logmatch_info(".gtp_ip_r"); single_value->field_gtp__ip__r.log_match(match_value.gtp__ip__r(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_teid__r.match(match_value.teid__r(), legacy)){ TTCN_Logger::log_logmatch_info(".teid_r"); single_value->field_teid__r.log_match(match_value.teid__r(), 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("{ pdr_id := "); single_value->field_pdr__id.log_match(match_value.pdr__id(), legacy); TTCN_Logger::log_event_str(", gtp_ip_l := "); single_value->field_gtp__ip__l.log_match(match_value.gtp__ip__l(), legacy); TTCN_Logger::log_event_str(", teid_l := "); single_value->field_teid__l.log_match(match_value.teid__l(), legacy); TTCN_Logger::log_event_str(", far_id := "); single_value->field_far__id.log_match(match_value.far__id(), legacy); TTCN_Logger::log_event_str(", gtp_ip_r := "); single_value->field_gtp__ip__r.log_match(match_value.gtp__ip__r(), legacy); TTCN_Logger::log_event_str(", teid_r := "); single_value->field_teid__r.log_match(match_value.teid__r(), 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 GTP__Action__tun_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pdr__id.encode_text(text_buf); single_value->field_gtp__ip__l.encode_text(text_buf); single_value->field_teid__l.encode_text(text_buf); single_value->field_far__id.encode_text(text_buf); single_value->field_gtp__ip__r.encode_text(text_buf); single_value->field_teid__r.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 @UPF_Tests.GTP_Action_tun."); } } void GTP__Action__tun_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_pdr__id.decode_text(text_buf); single_value->field_gtp__ip__l.decode_text(text_buf); single_value->field_teid__l.decode_text(text_buf); single_value->field_far__id.decode_text(text_buf); single_value->field_gtp__ip__r.decode_text(text_buf); single_value->field_teid__r.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 GTP__Action__tun_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 @UPF_Tests.GTP_Action_tun."); } } void GTP__Action__tun_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: { GTP__Action__tun_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) pdr__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gtp__ip__l().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) teid__l().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) far__id().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gtp__ip__r().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) teid__r().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_ip_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__ip__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_ip_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__ip__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "teid_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { teid__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action_tun: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GTP__Action__tun_template* precondition = new GTP__Action__tun_template; precondition->set_param(*param.get_elem(0)); GTP__Action__tun_template* implied_template = new GTP__Action__tun_template; implied_template->set_param(*param.get_elem(1)); *this = GTP__Action__tun_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.GTP_Action_tun"); } is_ifpresent = param.get_ifpresent(); } void GTP__Action__tun_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_pdr__id.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); single_value->field_gtp__ip__l.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); single_value->field_teid__l.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); single_value->field_far__id.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); single_value->field_gtp__ip__r.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); single_value->field_teid__r.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tun"); 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 : "@UPF_Tests.GTP_Action_tun"); } boolean GTP__Action__tun_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GTP__Action__tun_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_idxis_value(); case ALT_tunmap: return field_tunmap->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void GTP__Action__core::clean_up() { switch (union_selection) { case ALT_tunend: delete field_tunend; break; case ALT_tunmap: delete field_tunmap; break; default: break; } union_selection = UNBOUND_VALUE; } void GTP__Action__core::log() const { switch (union_selection) { case ALT_tunend: TTCN_Logger::log_event_str("{ tunend := "); field_tunend->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_tunmap: TTCN_Logger::log_event_str("{ tunmap := "); field_tunmap->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void GTP__Action__core::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "tunend")) { tunend().set_param(*mp_last); if (!tunend().is_bound()) clean_up(); return; } if (!strcmp(last_name, "tunmap")) { tunmap().set_param(*mp_last); if (!tunmap().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @UPF_Tests.GTP_Action_core.", last_name); } void GTP__Action__core::set_implicit_omit() { switch (union_selection) { case ALT_tunend: field_tunend->set_implicit_omit(); break; case ALT_tunmap: field_tunmap->set_implicit_omit(); break; default: break; } } void GTP__Action__core::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_tunend: field_tunend->encode_text(text_buf); break; case ALT_tunmap: field_tunmap->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @UPF_Tests.GTP_Action_core."); } } void GTP__Action__core::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_tunend: tunend().decode_text(text_buf); break; case ALT_tunmap: tunmap().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @UPF_Tests.GTP_Action_core."); } } void GTP__Action__core_template::copy_value(const GTP__Action__core& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: single_value.field_tunend = new GTP__Action__tunend_template(other_value.tunend()); break; case GTP__Action__core::ALT_tunmap: single_value.field_tunmap = new GTP__Action__tun_template(other_value.tunmap()); break; default: TTCN_error("Initializing a template with an unbound value of type @UPF_Tests.GTP_Action_core."); } set_selection(SPECIFIC_VALUE); } void GTP__Action__core_template::copy_template(const GTP__Action__core_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: single_value.field_tunend = new GTP__Action__tunend_template(*other_value.single_value.field_tunend); break; case GTP__Action__core::ALT_tunmap: single_value.field_tunmap = new GTP__Action__tun_template(*other_value.single_value.field_tunmap); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @UPF_Tests.GTP_Action_core."); } 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 GTP__Action__core_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 GTP__Action__core_template(*other_value.implication_.precondition); implication_.implied_template = new GTP__Action__core_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 template of union type @UPF_Tests.GTP_Action_core."); } set_selection(other_value); } GTP__Action__core_template::GTP__Action__core_template() { } GTP__Action__core_template::GTP__Action__core_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GTP__Action__core_template::GTP__Action__core_template(const GTP__Action__core& other_value) { copy_value(other_value); } GTP__Action__core_template::GTP__Action__core_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__core&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @UPF_Tests.GTP_Action_core from an unbound optional field."); } } GTP__Action__core_template::GTP__Action__core_template(GTP__Action__core_template* p_precondition, GTP__Action__core_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GTP__Action__core_template::GTP__Action__core_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; } GTP__Action__core_template::GTP__Action__core_template(const GTP__Action__core_template& other_value) : Base_Template(){ copy_template(other_value); } GTP__Action__core_template::~GTP__Action__core_template() { clean_up(); } void GTP__Action__core_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: delete single_value.field_tunend; break; case GTP__Action__core::ALT_tunmap: delete single_value.field_tunmap; default: break; } 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; } GTP__Action__core_template& GTP__Action__core_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GTP__Action__core_template& GTP__Action__core_template::operator=(const GTP__Action__core& other_value) { clean_up(); copy_value(other_value); return *this; } GTP__Action__core_template& GTP__Action__core_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__core&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @UPF_Tests.GTP_Action_core."); } return *this; } GTP__Action__core_template& GTP__Action__core_template::operator=(const GTP__Action__core_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GTP__Action__core_template::match(const GTP__Action__core& 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: { GTP__Action__core::union_selection_type value_selection = other_value.get_selection(); if (value_selection == GTP__Action__core::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case GTP__Action__core::ALT_tunend: return single_value.field_tunend->match(other_value.tunend(), legacy); case GTP__Action__core::ALT_tunmap: return single_value.field_tunmap->match(other_value.tunmap(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @UPF_Tests.GTP_Action_core."); } } 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 template of union type @UPF_Tests.GTP_Action_core."); } return FALSE; } boolean GTP__Action__core_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: return single_value.field_tunend->is_value(); case GTP__Action__core::ALT_tunmap: return single_value.field_tunmap->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @UPF_Tests.GTP_Action_core."); } } GTP__Action__core GTP__Action__core_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @UPF_Tests.GTP_Action_core."); GTP__Action__core ret_val; switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: ret_val.tunend() = single_value.field_tunend->valueof(); break; case GTP__Action__core::ALT_tunmap: ret_val.tunmap() = single_value.field_tunmap->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @UPF_Tests.GTP_Action_core."); } return ret_val; } GTP__Action__core_template& GTP__Action__core_template::list_item(unsigned int list_index) const { 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 union type @UPF_Tests.GTP_Action_core."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @UPF_Tests.GTP_Action_core."); return value_list.list_value[list_index]; } void GTP__Action__core_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 ("Internal error: Setting an invalid list for a template of union type @UPF_Tests.GTP_Action_core."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GTP__Action__core_template[list_length]; } GTP__Action__tunend_template& GTP__Action__core_template::tunend() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != GTP__Action__core::ALT_tunend) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tunend = new GTP__Action__tunend_template(ANY_VALUE); else single_value.field_tunend = new GTP__Action__tunend_template; single_value.union_selection = GTP__Action__core::ALT_tunend; set_selection(SPECIFIC_VALUE); } return *single_value.field_tunend; } const GTP__Action__tunend_template& GTP__Action__core_template::tunend() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tunend in a non-specific template of union type @UPF_Tests.GTP_Action_core."); if (single_value.union_selection != GTP__Action__core::ALT_tunend) TTCN_error("Accessing non-selected field tunend in a template of union type @UPF_Tests.GTP_Action_core."); return *single_value.field_tunend; } GTP__Action__tun_template& GTP__Action__core_template::tunmap() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != GTP__Action__core::ALT_tunmap) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tunmap = new GTP__Action__tun_template(ANY_VALUE); else single_value.field_tunmap = new GTP__Action__tun_template; single_value.union_selection = GTP__Action__core::ALT_tunmap; set_selection(SPECIFIC_VALUE); } return *single_value.field_tunmap; } const GTP__Action__tun_template& GTP__Action__core_template::tunmap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tunmap in a non-specific template of union type @UPF_Tests.GTP_Action_core."); if (single_value.union_selection != GTP__Action__core::ALT_tunmap) TTCN_error("Accessing non-selected field tunmap in a template of union type @UPF_Tests.GTP_Action_core."); return *single_value.field_tunmap; } boolean GTP__Action__core_template::ischosen(GTP__Action__core::union_selection_type checked_selection) const { if (checked_selection == GTP__Action__core::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @UPF_Tests.GTP_Action_core."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == GTP__Action__core::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @UPF_Tests.GTP_Action_core."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @UPF_Tests.GTP_Action_core containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void GTP__Action__core_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: TTCN_Logger::log_event_str("{ tunend := "); single_value.field_tunend->log(); TTCN_Logger::log_event_str(" }"); break; case GTP__Action__core::ALT_tunmap: TTCN_Logger::log_event_str("{ tunmap := "); single_value.field_tunmap->log(); TTCN_Logger::log_event_str(" }"); break; default: 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 GTP__Action__core_template::log_match(const GTP__Action__core& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tunend"); single_value.field_tunend->log_match(match_value.tunend(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tunend := "); single_value.field_tunend->log_match(match_value.tunend(), legacy); TTCN_Logger::log_event_str(" }"); } break; case GTP__Action__core::ALT_tunmap: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tunmap"); single_value.field_tunmap->log_match(match_value.tunmap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tunmap := "); single_value.field_tunmap->log_match(match_value.tunmap(), legacy); TTCN_Logger::log_event_str(" }"); } break; default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 GTP__Action__core_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: single_value.field_tunend->encode_text(text_buf); break; case GTP__Action__core::ALT_tunmap: single_value.field_tunmap->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @UPF_Tests.GTP_Action_core."); } 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 template of type @UPF_Tests.GTP_Action_core."); } } void GTP__Action__core_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = GTP__Action__core::UNBOUND_VALUE; GTP__Action__core::union_selection_type new_selection = (GTP__Action__core::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case GTP__Action__core::ALT_tunend: single_value.field_tunend = new GTP__Action__tunend_template; single_value.field_tunend->decode_text(text_buf); break; case GTP__Action__core::ALT_tunmap: single_value.field_tunmap = new GTP__Action__tun_template; single_value.field_tunmap->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @UPF_Tests.GTP_Action_core."); } single_value.union_selection = new_selection; } 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 GTP__Action__core_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: Unrecognized selector was received in a template of type @UPF_Tests.GTP_Action_core."); } } boolean GTP__Action__core_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GTP__Action__core_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@UPF_Tests.GTP_Action_core'"); } if (strcmp("tunend", param_field) == 0) { tunend().set_param(param); return; } else if (strcmp("tunmap", param_field) == 0) { tunmap().set_param(param); return; } else param.error("Field `%s' not found in union template type `@UPF_Tests.GTP_Action_core'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { GTP__Action__core_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@UPF_Tests.GTP_Action_core"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "tunend")) { tunend().set_param(*mp_last); break; } if (!strcmp(last_name, "tunmap")) { tunmap().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @UPF_Tests.GTP_Action_core.", last_name); } break; case Module_Param::MP_Implication_Template: { GTP__Action__core_template* precondition = new GTP__Action__core_template; precondition->set_param(*m_p->get_elem(0)); GTP__Action__core_template* implied_template = new GTP__Action__core_template; implied_template->set_param(*m_p->get_elem(1)); *this = GTP__Action__core_template(precondition, implied_template); } break; default: param.type_error("union template", "@UPF_Tests.GTP_Action_core"); } is_ifpresent = param.get_ifpresent(); } void GTP__Action__core_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; switch (single_value.union_selection) { case GTP__Action__core::ALT_tunend: single_value.field_tunend->check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_core"); return; case GTP__Action__core::ALT_tunmap: single_value.field_tunmap->check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_core"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @UPF_Tests.GTP_Action_core."); } 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 : "@UPF_Tests.GTP_Action_core"); } GTP__Action__tunend::GTP__Action__tunend() { } GTP__Action__tunend::GTP__Action__tunend(const INTEGER& par_pdr__id, const CHARSTRING& par_ip__l, const INTEGER& par_far__id) : field_pdr__id(par_pdr__id), field_ip__l(par_ip__l), field_far__id(par_far__id) { } GTP__Action__tunend::GTP__Action__tunend(const GTP__Action__tunend& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @UPF_Tests.GTP_Action_tunend."); if (other_value.pdr__id().is_bound()) field_pdr__id = other_value.pdr__id(); else field_pdr__id.clean_up(); if (other_value.ip__l().is_bound()) field_ip__l = other_value.ip__l(); else field_ip__l.clean_up(); if (other_value.far__id().is_bound()) field_far__id = other_value.far__id(); else field_far__id.clean_up(); } void GTP__Action__tunend::clean_up() { field_pdr__id.clean_up(); field_ip__l.clean_up(); field_far__id.clean_up(); } const TTCN_Typedescriptor_t* GTP__Action__tunend::get_descriptor() const { return >P__Action__tunend_descr_; } GTP__Action__tunend& GTP__Action__tunend::operator=(const GTP__Action__tunend& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @UPF_Tests.GTP_Action_tunend."); if (other_value.pdr__id().is_bound()) field_pdr__id = other_value.pdr__id(); else field_pdr__id.clean_up(); if (other_value.ip__l().is_bound()) field_ip__l = other_value.ip__l(); else field_ip__l.clean_up(); if (other_value.far__id().is_bound()) field_far__id = other_value.far__id(); else field_far__id.clean_up(); } return *this; } boolean GTP__Action__tunend::operator==(const GTP__Action__tunend& other_value) const { return field_pdr__id==other_value.field_pdr__id && field_ip__l==other_value.field_ip__l && field_far__id==other_value.field_far__id; } boolean GTP__Action__tunend::is_bound() const { return (field_pdr__id.is_bound()) || (field_ip__l.is_bound()) || (field_far__id.is_bound()); } boolean GTP__Action__tunend::is_value() const { return field_pdr__id.is_value() && field_ip__l.is_value() && field_far__id.is_value(); } void GTP__Action__tunend::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pdr_id := "); field_pdr__id.log(); TTCN_Logger::log_event_str(", ip_l := "); field_ip__l.log(); TTCN_Logger::log_event_str(", far_id := "); field_far__id.log(); TTCN_Logger::log_event_str(" }"); } void GTP__Action__tunend::set_implicit_omit() { if (pdr__id().is_bound()) pdr__id().set_implicit_omit(); if (ip__l().is_bound()) ip__l().set_implicit_omit(); if (far__id().is_bound()) far__id().set_implicit_omit(); } void GTP__Action__tunend::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (30 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) pdr__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ip__l().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) far__id().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ip_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ip__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action_tunend: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.GTP_Action_tunend"); } } void GTP__Action__tunend::encode_text(Text_Buf& text_buf) const { field_pdr__id.encode_text(text_buf); field_ip__l.encode_text(text_buf); field_far__id.encode_text(text_buf); } void GTP__Action__tunend::decode_text(Text_Buf& text_buf) { field_pdr__id.decode_text(text_buf); field_ip__l.decode_text(text_buf); field_far__id.decode_text(text_buf); } struct GTP__Action__tunend_template::single_value_struct { INTEGER_template field_pdr__id; CHARSTRING_template field_ip__l; INTEGER_template field_far__id; }; void GTP__Action__tunend_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_pdr__id = ANY_VALUE; single_value->field_ip__l = ANY_VALUE; single_value->field_far__id = ANY_VALUE; } } } void GTP__Action__tunend_template::copy_value(const GTP__Action__tunend& other_value) { single_value = new single_value_struct; if (other_value.pdr__id().is_bound()) { single_value->field_pdr__id = other_value.pdr__id(); } else { single_value->field_pdr__id.clean_up(); } if (other_value.ip__l().is_bound()) { single_value->field_ip__l = other_value.ip__l(); } else { single_value->field_ip__l.clean_up(); } if (other_value.far__id().is_bound()) { single_value->field_far__id = other_value.far__id(); } else { single_value->field_far__id.clean_up(); } set_selection(SPECIFIC_VALUE); } void GTP__Action__tunend_template::copy_template(const GTP__Action__tunend_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pdr__id().get_selection()) { single_value->field_pdr__id = other_value.pdr__id(); } else { single_value->field_pdr__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ip__l().get_selection()) { single_value->field_ip__l = other_value.ip__l(); } else { single_value->field_ip__l.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.far__id().get_selection()) { single_value->field_far__id = other_value.far__id(); } else { single_value->field_far__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 GTP__Action__tunend_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 GTP__Action__tunend_template(*other_value.implication_.precondition); implication_.implied_template = new GTP__Action__tunend_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 @UPF_Tests.GTP_Action_tunend."); break; } set_selection(other_value); } GTP__Action__tunend_template::GTP__Action__tunend_template() { } GTP__Action__tunend_template::GTP__Action__tunend_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GTP__Action__tunend_template::GTP__Action__tunend_template(const GTP__Action__tunend& other_value) { copy_value(other_value); } GTP__Action__tunend_template::GTP__Action__tunend_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__tunend&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.GTP_Action_tunend from an unbound optional field."); } } GTP__Action__tunend_template::GTP__Action__tunend_template(GTP__Action__tunend_template* p_precondition, GTP__Action__tunend_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GTP__Action__tunend_template::GTP__Action__tunend_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; } GTP__Action__tunend_template::GTP__Action__tunend_template(const GTP__Action__tunend_template& other_value) : Base_Template() { copy_template(other_value); } GTP__Action__tunend_template::~GTP__Action__tunend_template() { clean_up(); } GTP__Action__tunend_template& GTP__Action__tunend_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GTP__Action__tunend_template& GTP__Action__tunend_template::operator=(const GTP__Action__tunend& other_value) { clean_up(); copy_value(other_value); return *this; } GTP__Action__tunend_template& GTP__Action__tunend_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__tunend&)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 @UPF_Tests.GTP_Action_tunend."); } return *this; } GTP__Action__tunend_template& GTP__Action__tunend_template::operator=(const GTP__Action__tunend_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GTP__Action__tunend_template::match(const GTP__Action__tunend& 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.pdr__id().is_bound()) return FALSE; if(!single_value->field_pdr__id.match(other_value.pdr__id(), legacy))return FALSE; if(!other_value.ip__l().is_bound()) return FALSE; if(!single_value->field_ip__l.match(other_value.ip__l(), legacy))return FALSE; if(!other_value.far__id().is_bound()) return FALSE; if(!single_value->field_far__id.match(other_value.far__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 @UPF_Tests.GTP_Action_tunend."); } return FALSE; } boolean GTP__Action__tunend_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pdr__id.is_bound() || single_value->field_ip__l.is_bound() || single_value->field_far__id.is_bound(); } boolean GTP__Action__tunend_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pdr__id.is_value() && single_value->field_ip__l.is_value() && single_value->field_far__id.is_value(); } void GTP__Action__tunend_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; } GTP__Action__tunend GTP__Action__tunend_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 @UPF_Tests.GTP_Action_tunend."); GTP__Action__tunend ret_val; if (single_value->field_pdr__id.is_bound()) { ret_val.pdr__id() = single_value->field_pdr__id.valueof(); } if (single_value->field_ip__l.is_bound()) { ret_val.ip__l() = single_value->field_ip__l.valueof(); } if (single_value->field_far__id.is_bound()) { ret_val.far__id() = single_value->field_far__id.valueof(); } return ret_val; } void GTP__Action__tunend_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 @UPF_Tests.GTP_Action_tunend."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GTP__Action__tunend_template[list_length]; } GTP__Action__tunend_template& GTP__Action__tunend_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 @UPF_Tests.GTP_Action_tunend."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.GTP_Action_tunend."); return value_list.list_value[list_index]; } INTEGER_template& GTP__Action__tunend_template::pdr__id() { set_specific(); return single_value->field_pdr__id; } const INTEGER_template& GTP__Action__tunend_template::pdr__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pdr_id of a non-specific template of type @UPF_Tests.GTP_Action_tunend."); return single_value->field_pdr__id; } CHARSTRING_template& GTP__Action__tunend_template::ip__l() { set_specific(); return single_value->field_ip__l; } const CHARSTRING_template& GTP__Action__tunend_template::ip__l() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ip_l of a non-specific template of type @UPF_Tests.GTP_Action_tunend."); return single_value->field_ip__l; } INTEGER_template& GTP__Action__tunend_template::far__id() { set_specific(); return single_value->field_far__id; } const INTEGER_template& GTP__Action__tunend_template::far__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field far_id of a non-specific template of type @UPF_Tests.GTP_Action_tunend."); return single_value->field_far__id; } int GTP__Action__tunend_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 3; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend 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 @UPF_Tests.GTP_Action_tunend containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action_tunend containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.GTP_Action_tunend."); } return 0; } void GTP__Action__tunend_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pdr_id := "); single_value->field_pdr__id.log(); TTCN_Logger::log_event_str(", ip_l := "); single_value->field_ip__l.log(); TTCN_Logger::log_event_str(", far_id := "); single_value->field_far__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 GTP__Action__tunend_template::log_match(const GTP__Action__tunend& 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_pdr__id.match(match_value.pdr__id(), legacy)){ TTCN_Logger::log_logmatch_info(".pdr_id"); single_value->field_pdr__id.log_match(match_value.pdr__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ip__l.match(match_value.ip__l(), legacy)){ TTCN_Logger::log_logmatch_info(".ip_l"); single_value->field_ip__l.log_match(match_value.ip__l(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_far__id.match(match_value.far__id(), legacy)){ TTCN_Logger::log_logmatch_info(".far_id"); single_value->field_far__id.log_match(match_value.far__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("{ pdr_id := "); single_value->field_pdr__id.log_match(match_value.pdr__id(), legacy); TTCN_Logger::log_event_str(", ip_l := "); single_value->field_ip__l.log_match(match_value.ip__l(), legacy); TTCN_Logger::log_event_str(", far_id := "); single_value->field_far__id.log_match(match_value.far__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 GTP__Action__tunend_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pdr__id.encode_text(text_buf); single_value->field_ip__l.encode_text(text_buf); single_value->field_far__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 @UPF_Tests.GTP_Action_tunend."); } } void GTP__Action__tunend_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_pdr__id.decode_text(text_buf); single_value->field_ip__l.decode_text(text_buf); single_value->field_far__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 GTP__Action__tunend_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 @UPF_Tests.GTP_Action_tunend."); } } void GTP__Action__tunend_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: { GTP__Action__tunend_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) pdr__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ip__l().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) far__id().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ip_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ip__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action_tunend: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GTP__Action__tunend_template* precondition = new GTP__Action__tunend_template; precondition->set_param(*param.get_elem(0)); GTP__Action__tunend_template* implied_template = new GTP__Action__tunend_template; implied_template->set_param(*param.get_elem(1)); *this = GTP__Action__tunend_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.GTP_Action_tunend"); } is_ifpresent = param.get_ifpresent(); } void GTP__Action__tunend_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_pdr__id.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tunend"); single_value->field_ip__l.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tunend"); single_value->field_far__id.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action_tunend"); 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 : "@UPF_Tests.GTP_Action_tunend"); } boolean GTP__Action__tunend_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GTP__Action__tunend_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) kind().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)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) core().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pfcp__peer().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) seid__l().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(), "kind")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { kind().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_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(), "pfcp_peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.GTP_Action"); } } void GTP__Action::encode_text(Text_Buf& text_buf) const { field_kind.encode_text(text_buf); field_access.encode_text(text_buf); field_core.encode_text(text_buf); field_pfcp__peer.encode_text(text_buf); field_seid__l.encode_text(text_buf); } void GTP__Action::decode_text(Text_Buf& text_buf) { field_kind.decode_text(text_buf); field_access.decode_text(text_buf); field_core.decode_text(text_buf); field_pfcp__peer.decode_text(text_buf); field_seid__l.decode_text(text_buf); } struct GTP__Action_template::single_value_struct { CHARSTRING_template field_kind; GTP__Action__tun_template field_access; GTP__Action__core_template field_core; CHARSTRING_template field_pfcp__peer; OCTETSTRING_template field_seid__l; }; void GTP__Action_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_kind = ANY_VALUE; single_value->field_access = ANY_VALUE; single_value->field_core = ANY_VALUE; single_value->field_pfcp__peer = ANY_VALUE; single_value->field_seid__l = ANY_VALUE; } } } void GTP__Action_template::copy_value(const GTP__Action& other_value) { single_value = new single_value_struct; if (other_value.kind().is_bound()) { single_value->field_kind = other_value.kind(); } else { single_value->field_kind.clean_up(); } if (other_value.access().is_bound()) { single_value->field_access = other_value.access(); } else { single_value->field_access.clean_up(); } if (other_value.core().is_bound()) { single_value->field_core = other_value.core(); } else { single_value->field_core.clean_up(); } if (other_value.pfcp__peer().is_bound()) { single_value->field_pfcp__peer = other_value.pfcp__peer(); } else { single_value->field_pfcp__peer.clean_up(); } if (other_value.seid__l().is_bound()) { single_value->field_seid__l = other_value.seid__l(); } else { single_value->field_seid__l.clean_up(); } set_selection(SPECIFIC_VALUE); } void GTP__Action_template::copy_template(const GTP__Action_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.kind().get_selection()) { single_value->field_kind = other_value.kind(); } else { single_value->field_kind.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.access().get_selection()) { single_value->field_access = other_value.access(); } else { single_value->field_access.clean_up(); } 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.pfcp__peer().get_selection()) { single_value->field_pfcp__peer = other_value.pfcp__peer(); } else { single_value->field_pfcp__peer.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.seid__l().get_selection()) { single_value->field_seid__l = other_value.seid__l(); } else { single_value->field_seid__l.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 GTP__Action_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 GTP__Action_template(*other_value.implication_.precondition); implication_.implied_template = new GTP__Action_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 @UPF_Tests.GTP_Action."); break; } set_selection(other_value); } GTP__Action_template::GTP__Action_template() { } GTP__Action_template::GTP__Action_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GTP__Action_template::GTP__Action_template(const GTP__Action& other_value) { copy_value(other_value); } GTP__Action_template::GTP__Action_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.GTP_Action from an unbound optional field."); } } GTP__Action_template::GTP__Action_template(GTP__Action_template* p_precondition, GTP__Action_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GTP__Action_template::GTP__Action_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; } GTP__Action_template::GTP__Action_template(const GTP__Action_template& other_value) : Base_Template() { copy_template(other_value); } GTP__Action_template::~GTP__Action_template() { clean_up(); } GTP__Action_template& GTP__Action_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GTP__Action_template& GTP__Action_template::operator=(const GTP__Action& other_value) { clean_up(); copy_value(other_value); return *this; } GTP__Action_template& GTP__Action_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action&)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 @UPF_Tests.GTP_Action."); } return *this; } GTP__Action_template& GTP__Action_template::operator=(const GTP__Action_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GTP__Action_template::match(const GTP__Action& 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.kind().is_bound()) return FALSE; if(!single_value->field_kind.match(other_value.kind(), legacy))return FALSE; if(!other_value.access().is_bound()) return FALSE; if(!single_value->field_access.match(other_value.access(), legacy))return FALSE; if(!other_value.core().is_bound()) return FALSE; if(!single_value->field_core.match(other_value.core(), legacy))return FALSE; if(!other_value.pfcp__peer().is_bound()) return FALSE; if(!single_value->field_pfcp__peer.match(other_value.pfcp__peer(), legacy))return FALSE; if(!other_value.seid__l().is_bound()) return FALSE; if(!single_value->field_seid__l.match(other_value.seid__l(), 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 @UPF_Tests.GTP_Action."); } return FALSE; } boolean GTP__Action_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_kind.is_bound() || single_value->field_access.is_bound() || single_value->field_core.is_bound() || single_value->field_pfcp__peer.is_bound() || single_value->field_seid__l.is_bound(); } boolean GTP__Action_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_kind.is_value() && single_value->field_access.is_value() && single_value->field_core.is_value() && single_value->field_pfcp__peer.is_value() && single_value->field_seid__l.is_value(); } void GTP__Action_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; } GTP__Action GTP__Action_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 @UPF_Tests.GTP_Action."); GTP__Action ret_val; if (single_value->field_kind.is_bound()) { ret_val.kind() = single_value->field_kind.valueof(); } if (single_value->field_access.is_bound()) { ret_val.access() = single_value->field_access.valueof(); } if (single_value->field_core.is_bound()) { ret_val.core() = single_value->field_core.valueof(); } if (single_value->field_pfcp__peer.is_bound()) { ret_val.pfcp__peer() = single_value->field_pfcp__peer.valueof(); } if (single_value->field_seid__l.is_bound()) { ret_val.seid__l() = single_value->field_seid__l.valueof(); } return ret_val; } void GTP__Action_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 @UPF_Tests.GTP_Action."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GTP__Action_template[list_length]; } GTP__Action_template& GTP__Action_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 @UPF_Tests.GTP_Action."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.GTP_Action."); return value_list.list_value[list_index]; } CHARSTRING_template& GTP__Action_template::kind() { set_specific(); return single_value->field_kind; } const CHARSTRING_template& GTP__Action_template::kind() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field kind of a non-specific template of type @UPF_Tests.GTP_Action."); return single_value->field_kind; } GTP__Action__tun_template& GTP__Action_template::access() { set_specific(); return single_value->field_access; } const GTP__Action__tun_template& GTP__Action_template::access() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field access of a non-specific template of type @UPF_Tests.GTP_Action."); return single_value->field_access; } GTP__Action__core_template& GTP__Action_template::core() { set_specific(); return single_value->field_core; } const GTP__Action__core_template& GTP__Action_template::core() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field core of a non-specific template of type @UPF_Tests.GTP_Action."); return single_value->field_core; } CHARSTRING_template& GTP__Action_template::pfcp__peer() { set_specific(); return single_value->field_pfcp__peer; } const CHARSTRING_template& GTP__Action_template::pfcp__peer() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pfcp_peer of a non-specific template of type @UPF_Tests.GTP_Action."); return single_value->field_pfcp__peer; } OCTETSTRING_template& GTP__Action_template::seid__l() { set_specific(); return single_value->field_seid__l; } const OCTETSTRING_template& GTP__Action_template::seid__l() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field seid_l of a non-specific template of type @UPF_Tests.GTP_Action."); return single_value->field_seid__l; } int GTP__Action_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 5; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action 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 @UPF_Tests.GTP_Action containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.GTP_Action containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.GTP_Action."); } return 0; } void GTP__Action_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ kind := "); single_value->field_kind.log(); TTCN_Logger::log_event_str(", access := "); single_value->field_access.log(); TTCN_Logger::log_event_str(", core := "); single_value->field_core.log(); TTCN_Logger::log_event_str(", pfcp_peer := "); single_value->field_pfcp__peer.log(); TTCN_Logger::log_event_str(", seid_l := "); single_value->field_seid__l.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 GTP__Action_template::log_match(const GTP__Action& 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_kind.match(match_value.kind(), legacy)){ TTCN_Logger::log_logmatch_info(".kind"); single_value->field_kind.log_match(match_value.kind(), 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); } 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_pfcp__peer.match(match_value.pfcp__peer(), legacy)){ TTCN_Logger::log_logmatch_info(".pfcp_peer"); single_value->field_pfcp__peer.log_match(match_value.pfcp__peer(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_seid__l.match(match_value.seid__l(), legacy)){ TTCN_Logger::log_logmatch_info(".seid_l"); single_value->field_seid__l.log_match(match_value.seid__l(), 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("{ kind := "); single_value->field_kind.log_match(match_value.kind(), legacy); TTCN_Logger::log_event_str(", access := "); single_value->field_access.log_match(match_value.access(), legacy); TTCN_Logger::log_event_str(", core := "); single_value->field_core.log_match(match_value.core(), legacy); TTCN_Logger::log_event_str(", pfcp_peer := "); single_value->field_pfcp__peer.log_match(match_value.pfcp__peer(), legacy); TTCN_Logger::log_event_str(", seid_l := "); single_value->field_seid__l.log_match(match_value.seid__l(), 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 GTP__Action_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_kind.encode_text(text_buf); single_value->field_access.encode_text(text_buf); single_value->field_core.encode_text(text_buf); single_value->field_pfcp__peer.encode_text(text_buf); single_value->field_seid__l.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 @UPF_Tests.GTP_Action."); } } void GTP__Action_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_kind.decode_text(text_buf); single_value->field_access.decode_text(text_buf); single_value->field_core.decode_text(text_buf); single_value->field_pfcp__peer.decode_text(text_buf); single_value->field_seid__l.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 GTP__Action_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 @UPF_Tests.GTP_Action."); } } void GTP__Action_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: { GTP__Action_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) kind().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)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) core().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pfcp__peer().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) seid__l().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(), "kind")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { kind().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_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(), "pfcp_peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pfcp__peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.GTP_Action: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GTP__Action_template* precondition = new GTP__Action_template; precondition->set_param(*param.get_elem(0)); GTP__Action_template* implied_template = new GTP__Action_template; implied_template->set_param(*param.get_elem(1)); *this = GTP__Action_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.GTP_Action"); } is_ifpresent = param.get_ifpresent(); } void GTP__Action_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_kind.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action"); single_value->field_access.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action"); single_value->field_core.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action"); single_value->field_pfcp__peer.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action"); single_value->field_seid__l.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.GTP_Action"); 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 : "@UPF_Tests.GTP_Action"); } boolean GTP__Action_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GTP__Action_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) up__seid().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cp__seid().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gtp().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "up_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { up__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cp_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cp__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_session: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.PFCP_session"); } } void PFCP__session::encode_text(Text_Buf& text_buf) const { field_up__seid.encode_text(text_buf); field_cp__seid.encode_text(text_buf); field_gtp.encode_text(text_buf); } void PFCP__session::decode_text(Text_Buf& text_buf) { field_up__seid.decode_text(text_buf); field_cp__seid.decode_text(text_buf); field_gtp.decode_text(text_buf); } struct PFCP__session_template::single_value_struct { OCTETSTRING_template field_up__seid; OCTETSTRING_template field_cp__seid; GTP__Action_template field_gtp; }; void PFCP__session_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_up__seid = ANY_VALUE; single_value->field_cp__seid = ANY_VALUE; single_value->field_gtp = ANY_VALUE; } } } void PFCP__session_template::copy_value(const PFCP__session& other_value) { single_value = new single_value_struct; if (other_value.up__seid().is_bound()) { single_value->field_up__seid = other_value.up__seid(); } else { single_value->field_up__seid.clean_up(); } if (other_value.cp__seid().is_bound()) { single_value->field_cp__seid = other_value.cp__seid(); } else { single_value->field_cp__seid.clean_up(); } if (other_value.gtp().is_bound()) { single_value->field_gtp = other_value.gtp(); } else { single_value->field_gtp.clean_up(); } set_selection(SPECIFIC_VALUE); } void PFCP__session_template::copy_template(const PFCP__session_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.up__seid().get_selection()) { single_value->field_up__seid = other_value.up__seid(); } else { single_value->field_up__seid.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cp__seid().get_selection()) { single_value->field_cp__seid = other_value.cp__seid(); } else { single_value->field_cp__seid.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtp().get_selection()) { single_value->field_gtp = other_value.gtp(); } else { single_value->field_gtp.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 PFCP__session_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 PFCP__session_template(*other_value.implication_.precondition); implication_.implied_template = new PFCP__session_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 @UPF_Tests.PFCP_session."); break; } set_selection(other_value); } PFCP__session_template::PFCP__session_template() { } PFCP__session_template::PFCP__session_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PFCP__session_template::PFCP__session_template(const PFCP__session& other_value) { copy_value(other_value); } PFCP__session_template::PFCP__session_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__session&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.PFCP_session from an unbound optional field."); } } PFCP__session_template::PFCP__session_template(PFCP__session_template* p_precondition, PFCP__session_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PFCP__session_template::PFCP__session_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; } PFCP__session_template::PFCP__session_template(const PFCP__session_template& other_value) : Base_Template() { copy_template(other_value); } PFCP__session_template::~PFCP__session_template() { clean_up(); } PFCP__session_template& PFCP__session_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PFCP__session_template& PFCP__session_template::operator=(const PFCP__session& other_value) { clean_up(); copy_value(other_value); return *this; } PFCP__session_template& PFCP__session_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__session&)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 @UPF_Tests.PFCP_session."); } return *this; } PFCP__session_template& PFCP__session_template::operator=(const PFCP__session_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PFCP__session_template::match(const PFCP__session& 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.up__seid().is_bound()) return FALSE; if(!single_value->field_up__seid.match(other_value.up__seid(), legacy))return FALSE; if(!other_value.cp__seid().is_bound()) return FALSE; if(!single_value->field_cp__seid.match(other_value.cp__seid(), legacy))return FALSE; if(!other_value.gtp().is_bound()) return FALSE; if(!single_value->field_gtp.match(other_value.gtp(), 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 @UPF_Tests.PFCP_session."); } return FALSE; } boolean PFCP__session_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_up__seid.is_bound() || single_value->field_cp__seid.is_bound() || single_value->field_gtp.is_bound(); } boolean PFCP__session_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_up__seid.is_value() && single_value->field_cp__seid.is_value() && single_value->field_gtp.is_value(); } void PFCP__session_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; } PFCP__session PFCP__session_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 @UPF_Tests.PFCP_session."); PFCP__session ret_val; if (single_value->field_up__seid.is_bound()) { ret_val.up__seid() = single_value->field_up__seid.valueof(); } if (single_value->field_cp__seid.is_bound()) { ret_val.cp__seid() = single_value->field_cp__seid.valueof(); } if (single_value->field_gtp.is_bound()) { ret_val.gtp() = single_value->field_gtp.valueof(); } return ret_val; } void PFCP__session_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 @UPF_Tests.PFCP_session."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PFCP__session_template[list_length]; } PFCP__session_template& PFCP__session_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 @UPF_Tests.PFCP_session."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.PFCP_session."); return value_list.list_value[list_index]; } OCTETSTRING_template& PFCP__session_template::up__seid() { set_specific(); return single_value->field_up__seid; } const OCTETSTRING_template& PFCP__session_template::up__seid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field up_seid of a non-specific template of type @UPF_Tests.PFCP_session."); return single_value->field_up__seid; } OCTETSTRING_template& PFCP__session_template::cp__seid() { set_specific(); return single_value->field_cp__seid; } const OCTETSTRING_template& PFCP__session_template::cp__seid() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cp_seid of a non-specific template of type @UPF_Tests.PFCP_session."); return single_value->field_cp__seid; } GTP__Action_template& PFCP__session_template::gtp() { set_specific(); return single_value->field_gtp; } const GTP__Action_template& PFCP__session_template::gtp() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp of a non-specific template of type @UPF_Tests.PFCP_session."); return single_value->field_gtp; } int PFCP__session_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 3; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session 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 @UPF_Tests.PFCP_session containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_session containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.PFCP_session."); } return 0; } void PFCP__session_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ up_seid := "); single_value->field_up__seid.log(); TTCN_Logger::log_event_str(", cp_seid := "); single_value->field_cp__seid.log(); TTCN_Logger::log_event_str(", gtp := "); single_value->field_gtp.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 PFCP__session_template::log_match(const PFCP__session& 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_up__seid.match(match_value.up__seid(), legacy)){ TTCN_Logger::log_logmatch_info(".up_seid"); single_value->field_up__seid.log_match(match_value.up__seid(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cp__seid.match(match_value.cp__seid(), legacy)){ TTCN_Logger::log_logmatch_info(".cp_seid"); single_value->field_cp__seid.log_match(match_value.cp__seid(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtp.match(match_value.gtp(), legacy)){ TTCN_Logger::log_logmatch_info(".gtp"); single_value->field_gtp.log_match(match_value.gtp(), 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("{ up_seid := "); single_value->field_up__seid.log_match(match_value.up__seid(), legacy); TTCN_Logger::log_event_str(", cp_seid := "); single_value->field_cp__seid.log_match(match_value.cp__seid(), legacy); TTCN_Logger::log_event_str(", gtp := "); single_value->field_gtp.log_match(match_value.gtp(), 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 PFCP__session_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_up__seid.encode_text(text_buf); single_value->field_cp__seid.encode_text(text_buf); single_value->field_gtp.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 @UPF_Tests.PFCP_session."); } } void PFCP__session_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_up__seid.decode_text(text_buf); single_value->field_cp__seid.decode_text(text_buf); single_value->field_gtp.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 PFCP__session_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 @UPF_Tests.PFCP_session."); } } void PFCP__session_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: { PFCP__session_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) up__seid().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cp__seid().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gtp().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "up_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { up__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cp_seid")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cp__seid().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_session: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PFCP__session_template* precondition = new PFCP__session_template; precondition->set_param(*param.get_elem(0)); PFCP__session_template* implied_template = new PFCP__session_template; implied_template->set_param(*param.get_elem(1)); *this = PFCP__session_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.PFCP_session"); } is_ifpresent = param.get_ifpresent(); } void PFCP__session_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_up__seid.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_session"); single_value->field_cp__seid.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_session"); single_value->field_gtp.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_session"); 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 : "@UPF_Tests.PFCP_session"); } boolean PFCP__session_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PFCP__session_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; } GTP__Action__List::GTP__Action__List(const GTP__Action__List& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @UPF_Tests.GTP_Action_List."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } GTP__Action__List::~GTP__Action__List() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void GTP__Action__List::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."); } } GTP__Action__List& GTP__Action__List::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; } GTP__Action__List& GTP__Action__List::operator=(const GTP__Action__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @UPF_Tests.GTP_Action_List."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean GTP__Action__List::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @UPF_Tests.GTP_Action_List."); return val_ptr->n_elements == 0 ; } boolean GTP__Action__List::operator==(const GTP__Action__List& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @UPF_Tests.GTP_Action_List."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @UPF_Tests.GTP_Action_List."); 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; } GTP__Action& GTP__Action__List::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @UPF_Tests.GTP_Action_List 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 = (GTP__Action**)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 GTP__Action(*(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 GTP__Action; } return *val_ptr->value_elements[index_value]; } GTP__Action& GTP__Action__List::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @UPF_Tests.GTP_Action_List."); return (*this)[(int)index_value]; } const GTP__Action& GTP__Action__List::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @UPF_Tests.GTP_Action_List."); if (index_value < 0) TTCN_error("Accessing an element of type @UPF_Tests.GTP_Action_List using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @UPF_Tests.GTP_Action_List: 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 GTP__Action& GTP__Action__List::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @UPF_Tests.GTP_Action_List."); return (*this)[(int)index_value]; } GTP__Action__List GTP__Action__List::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } GTP__Action__List GTP__Action__List::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } GTP__Action__List GTP__Action__List::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } GTP__Action__List GTP__Action__List::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @UPF_Tests.GTP_Action_List."); 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; GTP__Action__List 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 GTP__Action(*val_ptr->value_elements[i]); } } return ret_val; } GTP__Action__List GTP__Action__List::operator+(const GTP__Action__List& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @UPF_Tests.GTP_Action_List concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; GTP__Action__List 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 GTP__Action(*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 GTP__Action(*other_value.val_ptr->value_elements[i]); } } return ret_val; } GTP__Action__List GTP__Action__List::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @UPF_Tests.GTP_Action_List."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@UPF_Tests.GTP_Action_List","element"); GTP__Action__List ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new GTP__Action(*val_ptr->value_elements[i+index]); } } return ret_val; } GTP__Action__List GTP__Action__List::replace(int index, int len, const GTP__Action__List& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @UPF_Tests.GTP_Action_List."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @UPF_Tests.GTP_Action_List."); check_replace_arguments(val_ptr->n_elements, index, len, "@UPF_Tests.GTP_Action_List","element"); GTP__Action__List 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 GTP__Action(*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 GTP__Action(*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 GTP__Action(*val_ptr->value_elements[index+i+len]); } } return ret_val; } GTP__Action__List GTP__Action__List::replace(int index, int len, const GTP__Action__List_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 GTP__Action__List::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @UPF_Tests.GTP_Action_List."); 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 = (GTP__Action**)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 GTP__Action(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (GTP__Action**)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 @UPF_Tests.GTP_Action_List: %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 = (GTP__Action**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean GTP__Action__List::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 GTP__Action__List::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @UPF_Tests.GTP_Action_List."); return val_ptr->n_elements; } int GTP__Action__List::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @UPF_Tests.GTP_Action_List."); 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 GTP__Action__List::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 GTP__Action__List::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 GTP__Action__List::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", "@UPF_Tests.GTP_Action_List"); } 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", "@UPF_Tests.GTP_Action_List"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void GTP__Action__List::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @UPF_Tests.GTP_Action_List."); 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 GTP__Action__List::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 @UPF_Tests.GTP_Action_List."); val_ptr->value_elements = (GTP__Action**)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 GTP__Action; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void GTP__Action__List_template::copy_value(const GTP__Action__List& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @UPF_Tests.GTP_Action_List with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (GTP__Action_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 GTP__Action_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new GTP__Action_template; } } set_selection(SPECIFIC_VALUE); } void GTP__Action__List_template::copy_template(const GTP__Action__List_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 = (GTP__Action_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 GTP__Action_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new GTP__Action_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 GTP__Action__List_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 GTP__Action__List_template(*other_value.implication_.precondition); implication_.implied_template = new GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); break; } set_selection(other_value); } boolean GTP__Action__List_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 GTP__Action__List_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const GTP__Action__List*)value_ptr)[value_index], legacy); else return ((const GTP__Action__List_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } GTP__Action__List_template::GTP__Action__List_template() { } GTP__Action__List_template::GTP__Action__List_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } GTP__Action__List_template::GTP__Action__List_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } GTP__Action__List_template::GTP__Action__List_template(const GTP__Action__List& other_value) { copy_value(other_value); } GTP__Action__List_template::GTP__Action__List_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__List&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.GTP_Action_List from an unbound optional field."); } } GTP__Action__List_template::GTP__Action__List_template(GTP__Action__List_template* p_precondition, GTP__Action__List_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GTP__Action__List_template::GTP__Action__List_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; } GTP__Action__List_template::GTP__Action__List_template(const GTP__Action__List_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } GTP__Action__List_template::~GTP__Action__List_template() { clean_up(); } void GTP__Action__List_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; } GTP__Action__List_template& GTP__Action__List_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GTP__Action__List_template& GTP__Action__List_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } GTP__Action__List_template& GTP__Action__List_template::operator=(const GTP__Action__List& other_value) { clean_up(); copy_value(other_value); return *this; } GTP__Action__List_template& GTP__Action__List_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GTP__Action__List&)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 @UPF_Tests.GTP_Action_List."); } return *this; } GTP__Action__List_template& GTP__Action__List_template::operator=(const GTP__Action__List_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } GTP__Action_template& GTP__Action__List_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List."); break; } return *single_value.value_elements[index_value]; } GTP__Action_template& GTP__Action__List_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @UPF_Tests.GTP_Action_List."); return (*this)[(int)index_value]; } const GTP__Action_template& GTP__Action__List_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @UPF_Tests.GTP_Action_List using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @UPF_Tests.GTP_Action_List."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @UPF_Tests.GTP_Action_List: 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 GTP__Action_template& GTP__Action__List_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @UPF_Tests.GTP_Action_List."); return (*this)[(int)index_value]; } void GTP__Action__List_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @UPF_Tests.GTP_Action_List."); 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 = (GTP__Action_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 GTP__Action_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 GTP__Action_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 = (GTP__Action_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int GTP__Action__List_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 GTP__Action__List_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 @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List 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 @UPF_Tests.GTP_Action_List containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @UPF_Tests.GTP_Action_List.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @UPF_Tests.GTP_Action_List"); } boolean GTP__Action__List_template::match(const GTP__Action__List& 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 @UPF_Tests.GTP_Action_List."); } return FALSE; } boolean GTP__Action__List_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; } GTP__Action__List GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); GTP__Action__List 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; } GTP__Action__List GTP__Action__List_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); } GTP__Action__List GTP__Action__List_template::replace(int index, int len, const GTP__Action__List_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()); } GTP__Action__List GTP__Action__List_template::replace(int index, int len, const GTP__Action__List& 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 GTP__Action__List_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 GTP__Action__List_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @UPF_Tests.GTP_Action_List."); } set_selection(template_type); } GTP__Action__List_template& GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @UPF_Tests.GTP_Action_List."); return value_list.list_value[list_index]; } void GTP__Action__List_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 GTP__Action__List_template::log_match(const GTP__Action__List& 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 GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); } } void GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); single_value.value_elements = (GTP__Action_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 GTP__Action_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 GTP__Action__List_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 @UPF_Tests.GTP_Action_List."); } } boolean GTP__Action__List_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GTP__Action__List_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iget_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: { GTP__Action__List_template* precondition = new GTP__Action__List_template; precondition->set_param(*param.get_elem(0)); GTP__Action__List_template* implied_template = new GTP__Action__List_template; implied_template->set_param(*param.get_elem(1)); *this = GTP__Action__List_template(precondition, implied_template); } break; default: param.type_error("record of template", "@UPF_Tests.GTP_Action_List"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void GTP__Action__List_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 : "@UPF_Tests.GTP_Action_List"); 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 : "@UPF_Tests.GTP_Action_List"); } boolean GTP__Action__List_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); } } PFCP__Session__Status::PFCP__Session__Status() { } PFCP__Session__Status::PFCP__Session__Status(const CHARSTRING& par_peer, const OCTETSTRING& par_seid__r, const OCTETSTRING& par_seid__l, const CHARSTRING& par_state, const INTEGER& par_pdr__active__count, const INTEGER& par_pdr__count, const INTEGER& par_far__active__count, const INTEGER& par_far__count, const INTEGER& par_gtp__active__count) : field_peer(par_peer), field_seid__r(par_seid__r), field_seid__l(par_seid__l), field_state(par_state), field_pdr__active__count(par_pdr__active__count), field_pdr__count(par_pdr__count), field_far__active__count(par_far__active__count), field_far__count(par_far__count), field_gtp__active__count(par_gtp__active__count) { } PFCP__Session__Status::PFCP__Session__Status(const PFCP__Session__Status& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @UPF_Tests.PFCP_Session_Status."); if (other_value.peer().is_bound()) field_peer = other_value.peer(); else field_peer.clean_up(); if (other_value.seid__r().is_bound()) field_seid__r = other_value.seid__r(); else field_seid__r.clean_up(); if (other_value.seid__l().is_bound()) field_seid__l = other_value.seid__l(); else field_seid__l.clean_up(); if (other_value.state().is_bound()) field_state = other_value.state(); else field_state.clean_up(); if (other_value.pdr__active__count().is_bound()) field_pdr__active__count = other_value.pdr__active__count(); else field_pdr__active__count.clean_up(); if (other_value.pdr__count().is_bound()) field_pdr__count = other_value.pdr__count(); else field_pdr__count.clean_up(); if (other_value.far__active__count().is_bound()) field_far__active__count = other_value.far__active__count(); else field_far__active__count.clean_up(); if (other_value.far__count().is_bound()) field_far__count = other_value.far__count(); else field_far__count.clean_up(); if (other_value.gtp__active__count().is_bound()) field_gtp__active__count = other_value.gtp__active__count(); else field_gtp__active__count.clean_up(); } void PFCP__Session__Status::clean_up() { field_peer.clean_up(); field_seid__r.clean_up(); field_seid__l.clean_up(); field_state.clean_up(); field_pdr__active__count.clean_up(); field_pdr__count.clean_up(); field_far__active__count.clean_up(); field_far__count.clean_up(); field_gtp__active__count.clean_up(); } const TTCN_Typedescriptor_t* PFCP__Session__Status::get_descriptor() const { return &PFCP__Session__Status_descr_; } PFCP__Session__Status& PFCP__Session__Status::operator=(const PFCP__Session__Status& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @UPF_Tests.PFCP_Session_Status."); if (other_value.peer().is_bound()) field_peer = other_value.peer(); else field_peer.clean_up(); if (other_value.seid__r().is_bound()) field_seid__r = other_value.seid__r(); else field_seid__r.clean_up(); if (other_value.seid__l().is_bound()) field_seid__l = other_value.seid__l(); else field_seid__l.clean_up(); if (other_value.state().is_bound()) field_state = other_value.state(); else field_state.clean_up(); if (other_value.pdr__active__count().is_bound()) field_pdr__active__count = other_value.pdr__active__count(); else field_pdr__active__count.clean_up(); if (other_value.pdr__count().is_bound()) field_pdr__count = other_value.pdr__count(); else field_pdr__count.clean_up(); if (other_value.far__active__count().is_bound()) field_far__active__count = other_value.far__active__count(); else field_far__active__count.clean_up(); if (other_value.far__count().is_bound()) field_far__count = other_value.far__count(); else field_far__count.clean_up(); if (other_value.gtp__active__count().is_bound()) field_gtp__active__count = other_value.gtp__active__count(); else field_gtp__active__count.clean_up(); } return *this; } boolean PFCP__Session__Status::operator==(const PFCP__Session__Status& other_value) const { return field_peer==other_value.field_peer && field_seid__r==other_value.field_seid__r && field_seid__l==other_value.field_seid__l && field_state==other_value.field_state && field_pdr__active__count==other_value.field_pdr__active__count && field_pdr__count==other_value.field_pdr__count && field_far__active__count==other_value.field_far__active__count && field_far__count==other_value.field_far__count && field_gtp__active__count==other_value.field_gtp__active__count; } boolean PFCP__Session__Status::is_bound() const { return (field_peer.is_bound()) || (field_seid__r.is_bound()) || (field_seid__l.is_bound()) || (field_state.is_bound()) || (field_pdr__active__count.is_bound()) || (field_pdr__count.is_bound()) || (field_far__active__count.is_bound()) || (field_far__count.is_bound()) || (field_gtp__active__count.is_bound()); } boolean PFCP__Session__Status::is_value() const { return field_peer.is_value() && field_seid__r.is_value() && field_seid__l.is_value() && field_state.is_value() && field_pdr__active__count.is_value() && field_pdr__count.is_value() && field_far__active__count.is_value() && field_far__count.is_value() && field_gtp__active__count.is_value(); } void PFCP__Session__Status::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ peer := "); field_peer.log(); TTCN_Logger::log_event_str(", seid_r := "); field_seid__r.log(); TTCN_Logger::log_event_str(", seid_l := "); field_seid__l.log(); TTCN_Logger::log_event_str(", state := "); field_state.log(); TTCN_Logger::log_event_str(", pdr_active_count := "); field_pdr__active__count.log(); TTCN_Logger::log_event_str(", pdr_count := "); field_pdr__count.log(); TTCN_Logger::log_event_str(", far_active_count := "); field_far__active__count.log(); TTCN_Logger::log_event_str(", far_count := "); field_far__count.log(); TTCN_Logger::log_event_str(", gtp_active_count := "); field_gtp__active__count.log(); TTCN_Logger::log_event_str(" }"); } void PFCP__Session__Status::set_implicit_omit() { if (peer().is_bound()) peer().set_implicit_omit(); if (seid__r().is_bound()) seid__r().set_implicit_omit(); if (seid__l().is_bound()) seid__l().set_implicit_omit(); if (state().is_bound()) state().set_implicit_omit(); if (pdr__active__count().is_bound()) pdr__active__count().set_implicit_omit(); if (pdr__count().is_bound()) pdr__count().set_implicit_omit(); if (far__active__count().is_bound()) far__active__count().set_implicit_omit(); if (far__count().is_bound()) far__count().set_implicit_omit(); if (gtp__active__count().is_bound()) gtp__active__count().set_implicit_omit(); } void PFCP__Session__Status::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 (90 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) peer().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) seid__r().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) seid__l().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) state().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pdr__active__count().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pdr__count().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) far__active__count().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) far__count().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) gtp__active__count().set_param(*param.get_elem(8)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "state")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { state().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_Session_Status: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.PFCP_Session_Status"); } } void PFCP__Session__Status::encode_text(Text_Buf& text_buf) const { field_peer.encode_text(text_buf); field_seid__r.encode_text(text_buf); field_seid__l.encode_text(text_buf); field_state.encode_text(text_buf); field_pdr__active__count.encode_text(text_buf); field_pdr__count.encode_text(text_buf); field_far__active__count.encode_text(text_buf); field_far__count.encode_text(text_buf); field_gtp__active__count.encode_text(text_buf); } void PFCP__Session__Status::decode_text(Text_Buf& text_buf) { field_peer.decode_text(text_buf); field_seid__r.decode_text(text_buf); field_seid__l.decode_text(text_buf); field_state.decode_text(text_buf); field_pdr__active__count.decode_text(text_buf); field_pdr__count.decode_text(text_buf); field_far__active__count.decode_text(text_buf); field_far__count.decode_text(text_buf); field_gtp__active__count.decode_text(text_buf); } struct PFCP__Session__Status_template::single_value_struct { CHARSTRING_template field_peer; OCTETSTRING_template field_seid__r; OCTETSTRING_template field_seid__l; CHARSTRING_template field_state; INTEGER_template field_pdr__active__count; INTEGER_template field_pdr__count; INTEGER_template field_far__active__count; INTEGER_template field_far__count; INTEGER_template field_gtp__active__count; }; void PFCP__Session__Status_template::set_specific() { if (template_selection != SPECIFIC_VALUE) { template_sel old_selection = template_selection; clean_up(); single_value = new single_value_struct; set_selection(SPECIFIC_VALUE); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { single_value->field_peer = ANY_VALUE; single_value->field_seid__r = ANY_VALUE; single_value->field_seid__l = ANY_VALUE; single_value->field_state = ANY_VALUE; single_value->field_pdr__active__count = ANY_VALUE; single_value->field_pdr__count = ANY_VALUE; single_value->field_far__active__count = ANY_VALUE; single_value->field_far__count = ANY_VALUE; single_value->field_gtp__active__count = ANY_VALUE; } } } void PFCP__Session__Status_template::copy_value(const PFCP__Session__Status& other_value) { single_value = new single_value_struct; if (other_value.peer().is_bound()) { single_value->field_peer = other_value.peer(); } else { single_value->field_peer.clean_up(); } if (other_value.seid__r().is_bound()) { single_value->field_seid__r = other_value.seid__r(); } else { single_value->field_seid__r.clean_up(); } if (other_value.seid__l().is_bound()) { single_value->field_seid__l = other_value.seid__l(); } else { single_value->field_seid__l.clean_up(); } if (other_value.state().is_bound()) { single_value->field_state = other_value.state(); } else { single_value->field_state.clean_up(); } if (other_value.pdr__active__count().is_bound()) { single_value->field_pdr__active__count = other_value.pdr__active__count(); } else { single_value->field_pdr__active__count.clean_up(); } if (other_value.pdr__count().is_bound()) { single_value->field_pdr__count = other_value.pdr__count(); } else { single_value->field_pdr__count.clean_up(); } if (other_value.far__active__count().is_bound()) { single_value->field_far__active__count = other_value.far__active__count(); } else { single_value->field_far__active__count.clean_up(); } if (other_value.far__count().is_bound()) { single_value->field_far__count = other_value.far__count(); } else { single_value->field_far__count.clean_up(); } if (other_value.gtp__active__count().is_bound()) { single_value->field_gtp__active__count = other_value.gtp__active__count(); } else { single_value->field_gtp__active__count.clean_up(); } set_selection(SPECIFIC_VALUE); } void PFCP__Session__Status_template::copy_template(const PFCP__Session__Status_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.peer().get_selection()) { single_value->field_peer = other_value.peer(); } else { single_value->field_peer.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.seid__r().get_selection()) { single_value->field_seid__r = other_value.seid__r(); } else { single_value->field_seid__r.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.seid__l().get_selection()) { single_value->field_seid__l = other_value.seid__l(); } else { single_value->field_seid__l.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.state().get_selection()) { single_value->field_state = other_value.state(); } else { single_value->field_state.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pdr__active__count().get_selection()) { single_value->field_pdr__active__count = other_value.pdr__active__count(); } else { single_value->field_pdr__active__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pdr__count().get_selection()) { single_value->field_pdr__count = other_value.pdr__count(); } else { single_value->field_pdr__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.far__active__count().get_selection()) { single_value->field_far__active__count = other_value.far__active__count(); } else { single_value->field_far__active__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.far__count().get_selection()) { single_value->field_far__count = other_value.far__count(); } else { single_value->field_far__count.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gtp__active__count().get_selection()) { single_value->field_gtp__active__count = other_value.gtp__active__count(); } else { single_value->field_gtp__active__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 PFCP__Session__Status_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 PFCP__Session__Status_template(*other_value.implication_.precondition); implication_.implied_template = new PFCP__Session__Status_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 @UPF_Tests.PFCP_Session_Status."); break; } set_selection(other_value); } PFCP__Session__Status_template::PFCP__Session__Status_template() { } PFCP__Session__Status_template::PFCP__Session__Status_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PFCP__Session__Status_template::PFCP__Session__Status_template(const PFCP__Session__Status& other_value) { copy_value(other_value); } PFCP__Session__Status_template::PFCP__Session__Status_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Session__Status&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.PFCP_Session_Status from an unbound optional field."); } } PFCP__Session__Status_template::PFCP__Session__Status_template(PFCP__Session__Status_template* p_precondition, PFCP__Session__Status_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PFCP__Session__Status_template::PFCP__Session__Status_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; } PFCP__Session__Status_template::PFCP__Session__Status_template(const PFCP__Session__Status_template& other_value) : Base_Template() { copy_template(other_value); } PFCP__Session__Status_template::~PFCP__Session__Status_template() { clean_up(); } PFCP__Session__Status_template& PFCP__Session__Status_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PFCP__Session__Status_template& PFCP__Session__Status_template::operator=(const PFCP__Session__Status& other_value) { clean_up(); copy_value(other_value); return *this; } PFCP__Session__Status_template& PFCP__Session__Status_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Session__Status&)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 @UPF_Tests.PFCP_Session_Status."); } return *this; } PFCP__Session__Status_template& PFCP__Session__Status_template::operator=(const PFCP__Session__Status_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PFCP__Session__Status_template::match(const PFCP__Session__Status& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; switch (template_selection) { case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case OMIT_VALUE: return FALSE; case SPECIFIC_VALUE: if(!other_value.peer().is_bound()) return FALSE; if(!single_value->field_peer.match(other_value.peer(), legacy))return FALSE; if(!other_value.seid__r().is_bound()) return FALSE; if(!single_value->field_seid__r.match(other_value.seid__r(), legacy))return FALSE; if(!other_value.seid__l().is_bound()) return FALSE; if(!single_value->field_seid__l.match(other_value.seid__l(), legacy))return FALSE; if(!other_value.state().is_bound()) return FALSE; if(!single_value->field_state.match(other_value.state(), legacy))return FALSE; if(!other_value.pdr__active__count().is_bound()) return FALSE; if(!single_value->field_pdr__active__count.match(other_value.pdr__active__count(), legacy))return FALSE; if(!other_value.pdr__count().is_bound()) return FALSE; if(!single_value->field_pdr__count.match(other_value.pdr__count(), legacy))return FALSE; if(!other_value.far__active__count().is_bound()) return FALSE; if(!single_value->field_far__active__count.match(other_value.far__active__count(), legacy))return FALSE; if(!other_value.far__count().is_bound()) return FALSE; if(!single_value->field_far__count.match(other_value.far__count(), legacy))return FALSE; if(!other_value.gtp__active__count().is_bound()) return FALSE; if(!single_value->field_gtp__active__count.match(other_value.gtp__active__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 @UPF_Tests.PFCP_Session_Status."); } return FALSE; } boolean PFCP__Session__Status_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_peer.is_bound() || single_value->field_seid__r.is_bound() || single_value->field_seid__l.is_bound() || single_value->field_state.is_bound() || single_value->field_pdr__active__count.is_bound() || single_value->field_pdr__count.is_bound() || single_value->field_far__active__count.is_bound() || single_value->field_far__count.is_bound() || single_value->field_gtp__active__count.is_bound(); } boolean PFCP__Session__Status_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_peer.is_value() && single_value->field_seid__r.is_value() && single_value->field_seid__l.is_value() && single_value->field_state.is_value() && single_value->field_pdr__active__count.is_value() && single_value->field_pdr__count.is_value() && single_value->field_far__active__count.is_value() && single_value->field_far__count.is_value() && single_value->field_gtp__active__count.is_value(); } void PFCP__Session__Status_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; } PFCP__Session__Status PFCP__Session__Status_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 @UPF_Tests.PFCP_Session_Status."); PFCP__Session__Status ret_val; if (single_value->field_peer.is_bound()) { ret_val.peer() = single_value->field_peer.valueof(); } if (single_value->field_seid__r.is_bound()) { ret_val.seid__r() = single_value->field_seid__r.valueof(); } if (single_value->field_seid__l.is_bound()) { ret_val.seid__l() = single_value->field_seid__l.valueof(); } if (single_value->field_state.is_bound()) { ret_val.state() = single_value->field_state.valueof(); } if (single_value->field_pdr__active__count.is_bound()) { ret_val.pdr__active__count() = single_value->field_pdr__active__count.valueof(); } if (single_value->field_pdr__count.is_bound()) { ret_val.pdr__count() = single_value->field_pdr__count.valueof(); } if (single_value->field_far__active__count.is_bound()) { ret_val.far__active__count() = single_value->field_far__active__count.valueof(); } if (single_value->field_far__count.is_bound()) { ret_val.far__count() = single_value->field_far__count.valueof(); } if (single_value->field_gtp__active__count.is_bound()) { ret_val.gtp__active__count() = single_value->field_gtp__active__count.valueof(); } return ret_val; } void PFCP__Session__Status_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 @UPF_Tests.PFCP_Session_Status."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PFCP__Session__Status_template[list_length]; } PFCP__Session__Status_template& PFCP__Session__Status_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 @UPF_Tests.PFCP_Session_Status."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.PFCP_Session_Status."); return value_list.list_value[list_index]; } CHARSTRING_template& PFCP__Session__Status_template::peer() { set_specific(); return single_value->field_peer; } const CHARSTRING_template& PFCP__Session__Status_template::peer() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field peer of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_peer; } OCTETSTRING_template& PFCP__Session__Status_template::seid__r() { set_specific(); return single_value->field_seid__r; } const OCTETSTRING_template& PFCP__Session__Status_template::seid__r() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field seid_r of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_seid__r; } OCTETSTRING_template& PFCP__Session__Status_template::seid__l() { set_specific(); return single_value->field_seid__l; } const OCTETSTRING_template& PFCP__Session__Status_template::seid__l() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field seid_l of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_seid__l; } CHARSTRING_template& PFCP__Session__Status_template::state() { set_specific(); return single_value->field_state; } const CHARSTRING_template& PFCP__Session__Status_template::state() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field state of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_state; } INTEGER_template& PFCP__Session__Status_template::pdr__active__count() { set_specific(); return single_value->field_pdr__active__count; } const INTEGER_template& PFCP__Session__Status_template::pdr__active__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pdr_active_count of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_pdr__active__count; } INTEGER_template& PFCP__Session__Status_template::pdr__count() { set_specific(); return single_value->field_pdr__count; } const INTEGER_template& PFCP__Session__Status_template::pdr__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pdr_count of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_pdr__count; } INTEGER_template& PFCP__Session__Status_template::far__active__count() { set_specific(); return single_value->field_far__active__count; } const INTEGER_template& PFCP__Session__Status_template::far__active__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field far_active_count of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_far__active__count; } INTEGER_template& PFCP__Session__Status_template::far__count() { set_specific(); return single_value->field_far__count; } const INTEGER_template& PFCP__Session__Status_template::far__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field far_count of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_far__count; } INTEGER_template& PFCP__Session__Status_template::gtp__active__count() { set_specific(); return single_value->field_gtp__active__count; } const INTEGER_template& PFCP__Session__Status_template::gtp__active__count() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp_active_count of a non-specific template of type @UPF_Tests.PFCP_Session_Status."); return single_value->field_gtp__active__count; } int PFCP__Session__Status_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 9; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status 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 @UPF_Tests.PFCP_Session_Status containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Session_Status containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.PFCP_Session_Status."); } return 0; } void PFCP__Session__Status_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ peer := "); single_value->field_peer.log(); TTCN_Logger::log_event_str(", seid_r := "); single_value->field_seid__r.log(); TTCN_Logger::log_event_str(", seid_l := "); single_value->field_seid__l.log(); TTCN_Logger::log_event_str(", state := "); single_value->field_state.log(); TTCN_Logger::log_event_str(", pdr_active_count := "); single_value->field_pdr__active__count.log(); TTCN_Logger::log_event_str(", pdr_count := "); single_value->field_pdr__count.log(); TTCN_Logger::log_event_str(", far_active_count := "); single_value->field_far__active__count.log(); TTCN_Logger::log_event_str(", far_count := "); single_value->field_far__count.log(); TTCN_Logger::log_event_str(", gtp_active_count := "); single_value->field_gtp__active__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 PFCP__Session__Status_template::log_match(const PFCP__Session__Status& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if(!single_value->field_peer.match(match_value.peer(), legacy)){ TTCN_Logger::log_logmatch_info(".peer"); single_value->field_peer.log_match(match_value.peer(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_seid__r.match(match_value.seid__r(), legacy)){ TTCN_Logger::log_logmatch_info(".seid_r"); single_value->field_seid__r.log_match(match_value.seid__r(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_seid__l.match(match_value.seid__l(), legacy)){ TTCN_Logger::log_logmatch_info(".seid_l"); single_value->field_seid__l.log_match(match_value.seid__l(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_state.match(match_value.state(), legacy)){ TTCN_Logger::log_logmatch_info(".state"); single_value->field_state.log_match(match_value.state(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pdr__active__count.match(match_value.pdr__active__count(), legacy)){ TTCN_Logger::log_logmatch_info(".pdr_active_count"); single_value->field_pdr__active__count.log_match(match_value.pdr__active__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pdr__count.match(match_value.pdr__count(), legacy)){ TTCN_Logger::log_logmatch_info(".pdr_count"); single_value->field_pdr__count.log_match(match_value.pdr__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_far__active__count.match(match_value.far__active__count(), legacy)){ TTCN_Logger::log_logmatch_info(".far_active_count"); single_value->field_far__active__count.log_match(match_value.far__active__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_far__count.match(match_value.far__count(), legacy)){ TTCN_Logger::log_logmatch_info(".far_count"); single_value->field_far__count.log_match(match_value.far__count(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gtp__active__count.match(match_value.gtp__active__count(), legacy)){ TTCN_Logger::log_logmatch_info(".gtp_active_count"); single_value->field_gtp__active__count.log_match(match_value.gtp__active__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("{ peer := "); single_value->field_peer.log_match(match_value.peer(), legacy); TTCN_Logger::log_event_str(", seid_r := "); single_value->field_seid__r.log_match(match_value.seid__r(), legacy); TTCN_Logger::log_event_str(", seid_l := "); single_value->field_seid__l.log_match(match_value.seid__l(), legacy); TTCN_Logger::log_event_str(", state := "); single_value->field_state.log_match(match_value.state(), legacy); TTCN_Logger::log_event_str(", pdr_active_count := "); single_value->field_pdr__active__count.log_match(match_value.pdr__active__count(), legacy); TTCN_Logger::log_event_str(", pdr_count := "); single_value->field_pdr__count.log_match(match_value.pdr__count(), legacy); TTCN_Logger::log_event_str(", far_active_count := "); single_value->field_far__active__count.log_match(match_value.far__active__count(), legacy); TTCN_Logger::log_event_str(", far_count := "); single_value->field_far__count.log_match(match_value.far__count(), legacy); TTCN_Logger::log_event_str(", gtp_active_count := "); single_value->field_gtp__active__count.log_match(match_value.gtp__active__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 PFCP__Session__Status_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_peer.encode_text(text_buf); single_value->field_seid__r.encode_text(text_buf); single_value->field_seid__l.encode_text(text_buf); single_value->field_state.encode_text(text_buf); single_value->field_pdr__active__count.encode_text(text_buf); single_value->field_pdr__count.encode_text(text_buf); single_value->field_far__active__count.encode_text(text_buf); single_value->field_far__count.encode_text(text_buf); single_value->field_gtp__active__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 @UPF_Tests.PFCP_Session_Status."); } } void PFCP__Session__Status_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; single_value->field_peer.decode_text(text_buf); single_value->field_seid__r.decode_text(text_buf); single_value->field_seid__l.decode_text(text_buf); single_value->field_state.decode_text(text_buf); single_value->field_pdr__active__count.decode_text(text_buf); single_value->field_pdr__count.decode_text(text_buf); single_value->field_far__active__count.decode_text(text_buf); single_value->field_far__count.decode_text(text_buf); single_value->field_gtp__active__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 PFCP__Session__Status_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 @UPF_Tests.PFCP_Session_Status."); } } void PFCP__Session__Status_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: { PFCP__Session__Status_template new_temp; new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) peer().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) seid__r().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) seid__l().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) state().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pdr__active__count().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pdr__count().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) far__active__count().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) far__count().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) gtp__active__count().set_param(*param.get_elem(8)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "peer")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peer().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_r")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__r().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "seid_l")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { seid__l().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "state")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { state().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pdr_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gtp_active_count")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gtp__active__count().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_Session_Status: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PFCP__Session__Status_template* precondition = new PFCP__Session__Status_template; precondition->set_param(*param.get_elem(0)); PFCP__Session__Status_template* implied_template = new PFCP__Session__Status_template; implied_template->set_param(*param.get_elem(1)); *this = PFCP__Session__Status_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.PFCP_Session_Status"); } is_ifpresent = param.get_ifpresent(); } void PFCP__Session__Status_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; single_value->field_peer.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_seid__r.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_seid__l.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_state.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_pdr__active__count.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_pdr__count.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_far__active__count.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_far__count.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); single_value->field_gtp__active__count.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Session_Status"); 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 : "@UPF_Tests.PFCP_Session_Status"); } boolean PFCP__Session__Status_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PFCP__Session__Status_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; } PFCP__Session__Status__List::PFCP__Session__Status__List(const PFCP__Session__Status__List& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } PFCP__Session__Status__List::~PFCP__Session__Status__List() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void PFCP__Session__Status__List::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."); } } PFCP__Session__Status__List& PFCP__Session__Status__List::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; } PFCP__Session__Status__List& PFCP__Session__Status__List::operator=(const PFCP__Session__Status__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean PFCP__Session__Status__List::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); return val_ptr->n_elements == 0 ; } boolean PFCP__Session__Status__List::operator==(const PFCP__Session__Status__List& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); 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; } PFCP__Session__Status& PFCP__Session__Status__List::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @UPF_Tests.PFCP_Session_Status_List 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 = (PFCP__Session__Status**)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 PFCP__Session__Status(*(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 PFCP__Session__Status; } return *val_ptr->value_elements[index_value]; } PFCP__Session__Status& PFCP__Session__Status__List::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @UPF_Tests.PFCP_Session_Status_List."); return (*this)[(int)index_value]; } const PFCP__Session__Status& PFCP__Session__Status__List::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); if (index_value < 0) TTCN_error("Accessing an element of type @UPF_Tests.PFCP_Session_Status_List using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @UPF_Tests.PFCP_Session_Status_List: 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 PFCP__Session__Status& PFCP__Session__Status__List::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @UPF_Tests.PFCP_Session_Status_List."); return (*this)[(int)index_value]; } PFCP__Session__Status__List PFCP__Session__Status__List::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } PFCP__Session__Status__List PFCP__Session__Status__List::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } PFCP__Session__Status__List PFCP__Session__Status__List::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } PFCP__Session__Status__List PFCP__Session__Status__List::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); 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; PFCP__Session__Status__List 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 PFCP__Session__Status(*val_ptr->value_elements[i]); } } return ret_val; } PFCP__Session__Status__List PFCP__Session__Status__List::operator+(const PFCP__Session__Status__List& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @UPF_Tests.PFCP_Session_Status_List concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; PFCP__Session__Status__List 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 PFCP__Session__Status(*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 PFCP__Session__Status(*other_value.val_ptr->value_elements[i]); } } return ret_val; } PFCP__Session__Status__List PFCP__Session__Status__List::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@UPF_Tests.PFCP_Session_Status_List","element"); PFCP__Session__Status__List ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new PFCP__Session__Status(*val_ptr->value_elements[i+index]); } } return ret_val; } PFCP__Session__Status__List PFCP__Session__Status__List::replace(int index, int len, const PFCP__Session__Status__List& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); check_replace_arguments(val_ptr->n_elements, index, len, "@UPF_Tests.PFCP_Session_Status_List","element"); PFCP__Session__Status__List 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 PFCP__Session__Status(*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 PFCP__Session__Status(*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 PFCP__Session__Status(*val_ptr->value_elements[index+i+len]); } } return ret_val; } PFCP__Session__Status__List PFCP__Session__Status__List::replace(int index, int len, const PFCP__Session__Status__List_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 PFCP__Session__Status__List::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @UPF_Tests.PFCP_Session_Status_List."); 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 = (PFCP__Session__Status**)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 PFCP__Session__Status(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (PFCP__Session__Status**)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 @UPF_Tests.PFCP_Session_Status_List: %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 = (PFCP__Session__Status**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean PFCP__Session__Status__List::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 PFCP__Session__Status__List::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); return val_ptr->n_elements; } int PFCP__Session__Status__List::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); 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 PFCP__Session__Status__List::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 PFCP__Session__Status__List::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 PFCP__Session__Status__List::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", "@UPF_Tests.PFCP_Session_Status_List"); } 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", "@UPF_Tests.PFCP_Session_Status_List"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void PFCP__Session__Status__List::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); 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 PFCP__Session__Status__List::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 @UPF_Tests.PFCP_Session_Status_List."); val_ptr->value_elements = (PFCP__Session__Status**)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 PFCP__Session__Status; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void PFCP__Session__Status__List_template::copy_value(const PFCP__Session__Status__List& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @UPF_Tests.PFCP_Session_Status_List with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (PFCP__Session__Status_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 PFCP__Session__Status_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new PFCP__Session__Status_template; } } set_selection(SPECIFIC_VALUE); } void PFCP__Session__Status__List_template::copy_template(const PFCP__Session__Status__List_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 = (PFCP__Session__Status_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 PFCP__Session__Status_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new PFCP__Session__Status_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 PFCP__Session__Status__List_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 PFCP__Session__Status__List_template(*other_value.implication_.precondition); implication_.implied_template = new PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); break; } set_selection(other_value); } boolean PFCP__Session__Status__List_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 PFCP__Session__Status__List_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const PFCP__Session__Status__List*)value_ptr)[value_index], legacy); else return ((const PFCP__Session__Status__List_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template() { } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(const PFCP__Session__Status__List& other_value) { copy_value(other_value); } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Session__Status__List&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.PFCP_Session_Status_List from an unbound optional field."); } } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(PFCP__Session__Status__List_template* p_precondition, PFCP__Session__Status__List_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PFCP__Session__Status__List_template::PFCP__Session__Status__List_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; } PFCP__Session__Status__List_template::PFCP__Session__Status__List_template(const PFCP__Session__Status__List_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } PFCP__Session__Status__List_template::~PFCP__Session__Status__List_template() { clean_up(); } void PFCP__Session__Status__List_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; } PFCP__Session__Status__List_template& PFCP__Session__Status__List_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PFCP__Session__Status__List_template& PFCP__Session__Status__List_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } PFCP__Session__Status__List_template& PFCP__Session__Status__List_template::operator=(const PFCP__Session__Status__List& other_value) { clean_up(); copy_value(other_value); return *this; } PFCP__Session__Status__List_template& PFCP__Session__Status__List_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Session__Status__List&)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 @UPF_Tests.PFCP_Session_Status_List."); } return *this; } PFCP__Session__Status__List_template& PFCP__Session__Status__List_template::operator=(const PFCP__Session__Status__List_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } PFCP__Session__Status_template& PFCP__Session__Status__List_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List."); break; } return *single_value.value_elements[index_value]; } PFCP__Session__Status_template& PFCP__Session__Status__List_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @UPF_Tests.PFCP_Session_Status_List."); return (*this)[(int)index_value]; } const PFCP__Session__Status_template& PFCP__Session__Status__List_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @UPF_Tests.PFCP_Session_Status_List using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @UPF_Tests.PFCP_Session_Status_List."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @UPF_Tests.PFCP_Session_Status_List: 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 PFCP__Session__Status_template& PFCP__Session__Status__List_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @UPF_Tests.PFCP_Session_Status_List."); return (*this)[(int)index_value]; } void PFCP__Session__Status__List_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @UPF_Tests.PFCP_Session_Status_List."); 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 = (PFCP__Session__Status_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 PFCP__Session__Status_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 PFCP__Session__Status_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 = (PFCP__Session__Status_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int PFCP__Session__Status__List_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 PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List 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 @UPF_Tests.PFCP_Session_Status_List containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @UPF_Tests.PFCP_Session_Status_List.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @UPF_Tests.PFCP_Session_Status_List"); } boolean PFCP__Session__Status__List_template::match(const PFCP__Session__Status__List& 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 @UPF_Tests.PFCP_Session_Status_List."); } return FALSE; } boolean PFCP__Session__Status__List_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; } PFCP__Session__Status__List PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); PFCP__Session__Status__List 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; } PFCP__Session__Status__List PFCP__Session__Status__List_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); } PFCP__Session__Status__List PFCP__Session__Status__List_template::replace(int index, int len, const PFCP__Session__Status__List_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()); } PFCP__Session__Status__List PFCP__Session__Status__List_template::replace(int index, int len, const PFCP__Session__Status__List& 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 PFCP__Session__Status__List_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 PFCP__Session__Status__List_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @UPF_Tests.PFCP_Session_Status_List."); } set_selection(template_type); } PFCP__Session__Status__List_template& PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @UPF_Tests.PFCP_Session_Status_List."); return value_list.list_value[list_index]; } void PFCP__Session__Status__List_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 PFCP__Session__Status__List_template::log_match(const PFCP__Session__Status__List& 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 PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); } } void PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); single_value.value_elements = (PFCP__Session__Status_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 PFCP__Session__Status_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 PFCP__Session__Status__List_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 @UPF_Tests.PFCP_Session_Status_List."); } } boolean PFCP__Session__Status__List_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PFCP__Session__Status__List_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iget_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: { PFCP__Session__Status__List_template* precondition = new PFCP__Session__Status__List_template; precondition->set_param(*param.get_elem(0)); PFCP__Session__Status__List_template* implied_template = new PFCP__Session__Status__List_template; implied_template->set_param(*param.get_elem(1)); *this = PFCP__Session__Status__List_template(precondition, implied_template); } break; default: param.type_error("record of template", "@UPF_Tests.PFCP_Session_Status_List"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void PFCP__Session__Status__List_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 : "@UPF_Tests.PFCP_Session_Status_List"); 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 : "@UPF_Tests.PFCP_Session_Status_List"); } boolean PFCP__Session__Status__List_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 @UPF_Tests.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 @UPF_Tests.void_fn comparison."); return referred_function == other_value; } boolean void__fn::operator==(const void__fn& other_value) const { must_bound("Unbound left operand of @UPF_Tests.void_fn comparison."); other_value.must_bound("Unbound right operand of @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.void_fn"); if(list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.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 @UPF_Tests.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 @UPF_Tests.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; i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) pdr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) far().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(), "pdr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_Ruleset: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@UPF_Tests.PFCP_Ruleset"); } } void PFCP__Ruleset::encode_text(Text_Buf& text_buf) const { field_pdr.encode_text(text_buf); field_far.encode_text(text_buf); } void PFCP__Ruleset::decode_text(Text_Buf& text_buf) { field_pdr.decode_text(text_buf); field_far.decode_text(text_buf); } struct PFCP__Ruleset_template::single_value_struct { PFCP__Types::Create__PDR__list_template field_pdr; PFCP__Types::Create__FAR__list_template field_far; }; void PFCP__Ruleset_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_pdr = ANY_VALUE; single_value->field_far = ANY_VALUE; } } } void PFCP__Ruleset_template::copy_value(const PFCP__Ruleset& other_value) { single_value = new single_value_struct; if (other_value.pdr().is_bound()) { single_value->field_pdr = other_value.pdr(); } else { single_value->field_pdr.clean_up(); } if (other_value.far().is_bound()) { single_value->field_far = other_value.far(); } else { single_value->field_far.clean_up(); } set_selection(SPECIFIC_VALUE); } void PFCP__Ruleset_template::copy_template(const PFCP__Ruleset_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pdr().get_selection()) { single_value->field_pdr = other_value.pdr(); } else { single_value->field_pdr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.far().get_selection()) { single_value->field_far = other_value.far(); } else { single_value->field_far.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 PFCP__Ruleset_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 PFCP__Ruleset_template(*other_value.implication_.precondition); implication_.implied_template = new PFCP__Ruleset_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 @UPF_Tests.PFCP_Ruleset."); break; } set_selection(other_value); } PFCP__Ruleset_template::PFCP__Ruleset_template() { } PFCP__Ruleset_template::PFCP__Ruleset_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PFCP__Ruleset_template::PFCP__Ruleset_template(const PFCP__Ruleset& other_value) { copy_value(other_value); } PFCP__Ruleset_template::PFCP__Ruleset_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Ruleset&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @UPF_Tests.PFCP_Ruleset from an unbound optional field."); } } PFCP__Ruleset_template::PFCP__Ruleset_template(PFCP__Ruleset_template* p_precondition, PFCP__Ruleset_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PFCP__Ruleset_template::PFCP__Ruleset_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; } PFCP__Ruleset_template::PFCP__Ruleset_template(const PFCP__Ruleset_template& other_value) : Base_Template() { copy_template(other_value); } PFCP__Ruleset_template::~PFCP__Ruleset_template() { clean_up(); } PFCP__Ruleset_template& PFCP__Ruleset_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PFCP__Ruleset_template& PFCP__Ruleset_template::operator=(const PFCP__Ruleset& other_value) { clean_up(); copy_value(other_value); return *this; } PFCP__Ruleset_template& PFCP__Ruleset_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PFCP__Ruleset&)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 @UPF_Tests.PFCP_Ruleset."); } return *this; } PFCP__Ruleset_template& PFCP__Ruleset_template::operator=(const PFCP__Ruleset_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PFCP__Ruleset_template::match(const PFCP__Ruleset& 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.pdr().is_bound()) return FALSE; if(!single_value->field_pdr.match(other_value.pdr(), legacy))return FALSE; if(!other_value.far().is_bound()) return FALSE; if(!single_value->field_far.match(other_value.far(), 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 @UPF_Tests.PFCP_Ruleset."); } return FALSE; } boolean PFCP__Ruleset_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pdr.is_bound() || single_value->field_far.is_bound(); } boolean PFCP__Ruleset_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pdr.is_value() && single_value->field_far.is_value(); } void PFCP__Ruleset_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; } PFCP__Ruleset PFCP__Ruleset_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 @UPF_Tests.PFCP_Ruleset."); PFCP__Ruleset ret_val; if (single_value->field_pdr.is_bound()) { ret_val.pdr() = single_value->field_pdr.valueof(); } if (single_value->field_far.is_bound()) { ret_val.far() = single_value->field_far.valueof(); } return ret_val; } void PFCP__Ruleset_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 @UPF_Tests.PFCP_Ruleset."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PFCP__Ruleset_template[list_length]; } PFCP__Ruleset_template& PFCP__Ruleset_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 @UPF_Tests.PFCP_Ruleset."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @UPF_Tests.PFCP_Ruleset."); return value_list.list_value[list_index]; } PFCP__Types::Create__PDR__list_template& PFCP__Ruleset_template::pdr() { set_specific(); return single_value->field_pdr; } const PFCP__Types::Create__PDR__list_template& PFCP__Ruleset_template::pdr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pdr of a non-specific template of type @UPF_Tests.PFCP_Ruleset."); return single_value->field_pdr; } PFCP__Types::Create__FAR__list_template& PFCP__Ruleset_template::far() { set_specific(); return single_value->field_far; } const PFCP__Types::Create__FAR__list_template& PFCP__Ruleset_template::far() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field far of a non-specific template of type @UPF_Tests.PFCP_Ruleset."); return single_value->field_far; } int PFCP__Ruleset_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset 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 @UPF_Tests.PFCP_Ruleset 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 @UPF_Tests.PFCP_Ruleset containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @UPF_Tests.PFCP_Ruleset containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @UPF_Tests.PFCP_Ruleset."); } return 0; } void PFCP__Ruleset_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pdr := "); single_value->field_pdr.log(); TTCN_Logger::log_event_str(", far := "); single_value->field_far.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 PFCP__Ruleset_template::log_match(const PFCP__Ruleset& 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_pdr.match(match_value.pdr(), legacy)){ TTCN_Logger::log_logmatch_info(".pdr"); single_value->field_pdr.log_match(match_value.pdr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_far.match(match_value.far(), legacy)){ TTCN_Logger::log_logmatch_info(".far"); single_value->field_far.log_match(match_value.far(), 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("{ pdr := "); single_value->field_pdr.log_match(match_value.pdr(), legacy); TTCN_Logger::log_event_str(", far := "); single_value->field_far.log_match(match_value.far(), 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 PFCP__Ruleset_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pdr.encode_text(text_buf); single_value->field_far.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 @UPF_Tests.PFCP_Ruleset."); } } void PFCP__Ruleset_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_pdr.decode_text(text_buf); single_value->field_far.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 PFCP__Ruleset_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 @UPF_Tests.PFCP_Ruleset."); } } void PFCP__Ruleset_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: { PFCP__Ruleset_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) pdr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) far().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(), "pdr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pdr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "far")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { far().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @UPF_Tests.PFCP_Ruleset: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PFCP__Ruleset_template* precondition = new PFCP__Ruleset_template; precondition->set_param(*param.get_elem(0)); PFCP__Ruleset_template* implied_template = new PFCP__Ruleset_template; implied_template->set_param(*param.get_elem(1)); *this = PFCP__Ruleset_template(precondition, implied_template); } break; default: param.type_error("record template", "@UPF_Tests.PFCP_Ruleset"); } is_ifpresent = param.get_ifpresent(); } void PFCP__Ruleset_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_pdr.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Ruleset"); single_value->field_far.check_restriction(t_res, t_name ? t_name : "@UPF_Tests.PFCP_Ruleset"); 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 : "@UPF_Tests.PFCP_Ruleset"); } boolean PFCP__Ruleset_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PFCP__Ruleset_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 16)) { current_location.update_lineno(92); /* UPF_Tests.ttcn, line 92 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("token too long: "); name.log(); TTCN_Logger::log_event_str(" in "); str.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(93); /* UPF_Tests.ttcn, line 93 */ return FALSE; } current_location.update_lineno(95); /* UPF_Tests.ttcn, line 95 */ CHARSTRING padded((substr(cs_9, 0, (16 - token.lengthof())) + token)); current_location.update_lineno(96); /* UPF_Tests.ttcn, line 96 */ val = str2oct(padded); current_location.update_lineno(97); /* UPF_Tests.ttcn, line 97 */ return TRUE; } BOOLEAN f__get__name__val__oct4(OCTETSTRING& val, const CHARSTRING& str, const CHARSTRING& name) { TTCN_Location current_location("UPF_Tests.ttcn", 100, TTCN_Location::LOCATION_FUNCTION, "f_get_name_val_oct4"); val.clean_up(); current_location.update_lineno(101); /* UPF_Tests.ttcn, line 101 */ CHARSTRING token; current_location.update_lineno(102); /* UPF_Tests.ttcn, line 102 */ if ((!(f__get__name__val(token, str, name, cs_8, f__get__name__val_delim_defval)))) { current_location.update_lineno(103); /* UPF_Tests.ttcn, line 103 */ return FALSE; } current_location.update_lineno(105); /* UPF_Tests.ttcn, line 105 */ if ((token.lengthof() > 8)) { current_location.update_lineno(106); /* UPF_Tests.ttcn, line 106 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("token too long: "); name.log(); TTCN_Logger::log_event_str(" in "); str.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(107); /* UPF_Tests.ttcn, line 107 */ return FALSE; } current_location.update_lineno(109); /* UPF_Tests.ttcn, line 109 */ CHARSTRING padded((substr(cs_10, 0, (8 - token.lengthof())) + token)); current_location.update_lineno(110); /* UPF_Tests.ttcn, line 110 */ val = str2oct(padded); current_location.update_lineno(111); /* UPF_Tests.ttcn, line 111 */ return TRUE; } BOOLEAN f__get__name__val__int(INTEGER& val, const CHARSTRING& str, const CHARSTRING& name) { TTCN_Location current_location("UPF_Tests.ttcn", 114, TTCN_Location::LOCATION_FUNCTION, "f_get_name_val_int"); val.clean_up(); current_location.update_lineno(115); /* UPF_Tests.ttcn, line 115 */ CHARSTRING token; current_location.update_lineno(116); /* UPF_Tests.ttcn, line 116 */ if ((!(f__get__name__val(token, str, name, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(117); /* UPF_Tests.ttcn, line 117 */ return FALSE; } current_location.update_lineno(119); /* UPF_Tests.ttcn, line 119 */ val = str2int(token); current_location.update_lineno(120); /* UPF_Tests.ttcn, line 120 */ return TRUE; } BOOLEAN f__get__name__val__2int(INTEGER& val1, INTEGER& val2, const CHARSTRING& str, const CHARSTRING& name, const CHARSTRING& delim) { TTCN_Location current_location("UPF_Tests.ttcn", 123, TTCN_Location::LOCATION_FUNCTION, "f_get_name_val_2int"); val1.clean_up(); val2.clean_up(); current_location.update_lineno(124); /* UPF_Tests.ttcn, line 124 */ CHARSTRING token; current_location.update_lineno(125); /* UPF_Tests.ttcn, line 125 */ if ((!(f__get__name__val(token, str, name, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(126); /* UPF_Tests.ttcn, line 126 */ return FALSE; } current_location.update_lineno(128); /* UPF_Tests.ttcn, line 128 */ Misc__Helpers::ro__charstring nrl(Misc__Helpers::f__str__split(token, delim)); current_location.update_lineno(129); /* UPF_Tests.ttcn, line 129 */ if ((nrl.lengthof() != 2)) { current_location.update_lineno(130); /* UPF_Tests.ttcn, line 130 */ return FALSE; } current_location.update_lineno(132); /* UPF_Tests.ttcn, line 132 */ val1 = str2int(const_cast< const Misc__Helpers::ro__charstring&>(nrl)[0]); current_location.update_lineno(133); /* UPF_Tests.ttcn, line 133 */ val2 = str2int(const_cast< const Misc__Helpers::ro__charstring&>(nrl)[1]); current_location.update_lineno(134); /* UPF_Tests.ttcn, line 134 */ return TRUE; } boolean operator==(null_type, const GTP__Action__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @UPF_Tests.GTP_Action_List."); return other_value.val_ptr->n_elements == 0; } BOOLEAN f__parse__gtp__action(GTP__Action& ret, const CHARSTRING& str) { TTCN_Location current_location("UPF_Tests.ttcn", 205, TTCN_Location::LOCATION_FUNCTION, "f_parse_gtp_action"); ret.clean_up(); current_location.update_lineno(209); /* UPF_Tests.ttcn, line 209 */ GTP__Action a; current_location.update_lineno(210); /* UPF_Tests.ttcn, line 210 */ if ((!(f__get__name__val(a.kind(), str, cs_12, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(211); /* UPF_Tests.ttcn, line 211 */ return FALSE; } current_location.update_lineno(213); /* UPF_Tests.ttcn, line 213 */ if ((!(f__get__name__val(a.access().gtp__ip__r(), str, cs_13, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(214); /* UPF_Tests.ttcn, line 214 */ return FALSE; } current_location.update_lineno(216); /* UPF_Tests.ttcn, line 216 */ if ((!(f__get__name__val__oct4(a.access().teid__r(), str, cs_14)))) { current_location.update_lineno(217); /* UPF_Tests.ttcn, line 217 */ return FALSE; } current_location.update_lineno(219); /* UPF_Tests.ttcn, line 219 */ if ((!(f__get__name__val(a.access().gtp__ip__l(), str, cs_15, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(220); /* UPF_Tests.ttcn, line 220 */ return FALSE; } current_location.update_lineno(222); /* UPF_Tests.ttcn, line 222 */ if ((!(f__get__name__val__oct4(a.access().teid__l(), str, cs_16)))) { current_location.update_lineno(223); /* UPF_Tests.ttcn, line 223 */ return FALSE; } current_location.update_lineno(225); /* UPF_Tests.ttcn, line 225 */ if ((!(f__get__name__val__int(a.access().pdr__id(), str, cs_17)))) { current_location.update_lineno(226); /* UPF_Tests.ttcn, line 226 */ return FALSE; } current_location.update_lineno(228); /* UPF_Tests.ttcn, line 228 */ if ((!(f__get__name__val(a.pfcp__peer(), str, cs_18, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(229); /* UPF_Tests.ttcn, line 229 */ return FALSE; } current_location.update_lineno(231); /* UPF_Tests.ttcn, line 231 */ if ((!(f__get__name__val__oct8(a.seid__l(), str, cs_19)))) { current_location.update_lineno(232); /* UPF_Tests.ttcn, line 232 */ return FALSE; } current_location.update_lineno(234); /* UPF_Tests.ttcn, line 234 */ if ((const_cast< const GTP__Action&>(a).kind() == cs_20)) { current_location.update_lineno(235); /* UPF_Tests.ttcn, line 235 */ if ((!(f__get__name__val__int(a.core().tunend().pdr__id(), str, cs_21)))) { current_location.update_lineno(236); /* UPF_Tests.ttcn, line 236 */ return FALSE; } current_location.update_lineno(238); /* UPF_Tests.ttcn, line 238 */ if ((!(f__get__name__val(a.core().tunend().ip__l(), str, cs_22, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(239); /* UPF_Tests.ttcn, line 239 */ return FALSE; } current_location.update_lineno(243); /* UPF_Tests.ttcn, line 243 */ { INTEGER tmp_7; tmp_7 = const_cast< const GTP__Action&>(a).access().pdr__id(); a.core().tunend().far__id() = tmp_7; } current_location.update_lineno(244); /* UPF_Tests.ttcn, line 244 */ { INTEGER tmp_8; tmp_8 = const_cast< const GTP__Action&>(a).core().tunend().pdr__id(); a.access().far__id() = tmp_8; } } else { current_location.update_lineno(245); /* UPF_Tests.ttcn, line 245 */ if ((const_cast< const GTP__Action&>(a).kind() == cs_23)) { current_location.update_lineno(246); /* UPF_Tests.ttcn, line 246 */ if ((!(f__get__name__val(a.core().tunmap().gtp__ip__r(), str, cs_24, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(247); /* UPF_Tests.ttcn, line 247 */ return FALSE; } current_location.update_lineno(249); /* UPF_Tests.ttcn, line 249 */ if ((!(f__get__name__val__oct4(a.core().tunmap().teid__r(), str, cs_25)))) { current_location.update_lineno(250); /* UPF_Tests.ttcn, line 250 */ return FALSE; } current_location.update_lineno(252); /* UPF_Tests.ttcn, line 252 */ if ((!(f__get__name__val(a.core().tunmap().gtp__ip__l(), str, cs_26, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(253); /* UPF_Tests.ttcn, line 253 */ return FALSE; } current_location.update_lineno(255); /* UPF_Tests.ttcn, line 255 */ if ((!(f__get__name__val__oct4(a.core().tunmap().teid__l(), str, cs_27)))) { current_location.update_lineno(256); /* UPF_Tests.ttcn, line 256 */ return FALSE; } current_location.update_lineno(258); /* UPF_Tests.ttcn, line 258 */ if ((!(f__get__name__val__int(a.core().tunmap().pdr__id(), str, cs_21)))) { current_location.update_lineno(259); /* UPF_Tests.ttcn, line 259 */ return FALSE; } current_location.update_lineno(263); /* UPF_Tests.ttcn, line 263 */ { INTEGER tmp_9; tmp_9 = const_cast< const GTP__Action&>(a).access().pdr__id(); a.core().tunmap().far__id() = tmp_9; } current_location.update_lineno(264); /* UPF_Tests.ttcn, line 264 */ { INTEGER tmp_10; tmp_10 = const_cast< const GTP__Action&>(a).core().tunmap().pdr__id(); a.access().far__id() = tmp_10; } } } current_location.update_lineno(267); /* UPF_Tests.ttcn, line 267 */ ret = a; current_location.update_lineno(268); /* UPF_Tests.ttcn, line 268 */ return TRUE; } GTP__Action__List f__vty__get__gtp__actions(TELNETasp__PortType::TELNETasp__PT& vty__pt) { TTCN_Location current_location("UPF_Tests.ttcn", 271, TTCN_Location::LOCATION_FUNCTION, "f_vty_get_gtp_actions"); current_location.update_lineno(272); /* UPF_Tests.ttcn, line 272 */ CHARSTRING gtp__str(Osmocom__VTY__Functions::f__vty__transceive__ret(vty__pt, cs_28, Osmocom__VTY__Functions::f__vty__transceive__ret_strict_defval)); current_location.update_lineno(273); /* UPF_Tests.ttcn, line 273 */ Misc__Helpers::ro__charstring lines(Misc__Helpers::f__str__split(gtp__str, cs_29)); current_location.update_lineno(274); /* UPF_Tests.ttcn, line 274 */ GTP__Action__List gtps(NULL_VALUE); { current_location.update_lineno(275); /* UPF_Tests.ttcn, line 275 */ INTEGER i(0); current_location.update_lineno(275); /* UPF_Tests.ttcn, line 275 */ for ( ; ; ) { current_location.update_lineno(275); /* UPF_Tests.ttcn, line 275 */ if (!(i < lines.lengthof())) break; { current_location.update_lineno(276); /* UPF_Tests.ttcn, line 276 */ CHARSTRING line(const_cast< const Misc__Helpers::ro__charstring&>(lines)[i]); current_location.update_lineno(277); /* UPF_Tests.ttcn, line 277 */ GTP__Action a; current_location.update_lineno(278); /* UPF_Tests.ttcn, line 278 */ if ((!(f__parse__gtp__action(a, line)))) { current_location.update_lineno(279); /* UPF_Tests.ttcn, line 279 */ goto tmp_12; } current_location.update_lineno(281); /* UPF_Tests.ttcn, line 281 */ { GTP__Action__List tmp_13; { GTP__Action__List tmp_14; tmp_14.set_size(1); tmp_14[0] = a; tmp_13 = (gtps + tmp_14); } gtps = tmp_13; } } tmp_12: current_location.update_lineno(275); /* UPF_Tests.ttcn, line 275 */ { INTEGER tmp_15; ++i; } } } current_location.update_lineno(283); /* UPF_Tests.ttcn, line 283 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("GTP-actions: "); gtps.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(284); /* UPF_Tests.ttcn, line 284 */ return gtps; } BOOLEAN f__find__gtp__action(const GTP__Action__List& actions, const GTP__Action_template& find) { TTCN_Location current_location("UPF_Tests.ttcn", 287, TTCN_Location::LOCATION_FUNCTION, "f_find_gtp_action"); { current_location.update_lineno(288); /* UPF_Tests.ttcn, line 288 */ INTEGER i(0); current_location.update_lineno(288); /* UPF_Tests.ttcn, line 288 */ for ( ; ; ) { current_location.update_lineno(288); /* UPF_Tests.ttcn, line 288 */ if (!(i < actions.lengthof())) break; current_location.update_lineno(289); /* UPF_Tests.ttcn, line 289 */ if (find.match(const_cast< const GTP__Action__List&>(actions)[i])) { current_location.update_lineno(290); /* UPF_Tests.ttcn, line 290 */ return TRUE; } current_location.update_lineno(288); /* UPF_Tests.ttcn, line 288 */ { INTEGER tmp_16; ++i; } } } current_location.update_lineno(293); /* UPF_Tests.ttcn, line 293 */ return FALSE; } void f__expect__gtp__action(const GTP__Action__List& actions, const GTP__Action_template& expect) { TTCN_Location current_location("UPF_Tests.ttcn", 296, TTCN_Location::LOCATION_FUNCTION, "f_expect_gtp_action"); current_location.update_lineno(297); /* UPF_Tests.ttcn, line 297 */ if (f__find__gtp__action(actions, expect)) { current_location.update_lineno(298); /* UPF_Tests.ttcn, line 298 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("VTY confirms: GTP action active: "); expect.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(299); /* UPF_Tests.ttcn, line 299 */ TTCN_Runtime::setverdict(PASS); current_location.update_lineno(300); /* UPF_Tests.ttcn, line 300 */ return; } current_location.update_lineno(302); /* UPF_Tests.ttcn, line 302 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Expected to find "); expect.log(); TTCN_Logger::log_event_str(" in "); actions.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(303); /* UPF_Tests.ttcn, line 303 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("on VTY, a GTP action failed to show as active"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(304); /* UPF_Tests.ttcn, line 304 */ TTCN_Runtime::stop_component(MTC_COMPREF); } void f__expect__no__gtp__action(const GTP__Action__List& actions, const GTP__Action_template& expect) { TTCN_Location current_location("UPF_Tests.ttcn", 307, TTCN_Location::LOCATION_FUNCTION, "f_expect_no_gtp_action"); current_location.update_lineno(308); /* UPF_Tests.ttcn, line 308 */ if (f__find__gtp__action(actions, expect)) { current_location.update_lineno(309); /* UPF_Tests.ttcn, line 309 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Expected to *not* find "); expect.log(); TTCN_Logger::log_event_str(" in "); actions.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(310); /* UPF_Tests.ttcn, line 310 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("a GTP action failed to show as inactive"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(311); /* UPF_Tests.ttcn, line 311 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(313); /* UPF_Tests.ttcn, line 313 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("VTY confirms: GTP action inactive: "); expect.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(314); /* UPF_Tests.ttcn, line 314 */ TTCN_Runtime::setverdict(PASS); current_location.update_lineno(315); /* UPF_Tests.ttcn, line 315 */ return; } void f__vty__expect__gtp__action(TELNETasp__PortType::TELNETasp__PT& vty__pt, const GTP__Action_template& expect) { TTCN_Location current_location("UPF_Tests.ttcn", 318, TTCN_Location::LOCATION_FUNCTION, "f_vty_expect_gtp_action"); current_location.update_lineno(319); /* UPF_Tests.ttcn, line 319 */ if ((!(mp__verify__gtp__actions))) { current_location.update_lineno(321); /* UPF_Tests.ttcn, line 321 */ TTCN_Runtime::setverdict(PASS); current_location.update_lineno(322); /* UPF_Tests.ttcn, line 322 */ return; } current_location.update_lineno(324); /* UPF_Tests.ttcn, line 324 */ GTP__Action__List actions(f__vty__get__gtp__actions(vty__pt)); current_location.update_lineno(325); /* UPF_Tests.ttcn, line 325 */ f__expect__gtp__action(actions, expect); } void f__vty__expect__no__gtp__actions(TELNETasp__PortType::TELNETasp__PT& vty__pt) { TTCN_Location current_location("UPF_Tests.ttcn", 328, TTCN_Location::LOCATION_FUNCTION, "f_vty_expect_no_gtp_actions"); current_location.update_lineno(329); /* UPF_Tests.ttcn, line 329 */ GTP__Action__List actions(f__vty__get__gtp__actions(vty__pt)); current_location.update_lineno(330); /* UPF_Tests.ttcn, line 330 */ if ((actions.lengthof() > 0)) { current_location.update_lineno(331); /* UPF_Tests.ttcn, line 331 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("VTY says that there are still active GTP actions"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(332); /* UPF_Tests.ttcn, line 332 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(334); /* UPF_Tests.ttcn, line 334 */ TTCN_Runtime::setverdict(PASS); } boolean operator==(null_type, const PFCP__Session__Status__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @UPF_Tests.PFCP_Session_Status_List."); return other_value.val_ptr->n_elements == 0; } BOOLEAN f__parse__session__status(PFCP__Session__Status& ret, const CHARSTRING& str) { TTCN_Location current_location("UPF_Tests.ttcn", 375, TTCN_Location::LOCATION_FUNCTION, "f_parse_session_status"); ret.clean_up(); current_location.update_lineno(376); /* UPF_Tests.ttcn, line 376 */ PFCP__Session__Status st; current_location.update_lineno(377); /* UPF_Tests.ttcn, line 377 */ if ((!(f__get__name__val(st.peer(), str, cs_31, f__get__name__val_sep_defval, f__get__name__val_delim_defval)))) { current_location.update_lineno(378); /* UPF_Tests.ttcn, line 378 */ return FALSE; } current_location.update_lineno(380); /* UPF_Tests.ttcn, line 380 */ if ((!(f__get__name__val__oct8(st.seid__l(), str, cs_19)))) { current_location.update_lineno(381); /* UPF_Tests.ttcn, line 381 */ return FALSE; } current_location.update_lineno(383); /* UPF_Tests.ttcn, line 383 */ f__get__name__val__oct8(st.seid__r(), str, cs_32); current_location.update_lineno(384); /* UPF_Tests.ttcn, line 384 */ f__get__name__val(st.state(), str, cs_33, f__get__name__val_sep_defval, f__get__name__val_delim_defval); current_location.update_lineno(387); /* UPF_Tests.ttcn, line 387 */ if ((!(f__get__name__val__2int(st.pdr__active__count(), st.pdr__count(), str, cs_34, cs_35)))) { current_location.update_lineno(388); /* UPF_Tests.ttcn, line 388 */ return FALSE; } current_location.update_lineno(391); /* UPF_Tests.ttcn, line 391 */ if ((!(f__get__name__val__2int(st.far__active__count(), st.far__count(), str, cs_36, cs_35)))) { current_location.update_lineno(392); /* UPF_Tests.ttcn, line 392 */ return FALSE; } current_location.update_lineno(395); /* UPF_Tests.ttcn, line 395 */ f__get__name__val__int(st.gtp__active__count(), str, cs_37); current_location.update_lineno(396); /* UPF_Tests.ttcn, line 396 */ ret = st; current_location.update_lineno(397); /* UPF_Tests.ttcn, line 397 */ return TRUE; } PFCP__Session__Status__List f__vty__get__sessions(TELNETasp__PortType::TELNETasp__PT& vty__pt) { TTCN_Location current_location("UPF_Tests.ttcn", 400, TTCN_Location::LOCATION_FUNCTION, "f_vty_get_sessions"); current_location.update_lineno(401); /* UPF_Tests.ttcn, line 401 */ CHARSTRING sessions__str(Osmocom__VTY__Functions::f__vty__transceive__ret(vty__pt, cs_38, Osmocom__VTY__Functions::f__vty__transceive__ret_strict_defval)); current_location.update_lineno(402); /* UPF_Tests.ttcn, line 402 */ Misc__Helpers::ro__charstring lines(Misc__Helpers::f__str__split(sessions__str, cs_29)); current_location.update_lineno(403); /* UPF_Tests.ttcn, line 403 */ PFCP__Session__Status__List sessions(NULL_VALUE); { current_location.update_lineno(404); /* UPF_Tests.ttcn, line 404 */ INTEGER i(0); current_location.update_lineno(404); /* UPF_Tests.ttcn, line 404 */ for ( ; ; ) { current_location.update_lineno(404); /* UPF_Tests.ttcn, line 404 */ if (!(i < lines.lengthof())) break; { current_location.update_lineno(405); /* UPF_Tests.ttcn, line 405 */ CHARSTRING line(const_cast< const Misc__Helpers::ro__charstring&>(lines)[i]); current_location.update_lineno(406); /* UPF_Tests.ttcn, line 406 */ PFCP__Session__Status st; current_location.update_lineno(407); /* UPF_Tests.ttcn, line 407 */ if ((!(f__parse__session__status(st, line)))) { current_location.update_lineno(408); /* UPF_Tests.ttcn, line 408 */ goto tmp_25; } current_location.update_lineno(410); /* UPF_Tests.ttcn, line 410 */ { PFCP__Session__Status__List tmp_26; { PFCP__Session__Status__List tmp_27; tmp_27.set_size(1); tmp_27[0] = st; tmp_26 = (sessions + tmp_27); } sessions = tmp_26; } } tmp_25: current_location.update_lineno(404); /* UPF_Tests.ttcn, line 404 */ { INTEGER tmp_28; ++i; } } } current_location.update_lineno(412); /* UPF_Tests.ttcn, line 412 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Sessions: "); sessions.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(413); /* UPF_Tests.ttcn, line 413 */ return sessions; } BOOLEAN f__vty__get__session__status(TELNETasp__PortType::TELNETasp__PT& vty__pt, const PFCP__session& s, PFCP__Session__Status& ret) { TTCN_Location current_location("UPF_Tests.ttcn", 416, TTCN_Location::LOCATION_FUNCTION, "f_vty_get_session_status"); ret.clean_up(); current_location.update_lineno(417); /* UPF_Tests.ttcn, line 417 */ PFCP__Session__Status__List sessions(f__vty__get__sessions(vty__pt)); current_location.update_lineno(418); /* UPF_Tests.ttcn, line 418 */ return f__get__session__status(sessions, s, ret); } BOOLEAN f__get__session__status(const PFCP__Session__Status__List& sessions, const PFCP__session& s, PFCP__Session__Status& ret) { TTCN_Location current_location("UPF_Tests.ttcn", 421, TTCN_Location::LOCATION_FUNCTION, "f_get_session_status"); ret.clean_up(); current_location.update_lineno(423); /* UPF_Tests.ttcn, line 423 */ PFCP__Session__Status__List matches(NULL_VALUE); { current_location.update_lineno(424); /* UPF_Tests.ttcn, line 424 */ INTEGER i(0); current_location.update_lineno(424); /* UPF_Tests.ttcn, line 424 */ for ( ; ; ) { current_location.update_lineno(424); /* UPF_Tests.ttcn, line 424 */ if (!(i < sessions.lengthof())) break; { current_location.update_lineno(425); /* UPF_Tests.ttcn, line 425 */ PFCP__Session__Status st(const_cast< const PFCP__Session__Status__List&>(sessions)[i]); current_location.update_lineno(426); /* UPF_Tests.ttcn, line 426 */ if ((const_cast< const PFCP__Session__Status&>(st).seid__l() != const_cast< const PFCP__session&>(s).up__seid())) { current_location.update_lineno(427); /* UPF_Tests.ttcn, line 427 */ goto tmp_29; } current_location.update_lineno(429); /* UPF_Tests.ttcn, line 429 */ if ((const_cast< const PFCP__Session__Status&>(st).seid__r() != const_cast< const PFCP__session&>(s).cp__seid())) { current_location.update_lineno(430); /* UPF_Tests.ttcn, line 430 */ goto tmp_29; } current_location.update_lineno(432); /* UPF_Tests.ttcn, line 432 */ { PFCP__Session__Status__List tmp_30; { PFCP__Session__Status__List tmp_31; tmp_31.set_size(1); tmp_31[0] = st; tmp_30 = (matches + tmp_31); } matches = tmp_30; } } tmp_29: current_location.update_lineno(424); /* UPF_Tests.ttcn, line 424 */ { INTEGER tmp_32; ++i; } } } current_location.update_lineno(434); /* UPF_Tests.ttcn, line 434 */ if ((matches.lengthof() < 1)) { current_location.update_lineno(435); /* UPF_Tests.ttcn, line 435 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("no session with SEID-l = "); const_cast< const PFCP__session&>(s).up__seid().log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(436); /* UPF_Tests.ttcn, line 436 */ return FALSE; } current_location.update_lineno(438); /* UPF_Tests.ttcn, line 438 */ if ((matches.lengthof() > 1)) { current_location.update_lineno(439); /* UPF_Tests.ttcn, line 439 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("multiple sessions have "); s.log(); TTCN_Logger::log_event_str(": "); matches.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(440); /* UPF_Tests.ttcn, line 440 */ return FALSE; } current_location.update_lineno(442); /* UPF_Tests.ttcn, line 442 */ ret = const_cast< const PFCP__Session__Status__List&>(matches)[0]; current_location.update_lineno(443); /* UPF_Tests.ttcn, line 443 */ return TRUE; } void f__vty__expect__session__status(TELNETasp__PortType::TELNETasp__PT& vty__pt, const PFCP__session& s, const PFCP__Session__Status_template& expect__st) { TTCN_Location current_location("UPF_Tests.ttcn", 446, TTCN_Location::LOCATION_FUNCTION, "f_vty_expect_session_status"); current_location.update_lineno(447); /* UPF_Tests.ttcn, line 447 */ PFCP__Session__Status st; current_location.update_lineno(448); /* UPF_Tests.ttcn, line 448 */ if ((!(f__vty__get__session__status(vty__pt, s, st)))) { current_location.update_lineno(449); /* UPF_Tests.ttcn, line 449 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Session "); s.log(); TTCN_Logger::log_event_str(" not found in VTY session list"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(450); /* UPF_Tests.ttcn, line 450 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Session not found in VTY list"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(451); /* UPF_Tests.ttcn, line 451 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(453); /* UPF_Tests.ttcn, line 453 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Session "); s.log(); TTCN_Logger::log_event_str(" status: "); st.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(454); /* UPF_Tests.ttcn, line 454 */ if ((!(expect__st.match(st)))) { current_location.update_lineno(455); /* UPF_Tests.ttcn, line 455 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("ERROR: Session "); st.log(); TTCN_Logger::log_event_str(" does not match "); expect__st.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(456); /* UPF_Tests.ttcn, line 456 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("VTY shows unexpected state of PFCP session"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(457); /* UPF_Tests.ttcn, line 457 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(460); /* UPF_Tests.ttcn, line 460 */ TTCN_Runtime::setverdict(PASS); } void f__vty__expect__session__active(TELNETasp__PortType::TELNETasp__PT& vty__pt, const PFCP__session& s) { TTCN_Location current_location("UPF_Tests.ttcn", 463, TTCN_Location::LOCATION_FUNCTION, "f_vty_expect_session_active"); current_location.update_lineno(465); /* UPF_Tests.ttcn, line 465 */ f__vty__expect__session__status(vty__pt, s, PFCP__session__active); current_location.update_lineno(466); /* UPF_Tests.ttcn, line 466 */ f__vty__expect__gtp__action(vty__pt, GTP__Action_template(const_cast< const PFCP__session&>(s).gtp())); current_location.update_lineno(467); /* UPF_Tests.ttcn, line 467 */ TTCN_Runtime::setverdict(PASS); } void f__vty__expect__no__active__sessions(TELNETasp__PortType::TELNETasp__PT& vty__pt) { TTCN_Location current_location("UPF_Tests.ttcn", 470, TTCN_Location::LOCATION_FUNCTION, "f_vty_expect_no_active_sessions"); current_location.update_lineno(471); /* UPF_Tests.ttcn, line 471 */ PFCP__Session__Status__List stl(f__vty__get__sessions(vty__pt)); current_location.update_lineno(472); /* UPF_Tests.ttcn, line 472 */ INTEGER active(0); { current_location.update_lineno(473); /* UPF_Tests.ttcn, line 473 */ INTEGER i(0); current_location.update_lineno(473); /* UPF_Tests.ttcn, line 473 */ for ( ; ; ) { current_location.update_lineno(473); /* UPF_Tests.ttcn, line 473 */ if (!(i < stl.lengthof())) break; current_location.update_lineno(474); /* UPF_Tests.ttcn, line 474 */ if (PFCP__session__active.match(const_cast< const PFCP__Session__Status__List&>(stl)[i])) { current_location.update_lineno(475); /* UPF_Tests.ttcn, line 475 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Active session: "); const_cast< const PFCP__Session__Status__List&>(stl)[i].log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(476); /* UPF_Tests.ttcn, line 476 */ { INTEGER tmp_34; ++active; } } current_location.update_lineno(473); /* UPF_Tests.ttcn, line 473 */ { INTEGER tmp_35; ++i; } } } current_location.update_lineno(479); /* UPF_Tests.ttcn, line 479 */ if ((active > 0)) { current_location.update_lineno(480); /* UPF_Tests.ttcn, line 480 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("There are still active sessions"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(481); /* UPF_Tests.ttcn, line 481 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(483); /* UPF_Tests.ttcn, line 483 */ TTCN_Runtime::setverdict(PASS); } void f__vty__netinst__cfg(TELNETasp__PortType::TELNETasp__PT& vty__pt, const Misc__Helpers::ro__charstring& netinst__cmds) { TTCN_Location current_location("UPF_Tests.ttcn", 486, TTCN_Location::LOCATION_FUNCTION, "f_vty_netinst_cfg"); current_location.update_lineno(488); /* UPF_Tests.ttcn, line 488 */ Osmocom__VTY__Functions::f__vty__enter__config(vty__pt); current_location.update_lineno(489); /* UPF_Tests.ttcn, line 489 */ Osmocom__VTY__Functions::f__vty__transceive(vty__pt, cs_39, Osmocom__VTY__Functions::f__vty__transceive_strict_defval); { current_location.update_lineno(490); /* UPF_Tests.ttcn, line 490 */ INTEGER i(0); current_location.update_lineno(490); /* UPF_Tests.ttcn, line 490 */ for ( ; ; ) { current_location.update_lineno(490); /* UPF_Tests.ttcn, line 490 */ if (!(i < netinst__cmds.lengthof())) break; current_location.update_lineno(491); /* UPF_Tests.ttcn, line 491 */ Osmocom__VTY__Functions::f__vty__transceive(vty__pt, const_cast< const Misc__Helpers::ro__charstring&>(netinst__cmds)[i], Osmocom__VTY__Functions::f__vty__transceive_strict_defval); current_location.update_lineno(490); /* UPF_Tests.ttcn, line 490 */ { INTEGER tmp_36; ++i; } } } current_location.update_lineno(493); /* UPF_Tests.ttcn, line 493 */ Osmocom__VTY__Functions::f__vty__transceive__ret(vty__pt, cs_40, Osmocom__VTY__Functions::f__vty__transceive__ret_strict_defval); } void f__init__vty(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 496, TTCN_Location::LOCATION_FUNCTION, "f_init_vty"); current_location.update_lineno(497); /* UPF_Tests.ttcn, line 497 */ if (test__CT_component_UPFVTY.check_port_state(cs_42)) { current_location.update_lineno(499); /* UPF_Tests.ttcn, line 499 */ return; } current_location.update_lineno(501); /* UPF_Tests.ttcn, line 501 */ { Map_Params tmp_37(0); TTCN_Runtime::map_port(self, test__CT_component_UPFVTY.get_name(), SYSTEM_COMPREF, "UPFVTY", tmp_37); } current_location.update_lineno(502); /* UPF_Tests.ttcn, line 502 */ Osmocom__VTY__Functions::f__vty__set__prompts(test__CT_component_UPFVTY, Osmocom__VTY__Functions::f__vty__set__prompts_prompt__prefix_defval); current_location.update_lineno(503); /* UPF_Tests.ttcn, line 503 */ Osmocom__VTY__Functions::f__vty__transceive(test__CT_component_UPFVTY, cs_43, Osmocom__VTY__Functions::f__vty__transceive_strict_defval); } void start_f__init__vty(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init_vty("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_init_vty", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__init(const FLOAT& guard__timeout) { TTCN_Location current_location("UPF_Tests.ttcn", 507, TTCN_Location::LOCATION_FUNCTION, "f_init"); current_location.update_lineno(508); /* UPF_Tests.ttcn, line 508 */ INTEGER bssap__idx; current_location.update_lineno(510); /* UPF_Tests.ttcn, line 510 */ test__CT_component_T__guard.start(guard__timeout); current_location.update_lineno(511); /* UPF_Tests.ttcn, line 511 */ activate_as__Tguard(); current_location.update_lineno(513); /* UPF_Tests.ttcn, line 513 */ f__init__vty(cs_44); current_location.update_lineno(516); /* UPF_Tests.ttcn, line 516 */ { Misc__Helpers::ro__charstring tmp_38; tmp_38.set_size(5); tmp_38[0] = cs_45; tmp_38[1] = (cs_46 + mp__netinst__access__ip__1); tmp_38[2] = (cs_47 + mp__netinst__access__ip__2); tmp_38[3] = (cs_48 + mp__netinst__core__ip__1); tmp_38[4] = (cs_49 + mp__netinst__core__ip__2); f__vty__netinst__cfg(test__CT_component_UPFVTY, tmp_38); } } void start_f__init(const COMPONENT& component_reference, const FLOAT& guard__timeout) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init("); guard__timeout.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, "UPF_Tests", "f_init", text_buf); guard__timeout.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__shutdown__helper() { TTCN_Location current_location("UPF_Tests.ttcn", 525, TTCN_Location::LOCATION_FUNCTION, "f_shutdown_helper"); current_location.update_lineno(526); /* UPF_Tests.ttcn, line 526 */ TTCN_Runtime::stop_component(ALL_COMPREF); current_location.update_lineno(527); /* UPF_Tests.ttcn, line 527 */ TTCN_Runtime::setverdict(PASS); current_location.update_lineno(528); /* UPF_Tests.ttcn, line 528 */ TTCN_Runtime::stop_component(MTC_COMPREF); } void start_f__shutdown__helper(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_shutdown_helper("); 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, "UPF_Tests", "f_shutdown_helper", text_buf); TTCN_Runtime::send_start_component(text_buf); } CPF__ConnectionHandler::TestHdlrParams f__gen__test__hdlr__pars() { TTCN_Location current_location("UPF_Tests.ttcn", 531, TTCN_Location::LOCATION_FUNCTION, "f_gen_test_hdlr_pars"); current_location.update_lineno(532); /* UPF_Tests.ttcn, line 532 */ CPF__ConnectionHandler::TestHdlrParams pars(CPF__ConnectionHandler::t__def__TestHdlrPars.valueof()); current_location.update_lineno(533); /* UPF_Tests.ttcn, line 533 */ pars.remote__upf__addr() = mp__pfcp__ip__upf; current_location.update_lineno(534); /* UPF_Tests.ttcn, line 534 */ pars.local__addr() = mp__pfcp__ip__local; current_location.update_lineno(535); /* UPF_Tests.ttcn, line 535 */ pars.local__node__id() = PFCP__Templates::ts__PFCP__Node__ID__ipv4(Native__Functions::f__inet__addr(mp__pfcp__ip__local)).valueof(); current_location.update_lineno(536); /* UPF_Tests.ttcn, line 536 */ return pars; } void start_f__gen__test__hdlr__pars(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_gen_test_hdlr_pars("); 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, "UPF_Tests", "f_gen_test_hdlr_pars", text_buf); TTCN_Runtime::send_start_component(text_buf); } COMPONENT f__start__handler__create(const CPF__ConnectionHandler::TestHdlrParams& ) { TTCN_Location current_location("UPF_Tests.ttcn", 541, TTCN_Location::LOCATION_FUNCTION, "f_start_handler_create"); current_location.update_lineno(543); /* UPF_Tests.ttcn, line 543 */ CHARSTRING id(TTCN_Runtime::get_testcasename()); current_location.update_lineno(544); /* UPF_Tests.ttcn, line 544 */ COMPONENT vc__conn; current_location.update_lineno(545); /* UPF_Tests.ttcn, line 545 */ vc__conn = TTCN_Runtime::create_component("CPF_ConnectionHandler", "CPF_ConnHdlr", id, NULL, FALSE); current_location.update_lineno(546); /* UPF_Tests.ttcn, line 546 */ return vc__conn; } void start_f__start__handler__create(const COMPONENT& component_reference, const CPF__ConnectionHandler::TestHdlrParams& pars) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_start_handler_create("); 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, "UPF_Tests", "f_start_handler_create", text_buf); pars.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } COMPONENT f__start__handler__run(const COMPONENT& vc__conn, const void__fn& fn, const CPF__ConnectionHandler::TestHdlrParams& pars) { TTCN_Location current_location("UPF_Tests.ttcn", 549, TTCN_Location::LOCATION_FUNCTION, "f_start_handler_run"); current_location.update_lineno(551); /* UPF_Tests.ttcn, line 551 */ CHARSTRING id(TTCN_Runtime::get_testcasename()); current_location.update_lineno(553); /* UPF_Tests.ttcn, line 553 */ Osmocom__VTY__Functions::f__logp(test__CT_component_UPFVTY, (id + cs_50)); current_location.update_lineno(554); /* UPF_Tests.ttcn, line 554 */ start_f__handler__init(vc__conn, fn, id, pars); current_location.update_lineno(555); /* UPF_Tests.ttcn, line 555 */ return vc__conn; } void start_f__start__handler__run(const COMPONENT& component_reference, const COMPONENT& vc__conn, const void__fn& fn, const CPF__ConnectionHandler::TestHdlrParams& pars) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_start_handler_run("); vc__conn.log(); TTCN_Logger::log_event_str(", "); fn.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, "UPF_Tests", "f_start_handler_run", text_buf); vc__conn.encode_text(text_buf); fn.encode_text(text_buf); pars.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } COMPONENT f__start__handler(const void__fn& fn, const CPF__ConnectionHandler::TestHdlrParams_template& pars__tmpl) { TTCN_Location current_location("UPF_Tests.ttcn", 558, TTCN_Location::LOCATION_FUNCTION, "f_start_handler"); current_location.update_lineno(560); /* UPF_Tests.ttcn, line 560 */ CPF__ConnectionHandler::TestHdlrParams pars; current_location.update_lineno(561); /* UPF_Tests.ttcn, line 561 */ if (pars__tmpl.is_value()) { current_location.update_lineno(562); /* UPF_Tests.ttcn, line 562 */ pars = pars__tmpl.valueof(); } else { current_location.update_lineno(564); /* UPF_Tests.ttcn, line 564 */ pars = f__gen__test__hdlr__pars(); } current_location.update_lineno(566); /* UPF_Tests.ttcn, line 566 */ return f__start__handler__run(f__start__handler__create(pars), fn, pars); } void start_f__start__handler(const COMPONENT& component_reference, const void__fn& fn, const CPF__ConnectionHandler::TestHdlrParams_template& pars__tmpl) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_start_handler("); fn.log(); TTCN_Logger::log_event_str(", "); pars__tmpl.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, "UPF_Tests", "f_start_handler", text_buf); fn.encode_text(text_buf); pars__tmpl.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__handler__init(const void__fn& fn, const CHARSTRING& id, const CPF__ConnectionHandler::TestHdlrParams& pars) { TTCN_Location current_location("UPF_Tests.ttcn", 570, TTCN_Location::LOCATION_FUNCTION, "f_handler_init"); current_location.update_lineno(572); /* UPF_Tests.ttcn, line 572 */ CPF__ConnectionHandler::f__CPF__ConnHdlr__init(id, pars); current_location.update_lineno(573); /* UPF_Tests.ttcn, line 573 */ fn.invoke(id); } void start_f__handler__init(const COMPONENT& component_reference, const void__fn& fn, const CHARSTRING& id, const CPF__ConnectionHandler::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, "UPF_Tests", "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); } void f__assoc__setup() { TTCN_Location current_location("UPF_Tests.ttcn", 577, TTCN_Location::LOCATION_FUNCTION, "f_assoc_setup"); current_location.update_lineno(578); /* UPF_Tests.ttcn, line 578 */ CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Assoc__Setup__Req(PFCP__Types::Node__ID_template(const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__node__id()), CPF__ConnectionHandler::CPF__ConnHdlr_component_g__recovery__timestamp), NULL); current_location.update_lineno(579); /* UPF_Tests.ttcn, line 579 */ { tmp_45: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.receive(PFCP__Templates::tr__PFCP__Assoc__Setup__Resp(PFCP__Templates::tr__PFCP__Assoc__Setup__Resp_node__id_defval, PFCP__Templates::tr__PFCP__Cause(PFCP__Templates::e__PFCP__Cause::REQUEST__ACCEPTED)), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_45; } current_location.update_lineno(579); /* UPF_Tests.ttcn, line 579 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file UPF_Tests.ttcn, line 579."); TTCN_Snapshot::take_new(TRUE); } } } void start_f__assoc__setup(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_assoc_setup("); 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, "UPF_Tests", "f_assoc_setup", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__assoc__release() { TTCN_Location current_location("UPF_Tests.ttcn", 583, TTCN_Location::LOCATION_FUNCTION, "f_assoc_release"); current_location.update_lineno(584); /* UPF_Tests.ttcn, line 584 */ CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Assoc__Release__Req(PFCP__Types::Node__ID_template(const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__node__id())), NULL); current_location.update_lineno(585); /* UPF_Tests.ttcn, line 585 */ { tmp_46: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.receive(PFCP__Templates::tr__PFCP__Assoc__Release__Resp(PFCP__Templates::tr__PFCP__Assoc__Release__Resp_node__id_defval, PFCP__Templates::tr__PFCP__Cause(PFCP__Templates::e__PFCP__Cause::REQUEST__ACCEPTED)), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_46; } current_location.update_lineno(585); /* UPF_Tests.ttcn, line 585 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file UPF_Tests.ttcn, line 585."); TTCN_Snapshot::take_new(TRUE); } } } void start_f__assoc__release(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_assoc_release("); 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, "UPF_Tests", "f_assoc_release", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__ruleset__add__GTP__decaps(PFCP__Ruleset& r, const INTEGER& pdr__id, const CHARSTRING& src__netinst, const INTEGER& far__id) { TTCN_Location current_location("UPF_Tests.ttcn", 597, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_add_GTP_decaps"); current_location.update_lineno(601); /* UPF_Tests.ttcn, line 601 */ { PFCP__Types::Create__PDR__list tmp_47; { PFCP__Types::Create__PDR__list tmp_49; tmp_49.set_size(1); tmp_49[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(PFCP__Templates::e__PFCP__Src__Iface::ACCESS, PFCP__Templates::ts__PFCP__F__TEID__choose__v4(PFCP__Templates::ts__PFCP__F__TEID__choose__v4_choose__id_defval), PFCP__Templates::ts__PFCP__PDI_ue__addr__v4_defval, PFCP__Types::Network__Instance_template(PFCP__Templates::ts__PFCP__Network__Instance(src__netinst))), PFCP__Templates::ts__PFCP__Outer__Header__Removal(PFCP__Templates::e__PFCP__Outer__Header__Removal::GTP__U__UDP__IPV4), far__id).valueof(); tmp_47 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_49); } { PFCP__Types::Create__PDR__list& tmp_48 = r.pdr(); /* 7388 */ tmp_48 = tmp_47; } } current_location.update_lineno(614); /* UPF_Tests.ttcn, line 614 */ { PFCP__Types::Create__FAR__list tmp_50; { PFCP__Types::Create__FAR__list tmp_52; tmp_52.set_size(1); tmp_52[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Forwarding__Parameters(PFCP__Templates::e__PFCP__Dest__Iface::CORE, PFCP__Templates::ts__PFCP__Forwarding__Parameters_outer__header__creation_defval, PFCP__Templates::ts__PFCP__Forwarding__Parameters_network__instance_defval).valueof())).valueof(); tmp_50 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_52); } { PFCP__Types::Create__FAR__list& tmp_51 = r.far(); /* 7388 */ tmp_51 = tmp_50; } } } void f__ruleset__add__GTP__encaps(PFCP__Ruleset& r, const INTEGER& pdr__id, const CHARSTRING& ue__addr__v4, const INTEGER& far__id, const OCTETSTRING& remote__teid, const OCTETSTRING& gtp__dest__addr__v4) { TTCN_Location current_location("UPF_Tests.ttcn", 626, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_add_GTP_encaps"); current_location.update_lineno(632); /* UPF_Tests.ttcn, line 632 */ { PFCP__Types::Create__PDR__list tmp_53; { PFCP__Types::Create__PDR__list tmp_55; tmp_55.set_size(1); tmp_55[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(PFCP__Templates::e__PFCP__Src__Iface::CORE, PFCP__Templates::ts__PFCP__PDI_local__F__TEID_defval, PFCP__Templates::ts__PFCP__UE__IP__Address__v4(Native__Functions::f__inet__addr(ue__addr__v4), TRUE), PFCP__Templates::ts__PFCP__PDI_network__instance_defval), PFCP__Templates::ts__PFCP__Create__PDR_outer__header__removal_defval, far__id).valueof(); tmp_53 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_55); } { PFCP__Types::Create__PDR__list& tmp_54 = r.pdr(); /* 7388 */ tmp_54 = tmp_53; } } current_location.update_lineno(644); /* UPF_Tests.ttcn, line 644 */ { PFCP__Types::Create__FAR__list tmp_56; { PFCP__Types::Create__FAR__list tmp_58; tmp_58.set_size(1); tmp_58[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Forwarding__Parameters(PFCP__Templates::e__PFCP__Dest__Iface::ACCESS, PFCP__Templates::ts__PFCP__Outer__Header__Creation__GTP__ipv4(remote__teid, gtp__dest__addr__v4), PFCP__Templates::ts__PFCP__Forwarding__Parameters_network__instance_defval).valueof())).valueof(); tmp_56 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_58); } { PFCP__Types::Create__FAR__list& tmp_57 = r.far(); /* 7388 */ tmp_57 = tmp_56; } } } void f__ruleset__add__GTP__forw(PFCP__Ruleset& r, const INTEGER& pdr__id, const PFCP__Templates::e__PFCP__Src__Iface& src__iface, const CHARSTRING& src__netinst, const INTEGER& far__id, const PFCP__Templates::e__PFCP__Dest__Iface& dest__iface, const PFCP__Types::F__TEID& dest__remote__f__teid) { TTCN_Location current_location("UPF_Tests.ttcn", 661, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_add_GTP_forw"); current_location.update_lineno(668); /* UPF_Tests.ttcn, line 668 */ { PFCP__Types::Create__PDR__list tmp_59; { PFCP__Types::Create__PDR__list tmp_61; tmp_61.set_size(1); tmp_61[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(src__iface, PFCP__Templates::ts__PFCP__F__TEID__choose__v4(PFCP__Templates::ts__PFCP__F__TEID__choose__v4_choose__id_defval), PFCP__Templates::ts__PFCP__PDI_ue__addr__v4_defval, PFCP__Types::Network__Instance_template(PFCP__Templates::ts__PFCP__Network__Instance(src__netinst))), PFCP__Templates::ts__PFCP__Outer__Header__Removal(PFCP__Templates::e__PFCP__Outer__Header__Removal::GTP__U__UDP__IPV4), far__id).valueof(); tmp_59 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_61); } { PFCP__Types::Create__PDR__list& tmp_60 = r.pdr(); /* 7388 */ tmp_60 = tmp_59; } } current_location.update_lineno(681); /* UPF_Tests.ttcn, line 681 */ { PFCP__Types::Create__FAR__list tmp_62; { PFCP__Types::Create__FAR__list tmp_64; tmp_64.set_size(1); tmp_64[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Forwarding__Parameters(dest__iface, PFCP__Templates::ts__PFCP__Outer__Header__Creation__GTP__ipv4(const_cast< const PFCP__Types::F__TEID&>(dest__remote__f__teid).teid(), const_cast< const PFCP__Types::F__TEID&>(dest__remote__f__teid).ipv4__address()), PFCP__Templates::ts__PFCP__Forwarding__Parameters_network__instance_defval).valueof())).valueof(); tmp_62 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_64); } { PFCP__Types::Create__FAR__list& tmp_63 = r.far(); /* 7388 */ tmp_63 = tmp_62; } } } void f__ruleset__add__GTP__drop(PFCP__Ruleset& r, const INTEGER& pdr__id, const PFCP__Templates::e__PFCP__Src__Iface& src__iface, const CHARSTRING& src__netinst, const INTEGER& far__id, const PFCP__Templates::e__PFCP__Dest__Iface& ) { TTCN_Location current_location("UPF_Tests.ttcn", 695, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_add_GTP_drop"); current_location.update_lineno(701); /* UPF_Tests.ttcn, line 701 */ { PFCP__Types::Create__PDR__list tmp_65; { PFCP__Types::Create__PDR__list tmp_67; tmp_67.set_size(1); tmp_67[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(src__iface, PFCP__Templates::ts__PFCP__F__TEID__choose__v4(PFCP__Templates::ts__PFCP__F__TEID__choose__v4_choose__id_defval), PFCP__Templates::ts__PFCP__PDI_ue__addr__v4_defval, PFCP__Types::Network__Instance_template(PFCP__Templates::ts__PFCP__Network__Instance(src__netinst))), PFCP__Templates::ts__PFCP__Outer__Header__Removal(PFCP__Templates::e__PFCP__Outer__Header__Removal::GTP__U__UDP__IPV4), far__id).valueof(); tmp_65 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_67); } { PFCP__Types::Create__PDR__list& tmp_66 = r.pdr(); /* 7388 */ tmp_66 = tmp_65; } } current_location.update_lineno(714); /* UPF_Tests.ttcn, line 714 */ { PFCP__Types::Create__FAR__list tmp_68; { PFCP__Types::Create__FAR__list tmp_70; tmp_70.set_size(1); tmp_70[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__DROP, PFCP__Types::Forwarding__Parameters_template(OMIT_VALUE)).valueof(); tmp_68 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_70); } { PFCP__Types::Create__FAR__list& tmp_69 = r.far(); /* 7388 */ tmp_69 = tmp_68; } } } PFCP__Types::Update__FAR f__tunmap__upd__far__to__core(const GTP__Action& gtp) { TTCN_Location current_location("UPF_Tests.ttcn", 725, TTCN_Location::LOCATION_FUNCTION, "f_tunmap_upd_far_to_core"); current_location.update_lineno(727); /* UPF_Tests.ttcn, line 727 */ return PFCP__Templates::ts__PFCP__Update__FAR(const_cast< const GTP__Action&>(gtp).core().tunmap().far__id(), PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Update__Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Update__Forwarding__Parameters(PFCP__Templates::e__PFCP__Dest__Iface::CORE, PFCP__Templates::ts__PFCP__Outer__Header__Creation__GTP__ipv4(const_cast< const GTP__Action&>(gtp).core().tunmap().teid__r(), Native__Functions::f__inet__addr(const_cast< const GTP__Action&>(gtp).core().tunmap().gtp__ip__r()))).valueof())).valueof(); } PFCP__Ruleset f__ruleset__noop() { TTCN_Location current_location("UPF_Tests.ttcn", 744, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_noop"); current_location.update_lineno(746); /* UPF_Tests.ttcn, line 746 */ PFCP__Ruleset r; r.pdr() = NULL_VALUE; r.far() = NULL_VALUE; current_location.update_lineno(747); /* UPF_Tests.ttcn, line 747 */ INTEGER pdr__id((const_cast< const PFCP__Ruleset&>(r).pdr().lengthof() + 1)); current_location.update_lineno(748); /* UPF_Tests.ttcn, line 748 */ INTEGER far__id((const_cast< const PFCP__Ruleset&>(r).far().lengthof() + 1)); current_location.update_lineno(750); /* UPF_Tests.ttcn, line 750 */ { PFCP__Types::Create__PDR__list tmp_71; { PFCP__Types::Create__PDR__list tmp_73; tmp_73.set_size(1); tmp_73[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(PFCP__Templates::e__PFCP__Src__Iface::CP__FUNCTION, PFCP__Templates::ts__PFCP__F__TEID__choose__v4(OCTETSTRING_template(os_0)), PFCP__Templates::ts__PFCP__PDI_ue__addr__v4_defval, PFCP__Templates::ts__PFCP__PDI_network__instance_defval), PFCP__Templates::ts__PFCP__Outer__Header__Removal(PFCP__Templates::e__PFCP__Outer__Header__Removal::GTP__U__UDP__IPV4), far__id).valueof(); tmp_71 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_73); } { PFCP__Types::Create__PDR__list& tmp_72 = r.pdr(); /* 7388 */ tmp_72 = tmp_71; } } current_location.update_lineno(762); /* UPF_Tests.ttcn, line 762 */ { PFCP__Types::Create__FAR__list tmp_74; { PFCP__Types::Create__FAR__list tmp_76; tmp_76.set_size(1); tmp_76[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Forwarding__Parameters(PFCP__Templates::e__PFCP__Dest__Iface::ACCESS, PFCP__Templates::ts__PFCP__Forwarding__Parameters_outer__header__creation_defval, PFCP__Templates::ts__PFCP__Forwarding__Parameters_network__instance_defval).valueof())).valueof(); tmp_74 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_76); } { PFCP__Types::Create__FAR__list& tmp_75 = r.far(); /* 7388 */ tmp_75 = tmp_74; } } current_location.update_lineno(773); /* UPF_Tests.ttcn, line 773 */ pdr__id = (const_cast< const PFCP__Ruleset&>(r).pdr().lengthof() + 1); current_location.update_lineno(774); /* UPF_Tests.ttcn, line 774 */ far__id = (const_cast< const PFCP__Ruleset&>(r).far().lengthof() + 1); current_location.update_lineno(776); /* UPF_Tests.ttcn, line 776 */ { PFCP__Types::Create__PDR__list tmp_79; { PFCP__Types::Create__PDR__list tmp_81; tmp_81.set_size(1); tmp_81[0] = PFCP__Templates::ts__PFCP__Create__PDR(pdr__id, PFCP__Templates::ts__PFCP__PDI(PFCP__Templates::e__PFCP__Src__Iface::CP__FUNCTION, PFCP__Templates::ts__PFCP__F__TEID__choose__v4(OCTETSTRING_template(os_1)), PFCP__Templates::ts__PFCP__PDI_ue__addr__v4_defval, PFCP__Templates::ts__PFCP__PDI_network__instance_defval), PFCP__Templates::ts__PFCP__Create__PDR_outer__header__removal_defval, far__id).valueof(); tmp_79 = (const_cast< const PFCP__Ruleset&>(r).pdr() + tmp_81); } { PFCP__Types::Create__PDR__list& tmp_80 = r.pdr(); /* 7388 */ tmp_80 = tmp_79; } } current_location.update_lineno(787); /* UPF_Tests.ttcn, line 787 */ { PFCP__Types::Create__FAR__list tmp_82; { PFCP__Types::Create__FAR__list tmp_84; tmp_84.set_size(1); tmp_84[0] = PFCP__Templates::ts__PFCP__Create__FAR(far__id, PFCP__Templates::ts__PFCP__Apply__Action__FORW(), PFCP__Types::Forwarding__Parameters_template(PFCP__Templates::ts__PFCP__Forwarding__Parameters(PFCP__Templates::e__PFCP__Dest__Iface::ACCESS, PFCP__Templates::ts__PFCP__Forwarding__Parameters_outer__header__creation_defval, PFCP__Templates::ts__PFCP__Forwarding__Parameters_network__instance_defval).valueof())).valueof(); tmp_82 = (const_cast< const PFCP__Ruleset&>(r).far() + tmp_84); } { PFCP__Types::Create__FAR__list& tmp_83 = r.far(); /* 7388 */ tmp_83 = tmp_82; } } current_location.update_lineno(796); /* UPF_Tests.ttcn, line 796 */ return r; } PFCP__Ruleset f__ruleset__tunend(const GTP__Action& gtp, const CHARSTRING& netinst__access) { TTCN_Location current_location("UPF_Tests.ttcn", 800, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_tunend"); current_location.update_lineno(802); /* UPF_Tests.ttcn, line 802 */ PFCP__Ruleset rules; rules.pdr() = NULL_VALUE; rules.far() = NULL_VALUE; current_location.update_lineno(803); /* UPF_Tests.ttcn, line 803 */ f__ruleset__add__GTP__decaps(rules, const_cast< const GTP__Action&>(gtp).access().pdr__id(), netinst__access, const_cast< const GTP__Action&>(gtp).core().tunend().far__id()); current_location.update_lineno(807); /* UPF_Tests.ttcn, line 807 */ f__ruleset__add__GTP__encaps(rules, const_cast< const GTP__Action&>(gtp).core().tunend().pdr__id(), const_cast< const GTP__Action&>(gtp).core().tunend().ip__l(), const_cast< const GTP__Action&>(gtp).access().far__id(), const_cast< const GTP__Action&>(gtp).access().teid__r(), Native__Functions::f__inet__addr(const_cast< const GTP__Action&>(gtp).access().gtp__ip__r())); current_location.update_lineno(813); /* UPF_Tests.ttcn, line 813 */ return rules; } PFCP__Ruleset f__ruleset__tunmap(const GTP__Action& gtp, const BOOLEAN& core__gtp__known, const CHARSTRING& netinst__access, const CHARSTRING& netinst__core) { TTCN_Location current_location("UPF_Tests.ttcn", 822, TTCN_Location::LOCATION_FUNCTION, "f_ruleset_tunmap"); current_location.update_lineno(826); /* UPF_Tests.ttcn, line 826 */ PFCP__Ruleset rules; rules.pdr() = NULL_VALUE; rules.far() = NULL_VALUE; current_location.update_lineno(828); /* UPF_Tests.ttcn, line 828 */ if (core__gtp__known) { current_location.update_lineno(829); /* UPF_Tests.ttcn, line 829 */ f__ruleset__add__GTP__forw(rules, const_cast< const GTP__Action&>(gtp).access().pdr__id(), PFCP__Templates::e__PFCP__Src__Iface::ACCESS, netinst__access, const_cast< const GTP__Action&>(gtp).core().tunmap().far__id(), PFCP__Templates::e__PFCP__Dest__Iface::CORE, PFCP__Templates::ts__PFCP__F__TEID__ipv4(const_cast< const GTP__Action&>(gtp).core().tunmap().teid__r(), Native__Functions::f__inet__addr(const_cast< const GTP__Action&>(gtp).core().tunmap().gtp__ip__r())).valueof()); } else { current_location.update_lineno(839); /* UPF_Tests.ttcn, line 839 */ f__ruleset__add__GTP__drop(rules, const_cast< const GTP__Action&>(gtp).access().pdr__id(), PFCP__Templates::e__PFCP__Src__Iface::ACCESS, netinst__access, const_cast< const GTP__Action&>(gtp).core().tunmap().far__id(), PFCP__Templates::e__PFCP__Dest__Iface::CORE); } current_location.update_lineno(847); /* UPF_Tests.ttcn, line 847 */ f__ruleset__add__GTP__forw(rules, const_cast< const GTP__Action&>(gtp).core().tunmap().pdr__id(), PFCP__Templates::e__PFCP__Src__Iface::CORE, netinst__core, const_cast< const GTP__Action&>(gtp).access().far__id(), PFCP__Templates::e__PFCP__Dest__Iface::ACCESS, PFCP__Templates::ts__PFCP__F__TEID__ipv4(const_cast< const GTP__Action&>(gtp).access().teid__r(), Native__Functions::f__inet__addr(const_cast< const GTP__Action&>(gtp).access().gtp__ip__r())).valueof()); current_location.update_lineno(855); /* UPF_Tests.ttcn, line 855 */ return rules; } PFCP__Types::F__TEID f__get__created__local__f__teid(const PFCP__Types::PDU__PFCP& sess__est__resp, const INTEGER& pdr__id) { TTCN_Location current_location("UPF_Tests.ttcn", 860, TTCN_Location::LOCATION_FUNCTION, "f_get_created_local_f_teid"); { current_location.update_lineno(862); /* UPF_Tests.ttcn, line 862 */ INTEGER i(0); current_location.update_lineno(862); /* UPF_Tests.ttcn, line 862 */ for ( ; ; ) { current_location.update_lineno(863); /* UPF_Tests.ttcn, line 863 */ if (!(i < const_cast< const PFCP__Types::PDU__PFCP&>(sess__est__resp).message__body().pfcp__session__establishment__response().created__PDR__list().lengthof())) break; { current_location.update_lineno(865); /* UPF_Tests.ttcn, line 865 */ PFCP__Types::Created__PDR cpdr(const_cast< const PFCP__Types::PDU__PFCP&>(sess__est__resp).message__body().pfcp__session__establishment__response().created__PDR__list()[i]); current_location.update_lineno(866); /* UPF_Tests.ttcn, line 866 */ if ((oct2int(const_cast< const PFCP__Types::Created__PDR&>(cpdr).grouped__ie().pdr__id().rule__id()) != pdr__id)) { current_location.update_lineno(867); /* UPF_Tests.ttcn, line 867 */ goto tmp_85; } current_location.update_lineno(869); /* UPF_Tests.ttcn, line 869 */ try { TTCN_Logger::begin_event(TTCN_USER); ((cs_54 + int2str(pdr__id)) + cs_55).log(); const_cast< const PFCP__Types::Created__PDR&>(cpdr).grouped__ie().local__F__TEID().log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(870); /* UPF_Tests.ttcn, line 870 */ return const_cast< const PFCP__Types::Created__PDR&>(cpdr).grouped__ie().local__F__TEID()(); } tmp_85: current_location.update_lineno(864); /* UPF_Tests.ttcn, line 864 */ { INTEGER tmp_86; ++i; } } } current_location.update_lineno(872); /* UPF_Tests.ttcn, line 872 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),((cs_56 + int2str(pdr__id)) + cs_57).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(873); /* UPF_Tests.ttcn, line 873 */ TTCN_Runtime::stop_component(MTC_COMPREF); } void f__session__est(PFCP__session& s, const PFCP__Ruleset& rules) { TTCN_Location current_location("UPF_Tests.ttcn", 877, TTCN_Location::LOCATION_FUNCTION, "f_session_est"); current_location.update_lineno(879); /* UPF_Tests.ttcn, line 879 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("f_session_est: rules = "); rules.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(880); /* UPF_Tests.ttcn, line 880 */ CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Session__Est__Req(PFCP__Templates::ts__PFCP__Node__ID__ipv4(Native__Functions::f__inet__addr(const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__addr())), PFCP__Templates::ts__PFCP__F__SEID__ipv4(Native__Functions::f__inet__addr(const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__addr()), const_cast< const PFCP__session&>(s).cp__seid()), const_cast< const PFCP__Ruleset&>(rules).pdr(), const_cast< const PFCP__Ruleset&>(rules).far()), NULL); current_location.update_lineno(884); /* UPF_Tests.ttcn, line 884 */ PFCP__Types::PDU__PFCP pfcp; current_location.update_lineno(885); /* UPF_Tests.ttcn, line 885 */ { tmp_87: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.receive(PFCP__Templates::tr__PFCP__Session__Est__Resp(OCTETSTRING_template(const_cast< const PFCP__session&>(s).cp__seid())), &(pfcp), any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_87; } current_location.update_lineno(885); /* UPF_Tests.ttcn, line 885 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file UPF_Tests.ttcn, line 885."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(886); /* UPF_Tests.ttcn, line 886 */ s.up__seid() = const_cast< const PFCP__Types::PDU__PFCP&>(pfcp).message__body().pfcp__session__establishment__response().UP__F__SEID().seid(); current_location.update_lineno(887); /* UPF_Tests.ttcn, line 887 */ { OCTETSTRING tmp_89; tmp_89 = const_cast< const PFCP__session&>(s).up__seid(); s.gtp().seid__l() = tmp_89; } current_location.update_lineno(889); /* UPF_Tests.ttcn, line 889 */ PFCP__Types::F__TEID access__local__f__teid(f__get__created__local__f__teid(pfcp, const_cast< const PFCP__session&>(s).gtp().access().pdr__id())); current_location.update_lineno(890); /* UPF_Tests.ttcn, line 890 */ s.gtp().access().gtp__ip__l() = Native__Functions::f__inet__ntoa(const_cast< const PFCP__Types::F__TEID&>(access__local__f__teid).ipv4__address()); current_location.update_lineno(891); /* UPF_Tests.ttcn, line 891 */ s.gtp().access().teid__l() = const_cast< const PFCP__Types::F__TEID&>(access__local__f__teid).teid(); current_location.update_lineno(893); /* UPF_Tests.ttcn, line 893 */ { boolean tmp_97; { boolean tmp_92 = s.is_bound(); if(tmp_92) { const PFCP__session& tmp_93 = s; const GTP__Action& tmp_94 = tmp_93.gtp(); tmp_92 = tmp_94.is_bound(); if(tmp_92) { const GTP__Action& tmp_95 = tmp_94; const GTP__Action__core& tmp_96 = tmp_95.core(); tmp_92 = tmp_96.is_bound(); if (tmp_92) { tmp_92 = tmp_96.ischosen(GTP__Action__core::ALT_tunmap); } } } tmp_97 = tmp_92; } if (tmp_97) { current_location.update_lineno(894); /* UPF_Tests.ttcn, line 894 */ PFCP__Types::F__TEID core__local__f__teid(f__get__created__local__f__teid(pfcp, const_cast< const PFCP__session&>(s).gtp().core().tunmap().pdr__id())); current_location.update_lineno(895); /* UPF_Tests.ttcn, line 895 */ s.gtp().core().tunmap().gtp__ip__l() = Native__Functions::f__inet__ntoa(const_cast< const PFCP__Types::F__TEID&>(core__local__f__teid).ipv4__address()); current_location.update_lineno(896); /* UPF_Tests.ttcn, line 896 */ s.gtp().core().tunmap().teid__l() = const_cast< const PFCP__Types::F__TEID&>(core__local__f__teid).teid(); } } current_location.update_lineno(898); /* UPF_Tests.ttcn, line 898 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("established PFCP session: "); s.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } } void start_f__session__est(const COMPONENT& component_reference, PFCP__session& s, const PFCP__Ruleset& rules) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_est("); s.log(); TTCN_Logger::log_event_str(", "); rules.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, "UPF_Tests", "f_session_est", text_buf); s.encode_text(text_buf); rules.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__session__mod(PFCP__session& s) { TTCN_Location current_location("UPF_Tests.ttcn", 902, TTCN_Location::LOCATION_FUNCTION, "f_session_mod"); current_location.update_lineno(904); /* UPF_Tests.ttcn, line 904 */ CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Session__Mod__Req(const_cast< const PFCP__session&>(s).up__seid(), f__tunmap__upd__far__to__core(const_cast< const PFCP__session&>(s).gtp())), NULL); current_location.update_lineno(905); /* UPF_Tests.ttcn, line 905 */ { tmp_100: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.receive(PFCP__Templates::tr__PFCP__Session__Mod__Resp(OCTETSTRING_template(const_cast< const PFCP__session&>(s).cp__seid())), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_100; } current_location.update_lineno(905); /* UPF_Tests.ttcn, line 905 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file UPF_Tests.ttcn, line 905."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(906); /* UPF_Tests.ttcn, line 906 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("modified PFCP session: "); s.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } } void start_f__session__mod(const COMPONENT& component_reference, PFCP__session& s) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_mod("); s.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, "UPF_Tests", "f_session_mod", text_buf); s.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } PFCP__session f__create__PFCP__session__tunend() { TTCN_Location current_location("UPF_Tests.ttcn", 909, TTCN_Location::LOCATION_FUNCTION, "f_create_PFCP_session_tunend"); current_location.update_lineno(911); /* UPF_Tests.ttcn, line 911 */ PFCP__session s; s.cp__seid() = CPF__ConnectionHandler::f__next__seid(); { GTP__Action& tmp_101 = s.gtp(); tmp_101.kind() = cs_20; { GTP__Action__tun& tmp_102 = tmp_101.access(); tmp_102.pdr__id() = 1; tmp_102.gtp__ip__l() = cs_58; tmp_102.teid__l() = os_2; tmp_102.far__id() = 2; tmp_102.gtp__ip__r() = cs_1; tmp_102.teid__r() = CPF__ConnectionHandler::f__next__remote__teid(); } { GTP__Action__tunend& tmp_103 = tmp_101.core().tunend(); tmp_103.pdr__id() = 2; tmp_103.ip__l() = CPF__ConnectionHandler::f__next__ue__addr(); tmp_103.far__id() = 1; } tmp_101.pfcp__peer() = const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__addr(); tmp_101.seid__l() = os_3; } current_location.update_lineno(937); /* UPF_Tests.ttcn, line 937 */ return s; } void start_f__create__PFCP__session__tunend(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_PFCP_session_tunend("); 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, "UPF_Tests", "f_create_PFCP_session_tunend", text_buf); TTCN_Runtime::send_start_component(text_buf); } PFCP__session f__create__PFCP__session__tunmap() { TTCN_Location current_location("UPF_Tests.ttcn", 940, TTCN_Location::LOCATION_FUNCTION, "f_create_PFCP_session_tunmap"); current_location.update_lineno(942); /* UPF_Tests.ttcn, line 942 */ PFCP__session s; s.cp__seid() = CPF__ConnectionHandler::f__next__seid(); { GTP__Action& tmp_104 = s.gtp(); tmp_104.kind() = cs_23; { GTP__Action__tun& tmp_105 = tmp_104.access(); tmp_105.pdr__id() = 1; tmp_105.gtp__ip__l() = cs_58; tmp_105.teid__l() = os_2; tmp_105.far__id() = 2; tmp_105.gtp__ip__r() = cs_1; tmp_105.teid__r() = CPF__ConnectionHandler::f__next__remote__teid(); } { GTP__Action__tun& tmp_106 = tmp_104.core().tunmap(); tmp_106.pdr__id() = 2; tmp_106.gtp__ip__l() = cs_58; tmp_106.teid__l() = os_2; tmp_106.far__id() = 1; tmp_106.gtp__ip__r() = cs_59; tmp_106.teid__r() = CPF__ConnectionHandler::f__next__remote__teid(); } tmp_104.pfcp__peer() = const_cast< const CPF__ConnectionHandler::TestHdlrParams&>(CPF__ConnectionHandler::CPF__ConnHdlr_component_g__pars).local__addr(); tmp_104.seid__l() = os_3; } current_location.update_lineno(972); /* UPF_Tests.ttcn, line 972 */ return s; } void start_f__create__PFCP__session__tunmap(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_create_PFCP_session_tunmap("); 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, "UPF_Tests", "f_create_PFCP_session_tunmap", text_buf); TTCN_Runtime::send_start_component(text_buf); } PFCP__session f__session__est__tunend() { TTCN_Location current_location("UPF_Tests.ttcn", 976, TTCN_Location::LOCATION_FUNCTION, "f_session_est_tunend"); current_location.update_lineno(978); /* UPF_Tests.ttcn, line 978 */ PFCP__session s(f__create__PFCP__session__tunend()); current_location.update_lineno(979); /* UPF_Tests.ttcn, line 979 */ f__session__est(s, f__ruleset__tunend(const_cast< const PFCP__session&>(s).gtp(), f__ruleset__tunend_netinst__access_defval)); current_location.update_lineno(980); /* UPF_Tests.ttcn, line 980 */ return s; } void start_f__session__est__tunend(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_est_tunend("); 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, "UPF_Tests", "f_session_est_tunend", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__session__del(const PFCP__session& s) { TTCN_Location current_location("UPF_Tests.ttcn", 983, TTCN_Location::LOCATION_FUNCTION, "f_session_del"); current_location.update_lineno(984); /* UPF_Tests.ttcn, line 984 */ CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.send(PFCP__Templates::ts__PFCP__Session__Del__Req(const_cast< const PFCP__session&>(s).up__seid()), NULL); current_location.update_lineno(985); /* UPF_Tests.ttcn, line 985 */ { tmp_107: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = CPF__ConnectionHandler::CPF__ConnHdlr_component_PFCP.receive(PFCP__Templates::tr__PFCP__Session__Del__Resp(OCTETSTRING_template(const_cast< const PFCP__session&>(s).cp__seid()), PFCP__Templates::tr__PFCP__Session__Del__Resp_cause_defval), NULL, any_compref, NULL, NULL, NULL); if (alt_flag == ALT_YES) break; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_107; } current_location.update_lineno(985); /* UPF_Tests.ttcn, line 985 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone receive statement failed in file UPF_Tests.ttcn, line 985."); TTCN_Snapshot::take_new(TRUE); } } } void start_f__session__del(const COMPONENT& component_reference, const PFCP__session& s) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_del("); s.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, "UPF_Tests", "f_session_del", text_buf); s.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__tc__assoc(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 988, TTCN_Location::LOCATION_FUNCTION, "f_tc_assoc"); current_location.update_lineno(989); /* UPF_Tests.ttcn, line 989 */ f__assoc__setup(); current_location.update_lineno(990); /* UPF_Tests.ttcn, line 990 */ f__assoc__release(); current_location.update_lineno(991); /* UPF_Tests.ttcn, line 991 */ TTCN_Runtime::setverdict(PASS); } void start_f__tc__assoc(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_assoc("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_assoc", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__assoc__node__id__v4(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 995, TTCN_Location::LOCATION_TESTCASE, "TC_assoc_node_id_v4"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_assoc_node_id_v4", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(996); /* UPF_Tests.ttcn, line 996 */ COMPONENT vc__conn; current_location.update_lineno(998); /* UPF_Tests.ttcn, line 998 */ f__init(5.0); current_location.update_lineno(999); /* UPF_Tests.ttcn, line 999 */ vc__conn = f__start__handler(&f__tc__assoc, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1000); /* UPF_Tests.ttcn, line 1000 */ { tmp_109: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_109; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_109; } current_location.update_lineno(1000); /* UPF_Tests.ttcn, line 1000 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1000."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1001); /* UPF_Tests.ttcn, line 1001 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_assoc_node_id_v4 was stopped."); } return TTCN_Runtime::end_testcase(); } verdicttype testcase_TC__assoc__node__id__fqdn(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1005, TTCN_Location::LOCATION_TESTCASE, "TC_assoc_node_id_fqdn"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_assoc_node_id_fqdn", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1006); /* UPF_Tests.ttcn, line 1006 */ COMPONENT vc__conn; current_location.update_lineno(1007); /* UPF_Tests.ttcn, line 1007 */ CPF__ConnectionHandler::TestHdlrParams pars(f__gen__test__hdlr__pars()); current_location.update_lineno(1009); /* UPF_Tests.ttcn, line 1009 */ pars.local__node__id() = PFCP__Templates::ts__PFCP__Node__ID__fqdn(cs_60).valueof(); current_location.update_lineno(1011); /* UPF_Tests.ttcn, line 1011 */ f__init(5.0); current_location.update_lineno(1012); /* UPF_Tests.ttcn, line 1012 */ vc__conn = f__start__handler(&f__tc__assoc, CPF__ConnectionHandler::TestHdlrParams_template(pars)); current_location.update_lineno(1013); /* UPF_Tests.ttcn, line 1013 */ { tmp_112: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_112; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_112; } current_location.update_lineno(1013); /* UPF_Tests.ttcn, line 1013 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1013."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1014); /* UPF_Tests.ttcn, line 1014 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_assoc_node_id_fqdn was stopped."); } return TTCN_Runtime::end_testcase(); } void f__tc__session__est__tunend(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1018, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_est_tunend"); current_location.update_lineno(1019); /* UPF_Tests.ttcn, line 1019 */ f__assoc__setup(); current_location.update_lineno(1020); /* UPF_Tests.ttcn, line 1020 */ PFCP__session s(f__session__est__tunend()); current_location.update_lineno(1021); /* UPF_Tests.ttcn, line 1021 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1022); /* UPF_Tests.ttcn, line 1022 */ f__vty__expect__session__active(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s); current_location.update_lineno(1023); /* UPF_Tests.ttcn, line 1023 */ f__session__del(s); current_location.update_lineno(1024); /* UPF_Tests.ttcn, line 1024 */ f__vty__expect__no__active__sessions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1025); /* UPF_Tests.ttcn, line 1025 */ f__vty__expect__no__gtp__actions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1026); /* UPF_Tests.ttcn, line 1026 */ f__assoc__release(); current_location.update_lineno(1027); /* UPF_Tests.ttcn, line 1027 */ TTCN_Runtime::setverdict(PASS); } void start_f__tc__session__est__tunend(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_tunend("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_est_tunend", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__session__est__tunend(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1029, TTCN_Location::LOCATION_TESTCASE, "TC_session_est_tunend"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_est_tunend", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1030); /* UPF_Tests.ttcn, line 1030 */ COMPONENT vc__conn; current_location.update_lineno(1032); /* UPF_Tests.ttcn, line 1032 */ f__init(1.5e1); current_location.update_lineno(1033); /* UPF_Tests.ttcn, line 1033 */ vc__conn = f__start__handler(&f__tc__session__est__tunend, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1034); /* UPF_Tests.ttcn, line 1034 */ { tmp_114: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_114; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_114; } current_location.update_lineno(1034); /* UPF_Tests.ttcn, line 1034 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1034."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1035); /* UPF_Tests.ttcn, line 1035 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_est_tunend was stopped."); } return TTCN_Runtime::end_testcase(); } void f__tc__session__term__by__assoc__rel(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1039, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_term_by_assoc_rel"); current_location.update_lineno(1040); /* UPF_Tests.ttcn, line 1040 */ f__assoc__setup(); current_location.update_lineno(1041); /* UPF_Tests.ttcn, line 1041 */ PFCP__session s(f__session__est__tunend()); current_location.update_lineno(1042); /* UPF_Tests.ttcn, line 1042 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1043); /* UPF_Tests.ttcn, line 1043 */ f__vty__expect__session__active(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s); current_location.update_lineno(1044); /* UPF_Tests.ttcn, line 1044 */ f__assoc__release(); current_location.update_lineno(1045); /* UPF_Tests.ttcn, line 1045 */ f__vty__expect__no__active__sessions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1046); /* UPF_Tests.ttcn, line 1046 */ f__vty__expect__no__gtp__actions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1047); /* UPF_Tests.ttcn, line 1047 */ TTCN_Runtime::setverdict(PASS); } void start_f__tc__session__term__by__assoc__rel(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_term_by_assoc_rel("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_term_by_assoc_rel", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__session__term__by__assoc__rel(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1049, TTCN_Location::LOCATION_TESTCASE, "TC_session_term_by_assoc_rel"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_term_by_assoc_rel", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1050); /* UPF_Tests.ttcn, line 1050 */ COMPONENT vc__conn; current_location.update_lineno(1052); /* UPF_Tests.ttcn, line 1052 */ f__init(1.5e1); current_location.update_lineno(1053); /* UPF_Tests.ttcn, line 1053 */ vc__conn = f__start__handler(&f__tc__session__term__by__assoc__rel, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1054); /* UPF_Tests.ttcn, line 1054 */ { tmp_116: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_116; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_116; } current_location.update_lineno(1054); /* UPF_Tests.ttcn, line 1054 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1054."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1055); /* UPF_Tests.ttcn, line 1055 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_term_by_assoc_rel was stopped."); } return TTCN_Runtime::end_testcase(); } void f__tc__session__est__noop(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1059, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_est_noop"); current_location.update_lineno(1060); /* UPF_Tests.ttcn, line 1060 */ f__assoc__setup(); current_location.update_lineno(1061); /* UPF_Tests.ttcn, line 1061 */ PFCP__session s(f__create__PFCP__session__tunend()); current_location.update_lineno(1062); /* UPF_Tests.ttcn, line 1062 */ f__session__est(s, f__ruleset__noop()); current_location.update_lineno(1064); /* UPF_Tests.ttcn, line 1064 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1065); /* UPF_Tests.ttcn, line 1065 */ f__vty__expect__session__status(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s, PFCP__session__inactive); current_location.update_lineno(1067); /* UPF_Tests.ttcn, line 1067 */ f__session__del(s); current_location.update_lineno(1068); /* UPF_Tests.ttcn, line 1068 */ f__vty__expect__no__active__sessions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1069); /* UPF_Tests.ttcn, line 1069 */ f__vty__expect__no__gtp__actions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1070); /* UPF_Tests.ttcn, line 1070 */ f__assoc__release(); current_location.update_lineno(1071); /* UPF_Tests.ttcn, line 1071 */ TTCN_Runtime::setverdict(PASS); } void start_f__tc__session__est__noop(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_noop("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_est_noop", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__session__est__noop(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1073, TTCN_Location::LOCATION_TESTCASE, "TC_session_est_noop"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_est_noop", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1074); /* UPF_Tests.ttcn, line 1074 */ COMPONENT vc__conn; current_location.update_lineno(1076); /* UPF_Tests.ttcn, line 1076 */ f__init(1.5e1); current_location.update_lineno(1077); /* UPF_Tests.ttcn, line 1077 */ vc__conn = f__start__handler(&f__tc__session__est__noop, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1078); /* UPF_Tests.ttcn, line 1078 */ { tmp_118: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_118; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_118; } current_location.update_lineno(1078); /* UPF_Tests.ttcn, line 1078 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1078."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1079); /* UPF_Tests.ttcn, line 1079 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_est_noop was stopped."); } return TTCN_Runtime::end_testcase(); } void f__tc__session__est__tunmap(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1083, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_est_tunmap"); current_location.update_lineno(1084); /* UPF_Tests.ttcn, line 1084 */ f__assoc__setup(); current_location.update_lineno(1085); /* UPF_Tests.ttcn, line 1085 */ PFCP__session s(f__create__PFCP__session__tunmap()); current_location.update_lineno(1086); /* UPF_Tests.ttcn, line 1086 */ f__session__est(s, f__ruleset__tunmap(const_cast< const PFCP__session&>(s).gtp(), f__ruleset__tunmap_core__gtp__known_defval, f__ruleset__tunmap_netinst__access_defval, f__ruleset__tunmap_netinst__core_defval)); current_location.update_lineno(1087); /* UPF_Tests.ttcn, line 1087 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1088); /* UPF_Tests.ttcn, line 1088 */ f__vty__expect__session__active(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s); current_location.update_lineno(1089); /* UPF_Tests.ttcn, line 1089 */ f__session__del(s); current_location.update_lineno(1090); /* UPF_Tests.ttcn, line 1090 */ f__vty__expect__no__active__sessions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1091); /* UPF_Tests.ttcn, line 1091 */ f__vty__expect__no__gtp__actions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1092); /* UPF_Tests.ttcn, line 1092 */ f__assoc__release(); current_location.update_lineno(1093); /* UPF_Tests.ttcn, line 1093 */ TTCN_Runtime::setverdict(PASS); } void start_f__tc__session__est__tunmap(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_tunmap("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_est_tunmap", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__session__est__tunmap(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1095, TTCN_Location::LOCATION_TESTCASE, "TC_session_est_tunmap"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_est_tunmap", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1096); /* UPF_Tests.ttcn, line 1096 */ COMPONENT vc__conn; current_location.update_lineno(1098); /* UPF_Tests.ttcn, line 1098 */ f__init(1.5e1); current_location.update_lineno(1100); /* UPF_Tests.ttcn, line 1100 */ vc__conn = f__start__handler(&f__tc__session__est__tunmap, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1101); /* UPF_Tests.ttcn, line 1101 */ { tmp_120: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_120; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_120; } current_location.update_lineno(1101); /* UPF_Tests.ttcn, line 1101 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1101."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1102); /* UPF_Tests.ttcn, line 1102 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_est_tunmap was stopped."); } return TTCN_Runtime::end_testcase(); } void f__session__est__mod__tunmap(const CHARSTRING& netinst__access, const CHARSTRING& expect__gtp__ip__access, const CHARSTRING& netinst__core, const CHARSTRING& expect__gtp__ip__core) { TTCN_Location current_location("UPF_Tests.ttcn", 1106, TTCN_Location::LOCATION_FUNCTION, "f_session_est_mod_tunmap"); current_location.update_lineno(1108); /* UPF_Tests.ttcn, line 1108 */ f__assoc__setup(); current_location.update_lineno(1109); /* UPF_Tests.ttcn, line 1109 */ PFCP__session s(f__create__PFCP__session__tunmap()); current_location.update_lineno(1110); /* UPF_Tests.ttcn, line 1110 */ f__session__est(s, f__ruleset__tunmap(const_cast< const PFCP__session&>(s).gtp(), FALSE, netinst__access, netinst__core)); current_location.update_lineno(1115); /* UPF_Tests.ttcn, line 1115 */ if ((const_cast< const PFCP__session&>(s).gtp().access().gtp__ip__l() != expect__gtp__ip__access)) { current_location.update_lineno(1116); /* UPF_Tests.ttcn, line 1116 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(((((cs_61 + netinst__access) + cs_62) + expect__gtp__ip__access) + cs_63) + const_cast< const PFCP__session&>(s).gtp().access().gtp__ip__l()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(1118); /* UPF_Tests.ttcn, line 1118 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(1120); /* UPF_Tests.ttcn, line 1120 */ if ((const_cast< const PFCP__session&>(s).gtp().core().tunmap().gtp__ip__l() != expect__gtp__ip__core)) { current_location.update_lineno(1121); /* UPF_Tests.ttcn, line 1121 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(((((cs_61 + netinst__core) + cs_62) + expect__gtp__ip__core) + cs_63) + const_cast< const PFCP__session&>(s).gtp().core().tunmap().gtp__ip__l()).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(1123); /* UPF_Tests.ttcn, line 1123 */ TTCN_Runtime::stop_component(MTC_COMPREF); } current_location.update_lineno(1126); /* UPF_Tests.ttcn, line 1126 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1127); /* UPF_Tests.ttcn, line 1127 */ f__vty__expect__session__status(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s, PFCP__session__inactive); current_location.update_lineno(1129); /* UPF_Tests.ttcn, line 1129 */ f__session__mod(s); current_location.update_lineno(1130); /* UPF_Tests.ttcn, line 1130 */ Osmocom__Types::f__sleep(1.0); current_location.update_lineno(1131); /* UPF_Tests.ttcn, line 1131 */ f__vty__expect__session__active(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY, s); current_location.update_lineno(1132); /* UPF_Tests.ttcn, line 1132 */ f__session__del(s); current_location.update_lineno(1133); /* UPF_Tests.ttcn, line 1133 */ f__vty__expect__no__active__sessions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1134); /* UPF_Tests.ttcn, line 1134 */ f__vty__expect__no__gtp__actions(CPF__ConnectionHandler::CPF__ConnHdlr_component_UPFVTY); current_location.update_lineno(1135); /* UPF_Tests.ttcn, line 1135 */ f__assoc__release(); current_location.update_lineno(1136); /* UPF_Tests.ttcn, line 1136 */ TTCN_Runtime::setverdict(PASS); } void start_f__session__est__mod__tunmap(const COMPONENT& component_reference, const CHARSTRING& netinst__access, const CHARSTRING& expect__gtp__ip__access, const CHARSTRING& netinst__core, const CHARSTRING& expect__gtp__ip__core) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_est_mod_tunmap("); netinst__access.log(); TTCN_Logger::log_event_str(", "); expect__gtp__ip__access.log(); TTCN_Logger::log_event_str(", "); netinst__core.log(); TTCN_Logger::log_event_str(", "); expect__gtp__ip__core.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, "UPF_Tests", "f_session_est_mod_tunmap", text_buf); netinst__access.encode_text(text_buf); expect__gtp__ip__access.encode_text(text_buf); netinst__core.encode_text(text_buf); expect__gtp__ip__core.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__tc__session__est__mod__tunmap(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1139, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_est_mod_tunmap"); current_location.update_lineno(1140); /* UPF_Tests.ttcn, line 1140 */ f__session__est__mod__tunmap(cs_52, mp__netinst__access__ip__1, cs_53, mp__netinst__core__ip__1); } void start_f__tc__session__est__mod__tunmap(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_mod_tunmap("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_est_mod_tunmap", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__tc__session__est__mod__tunmap2(const CHARSTRING& ) { TTCN_Location current_location("UPF_Tests.ttcn", 1143, TTCN_Location::LOCATION_FUNCTION, "f_tc_session_est_mod_tunmap2"); current_location.update_lineno(1144); /* UPF_Tests.ttcn, line 1144 */ f__session__est__mod__tunmap(cs_64, mp__netinst__access__ip__2, cs_65, mp__netinst__core__ip__2); } void start_f__tc__session__est__mod__tunmap2(const COMPONENT& component_reference, const CHARSTRING& id) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_mod_tunmap2("); id.log(); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "UPF_Tests", "f_tc_session_est_mod_tunmap2", text_buf); id.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } verdicttype testcase_TC__session__est__mod__tunmap(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1146, TTCN_Location::LOCATION_TESTCASE, "TC_session_est_mod_tunmap"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_est_mod_tunmap", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1147); /* UPF_Tests.ttcn, line 1147 */ COMPONENT vc__conn; current_location.update_lineno(1149); /* UPF_Tests.ttcn, line 1149 */ f__init(1.5e1); current_location.update_lineno(1151); /* UPF_Tests.ttcn, line 1151 */ vc__conn = f__start__handler(&f__tc__session__est__mod__tunmap, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1152); /* UPF_Tests.ttcn, line 1152 */ { tmp_122: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_122; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_122; } current_location.update_lineno(1152); /* UPF_Tests.ttcn, line 1152 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1152."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1153); /* UPF_Tests.ttcn, line 1153 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_est_mod_tunmap was stopped."); } return TTCN_Runtime::end_testcase(); } verdicttype testcase_TC__session__est__mod__tunmap2(boolean has_timer, double timer_value) { TTCN_Runtime::check_begin_testcase(has_timer, timer_value); TTCN_Location current_location("UPF_Tests.ttcn", 1155, TTCN_Location::LOCATION_TESTCASE, "TC_session_est_mod_tunmap2"); try { TTCN_Runtime::begin_testcase("UPF_Tests", "TC_session_est_mod_tunmap2", "UPF_Tests", "test_CT", "UPF_Tests", "test_CT", has_timer, timer_value); current_location.update_lineno(1156); /* UPF_Tests.ttcn, line 1156 */ COMPONENT vc__conn; current_location.update_lineno(1158); /* UPF_Tests.ttcn, line 1158 */ f__init(1.5e1); current_location.update_lineno(1160); /* UPF_Tests.ttcn, line 1160 */ vc__conn = f__start__handler(&f__tc__session__est__mod__tunmap2, f__start__handler_pars__tmpl_defval); current_location.update_lineno(1161); /* UPF_Tests.ttcn, line 1161 */ { tmp_124: alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (alt_flag != ALT_NO) { alt_flag = vc__conn.done(NULL, NULL); if (alt_flag == ALT_YES) break; else if (alt_flag == ALT_REPEAT) goto tmp_124; } if (default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(); if (default_flag == ALT_YES || default_flag == ALT_BREAK) break; else if (default_flag == ALT_REPEAT) goto tmp_124; } current_location.update_lineno(1161); /* UPF_Tests.ttcn, line 1161 */ if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file UPF_Tests.ttcn, line 1161."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(1162); /* UPF_Tests.ttcn, line 1162 */ f__shutdown__helper(); } catch (const TC_Error& tc_error) { } catch (const TC_End& tc_end) { TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_session_est_mod_tunmap2 was stopped."); } return TTCN_Runtime::end_testcase(); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("UPF_Tests.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "UPF_Tests"); Osmocom__CTRL__Adapter::module_object.pre_init_module(); CPF__ConnectionHandler::module_object.pre_init_module(); PFCP__Templates::module_object.pre_init_module(); current_location.update_lineno(42); /* UPF_Tests.ttcn, line 42 */ modulepar_mp__pfcp__ip__upf = cs_0; module_object.add_modulepar("mp_pfcp_ip_upf"); current_location.update_lineno(43); /* UPF_Tests.ttcn, line 43 */ modulepar_mp__pfcp__ip__local = cs_1; module_object.add_modulepar("mp_pfcp_ip_local"); current_location.update_lineno(45); /* UPF_Tests.ttcn, line 45 */ modulepar_mp__netinst__access__ip__1 = cs_2; module_object.add_modulepar("mp_netinst_access_ip_1"); current_location.update_lineno(46); /* UPF_Tests.ttcn, line 46 */ modulepar_mp__netinst__access__ip__2 = cs_3; module_object.add_modulepar("mp_netinst_access_ip_2"); current_location.update_lineno(47); /* UPF_Tests.ttcn, line 47 */ modulepar_mp__netinst__core__ip__1 = cs_4; module_object.add_modulepar("mp_netinst_core_ip_1"); current_location.update_lineno(48); /* UPF_Tests.ttcn, line 48 */ modulepar_mp__netinst__core__ip__2 = cs_5; module_object.add_modulepar("mp_netinst_core_ip_2"); current_location.update_lineno(51); /* UPF_Tests.ttcn, line 51 */ modulepar_mp__verify__gtp__actions = FALSE; module_object.add_modulepar("mp_verify_gtp_actions"); module_object.add_altstep("as_Tguard", (genericfunc_t)&as__Tguard_instance, (genericfunc_t )&activate_as__Tguard, (genericfunc_t )&as__Tguard); module_object.add_function("f_get_name_val", (genericfunc_t)&f__get__name__val, NULL); module_object.add_function("f_get_name_val_oct8", (genericfunc_t)&f__get__name__val__oct8, NULL); module_object.add_function("f_get_name_val_oct4", (genericfunc_t)&f__get__name__val__oct4, NULL); module_object.add_function("f_get_name_val_int", (genericfunc_t)&f__get__name__val__int, NULL); module_object.add_function("f_get_name_val_2int", (genericfunc_t)&f__get__name__val__2int, NULL); module_object.add_function("f_parse_gtp_action", (genericfunc_t)&f__parse__gtp__action, NULL); module_object.add_function("f_vty_get_gtp_actions", (genericfunc_t)&f__vty__get__gtp__actions, NULL); module_object.add_function("f_find_gtp_action", (genericfunc_t)&f__find__gtp__action, NULL); module_object.add_function("f_expect_gtp_action", (genericfunc_t)&f__expect__gtp__action, NULL); module_object.add_function("f_expect_no_gtp_action", (genericfunc_t)&f__expect__no__gtp__action, NULL); module_object.add_function("f_vty_expect_gtp_action", (genericfunc_t)&f__vty__expect__gtp__action, NULL); module_object.add_function("f_vty_expect_no_gtp_actions", (genericfunc_t)&f__vty__expect__no__gtp__actions, NULL); module_object.add_function("f_parse_session_status", (genericfunc_t)&f__parse__session__status, NULL); module_object.add_function("f_vty_get_sessions", (genericfunc_t)&f__vty__get__sessions, NULL); module_object.add_function("f_vty_get_session_status", (genericfunc_t)&f__vty__get__session__status, NULL); module_object.add_function("f_get_session_status", (genericfunc_t)&f__get__session__status, NULL); module_object.add_function("f_vty_expect_session_status", (genericfunc_t)&f__vty__expect__session__status, NULL); module_object.add_function("f_vty_expect_session_active", (genericfunc_t)&f__vty__expect__session__active, NULL); module_object.add_function("f_vty_expect_no_active_sessions", (genericfunc_t)&f__vty__expect__no__active__sessions, NULL); module_object.add_function("f_vty_netinst_cfg", (genericfunc_t)&f__vty__netinst__cfg, NULL); module_object.add_function("f_init_vty", (genericfunc_t)&f__init__vty, (genericfunc_t)&start_f__init__vty); module_object.add_function("f_init", (genericfunc_t)&f__init, (genericfunc_t)&start_f__init); module_object.add_function("f_shutdown_helper", (genericfunc_t)&f__shutdown__helper, (genericfunc_t)&start_f__shutdown__helper); module_object.add_function("f_gen_test_hdlr_pars", (genericfunc_t)&f__gen__test__hdlr__pars, (genericfunc_t)&start_f__gen__test__hdlr__pars); module_object.add_function("f_start_handler_create", (genericfunc_t)&f__start__handler__create, (genericfunc_t)&start_f__start__handler__create); module_object.add_function("f_start_handler_run", (genericfunc_t)&f__start__handler__run, (genericfunc_t)&start_f__start__handler__run); module_object.add_function("f_start_handler", (genericfunc_t)&f__start__handler, (genericfunc_t)&start_f__start__handler); module_object.add_function("f_handler_init", (genericfunc_t)&f__handler__init, (genericfunc_t)&start_f__handler__init); module_object.add_function("f_assoc_setup", (genericfunc_t)&f__assoc__setup, (genericfunc_t)&start_f__assoc__setup); module_object.add_function("f_assoc_release", (genericfunc_t)&f__assoc__release, (genericfunc_t)&start_f__assoc__release); module_object.add_function("f_ruleset_add_GTP_decaps", (genericfunc_t)&f__ruleset__add__GTP__decaps, NULL); module_object.add_function("f_ruleset_add_GTP_encaps", (genericfunc_t)&f__ruleset__add__GTP__encaps, NULL); module_object.add_function("f_ruleset_add_GTP_forw", (genericfunc_t)&f__ruleset__add__GTP__forw, NULL); module_object.add_function("f_ruleset_add_GTP_drop", (genericfunc_t)&f__ruleset__add__GTP__drop, NULL); module_object.add_function("f_tunmap_upd_far_to_core", (genericfunc_t)&f__tunmap__upd__far__to__core, NULL); module_object.add_function("f_ruleset_noop", (genericfunc_t)&f__ruleset__noop, NULL); module_object.add_function("f_ruleset_tunend", (genericfunc_t)&f__ruleset__tunend, NULL); module_object.add_function("f_ruleset_tunmap", (genericfunc_t)&f__ruleset__tunmap, NULL); module_object.add_function("f_get_created_local_f_teid", (genericfunc_t)&f__get__created__local__f__teid, NULL); module_object.add_function("f_session_est", (genericfunc_t)&f__session__est, (genericfunc_t)&start_f__session__est); module_object.add_function("f_session_mod", (genericfunc_t)&f__session__mod, (genericfunc_t)&start_f__session__mod); module_object.add_function("f_create_PFCP_session_tunend", (genericfunc_t)&f__create__PFCP__session__tunend, (genericfunc_t)&start_f__create__PFCP__session__tunend); module_object.add_function("f_create_PFCP_session_tunmap", (genericfunc_t)&f__create__PFCP__session__tunmap, (genericfunc_t)&start_f__create__PFCP__session__tunmap); module_object.add_function("f_session_est_tunend", (genericfunc_t)&f__session__est__tunend, (genericfunc_t)&start_f__session__est__tunend); module_object.add_function("f_session_del", (genericfunc_t)&f__session__del, (genericfunc_t)&start_f__session__del); module_object.add_function("f_tc_assoc", (genericfunc_t)&f__tc__assoc, (genericfunc_t)&start_f__tc__assoc); module_object.add_testcase_nonpard("TC_assoc_node_id_v4", testcase_TC__assoc__node__id__v4); module_object.add_testcase_nonpard("TC_assoc_node_id_fqdn", testcase_TC__assoc__node__id__fqdn); module_object.add_function("f_tc_session_est_tunend", (genericfunc_t)&f__tc__session__est__tunend, (genericfunc_t)&start_f__tc__session__est__tunend); module_object.add_testcase_nonpard("TC_session_est_tunend", testcase_TC__session__est__tunend); module_object.add_function("f_tc_session_term_by_assoc_rel", (genericfunc_t)&f__tc__session__term__by__assoc__rel, (genericfunc_t)&start_f__tc__session__term__by__assoc__rel); module_object.add_testcase_nonpard("TC_session_term_by_assoc_rel", testcase_TC__session__term__by__assoc__rel); module_object.add_function("f_tc_session_est_noop", (genericfunc_t)&f__tc__session__est__noop, (genericfunc_t)&start_f__tc__session__est__noop); module_object.add_testcase_nonpard("TC_session_est_noop", testcase_TC__session__est__noop); module_object.add_function("f_tc_session_est_tunmap", (genericfunc_t)&f__tc__session__est__tunmap, (genericfunc_t)&start_f__tc__session__est__tunmap); module_object.add_testcase_nonpard("TC_session_est_tunmap", testcase_TC__session__est__tunmap); module_object.add_function("f_session_est_mod_tunmap", (genericfunc_t)&f__session__est__mod__tunmap, (genericfunc_t)&start_f__session__est__mod__tunmap); module_object.add_function("f_tc_session_est_mod_tunmap", (genericfunc_t)&f__tc__session__est__mod__tunmap, (genericfunc_t)&start_f__tc__session__est__mod__tunmap); module_object.add_function("f_tc_session_est_mod_tunmap2", (genericfunc_t)&f__tc__session__est__mod__tunmap2, (genericfunc_t)&start_f__tc__session__est__mod__tunmap2); module_object.add_testcase_nonpard("TC_session_est_mod_tunmap", testcase_TC__session__est__mod__tunmap); module_object.add_testcase_nonpard("TC_session_est_mod_tunmap2", testcase_TC__session__est__mod__tunmap2); } void post_init_module() { TTCN_Location current_location("UPF_Tests.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "UPF_Tests"); Osmocom__CTRL__Adapter::module_object.post_init_module(); CPF__ConnectionHandler::module_object.post_init_module(); PFCP__Templates::module_object.post_init_module(); current_location.update_lineno(71); /* UPF_Tests.ttcn, line 71 */ const_f__get__name__val_sep_defval = cs_6; current_location.update_lineno(71); /* UPF_Tests.ttcn, line 71 */ const_f__get__name__val_delim_defval = cs_7; current_location.update_lineno(123); /* UPF_Tests.ttcn, line 123 */ const_f__get__name__val__2int_delim_defval = cs_11; current_location.update_lineno(349); /* UPF_Tests.ttcn, line 349 */ template_PFCP__session__active.peer() = ANY_VALUE; template_PFCP__session__active.seid__r() = ANY_VALUE; template_PFCP__session__active.seid__l() = ANY_VALUE; template_PFCP__session__active.state() = cs_30; { INTEGER_template& tmp_17 = template_PFCP__session__active.pdr__active__count(); tmp_17.set_type(VALUE_RANGE); tmp_17.set_min(1); tmp_17.set_max(99999); } { INTEGER_template& tmp_18 = template_PFCP__session__active.pdr__count(); tmp_18.set_type(VALUE_RANGE); tmp_18.set_min(1); tmp_18.set_max(99999); } { INTEGER_template& tmp_19 = template_PFCP__session__active.far__active__count(); tmp_19.set_type(VALUE_RANGE); tmp_19.set_min(1); tmp_19.set_max(99999); } { INTEGER_template& tmp_20 = template_PFCP__session__active.far__count(); tmp_20.set_type(VALUE_RANGE); tmp_20.set_min(1); tmp_20.set_max(99999); } { INTEGER_template& tmp_21 = template_PFCP__session__active.gtp__active__count(); tmp_21.set_type(VALUE_RANGE); tmp_21.set_min(1); tmp_21.set_max(99999); } current_location.update_lineno(361); /* UPF_Tests.ttcn, line 361 */ template_PFCP__session__inactive.peer() = ANY_VALUE; template_PFCP__session__inactive.seid__r() = ANY_VALUE; template_PFCP__session__inactive.seid__l() = ANY_VALUE; template_PFCP__session__inactive.state() = cs_30; template_PFCP__session__inactive.pdr__active__count() = 0; { INTEGER_template& tmp_22 = template_PFCP__session__inactive.pdr__count(); tmp_22.set_type(VALUE_RANGE); tmp_22.set_min(1); tmp_22.set_max(99999); } template_PFCP__session__inactive.far__active__count() = 0; { INTEGER_template& tmp_23 = template_PFCP__session__inactive.far__count(); tmp_23.set_type(VALUE_RANGE); tmp_23.set_min(1); tmp_23.set_max(99999); } template_PFCP__session__inactive.gtp__active__count() = 0; current_location.update_lineno(496); /* UPF_Tests.ttcn, line 496 */ const_f__init__vty_id_defval = cs_41; current_location.update_lineno(507); /* UPF_Tests.ttcn, line 507 */ const_f__init_guard__timeout_defval = 3.0e1; current_location.update_lineno(558); /* UPF_Tests.ttcn, line 558 */ template_f__start__handler_pars__tmpl_defval = OMIT_VALUE; current_location.update_lineno(628); /* UPF_Tests.ttcn, line 628 */ const_f__ruleset__add__GTP__encaps_ue__addr__v4_defval = cs_51; current_location.update_lineno(800); /* UPF_Tests.ttcn, line 800 */ const_f__ruleset__tunend_netinst__access_defval = cs_52; current_location.update_lineno(822); /* UPF_Tests.ttcn, line 822 */ const_f__ruleset__tunmap_core__gtp__known_defval = TRUE; current_location.update_lineno(823); /* UPF_Tests.ttcn, line 823 */ const_f__ruleset__tunmap_netinst__access_defval = cs_52; current_location.update_lineno(824); /* UPF_Tests.ttcn, line 824 */ const_f__ruleset__tunmap_netinst__core_defval = cs_53; } boolean set_module_param(Module_Param& param) { const char* const par_name = param.get_id()->get_current_name(); if (!strcmp(par_name, "mp_pfcp_ip_upf")) { modulepar_mp__pfcp__ip__upf.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_pfcp_ip_local")) { modulepar_mp__pfcp__ip__local.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_netinst_access_ip_1")) { modulepar_mp__netinst__access__ip__1.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_netinst_access_ip_2")) { modulepar_mp__netinst__access__ip__2.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_netinst_core_ip_1")) { modulepar_mp__netinst__core__ip__1.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_netinst_core_ip_2")) { modulepar_mp__netinst__core__ip__2.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_verify_gtp_actions")) { modulepar_mp__verify__gtp__actions.set_param(param); return TRUE; } else return FALSE; } void log_module_param() { TTCN_Logger::log_event_str("mp_pfcp_ip_upf := "); mp__pfcp__ip__upf.log(); TTCN_Logger::log_event_str(", mp_pfcp_ip_local := "); mp__pfcp__ip__local.log(); TTCN_Logger::log_event_str(", mp_netinst_access_ip_1 := "); mp__netinst__access__ip__1.log(); TTCN_Logger::log_event_str(", mp_netinst_access_ip_2 := "); mp__netinst__access__ip__2.log(); TTCN_Logger::log_event_str(", mp_netinst_core_ip_1 := "); mp__netinst__core__ip__1.log(); TTCN_Logger::log_event_str(", mp_netinst_core_ip_2 := "); mp__netinst__core__ip__2.log(); TTCN_Logger::log_event_str(", mp_verify_gtp_actions := "); mp__verify__gtp__actions.log(); } boolean init_comp_type(const char *component_type, boolean init_base_comps) { (void)init_base_comps; if (!strcmp(component_type, "test_CT")) { if (init_base_comps) { Module_List::initialize_component("Osmocom_CTRL_Adapter", "CTRL_Adapter_CT", FALSE); } test__CT_component_PFCP.activate_port(); test__CT_component_UPFVTY.activate_port(); return TRUE; } else return FALSE; } boolean init_system_port(const char* component_type, const char* port_name) { if (!strcmp(component_type, "test_CT")) { if (!strcmp(port_name, "IPA_CTRL")) { Osmocom__CTRL__Adapter::CTRL__Adapter__CT_component_IPA__CTRL.safe_start(); return TRUE; } if (!strcmp(port_name, "PFCP")) { test__CT_component_PFCP.safe_start(); return TRUE; } if (!strcmp(port_name, "UPFVTY")) { test__CT_component_UPFVTY.safe_start(); return TRUE; } } return FALSE; } boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments) { if (!strcmp(function_name, "f_init_vty")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init_vty("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__init__vty(id); TTCN_Runtime::function_finished("f_init_vty"); return TRUE; } else if (!strcmp(function_name, "f_init")) { FLOAT guard__timeout; guard__timeout.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init("); guard__timeout.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__init(guard__timeout); TTCN_Runtime::function_finished("f_init"); return TRUE; } else if (!strcmp(function_name, "f_shutdown_helper")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_shutdown_helper()."); TTCN_Runtime::function_started(function_arguments); f__shutdown__helper(); TTCN_Runtime::function_finished("f_shutdown_helper"); return TRUE; } else if (!strcmp(function_name, "f_gen_test_hdlr_pars")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_gen_test_hdlr_pars()."); TTCN_Runtime::function_started(function_arguments); f__gen__test__hdlr__pars(); TTCN_Runtime::function_finished("f_gen_test_hdlr_pars"); return TRUE; } else if (!strcmp(function_name, "f_start_handler_create")) { CPF__ConnectionHandler::TestHdlrParams pars; pars.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_start_handler_create("); pars.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__start__handler__create(pars); TTCN_Runtime::function_finished("f_start_handler_create"); return TRUE; } else if (!strcmp(function_name, "f_start_handler_run")) { COMPONENT vc__conn; void__fn fn; CPF__ConnectionHandler::TestHdlrParams pars; vc__conn.decode_text(function_arguments); fn.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_start_handler_run("); vc__conn.log(); TTCN_Logger::log_event_str(", "); fn.log(); TTCN_Logger::log_event_str(", "); pars.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__start__handler__run(vc__conn, fn, pars); TTCN_Runtime::function_finished("f_start_handler_run"); return TRUE; } else if (!strcmp(function_name, "f_start_handler")) { void__fn fn; CPF__ConnectionHandler::TestHdlrParams_template pars__tmpl; fn.decode_text(function_arguments); pars__tmpl.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_start_handler("); fn.log(); TTCN_Logger::log_event_str(", "); pars__tmpl.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__start__handler(fn, pars__tmpl); TTCN_Runtime::function_finished("f_start_handler"); return TRUE; } else if (!strcmp(function_name, "f_handler_init")) { void__fn fn; CHARSTRING id; CPF__ConnectionHandler::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_assoc_setup")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_assoc_setup()."); TTCN_Runtime::function_started(function_arguments); f__assoc__setup(); TTCN_Runtime::function_finished("f_assoc_setup"); return TRUE; } else if (!strcmp(function_name, "f_assoc_release")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_assoc_release()."); TTCN_Runtime::function_started(function_arguments); f__assoc__release(); TTCN_Runtime::function_finished("f_assoc_release"); return TRUE; } else if (!strcmp(function_name, "f_session_est")) { PFCP__session s; PFCP__Ruleset rules; s.decode_text(function_arguments); rules.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_est("); s.log(); TTCN_Logger::log_event_str(", "); rules.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__session__est(s, rules); TTCN_Runtime::function_finished("f_session_est"); return TRUE; } else if (!strcmp(function_name, "f_session_mod")) { PFCP__session s; s.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_mod("); s.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__session__mod(s); TTCN_Runtime::function_finished("f_session_mod"); return TRUE; } else if (!strcmp(function_name, "f_create_PFCP_session_tunend")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_PFCP_session_tunend()."); TTCN_Runtime::function_started(function_arguments); f__create__PFCP__session__tunend(); TTCN_Runtime::function_finished("f_create_PFCP_session_tunend"); return TRUE; } else if (!strcmp(function_name, "f_create_PFCP_session_tunmap")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_create_PFCP_session_tunmap()."); TTCN_Runtime::function_started(function_arguments); f__create__PFCP__session__tunmap(); TTCN_Runtime::function_finished("f_create_PFCP_session_tunmap"); return TRUE; } else if (!strcmp(function_name, "f_session_est_tunend")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_session_est_tunend()."); TTCN_Runtime::function_started(function_arguments); f__session__est__tunend(); TTCN_Runtime::function_finished("f_session_est_tunend"); return TRUE; } else if (!strcmp(function_name, "f_session_del")) { PFCP__session s; s.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_del("); s.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__session__del(s); TTCN_Runtime::function_finished("f_session_del"); return TRUE; } else if (!strcmp(function_name, "f_tc_assoc")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_assoc("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__assoc(id); TTCN_Runtime::function_finished("f_tc_assoc"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_est_tunend")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_tunend("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__est__tunend(id); TTCN_Runtime::function_finished("f_tc_session_est_tunend"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_term_by_assoc_rel")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_term_by_assoc_rel("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__term__by__assoc__rel(id); TTCN_Runtime::function_finished("f_tc_session_term_by_assoc_rel"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_est_noop")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_noop("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__est__noop(id); TTCN_Runtime::function_finished("f_tc_session_est_noop"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_est_tunmap")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_tunmap("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__est__tunmap(id); TTCN_Runtime::function_finished("f_tc_session_est_tunmap"); return TRUE; } else if (!strcmp(function_name, "f_session_est_mod_tunmap")) { CHARSTRING netinst__access; CHARSTRING expect__gtp__ip__access; CHARSTRING netinst__core; CHARSTRING expect__gtp__ip__core; netinst__access.decode_text(function_arguments); expect__gtp__ip__access.decode_text(function_arguments); netinst__core.decode_text(function_arguments); expect__gtp__ip__core.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_session_est_mod_tunmap("); netinst__access.log(); TTCN_Logger::log_event_str(", "); expect__gtp__ip__access.log(); TTCN_Logger::log_event_str(", "); netinst__core.log(); TTCN_Logger::log_event_str(", "); expect__gtp__ip__core.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__session__est__mod__tunmap(netinst__access, expect__gtp__ip__access, netinst__core, expect__gtp__ip__core); TTCN_Runtime::function_finished("f_session_est_mod_tunmap"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_est_mod_tunmap")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_mod_tunmap("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__est__mod__tunmap(id); TTCN_Runtime::function_finished("f_tc_session_est_mod_tunmap"); return TRUE; } else if (!strcmp(function_name, "f_tc_session_est_mod_tunmap2")) { CHARSTRING id; id.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tc_session_est_mod_tunmap2("); id.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tc__session__est__mod__tunmap2(id); TTCN_Runtime::function_finished("f_tc_session_est_mod_tunmap2"); return TRUE; } else return FALSE; } void module_control_part() { TTCN_Location current_location("UPF_Tests.ttcn", 1165, TTCN_Location::LOCATION_CONTROLPART, "UPF_Tests"); TTCN_Runtime::begin_controlpart("UPF_Tests"); current_location.update_lineno(1166); /* UPF_Tests.ttcn, line 1166 */ testcase_TC__assoc__node__id__v4(FALSE, 0.0); current_location.update_lineno(1167); /* UPF_Tests.ttcn, line 1167 */ testcase_TC__assoc__node__id__fqdn(FALSE, 0.0); current_location.update_lineno(1168); /* UPF_Tests.ttcn, line 1168 */ testcase_TC__session__est__tunend(FALSE, 0.0); current_location.update_lineno(1169); /* UPF_Tests.ttcn, line 1169 */ testcase_TC__session__term__by__assoc__rel(FALSE, 0.0); current_location.update_lineno(1170); /* UPF_Tests.ttcn, line 1170 */ testcase_TC__session__est__noop(FALSE, 0.0); current_location.update_lineno(1171); /* UPF_Tests.ttcn, line 1171 */ testcase_TC__session__est__tunmap(FALSE, 0.0); current_location.update_lineno(1172); /* UPF_Tests.ttcn, line 1172 */ testcase_TC__session__est__mod__tunmap(FALSE, 0.0); current_location.update_lineno(1173); /* UPF_Tests.ttcn, line 1173 */ testcase_TC__session__est__mod__tunmap2(FALSE, 0.0); TTCN_Runtime::end_controlpart(); } } /* end of namespace */