// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 11.1.0 // The generation of user and time information were disabled by the -D flag. // Copyright (c) 2000-2025 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "LAPDm_RAW_PT.hh" namespace LAPDm__RAW__PT { /* Literal string constants */ const unsigned char os_0_octets[] = { 31 }, os_1_octets[] = { 43 }; extern const OCTETSTRING os_0(1, os_0_octets), os_1(1, os_1_octets); extern const CHARSTRING cs_1(25, "Unable to esetablish DCCH"), cs_0(26, "Unable to establish UL TBF"), cs_2(24, "Unable to switch to DCCH"); const unsigned char module_checksum[] = { 0x2e, 0x7b, 0xae, 0x5a, 0x34, 0xa6, 0x0b, 0x63, 0x6e, 0xef, 0x43, 0x57, 0xff, 0x9c, 0xb6, 0x5f }; /* Global variable definitions */ // No XER for TfiUsfArr const TTCN_Typedescriptor_t TfiUsfArr_descr_ = { "@LAPDm_RAW_PT.TfiUsfArr", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &Osmocom__Types::uint8__t_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TfiUsfArr_0_xer_ = { {"uint8_t>\n", "uint8_t>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TfiUsfArr_0_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TfiUsfArr_0_descr_ = { "@LAPDm_RAW_PT.TfiUsfArr.", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &TfiUsfArr_0_xer_, &INTEGER_json_, &TfiUsfArr_0_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TfiUsfArr_0_default_coding("RAW"); UNIVERSAL_CHARSTRING BCCH__tune__req_arfcn_default_coding("RAW"); const XERdescriptor_t BCCH__tune__req_combined__ccch_xer_ = { {"combined_ccch>\n", "combined_ccch>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int BCCH__tune__req_combined__ccch_oer_ext_arr_[0] = {}; const int BCCH__tune__req_combined__ccch_oer_p_[0] = {}; const TTCN_OERdescriptor_t BCCH__tune__req_combined__ccch_oer_ = { -1, TRUE, -1, FALSE, 0, 0, BCCH__tune__req_combined__ccch_oer_ext_arr_, 0, BCCH__tune__req_combined__ccch_oer_p_}; const TTCN_Typedescriptor_t BCCH__tune__req_combined__ccch_descr_ = { "@LAPDm_RAW_PT.BCCH_tune_req.combined_ccch", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &BCCH__tune__req_combined__ccch_xer_, &BOOLEAN_json_, &BCCH__tune__req_combined__ccch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for BCCH__tune__req const TTCN_Typedescriptor_t BCCH__tune__req_descr_ = { "@LAPDm_RAW_PT.BCCH_tune_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t DCCH__establish__req_ra_xer_ = { {"ra>\n", "ra>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t DCCH__establish__req_ra_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t DCCH__establish__req_ra_descr_ = { "@LAPDm_RAW_PT.DCCH_establish_req.ra", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &DCCH__establish__req_ra_xer_, &INTEGER_json_, &DCCH__establish__req_ra_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING DCCH__establish__req_ra_default_coding("RAW"); // No XER for DCCH__establish__req const TTCN_Typedescriptor_t DCCH__establish__req_descr_ = { "@LAPDm_RAW_PT.DCCH_establish_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for DCCH__establish__res const TTCN_Typedescriptor_t DCCH__establish__res_descr_ = { "@LAPDm_RAW_PT.DCCH_establish_res", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING DCCH__establish__res_chan__desc_default_coding("RAW"); const XERdescriptor_t DCCH__establish__res_err_xer_ = { {"err>\n", "err>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t DCCH__establish__res_err_descr_ = { "@LAPDm_RAW_PT.DCCH_establish_res.err", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DCCH__establish__res_err_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING DCCH__switch__req_chan__desc_default_coding("RAW"); // No XER for DCCH__switch__req const TTCN_Typedescriptor_t DCCH__switch__req_descr_ = { "@LAPDm_RAW_PT.DCCH_switch_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING DCCH__switch__req_ma_default_coding("RAW"); // No XER for DCCH__switch__res const TTCN_Typedescriptor_t DCCH__switch__res_descr_ = { "@LAPDm_RAW_PT.DCCH_switch_res", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t DCCH__switch__res_err_xer_ = { {"err>\n", "err>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t DCCH__switch__res_err_descr_ = { "@LAPDm_RAW_PT.DCCH_switch_res.err", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &DCCH__switch__res_err_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for TfiList const TTCN_Typedescriptor_t TfiList_descr_ = { "@LAPDm_RAW_PT.TfiList", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &Osmocom__Types::uint8__t_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TfiList_0_xer_ = { {"uint8_t>\n", "uint8_t>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TfiList_0_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TfiList_0_descr_ = { "@LAPDm_RAW_PT.TfiList.", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &TfiList_0_xer_, &INTEGER_json_, &TfiList_0_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TfiList_0_default_coding("RAW"); // No XER for TbfPars const TTCN_Typedescriptor_t TbfPars_descr_ = { "@LAPDm_RAW_PT.TbfPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TbfPars_arfcn_xer_ = { {"arfcn>\n", "arfcn>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TbfPars_arfcn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TbfPars_arfcn_descr_ = { "@LAPDm_RAW_PT.TbfPars.arfcn", &INTEGER_ber_, &GSM__Types::GsmArfcn_raw_, &INTEGER_text_, &TbfPars_arfcn_xer_, &INTEGER_json_, &TbfPars_arfcn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TbfPars_arfcn_default_coding("RAW"); // No XER for TbfParsPerTs const TTCN_Typedescriptor_t TbfParsPerTs_descr_ = { "@LAPDm_RAW_PT.TbfParsPerTs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &TbfPars_descr_, TTCN_Typedescriptor_t::DONTCARE }; TbfPars_template template_t__TbfParsInit; const TbfPars_template& t__TbfParsInit = template_t__TbfParsInit; // No XER for TBF__UL__establish__res const TTCN_Typedescriptor_t TBF__UL__establish__res_descr_ = { "@LAPDm_RAW_PT.TBF_UL_establish_res", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TBF__UL__establish__res_err_xer_ = { {"err>\n", "err>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TBF__UL__establish__res_err_descr_ = { "@LAPDm_RAW_PT.TBF_UL_establish_res.err", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &TBF__UL__establish__res_err_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for DCCH__release__req const TTCN_Typedescriptor_t DCCH__release__req_descr_ = { "@LAPDm_RAW_PT.DCCH_release_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t LAPDm__ph__data_sacch_xer_ = { {"sacch>\n", "sacch>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const int LAPDm__ph__data_sacch_oer_ext_arr_[0] = {}; const int LAPDm__ph__data_sacch_oer_p_[0] = {}; const TTCN_OERdescriptor_t LAPDm__ph__data_sacch_oer_ = { -1, TRUE, -1, FALSE, 0, 0, LAPDm__ph__data_sacch_oer_ext_arr_, 0, LAPDm__ph__data_sacch_oer_p_}; const TTCN_Typedescriptor_t LAPDm__ph__data_sacch_descr_ = { "@LAPDm_RAW_PT.LAPDm_ph_data.sacch", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &LAPDm__ph__data_sacch_xer_, &BOOLEAN_json_, &LAPDm__ph__data_sacch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t LAPDm__ph__data_sapi_xer_ = { {"sapi>\n", "sapi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t LAPDm__ph__data_sapi_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t LAPDm__ph__data_sapi_descr_ = { "@LAPDm_RAW_PT.LAPDm_ph_data.sapi", &INTEGER_ber_, &GSM__Types::GsmSapi_raw_, &INTEGER_text_, &LAPDm__ph__data_sapi_xer_, &INTEGER_json_, &LAPDm__ph__data_sapi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LAPDm__ph__data_sapi_default_coding("RAW"); UNIVERSAL_CHARSTRING LAPDm__ph__data_lapdm_default_coding("RAW"); // No XER for LAPDm__ph__data const TTCN_Typedescriptor_t LAPDm__ph__data_descr_ = { "@LAPDm_RAW_PT.LAPDm_ph_data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TbfNr_xer_ = { {"TbfNr>\n", "TbfNr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TbfNr_descr_ = { "@LAPDm_RAW_PT.TbfNr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TbfNr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TBF__UL__establish__req_tbf__nr_xer_ = { {"tbf_nr>\n", "tbf_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TBF__UL__establish__req_tbf__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TBF__UL__establish__req_tbf__nr_descr_ = { "@LAPDm_RAW_PT.TBF_UL_establish_req.tbf_nr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TBF__UL__establish__req_tbf__nr_xer_, &INTEGER_json_, &TBF__UL__establish__req_tbf__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TBF__UL__establish__req_ra_xer_ = { {"ra>\n", "ra>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TBF__UL__establish__req_ra_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TBF__UL__establish__req_ra_descr_ = { "@LAPDm_RAW_PT.TBF_UL_establish_req.ra", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &TBF__UL__establish__req_ra_xer_, &INTEGER_json_, &TBF__UL__establish__req_ra_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TBF__UL__establish__req_ra_default_coding("RAW"); // No XER for TBF__UL__establish__req const TTCN_Typedescriptor_t TBF__UL__establish__req_descr_ = { "@LAPDm_RAW_PT.TBF_UL_establish_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TBF__DL__establish__req_tbf__nr_xer_ = { {"tbf_nr>\n", "tbf_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TBF__DL__establish__req_tbf__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TBF__DL__establish__req_tbf__nr_descr_ = { "@LAPDm_RAW_PT.TBF_DL_establish_req.tbf_nr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TBF__DL__establish__req_tbf__nr_xer_, &INTEGER_json_, &TBF__DL__establish__req_tbf__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for TBF__DL__establish__req const TTCN_Typedescriptor_t TBF__DL__establish__req_descr_ = { "@LAPDm_RAW_PT.TBF_DL_establish_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__ind_cs_default_coding("RAW"); const XERdescriptor_t RLCMAC__ph__data__ind_ts__nr_xer_ = { {"ts_nr>\n", "ts_nr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__ind_ts__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__ind_ts__nr_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_ind.ts_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &RLCMAC__ph__data__ind_ts__nr_xer_, &INTEGER_json_, &RLCMAC__ph__data__ind_ts__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__ind_ts__nr_default_coding("RAW"); const XERdescriptor_t RLCMAC__ph__data__ind_fn_xer_ = { {"fn>\n", "fn>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__ind_fn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__ind_fn_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_ind.fn", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &RLCMAC__ph__data__ind_fn_xer_, &INTEGER_json_, &RLCMAC__ph__data__ind_fn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__ind_fn_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__ind_block_default_coding("RAW"); // No XER for RLCMAC__ph__data__ind const TTCN_Typedescriptor_t RLCMAC__ph__data__ind_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_ind", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RLCMAC__ph__data__req__dyn_tbf__id_xer_ = { {"tbf_id>\n", "tbf_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__req__dyn_tbf__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__req__dyn_tbf__id_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn.tbf_id", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &RLCMAC__ph__data__req__dyn_tbf__id_xer_, &INTEGER_json_, &RLCMAC__ph__data__req__dyn_tbf__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__dyn_tbf__id_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__dyn_cs_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__dyn_block_default_coding("RAW"); // No XER for RLCMAC__ph__data__req__dyn const TTCN_Typedescriptor_t RLCMAC__ph__data__req__dyn_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t RLCMAC__ph__data__req__abs_tbf__id_xer_ = { {"tbf_id>\n", "tbf_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__req__abs_tbf__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__req__abs_tbf__id_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs.tbf_id", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &RLCMAC__ph__data__req__abs_tbf__id_xer_, &INTEGER_json_, &RLCMAC__ph__data__req__abs_tbf__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_tbf__id_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_cs_default_coding("RAW"); const XERdescriptor_t RLCMAC__ph__data__req__abs_ts__nr_xer_ = { {"ts_nr>\n", "ts_nr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__req__abs_ts__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__req__abs_ts__nr_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs.ts_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &RLCMAC__ph__data__req__abs_ts__nr_xer_, &INTEGER_json_, &RLCMAC__ph__data__req__abs_ts__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_ts__nr_default_coding("RAW"); const XERdescriptor_t RLCMAC__ph__data__req__abs_fn_xer_ = { {"fn>\n", "fn>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t RLCMAC__ph__data__req__abs_fn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t RLCMAC__ph__data__req__abs_fn_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs.fn", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &RLCMAC__ph__data__req__abs_fn_xer_, &INTEGER_json_, &RLCMAC__ph__data__req__abs_fn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_fn_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_arfcn_default_coding("RAW"); UNIVERSAL_CHARSTRING RLCMAC__ph__data__req__abs_block_default_coding("RAW"); // No XER for RLCMAC__ph__data__req__abs const TTCN_Typedescriptor_t RLCMAC__ph__data__req__abs_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for RLCMAC__ph__data__req const TTCN_Typedescriptor_t RLCMAC__ph__data__req_descr_ = { "@LAPDm_RAW_PT.RLCMAC_ph_data_req", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for ph__state__enum const TTCN_Typedescriptor_t ph__state__enum_descr_ = { "@LAPDm_RAW_PT.ph_state_enum", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const TTCN_Typedescriptor_t& lapdm__CT_descr_ = COMPONENT_descr_; L1CTL__PortType::L1CTL__PT lapdm__CT_component_L1CTL("L1CTL"); LAPDm__SP__PT lapdm__CT_component_LAPDM__SP("LAPDM_SP"); ph__state__enum lapdm__CT_component_ph__state; GSM__RR__Types::ChannelDescription lapdm__CT_component_chan__desc; INTEGER lapdm__CT_component_ms__power__lvl; INTEGER lapdm__CT_component_timing__adv; TbfParsPerTs lapdm__CT_component_g__tbf__ul; TbfParsPerTs lapdm__CT_component_g__tbf__dl; TTCN_Module module_object("LAPDm_RAW_PT", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_11, current_runtime_version.requires_minor_version_1, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Member functions of C++ classes */ BCCH__tune__req::BCCH__tune__req() { } BCCH__tune__req::BCCH__tune__req(const GSM__Types::GsmBandArfcn& par_arfcn, const BOOLEAN& par_combined__ccch) : field_arfcn(par_arfcn), field_combined__ccch(par_combined__ccch) { } BCCH__tune__req::BCCH__tune__req(const BCCH__tune__req& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.BCCH_tune_req."); if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn(); else field_arfcn.clean_up(); if (other_value.combined__ccch().is_bound()) field_combined__ccch = other_value.combined__ccch(); else field_combined__ccch.clean_up(); } void BCCH__tune__req::clean_up() { field_arfcn.clean_up(); field_combined__ccch.clean_up(); } const TTCN_Typedescriptor_t* BCCH__tune__req::get_descriptor() const { return &BCCH__tune__req_descr_; } BCCH__tune__req& BCCH__tune__req::operator=(const BCCH__tune__req& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.BCCH_tune_req."); if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn(); else field_arfcn.clean_up(); if (other_value.combined__ccch().is_bound()) field_combined__ccch = other_value.combined__ccch(); else field_combined__ccch.clean_up(); } return *this; } boolean BCCH__tune__req::operator==(const BCCH__tune__req& other_value) const { return field_arfcn==other_value.field_arfcn && field_combined__ccch==other_value.field_combined__ccch; } boolean BCCH__tune__req::is_bound() const { return (field_arfcn.is_bound()) || (field_combined__ccch.is_bound()); } boolean BCCH__tune__req::is_value() const { return field_arfcn.is_value() && field_combined__ccch.is_value(); } void BCCH__tune__req::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ arfcn := "); field_arfcn.log(); TTCN_Logger::log_event_str(", combined_ccch := "); field_combined__ccch.log(); TTCN_Logger::log_event_str(" }"); } void BCCH__tune__req::set_implicit_omit() { if (arfcn().is_bound()) arfcn().set_implicit_omit(); if (combined__ccch().is_bound()) combined__ccch().set_implicit_omit(); } void BCCH__tune__req::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) combined__ccch().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(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "combined_ccch")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { combined__ccch().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.BCCH_tune_req: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.BCCH_tune_req"); } } void BCCH__tune__req::encode_text(Text_Buf& text_buf) const { field_arfcn.encode_text(text_buf); field_combined__ccch.encode_text(text_buf); } void BCCH__tune__req::decode_text(Text_Buf& text_buf) { field_arfcn.decode_text(text_buf); field_combined__ccch.decode_text(text_buf); } struct BCCH__tune__req_template::single_value_struct { GSM__Types::GsmBandArfcn_template field_arfcn; BOOLEAN_template field_combined__ccch; }; void BCCH__tune__req_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_arfcn = ANY_VALUE; single_value->field_combined__ccch = ANY_VALUE; } } } void BCCH__tune__req_template::copy_value(const BCCH__tune__req& other_value) { single_value = new single_value_struct; if (other_value.arfcn().is_bound()) { single_value->field_arfcn = other_value.arfcn(); } else { single_value->field_arfcn.clean_up(); } if (other_value.combined__ccch().is_bound()) { single_value->field_combined__ccch = other_value.combined__ccch(); } else { single_value->field_combined__ccch.clean_up(); } set_selection(SPECIFIC_VALUE); } void BCCH__tune__req_template::copy_template(const BCCH__tune__req_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.arfcn().get_selection()) { single_value->field_arfcn = other_value.arfcn(); } else { single_value->field_arfcn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.combined__ccch().get_selection()) { single_value->field_combined__ccch = other_value.combined__ccch(); } else { single_value->field_combined__ccch.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 BCCH__tune__req_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 BCCH__tune__req_template(*other_value.implication_.precondition); implication_.implied_template = new BCCH__tune__req_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 @LAPDm_RAW_PT.BCCH_tune_req."); break; } set_selection(other_value); } BCCH__tune__req_template::BCCH__tune__req_template() { } BCCH__tune__req_template::BCCH__tune__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } BCCH__tune__req_template::BCCH__tune__req_template(const BCCH__tune__req& other_value) { copy_value(other_value); } BCCH__tune__req_template::BCCH__tune__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const BCCH__tune__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.BCCH_tune_req from an unbound optional field."); } } BCCH__tune__req_template::BCCH__tune__req_template(BCCH__tune__req_template* p_precondition, BCCH__tune__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } BCCH__tune__req_template::BCCH__tune__req_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; } BCCH__tune__req_template::BCCH__tune__req_template(const BCCH__tune__req_template& other_value) : Base_Template() { copy_template(other_value); } BCCH__tune__req_template::~BCCH__tune__req_template() { clean_up(); } BCCH__tune__req_template& BCCH__tune__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } BCCH__tune__req_template& BCCH__tune__req_template::operator=(const BCCH__tune__req& other_value) { clean_up(); copy_value(other_value); return *this; } BCCH__tune__req_template& BCCH__tune__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const BCCH__tune__req&)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 @LAPDm_RAW_PT.BCCH_tune_req."); } return *this; } BCCH__tune__req_template& BCCH__tune__req_template::operator=(const BCCH__tune__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean BCCH__tune__req_template::match(const BCCH__tune__req& 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.arfcn().is_bound()) return FALSE; if(!single_value->field_arfcn.match(other_value.arfcn(), legacy))return FALSE; if(!other_value.combined__ccch().is_bound()) return FALSE; if(!single_value->field_combined__ccch.match(other_value.combined__ccch(), 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 @LAPDm_RAW_PT.BCCH_tune_req."); } return FALSE; } boolean BCCH__tune__req_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_arfcn.is_bound() || single_value->field_combined__ccch.is_bound(); } boolean BCCH__tune__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_arfcn.is_value() && single_value->field_combined__ccch.is_value(); } void BCCH__tune__req_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; } BCCH__tune__req BCCH__tune__req_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 @LAPDm_RAW_PT.BCCH_tune_req."); BCCH__tune__req ret_val; if (single_value->field_arfcn.is_bound()) { ret_val.arfcn() = single_value->field_arfcn.valueof(); } if (single_value->field_combined__ccch.is_bound()) { ret_val.combined__ccch() = single_value->field_combined__ccch.valueof(); } return ret_val; } void BCCH__tune__req_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 @LAPDm_RAW_PT.BCCH_tune_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new BCCH__tune__req_template[list_length]; } BCCH__tune__req_template& BCCH__tune__req_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 @LAPDm_RAW_PT.BCCH_tune_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.BCCH_tune_req."); return value_list.list_value[list_index]; } GSM__Types::GsmBandArfcn_template& BCCH__tune__req_template::arfcn() { set_specific(); return single_value->field_arfcn; } const GSM__Types::GsmBandArfcn_template& BCCH__tune__req_template::arfcn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field arfcn of a non-specific template of type @LAPDm_RAW_PT.BCCH_tune_req."); return single_value->field_arfcn; } BOOLEAN_template& BCCH__tune__req_template::combined__ccch() { set_specific(); return single_value->field_combined__ccch; } const BOOLEAN_template& BCCH__tune__req_template::combined__ccch() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field combined_ccch of a non-specific template of type @LAPDm_RAW_PT.BCCH_tune_req."); return single_value->field_combined__ccch; } int BCCH__tune__req_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req 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 @LAPDm_RAW_PT.BCCH_tune_req 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 @LAPDm_RAW_PT.BCCH_tune_req containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.BCCH_tune_req containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.BCCH_tune_req."); } return 0; } void BCCH__tune__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ arfcn := "); single_value->field_arfcn.log(); TTCN_Logger::log_event_str(", combined_ccch := "); single_value->field_combined__ccch.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 BCCH__tune__req_template::log_match(const BCCH__tune__req& 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_arfcn.match(match_value.arfcn(), legacy)){ TTCN_Logger::log_logmatch_info(".arfcn"); single_value->field_arfcn.log_match(match_value.arfcn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_combined__ccch.match(match_value.combined__ccch(), legacy)){ TTCN_Logger::log_logmatch_info(".combined_ccch"); single_value->field_combined__ccch.log_match(match_value.combined__ccch(), 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("{ arfcn := "); single_value->field_arfcn.log_match(match_value.arfcn(), legacy); TTCN_Logger::log_event_str(", combined_ccch := "); single_value->field_combined__ccch.log_match(match_value.combined__ccch(), 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 BCCH__tune__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (arfcn().is_bound()) arfcn().set_implicit_omit(); if (combined__ccch().is_bound()) combined__ccch().set_implicit_omit(); } void BCCH__tune__req_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_arfcn.encode_text(text_buf); single_value->field_combined__ccch.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 @LAPDm_RAW_PT.BCCH_tune_req."); } } void BCCH__tune__req_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_arfcn.decode_text(text_buf); single_value->field_combined__ccch.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 BCCH__tune__req_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 @LAPDm_RAW_PT.BCCH_tune_req."); } } void BCCH__tune__req_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: { BCCH__tune__req_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) arfcn().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) combined__ccch().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(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "combined_ccch")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { combined__ccch().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.BCCH_tune_req: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { BCCH__tune__req_template* precondition = new BCCH__tune__req_template; precondition->set_param(*param.get_elem(0)); BCCH__tune__req_template* implied_template = new BCCH__tune__req_template; implied_template->set_param(*param.get_elem(1)); *this = BCCH__tune__req_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.BCCH_tune_req"); } is_ifpresent = param.get_ifpresent(); } void BCCH__tune__req_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_arfcn.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.BCCH_tune_req"); single_value->field_combined__ccch.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.BCCH_tune_req"); 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 : "@LAPDm_RAW_PT.BCCH_tune_req"); } boolean BCCH__tune__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean BCCH__tune__req_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) ra().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.DCCH_establish_req"); } } void DCCH__establish__req::encode_text(Text_Buf& text_buf) const { field_ra.encode_text(text_buf); } void DCCH__establish__req::decode_text(Text_Buf& text_buf) { field_ra.decode_text(text_buf); } struct DCCH__establish__req_template::single_value_struct { INTEGER_template field_ra; }; void DCCH__establish__req_template::set_specific() { if (template_selection != SPECIFIC_VALUE) { template_sel old_selection = template_selection; clean_up(); single_value = new single_value_struct; set_selection(SPECIFIC_VALUE); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { single_value->field_ra = ANY_VALUE; } } } void DCCH__establish__req_template::copy_value(const DCCH__establish__req& other_value) { single_value = new single_value_struct; if (other_value.ra().is_bound()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } set_selection(SPECIFIC_VALUE); } void DCCH__establish__req_template::copy_template(const DCCH__establish__req_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.ra().get_selection()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } 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 DCCH__establish__req_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 DCCH__establish__req_template(*other_value.implication_.precondition); implication_.implied_template = new DCCH__establish__req_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 @LAPDm_RAW_PT.DCCH_establish_req."); break; } set_selection(other_value); } DCCH__establish__req_template::DCCH__establish__req_template() { } DCCH__establish__req_template::DCCH__establish__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DCCH__establish__req_template::DCCH__establish__req_template(const DCCH__establish__req& other_value) { copy_value(other_value); } DCCH__establish__req_template::DCCH__establish__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__establish__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.DCCH_establish_req from an unbound optional field."); } } DCCH__establish__req_template::DCCH__establish__req_template(DCCH__establish__req_template* p_precondition, DCCH__establish__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DCCH__establish__req_template::DCCH__establish__req_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; } DCCH__establish__req_template::DCCH__establish__req_template(const DCCH__establish__req_template& other_value) : Base_Template() { copy_template(other_value); } DCCH__establish__req_template::~DCCH__establish__req_template() { clean_up(); } DCCH__establish__req_template& DCCH__establish__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DCCH__establish__req_template& DCCH__establish__req_template::operator=(const DCCH__establish__req& other_value) { clean_up(); copy_value(other_value); return *this; } DCCH__establish__req_template& DCCH__establish__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__establish__req&)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 @LAPDm_RAW_PT.DCCH_establish_req."); } return *this; } DCCH__establish__req_template& DCCH__establish__req_template::operator=(const DCCH__establish__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DCCH__establish__req_template::match(const DCCH__establish__req& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; switch (template_selection) { case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case OMIT_VALUE: return FALSE; case SPECIFIC_VALUE: if(!other_value.ra().is_bound()) return FALSE; if(!single_value->field_ra.match(other_value.ra(), legacy))return FALSE; 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 @LAPDm_RAW_PT.DCCH_establish_req."); } return FALSE; } boolean DCCH__establish__req_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_ra.is_bound(); } boolean DCCH__establish__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_ra.is_value(); } void DCCH__establish__req_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; } DCCH__establish__req DCCH__establish__req_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 @LAPDm_RAW_PT.DCCH_establish_req."); DCCH__establish__req ret_val; if (single_value->field_ra.is_bound()) { ret_val.ra() = single_value->field_ra.valueof(); } return ret_val; } void DCCH__establish__req_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 @LAPDm_RAW_PT.DCCH_establish_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DCCH__establish__req_template[list_length]; } DCCH__establish__req_template& DCCH__establish__req_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 @LAPDm_RAW_PT.DCCH_establish_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.DCCH_establish_req."); return value_list.list_value[list_index]; } INTEGER_template& DCCH__establish__req_template::ra() { set_specific(); return single_value->field_ra; } const INTEGER_template& DCCH__establish__req_template::ra() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ra of a non-specific template of type @LAPDm_RAW_PT.DCCH_establish_req."); return single_value->field_ra; } int DCCH__establish__req_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req 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 @LAPDm_RAW_PT.DCCH_establish_req containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_req containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_establish_req."); } return 0; } void DCCH__establish__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ ra := "); single_value->field_ra.log(); TTCN_Logger::log_event_str(" }"); 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 DCCH__establish__req_template::log_match(const DCCH__establish__req& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if(!single_value->field_ra.match(match_value.ra(), legacy)){ TTCN_Logger::log_logmatch_info(".ra"); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ ra := "); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::log_event_str(" }"); } 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 DCCH__establish__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (ra().is_bound()) ra().set_implicit_omit(); } void DCCH__establish__req_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_ra.encode_text(text_buf); 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 @LAPDm_RAW_PT.DCCH_establish_req."); } } void DCCH__establish__req_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; single_value->field_ra.decode_text(text_buf); 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 DCCH__establish__req_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 @LAPDm_RAW_PT.DCCH_establish_req."); } } void DCCH__establish__req_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: { DCCH__establish__req_template new_temp; new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ra().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DCCH__establish__req_template* precondition = new DCCH__establish__req_template; precondition->set_param(*param.get_elem(0)); DCCH__establish__req_template* implied_template = new DCCH__establish__req_template; implied_template->set_param(*param.get_elem(1)); *this = DCCH__establish__req_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.DCCH_establish_req"); } is_ifpresent = param.get_ifpresent(); } void DCCH__establish__req_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; single_value->field_ra.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_establish_req"); 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 : "@LAPDm_RAW_PT.DCCH_establish_req"); } boolean DCCH__establish__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DCCH__establish__req_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_chan__desc, const OPTIONAL< CHARSTRING >& par_err) : field_chan__desc(par_chan__desc), field_err(par_err) { } DCCH__establish__res::DCCH__establish__res(const DCCH__establish__res& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.DCCH_establish_res."); if (other_value.chan__desc().is_bound()) field_chan__desc = other_value.chan__desc(); else field_chan__desc.clean_up(); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } void DCCH__establish__res::clean_up() { field_chan__desc.clean_up(); field_err.clean_up(); } const TTCN_Typedescriptor_t* DCCH__establish__res::get_descriptor() const { return &DCCH__establish__res_descr_; } DCCH__establish__res& DCCH__establish__res::operator=(const DCCH__establish__res& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.DCCH_establish_res."); if (other_value.chan__desc().is_bound()) field_chan__desc = other_value.chan__desc(); else field_chan__desc.clean_up(); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } return *this; } boolean DCCH__establish__res::operator==(const DCCH__establish__res& other_value) const { return field_chan__desc==other_value.field_chan__desc && field_err==other_value.field_err; } boolean DCCH__establish__res::is_bound() const { return (OPTIONAL_OMIT == field_chan__desc.get_selection() || field_chan__desc.is_bound()) || (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_bound()); } boolean DCCH__establish__res::is_value() const { return (OPTIONAL_OMIT == field_chan__desc.get_selection() || field_chan__desc.is_value()) && (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_value()); } int DCCH__establish__res::size_of() const { int ret_val = 0; if (field_chan__desc.ispresent()) ret_val++; if (field_err.ispresent()) ret_val++; return ret_val; } void DCCH__establish__res::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ chan_desc := "); field_chan__desc.log(); TTCN_Logger::log_event_str(", err := "); field_err.log(); TTCN_Logger::log_event_str(" }"); } void DCCH__establish__res::set_implicit_omit() { if (!chan__desc().is_bound()) chan__desc() = OMIT_VALUE; else chan__desc().set_implicit_omit(); if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void DCCH__establish__res::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) chan__desc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "chan_desc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__desc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_establish_res: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.DCCH_establish_res"); } } void DCCH__establish__res::encode_text(Text_Buf& text_buf) const { field_chan__desc.encode_text(text_buf); field_err.encode_text(text_buf); } void DCCH__establish__res::decode_text(Text_Buf& text_buf) { field_chan__desc.decode_text(text_buf); field_err.decode_text(text_buf); } struct DCCH__establish__res_template::single_value_struct { GSM__RR__Types::ChannelDescription_template field_chan__desc; CHARSTRING_template field_err; }; void DCCH__establish__res_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_chan__desc = ANY_OR_OMIT; single_value->field_err = ANY_OR_OMIT; } } } void DCCH__establish__res_template::copy_value(const DCCH__establish__res& other_value) { single_value = new single_value_struct; if (other_value.chan__desc().is_bound()) { if (other_value.chan__desc().ispresent()) single_value->field_chan__desc = other_value.chan__desc()(); else single_value->field_chan__desc = OMIT_VALUE; } else { single_value->field_chan__desc.clean_up(); } if (other_value.err().is_bound()) { if (other_value.err().ispresent()) single_value->field_err = other_value.err()(); else single_value->field_err = OMIT_VALUE; } else { single_value->field_err.clean_up(); } set_selection(SPECIFIC_VALUE); } void DCCH__establish__res_template::copy_template(const DCCH__establish__res_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.chan__desc().get_selection()) { single_value->field_chan__desc = other_value.chan__desc(); } else { single_value->field_chan__desc.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.err().get_selection()) { single_value->field_err = other_value.err(); } else { single_value->field_err.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 DCCH__establish__res_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 DCCH__establish__res_template(*other_value.implication_.precondition); implication_.implied_template = new DCCH__establish__res_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 @LAPDm_RAW_PT.DCCH_establish_res."); break; } set_selection(other_value); } DCCH__establish__res_template::DCCH__establish__res_template() { } DCCH__establish__res_template::DCCH__establish__res_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DCCH__establish__res_template::DCCH__establish__res_template(const DCCH__establish__res& other_value) { copy_value(other_value); } DCCH__establish__res_template::DCCH__establish__res_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__establish__res&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.DCCH_establish_res from an unbound optional field."); } } DCCH__establish__res_template::DCCH__establish__res_template(DCCH__establish__res_template* p_precondition, DCCH__establish__res_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DCCH__establish__res_template::DCCH__establish__res_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; } DCCH__establish__res_template::DCCH__establish__res_template(const DCCH__establish__res_template& other_value) : Base_Template() { copy_template(other_value); } DCCH__establish__res_template::~DCCH__establish__res_template() { clean_up(); } DCCH__establish__res_template& DCCH__establish__res_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DCCH__establish__res_template& DCCH__establish__res_template::operator=(const DCCH__establish__res& other_value) { clean_up(); copy_value(other_value); return *this; } DCCH__establish__res_template& DCCH__establish__res_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__establish__res&)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 @LAPDm_RAW_PT.DCCH_establish_res."); } return *this; } DCCH__establish__res_template& DCCH__establish__res_template::operator=(const DCCH__establish__res_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DCCH__establish__res_template::match(const DCCH__establish__res& 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.chan__desc().is_bound()) return FALSE; if((other_value.chan__desc().ispresent() ? !single_value->field_chan__desc.match((const GSM__RR__Types::ChannelDescription&)other_value.chan__desc(), legacy) : !single_value->field_chan__desc.match_omit(legacy)))return FALSE; if(!other_value.err().is_bound()) return FALSE; if((other_value.err().ispresent() ? !single_value->field_err.match((const CHARSTRING&)other_value.err(), legacy) : !single_value->field_err.match_omit(legacy)))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_establish_res."); } return FALSE; } boolean DCCH__establish__res_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_chan__desc.is_omit() || single_value->field_chan__desc.is_bound()) || (single_value->field_err.is_omit() || single_value->field_err.is_bound()); } boolean DCCH__establish__res_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_chan__desc.is_omit() || single_value->field_chan__desc.is_value()) && (single_value->field_err.is_omit() || single_value->field_err.is_value()); } void DCCH__establish__res_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; } DCCH__establish__res DCCH__establish__res_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 @LAPDm_RAW_PT.DCCH_establish_res."); DCCH__establish__res ret_val; if (single_value->field_chan__desc.is_omit()) ret_val.chan__desc() = OMIT_VALUE; else if (single_value->field_chan__desc.is_bound()) { ret_val.chan__desc() = single_value->field_chan__desc.valueof(); } if (single_value->field_err.is_omit()) ret_val.err() = OMIT_VALUE; else if (single_value->field_err.is_bound()) { ret_val.err() = single_value->field_err.valueof(); } return ret_val; } void DCCH__establish__res_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 @LAPDm_RAW_PT.DCCH_establish_res."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DCCH__establish__res_template[list_length]; } DCCH__establish__res_template& DCCH__establish__res_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 @LAPDm_RAW_PT.DCCH_establish_res."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.DCCH_establish_res."); return value_list.list_value[list_index]; } GSM__RR__Types::ChannelDescription_template& DCCH__establish__res_template::chan__desc() { set_specific(); return single_value->field_chan__desc; } const GSM__RR__Types::ChannelDescription_template& DCCH__establish__res_template::chan__desc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field chan_desc of a non-specific template of type @LAPDm_RAW_PT.DCCH_establish_res."); return single_value->field_chan__desc; } CHARSTRING_template& DCCH__establish__res_template::err() { set_specific(); return single_value->field_err; } const CHARSTRING_template& DCCH__establish__res_template::err() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field err of a non-specific template of type @LAPDm_RAW_PT.DCCH_establish_res."); return single_value->field_err; } int DCCH__establish__res_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_chan__desc.is_present()) ret_val++; if (single_value->field_err.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res 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 @LAPDm_RAW_PT.DCCH_establish_res containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_establish_res containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_establish_res."); } return 0; } void DCCH__establish__res_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ chan_desc := "); single_value->field_chan__desc.log(); TTCN_Logger::log_event_str(", err := "); single_value->field_err.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 DCCH__establish__res_template::log_match(const DCCH__establish__res& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if (match_value.chan__desc().ispresent()){ if(!single_value->field_chan__desc.match(match_value.chan__desc(), legacy)){ TTCN_Logger::log_logmatch_info(".chan_desc"); single_value->field_chan__desc.log_match(match_value.chan__desc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_chan__desc.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".chan_desc := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_chan__desc.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.err().ispresent()){ if(!single_value->field_err.match(match_value.err(), legacy)){ TTCN_Logger::log_logmatch_info(".err"); single_value->field_err.log_match(match_value.err(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_err.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".err := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_err.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ chan_desc := "); if (match_value.chan__desc().ispresent()) { single_value->field_chan__desc.log_match(match_value.chan__desc(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_chan__desc.log(); if (single_value->field_chan__desc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", err := "); if (match_value.err().ispresent()) { single_value->field_err.log_match(match_value.err(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_err.log(); if (single_value->field_err.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void DCCH__establish__res_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!chan__desc().is_bound()) chan__desc() = OMIT_VALUE; else chan__desc().set_implicit_omit(); if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void DCCH__establish__res_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_chan__desc.encode_text(text_buf); single_value->field_err.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 @LAPDm_RAW_PT.DCCH_establish_res."); } } void DCCH__establish__res_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_chan__desc.decode_text(text_buf); single_value->field_err.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 DCCH__establish__res_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 @LAPDm_RAW_PT.DCCH_establish_res."); } } void DCCH__establish__res_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: { DCCH__establish__res_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) chan__desc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "chan_desc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__desc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_establish_res: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DCCH__establish__res_template* precondition = new DCCH__establish__res_template; precondition->set_param(*param.get_elem(0)); DCCH__establish__res_template* implied_template = new DCCH__establish__res_template; implied_template->set_param(*param.get_elem(1)); *this = DCCH__establish__res_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.DCCH_establish_res"); } is_ifpresent = param.get_ifpresent(); } void DCCH__establish__res_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_chan__desc.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_establish_res"); single_value->field_err.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_establish_res"); 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 : "@LAPDm_RAW_PT.DCCH_establish_res"); } boolean DCCH__establish__res_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DCCH__establish__res_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_ma) : field_chan__desc(par_chan__desc), field_ma(par_ma) { } DCCH__switch__req::DCCH__switch__req(const DCCH__switch__req& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.DCCH_switch_req."); if (other_value.chan__desc().is_bound()) field_chan__desc = other_value.chan__desc(); else field_chan__desc.clean_up(); if (other_value.ma().is_bound()) field_ma = other_value.ma(); else field_ma.clean_up(); } void DCCH__switch__req::clean_up() { field_chan__desc.clean_up(); field_ma.clean_up(); } const TTCN_Typedescriptor_t* DCCH__switch__req::get_descriptor() const { return &DCCH__switch__req_descr_; } DCCH__switch__req& DCCH__switch__req::operator=(const DCCH__switch__req& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.DCCH_switch_req."); if (other_value.chan__desc().is_bound()) field_chan__desc = other_value.chan__desc(); else field_chan__desc.clean_up(); if (other_value.ma().is_bound()) field_ma = other_value.ma(); else field_ma.clean_up(); } return *this; } boolean DCCH__switch__req::operator==(const DCCH__switch__req& other_value) const { return field_chan__desc==other_value.field_chan__desc && field_ma==other_value.field_ma; } boolean DCCH__switch__req::is_bound() const { return (field_chan__desc.is_bound()) || (OPTIONAL_OMIT == field_ma.get_selection() || field_ma.is_bound()); } boolean DCCH__switch__req::is_value() const { return field_chan__desc.is_value() && (OPTIONAL_OMIT == field_ma.get_selection() || field_ma.is_value()); } int DCCH__switch__req::size_of() const { int ret_val = 1; if (field_ma.ispresent()) ret_val++; return ret_val; } void DCCH__switch__req::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ chan_desc := "); field_chan__desc.log(); TTCN_Logger::log_event_str(", ma := "); field_ma.log(); TTCN_Logger::log_event_str(" }"); } void DCCH__switch__req::set_implicit_omit() { if (chan__desc().is_bound()) chan__desc().set_implicit_omit(); if (!ma().is_bound()) ma() = OMIT_VALUE; else ma().set_implicit_omit(); } void DCCH__switch__req::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) chan__desc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ma().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(), "chan_desc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__desc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ma")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ma().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_switch_req: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.DCCH_switch_req"); } } void DCCH__switch__req::encode_text(Text_Buf& text_buf) const { field_chan__desc.encode_text(text_buf); field_ma.encode_text(text_buf); } void DCCH__switch__req::decode_text(Text_Buf& text_buf) { field_chan__desc.decode_text(text_buf); field_ma.decode_text(text_buf); } struct DCCH__switch__req_template::single_value_struct { GSM__RR__Types::ChannelDescription_template field_chan__desc; L1CTL__Types::L1ctlMA_template field_ma; }; void DCCH__switch__req_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_chan__desc = ANY_VALUE; single_value->field_ma = ANY_OR_OMIT; } } } void DCCH__switch__req_template::copy_value(const DCCH__switch__req& other_value) { single_value = new single_value_struct; if (other_value.chan__desc().is_bound()) { single_value->field_chan__desc = other_value.chan__desc(); } else { single_value->field_chan__desc.clean_up(); } if (other_value.ma().is_bound()) { if (other_value.ma().ispresent()) single_value->field_ma = other_value.ma()(); else single_value->field_ma = OMIT_VALUE; } else { single_value->field_ma.clean_up(); } set_selection(SPECIFIC_VALUE); } void DCCH__switch__req_template::copy_template(const DCCH__switch__req_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.chan__desc().get_selection()) { single_value->field_chan__desc = other_value.chan__desc(); } else { single_value->field_chan__desc.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ma().get_selection()) { single_value->field_ma = other_value.ma(); } else { single_value->field_ma.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 DCCH__switch__req_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 DCCH__switch__req_template(*other_value.implication_.precondition); implication_.implied_template = new DCCH__switch__req_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 @LAPDm_RAW_PT.DCCH_switch_req."); break; } set_selection(other_value); } DCCH__switch__req_template::DCCH__switch__req_template() { } DCCH__switch__req_template::DCCH__switch__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DCCH__switch__req_template::DCCH__switch__req_template(const DCCH__switch__req& other_value) { copy_value(other_value); } DCCH__switch__req_template::DCCH__switch__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__switch__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.DCCH_switch_req from an unbound optional field."); } } DCCH__switch__req_template::DCCH__switch__req_template(DCCH__switch__req_template* p_precondition, DCCH__switch__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DCCH__switch__req_template::DCCH__switch__req_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; } DCCH__switch__req_template::DCCH__switch__req_template(const DCCH__switch__req_template& other_value) : Base_Template() { copy_template(other_value); } DCCH__switch__req_template::~DCCH__switch__req_template() { clean_up(); } DCCH__switch__req_template& DCCH__switch__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DCCH__switch__req_template& DCCH__switch__req_template::operator=(const DCCH__switch__req& other_value) { clean_up(); copy_value(other_value); return *this; } DCCH__switch__req_template& DCCH__switch__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__switch__req&)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 @LAPDm_RAW_PT.DCCH_switch_req."); } return *this; } DCCH__switch__req_template& DCCH__switch__req_template::operator=(const DCCH__switch__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DCCH__switch__req_template::match(const DCCH__switch__req& 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.chan__desc().is_bound()) return FALSE; if(!single_value->field_chan__desc.match(other_value.chan__desc(), legacy))return FALSE; if(!other_value.ma().is_bound()) return FALSE; if((other_value.ma().ispresent() ? !single_value->field_ma.match((const L1CTL__Types::L1ctlMA&)other_value.ma(), legacy) : !single_value->field_ma.match_omit(legacy)))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_switch_req."); } return FALSE; } boolean DCCH__switch__req_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_chan__desc.is_bound() || (single_value->field_ma.is_omit() || single_value->field_ma.is_bound()); } boolean DCCH__switch__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_chan__desc.is_value() && (single_value->field_ma.is_omit() || single_value->field_ma.is_value()); } void DCCH__switch__req_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; } DCCH__switch__req DCCH__switch__req_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 @LAPDm_RAW_PT.DCCH_switch_req."); DCCH__switch__req ret_val; if (single_value->field_chan__desc.is_bound()) { ret_val.chan__desc() = single_value->field_chan__desc.valueof(); } if (single_value->field_ma.is_omit()) ret_val.ma() = OMIT_VALUE; else if (single_value->field_ma.is_bound()) { ret_val.ma() = single_value->field_ma.valueof(); } return ret_val; } void DCCH__switch__req_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 @LAPDm_RAW_PT.DCCH_switch_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DCCH__switch__req_template[list_length]; } DCCH__switch__req_template& DCCH__switch__req_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 @LAPDm_RAW_PT.DCCH_switch_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.DCCH_switch_req."); return value_list.list_value[list_index]; } GSM__RR__Types::ChannelDescription_template& DCCH__switch__req_template::chan__desc() { set_specific(); return single_value->field_chan__desc; } const GSM__RR__Types::ChannelDescription_template& DCCH__switch__req_template::chan__desc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field chan_desc of a non-specific template of type @LAPDm_RAW_PT.DCCH_switch_req."); return single_value->field_chan__desc; } L1CTL__Types::L1ctlMA_template& DCCH__switch__req_template::ma() { set_specific(); return single_value->field_ma; } const L1CTL__Types::L1ctlMA_template& DCCH__switch__req_template::ma() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ma of a non-specific template of type @LAPDm_RAW_PT.DCCH_switch_req."); return single_value->field_ma; } int DCCH__switch__req_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_ma.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req 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 @LAPDm_RAW_PT.DCCH_switch_req containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_req containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_switch_req."); } return 0; } void DCCH__switch__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ chan_desc := "); single_value->field_chan__desc.log(); TTCN_Logger::log_event_str(", ma := "); single_value->field_ma.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 DCCH__switch__req_template::log_match(const DCCH__switch__req& 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_chan__desc.match(match_value.chan__desc(), legacy)){ TTCN_Logger::log_logmatch_info(".chan_desc"); single_value->field_chan__desc.log_match(match_value.chan__desc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.ma().ispresent()){ if(!single_value->field_ma.match(match_value.ma(), legacy)){ TTCN_Logger::log_logmatch_info(".ma"); single_value->field_ma.log_match(match_value.ma(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_ma.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".ma := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_ma.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ chan_desc := "); single_value->field_chan__desc.log_match(match_value.chan__desc(), legacy); TTCN_Logger::log_event_str(", ma := "); if (match_value.ma().ispresent()) { single_value->field_ma.log_match(match_value.ma(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_ma.log(); if (single_value->field_ma.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void DCCH__switch__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (chan__desc().is_bound()) chan__desc().set_implicit_omit(); if (!ma().is_bound()) ma() = OMIT_VALUE; else ma().set_implicit_omit(); } void DCCH__switch__req_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_chan__desc.encode_text(text_buf); single_value->field_ma.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 @LAPDm_RAW_PT.DCCH_switch_req."); } } void DCCH__switch__req_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_chan__desc.decode_text(text_buf); single_value->field_ma.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 DCCH__switch__req_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 @LAPDm_RAW_PT.DCCH_switch_req."); } } void DCCH__switch__req_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: { DCCH__switch__req_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) chan__desc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ma().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(), "chan_desc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { chan__desc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ma")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ma().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_switch_req: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DCCH__switch__req_template* precondition = new DCCH__switch__req_template; precondition->set_param(*param.get_elem(0)); DCCH__switch__req_template* implied_template = new DCCH__switch__req_template; implied_template->set_param(*param.get_elem(1)); *this = DCCH__switch__req_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.DCCH_switch_req"); } is_ifpresent = param.get_ifpresent(); } void DCCH__switch__req_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_chan__desc.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_switch_req"); single_value->field_ma.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_switch_req"); 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 : "@LAPDm_RAW_PT.DCCH_switch_req"); } boolean DCCH__switch__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DCCH__switch__req_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_err) : field_err(par_err) { } DCCH__switch__res::DCCH__switch__res(const DCCH__switch__res& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.DCCH_switch_res."); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } void DCCH__switch__res::clean_up() { field_err.clean_up(); } const TTCN_Typedescriptor_t* DCCH__switch__res::get_descriptor() const { return &DCCH__switch__res_descr_; } DCCH__switch__res& DCCH__switch__res::operator=(const DCCH__switch__res& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.DCCH_switch_res."); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } return *this; } boolean DCCH__switch__res::operator==(const DCCH__switch__res& other_value) const { return field_err==other_value.field_err; } boolean DCCH__switch__res::is_bound() const { return (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_bound()); } boolean DCCH__switch__res::is_value() const { return (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_value()); } int DCCH__switch__res::size_of() const { int ret_val = 0; if (field_err.ispresent()) ret_val++; return ret_val; } void DCCH__switch__res::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ err := "); field_err.log(); TTCN_Logger::log_event_str(" }"); } void DCCH__switch__res::set_implicit_omit() { if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void DCCH__switch__res::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 (10 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) err().set_param(*param.get_elem(0)); 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(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_switch_res: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.DCCH_switch_res"); } } void DCCH__switch__res::encode_text(Text_Buf& text_buf) const { field_err.encode_text(text_buf); } void DCCH__switch__res::decode_text(Text_Buf& text_buf) { field_err.decode_text(text_buf); } struct DCCH__switch__res_template::single_value_struct { CHARSTRING_template field_err; }; void DCCH__switch__res_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_err = ANY_OR_OMIT; } } } void DCCH__switch__res_template::copy_value(const DCCH__switch__res& other_value) { single_value = new single_value_struct; if (other_value.err().is_bound()) { if (other_value.err().ispresent()) single_value->field_err = other_value.err()(); else single_value->field_err = OMIT_VALUE; } else { single_value->field_err.clean_up(); } set_selection(SPECIFIC_VALUE); } void DCCH__switch__res_template::copy_template(const DCCH__switch__res_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.err().get_selection()) { single_value->field_err = other_value.err(); } else { single_value->field_err.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 DCCH__switch__res_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 DCCH__switch__res_template(*other_value.implication_.precondition); implication_.implied_template = new DCCH__switch__res_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 @LAPDm_RAW_PT.DCCH_switch_res."); break; } set_selection(other_value); } DCCH__switch__res_template::DCCH__switch__res_template() { } DCCH__switch__res_template::DCCH__switch__res_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DCCH__switch__res_template::DCCH__switch__res_template(const DCCH__switch__res& other_value) { copy_value(other_value); } DCCH__switch__res_template::DCCH__switch__res_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__switch__res&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.DCCH_switch_res from an unbound optional field."); } } DCCH__switch__res_template::DCCH__switch__res_template(DCCH__switch__res_template* p_precondition, DCCH__switch__res_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DCCH__switch__res_template::DCCH__switch__res_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; } DCCH__switch__res_template::DCCH__switch__res_template(const DCCH__switch__res_template& other_value) : Base_Template() { copy_template(other_value); } DCCH__switch__res_template::~DCCH__switch__res_template() { clean_up(); } DCCH__switch__res_template& DCCH__switch__res_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DCCH__switch__res_template& DCCH__switch__res_template::operator=(const DCCH__switch__res& other_value) { clean_up(); copy_value(other_value); return *this; } DCCH__switch__res_template& DCCH__switch__res_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DCCH__switch__res&)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 @LAPDm_RAW_PT.DCCH_switch_res."); } return *this; } DCCH__switch__res_template& DCCH__switch__res_template::operator=(const DCCH__switch__res_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DCCH__switch__res_template::match(const DCCH__switch__res& 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.err().is_bound()) return FALSE; if((other_value.err().ispresent() ? !single_value->field_err.match((const CHARSTRING&)other_value.err(), legacy) : !single_value->field_err.match_omit(legacy)))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_switch_res."); } return FALSE; } boolean DCCH__switch__res_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_err.is_omit() || single_value->field_err.is_bound()); } boolean DCCH__switch__res_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_err.is_omit() || single_value->field_err.is_value()); } void DCCH__switch__res_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; } DCCH__switch__res DCCH__switch__res_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 @LAPDm_RAW_PT.DCCH_switch_res."); DCCH__switch__res ret_val; if (single_value->field_err.is_omit()) ret_val.err() = OMIT_VALUE; else if (single_value->field_err.is_bound()) { ret_val.err() = single_value->field_err.valueof(); } return ret_val; } void DCCH__switch__res_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 @LAPDm_RAW_PT.DCCH_switch_res."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DCCH__switch__res_template[list_length]; } DCCH__switch__res_template& DCCH__switch__res_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 @LAPDm_RAW_PT.DCCH_switch_res."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.DCCH_switch_res."); return value_list.list_value[list_index]; } CHARSTRING_template& DCCH__switch__res_template::err() { set_specific(); return single_value->field_err; } const CHARSTRING_template& DCCH__switch__res_template::err() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field err of a non-specific template of type @LAPDm_RAW_PT.DCCH_switch_res."); return single_value->field_err; } int DCCH__switch__res_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_err.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res 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 @LAPDm_RAW_PT.DCCH_switch_res containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.DCCH_switch_res containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_switch_res."); } return 0; } void DCCH__switch__res_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ err := "); single_value->field_err.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 DCCH__switch__res_template::log_match(const DCCH__switch__res& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if (match_value.err().ispresent()){ if(!single_value->field_err.match(match_value.err(), legacy)){ TTCN_Logger::log_logmatch_info(".err"); single_value->field_err.log_match(match_value.err(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_err.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".err := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_err.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ err := "); if (match_value.err().ispresent()) { single_value->field_err.log_match(match_value.err(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_err.log(); if (single_value->field_err.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void DCCH__switch__res_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void DCCH__switch__res_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_err.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 @LAPDm_RAW_PT.DCCH_switch_res."); } } void DCCH__switch__res_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_err.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 DCCH__switch__res_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 @LAPDm_RAW_PT.DCCH_switch_res."); } } void DCCH__switch__res_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: { DCCH__switch__res_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) err().set_param(*param.get_elem(0)); 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(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.DCCH_switch_res: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DCCH__switch__res_template* precondition = new DCCH__switch__res_template; precondition->set_param(*param.get_elem(0)); DCCH__switch__res_template* implied_template = new DCCH__switch__res_template; implied_template->set_param(*param.get_elem(1)); *this = DCCH__switch__res_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.DCCH_switch_res"); } is_ifpresent = param.get_ifpresent(); } void DCCH__switch__res_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_err.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.DCCH_switch_res"); 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 : "@LAPDm_RAW_PT.DCCH_switch_res"); } boolean DCCH__switch__res_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DCCH__switch__res_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_arfcn, const TfiList& par_tfi) : field_arfcn(par_arfcn), field_tfi(par_tfi) { } TbfPars::TbfPars(const TbfPars& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.TbfPars."); if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn(); else field_arfcn.clean_up(); if (other_value.tfi().is_bound()) field_tfi = other_value.tfi(); else field_tfi.clean_up(); } void TbfPars::clean_up() { field_arfcn.clean_up(); field_tfi.clean_up(); } const TTCN_Typedescriptor_t* TbfPars::get_descriptor() const { return &TbfPars_descr_; } TbfPars& TbfPars::operator=(const TbfPars& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.TbfPars."); if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn(); else field_arfcn.clean_up(); if (other_value.tfi().is_bound()) field_tfi = other_value.tfi(); else field_tfi.clean_up(); } return *this; } boolean TbfPars::operator==(const TbfPars& other_value) const { return field_arfcn==other_value.field_arfcn && field_tfi==other_value.field_tfi; } boolean TbfPars::is_bound() const { return (OPTIONAL_OMIT == field_arfcn.get_selection() || field_arfcn.is_bound()) || (field_tfi.is_bound()); } boolean TbfPars::is_value() const { return (OPTIONAL_OMIT == field_arfcn.get_selection() || field_arfcn.is_value()) && field_tfi.is_value(); } int TbfPars::size_of() const { int ret_val = 1; if (field_arfcn.ispresent()) ret_val++; return ret_val; } void TbfPars::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ arfcn := "); field_arfcn.log(); TTCN_Logger::log_event_str(", tfi := "); field_tfi.log(); TTCN_Logger::log_event_str(" }"); } void TbfPars::set_implicit_omit() { if (!arfcn().is_bound()) arfcn() = OMIT_VALUE; else arfcn().set_implicit_omit(); if (tfi().is_bound()) tfi().set_implicit_omit(); } void TbfPars::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tfi().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(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tfi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tfi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TbfPars: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.TbfPars"); } } void TbfPars::encode_text(Text_Buf& text_buf) const { field_arfcn.encode_text(text_buf); field_tfi.encode_text(text_buf); } void TbfPars::decode_text(Text_Buf& text_buf) { field_arfcn.decode_text(text_buf); field_tfi.decode_text(text_buf); } struct TbfPars_template::single_value_struct { INTEGER_template field_arfcn; TfiList_template field_tfi; }; void TbfPars_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_arfcn = ANY_OR_OMIT; single_value->field_tfi = ANY_VALUE; } } } void TbfPars_template::copy_value(const TbfPars& other_value) { single_value = new single_value_struct; if (other_value.arfcn().is_bound()) { if (other_value.arfcn().ispresent()) single_value->field_arfcn = other_value.arfcn()(); else single_value->field_arfcn = OMIT_VALUE; } else { single_value->field_arfcn.clean_up(); } if (other_value.tfi().is_bound()) { single_value->field_tfi = other_value.tfi(); } else { single_value->field_tfi.clean_up(); } set_selection(SPECIFIC_VALUE); } void TbfPars_template::copy_template(const TbfPars_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.arfcn().get_selection()) { single_value->field_arfcn = other_value.arfcn(); } else { single_value->field_arfcn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tfi().get_selection()) { single_value->field_tfi = other_value.tfi(); } else { single_value->field_tfi.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 TbfPars_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 TbfPars_template(*other_value.implication_.precondition); implication_.implied_template = new TbfPars_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 @LAPDm_RAW_PT.TbfPars."); break; } set_selection(other_value); } TbfPars_template::TbfPars_template() { } TbfPars_template::TbfPars_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TbfPars_template::TbfPars_template(const TbfPars& other_value) { copy_value(other_value); } TbfPars_template::TbfPars_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TbfPars&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.TbfPars from an unbound optional field."); } } TbfPars_template::TbfPars_template(TbfPars_template* p_precondition, TbfPars_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TbfPars_template::TbfPars_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; } TbfPars_template::TbfPars_template(const TbfPars_template& other_value) : Base_Template() { copy_template(other_value); } TbfPars_template::~TbfPars_template() { clean_up(); } TbfPars_template& TbfPars_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TbfPars_template& TbfPars_template::operator=(const TbfPars& other_value) { clean_up(); copy_value(other_value); return *this; } TbfPars_template& TbfPars_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TbfPars&)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 @LAPDm_RAW_PT.TbfPars."); } return *this; } TbfPars_template& TbfPars_template::operator=(const TbfPars_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TbfPars_template::match(const TbfPars& 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.arfcn().is_bound()) return FALSE; if((other_value.arfcn().ispresent() ? !single_value->field_arfcn.match((const INTEGER&)other_value.arfcn(), legacy) : !single_value->field_arfcn.match_omit(legacy)))return FALSE; if(!other_value.tfi().is_bound()) return FALSE; if(!single_value->field_tfi.match(other_value.tfi(), 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 @LAPDm_RAW_PT.TbfPars."); } return FALSE; } boolean TbfPars_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_arfcn.is_omit() || single_value->field_arfcn.is_bound()) || single_value->field_tfi.is_bound(); } boolean TbfPars_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_arfcn.is_omit() || single_value->field_arfcn.is_value()) && single_value->field_tfi.is_value(); } void TbfPars_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; } TbfPars TbfPars_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 @LAPDm_RAW_PT.TbfPars."); TbfPars ret_val; if (single_value->field_arfcn.is_omit()) ret_val.arfcn() = OMIT_VALUE; else if (single_value->field_arfcn.is_bound()) { ret_val.arfcn() = single_value->field_arfcn.valueof(); } if (single_value->field_tfi.is_bound()) { ret_val.tfi() = single_value->field_tfi.valueof(); } return ret_val; } void TbfPars_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 @LAPDm_RAW_PT.TbfPars."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TbfPars_template[list_length]; } TbfPars_template& TbfPars_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 @LAPDm_RAW_PT.TbfPars."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.TbfPars."); return value_list.list_value[list_index]; } INTEGER_template& TbfPars_template::arfcn() { set_specific(); return single_value->field_arfcn; } const INTEGER_template& TbfPars_template::arfcn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field arfcn of a non-specific template of type @LAPDm_RAW_PT.TbfPars."); return single_value->field_arfcn; } TfiList_template& TbfPars_template::tfi() { set_specific(); return single_value->field_tfi; } const TfiList_template& TbfPars_template::tfi() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tfi of a non-specific template of type @LAPDm_RAW_PT.TbfPars."); return single_value->field_tfi; } int TbfPars_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_arfcn.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars 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 @LAPDm_RAW_PT.TbfPars containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TbfPars containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.TbfPars."); } return 0; } void TbfPars_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ arfcn := "); single_value->field_arfcn.log(); TTCN_Logger::log_event_str(", tfi := "); single_value->field_tfi.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 TbfPars_template::log_match(const TbfPars& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if (match_value.arfcn().ispresent()){ if(!single_value->field_arfcn.match(match_value.arfcn(), legacy)){ TTCN_Logger::log_logmatch_info(".arfcn"); single_value->field_arfcn.log_match(match_value.arfcn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_arfcn.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".arfcn := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_arfcn.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_tfi.match(match_value.tfi(), legacy)){ TTCN_Logger::log_logmatch_info(".tfi"); single_value->field_tfi.log_match(match_value.tfi(), 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("{ arfcn := "); if (match_value.arfcn().ispresent()) { single_value->field_arfcn.log_match(match_value.arfcn(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_arfcn.log(); if (single_value->field_arfcn.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", tfi := "); single_value->field_tfi.log_match(match_value.tfi(), 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 TbfPars_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!arfcn().is_bound()) arfcn() = OMIT_VALUE; else arfcn().set_implicit_omit(); if (tfi().is_bound()) tfi().set_implicit_omit(); } void TbfPars_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_arfcn.encode_text(text_buf); single_value->field_tfi.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 @LAPDm_RAW_PT.TbfPars."); } } void TbfPars_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_arfcn.decode_text(text_buf); single_value->field_tfi.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 TbfPars_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 @LAPDm_RAW_PT.TbfPars."); } } void TbfPars_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: { TbfPars_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) arfcn().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tfi().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(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tfi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tfi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TbfPars: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TbfPars_template* precondition = new TbfPars_template; precondition->set_param(*param.get_elem(0)); TbfPars_template* implied_template = new TbfPars_template; implied_template->set_param(*param.get_elem(1)); *this = TbfPars_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.TbfPars"); } is_ifpresent = param.get_ifpresent(); } void TbfPars_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_arfcn.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TbfPars"); single_value->field_tfi.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TbfPars"); 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 : "@LAPDm_RAW_PT.TbfPars"); } boolean TbfPars_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TbfPars_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; } TbfParsPerTs::TbfParsPerTs(const TbfParsPerTs& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } TbfParsPerTs::~TbfParsPerTs() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void TbfParsPerTs::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."); } } TbfParsPerTs& TbfParsPerTs::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; } TbfParsPerTs& TbfParsPerTs::operator=(const TbfParsPerTs& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean TbfParsPerTs::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); return val_ptr->n_elements == 0 ; } boolean TbfParsPerTs::operator==(const TbfParsPerTs& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); 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; } TbfPars& TbfParsPerTs::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @LAPDm_RAW_PT.TbfParsPerTs 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 = (TbfPars**)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 TbfPars(*(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 TbfPars; } return *val_ptr->value_elements[index_value]; } TbfPars& TbfParsPerTs::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @LAPDm_RAW_PT.TbfParsPerTs."); return (*this)[(int)index_value]; } const TbfPars& TbfParsPerTs::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); if (index_value < 0) TTCN_error("Accessing an element of type @LAPDm_RAW_PT.TbfParsPerTs using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @LAPDm_RAW_PT.TbfParsPerTs: 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 TbfPars& TbfParsPerTs::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @LAPDm_RAW_PT.TbfParsPerTs."); return (*this)[(int)index_value]; } TbfParsPerTs TbfParsPerTs::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } TbfParsPerTs TbfParsPerTs::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } TbfParsPerTs TbfParsPerTs::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } TbfParsPerTs TbfParsPerTs::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); 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; TbfParsPerTs 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 TbfPars(*val_ptr->value_elements[i]); } } return ret_val; } TbfParsPerTs TbfParsPerTs::operator+(const TbfParsPerTs& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @LAPDm_RAW_PT.TbfParsPerTs concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; TbfParsPerTs 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 TbfPars(*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 TbfPars(*other_value.val_ptr->value_elements[i]); } } return ret_val; } TbfParsPerTs TbfParsPerTs::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@LAPDm_RAW_PT.TbfParsPerTs","element"); TbfParsPerTs ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new TbfPars(*val_ptr->value_elements[i+index]); } } return ret_val; } TbfParsPerTs TbfParsPerTs::replace(int index, int len, const TbfParsPerTs& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); check_replace_arguments(val_ptr->n_elements, index, len, "@LAPDm_RAW_PT.TbfParsPerTs","element"); TbfParsPerTs 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 TbfPars(*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 TbfPars(*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 TbfPars(*val_ptr->value_elements[index+i+len]); } } return ret_val; } TbfParsPerTs TbfParsPerTs::replace(int index, int len, const TbfParsPerTs_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 TbfParsPerTs::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @LAPDm_RAW_PT.TbfParsPerTs."); 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 = (TbfPars**)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 TbfPars(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (TbfPars**)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 @LAPDm_RAW_PT.TbfParsPerTs: %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 = (TbfPars**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean TbfParsPerTs::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 TbfParsPerTs::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); return val_ptr->n_elements; } int TbfParsPerTs::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); 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 TbfParsPerTs::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 TbfParsPerTs::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 TbfParsPerTs::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", "@LAPDm_RAW_PT.TbfParsPerTs"); } 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", "@LAPDm_RAW_PT.TbfParsPerTs"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void TbfParsPerTs::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); 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 TbfParsPerTs::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 @LAPDm_RAW_PT.TbfParsPerTs."); val_ptr->value_elements = (TbfPars**)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 TbfPars; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void TbfParsPerTs_template::copy_value(const TbfParsPerTs& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @LAPDm_RAW_PT.TbfParsPerTs with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (TbfPars_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 TbfPars_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new TbfPars_template; } } set_selection(SPECIFIC_VALUE); } void TbfParsPerTs_template::copy_template(const TbfParsPerTs_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 = (TbfPars_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 TbfPars_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new TbfPars_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 TbfParsPerTs_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 TbfParsPerTs_template(*other_value.implication_.precondition); implication_.implied_template = new TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); break; } set_selection(other_value); } boolean TbfParsPerTs_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 TbfParsPerTs_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const TbfParsPerTs*)value_ptr)[value_index], legacy); else return ((const TbfParsPerTs_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } TbfParsPerTs_template::TbfParsPerTs_template() { } TbfParsPerTs_template::TbfParsPerTs_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } TbfParsPerTs_template::TbfParsPerTs_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } TbfParsPerTs_template::TbfParsPerTs_template(const TbfParsPerTs& other_value) { copy_value(other_value); } TbfParsPerTs_template::TbfParsPerTs_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TbfParsPerTs&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.TbfParsPerTs from an unbound optional field."); } } TbfParsPerTs_template::TbfParsPerTs_template(TbfParsPerTs_template* p_precondition, TbfParsPerTs_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TbfParsPerTs_template::TbfParsPerTs_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; } TbfParsPerTs_template::TbfParsPerTs_template(const TbfParsPerTs_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } TbfParsPerTs_template::~TbfParsPerTs_template() { clean_up(); } void TbfParsPerTs_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; } TbfParsPerTs_template& TbfParsPerTs_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TbfParsPerTs_template& TbfParsPerTs_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } TbfParsPerTs_template& TbfParsPerTs_template::operator=(const TbfParsPerTs& other_value) { clean_up(); copy_value(other_value); return *this; } TbfParsPerTs_template& TbfParsPerTs_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TbfParsPerTs&)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 @LAPDm_RAW_PT.TbfParsPerTs."); } return *this; } TbfParsPerTs_template& TbfParsPerTs_template::operator=(const TbfParsPerTs_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } TbfPars_template& TbfParsPerTs_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs."); break; } return *single_value.value_elements[index_value]; } TbfPars_template& TbfParsPerTs_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @LAPDm_RAW_PT.TbfParsPerTs."); return (*this)[(int)index_value]; } const TbfPars_template& TbfParsPerTs_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @LAPDm_RAW_PT.TbfParsPerTs using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @LAPDm_RAW_PT.TbfParsPerTs."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @LAPDm_RAW_PT.TbfParsPerTs: 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 TbfPars_template& TbfParsPerTs_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @LAPDm_RAW_PT.TbfParsPerTs."); return (*this)[(int)index_value]; } void TbfParsPerTs_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @LAPDm_RAW_PT.TbfParsPerTs."); 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 = (TbfPars_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 TbfPars_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 TbfPars_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 = (TbfPars_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int TbfParsPerTs_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 TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs 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 @LAPDm_RAW_PT.TbfParsPerTs containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.TbfParsPerTs.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @LAPDm_RAW_PT.TbfParsPerTs"); } boolean TbfParsPerTs_template::match(const TbfParsPerTs& 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 @LAPDm_RAW_PT.TbfParsPerTs."); } return FALSE; } boolean TbfParsPerTs_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; } TbfParsPerTs TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); TbfParsPerTs 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; } TbfParsPerTs TbfParsPerTs_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); } TbfParsPerTs TbfParsPerTs_template::replace(int index, int len, const TbfParsPerTs_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()); } TbfParsPerTs TbfParsPerTs_template::replace(int index, int len, const TbfParsPerTs& 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 TbfParsPerTs_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 TbfParsPerTs_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @LAPDm_RAW_PT.TbfParsPerTs."); } set_selection(template_type); } TbfParsPerTs_template& TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @LAPDm_RAW_PT.TbfParsPerTs."); return value_list.list_value[list_index]; } void TbfParsPerTs_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 TbfParsPerTs_template::log_match(const TbfParsPerTs& 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 TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); } } void TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); single_value.value_elements = (TbfPars_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 TbfPars_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 TbfParsPerTs_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 @LAPDm_RAW_PT.TbfParsPerTs."); } } boolean TbfParsPerTs_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TbfParsPerTs_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iset_implicit_omit(); } } void TbfParsPerTs_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template"); switch (param.get_type()) { case Module_Param::MP_Omit: *this = OMIT_VALUE; break; case Module_Param::MP_Any: *this = ANY_VALUE; break; case Module_Param::MP_AnyOrNone: *this = ANY_OR_OMIT; break; case Module_Param::MP_List_Template: case Module_Param::MP_ComplementList_Template: case Module_Param::MP_ConjunctList_Template: { TbfParsPerTs_template temp; temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { TbfParsPerTs_template* precondition = new TbfParsPerTs_template; precondition->set_param(*param.get_elem(0)); TbfParsPerTs_template* implied_template = new TbfParsPerTs_template; implied_template->set_param(*param.get_elem(1)); *this = TbfParsPerTs_template(precondition, implied_template); } break; default: param.type_error("record of template", "@LAPDm_RAW_PT.TbfParsPerTs"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void TbfParsPerTs_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 : "@LAPDm_RAW_PT.TbfParsPerTs"); 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 : "@LAPDm_RAW_PT.TbfParsPerTs"); } boolean TbfParsPerTs_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); } } TBF__UL__establish__res::TBF__UL__establish__res() { } TBF__UL__establish__res::TBF__UL__establish__res(const OPTIONAL< TbfPars >& par_pars, const OPTIONAL< CHARSTRING >& par_err) : field_pars(par_pars), field_err(par_err) { } TBF__UL__establish__res::TBF__UL__establish__res(const TBF__UL__establish__res& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @LAPDm_RAW_PT.TBF_UL_establish_res."); if (other_value.pars().is_bound()) field_pars = other_value.pars(); else field_pars.clean_up(); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } void TBF__UL__establish__res::clean_up() { field_pars.clean_up(); field_err.clean_up(); } const TTCN_Typedescriptor_t* TBF__UL__establish__res::get_descriptor() const { return &TBF__UL__establish__res_descr_; } TBF__UL__establish__res& TBF__UL__establish__res::operator=(const TBF__UL__establish__res& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @LAPDm_RAW_PT.TBF_UL_establish_res."); if (other_value.pars().is_bound()) field_pars = other_value.pars(); else field_pars.clean_up(); if (other_value.err().is_bound()) field_err = other_value.err(); else field_err.clean_up(); } return *this; } boolean TBF__UL__establish__res::operator==(const TBF__UL__establish__res& other_value) const { return field_pars==other_value.field_pars && field_err==other_value.field_err; } boolean TBF__UL__establish__res::is_bound() const { return (OPTIONAL_OMIT == field_pars.get_selection() || field_pars.is_bound()) || (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_bound()); } boolean TBF__UL__establish__res::is_value() const { return (OPTIONAL_OMIT == field_pars.get_selection() || field_pars.is_value()) && (OPTIONAL_OMIT == field_err.get_selection() || field_err.is_value()); } int TBF__UL__establish__res::size_of() const { int ret_val = 0; if (field_pars.ispresent()) ret_val++; if (field_err.ispresent()) ret_val++; return ret_val; } void TBF__UL__establish__res::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pars := "); field_pars.log(); TTCN_Logger::log_event_str(", err := "); field_err.log(); TTCN_Logger::log_event_str(" }"); } void TBF__UL__establish__res::set_implicit_omit() { if (!pars().is_bound()) pars() = OMIT_VALUE; else pars().set_implicit_omit(); if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void TBF__UL__establish__res::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "record value"); switch (param.get_type()) { case Module_Param::MP_Value_List: if (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) pars().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_UL_establish_res: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.TBF_UL_establish_res"); } } void TBF__UL__establish__res::encode_text(Text_Buf& text_buf) const { field_pars.encode_text(text_buf); field_err.encode_text(text_buf); } void TBF__UL__establish__res::decode_text(Text_Buf& text_buf) { field_pars.decode_text(text_buf); field_err.decode_text(text_buf); } struct TBF__UL__establish__res_template::single_value_struct { TbfPars_template field_pars; CHARSTRING_template field_err; }; void TBF__UL__establish__res_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_pars = ANY_OR_OMIT; single_value->field_err = ANY_OR_OMIT; } } } void TBF__UL__establish__res_template::copy_value(const TBF__UL__establish__res& other_value) { single_value = new single_value_struct; if (other_value.pars().is_bound()) { if (other_value.pars().ispresent()) single_value->field_pars = other_value.pars()(); else single_value->field_pars = OMIT_VALUE; } else { single_value->field_pars.clean_up(); } if (other_value.err().is_bound()) { if (other_value.err().ispresent()) single_value->field_err = other_value.err()(); else single_value->field_err = OMIT_VALUE; } else { single_value->field_err.clean_up(); } set_selection(SPECIFIC_VALUE); } void TBF__UL__establish__res_template::copy_template(const TBF__UL__establish__res_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pars().get_selection()) { single_value->field_pars = other_value.pars(); } else { single_value->field_pars.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.err().get_selection()) { single_value->field_err = other_value.err(); } else { single_value->field_err.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 TBF__UL__establish__res_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 TBF__UL__establish__res_template(*other_value.implication_.precondition); implication_.implied_template = new TBF__UL__establish__res_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 @LAPDm_RAW_PT.TBF_UL_establish_res."); break; } set_selection(other_value); } TBF__UL__establish__res_template::TBF__UL__establish__res_template() { } TBF__UL__establish__res_template::TBF__UL__establish__res_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TBF__UL__establish__res_template::TBF__UL__establish__res_template(const TBF__UL__establish__res& other_value) { copy_value(other_value); } TBF__UL__establish__res_template::TBF__UL__establish__res_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__UL__establish__res&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.TBF_UL_establish_res from an unbound optional field."); } } TBF__UL__establish__res_template::TBF__UL__establish__res_template(TBF__UL__establish__res_template* p_precondition, TBF__UL__establish__res_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TBF__UL__establish__res_template::TBF__UL__establish__res_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; } TBF__UL__establish__res_template::TBF__UL__establish__res_template(const TBF__UL__establish__res_template& other_value) : Base_Template() { copy_template(other_value); } TBF__UL__establish__res_template::~TBF__UL__establish__res_template() { clean_up(); } TBF__UL__establish__res_template& TBF__UL__establish__res_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TBF__UL__establish__res_template& TBF__UL__establish__res_template::operator=(const TBF__UL__establish__res& other_value) { clean_up(); copy_value(other_value); return *this; } TBF__UL__establish__res_template& TBF__UL__establish__res_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__UL__establish__res&)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 @LAPDm_RAW_PT.TBF_UL_establish_res."); } return *this; } TBF__UL__establish__res_template& TBF__UL__establish__res_template::operator=(const TBF__UL__establish__res_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TBF__UL__establish__res_template::match(const TBF__UL__establish__res& 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.pars().is_bound()) return FALSE; if((other_value.pars().ispresent() ? !single_value->field_pars.match((const TbfPars&)other_value.pars(), legacy) : !single_value->field_pars.match_omit(legacy)))return FALSE; if(!other_value.err().is_bound()) return FALSE; if((other_value.err().ispresent() ? !single_value->field_err.match((const CHARSTRING&)other_value.err(), legacy) : !single_value->field_err.match_omit(legacy)))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @LAPDm_RAW_PT.TBF_UL_establish_res."); } return FALSE; } boolean TBF__UL__establish__res_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_pars.is_omit() || single_value->field_pars.is_bound()) || (single_value->field_err.is_omit() || single_value->field_err.is_bound()); } boolean TBF__UL__establish__res_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_pars.is_omit() || single_value->field_pars.is_value()) && (single_value->field_err.is_omit() || single_value->field_err.is_value()); } void TBF__UL__establish__res_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; } TBF__UL__establish__res TBF__UL__establish__res_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 @LAPDm_RAW_PT.TBF_UL_establish_res."); TBF__UL__establish__res ret_val; if (single_value->field_pars.is_omit()) ret_val.pars() = OMIT_VALUE; else if (single_value->field_pars.is_bound()) { ret_val.pars() = single_value->field_pars.valueof(); } if (single_value->field_err.is_omit()) ret_val.err() = OMIT_VALUE; else if (single_value->field_err.is_bound()) { ret_val.err() = single_value->field_err.valueof(); } return ret_val; } void TBF__UL__establish__res_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 @LAPDm_RAW_PT.TBF_UL_establish_res."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TBF__UL__establish__res_template[list_length]; } TBF__UL__establish__res_template& TBF__UL__establish__res_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 @LAPDm_RAW_PT.TBF_UL_establish_res."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.TBF_UL_establish_res."); return value_list.list_value[list_index]; } TbfPars_template& TBF__UL__establish__res_template::pars() { set_specific(); return single_value->field_pars; } const TbfPars_template& TBF__UL__establish__res_template::pars() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pars of a non-specific template of type @LAPDm_RAW_PT.TBF_UL_establish_res."); return single_value->field_pars; } CHARSTRING_template& TBF__UL__establish__res_template::err() { set_specific(); return single_value->field_err; } const CHARSTRING_template& TBF__UL__establish__res_template::err() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field err of a non-specific template of type @LAPDm_RAW_PT.TBF_UL_establish_res."); return single_value->field_err; } int TBF__UL__establish__res_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_pars.is_present()) ret_val++; if (single_value->field_err.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res 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 @LAPDm_RAW_PT.TBF_UL_establish_res containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_res containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.TBF_UL_establish_res."); } return 0; } void TBF__UL__establish__res_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pars := "); single_value->field_pars.log(); TTCN_Logger::log_event_str(", err := "); single_value->field_err.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 TBF__UL__establish__res_template::log_match(const TBF__UL__establish__res& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ if(match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); } else{ if (template_selection == SPECIFIC_VALUE) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); if (match_value.pars().ispresent()){ if(!single_value->field_pars.match(match_value.pars(), legacy)){ TTCN_Logger::log_logmatch_info(".pars"); single_value->field_pars.log_match(match_value.pars(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_pars.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".pars := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_pars.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.err().ispresent()){ if(!single_value->field_err.match(match_value.err(), legacy)){ TTCN_Logger::log_logmatch_info(".err"); single_value->field_err.log_match(match_value.err(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_err.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".err := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_err.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ pars := "); if (match_value.pars().ispresent()) { single_value->field_pars.log_match(match_value.pars(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_pars.log(); if (single_value->field_pars.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", err := "); if (match_value.err().ispresent()) { single_value->field_err.log_match(match_value.err(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_err.log(); if (single_value->field_err.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void TBF__UL__establish__res_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!pars().is_bound()) pars() = OMIT_VALUE; else pars().set_implicit_omit(); if (!err().is_bound()) err() = OMIT_VALUE; else err().set_implicit_omit(); } void TBF__UL__establish__res_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pars.encode_text(text_buf); single_value->field_err.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 @LAPDm_RAW_PT.TBF_UL_establish_res."); } } void TBF__UL__establish__res_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_pars.decode_text(text_buf); single_value->field_err.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 TBF__UL__establish__res_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 @LAPDm_RAW_PT.TBF_UL_establish_res."); } } void TBF__UL__establish__res_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: { TBF__UL__establish__res_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) pars().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) err().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(), "pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "err")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { err().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_UL_establish_res: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TBF__UL__establish__res_template* precondition = new TBF__UL__establish__res_template; precondition->set_param(*param.get_elem(0)); TBF__UL__establish__res_template* implied_template = new TBF__UL__establish__res_template; implied_template->set_param(*param.get_elem(1)); *this = TBF__UL__establish__res_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.TBF_UL_establish_res"); } is_ifpresent = param.get_ifpresent(); } void TBF__UL__establish__res_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_pars.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_UL_establish_res"); single_value->field_err.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_UL_establish_res"); 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 : "@LAPDm_RAW_PT.TBF_UL_establish_res"); } boolean TBF__UL__establish__res_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TBF__UL__establish__res_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.type_error("empty record/set value (i.e. { })", "@LAPDm_RAW_PT.DCCH_release_req"); } bound_flag = TRUE; } void DCCH__release__req::encode_text(Text_Buf& /*text_buf*/) const { must_bound("Text encoder: Encoding an unbound value of type @LAPDm_RAW_PT.DCCH_release_req."); } void DCCH__release__req::decode_text(Text_Buf& /*text_buf*/) { bound_flag = TRUE; } void DCCH__release__req_template::copy_template(const DCCH__release__req_template& other_value) { set_selection(other_value); switch (template_selection) { case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case SPECIFIC_VALUE: 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 DCCH__release__req_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 DCCH__release__req_template(*other_value.implication_.precondition); implication_.implied_template = new DCCH__release__req_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 @LAPDm_RAW_PT.DCCH_release_req."); break; } } DCCH__release__req_template::DCCH__release__req_template() { } DCCH__release__req_template::DCCH__release__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DCCH__release__req_template::DCCH__release__req_template(null_type) : Base_Template(SPECIFIC_VALUE) { } DCCH__release__req_template::DCCH__release__req_template(const DCCH__release__req& other_value) : Base_Template(SPECIFIC_VALUE) { other_value.must_bound("Creating a template from an unbound value of type @LAPDm_RAW_PT.DCCH_release_req."); } DCCH__release__req_template::DCCH__release__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.DCCH_release_req from an unbound optional field."); } } DCCH__release__req_template::DCCH__release__req_template(DCCH__release__req_template* p_precondition, DCCH__release__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DCCH__release__req_template::DCCH__release__req_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; } DCCH__release__req_template::DCCH__release__req_template(const DCCH__release__req_template& other_value) : Base_Template(){ copy_template(other_value); } DCCH__release__req_template::~DCCH__release__req_template() { clean_up(); } void DCCH__release__req_template::clean_up() { switch (template_selection) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: delete [] value_list.list_value; break; case IMPLICATION_MATCH: delete implication_.precondition; delete implication_.implied_template; break; case DYNAMIC_MATCH: dyn_match->ref_count--; if (dyn_match->ref_count == 0) { delete dyn_match->ptr; delete dyn_match; } break; default: break; } template_selection = UNINITIALIZED_TEMPLATE; } DCCH__release__req_template& DCCH__release__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DCCH__release__req_template& DCCH__release__req_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); return *this; } DCCH__release__req_template& DCCH__release__req_template::operator=(const DCCH__release__req& other_value) { other_value.must_bound("Assignment of an unbound value of type @LAPDm_RAW_PT.DCCH_release_req to a template."); clean_up(); set_selection(SPECIFIC_VALUE); return *this; } DCCH__release__req_template& DCCH__release__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of type @LAPDm_RAW_PT.DCCH_release_req."); } return *this; } DCCH__release__req_template& DCCH__release__req_template::operator=(const DCCH__release__req_template& other_value) { if (&other_value != this) { clean_up(); set_selection(other_value); } return *this; } boolean DCCH__release__req_template::match(null_type other_value,boolean) const { switch (template_selection) { case ANY_VALUE: case ANY_OR_OMIT: case SPECIFIC_VALUE: return TRUE; case OMIT_VALUE: return FALSE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @LAPDm_RAW_PT.DCCH_release_req."); } return FALSE; } boolean DCCH__release__req_template::match(const DCCH__release__req& other_value, boolean) const { if (!other_value.is_bound()) return FALSE; return match(NULL_VALUE); } DCCH__release__req DCCH__release__req_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 @LAPDm_RAW_PT.DCCH_release_req."); return NULL_VALUE; } void DCCH__release__req_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 @LAPDm_RAW_PT.DCCH_release_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DCCH__release__req_template[list_length]; } DCCH__release__req_template& DCCH__release__req_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 @LAPDm_RAW_PT.DCCH_release_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.DCCH_release_req."); return value_list.list_value[list_index]; } void DCCH__release__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: 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 DCCH__release__req_template::log_match(const DCCH__release__req& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void DCCH__release__req_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: case SPECIFIC_VALUE: 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 @LAPDm_RAW_PT.DCCH_release_req."); } } void DCCH__release__req_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: case SPECIFIC_VALUE: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new DCCH__release__req_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 @LAPDm_RAW_PT.DCCH_release_req."); } } void DCCH__release__req_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set 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: { DCCH__release__req_template temp; temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size()); for (size_t p_i=0; p_i0) param.type_error("empty record/set template", "@LAPDm_RAW_PT.DCCH_release_req"); *this = NULL_VALUE; break; case Module_Param::MP_Implication_Template: { DCCH__release__req_template* precondition = new DCCH__release__req_template; precondition->set_param(*param.get_elem(0)); DCCH__release__req_template* implied_template = new DCCH__release__req_template; implied_template->set_param(*param.get_elem(1)); *this = DCCH__release__req_template(precondition, implied_template); } break; default: param.type_error("empty record/set template", "@LAPDm_RAW_PT.DCCH_release_req"); } is_ifpresent = param.get_ifpresent(); } void DCCH__release__req_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; 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 : "@LAPDm_RAW_PT.DCCH_release_req"); } boolean DCCH__release__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DCCH__release__req_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) sacch().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sapi().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lapdm().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(), "sacch")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sacch().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sapi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sapi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lapdm")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lapdm().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.LAPDm_ph_data: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.LAPDm_ph_data"); } } void LAPDm__ph__data::encode_text(Text_Buf& text_buf) const { field_sacch.encode_text(text_buf); field_sapi.encode_text(text_buf); field_lapdm.encode_text(text_buf); } void LAPDm__ph__data::decode_text(Text_Buf& text_buf) { field_sacch.decode_text(text_buf); field_sapi.decode_text(text_buf); field_lapdm.decode_text(text_buf); } struct LAPDm__ph__data_template::single_value_struct { BOOLEAN_template field_sacch; INTEGER_template field_sapi; LAPDm__Types::LapdmFrame_template field_lapdm; }; void LAPDm__ph__data_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_sacch = ANY_VALUE; single_value->field_sapi = ANY_VALUE; single_value->field_lapdm = ANY_VALUE; } } } void LAPDm__ph__data_template::copy_value(const LAPDm__ph__data& other_value) { single_value = new single_value_struct; if (other_value.sacch().is_bound()) { single_value->field_sacch = other_value.sacch(); } else { single_value->field_sacch.clean_up(); } if (other_value.sapi().is_bound()) { single_value->field_sapi = other_value.sapi(); } else { single_value->field_sapi.clean_up(); } if (other_value.lapdm().is_bound()) { single_value->field_lapdm = other_value.lapdm(); } else { single_value->field_lapdm.clean_up(); } set_selection(SPECIFIC_VALUE); } void LAPDm__ph__data_template::copy_template(const LAPDm__ph__data_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.sacch().get_selection()) { single_value->field_sacch = other_value.sacch(); } else { single_value->field_sacch.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.sapi().get_selection()) { single_value->field_sapi = other_value.sapi(); } else { single_value->field_sapi.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lapdm().get_selection()) { single_value->field_lapdm = other_value.lapdm(); } else { single_value->field_lapdm.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 LAPDm__ph__data_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 LAPDm__ph__data_template(*other_value.implication_.precondition); implication_.implied_template = new LAPDm__ph__data_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 @LAPDm_RAW_PT.LAPDm_ph_data."); break; } set_selection(other_value); } LAPDm__ph__data_template::LAPDm__ph__data_template() { } LAPDm__ph__data_template::LAPDm__ph__data_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } LAPDm__ph__data_template::LAPDm__ph__data_template(const LAPDm__ph__data& other_value) { copy_value(other_value); } LAPDm__ph__data_template::LAPDm__ph__data_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LAPDm__ph__data&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.LAPDm_ph_data from an unbound optional field."); } } LAPDm__ph__data_template::LAPDm__ph__data_template(LAPDm__ph__data_template* p_precondition, LAPDm__ph__data_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } LAPDm__ph__data_template::LAPDm__ph__data_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; } LAPDm__ph__data_template::LAPDm__ph__data_template(const LAPDm__ph__data_template& other_value) : Base_Template() { copy_template(other_value); } LAPDm__ph__data_template::~LAPDm__ph__data_template() { clean_up(); } LAPDm__ph__data_template& LAPDm__ph__data_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } LAPDm__ph__data_template& LAPDm__ph__data_template::operator=(const LAPDm__ph__data& other_value) { clean_up(); copy_value(other_value); return *this; } LAPDm__ph__data_template& LAPDm__ph__data_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LAPDm__ph__data&)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 @LAPDm_RAW_PT.LAPDm_ph_data."); } return *this; } LAPDm__ph__data_template& LAPDm__ph__data_template::operator=(const LAPDm__ph__data_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean LAPDm__ph__data_template::match(const LAPDm__ph__data& 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.sacch().is_bound()) return FALSE; if(!single_value->field_sacch.match(other_value.sacch(), legacy))return FALSE; if(!other_value.sapi().is_bound()) return FALSE; if(!single_value->field_sapi.match(other_value.sapi(), legacy))return FALSE; if(!other_value.lapdm().is_bound()) return FALSE; if(!single_value->field_lapdm.match(other_value.lapdm(), 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 @LAPDm_RAW_PT.LAPDm_ph_data."); } return FALSE; } boolean LAPDm__ph__data_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_sacch.is_bound() || single_value->field_sapi.is_bound() || single_value->field_lapdm.is_bound(); } boolean LAPDm__ph__data_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_sacch.is_value() && single_value->field_sapi.is_value() && single_value->field_lapdm.is_value(); } void LAPDm__ph__data_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; } LAPDm__ph__data LAPDm__ph__data_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 @LAPDm_RAW_PT.LAPDm_ph_data."); LAPDm__ph__data ret_val; if (single_value->field_sacch.is_bound()) { ret_val.sacch() = single_value->field_sacch.valueof(); } if (single_value->field_sapi.is_bound()) { ret_val.sapi() = single_value->field_sapi.valueof(); } if (single_value->field_lapdm.is_bound()) { ret_val.lapdm() = single_value->field_lapdm.valueof(); } return ret_val; } void LAPDm__ph__data_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 @LAPDm_RAW_PT.LAPDm_ph_data."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new LAPDm__ph__data_template[list_length]; } LAPDm__ph__data_template& LAPDm__ph__data_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 @LAPDm_RAW_PT.LAPDm_ph_data."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.LAPDm_ph_data."); return value_list.list_value[list_index]; } BOOLEAN_template& LAPDm__ph__data_template::sacch() { set_specific(); return single_value->field_sacch; } const BOOLEAN_template& LAPDm__ph__data_template::sacch() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sacch of a non-specific template of type @LAPDm_RAW_PT.LAPDm_ph_data."); return single_value->field_sacch; } INTEGER_template& LAPDm__ph__data_template::sapi() { set_specific(); return single_value->field_sapi; } const INTEGER_template& LAPDm__ph__data_template::sapi() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sapi of a non-specific template of type @LAPDm_RAW_PT.LAPDm_ph_data."); return single_value->field_sapi; } LAPDm__Types::LapdmFrame_template& LAPDm__ph__data_template::lapdm() { set_specific(); return single_value->field_lapdm; } const LAPDm__Types::LapdmFrame_template& LAPDm__ph__data_template::lapdm() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lapdm of a non-specific template of type @LAPDm_RAW_PT.LAPDm_ph_data."); return single_value->field_lapdm; } int LAPDm__ph__data_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data 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 @LAPDm_RAW_PT.LAPDm_ph_data 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 @LAPDm_RAW_PT.LAPDm_ph_data containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.LAPDm_ph_data containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.LAPDm_ph_data."); } return 0; } void LAPDm__ph__data_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ sacch := "); single_value->field_sacch.log(); TTCN_Logger::log_event_str(", sapi := "); single_value->field_sapi.log(); TTCN_Logger::log_event_str(", lapdm := "); single_value->field_lapdm.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 LAPDm__ph__data_template::log_match(const LAPDm__ph__data& 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_sacch.match(match_value.sacch(), legacy)){ TTCN_Logger::log_logmatch_info(".sacch"); single_value->field_sacch.log_match(match_value.sacch(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_sapi.match(match_value.sapi(), legacy)){ TTCN_Logger::log_logmatch_info(".sapi"); single_value->field_sapi.log_match(match_value.sapi(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lapdm.match(match_value.lapdm(), legacy)){ TTCN_Logger::log_logmatch_info(".lapdm"); single_value->field_lapdm.log_match(match_value.lapdm(), 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("{ sacch := "); single_value->field_sacch.log_match(match_value.sacch(), legacy); TTCN_Logger::log_event_str(", sapi := "); single_value->field_sapi.log_match(match_value.sapi(), legacy); TTCN_Logger::log_event_str(", lapdm := "); single_value->field_lapdm.log_match(match_value.lapdm(), 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 LAPDm__ph__data_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (sacch().is_bound()) sacch().set_implicit_omit(); if (sapi().is_bound()) sapi().set_implicit_omit(); if (lapdm().is_bound()) lapdm().set_implicit_omit(); } void LAPDm__ph__data_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_sacch.encode_text(text_buf); single_value->field_sapi.encode_text(text_buf); single_value->field_lapdm.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 @LAPDm_RAW_PT.LAPDm_ph_data."); } } void LAPDm__ph__data_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_sacch.decode_text(text_buf); single_value->field_sapi.decode_text(text_buf); single_value->field_lapdm.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 LAPDm__ph__data_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 @LAPDm_RAW_PT.LAPDm_ph_data."); } } void LAPDm__ph__data_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: { LAPDm__ph__data_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) sacch().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sapi().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lapdm().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(), "sacch")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sacch().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "sapi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { sapi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lapdm")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lapdm().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.LAPDm_ph_data: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { LAPDm__ph__data_template* precondition = new LAPDm__ph__data_template; precondition->set_param(*param.get_elem(0)); LAPDm__ph__data_template* implied_template = new LAPDm__ph__data_template; implied_template->set_param(*param.get_elem(1)); *this = LAPDm__ph__data_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.LAPDm_ph_data"); } is_ifpresent = param.get_ifpresent(); } void LAPDm__ph__data_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_sacch.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.LAPDm_ph_data"); single_value->field_sapi.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.LAPDm_ph_data"); single_value->field_lapdm.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.LAPDm_ph_data"); 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 : "@LAPDm_RAW_PT.LAPDm_ph_data"); } boolean LAPDm__ph__data_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean LAPDm__ph__data_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) tbf__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ra().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(), "tbf_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_UL_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.TBF_UL_establish_req"); } } void TBF__UL__establish__req::encode_text(Text_Buf& text_buf) const { field_tbf__nr.encode_text(text_buf); field_ra.encode_text(text_buf); } void TBF__UL__establish__req::decode_text(Text_Buf& text_buf) { field_tbf__nr.decode_text(text_buf); field_ra.decode_text(text_buf); } struct TBF__UL__establish__req_template::single_value_struct { INTEGER_template field_tbf__nr; INTEGER_template field_ra; }; void TBF__UL__establish__req_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_tbf__nr = ANY_VALUE; single_value->field_ra = ANY_VALUE; } } } void TBF__UL__establish__req_template::copy_value(const TBF__UL__establish__req& other_value) { single_value = new single_value_struct; if (other_value.tbf__nr().is_bound()) { single_value->field_tbf__nr = other_value.tbf__nr(); } else { single_value->field_tbf__nr.clean_up(); } if (other_value.ra().is_bound()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } set_selection(SPECIFIC_VALUE); } void TBF__UL__establish__req_template::copy_template(const TBF__UL__establish__req_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tbf__nr().get_selection()) { single_value->field_tbf__nr = other_value.tbf__nr(); } else { single_value->field_tbf__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ra().get_selection()) { single_value->field_ra = other_value.ra(); } else { single_value->field_ra.clean_up(); } 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 TBF__UL__establish__req_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 TBF__UL__establish__req_template(*other_value.implication_.precondition); implication_.implied_template = new TBF__UL__establish__req_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 @LAPDm_RAW_PT.TBF_UL_establish_req."); break; } set_selection(other_value); } TBF__UL__establish__req_template::TBF__UL__establish__req_template() { } TBF__UL__establish__req_template::TBF__UL__establish__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TBF__UL__establish__req_template::TBF__UL__establish__req_template(const TBF__UL__establish__req& other_value) { copy_value(other_value); } TBF__UL__establish__req_template::TBF__UL__establish__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__UL__establish__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.TBF_UL_establish_req from an unbound optional field."); } } TBF__UL__establish__req_template::TBF__UL__establish__req_template(TBF__UL__establish__req_template* p_precondition, TBF__UL__establish__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TBF__UL__establish__req_template::TBF__UL__establish__req_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; } TBF__UL__establish__req_template::TBF__UL__establish__req_template(const TBF__UL__establish__req_template& other_value) : Base_Template() { copy_template(other_value); } TBF__UL__establish__req_template::~TBF__UL__establish__req_template() { clean_up(); } TBF__UL__establish__req_template& TBF__UL__establish__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TBF__UL__establish__req_template& TBF__UL__establish__req_template::operator=(const TBF__UL__establish__req& other_value) { clean_up(); copy_value(other_value); return *this; } TBF__UL__establish__req_template& TBF__UL__establish__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__UL__establish__req&)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 @LAPDm_RAW_PT.TBF_UL_establish_req."); } return *this; } TBF__UL__establish__req_template& TBF__UL__establish__req_template::operator=(const TBF__UL__establish__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TBF__UL__establish__req_template::match(const TBF__UL__establish__req& 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.tbf__nr().is_bound()) return FALSE; if(!single_value->field_tbf__nr.match(other_value.tbf__nr(), legacy))return FALSE; if(!other_value.ra().is_bound()) return FALSE; if(!single_value->field_ra.match(other_value.ra(), 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 @LAPDm_RAW_PT.TBF_UL_establish_req."); } return FALSE; } boolean TBF__UL__establish__req_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tbf__nr.is_bound() || single_value->field_ra.is_bound(); } boolean TBF__UL__establish__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tbf__nr.is_value() && single_value->field_ra.is_value(); } void TBF__UL__establish__req_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; } TBF__UL__establish__req TBF__UL__establish__req_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 @LAPDm_RAW_PT.TBF_UL_establish_req."); TBF__UL__establish__req ret_val; if (single_value->field_tbf__nr.is_bound()) { ret_val.tbf__nr() = single_value->field_tbf__nr.valueof(); } if (single_value->field_ra.is_bound()) { ret_val.ra() = single_value->field_ra.valueof(); } return ret_val; } void TBF__UL__establish__req_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 @LAPDm_RAW_PT.TBF_UL_establish_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TBF__UL__establish__req_template[list_length]; } TBF__UL__establish__req_template& TBF__UL__establish__req_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 @LAPDm_RAW_PT.TBF_UL_establish_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.TBF_UL_establish_req."); return value_list.list_value[list_index]; } INTEGER_template& TBF__UL__establish__req_template::tbf__nr() { set_specific(); return single_value->field_tbf__nr; } const INTEGER_template& TBF__UL__establish__req_template::tbf__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tbf_nr of a non-specific template of type @LAPDm_RAW_PT.TBF_UL_establish_req."); return single_value->field_tbf__nr; } INTEGER_template& TBF__UL__establish__req_template::ra() { set_specific(); return single_value->field_ra; } const INTEGER_template& TBF__UL__establish__req_template::ra() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ra of a non-specific template of type @LAPDm_RAW_PT.TBF_UL_establish_req."); return single_value->field_ra; } int TBF__UL__establish__req_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req 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 @LAPDm_RAW_PT.TBF_UL_establish_req 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 @LAPDm_RAW_PT.TBF_UL_establish_req containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_UL_establish_req containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.TBF_UL_establish_req."); } return 0; } void TBF__UL__establish__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tbf_nr := "); single_value->field_tbf__nr.log(); TTCN_Logger::log_event_str(", ra := "); single_value->field_ra.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 TBF__UL__establish__req_template::log_match(const TBF__UL__establish__req& 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_tbf__nr.match(match_value.tbf__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".tbf_nr"); single_value->field_tbf__nr.log_match(match_value.tbf__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ra.match(match_value.ra(), legacy)){ TTCN_Logger::log_logmatch_info(".ra"); single_value->field_ra.log_match(match_value.ra(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } }else { 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("{ tbf_nr := "); single_value->field_tbf__nr.log_match(match_value.tbf__nr(), legacy); TTCN_Logger::log_event_str(", ra := "); single_value->field_ra.log_match(match_value.ra(), 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 TBF__UL__establish__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tbf__nr().is_bound()) tbf__nr().set_implicit_omit(); if (ra().is_bound()) ra().set_implicit_omit(); } void TBF__UL__establish__req_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tbf__nr.encode_text(text_buf); single_value->field_ra.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 @LAPDm_RAW_PT.TBF_UL_establish_req."); } } void TBF__UL__establish__req_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_tbf__nr.decode_text(text_buf); single_value->field_ra.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 TBF__UL__establish__req_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 @LAPDm_RAW_PT.TBF_UL_establish_req."); } } void TBF__UL__establish__req_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: { TBF__UL__establish__req_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) tbf__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ra().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(), "tbf_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ra")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ra().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_UL_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TBF__UL__establish__req_template* precondition = new TBF__UL__establish__req_template; precondition->set_param(*param.get_elem(0)); TBF__UL__establish__req_template* implied_template = new TBF__UL__establish__req_template; implied_template->set_param(*param.get_elem(1)); *this = TBF__UL__establish__req_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.TBF_UL_establish_req"); } is_ifpresent = param.get_ifpresent(); } void TBF__UL__establish__req_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_tbf__nr.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_UL_establish_req"); single_value->field_ra.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_UL_establish_req"); 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 : "@LAPDm_RAW_PT.TBF_UL_establish_req"); } boolean TBF__UL__establish__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TBF__UL__establish__req_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) tbf__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pars().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(), "tbf_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_DL_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.TBF_DL_establish_req"); } } void TBF__DL__establish__req::encode_text(Text_Buf& text_buf) const { field_tbf__nr.encode_text(text_buf); field_pars.encode_text(text_buf); } void TBF__DL__establish__req::decode_text(Text_Buf& text_buf) { field_tbf__nr.decode_text(text_buf); field_pars.decode_text(text_buf); } struct TBF__DL__establish__req_template::single_value_struct { INTEGER_template field_tbf__nr; TbfPars_template field_pars; }; void TBF__DL__establish__req_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_tbf__nr = ANY_VALUE; single_value->field_pars = ANY_VALUE; } } } void TBF__DL__establish__req_template::copy_value(const TBF__DL__establish__req& other_value) { single_value = new single_value_struct; if (other_value.tbf__nr().is_bound()) { single_value->field_tbf__nr = other_value.tbf__nr(); } else { single_value->field_tbf__nr.clean_up(); } if (other_value.pars().is_bound()) { single_value->field_pars = other_value.pars(); } else { single_value->field_pars.clean_up(); } set_selection(SPECIFIC_VALUE); } void TBF__DL__establish__req_template::copy_template(const TBF__DL__establish__req_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tbf__nr().get_selection()) { single_value->field_tbf__nr = other_value.tbf__nr(); } else { single_value->field_tbf__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pars().get_selection()) { single_value->field_pars = other_value.pars(); } else { single_value->field_pars.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 TBF__DL__establish__req_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 TBF__DL__establish__req_template(*other_value.implication_.precondition); implication_.implied_template = new TBF__DL__establish__req_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 @LAPDm_RAW_PT.TBF_DL_establish_req."); break; } set_selection(other_value); } TBF__DL__establish__req_template::TBF__DL__establish__req_template() { } TBF__DL__establish__req_template::TBF__DL__establish__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TBF__DL__establish__req_template::TBF__DL__establish__req_template(const TBF__DL__establish__req& other_value) { copy_value(other_value); } TBF__DL__establish__req_template::TBF__DL__establish__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__DL__establish__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.TBF_DL_establish_req from an unbound optional field."); } } TBF__DL__establish__req_template::TBF__DL__establish__req_template(TBF__DL__establish__req_template* p_precondition, TBF__DL__establish__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TBF__DL__establish__req_template::TBF__DL__establish__req_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; } TBF__DL__establish__req_template::TBF__DL__establish__req_template(const TBF__DL__establish__req_template& other_value) : Base_Template() { copy_template(other_value); } TBF__DL__establish__req_template::~TBF__DL__establish__req_template() { clean_up(); } TBF__DL__establish__req_template& TBF__DL__establish__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TBF__DL__establish__req_template& TBF__DL__establish__req_template::operator=(const TBF__DL__establish__req& other_value) { clean_up(); copy_value(other_value); return *this; } TBF__DL__establish__req_template& TBF__DL__establish__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TBF__DL__establish__req&)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 @LAPDm_RAW_PT.TBF_DL_establish_req."); } return *this; } TBF__DL__establish__req_template& TBF__DL__establish__req_template::operator=(const TBF__DL__establish__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TBF__DL__establish__req_template::match(const TBF__DL__establish__req& 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.tbf__nr().is_bound()) return FALSE; if(!single_value->field_tbf__nr.match(other_value.tbf__nr(), legacy))return FALSE; if(!other_value.pars().is_bound()) return FALSE; if(!single_value->field_pars.match(other_value.pars(), 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 @LAPDm_RAW_PT.TBF_DL_establish_req."); } return FALSE; } boolean TBF__DL__establish__req_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tbf__nr.is_bound() || single_value->field_pars.is_bound(); } boolean TBF__DL__establish__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tbf__nr.is_value() && single_value->field_pars.is_value(); } void TBF__DL__establish__req_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; } TBF__DL__establish__req TBF__DL__establish__req_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 @LAPDm_RAW_PT.TBF_DL_establish_req."); TBF__DL__establish__req ret_val; if (single_value->field_tbf__nr.is_bound()) { ret_val.tbf__nr() = single_value->field_tbf__nr.valueof(); } if (single_value->field_pars.is_bound()) { ret_val.pars() = single_value->field_pars.valueof(); } return ret_val; } void TBF__DL__establish__req_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 @LAPDm_RAW_PT.TBF_DL_establish_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TBF__DL__establish__req_template[list_length]; } TBF__DL__establish__req_template& TBF__DL__establish__req_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 @LAPDm_RAW_PT.TBF_DL_establish_req."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.TBF_DL_establish_req."); return value_list.list_value[list_index]; } INTEGER_template& TBF__DL__establish__req_template::tbf__nr() { set_specific(); return single_value->field_tbf__nr; } const INTEGER_template& TBF__DL__establish__req_template::tbf__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tbf_nr of a non-specific template of type @LAPDm_RAW_PT.TBF_DL_establish_req."); return single_value->field_tbf__nr; } TbfPars_template& TBF__DL__establish__req_template::pars() { set_specific(); return single_value->field_pars; } const TbfPars_template& TBF__DL__establish__req_template::pars() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pars of a non-specific template of type @LAPDm_RAW_PT.TBF_DL_establish_req."); return single_value->field_pars; } int TBF__DL__establish__req_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req 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 @LAPDm_RAW_PT.TBF_DL_establish_req 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 @LAPDm_RAW_PT.TBF_DL_establish_req containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.TBF_DL_establish_req containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.TBF_DL_establish_req."); } return 0; } void TBF__DL__establish__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tbf_nr := "); single_value->field_tbf__nr.log(); TTCN_Logger::log_event_str(", pars := "); single_value->field_pars.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 TBF__DL__establish__req_template::log_match(const TBF__DL__establish__req& 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_tbf__nr.match(match_value.tbf__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".tbf_nr"); single_value->field_tbf__nr.log_match(match_value.tbf__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pars.match(match_value.pars(), legacy)){ TTCN_Logger::log_logmatch_info(".pars"); single_value->field_pars.log_match(match_value.pars(), 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("{ tbf_nr := "); single_value->field_tbf__nr.log_match(match_value.tbf__nr(), legacy); TTCN_Logger::log_event_str(", pars := "); single_value->field_pars.log_match(match_value.pars(), 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 TBF__DL__establish__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tbf__nr().is_bound()) tbf__nr().set_implicit_omit(); if (pars().is_bound()) pars().set_implicit_omit(); } void TBF__DL__establish__req_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tbf__nr.encode_text(text_buf); single_value->field_pars.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 @LAPDm_RAW_PT.TBF_DL_establish_req."); } } void TBF__DL__establish__req_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_tbf__nr.decode_text(text_buf); single_value->field_pars.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 TBF__DL__establish__req_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 @LAPDm_RAW_PT.TBF_DL_establish_req."); } } void TBF__DL__establish__req_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: { TBF__DL__establish__req_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) tbf__nr().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pars().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(), "tbf_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pars")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pars().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.TBF_DL_establish_req: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TBF__DL__establish__req_template* precondition = new TBF__DL__establish__req_template; precondition->set_param(*param.get_elem(0)); TBF__DL__establish__req_template* implied_template = new TBF__DL__establish__req_template; implied_template->set_param(*param.get_elem(1)); *this = TBF__DL__establish__req_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.TBF_DL_establish_req"); } is_ifpresent = param.get_ifpresent(); } void TBF__DL__establish__req_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_tbf__nr.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_DL_establish_req"); single_value->field_pars.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.TBF_DL_establish_req"); 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 : "@LAPDm_RAW_PT.TBF_DL_establish_req"); } boolean TBF__DL__establish__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TBF__DL__establish__req_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) cs().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ts__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) block().set_param(*param.get_elem(3)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ts_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ts__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_ind: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); } } void RLCMAC__ph__data__ind::encode_text(Text_Buf& text_buf) const { field_cs.encode_text(text_buf); field_ts__nr.encode_text(text_buf); field_fn.encode_text(text_buf); field_block.encode_text(text_buf); } void RLCMAC__ph__data__ind::decode_text(Text_Buf& text_buf) { field_cs.decode_text(text_buf); field_ts__nr.decode_text(text_buf); field_fn.decode_text(text_buf); field_block.decode_text(text_buf); } struct RLCMAC__ph__data__ind_template::single_value_struct { GSM__Types::GprsCodingScheme_template field_cs; INTEGER_template field_ts__nr; INTEGER_template field_fn; RLCMAC__Types::RlcmacDlBlock_template field_block; }; void RLCMAC__ph__data__ind_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_cs = ANY_VALUE; single_value->field_ts__nr = ANY_VALUE; single_value->field_fn = ANY_VALUE; single_value->field_block = ANY_VALUE; } } } void RLCMAC__ph__data__ind_template::copy_value(const RLCMAC__ph__data__ind& other_value) { single_value = new single_value_struct; if (other_value.cs().is_bound()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (other_value.ts__nr().is_bound()) { single_value->field_ts__nr = other_value.ts__nr(); } else { single_value->field_ts__nr.clean_up(); } if (other_value.fn().is_bound()) { single_value->field_fn = other_value.fn(); } else { single_value->field_fn.clean_up(); } if (other_value.block().is_bound()) { single_value->field_block = other_value.block(); } else { single_value->field_block.clean_up(); } set_selection(SPECIFIC_VALUE); } void RLCMAC__ph__data__ind_template::copy_template(const RLCMAC__ph__data__ind_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.cs().get_selection()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ts__nr().get_selection()) { single_value->field_ts__nr = other_value.ts__nr(); } else { single_value->field_ts__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fn().get_selection()) { single_value->field_fn = other_value.fn(); } else { single_value->field_fn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.block().get_selection()) { single_value->field_block = other_value.block(); } else { single_value->field_block.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 RLCMAC__ph__data__ind_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 RLCMAC__ph__data__ind_template(*other_value.implication_.precondition); implication_.implied_template = new RLCMAC__ph__data__ind_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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); break; } set_selection(other_value); } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template() { } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template(const RLCMAC__ph__data__ind& other_value) { copy_value(other_value); } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__ind&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind from an unbound optional field."); } } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template(RLCMAC__ph__data__ind_template* p_precondition, RLCMAC__ph__data__ind_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_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; } RLCMAC__ph__data__ind_template::RLCMAC__ph__data__ind_template(const RLCMAC__ph__data__ind_template& other_value) : Base_Template() { copy_template(other_value); } RLCMAC__ph__data__ind_template::~RLCMAC__ph__data__ind_template() { clean_up(); } RLCMAC__ph__data__ind_template& RLCMAC__ph__data__ind_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RLCMAC__ph__data__ind_template& RLCMAC__ph__data__ind_template::operator=(const RLCMAC__ph__data__ind& other_value) { clean_up(); copy_value(other_value); return *this; } RLCMAC__ph__data__ind_template& RLCMAC__ph__data__ind_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__ind&)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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); } return *this; } RLCMAC__ph__data__ind_template& RLCMAC__ph__data__ind_template::operator=(const RLCMAC__ph__data__ind_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RLCMAC__ph__data__ind_template::match(const RLCMAC__ph__data__ind& 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.cs().is_bound()) return FALSE; if(!single_value->field_cs.match(other_value.cs(), legacy))return FALSE; if(!other_value.ts__nr().is_bound()) return FALSE; if(!single_value->field_ts__nr.match(other_value.ts__nr(), legacy))return FALSE; if(!other_value.fn().is_bound()) return FALSE; if(!single_value->field_fn.match(other_value.fn(), legacy))return FALSE; if(!other_value.block().is_bound()) return FALSE; if(!single_value->field_block.match(other_value.block(), 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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); } return FALSE; } boolean RLCMAC__ph__data__ind_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_cs.is_bound() || single_value->field_ts__nr.is_bound() || single_value->field_fn.is_bound() || single_value->field_block.is_bound(); } boolean RLCMAC__ph__data__ind_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_cs.is_value() && single_value->field_ts__nr.is_value() && single_value->field_fn.is_value() && single_value->field_block.is_value(); } void RLCMAC__ph__data__ind_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; } RLCMAC__ph__data__ind RLCMAC__ph__data__ind_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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); RLCMAC__ph__data__ind ret_val; if (single_value->field_cs.is_bound()) { ret_val.cs() = single_value->field_cs.valueof(); } if (single_value->field_ts__nr.is_bound()) { ret_val.ts__nr() = single_value->field_ts__nr.valueof(); } if (single_value->field_fn.is_bound()) { ret_val.fn() = single_value->field_fn.valueof(); } if (single_value->field_block.is_bound()) { ret_val.block() = single_value->field_block.valueof(); } return ret_val; } void RLCMAC__ph__data__ind_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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RLCMAC__ph__data__ind_template[list_length]; } RLCMAC__ph__data__ind_template& RLCMAC__ph__data__ind_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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); return value_list.list_value[list_index]; } GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__ind_template::cs() { set_specific(); return single_value->field_cs; } const GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__ind_template::cs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cs of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); return single_value->field_cs; } INTEGER_template& RLCMAC__ph__data__ind_template::ts__nr() { set_specific(); return single_value->field_ts__nr; } const INTEGER_template& RLCMAC__ph__data__ind_template::ts__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ts_nr of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); return single_value->field_ts__nr; } INTEGER_template& RLCMAC__ph__data__ind_template::fn() { set_specific(); return single_value->field_fn; } const INTEGER_template& RLCMAC__ph__data__ind_template::fn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fn of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); return single_value->field_fn; } RLCMAC__Types::RlcmacDlBlock_template& RLCMAC__ph__data__ind_template::block() { set_specific(); return single_value->field_block; } const RLCMAC__Types::RlcmacDlBlock_template& RLCMAC__ph__data__ind_template::block() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field block of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); return single_value->field_block; } int RLCMAC__ph__data__ind_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind 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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); } return 0; } void RLCMAC__ph__data__ind_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ cs := "); single_value->field_cs.log(); TTCN_Logger::log_event_str(", ts_nr := "); single_value->field_ts__nr.log(); TTCN_Logger::log_event_str(", fn := "); single_value->field_fn.log(); TTCN_Logger::log_event_str(", block := "); single_value->field_block.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 RLCMAC__ph__data__ind_template::log_match(const RLCMAC__ph__data__ind& 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_cs.match(match_value.cs(), legacy)){ TTCN_Logger::log_logmatch_info(".cs"); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ts__nr.match(match_value.ts__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".ts_nr"); single_value->field_ts__nr.log_match(match_value.ts__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_fn.match(match_value.fn(), legacy)){ TTCN_Logger::log_logmatch_info(".fn"); single_value->field_fn.log_match(match_value.fn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_block.match(match_value.block(), legacy)){ TTCN_Logger::log_logmatch_info(".block"); single_value->field_block.log_match(match_value.block(), 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("{ cs := "); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::log_event_str(", ts_nr := "); single_value->field_ts__nr.log_match(match_value.ts__nr(), legacy); TTCN_Logger::log_event_str(", fn := "); single_value->field_fn.log_match(match_value.fn(), legacy); TTCN_Logger::log_event_str(", block := "); single_value->field_block.log_match(match_value.block(), 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 RLCMAC__ph__data__ind_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (cs().is_bound()) cs().set_implicit_omit(); if (ts__nr().is_bound()) ts__nr().set_implicit_omit(); if (fn().is_bound()) fn().set_implicit_omit(); if (block().is_bound()) block().set_implicit_omit(); } void RLCMAC__ph__data__ind_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_cs.encode_text(text_buf); single_value->field_ts__nr.encode_text(text_buf); single_value->field_fn.encode_text(text_buf); single_value->field_block.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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); } } void RLCMAC__ph__data__ind_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_cs.decode_text(text_buf); single_value->field_ts__nr.decode_text(text_buf); single_value->field_fn.decode_text(text_buf); single_value->field_block.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 RLCMAC__ph__data__ind_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 @LAPDm_RAW_PT.RLCMAC_ph_data_ind."); } } void RLCMAC__ph__data__ind_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: { RLCMAC__ph__data__ind_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) cs().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ts__nr().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) block().set_param(*param.get_elem(3)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ts_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ts__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_ind: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RLCMAC__ph__data__ind_template* precondition = new RLCMAC__ph__data__ind_template; precondition->set_param(*param.get_elem(0)); RLCMAC__ph__data__ind_template* implied_template = new RLCMAC__ph__data__ind_template; implied_template->set_param(*param.get_elem(1)); *this = RLCMAC__ph__data__ind_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); } is_ifpresent = param.get_ifpresent(); } void RLCMAC__ph__data__ind_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_cs.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); single_value->field_ts__nr.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); single_value->field_fn.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); single_value->field_block.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); 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 : "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); } boolean RLCMAC__ph__data__ind_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RLCMAC__ph__data__ind_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) tbf__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) block().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(), "tbf_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); } } void RLCMAC__ph__data__req__dyn::encode_text(Text_Buf& text_buf) const { field_tbf__id.encode_text(text_buf); field_cs.encode_text(text_buf); field_block.encode_text(text_buf); } void RLCMAC__ph__data__req__dyn::decode_text(Text_Buf& text_buf) { field_tbf__id.decode_text(text_buf); field_cs.decode_text(text_buf); field_block.decode_text(text_buf); } struct RLCMAC__ph__data__req__dyn_template::single_value_struct { INTEGER_template field_tbf__id; GSM__Types::GprsCodingScheme_template field_cs; RLCMAC__Types::RlcmacUlBlock_template field_block; }; void RLCMAC__ph__data__req__dyn_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_tbf__id = ANY_VALUE; single_value->field_cs = ANY_VALUE; single_value->field_block = ANY_VALUE; } } } void RLCMAC__ph__data__req__dyn_template::copy_value(const RLCMAC__ph__data__req__dyn& other_value) { single_value = new single_value_struct; if (other_value.tbf__id().is_bound()) { single_value->field_tbf__id = other_value.tbf__id(); } else { single_value->field_tbf__id.clean_up(); } if (other_value.cs().is_bound()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (other_value.block().is_bound()) { single_value->field_block = other_value.block(); } else { single_value->field_block.clean_up(); } set_selection(SPECIFIC_VALUE); } void RLCMAC__ph__data__req__dyn_template::copy_template(const RLCMAC__ph__data__req__dyn_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tbf__id().get_selection()) { single_value->field_tbf__id = other_value.tbf__id(); } else { single_value->field_tbf__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cs().get_selection()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.block().get_selection()) { single_value->field_block = other_value.block(); } else { single_value->field_block.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 RLCMAC__ph__data__req__dyn_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 RLCMAC__ph__data__req__dyn_template(*other_value.implication_.precondition); implication_.implied_template = new RLCMAC__ph__data__req__dyn_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); break; } set_selection(other_value); } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template() { } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template(const RLCMAC__ph__data__req__dyn& other_value) { copy_value(other_value); } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req__dyn&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn from an unbound optional field."); } } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template(RLCMAC__ph__data__req__dyn_template* p_precondition, RLCMAC__ph__data__req__dyn_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_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; } RLCMAC__ph__data__req__dyn_template::RLCMAC__ph__data__req__dyn_template(const RLCMAC__ph__data__req__dyn_template& other_value) : Base_Template() { copy_template(other_value); } RLCMAC__ph__data__req__dyn_template::~RLCMAC__ph__data__req__dyn_template() { clean_up(); } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req__dyn_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req__dyn_template::operator=(const RLCMAC__ph__data__req__dyn& other_value) { clean_up(); copy_value(other_value); return *this; } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req__dyn_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req__dyn&)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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); } return *this; } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req__dyn_template::operator=(const RLCMAC__ph__data__req__dyn_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RLCMAC__ph__data__req__dyn_template::match(const RLCMAC__ph__data__req__dyn& 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.tbf__id().is_bound()) return FALSE; if(!single_value->field_tbf__id.match(other_value.tbf__id(), legacy))return FALSE; if(!other_value.cs().is_bound()) return FALSE; if(!single_value->field_cs.match(other_value.cs(), legacy))return FALSE; if(!other_value.block().is_bound()) return FALSE; if(!single_value->field_block.match(other_value.block(), 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); } return FALSE; } boolean RLCMAC__ph__data__req__dyn_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tbf__id.is_bound() || single_value->field_cs.is_bound() || single_value->field_block.is_bound(); } boolean RLCMAC__ph__data__req__dyn_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tbf__id.is_value() && single_value->field_cs.is_value() && single_value->field_block.is_value(); } void RLCMAC__ph__data__req__dyn_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; } RLCMAC__ph__data__req__dyn RLCMAC__ph__data__req__dyn_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); RLCMAC__ph__data__req__dyn ret_val; if (single_value->field_tbf__id.is_bound()) { ret_val.tbf__id() = single_value->field_tbf__id.valueof(); } if (single_value->field_cs.is_bound()) { ret_val.cs() = single_value->field_cs.valueof(); } if (single_value->field_block.is_bound()) { ret_val.block() = single_value->field_block.valueof(); } return ret_val; } void RLCMAC__ph__data__req__dyn_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RLCMAC__ph__data__req__dyn_template[list_length]; } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req__dyn_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); return value_list.list_value[list_index]; } INTEGER_template& RLCMAC__ph__data__req__dyn_template::tbf__id() { set_specific(); return single_value->field_tbf__id; } const INTEGER_template& RLCMAC__ph__data__req__dyn_template::tbf__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tbf_id of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); return single_value->field_tbf__id; } GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__req__dyn_template::cs() { set_specific(); return single_value->field_cs; } const GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__req__dyn_template::cs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cs of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); return single_value->field_cs; } RLCMAC__Types::RlcmacUlBlock_template& RLCMAC__ph__data__req__dyn_template::block() { set_specific(); return single_value->field_block; } const RLCMAC__Types::RlcmacUlBlock_template& RLCMAC__ph__data__req__dyn_template::block() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field block of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); return single_value->field_block; } int RLCMAC__ph__data__req__dyn_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); } return 0; } void RLCMAC__ph__data__req__dyn_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tbf_id := "); single_value->field_tbf__id.log(); TTCN_Logger::log_event_str(", cs := "); single_value->field_cs.log(); TTCN_Logger::log_event_str(", block := "); single_value->field_block.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 RLCMAC__ph__data__req__dyn_template::log_match(const RLCMAC__ph__data__req__dyn& 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_tbf__id.match(match_value.tbf__id(), legacy)){ TTCN_Logger::log_logmatch_info(".tbf_id"); single_value->field_tbf__id.log_match(match_value.tbf__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cs.match(match_value.cs(), legacy)){ TTCN_Logger::log_logmatch_info(".cs"); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_block.match(match_value.block(), legacy)){ TTCN_Logger::log_logmatch_info(".block"); single_value->field_block.log_match(match_value.block(), 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("{ tbf_id := "); single_value->field_tbf__id.log_match(match_value.tbf__id(), legacy); TTCN_Logger::log_event_str(", cs := "); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::log_event_str(", block := "); single_value->field_block.log_match(match_value.block(), 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 RLCMAC__ph__data__req__dyn_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tbf__id().is_bound()) tbf__id().set_implicit_omit(); if (cs().is_bound()) cs().set_implicit_omit(); if (block().is_bound()) block().set_implicit_omit(); } void RLCMAC__ph__data__req__dyn_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tbf__id.encode_text(text_buf); single_value->field_cs.encode_text(text_buf); single_value->field_block.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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); } } void RLCMAC__ph__data__req__dyn_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_tbf__id.decode_text(text_buf); single_value->field_cs.decode_text(text_buf); single_value->field_block.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 RLCMAC__ph__data__req__dyn_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn."); } } void RLCMAC__ph__data__req__dyn_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: { RLCMAC__ph__data__req__dyn_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) tbf__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) block().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(), "tbf_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RLCMAC__ph__data__req__dyn_template* precondition = new RLCMAC__ph__data__req__dyn_template; precondition->set_param(*param.get_elem(0)); RLCMAC__ph__data__req__dyn_template* implied_template = new RLCMAC__ph__data__req__dyn_template; implied_template->set_param(*param.get_elem(1)); *this = RLCMAC__ph__data__req__dyn_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); } is_ifpresent = param.get_ifpresent(); } void RLCMAC__ph__data__req__dyn_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_tbf__id.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); single_value->field_cs.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); single_value->field_block.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); 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 : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_dyn"); } boolean RLCMAC__ph__data__req__dyn_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RLCMAC__ph__data__req__dyn_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) tbf__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ts__nr().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) block().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(), "tbf_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ts_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ts__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); } } void RLCMAC__ph__data__req__abs::encode_text(Text_Buf& text_buf) const { field_tbf__id.encode_text(text_buf); field_cs.encode_text(text_buf); field_ts__nr.encode_text(text_buf); field_fn.encode_text(text_buf); field_arfcn.encode_text(text_buf); field_block.encode_text(text_buf); } void RLCMAC__ph__data__req__abs::decode_text(Text_Buf& text_buf) { field_tbf__id.decode_text(text_buf); field_cs.decode_text(text_buf); field_ts__nr.decode_text(text_buf); field_fn.decode_text(text_buf); field_arfcn.decode_text(text_buf); field_block.decode_text(text_buf); } struct RLCMAC__ph__data__req__abs_template::single_value_struct { INTEGER_template field_tbf__id; GSM__Types::GprsCodingScheme_template field_cs; INTEGER_template field_ts__nr; INTEGER_template field_fn; GSM__Types::GsmBandArfcn_template field_arfcn; RLCMAC__Types::RlcmacUlBlock_template field_block; }; void RLCMAC__ph__data__req__abs_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_tbf__id = ANY_VALUE; single_value->field_cs = ANY_VALUE; single_value->field_ts__nr = ANY_VALUE; single_value->field_fn = ANY_VALUE; single_value->field_arfcn = ANY_VALUE; single_value->field_block = ANY_VALUE; } } } void RLCMAC__ph__data__req__abs_template::copy_value(const RLCMAC__ph__data__req__abs& other_value) { single_value = new single_value_struct; if (other_value.tbf__id().is_bound()) { single_value->field_tbf__id = other_value.tbf__id(); } else { single_value->field_tbf__id.clean_up(); } if (other_value.cs().is_bound()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (other_value.ts__nr().is_bound()) { single_value->field_ts__nr = other_value.ts__nr(); } else { single_value->field_ts__nr.clean_up(); } if (other_value.fn().is_bound()) { single_value->field_fn = other_value.fn(); } else { single_value->field_fn.clean_up(); } if (other_value.arfcn().is_bound()) { single_value->field_arfcn = other_value.arfcn(); } else { single_value->field_arfcn.clean_up(); } if (other_value.block().is_bound()) { single_value->field_block = other_value.block(); } else { single_value->field_block.clean_up(); } set_selection(SPECIFIC_VALUE); } void RLCMAC__ph__data__req__abs_template::copy_template(const RLCMAC__ph__data__req__abs_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tbf__id().get_selection()) { single_value->field_tbf__id = other_value.tbf__id(); } else { single_value->field_tbf__id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cs().get_selection()) { single_value->field_cs = other_value.cs(); } else { single_value->field_cs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ts__nr().get_selection()) { single_value->field_ts__nr = other_value.ts__nr(); } else { single_value->field_ts__nr.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fn().get_selection()) { single_value->field_fn = other_value.fn(); } else { single_value->field_fn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.arfcn().get_selection()) { single_value->field_arfcn = other_value.arfcn(); } else { single_value->field_arfcn.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.block().get_selection()) { single_value->field_block = other_value.block(); } else { single_value->field_block.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 RLCMAC__ph__data__req__abs_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 RLCMAC__ph__data__req__abs_template(*other_value.implication_.precondition); implication_.implied_template = new RLCMAC__ph__data__req__abs_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); break; } set_selection(other_value); } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template() { } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template(const RLCMAC__ph__data__req__abs& other_value) { copy_value(other_value); } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req__abs&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs from an unbound optional field."); } } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template(RLCMAC__ph__data__req__abs_template* p_precondition, RLCMAC__ph__data__req__abs_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_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; } RLCMAC__ph__data__req__abs_template::RLCMAC__ph__data__req__abs_template(const RLCMAC__ph__data__req__abs_template& other_value) : Base_Template() { copy_template(other_value); } RLCMAC__ph__data__req__abs_template::~RLCMAC__ph__data__req__abs_template() { clean_up(); } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req__abs_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req__abs_template::operator=(const RLCMAC__ph__data__req__abs& other_value) { clean_up(); copy_value(other_value); return *this; } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req__abs_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req__abs&)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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); } return *this; } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req__abs_template::operator=(const RLCMAC__ph__data__req__abs_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RLCMAC__ph__data__req__abs_template::match(const RLCMAC__ph__data__req__abs& 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.tbf__id().is_bound()) return FALSE; if(!single_value->field_tbf__id.match(other_value.tbf__id(), legacy))return FALSE; if(!other_value.cs().is_bound()) return FALSE; if(!single_value->field_cs.match(other_value.cs(), legacy))return FALSE; if(!other_value.ts__nr().is_bound()) return FALSE; if(!single_value->field_ts__nr.match(other_value.ts__nr(), legacy))return FALSE; if(!other_value.fn().is_bound()) return FALSE; if(!single_value->field_fn.match(other_value.fn(), legacy))return FALSE; if(!other_value.arfcn().is_bound()) return FALSE; if(!single_value->field_arfcn.match(other_value.arfcn(), legacy))return FALSE; if(!other_value.block().is_bound()) return FALSE; if(!single_value->field_block.match(other_value.block(), 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); } return FALSE; } boolean RLCMAC__ph__data__req__abs_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tbf__id.is_bound() || single_value->field_cs.is_bound() || single_value->field_ts__nr.is_bound() || single_value->field_fn.is_bound() || single_value->field_arfcn.is_bound() || single_value->field_block.is_bound(); } boolean RLCMAC__ph__data__req__abs_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tbf__id.is_value() && single_value->field_cs.is_value() && single_value->field_ts__nr.is_value() && single_value->field_fn.is_value() && single_value->field_arfcn.is_value() && single_value->field_block.is_value(); } void RLCMAC__ph__data__req__abs_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; } RLCMAC__ph__data__req__abs RLCMAC__ph__data__req__abs_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); RLCMAC__ph__data__req__abs ret_val; if (single_value->field_tbf__id.is_bound()) { ret_val.tbf__id() = single_value->field_tbf__id.valueof(); } if (single_value->field_cs.is_bound()) { ret_val.cs() = single_value->field_cs.valueof(); } if (single_value->field_ts__nr.is_bound()) { ret_val.ts__nr() = single_value->field_ts__nr.valueof(); } if (single_value->field_fn.is_bound()) { ret_val.fn() = single_value->field_fn.valueof(); } if (single_value->field_arfcn.is_bound()) { ret_val.arfcn() = single_value->field_arfcn.valueof(); } if (single_value->field_block.is_bound()) { ret_val.block() = single_value->field_block.valueof(); } return ret_val; } void RLCMAC__ph__data__req__abs_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RLCMAC__ph__data__req__abs_template[list_length]; } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req__abs_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return value_list.list_value[list_index]; } INTEGER_template& RLCMAC__ph__data__req__abs_template::tbf__id() { set_specific(); return single_value->field_tbf__id; } const INTEGER_template& RLCMAC__ph__data__req__abs_template::tbf__id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tbf_id of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_tbf__id; } GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__req__abs_template::cs() { set_specific(); return single_value->field_cs; } const GSM__Types::GprsCodingScheme_template& RLCMAC__ph__data__req__abs_template::cs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cs of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_cs; } INTEGER_template& RLCMAC__ph__data__req__abs_template::ts__nr() { set_specific(); return single_value->field_ts__nr; } const INTEGER_template& RLCMAC__ph__data__req__abs_template::ts__nr() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ts_nr of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_ts__nr; } INTEGER_template& RLCMAC__ph__data__req__abs_template::fn() { set_specific(); return single_value->field_fn; } const INTEGER_template& RLCMAC__ph__data__req__abs_template::fn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fn of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_fn; } GSM__Types::GsmBandArfcn_template& RLCMAC__ph__data__req__abs_template::arfcn() { set_specific(); return single_value->field_arfcn; } const GSM__Types::GsmBandArfcn_template& RLCMAC__ph__data__req__abs_template::arfcn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field arfcn of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_arfcn; } RLCMAC__Types::RlcmacUlBlock_template& RLCMAC__ph__data__req__abs_template::block() { set_specific(); return single_value->field_block; } const RLCMAC__Types::RlcmacUlBlock_template& RLCMAC__ph__data__req__abs_template::block() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field block of a non-specific template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); return single_value->field_block; } int RLCMAC__ph__data__req__abs_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); } return 0; } void RLCMAC__ph__data__req__abs_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tbf_id := "); single_value->field_tbf__id.log(); TTCN_Logger::log_event_str(", cs := "); single_value->field_cs.log(); TTCN_Logger::log_event_str(", ts_nr := "); single_value->field_ts__nr.log(); TTCN_Logger::log_event_str(", fn := "); single_value->field_fn.log(); TTCN_Logger::log_event_str(", arfcn := "); single_value->field_arfcn.log(); TTCN_Logger::log_event_str(", block := "); single_value->field_block.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 RLCMAC__ph__data__req__abs_template::log_match(const RLCMAC__ph__data__req__abs& 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_tbf__id.match(match_value.tbf__id(), legacy)){ TTCN_Logger::log_logmatch_info(".tbf_id"); single_value->field_tbf__id.log_match(match_value.tbf__id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cs.match(match_value.cs(), legacy)){ TTCN_Logger::log_logmatch_info(".cs"); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ts__nr.match(match_value.ts__nr(), legacy)){ TTCN_Logger::log_logmatch_info(".ts_nr"); single_value->field_ts__nr.log_match(match_value.ts__nr(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_fn.match(match_value.fn(), legacy)){ TTCN_Logger::log_logmatch_info(".fn"); single_value->field_fn.log_match(match_value.fn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_arfcn.match(match_value.arfcn(), legacy)){ TTCN_Logger::log_logmatch_info(".arfcn"); single_value->field_arfcn.log_match(match_value.arfcn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_block.match(match_value.block(), legacy)){ TTCN_Logger::log_logmatch_info(".block"); single_value->field_block.log_match(match_value.block(), 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("{ tbf_id := "); single_value->field_tbf__id.log_match(match_value.tbf__id(), legacy); TTCN_Logger::log_event_str(", cs := "); single_value->field_cs.log_match(match_value.cs(), legacy); TTCN_Logger::log_event_str(", ts_nr := "); single_value->field_ts__nr.log_match(match_value.ts__nr(), legacy); TTCN_Logger::log_event_str(", fn := "); single_value->field_fn.log_match(match_value.fn(), legacy); TTCN_Logger::log_event_str(", arfcn := "); single_value->field_arfcn.log_match(match_value.arfcn(), legacy); TTCN_Logger::log_event_str(", block := "); single_value->field_block.log_match(match_value.block(), 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 RLCMAC__ph__data__req__abs_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tbf__id().is_bound()) tbf__id().set_implicit_omit(); if (cs().is_bound()) cs().set_implicit_omit(); if (ts__nr().is_bound()) ts__nr().set_implicit_omit(); if (fn().is_bound()) fn().set_implicit_omit(); if (arfcn().is_bound()) arfcn().set_implicit_omit(); if (block().is_bound()) block().set_implicit_omit(); } void RLCMAC__ph__data__req__abs_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tbf__id.encode_text(text_buf); single_value->field_cs.encode_text(text_buf); single_value->field_ts__nr.encode_text(text_buf); single_value->field_fn.encode_text(text_buf); single_value->field_arfcn.encode_text(text_buf); single_value->field_block.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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); } } void RLCMAC__ph__data__req__abs_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_tbf__id.decode_text(text_buf); single_value->field_cs.decode_text(text_buf); single_value->field_ts__nr.decode_text(text_buf); single_value->field_fn.decode_text(text_buf); single_value->field_arfcn.decode_text(text_buf); single_value->field_block.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 RLCMAC__ph__data__req__abs_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs."); } } void RLCMAC__ph__data__req__abs_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: { RLCMAC__ph__data__req__abs_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) tbf__id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ts__nr().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) block().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(), "tbf_id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tbf__id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ts_nr")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ts__nr().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "arfcn")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { arfcn().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "block")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { block().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @LAPDm_RAW_PT.RLCMAC_ph_data_req_abs: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RLCMAC__ph__data__req__abs_template* precondition = new RLCMAC__ph__data__req__abs_template; precondition->set_param(*param.get_elem(0)); RLCMAC__ph__data__req__abs_template* implied_template = new RLCMAC__ph__data__req__abs_template; implied_template->set_param(*param.get_elem(1)); *this = RLCMAC__ph__data__req__abs_template(precondition, implied_template); } break; default: param.type_error("record template", "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); } is_ifpresent = param.get_ifpresent(); } void RLCMAC__ph__data__req__abs_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_tbf__id.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); single_value->field_cs.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); single_value->field_ts__nr.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); single_value->field_fn.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); single_value->field_arfcn.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); single_value->field_block.check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); 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 : "@LAPDm_RAW_PT.RLCMAC_ph_data_req_abs"); } boolean RLCMAC__ph__data__req__abs_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RLCMAC__ph__data__req__abs_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_abs: return field_abs->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void RLCMAC__ph__data__req::clean_up() { switch (union_selection) { case ALT_dyn: delete field_dyn; break; case ALT_abs: delete field_abs; break; default: break; } union_selection = UNBOUND_VALUE; } void RLCMAC__ph__data__req::log() const { switch (union_selection) { case ALT_dyn: TTCN_Logger::log_event_str("{ dyn := "); field_dyn->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_abs: TTCN_Logger::log_event_str("{ abs := "); field_abs->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void RLCMAC__ph__data__req::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, "dyn")) { dyn().set_param(*mp_last); if (!dyn().is_bound()) clean_up(); return; } if (!strcmp(last_name, "abs")) { abs().set_param(*mp_last); if (!abs().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @LAPDm_RAW_PT.RLCMAC_ph_data_req.", last_name); } void RLCMAC__ph__data__req::set_implicit_omit() { switch (union_selection) { case ALT_dyn: field_dyn->set_implicit_omit(); break; case ALT_abs: field_abs->set_implicit_omit(); break; default: break; } } void RLCMAC__ph__data__req::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_dyn: field_dyn->encode_text(text_buf); break; case ALT_abs: field_abs->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } void RLCMAC__ph__data__req::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_dyn: dyn().decode_text(text_buf); break; case ALT_abs: abs().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } void RLCMAC__ph__data__req_template::copy_value(const RLCMAC__ph__data__req& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn = new RLCMAC__ph__data__req__dyn_template(other_value.dyn()); break; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs = new RLCMAC__ph__data__req__abs_template(other_value.abs()); break; default: TTCN_error("Initializing a template with an unbound value of type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } set_selection(SPECIFIC_VALUE); } void RLCMAC__ph__data__req_template::copy_template(const RLCMAC__ph__data__req_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 RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn = new RLCMAC__ph__data__req__dyn_template(*other_value.single_value.field_dyn); break; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs = new RLCMAC__ph__data__req__abs_template(*other_value.single_value.field_abs); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } 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 RLCMAC__ph__data__req_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 RLCMAC__ph__data__req_template(*other_value.implication_.precondition); implication_.implied_template = new RLCMAC__ph__data__req_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } set_selection(other_value); } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template() { } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template(const RLCMAC__ph__data__req& other_value) { copy_value(other_value); } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req from an unbound optional field."); } } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template(RLCMAC__ph__data__req_template* p_precondition, RLCMAC__ph__data__req_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_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; } RLCMAC__ph__data__req_template::RLCMAC__ph__data__req_template(const RLCMAC__ph__data__req_template& other_value) : Base_Template(){ copy_template(other_value); } RLCMAC__ph__data__req_template::~RLCMAC__ph__data__req_template() { clean_up(); } void RLCMAC__ph__data__req_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: delete single_value.field_dyn; break; case RLCMAC__ph__data__req::ALT_abs: delete single_value.field_abs; 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; } RLCMAC__ph__data__req_template& RLCMAC__ph__data__req_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RLCMAC__ph__data__req_template& RLCMAC__ph__data__req_template::operator=(const RLCMAC__ph__data__req& other_value) { clean_up(); copy_value(other_value); return *this; } RLCMAC__ph__data__req_template& RLCMAC__ph__data__req_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RLCMAC__ph__data__req&)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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } return *this; } RLCMAC__ph__data__req_template& RLCMAC__ph__data__req_template::operator=(const RLCMAC__ph__data__req_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RLCMAC__ph__data__req_template::match(const RLCMAC__ph__data__req& 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: { RLCMAC__ph__data__req::union_selection_type value_selection = other_value.get_selection(); if (value_selection == RLCMAC__ph__data__req::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case RLCMAC__ph__data__req::ALT_dyn: return single_value.field_dyn->match(other_value.dyn(), legacy); case RLCMAC__ph__data__req::ALT_abs: return single_value.field_abs->match(other_value.abs(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } return FALSE; } boolean RLCMAC__ph__data__req_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: return single_value.field_dyn->is_value(); case RLCMAC__ph__data__req::ALT_abs: return single_value.field_abs->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } RLCMAC__ph__data__req RLCMAC__ph__data__req_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); RLCMAC__ph__data__req ret_val; switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: ret_val.dyn() = single_value.field_dyn->valueof(); break; case RLCMAC__ph__data__req::ALT_abs: ret_val.abs() = single_value.field_abs->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } return ret_val; } RLCMAC__ph__data__req_template& RLCMAC__ph__data__req_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); return value_list.list_value[list_index]; } void RLCMAC__ph__data__req_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RLCMAC__ph__data__req_template[list_length]; } RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req_template::dyn() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RLCMAC__ph__data__req::ALT_dyn) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dyn = new RLCMAC__ph__data__req__dyn_template(ANY_VALUE); else single_value.field_dyn = new RLCMAC__ph__data__req__dyn_template; single_value.union_selection = RLCMAC__ph__data__req::ALT_dyn; set_selection(SPECIFIC_VALUE); } return *single_value.field_dyn; } const RLCMAC__ph__data__req__dyn_template& RLCMAC__ph__data__req_template::dyn() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dyn in a non-specific template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); if (single_value.union_selection != RLCMAC__ph__data__req::ALT_dyn) TTCN_error("Accessing non-selected field dyn in a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); return *single_value.field_dyn; } RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req_template::abs() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RLCMAC__ph__data__req::ALT_abs) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_abs = new RLCMAC__ph__data__req__abs_template(ANY_VALUE); else single_value.field_abs = new RLCMAC__ph__data__req__abs_template; single_value.union_selection = RLCMAC__ph__data__req::ALT_abs; set_selection(SPECIFIC_VALUE); } return *single_value.field_abs; } const RLCMAC__ph__data__req__abs_template& RLCMAC__ph__data__req_template::abs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field abs in a non-specific template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); if (single_value.union_selection != RLCMAC__ph__data__req::ALT_abs) TTCN_error("Accessing non-selected field abs in a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); return *single_value.field_abs; } boolean RLCMAC__ph__data__req_template::ischosen(RLCMAC__ph__data__req::union_selection_type checked_selection) const { if (checked_selection == RLCMAC__ph__data__req::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == RLCMAC__ph__data__req::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req 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 RLCMAC__ph__data__req_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: TTCN_Logger::log_event_str("{ dyn := "); single_value.field_dyn->log(); TTCN_Logger::log_event_str(" }"); break; case RLCMAC__ph__data__req::ALT_abs: TTCN_Logger::log_event_str("{ abs := "); single_value.field_abs->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 RLCMAC__ph__data__req_template::log_match(const RLCMAC__ph__data__req& 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 RLCMAC__ph__data__req::ALT_dyn: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".dyn"); single_value.field_dyn->log_match(match_value.dyn(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ dyn := "); single_value.field_dyn->log_match(match_value.dyn(), legacy); TTCN_Logger::log_event_str(" }"); } break; case RLCMAC__ph__data__req::ALT_abs: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".abs"); single_value.field_abs->log_match(match_value.abs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ abs := "); single_value.field_abs->log_match(match_value.abs(), 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 RLCMAC__ph__data__req_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn->set_implicit_omit(); break; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs->set_implicit_omit(); break; default: break; } } void RLCMAC__ph__data__req_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 RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn->encode_text(text_buf); break; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } 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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } void RLCMAC__ph__data__req_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = RLCMAC__ph__data__req::UNBOUND_VALUE; RLCMAC__ph__data__req::union_selection_type new_selection = (RLCMAC__ph__data__req::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn = new RLCMAC__ph__data__req__dyn_template; single_value.field_dyn->decode_text(text_buf); break; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs = new RLCMAC__ph__data__req__abs_template; single_value.field_abs->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } 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 RLCMAC__ph__data__req_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 @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } } boolean RLCMAC__ph__data__req_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RLCMAC__ph__data__req_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 `@LAPDm_RAW_PT.RLCMAC_ph_data_req'"); } if (strcmp("dyn", param_field) == 0) { dyn().set_param(param); return; } else if (strcmp("abs", param_field) == 0) { abs().set_param(param); return; } else param.error("Field `%s' not found in union template type `@LAPDm_RAW_PT.RLCMAC_ph_data_req'", 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: { RLCMAC__ph__data__req_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", "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); 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, "dyn")) { dyn().set_param(*mp_last); break; } if (!strcmp(last_name, "abs")) { abs().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @LAPDm_RAW_PT.RLCMAC_ph_data_req.", last_name); } break; case Module_Param::MP_Implication_Template: { RLCMAC__ph__data__req_template* precondition = new RLCMAC__ph__data__req_template; precondition->set_param(*m_p->get_elem(0)); RLCMAC__ph__data__req_template* implied_template = new RLCMAC__ph__data__req_template; implied_template->set_param(*m_p->get_elem(1)); *this = RLCMAC__ph__data__req_template(precondition, implied_template); } break; default: param.type_error("union template", "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); } is_ifpresent = param.get_ifpresent(); } void RLCMAC__ph__data__req_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 RLCMAC__ph__data__req::ALT_dyn: single_value.field_dyn->check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); return; case RLCMAC__ph__data__req::ALT_abs: single_value.field_abs->check_restriction(t_res, t_name ? t_name : "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @LAPDm_RAW_PT.RLCMAC_ph_data_req."); } 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 : "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); } void LAPDm__SP__PT::remove_msg_queue_head() { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; switch (my_head->item_selection) { case MESSAGE_0: delete (my_head)->message_0; break; case MESSAGE_1: delete (my_head)->message_1; break; case MESSAGE_2: delete (my_head)->message_2; break; case MESSAGE_3: delete (my_head)->message_3; break; case MESSAGE_4: delete (my_head)->message_4; break; case MESSAGE_5: delete (my_head)->message_5; break; case MESSAGE_6: delete (my_head)->message_6; break; case MESSAGE_7: delete (my_head)->message_7; break; default: TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name); } msg_queue_item_base *next_item = msg_queue_head->next_item; delete (msg_queue_item*)msg_queue_head; msg_queue_head = next_item; if (next_item == NULL) msg_queue_tail = NULL; TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));} void LAPDm__SP__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } LAPDm__SP__PT::LAPDm__SP__PT(const char *par_port_name) : PORT(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } LAPDm__SP__PT::~LAPDm__SP__PT() { clear_queue(); } void LAPDm__SP__PT::send(const DCCH__establish__res& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_establish_res"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__SP__PT::send(const DCCH__establish__res& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__establish__res& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_establish_res"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__establish__res_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const DCCH__establish__res& send_par_value = DCCH__establish__res(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__establish__res_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const DCCH__establish__res& send_par_value = DCCH__establish__res(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__establish__res_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const DCCH__establish__res& send_par_value = DCCH__establish__res(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__switch__res& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_switch_res"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__SP__PT::send(const DCCH__switch__res& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__switch__res& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_switch_res"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__switch__res_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const DCCH__switch__res& send_par_value = DCCH__switch__res(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__switch__res_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const DCCH__switch__res& send_par_value = DCCH__switch__res(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__SP__PT::send(const DCCH__switch__res_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const DCCH__switch__res& send_par_value = DCCH__switch__res(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__SP__PT::send(const TBF__UL__establish__res& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_UL_establish_res"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__SP__PT::send(const TBF__UL__establish__res& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__SP__PT::send(const TBF__UL__establish__res& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_UL_establish_res"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_res : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__SP__PT::send(const TBF__UL__establish__res_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const TBF__UL__establish__res& send_par_value = TBF__UL__establish__res(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__SP__PT::send(const TBF__UL__establish__res_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const TBF__UL__establish__res& send_par_value = TBF__UL__establish__res(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__SP__PT::send(const TBF__UL__establish__res_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const TBF__UL__establish__res& send_par_value = TBF__UL__establish__res(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.RLCMAC_ph_data_ind"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__ind& send_par_value = RLCMAC__ph__data__ind(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__ind& send_par_value = RLCMAC__ph__data__ind(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__SP__PT::send(const RLCMAC__ph__data__ind_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__ind& send_par_value = RLCMAC__ph__data__ind(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__SP__PT::send(const LAPDm__ph__data& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.LAPDm_ph_data"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__SP__PT::send(const LAPDm__ph__data& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__SP__PT::send(const LAPDm__ph__data& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.LAPDm_ph_data"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__SP__PT::send(const LAPDm__ph__data_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__SP__PT::send(const LAPDm__ph__data_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__SP__PT::send(const LAPDm__ph__data_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } alt_status LAPDm__SP__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_5: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req: "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_6: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req: "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_7: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_5: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req: "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_6: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req: "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_7: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_5: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req: "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_6: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req: "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_7: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const BCCH__tune__req_template& value_template, BCCH__tune__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.BCCH_tune_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const BCCH__tune__req_template& value_template, BCCH__tune__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.BCCH_tune_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const BCCH__tune__req_template& value_template, BCCH__tune__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.BCCH_tune_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.BCCH_tune_req : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const DCCH__establish__req_template& value_template, DCCH__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const DCCH__establish__req_template& value_template, DCCH__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const DCCH__establish__req_template& value_template, DCCH__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_req : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const DCCH__switch__req_template& value_template, DCCH__switch__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const DCCH__switch__req_template& value_template, DCCH__switch__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const DCCH__switch__req_template& value_template, DCCH__switch__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_req : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const DCCH__release__req_template& value_template, DCCH__release__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_release_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const DCCH__release__req_template& value_template, DCCH__release__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_release_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const DCCH__release__req_template& value_template, DCCH__release__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_release_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_release_req : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const TBF__UL__establish__req_template& value_template, TBF__UL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const TBF__UL__establish__req_template& value_template, TBF__UL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const TBF__UL__establish__req_template& value_template, TBF__UL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_req : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const TBF__DL__establish__req_template& value_template, TBF__DL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_5) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_DL_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_5)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_5; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req : "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const TBF__DL__establish__req_template& value_template, TBF__DL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_5) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_DL_establish_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_5)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_5; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req : "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const TBF__DL__establish__req_template& value_template, TBF__DL__establish__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_5) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_DL_establish_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_5)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_5; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_5), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_DL_establish_req : "), my_head->message_5->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const RLCMAC__ph__data__req_template& value_template, RLCMAC__ph__data__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_6) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_6)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_6; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const RLCMAC__ph__data__req_template& value_template, RLCMAC__ph__data__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_6) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_req.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_6)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_6; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const RLCMAC__ph__data__req_template& value_template, RLCMAC__ph__data__req *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_6) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_req.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_6)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_6; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_6), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), my_head->message_6->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::receive(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_7) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_7)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_7; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__SP__PT::check_receive(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_7) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_7)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_7; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__SP__PT::trigger(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_7) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_7)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_7; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_7), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_7->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void LAPDm__SP__PT::incoming_message(const BCCH__tune__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.BCCH_tune_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = new BCCH__tune__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const DCCH__establish__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_1; new_item->message_1 = new DCCH__establish__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const DCCH__switch__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_2; new_item->message_2 = new DCCH__switch__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const DCCH__release__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_release_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_3; new_item->message_3 = new DCCH__release__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const TBF__UL__establish__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_4; new_item->message_4 = new TBF__UL__establish__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const TBF__DL__establish__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_DL_establish_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_5; new_item->message_5 = new TBF__DL__establish__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const RLCMAC__ph__data__req& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_6; new_item->message_6 = new RLCMAC__ph__data__req(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__SP__PT::incoming_message(const LAPDm__ph__data& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_7; new_item->message_7 = new LAPDm__ph__data(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } boolean LAPDm__SP__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@LAPDm_RAW_PT.BCCH_tune_req")) { BCCH__tune__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.DCCH_establish_req")) { DCCH__establish__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.DCCH_switch_req")) { DCCH__switch__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.DCCH_release_req")) { DCCH__release__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.TBF_UL_establish_req")) { TBF__UL__establish__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.TBF_DL_establish_req")) { TBF__DL__establish__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.RLCMAC_ph_data_req")) { RLCMAC__ph__data__req incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.LAPDm_ph_data")) { LAPDm__ph__data incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } void LAPDm__PT::remove_msg_queue_head() { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; switch (my_head->item_selection) { case MESSAGE_0: delete (my_head)->message_0; break; case MESSAGE_1: delete (my_head)->message_1; break; case MESSAGE_2: delete (my_head)->message_2; break; case MESSAGE_3: delete (my_head)->message_3; break; case MESSAGE_4: delete (my_head)->message_4; break; default: TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name); } msg_queue_item_base *next_item = msg_queue_head->next_item; delete (msg_queue_item*)msg_queue_head; msg_queue_head = next_item; if (next_item == NULL) msg_queue_tail = NULL; TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));} void LAPDm__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } LAPDm__PT::LAPDm__PT(const char *par_port_name) : PORT(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } LAPDm__PT::~LAPDm__PT() { clear_queue(); } void LAPDm__PT::send(const BCCH__tune__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.BCCH_tune_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.BCCH_tune_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const BCCH__tune__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const BCCH__tune__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.BCCH_tune_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.BCCH_tune_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const BCCH__tune__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const BCCH__tune__req& send_par_value = BCCH__tune__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const BCCH__tune__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const BCCH__tune__req& send_par_value = BCCH__tune__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const BCCH__tune__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const BCCH__tune__req& send_par_value = BCCH__tune__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const DCCH__establish__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_establish_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const DCCH__establish__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const DCCH__establish__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_establish_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const DCCH__establish__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const DCCH__establish__req& send_par_value = DCCH__establish__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const DCCH__establish__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const DCCH__establish__req& send_par_value = DCCH__establish__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const DCCH__establish__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const DCCH__establish__req& send_par_value = DCCH__establish__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const DCCH__switch__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_switch_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const DCCH__switch__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const DCCH__switch__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_switch_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const DCCH__switch__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const DCCH__switch__req& send_par_value = DCCH__switch__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const DCCH__switch__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const DCCH__switch__req& send_par_value = DCCH__switch__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const DCCH__switch__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const DCCH__switch__req& send_par_value = DCCH__switch__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const DCCH__release__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_release_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_release_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const DCCH__release__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const DCCH__release__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.DCCH_release_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_release_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const DCCH__release__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const DCCH__release__req& send_par_value = DCCH__release__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const DCCH__release__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const DCCH__release__req& send_par_value = DCCH__release__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const DCCH__release__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const DCCH__release__req& send_par_value = DCCH__release__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const TBF__UL__establish__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_UL_establish_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const TBF__UL__establish__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const TBF__UL__establish__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_UL_establish_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const TBF__UL__establish__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const TBF__UL__establish__req& send_par_value = TBF__UL__establish__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const TBF__UL__establish__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const TBF__UL__establish__req& send_par_value = TBF__UL__establish__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const TBF__UL__establish__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const TBF__UL__establish__req& send_par_value = TBF__UL__establish__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const TBF__DL__establish__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_DL_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_DL_establish_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const TBF__DL__establish__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const TBF__DL__establish__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.TBF_DL_establish_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_DL_establish_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const TBF__DL__establish__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const TBF__DL__establish__req& send_par_value = TBF__DL__establish__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const TBF__DL__establish__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const TBF__DL__establish__req& send_par_value = TBF__DL__establish__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const TBF__DL__establish__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const TBF__DL__establish__req& send_par_value = TBF__DL__establish__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const RLCMAC__ph__data__req& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const RLCMAC__ph__data__req& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const RLCMAC__ph__data__req& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.RLCMAC_ph_data_req"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_req : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const RLCMAC__ph__data__req_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__req& send_par_value = RLCMAC__ph__data__req(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const RLCMAC__ph__data__req_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__req& send_par_value = RLCMAC__ph__data__req(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const RLCMAC__ph__data__req_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const RLCMAC__ph__data__req& send_par_value = RLCMAC__ph__data__req(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void LAPDm__PT::send(const LAPDm__ph__data& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation."); const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_send(port_name, destination_component, (TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name); else { Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.LAPDm_ph_data"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void LAPDm__PT::send(const LAPDm__ph__data& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect); } void LAPDm__PT::send(const LAPDm__ph__data& send_par, boolean broadcast, FLOAT* timestamp_redirect) { if (broadcast) { if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name); Text_Buf text_buf; prepare_message(text_buf, "@LAPDm_RAW_PT.LAPDm_ph_data"); send_par.encode_text(text_buf); send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void LAPDm__PT::send(const LAPDm__ph__data_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void LAPDm__PT::send(const LAPDm__ph__data_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void LAPDm__PT::send(const LAPDm__ph__data_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const LAPDm__ph__data& send_par_value = LAPDm__ph__data(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } alt_status LAPDm__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } return ALT_YES; } } alt_status LAPDm__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name); const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { switch (my_head->item_selection) { case MESSAGE_0: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res: "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_1: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_4: TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data: "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::receive(const DCCH__establish__res_template& value_template, DCCH__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const DCCH__establish__res_template& value_template, DCCH__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__PT::trigger(const DCCH__establish__res_template& value_template, DCCH__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_0) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_establish_res.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_0)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_0; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_establish_res : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::receive(const DCCH__switch__res_template& value_template, DCCH__switch__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const DCCH__switch__res_template& value_template, DCCH__switch__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__PT::trigger(const DCCH__switch__res_template& value_template, DCCH__switch__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_1) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.DCCH_switch_res.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_1)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_1; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_1), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.DCCH_switch_res : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::receive(const TBF__UL__establish__res_template& value_template, TBF__UL__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const TBF__UL__establish__res_template& value_template, TBF__UL__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_res.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__PT::trigger(const TBF__UL__establish__res_template& value_template, TBF__UL__establish__res *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_2) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.TBF_UL_establish_res.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_2)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_2), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.TBF_UL_establish_res : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::receive(const RLCMAC__ph__data__ind_template& value_template, RLCMAC__ph__data__ind *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_ind.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const RLCMAC__ph__data__ind_template& value_template, RLCMAC__ph__data__ind *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_ind.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__PT::trigger(const RLCMAC__ph__data__ind_template& value_template, RLCMAC__ph__data__ind *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_3) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.RLCMAC_ph_data_ind.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_3)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_3), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::receive(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status LAPDm__PT::check_receive(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } return ALT_NO; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status LAPDm__PT::trigger(const LAPDm__ph__data_template& value_template, LAPDm__ph__data *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*) { if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template"); msg_queue_item *my_head = (msg_queue_item*)msg_queue_head; if (msg_queue_head == NULL) { if (is_started) return ALT_MAYBE; else { TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name); return ALT_NO; } } else if (!sender_template.match(my_head->sender_component)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::begin_event(log_sev); TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name); sender_template.log_match(my_head->sender_component); TTCN_Logger::end_event(); } remove_msg_queue_head(); return ALT_REPEAT; } else if (my_head->item_selection != MESSAGE_4) { TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @LAPDm_RAW_PT.LAPDm_ph_data.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_4)) { const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_4; } if (sender_ptr != NULL) *sender_ptr = my_head->sender_component; TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__, port_name, my_head->sender_component, (TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_4), TTCN_Logger::end_event_log2str())); } log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV; if (TTCN_Logger::log_this_event(log_sev)) { TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op, my_head->sender_component, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @LAPDm_RAW_PT.LAPDm_ph_data : "), my_head->message_4->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void LAPDm__PT::incoming_message(const DCCH__establish__res& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_establish_res : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = new DCCH__establish__res(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__PT::incoming_message(const DCCH__switch__res& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.DCCH_switch_res : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_1; new_item->message_1 = new DCCH__switch__res(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__PT::incoming_message(const TBF__UL__establish__res& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.TBF_UL_establish_res : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_2; new_item->message_2 = new TBF__UL__establish__res(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__PT::incoming_message(const RLCMAC__ph__data__ind& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.RLCMAC_ph_data_ind : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_3; new_item->message_3 = new RLCMAC__ph__data__ind(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void LAPDm__PT::incoming_message(const LAPDm__ph__data& incoming_par, component sender_component) { if (!is_started) { if (is_halted) { TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name); return; } else { TTCN_error("Port %s is not started but a message has arrived on it.", port_name); } } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) { TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @LAPDm_RAW_PT.LAPDm_ph_data : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_4; new_item->message_4 = new LAPDm__ph__data(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } boolean LAPDm__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@LAPDm_RAW_PT.DCCH_establish_res")) { DCCH__establish__res incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.DCCH_switch_res")) { DCCH__switch__res incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.TBF_UL_establish_res")) { TBF__UL__establish__res incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.RLCMAC_ph_data_ind")) { RLCMAC__ph__data__ind incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@LAPDm_RAW_PT.LAPDm_ph_data")) { LAPDm__ph__data incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } ph__state__enum::ph__state__enum() { enum_value = UNBOUND_VALUE; } ph__state__enum::ph__state__enum(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @LAPDm_RAW_PT.ph_state_enum with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } ph__state__enum::ph__state__enum(enum_type other_value) { enum_value = other_value; } ph__state__enum::ph__state__enum(const ph__state__enum& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); enum_value = other_value.enum_value; } ph__state__enum& ph__state__enum::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @LAPDm_RAW_PT.ph_state_enum.", other_value); enum_value = (enum_type)other_value; return *this; } ph__state__enum& ph__state__enum::operator=(enum_type other_value) { enum_value = other_value; return *this; } ph__state__enum& ph__state__enum::operator=(const ph__state__enum& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); enum_value = other_value.enum_value; return *this; } boolean ph__state__enum::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @LAPDm_RAW_PT.ph_state_enum comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean ph__state__enum::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value == other_value; } boolean ph__state__enum::operator==(const ph__state__enum& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value == other_value.enum_value; } boolean ph__state__enum::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @LAPDm_RAW_PT.ph_state_enum comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean ph__state__enum::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value < other_value; } boolean ph__state__enum::operator<(const ph__state__enum& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value < other_value.enum_value; } boolean ph__state__enum::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @LAPDm_RAW_PT.ph_state_enum comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean ph__state__enum::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value > other_value; } boolean ph__state__enum::operator>(const ph__state__enum& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value > other_value.enum_value; } const char *ph__state__enum::enum_to_str(enum_type enum_par) { switch (enum_par) { case PH__STATE__NULL: return "PH_STATE_NULL"; case PH__STATE__BCH: return "PH_STATE_BCH"; case PH__STATE__SEARCHING__BCH: return "PH_STATE_SEARCHING_BCH"; case PH__STATE__TUNING__DCH: return "PH_STATE_TUNING_DCH"; case PH__STATE__DCH: return "PH_STATE_DCH"; case PH__STATE__TBF: return "PH_STATE_TBF"; default: return ""; } } ph__state__enum::enum_type ph__state__enum::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "PH_STATE_NULL")) return PH__STATE__NULL; if (!strcmp(str_par, "PH_STATE_BCH")) return PH__STATE__BCH; if (!strcmp(str_par, "PH_STATE_SEARCHING_BCH")) return PH__STATE__SEARCHING__BCH; if (!strcmp(str_par, "PH_STATE_TUNING_DCH")) return PH__STATE__TUNING__DCH; if (!strcmp(str_par, "PH_STATE_DCH")) return PH__STATE__DCH; if (!strcmp(str_par, "PH_STATE_TBF")) return PH__STATE__TBF; } return UNKNOWN_VALUE; } boolean ph__state__enum::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: case 4: case 5: return TRUE; default: return FALSE; } } int ph__state__enum::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @LAPDm_RAW_PT.ph_state_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int ph__state__enum::enum2int(const ph__state__enum& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @LAPDm_RAW_PT.ph_state_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void ph__state__enum::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @LAPDm_RAW_PT.ph_state_enum.", int_val); enum_value = (enum_type)int_val; } ph__state__enum::operator ph__state__enum::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return enum_value; } void ph__state__enum::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void ph__state__enum::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@LAPDm_RAW_PT.ph_state_enum"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @LAPDm_RAW_PT.ph_state_enum."); } } void ph__state__enum::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); text_buf.push_int(enum_value); } void ph__state__enum::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @LAPDm_RAW_PT.ph_state_enum.", enum_value); } void ph__state__enum_template::copy_template(const ph__state__enum_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new ph__state__enum_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 ph__state__enum_template(*other_value.implication_.precondition); implication_.implied_template = new ph__state__enum_template(*other_value.implication_.implied_template); break; case DYNAMIC_MATCH: dyn_match = other_value.dyn_match; dyn_match->ref_count++; break; default: TTCN_error("Copying an uninitialized/unsupported template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } } ph__state__enum_template::ph__state__enum_template() { } ph__state__enum_template::ph__state__enum_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } ph__state__enum_template::ph__state__enum_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!ph__state__enum::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @LAPDm_RAW_PT.ph_state_enum with unknown numeric value %d.", other_value); single_value = (ph__state__enum::enum_type)other_value; } ph__state__enum_template::ph__state__enum_template(ph__state__enum::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } ph__state__enum_template::ph__state__enum_template(const ph__state__enum& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == ph__state__enum::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum."); single_value = other_value.enum_value; } ph__state__enum_template::ph__state__enum_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (ph__state__enum::enum_type)(const ph__state__enum&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @LAPDm_RAW_PT.ph_state_enum from an unbound optional field."); } } ph__state__enum_template::ph__state__enum_template(ph__state__enum_template* p_precondition, ph__state__enum_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ph__state__enum_template::ph__state__enum_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; } ph__state__enum_template::ph__state__enum_template(const ph__state__enum_template& other_value) : Base_Template() { copy_template(other_value); } ph__state__enum_template::~ph__state__enum_template() { clean_up(); } boolean ph__state__enum_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean ph__state__enum_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != ph__state__enum::UNBOUND_VALUE; } void ph__state__enum_template::clean_up() { switch (template_selection) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: delete [] value_list.list_value; break; case IMPLICATION_MATCH: delete implication_.precondition; delete implication_.implied_template; break; case DYNAMIC_MATCH: dyn_match->ref_count--; if (dyn_match->ref_count == 0) { delete dyn_match->ptr; delete dyn_match; } break; default: break; } template_selection = UNINITIALIZED_TEMPLATE; } ph__state__enum_template& ph__state__enum_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ph__state__enum_template& ph__state__enum_template::operator=(int other_value) { if (!ph__state__enum::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @LAPDm_RAW_PT.ph_state_enum.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (ph__state__enum::enum_type)other_value; return *this; } ph__state__enum_template& ph__state__enum_template::operator=(ph__state__enum::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } ph__state__enum_template& ph__state__enum_template::operator=(const ph__state__enum& other_value) { if (other_value.enum_value == ph__state__enum::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @LAPDm_RAW_PT.ph_state_enum to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } ph__state__enum_template& ph__state__enum_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (ph__state__enum::enum_type)(const ph__state__enum&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } return *this; } ph__state__enum_template& ph__state__enum_template::operator=(const ph__state__enum_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean ph__state__enum_template::match(ph__state__enum::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } return FALSE; } boolean ph__state__enum_template::match(const ph__state__enum& other_value, boolean) const { if (other_value.enum_value == ph__state__enum::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @LAPDm_RAW_PT.ph_state_enum with an unbound value."); return match(other_value.enum_value); } ph__state__enum::enum_type ph__state__enum_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return single_value; } void ph__state__enum_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new ph__state__enum_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } } ph__state__enum_template& ph__state__enum_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); return value_list.list_value[list_index]; } void ph__state__enum_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(ph__state__enum::enum_to_str(single_value), single_value); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_ifpresent(); } void ph__state__enum_template::log_match(const ph__state__enum& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void ph__state__enum_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } } void ph__state__enum_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (ph__state__enum::enum_type)text_buf.pull_int().get_val(); if (!ph__state__enum::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @LAPDm_RAW_PT.ph_state_enum.", single_value); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new ph__state__enum_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @LAPDm_RAW_PT.ph_state_enum."); } } boolean ph__state__enum_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ph__state__enum_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int i=0; iget_type()) { case Module_Param::MP_Omit: *this = OMIT_VALUE; break; case Module_Param::MP_Any: *this = ANY_VALUE; break; case Module_Param::MP_AnyOrNone: *this = ANY_OR_OMIT; break; case Module_Param::MP_List_Template: case Module_Param::MP_ComplementList_Template: case Module_Param::MP_ConjunctList_Template: { ph__state__enum_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { ph__state__enum::enum_type enum_val = ph__state__enum::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!ph__state__enum::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @LAPDm_RAW_PT.ph_state_enum."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { ph__state__enum_template* precondition = new ph__state__enum_template; precondition->set_param(*m_p->get_elem(0)); ph__state__enum_template* implied_template = new ph__state__enum_template; implied_template->set_param(*m_p->get_elem(1)); *this = ph__state__enum_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@LAPDm_RAW_PT.ph_state_enum"); } is_ifpresent = param.get_ifpresent(); } void ph__state__enum_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return; switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) { case TR_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; case TR_PRESENT: if (!match_omit(legacy)) return; break; default: return; } TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@LAPDm_RAW_PT.ph_state_enum"); } as__tbf__ul__est_Default::as__tbf__ul__est_Default() : Default_Base("as_tbf_ul_est") { } alt_status as__tbf__ul__est_Default::call_altstep(boolean first_alt_run) { return as__tbf__ul__est_instance(first_alt_run); } as__tbf__dl__est_Default::as__tbf__dl__est_Default() : Default_Base("as_tbf_dl_est") { } alt_status as__tbf__dl__est_Default::call_altstep(boolean first_alt_run) { return as__tbf__dl__est_instance(first_alt_run); } /* Bodies of functions, altsteps and testcases */ boolean operator==(null_type, const TbfParsPerTs& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @LAPDm_RAW_PT.TbfParsPerTs."); return other_value.val_ptr->n_elements == 0; } boolean operator==(null_type, const DCCH__release__req& other_value) { other_value.must_bound("Comparison of an unbound value of type @LAPDm_RAW_PT.DCCH_release_req."); return TRUE; } void LAPDmStart() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 150, TTCN_Location::LOCATION_FUNCTION, "LAPDmStart"); current_location.update_lineno(151); /* LAPDm_RAW_PT.ttcn, line 151 */ f__init(); current_location.update_lineno(152); /* LAPDm_RAW_PT.ttcn, line 152 */ ScanEvents(); } void start_LAPDmStart(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function LAPDmStart("); 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, "LAPDm_RAW_PT", "LAPDmStart", text_buf); TTCN_Runtime::send_start_component(text_buf); } void set__ph__state(const ph__state__enum& new__state) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 187, TTCN_Location::LOCATION_FUNCTION, "set_ph_state"); current_location.update_lineno(188); /* LAPDm_RAW_PT.ttcn, line 188 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("PH-STATE "); lapdm__CT_component_ph__state.log(); TTCN_Logger::log_event_str(" -> "); new__state.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(189); /* LAPDm_RAW_PT.ttcn, line 189 */ lapdm__CT_component_ph__state = new__state; } void start_set__ph__state(const COMPONENT& component_reference, const ph__state__enum& new__state) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function set_ph_state("); new__state.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, "LAPDm_RAW_PT", "set_ph_state", text_buf); new__state.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__init() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 192, TTCN_Location::LOCATION_FUNCTION, "f_init"); current_location.update_lineno(193); /* LAPDm_RAW_PT.ttcn, line 193 */ L1CTL__PortType::f__connect__reset(lapdm__CT_component_L1CTL, L1CTL__PortType::f__connect__reset_l1ctl__sock__path_defval); current_location.update_lineno(194); /* LAPDm_RAW_PT.ttcn, line 194 */ set__ph__state(ph__state__enum::PH__STATE__NULL); } void start_f__init(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init("); TTCN_Logger::log_event_str(") on component "); component_reference.log(); TTCN_Logger::log_char('.'); TTCN_Logger::end_event(); Text_Buf text_buf; TTCN_Runtime::prepare_start_component(component_reference, "LAPDm_RAW_PT", "f_init", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__release__dcch() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 198, TTCN_Location::LOCATION_FUNCTION, "f_release_dcch"); current_location.update_lineno(199); /* LAPDm_RAW_PT.ttcn, line 199 */ lapdm__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DM__REL__REQ(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr())), FALSE, NULL); current_location.update_lineno(200); /* LAPDm_RAW_PT.ttcn, line 200 */ set__ph__state(ph__state__enum::PH__STATE__BCH); } void start_f__release__dcch(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_release_dcch("); 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, "LAPDm_RAW_PT", "f_release_dcch", text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__tune__bcch(const GSM__Types::GsmBandArfcn& arfcn, const BOOLEAN& combined) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 204, TTCN_Location::LOCATION_FUNCTION, "f_tune_bcch"); current_location.update_lineno(206); /* LAPDm_RAW_PT.ttcn, line 206 */ L1CTL__Types::L1ctlCcchMode mode(L1CTL__Types::L1ctlCcchMode::CCCH__MODE__NON__COMBINED); current_location.update_lineno(207); /* LAPDm_RAW_PT.ttcn, line 207 */ if (combined) { current_location.update_lineno(208); /* LAPDm_RAW_PT.ttcn, line 208 */ mode = L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED; } current_location.update_lineno(211); /* LAPDm_RAW_PT.ttcn, line 211 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__DCH)) { current_location.update_lineno(213); /* LAPDm_RAW_PT.ttcn, line 213 */ f__release__dcch(); } else { current_location.update_lineno(214); /* LAPDm_RAW_PT.ttcn, line 214 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__TBF)) { current_location.update_lineno(215); /* LAPDm_RAW_PT.ttcn, line 215 */ f__release__tbf(); } } current_location.update_lineno(218); /* LAPDm_RAW_PT.ttcn, line 218 */ set__ph__state(ph__state__enum::PH__STATE__SEARCHING__BCH); current_location.update_lineno(221); /* LAPDm_RAW_PT.ttcn, line 221 */ L1CTL__PortType::f__L1CTL__FBSB(lapdm__CT_component_L1CTL, arfcn, mode, L1CTL__PortType::f__L1CTL__FBSB_rxlev__exp_defval); current_location.update_lineno(222); /* LAPDm_RAW_PT.ttcn, line 222 */ set__ph__state(ph__state__enum::PH__STATE__BCH); } void start_f__tune__bcch(const COMPONENT& component_reference, const GSM__Types::GsmBandArfcn& arfcn, const BOOLEAN& combined) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tune_bcch("); arfcn.log(); TTCN_Logger::log_event_str(", "); combined.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, "LAPDm_RAW_PT", "f_tune_bcch", text_buf); arfcn.encode_text(text_buf); combined.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__establish__dcch(const INTEGER& ra) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 226, TTCN_Location::LOCATION_FUNCTION, "f_establish_dcch"); current_location.update_lineno(227); /* LAPDm_RAW_PT.ttcn, line 227 */ GSM__RR__Types::ImmediateAssignment imm__ass; current_location.update_lineno(228); /* LAPDm_RAW_PT.ttcn, line 228 */ INTEGER rach__fn; current_location.update_lineno(231); /* LAPDm_RAW_PT.ttcn, line 231 */ rach__fn = L1CTL__PortType::f__L1CTL__RACH(lapdm__CT_component_L1CTL, ra, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval); current_location.update_lineno(235); /* LAPDm_RAW_PT.ttcn, line 235 */ imm__ass = L1CTL__PortType::f__L1CTL__WAIT__IMM__ASS(lapdm__CT_component_L1CTL, ra, rach__fn); current_location.update_lineno(237); /* LAPDm_RAW_PT.ttcn, line 237 */ set__ph__state(ph__state__enum::PH__STATE__TUNING__DCH); current_location.update_lineno(240); /* LAPDm_RAW_PT.ttcn, line 240 */ lapdm__CT_component_chan__desc = const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).chan__desc(); current_location.update_lineno(243); /* LAPDm_RAW_PT.ttcn, line 243 */ L1CTL__PortType::f__L1CTL__DM__EST__REQ__IA(lapdm__CT_component_L1CTL, imm__ass, L1CTL__PortType::f__L1CTL__DM__EST__REQ__IA_ma_defval); current_location.update_lineno(244); /* LAPDm_RAW_PT.ttcn, line 244 */ set__ph__state(ph__state__enum::PH__STATE__DCH); } void start_f__establish__dcch(const COMPONENT& component_reference, const INTEGER& ra) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_establish_dcch("); ra.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, "LAPDm_RAW_PT", "f_establish_dcch", text_buf); ra.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__switch__dcch(const DCCH__switch__req& sw__req) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 248, TTCN_Location::LOCATION_FUNCTION, "f_switch_dcch"); current_location.update_lineno(249); /* LAPDm_RAW_PT.ttcn, line 249 */ set__ph__state(ph__state__enum::PH__STATE__TUNING__DCH); current_location.update_lineno(251); /* LAPDm_RAW_PT.ttcn, line 251 */ lapdm__CT_component_chan__desc = const_cast< const DCCH__switch__req&>(sw__req).chan__desc(); current_location.update_lineno(254); /* LAPDm_RAW_PT.ttcn, line 254 */ if (const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).h()) { current_location.update_lineno(255); /* LAPDm_RAW_PT.ttcn, line 255 */ lapdm__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H1(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr()), INTEGER_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).tsc()), INTEGER_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).maio__hsn()().hsn()), INTEGER_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).maio__hsn()().maio()), L1CTL__Types::L1ctlMA_template(const_cast< const DCCH__switch__req&>(sw__req).ma())), FALSE, NULL); } else { current_location.update_lineno(261); /* LAPDm_RAW_PT.ttcn, line 261 */ lapdm__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H0(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr()), INTEGER_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).tsc()), INTEGER_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).arfcn())), FALSE, NULL); } current_location.update_lineno(266); /* LAPDm_RAW_PT.ttcn, line 266 */ set__ph__state(ph__state__enum::PH__STATE__DCH); } void start_f__switch__dcch(const COMPONENT& component_reference, const DCCH__switch__req& sw__req) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_switch_dcch("); sw__req.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, "LAPDm_RAW_PT", "f_switch_dcch", text_buf); sw__req.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } TfiUsfArr f__TfiUsfArrInit() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 270, TTCN_Location::LOCATION_FUNCTION, "f_TfiUsfArrInit"); current_location.update_lineno(271); /* LAPDm_RAW_PT.ttcn, line 271 */ TfiUsfArr tua; tua.set_size(8); tua[0] = 255; tua[1] = 255; tua[2] = 255; tua[3] = 255; tua[4] = 255; tua[5] = 255; tua[6] = 255; tua[7] = 255; current_location.update_lineno(272); /* LAPDm_RAW_PT.ttcn, line 272 */ return tua; } void f__TfiUsfArrSet(TfiUsfArr& a, const INTEGER& idx, const INTEGER& tfi__usf) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 276, TTCN_Location::LOCATION_FUNCTION, "f_TfiUsfArrSet"); current_location.update_lineno(277); /* LAPDm_RAW_PT.ttcn, line 277 */ a[idx] = tfi__usf; } RLCMAC__ph__data__req_template ts__PH__DATA__ABS(const INTEGER& tbf__id, const GSM__Types::GprsCodingScheme& , const INTEGER& ts, const INTEGER& fn, const GSM__Types::GsmBandArfcn& arfcn, const RLCMAC__Types::RlcmacUlBlock& block) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 280, TTCN_Location::LOCATION_TEMPLATE, "ts_PH_DATA_ABS"); RLCMAC__ph__data__req_template ret_val; { RLCMAC__ph__data__req__abs_template& tmp_8 = ret_val.abs(); tmp_8.tbf__id() = tbf__id; tmp_8.cs() = GSM__Types::GprsCodingScheme::CS1; tmp_8.ts__nr() = ts; tmp_8.fn() = fn; tmp_8.arfcn() = arfcn; tmp_8.block() = block; } return ret_val; } BOOLEAN f__establish__tbf(const INTEGER& ra) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 294, TTCN_Location::LOCATION_FUNCTION, "f_establish_tbf"); current_location.update_lineno(295); /* LAPDm_RAW_PT.ttcn, line 295 */ GSM__RR__Types::GsmRrMessage_template imm__ass__rr; current_location.update_lineno(296); /* LAPDm_RAW_PT.ttcn, line 296 */ GSM__RR__Types::ImmediateAssignment imm__ass; current_location.update_lineno(297); /* LAPDm_RAW_PT.ttcn, line 297 */ GSM__RestOctets::PacketUlAssign pkt__ul__ass; current_location.update_lineno(298); /* LAPDm_RAW_PT.ttcn, line 298 */ INTEGER rach__fn; current_location.update_lineno(299); /* LAPDm_RAW_PT.ttcn, line 299 */ TfiUsfArr tua(f__TfiUsfArrInit()); current_location.update_lineno(302); /* LAPDm_RAW_PT.ttcn, line 302 */ rach__fn = L1CTL__PortType::f__L1CTL__RACH(lapdm__CT_component_L1CTL, ra, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval); current_location.update_lineno(305); /* LAPDm_RAW_PT.ttcn, line 305 */ imm__ass = L1CTL__PortType::f__L1CTL__WAIT__IMM__ASS(lapdm__CT_component_L1CTL, ra, rach__fn); current_location.update_lineno(308); /* LAPDm_RAW_PT.ttcn, line 308 */ imm__ass__rr = GSM__RR__Types::tr__IMM__TBF__ASS(BOOLEAN_template(FALSE), INTEGER_template(ra), INTEGER_template(rach__fn), GSM__RR__Types::tr__IMM__TBF__ASS_ta_defval, GSM__RR__Types::tr__IMM__TBF__ASS_ch__desc_defval, GSM__RR__Types::tr__IMM__TBF__ASS_ma_defval, GSM__RestOctets::tr__IaRestOctets__ULAss(GSM__RestOctets::PacketUlAssign_template(ANY_VALUE))); current_location.update_lineno(310); /* LAPDm_RAW_PT.ttcn, line 310 */ if ((!(const_cast< const GSM__RR__Types::GsmRrMessage_template&>(imm__ass__rr).payload().imm__ass().match(imm__ass)))) { current_location.update_lineno(311); /* LAPDm_RAW_PT.ttcn, line 311 */ TTCN_Logger::log_str(TTCN_USER, "Failed to match Packet Immediate Assignment"); current_location.update_lineno(312); /* LAPDm_RAW_PT.ttcn, line 312 */ return FALSE; } current_location.update_lineno(316); /* LAPDm_RAW_PT.ttcn, line 316 */ pkt__ul__ass = const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).rest__octets().hh()().pa().uldl().ass().ul(); current_location.update_lineno(319); /* LAPDm_RAW_PT.ttcn, line 319 */ if (GSM__RestOctets::tr__PacketUlDynAssign(GSM__RestOctets::tr__PacketUlDynAssign_tfi_defval, GSM__RestOctets::tr__PacketUlDynAssign_polling_defval, GSM__RestOctets::tr__PacketUlDynAssign_usf_defval, GSM__RestOctets::tr__PacketUlDynAssign_usf__granularity_defval, GSM__RestOctets::tr__PacketUlDynAssign_cs_defval).match(pkt__ul__ass)) { current_location.update_lineno(320); /* LAPDm_RAW_PT.ttcn, line 320 */ set__ph__state(ph__state__enum::PH__STATE__TBF); current_location.update_lineno(326); /* LAPDm_RAW_PT.ttcn, line 326 */ f__TfiUsfArrSet(tua, const_cast< const GSM__RR__Types::ImmediateAssignment&>(imm__ass).pkt__chan__desc()().tn(), const_cast< const GSM__RestOctets::PacketUlAssign&>(pkt__ul__ass).dynamic()().usf()); current_location.update_lineno(328); /* LAPDm_RAW_PT.ttcn, line 328 */ return TRUE; } else { current_location.update_lineno(330); /* LAPDm_RAW_PT.ttcn, line 330 */ if (GSM__RestOctets::tr__PacketUlSglAssign.match(pkt__ul__ass)) { current_location.update_lineno(331); /* LAPDm_RAW_PT.ttcn, line 331 */ TTCN_Logger::log_str(TTCN_USER, "Non-dynamic UL TBF assignment not supported yet"); current_location.update_lineno(332); /* LAPDm_RAW_PT.ttcn, line 332 */ return FALSE; } else { current_location.update_lineno(334); /* LAPDm_RAW_PT.ttcn, line 334 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Failed to match Uplink Block Allocation: "); pkt__ul__ass.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(335); /* LAPDm_RAW_PT.ttcn, line 335 */ return FALSE; } } } void start_f__establish__tbf(const COMPONENT& component_reference, const INTEGER& ra) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_establish_tbf("); ra.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, "LAPDm_RAW_PT", "f_establish_tbf", text_buf); ra.encode_text(text_buf); TTCN_Runtime::send_start_component(text_buf); } void f__release__tbf() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 339, TTCN_Location::LOCATION_FUNCTION, "f_release_tbf"); current_location.update_lineno(340); /* LAPDm_RAW_PT.ttcn, line 340 */ TfiUsfArr tua(f__TfiUsfArrInit()); current_location.update_lineno(345); /* LAPDm_RAW_PT.ttcn, line 345 */ set__ph__state(ph__state__enum::PH__STATE__BCH); } void start_f__release__tbf(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_release_tbf("); 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, "LAPDm_RAW_PT", "f_release_tbf", text_buf); TTCN_Runtime::send_start_component(text_buf); } alt_status as__tbf__ul__est_instance(boolean first_alt_run) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 349, TTCN_Location::LOCATION_ALTSTEP, "as_tbf_ul_est"); current_location.update_lineno(350); /* LAPDm_RAW_PT.ttcn, line 350 */ TBF__UL__establish__req tbf__ul__req; alt_status ret_val = ALT_NO; current_location.update_lineno(351); /* LAPDm_RAW_PT.ttcn, line 351 */ switch (lapdm__CT_component_LAPDM__SP.receive(TBF__UL__establish__req_template(ANY_VALUE), &(tbf__ul__req), any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(352); /* LAPDm_RAW_PT.ttcn, line 352 */ INTEGER tbf__nr(const_cast< const TBF__UL__establish__req&>(tbf__ul__req).tbf__nr()); current_location.update_lineno(353); /* LAPDm_RAW_PT.ttcn, line 353 */ TBF__UL__establish__res res; current_location.update_lineno(354); /* LAPDm_RAW_PT.ttcn, line 354 */ { boolean tmp_18; { boolean tmp_13 = lapdm__CT_component_g__tbf__ul.is_bound(); if(tmp_13) { const int tmp_14 = tbf__nr; tmp_13 = (tmp_14 >= 0) && (lapdm__CT_component_g__tbf__ul.size_of() > tmp_14); if(tmp_13) { const TbfPars& tmp_15 = lapdm__CT_component_g__tbf__ul[tmp_14]; tmp_13 = tmp_15.is_bound(); if(tmp_13) { const OPTIONAL< INTEGER >& tmp_16 = tmp_15.arfcn(); switch (tmp_16.get_selection()) { case OPTIONAL_UNBOUND: tmp_13 = FALSE; break; case OPTIONAL_OMIT: tmp_13 = FALSE; break; default: { const INTEGER& tmp_17 = (const INTEGER&) tmp_16; tmp_13 = tmp_17.is_value(); break;} } } } } tmp_18 = tmp_13; } if (tmp_18) { current_location.update_lineno(355); /* LAPDm_RAW_PT.ttcn, line 355 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Cannot establish UL TBF ID "),tbf__nr.log(),TTCN_Logger::log_event_str(": BUSY"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(356); /* LAPDm_RAW_PT.ttcn, line 356 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(358); /* LAPDm_RAW_PT.ttcn, line 358 */ f__establish__tbf(const_cast< const TBF__UL__establish__req&>(tbf__ul__req).ra()); current_location.update_lineno(359); /* LAPDm_RAW_PT.ttcn, line 359 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__TBF)) { current_location.update_lineno(360); /* LAPDm_RAW_PT.ttcn, line 360 */ lapdm__CT_component_g__tbf__ul[tbf__nr] = t__TbfParsInit.valueof(); current_location.update_lineno(361); /* LAPDm_RAW_PT.ttcn, line 361 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Established UL TBF "); tbf__nr.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(362); /* LAPDm_RAW_PT.ttcn, line 362 */ res.pars() = const_cast< const TbfParsPerTs&>(lapdm__CT_component_g__tbf__ul)[tbf__nr]; res.err() = OMIT_VALUE; } else { current_location.update_lineno(364); /* LAPDm_RAW_PT.ttcn, line 364 */ res.pars() = OMIT_VALUE; res.err() = cs_0; } current_location.update_lineno(366); /* LAPDm_RAW_PT.ttcn, line 366 */ lapdm__CT_component_LAPDM__SP.send(res, FALSE, NULL); } return ALT_YES; case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__tbf__ul__est(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__tbf__ul__est_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_tbf_ul_est."); else block_flag = TRUE; } } Default_Base *activate_as__tbf__ul__est() { return new as__tbf__ul__est_Default(); } alt_status as__tbf__dl__est_instance(boolean first_alt_run) { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 370, TTCN_Location::LOCATION_ALTSTEP, "as_tbf_dl_est"); current_location.update_lineno(371); /* LAPDm_RAW_PT.ttcn, line 371 */ TBF__DL__establish__req tbf__dl__req; alt_status ret_val = ALT_NO; current_location.update_lineno(372); /* LAPDm_RAW_PT.ttcn, line 372 */ switch (lapdm__CT_component_LAPDM__SP.receive(TBF__DL__establish__req_template(ANY_VALUE), &(tbf__dl__req), any_compref, NULL, NULL, NULL)) { case ALT_YES: { current_location.update_lineno(373); /* LAPDm_RAW_PT.ttcn, line 373 */ INTEGER tbf__nr(const_cast< const TBF__DL__establish__req&>(tbf__dl__req).tbf__nr()); current_location.update_lineno(374); /* LAPDm_RAW_PT.ttcn, line 374 */ { boolean tmp_27; { boolean tmp_22 = lapdm__CT_component_g__tbf__dl.is_bound(); if(tmp_22) { const int tmp_23 = tbf__nr; tmp_22 = (tmp_23 >= 0) && (lapdm__CT_component_g__tbf__dl.size_of() > tmp_23); if(tmp_22) { const TbfPars& tmp_24 = lapdm__CT_component_g__tbf__dl[tmp_23]; tmp_22 = tmp_24.is_bound(); if(tmp_22) { const OPTIONAL< INTEGER >& tmp_25 = tmp_24.arfcn(); switch (tmp_25.get_selection()) { case OPTIONAL_UNBOUND: tmp_22 = FALSE; break; case OPTIONAL_OMIT: tmp_22 = FALSE; break; default: { const INTEGER& tmp_26 = (const INTEGER&) tmp_25; tmp_22 = tmp_26.is_value(); break;} } } } } tmp_27 = tmp_22; } if (tmp_27) { current_location.update_lineno(375); /* LAPDm_RAW_PT.ttcn, line 375 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Cannot establish DL TBF ID "),tbf__nr.log(),TTCN_Logger::log_event_str(": BUSY"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(376); /* LAPDm_RAW_PT.ttcn, line 376 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } current_location.update_lineno(378); /* LAPDm_RAW_PT.ttcn, line 378 */ lapdm__CT_component_g__tbf__dl[tbf__nr] = const_cast< const TBF__DL__establish__req&>(tbf__dl__req).pars(); current_location.update_lineno(380); /* LAPDm_RAW_PT.ttcn, line 380 */ set__ph__state(ph__state__enum::PH__STATE__TBF); current_location.update_lineno(381); /* LAPDm_RAW_PT.ttcn, line 381 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("Established DL TBF "); tbf__nr.log(); TTCN_Logger::log_event_str(": "); const_cast< const TBF__DL__establish__req&>(tbf__dl__req).pars().log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } } return ALT_YES; case ALT_MAYBE: ret_val = ALT_MAYBE; default: break; } return ret_val; } void as__tbf__dl__est(boolean nodefault_modifier) { altstep_begin: boolean block_flag = FALSE; alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED; for ( ; ; ) { TTCN_Snapshot::take_new(block_flag); if (altstep_flag != ALT_NO) { altstep_flag = as__tbf__dl__est_instance(!block_flag); if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return; else if (altstep_flag == ALT_REPEAT) goto altstep_begin; } if (!nodefault_modifier && default_flag != ALT_NO) { default_flag = TTCN_Default::try_altsteps(!block_flag); if (default_flag == ALT_YES || default_flag == ALT_BREAK) return; else if (default_flag == ALT_REPEAT) goto altstep_begin; } if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_tbf_dl_est."); else block_flag = TRUE; } } Default_Base *activate_as__tbf__dl__est() { return new as__tbf__dl__est_Default(); } void f__init__tbf() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 385, TTCN_Location::LOCATION_FUNCTION, "f_init_tbf"); current_location.update_lineno(386); /* LAPDm_RAW_PT.ttcn, line 386 */ INTEGER i; current_location.update_lineno(387); /* LAPDm_RAW_PT.ttcn, line 387 */ i = 0; current_location.update_lineno(387); /* LAPDm_RAW_PT.ttcn, line 387 */ for ( ; ; ) { current_location.update_lineno(387); /* LAPDm_RAW_PT.ttcn, line 387 */ if (!(i < 8)) break; current_location.update_lineno(388); /* LAPDm_RAW_PT.ttcn, line 388 */ lapdm__CT_component_g__tbf__ul[i] = t__TbfParsInit.valueof(); current_location.update_lineno(389); /* LAPDm_RAW_PT.ttcn, line 389 */ lapdm__CT_component_g__tbf__dl[i] = t__TbfParsInit.valueof(); current_location.update_lineno(387); /* LAPDm_RAW_PT.ttcn, line 387 */ { INTEGER tmp_32; ++i; } } } void start_f__init__tbf(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_init_tbf("); 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, "LAPDm_RAW_PT", "f_init_tbf", text_buf); TTCN_Runtime::send_start_component(text_buf); } void ScanEvents() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 393, TTCN_Location::LOCATION_FUNCTION, "ScanEvents"); current_location.update_lineno(394); /* LAPDm_RAW_PT.ttcn, line 394 */ L1CTL__Types::L1ctlMessage dl; current_location.update_lineno(395); /* LAPDm_RAW_PT.ttcn, line 395 */ BCCH__tune__req bt; current_location.update_lineno(396); /* LAPDm_RAW_PT.ttcn, line 396 */ LAPDm__ph__data lpd; current_location.update_lineno(397); /* LAPDm_RAW_PT.ttcn, line 397 */ RLCMAC__ph__data__ind rpdi; current_location.update_lineno(398); /* LAPDm_RAW_PT.ttcn, line 398 */ RLCMAC__ph__data__req rpdr; current_location.update_lineno(399); /* LAPDm_RAW_PT.ttcn, line 399 */ DCCH__establish__req est__req; current_location.update_lineno(400); /* LAPDm_RAW_PT.ttcn, line 400 */ DCCH__switch__req sw__req; current_location.update_lineno(401); /* LAPDm_RAW_PT.ttcn, line 401 */ DCCH__establish__res est__res; current_location.update_lineno(403); /* LAPDm_RAW_PT.ttcn, line 403 */ f__init__tbf(); for ( ; ; ) { current_location.update_lineno(406); /* LAPDm_RAW_PT.ttcn, line 406 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__NULL)) { current_location.update_lineno(407); /* LAPDm_RAW_PT.ttcn, line 407 */ { tmp_33: alt_status tmp_33_alt_flag_0 = ALT_MAYBE; alt_status tmp_33_alt_flag_1 = ALT_MAYBE; alt_status tmp_33_alt_flag_2 = ALT_MAYBE; alt_status tmp_33_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_33_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(408); /* LAPDm_RAW_PT.ttcn, line 408 */ tmp_33_alt_flag_0 = lapdm__CT_component_LAPDM__SP.receive(BCCH__tune__req_template(ANY_VALUE), &(bt), any_compref, NULL, NULL, NULL); if (tmp_33_alt_flag_0 == ALT_YES) { current_location.update_lineno(409); /* LAPDm_RAW_PT.ttcn, line 409 */ f__tune__bcch(const_cast< const BCCH__tune__req&>(bt).arfcn(), const_cast< const BCCH__tune__req&>(bt).combined__ccch()); break; } } if (tmp_33_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(412); /* LAPDm_RAW_PT.ttcn, line 412 */ tmp_33_alt_flag_1 = lapdm__CT_component_LAPDM__SP.receive(any_compref, NULL, NULL, NULL); if (tmp_33_alt_flag_1 == ALT_YES) break; } if (tmp_33_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(413); /* LAPDm_RAW_PT.ttcn, line 413 */ tmp_33_alt_flag_2 = lapdm__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL); if (tmp_33_alt_flag_2 == ALT_YES) break; } if (tmp_33_default_flag == ALT_MAYBE) { tmp_33_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_33_default_flag == ALT_YES || tmp_33_default_flag == ALT_BREAK) break; else if (tmp_33_default_flag == ALT_REPEAT) goto tmp_33; } current_location.update_lineno(407); /* LAPDm_RAW_PT.ttcn, line 407 */ if (tmp_33_alt_flag_0 == ALT_NO && tmp_33_alt_flag_1 == ALT_NO && tmp_33_alt_flag_2 == ALT_NO && tmp_33_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file LAPDm_RAW_PT.ttcn between lines 407 and 415."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } else { current_location.update_lineno(416); /* LAPDm_RAW_PT.ttcn, line 416 */ boolean tmp_34; tmp_34 = (lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__BCH); if (!tmp_34) tmp_34 = (lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__SEARCHING__BCH); if (tmp_34) { current_location.update_lineno(417); /* LAPDm_RAW_PT.ttcn, line 417 */ { tmp_35: alt_status tmp_35_alt_flag_0 = ALT_MAYBE; alt_status tmp_35_alt_flag_1 = ALT_MAYBE; alt_status tmp_35_alt_flag_2 = ALT_MAYBE; alt_status tmp_35_alt_flag_3 = ALT_MAYBE; alt_status tmp_35_alt_flag_4 = ALT_MAYBE; alt_status tmp_35_alt_flag_5 = ALT_MAYBE; alt_status tmp_35_alt_flag_6 = ALT_MAYBE; alt_status tmp_35_alt_flag_7 = ALT_MAYBE; alt_status tmp_35_alt_flag_8 = ALT_MAYBE; alt_status tmp_35_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_35_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(418); /* LAPDm_RAW_PT.ttcn, line 418 */ tmp_35_alt_flag_0 = lapdm__CT_component_LAPDM__SP.receive(BCCH__tune__req_template(ANY_VALUE), &(bt), any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_0 == ALT_YES) { current_location.update_lineno(419); /* LAPDm_RAW_PT.ttcn, line 419 */ f__tune__bcch(const_cast< const BCCH__tune__req&>(bt).arfcn(), const_cast< const BCCH__tune__req&>(bt).combined__ccch()); break; } } if (tmp_35_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(423); /* LAPDm_RAW_PT.ttcn, line 423 */ tmp_35_alt_flag_1 = lapdm__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_1 == ALT_YES) { current_location.update_lineno(424); /* LAPDm_RAW_PT.ttcn, line 424 */ lpd.sacch() = FALSE; current_location.update_lineno(425); /* LAPDm_RAW_PT.ttcn, line 425 */ lpd.sapi() = 0; current_location.update_lineno(426); /* LAPDm_RAW_PT.ttcn, line 426 */ lpd.lapdm().bbis() = LAPDm__Types::dec__LapdmFrameBbis(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()); current_location.update_lineno(427); /* LAPDm_RAW_PT.ttcn, line 427 */ lapdm__CT_component_LAPDM__SP.send(lpd, FALSE, NULL); break; } } if (tmp_35_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(431); /* LAPDm_RAW_PT.ttcn, line 431 */ tmp_35_alt_flag_2 = lapdm__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_2 == ALT_YES) { current_location.update_lineno(432); /* LAPDm_RAW_PT.ttcn, line 432 */ lpd.sacch() = FALSE; current_location.update_lineno(433); /* LAPDm_RAW_PT.ttcn, line 433 */ lpd.sapi() = 0; current_location.update_lineno(434); /* LAPDm_RAW_PT.ttcn, line 434 */ lpd.lapdm().bbis() = LAPDm__Types::dec__LapdmFrameBbis(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()); current_location.update_lineno(435); /* LAPDm_RAW_PT.ttcn, line 435 */ lapdm__CT_component_LAPDM__SP.send(lpd, FALSE, NULL); break; } } if (tmp_35_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(439); /* LAPDm_RAW_PT.ttcn, line 439 */ tmp_35_alt_flag_3 = lapdm__CT_component_LAPDM__SP.receive(DCCH__establish__req_template(ANY_VALUE), &(est__req), any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_3 == ALT_YES) { current_location.update_lineno(440); /* LAPDm_RAW_PT.ttcn, line 440 */ DCCH__establish__res res; current_location.update_lineno(441); /* LAPDm_RAW_PT.ttcn, line 441 */ f__establish__dcch(const_cast< const DCCH__establish__req&>(est__req).ra()); current_location.update_lineno(442); /* LAPDm_RAW_PT.ttcn, line 442 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__DCH)) { current_location.update_lineno(443); /* LAPDm_RAW_PT.ttcn, line 443 */ res.chan__desc() = lapdm__CT_component_chan__desc; res.err() = OMIT_VALUE; } else { current_location.update_lineno(445); /* LAPDm_RAW_PT.ttcn, line 445 */ res.chan__desc() = OMIT_VALUE; res.err() = cs_1; } current_location.update_lineno(447); /* LAPDm_RAW_PT.ttcn, line 447 */ lapdm__CT_component_LAPDM__SP.send(res, FALSE, NULL); break; } } if (tmp_35_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(449); /* LAPDm_RAW_PT.ttcn, line 449 */ tmp_35_alt_flag_4 = lapdm__CT_component_LAPDM__SP.receive(DCCH__switch__req_template(ANY_VALUE), &(sw__req), any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_4 == ALT_YES) { current_location.update_lineno(450); /* LAPDm_RAW_PT.ttcn, line 450 */ DCCH__switch__res res; current_location.update_lineno(451); /* LAPDm_RAW_PT.ttcn, line 451 */ f__switch__dcch(sw__req); current_location.update_lineno(452); /* LAPDm_RAW_PT.ttcn, line 452 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__DCH)) { current_location.update_lineno(453); /* LAPDm_RAW_PT.ttcn, line 453 */ res.err() = OMIT_VALUE; } else { current_location.update_lineno(455); /* LAPDm_RAW_PT.ttcn, line 455 */ res.err() = cs_2; } current_location.update_lineno(457); /* LAPDm_RAW_PT.ttcn, line 457 */ lapdm__CT_component_LAPDM__SP.send(res, FALSE, NULL); break; } } if (tmp_35_alt_flag_5 == ALT_MAYBE) { current_location.update_lineno(461); /* LAPDm_RAW_PT.ttcn, line 461 */ tmp_35_alt_flag_5 = as__tbf__ul__est_instance(first_run); if (tmp_35_alt_flag_5 == ALT_REPEAT) goto tmp_35; if (tmp_35_alt_flag_5 == ALT_BREAK) break; if (tmp_35_alt_flag_5 == ALT_YES) break; } if (tmp_35_alt_flag_6 == ALT_MAYBE) { current_location.update_lineno(462); /* LAPDm_RAW_PT.ttcn, line 462 */ tmp_35_alt_flag_6 = as__tbf__dl__est_instance(first_run); if (tmp_35_alt_flag_6 == ALT_REPEAT) goto tmp_35; if (tmp_35_alt_flag_6 == ALT_BREAK) break; if (tmp_35_alt_flag_6 == ALT_YES) break; } if (tmp_35_alt_flag_7 == ALT_MAYBE) { current_location.update_lineno(464); /* LAPDm_RAW_PT.ttcn, line 464 */ tmp_35_alt_flag_7 = lapdm__CT_component_LAPDM__SP.receive(any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_7 == ALT_YES) break; } if (tmp_35_alt_flag_8 == ALT_MAYBE) { current_location.update_lineno(465); /* LAPDm_RAW_PT.ttcn, line 465 */ tmp_35_alt_flag_8 = lapdm__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL); if (tmp_35_alt_flag_8 == ALT_YES) break; } if (tmp_35_default_flag == ALT_MAYBE) { tmp_35_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_35_default_flag == ALT_YES || tmp_35_default_flag == ALT_BREAK) break; else if (tmp_35_default_flag == ALT_REPEAT) goto tmp_35; } current_location.update_lineno(417); /* LAPDm_RAW_PT.ttcn, line 417 */ if (tmp_35_alt_flag_0 == ALT_NO && tmp_35_alt_flag_1 == ALT_NO && tmp_35_alt_flag_2 == ALT_NO && tmp_35_alt_flag_3 == ALT_NO && tmp_35_alt_flag_4 == ALT_NO && tmp_35_alt_flag_5 == ALT_NO && tmp_35_alt_flag_6 == ALT_NO && tmp_35_alt_flag_7 == ALT_NO && tmp_35_alt_flag_8 == ALT_NO && tmp_35_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file LAPDm_RAW_PT.ttcn between lines 417 and 467."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } else { current_location.update_lineno(469); /* LAPDm_RAW_PT.ttcn, line 469 */ boolean tmp_46; tmp_46 = (lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__TUNING__DCH); if (!tmp_46) tmp_46 = (lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__DCH); if (tmp_46) { current_location.update_lineno(470); /* LAPDm_RAW_PT.ttcn, line 470 */ { tmp_47: alt_status tmp_47_alt_flag_0 = ALT_MAYBE; alt_status tmp_47_alt_flag_1 = ALT_MAYBE; alt_status tmp_47_alt_flag_2 = ALT_MAYBE; alt_status tmp_47_alt_flag_3 = ALT_MAYBE; alt_status tmp_47_alt_flag_4 = ALT_MAYBE; alt_status tmp_47_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_47_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(473); /* LAPDm_RAW_PT.ttcn, line 473 */ tmp_47_alt_flag_0 = lapdm__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr()), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_0 == ALT_YES) { current_location.update_lineno(474); /* LAPDm_RAW_PT.ttcn, line 474 */ OCTETSTRING l2; current_location.update_lineno(475); /* LAPDm_RAW_PT.ttcn, line 475 */ if ((const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().link__id().c() == GSM__Types::RslLinkIdC::SACCH)) { current_location.update_lineno(476); /* LAPDm_RAW_PT.ttcn, line 476 */ lpd.sacch() = TRUE; current_location.update_lineno(477); /* LAPDm_RAW_PT.ttcn, line 477 */ OCTETSTRING l1(substr(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload(), 0, 2)); current_location.update_lineno(478); /* LAPDm_RAW_PT.ttcn, line 478 */ l2 = substr(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload(), 2, (const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload().lengthof() - 2)); current_location.update_lineno(480); /* LAPDm_RAW_PT.ttcn, line 480 */ lapdm__CT_component_ms__power__lvl = oct2int((const_cast< const OCTETSTRING&>(l1)[0] & os_0)); current_location.update_lineno(481); /* LAPDm_RAW_PT.ttcn, line 481 */ lapdm__CT_component_timing__adv = oct2int(const_cast< const OCTETSTRING&>(l1)[1]); } else { current_location.update_lineno(484); /* LAPDm_RAW_PT.ttcn, line 484 */ lpd.sacch() = FALSE; current_location.update_lineno(485); /* LAPDm_RAW_PT.ttcn, line 485 */ l2 = const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload(); } current_location.update_lineno(487); /* LAPDm_RAW_PT.ttcn, line 487 */ lpd.sapi() = const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().link__id().sapi(); current_location.update_lineno(488); /* LAPDm_RAW_PT.ttcn, line 488 */ lpd.lapdm().ab() = LAPDm__Types::dec__LapdmFrameAB(l2); current_location.update_lineno(489); /* LAPDm_RAW_PT.ttcn, line 489 */ lapdm__CT_component_LAPDM__SP.send(lpd, FALSE, NULL); break; } } if (tmp_47_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(493); /* LAPDm_RAW_PT.ttcn, line 493 */ tmp_47_alt_flag_1 = lapdm__CT_component_LAPDM__SP.receive(LAPDm__ph__data_template(ANY_VALUE), &(lpd), any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_1 == ALT_YES) { current_location.update_lineno(494); /* LAPDm_RAW_PT.ttcn, line 494 */ OCTETSTRING buf; current_location.update_lineno(495); /* LAPDm_RAW_PT.ttcn, line 495 */ GSM__Types::RslLinkId link__id; current_location.update_lineno(496); /* LAPDm_RAW_PT.ttcn, line 496 */ if (const_cast< const LAPDm__ph__data&>(lpd).sacch()) { current_location.update_lineno(497); /* LAPDm_RAW_PT.ttcn, line 497 */ link__id = GSM__Types::ts__RslLinkID__SACCH(const_cast< const LAPDm__ph__data&>(lpd).sapi()).valueof(); current_location.update_lineno(498); /* LAPDm_RAW_PT.ttcn, line 498 */ buf = Osmocom__Types::f__pad__oct(LAPDm__Types::enc__LapdmFrame(const_cast< const LAPDm__ph__data&>(lpd).lapdm()), 21, os_1); current_location.update_lineno(499); /* LAPDm_RAW_PT.ttcn, line 499 */ GSM__RR__Types::SacchL1Header l1h(GSM__RR__Types::ts__SacchL1Header(lapdm__CT_component_ms__power__lvl, lapdm__CT_component_timing__adv, GSM__RR__Types::ts__SacchL1Header_fpc_defval).valueof()); current_location.update_lineno(501); /* LAPDm_RAW_PT.ttcn, line 501 */ lapdm__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ__SACCH(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr()), GSM__Types::RslLinkId_template(link__id), GSM__RR__Types::SacchL1Header_template(l1h), buf), FALSE, NULL); } else { current_location.update_lineno(504); /* LAPDm_RAW_PT.ttcn, line 504 */ link__id = GSM__Types::ts__RslLinkID__DCCH(const_cast< const LAPDm__ph__data&>(lpd).sapi()).valueof(); current_location.update_lineno(505); /* LAPDm_RAW_PT.ttcn, line 505 */ buf = Osmocom__Types::f__pad__oct(LAPDm__Types::enc__LapdmFrame(const_cast< const LAPDm__ph__data&>(lpd).lapdm()), 23, os_1); current_location.update_lineno(506); /* LAPDm_RAW_PT.ttcn, line 506 */ lapdm__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ(GSM__Types::RslChannelNr_template(const_cast< const GSM__RR__Types::ChannelDescription&>(lapdm__CT_component_chan__desc).chan__nr()), GSM__Types::RslLinkId_template(link__id), buf), FALSE, NULL); } break; } } if (tmp_47_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(511); /* LAPDm_RAW_PT.ttcn, line 511 */ tmp_47_alt_flag_2 = lapdm__CT_component_LAPDM__SP.receive(DCCH__release__req_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_2 == ALT_YES) { current_location.update_lineno(513); /* LAPDm_RAW_PT.ttcn, line 513 */ f__release__dcch(); break; } } if (tmp_47_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(516); /* LAPDm_RAW_PT.ttcn, line 516 */ tmp_47_alt_flag_3 = lapdm__CT_component_LAPDM__SP.receive(any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_3 == ALT_YES) break; } if (tmp_47_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(517); /* LAPDm_RAW_PT.ttcn, line 517 */ tmp_47_alt_flag_4 = lapdm__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL); if (tmp_47_alt_flag_4 == ALT_YES) break; } if (tmp_47_default_flag == ALT_MAYBE) { tmp_47_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_47_default_flag == ALT_YES || tmp_47_default_flag == ALT_BREAK) break; else if (tmp_47_default_flag == ALT_REPEAT) goto tmp_47; } current_location.update_lineno(470); /* LAPDm_RAW_PT.ttcn, line 470 */ if (tmp_47_alt_flag_0 == ALT_NO && tmp_47_alt_flag_1 == ALT_NO && tmp_47_alt_flag_2 == ALT_NO && tmp_47_alt_flag_3 == ALT_NO && tmp_47_alt_flag_4 == ALT_NO && tmp_47_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file LAPDm_RAW_PT.ttcn between lines 470 and 520."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } else { current_location.update_lineno(521); /* LAPDm_RAW_PT.ttcn, line 521 */ if ((lapdm__CT_component_ph__state == ph__state__enum::PH__STATE__TBF)) { current_location.update_lineno(522); /* LAPDm_RAW_PT.ttcn, line 522 */ { tmp_60: alt_status tmp_60_alt_flag_0 = ALT_MAYBE; alt_status tmp_60_alt_flag_1 = ALT_MAYBE; alt_status tmp_60_alt_flag_2 = ALT_MAYBE; alt_status tmp_60_alt_flag_3 = ALT_MAYBE; alt_status tmp_60_alt_flag_4 = ALT_MAYBE; alt_status tmp_60_alt_flag_5 = ALT_MAYBE; alt_status tmp_60_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_60_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(525); /* LAPDm_RAW_PT.ttcn, line 525 */ tmp_60_alt_flag_0 = lapdm__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PDCH(INTEGER_template(ANY_VALUE)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL); if (tmp_60_alt_flag_0 == ALT_YES) { current_location.update_lineno(526); /* LAPDm_RAW_PT.ttcn, line 526 */ rpdi.block() = RLCMAC__Types::dec__RlcmacDlBlock(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()); current_location.update_lineno(528); /* LAPDm_RAW_PT.ttcn, line 528 */ rpdi.fn() = const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr(); current_location.update_lineno(529); /* LAPDm_RAW_PT.ttcn, line 529 */ rpdi.ts__nr() = const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().chan__nr().tn(); current_location.update_lineno(530); /* LAPDm_RAW_PT.ttcn, line 530 */ rpdi.cs() = GSM__Types::GprsCodingScheme::CS1; current_location.update_lineno(531); /* LAPDm_RAW_PT.ttcn, line 531 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("RPDI: "); rpdi.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(532); /* LAPDm_RAW_PT.ttcn, line 532 */ lapdm__CT_component_LAPDM__SP.send(rpdi, FALSE, NULL); break; } } if (tmp_60_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(535); /* LAPDm_RAW_PT.ttcn, line 535 */ tmp_60_alt_flag_1 = lapdm__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL); if (tmp_60_alt_flag_1 == ALT_YES) break; } if (tmp_60_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(538); /* LAPDm_RAW_PT.ttcn, line 538 */ tmp_60_alt_flag_2 = lapdm__CT_component_LAPDM__SP.receive(RLCMAC__ph__data__req_template(ANY_VALUE), &(rpdr), any_compref, NULL, NULL, NULL); if (tmp_60_alt_flag_2 == ALT_YES) { current_location.update_lineno(539); /* LAPDm_RAW_PT.ttcn, line 539 */ OCTETSTRING buf; current_location.update_lineno(540); /* LAPDm_RAW_PT.ttcn, line 540 */ if (rpdr.ischosen(RLCMAC__ph__data__req::ALT_dyn)) { current_location.update_lineno(541); /* LAPDm_RAW_PT.ttcn, line 541 */ buf = RLCMAC__Types::enc__RlcmacUlBlock(const_cast< const RLCMAC__ph__data__req&>(rpdr).dyn().block()); } else { current_location.update_lineno(544); /* LAPDm_RAW_PT.ttcn, line 544 */ buf = RLCMAC__Types::enc__RlcmacUlBlock(const_cast< const RLCMAC__ph__data__req&>(rpdr).abs().block()); } break; } } if (tmp_60_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(551); /* LAPDm_RAW_PT.ttcn, line 551 */ tmp_60_alt_flag_3 = as__tbf__ul__est_instance(first_run); if (tmp_60_alt_flag_3 == ALT_REPEAT) goto tmp_60; if (tmp_60_alt_flag_3 == ALT_BREAK) break; if (tmp_60_alt_flag_3 == ALT_YES) break; } if (tmp_60_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(552); /* LAPDm_RAW_PT.ttcn, line 552 */ tmp_60_alt_flag_4 = as__tbf__dl__est_instance(first_run); if (tmp_60_alt_flag_4 == ALT_REPEAT) goto tmp_60; if (tmp_60_alt_flag_4 == ALT_BREAK) break; if (tmp_60_alt_flag_4 == ALT_YES) break; } if (tmp_60_alt_flag_5 == ALT_MAYBE) { current_location.update_lineno(555); /* LAPDm_RAW_PT.ttcn, line 555 */ tmp_60_alt_flag_5 = lapdm__CT_component_LAPDM__SP.receive(DCCH__release__req_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL); if (tmp_60_alt_flag_5 == ALT_YES) { current_location.update_lineno(557); /* LAPDm_RAW_PT.ttcn, line 557 */ f__release__tbf(); current_location.update_lineno(558); /* LAPDm_RAW_PT.ttcn, line 558 */ f__init__tbf(); break; } } if (tmp_60_default_flag == ALT_MAYBE) { tmp_60_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_60_default_flag == ALT_YES || tmp_60_default_flag == ALT_BREAK) break; else if (tmp_60_default_flag == ALT_REPEAT) goto tmp_60; } current_location.update_lineno(522); /* LAPDm_RAW_PT.ttcn, line 522 */ if (tmp_60_alt_flag_0 == ALT_NO && tmp_60_alt_flag_1 == ALT_NO && tmp_60_alt_flag_2 == ALT_NO && tmp_60_alt_flag_3 == ALT_NO && tmp_60_alt_flag_4 == ALT_NO && tmp_60_alt_flag_5 == ALT_NO && tmp_60_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file LAPDm_RAW_PT.ttcn between lines 522 and 561."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } } } } } } void start_ScanEvents(const COMPONENT& component_reference) { TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function ScanEvents("); 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, "LAPDm_RAW_PT", "ScanEvents", text_buf); TTCN_Runtime::send_start_component(text_buf); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "LAPDm_RAW_PT"); L1CTL__PortType::module_object.pre_init_module(); LAPDm__Types::module_object.pre_init_module(); RLCMAC__Types::module_object.pre_init_module(); module_object.add_function("LAPDmStart", (genericfunc_t)&LAPDmStart, (genericfunc_t)&start_LAPDmStart); module_object.add_function("set_ph_state", (genericfunc_t)&set__ph__state, (genericfunc_t)&start_set__ph__state); module_object.add_function("f_init", (genericfunc_t)&f__init, (genericfunc_t)&start_f__init); module_object.add_function("f_release_dcch", (genericfunc_t)&f__release__dcch, (genericfunc_t)&start_f__release__dcch); module_object.add_function("f_tune_bcch", (genericfunc_t)&f__tune__bcch, (genericfunc_t)&start_f__tune__bcch); module_object.add_function("f_establish_dcch", (genericfunc_t)&f__establish__dcch, (genericfunc_t)&start_f__establish__dcch); module_object.add_function("f_switch_dcch", (genericfunc_t)&f__switch__dcch, (genericfunc_t)&start_f__switch__dcch); module_object.add_function("f_TfiUsfArrInit", (genericfunc_t)&f__TfiUsfArrInit, NULL); module_object.add_function("f_TfiUsfArrSet", (genericfunc_t)&f__TfiUsfArrSet, NULL); module_object.add_function("f_establish_tbf", (genericfunc_t)&f__establish__tbf, (genericfunc_t)&start_f__establish__tbf); module_object.add_function("f_release_tbf", (genericfunc_t)&f__release__tbf, (genericfunc_t)&start_f__release__tbf); module_object.add_altstep("as_tbf_ul_est", (genericfunc_t)&as__tbf__ul__est_instance, (genericfunc_t )&activate_as__tbf__ul__est, (genericfunc_t )&as__tbf__ul__est); module_object.add_altstep("as_tbf_dl_est", (genericfunc_t)&as__tbf__dl__est_instance, (genericfunc_t )&activate_as__tbf__dl__est, (genericfunc_t )&as__tbf__dl__est); module_object.add_function("f_init_tbf", (genericfunc_t)&f__init__tbf, (genericfunc_t)&start_f__init__tbf); module_object.add_function("ScanEvents", (genericfunc_t)&ScanEvents, (genericfunc_t)&start_ScanEvents); } void post_init_module() { TTCN_Location current_location("LAPDm_RAW_PT.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "LAPDm_RAW_PT"); L1CTL__PortType::module_object.post_init_module(); LAPDm__Types::module_object.post_init_module(); RLCMAC__Types::module_object.post_init_module(); current_location.update_lineno(60); /* LAPDm_RAW_PT.ttcn, line 60 */ template_t__TbfParsInit.arfcn() = OMIT_VALUE; { TfiList_template& tmp_0 = template_t__TbfParsInit.tfi(); tmp_0.set_size(8); tmp_0[0] = 255; tmp_0[1] = 255; tmp_0[2] = 255; tmp_0[3] = 255; tmp_0[4] = 255; tmp_0[5] = 255; tmp_0[6] = 255; tmp_0[7] = 255; } } boolean init_comp_type(const char *component_type, boolean init_base_comps) { (void)init_base_comps; if (!strcmp(component_type, "lapdm_CT")) { lapdm__CT_component_L1CTL.activate_port(); lapdm__CT_component_LAPDM__SP.activate_port(); lapdm__CT_component_ph__state = ph__state__enum::PH__STATE__NULL; lapdm__CT_component_chan__desc.clean_up(); lapdm__CT_component_ms__power__lvl = 0; lapdm__CT_component_timing__adv = 0; lapdm__CT_component_g__tbf__ul.clean_up(); lapdm__CT_component_g__tbf__dl.clean_up(); return TRUE; } else return FALSE; } boolean init_system_port(const char* component_type, const char* port_name) { if (!strcmp(component_type, "lapdm_CT")) { if (!strcmp(port_name, "L1CTL")) { lapdm__CT_component_L1CTL.safe_start(); return TRUE; } if (!strcmp(port_name, "LAPDM_SP")) { lapdm__CT_component_LAPDM__SP.safe_start(); return TRUE; } } return FALSE; } boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments) { if (!strcmp(function_name, "LAPDmStart")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function LAPDmStart()."); TTCN_Runtime::function_started(function_arguments); LAPDmStart(); TTCN_Runtime::function_finished("LAPDmStart"); return TRUE; } else if (!strcmp(function_name, "set_ph_state")) { ph__state__enum new__state; new__state.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function set_ph_state("); new__state.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); set__ph__state(new__state); TTCN_Runtime::function_finished("set_ph_state"); return TRUE; } else if (!strcmp(function_name, "f_init")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_init()."); TTCN_Runtime::function_started(function_arguments); f__init(); TTCN_Runtime::function_finished("f_init"); return TRUE; } else if (!strcmp(function_name, "f_release_dcch")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_release_dcch()."); TTCN_Runtime::function_started(function_arguments); f__release__dcch(); TTCN_Runtime::function_finished("f_release_dcch"); return TRUE; } else if (!strcmp(function_name, "f_tune_bcch")) { GSM__Types::GsmBandArfcn arfcn; BOOLEAN combined; arfcn.decode_text(function_arguments); combined.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_tune_bcch("); arfcn.log(); TTCN_Logger::log_event_str(", "); combined.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__tune__bcch(arfcn, combined); TTCN_Runtime::function_finished("f_tune_bcch"); return TRUE; } else if (!strcmp(function_name, "f_establish_dcch")) { INTEGER ra; ra.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_establish_dcch("); ra.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__establish__dcch(ra); TTCN_Runtime::function_finished("f_establish_dcch"); return TRUE; } else if (!strcmp(function_name, "f_switch_dcch")) { DCCH__switch__req sw__req; sw__req.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_switch_dcch("); sw__req.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__switch__dcch(sw__req); TTCN_Runtime::function_finished("f_switch_dcch"); return TRUE; } else if (!strcmp(function_name, "f_establish_tbf")) { INTEGER ra; ra.decode_text(function_arguments); TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC); TTCN_Logger::log_event_str("Starting function f_establish_tbf("); ra.log(); TTCN_Logger::log_event_str(")."); TTCN_Logger::end_event(); TTCN_Runtime::function_started(function_arguments); f__establish__tbf(ra); TTCN_Runtime::function_finished("f_establish_tbf"); return TRUE; } else if (!strcmp(function_name, "f_release_tbf")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_release_tbf()."); TTCN_Runtime::function_started(function_arguments); f__release__tbf(); TTCN_Runtime::function_finished("f_release_tbf"); return TRUE; } else if (!strcmp(function_name, "f_init_tbf")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_init_tbf()."); TTCN_Runtime::function_started(function_arguments); f__init__tbf(); TTCN_Runtime::function_finished("f_init_tbf"); return TRUE; } else if (!strcmp(function_name, "ScanEvents")) { TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function ScanEvents()."); TTCN_Runtime::function_started(function_arguments); ScanEvents(); TTCN_Runtime::function_finished("ScanEvents"); return TRUE; } else return FALSE; } } /* end of namespace */