// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 9.0.0 // for (build@3978f7fbee0c) on Mon Jun 24 02:37:33 2024 // Copyright (c) 2000-2023 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "Osmocom_VTY_Functions.hh" namespace Osmocom__VTY__Functions { /* Literal string constants */ extern const CHARSTRING cs_6(0, NULL), cs_24(' '), cs_2(2, "# "), cs_3(3, "(*)"), cs_5(3, "(\?)"), cs_4(19, "*% Unknown command."), cs_25('.'), cs_1(2, "> "), cs_32(6, "Mapped"), cs_0(7, "OpenBSC"), cs_22(26, "Osmocom_VTY_Functions.ttcn"), cs_12(31, "VTY Telnet Connection Failure: "), cs_13(24, "VTY Timeout for prompt: "), cs_11(32, "VTY: Unknown Command (ignored): "), cs_10(22, "VTY: Unknown Command: "), cs_7(8, "[\\w-]+> "), cs_8(9, "[\\w-]+\\# "), cs_9(14, "[\\w-]+\\(*\\)\\# "), cs_26(2, "\\<"), cs_27(2, "\\>"), cs_28(2, "\\|"), cs_16(4, "bts "), cs_31(5, "bytes"), cs_14(18, "configure terminal"), cs_20(13, "cs7 instance "), cs_21(3, "end"), cs_33(36, "logp lglobal notice TTCN3 f_logp(): "), cs_19(4, "msc "), cs_15(7, "network"), cs_30(37, "show talloc-context application brief"), cs_23(44, "show talloc-context application full filter "), cs_29(21, "talloc count mismatch"), cs_18(9, "timeslot "), cs_17(4, "trx "); const unsigned char module_checksum[] = { 0xac, 0x17, 0x0e, 0xae, 0x4b, 0xa7, 0x07, 0xf2, 0x55, 0xaa, 0x91, 0x85, 0xa0, 0x23, 0x96, 0x5e }; /* Global variable definitions */ CHARSTRING modulepar_mp__prompt__prefix; const CHARSTRING& mp__prompt__prefix = modulepar_mp__prompt__prefix; FLOAT modulepar_mp__prompt__timeout; const FLOAT& mp__prompt__timeout = modulepar_mp__prompt__timeout; CHARSTRING const_VTY__VIEW__SUFFIX; const CHARSTRING& VTY__VIEW__SUFFIX = const_VTY__VIEW__SUFFIX; CHARSTRING const_VTY__ENABLE__SUFFIX; const CHARSTRING& VTY__ENABLE__SUFFIX = const_VTY__ENABLE__SUFFIX; CHARSTRING const_VTY__CFG__SUFFIX; const CHARSTRING& VTY__CFG__SUFFIX = const_VTY__CFG__SUFFIX; CHARSTRING_template template_t__vty__unknown; const CHARSTRING_template& t__vty__unknown = template_t__vty__unknown; CHARSTRING const_f__vty__set__prompts_prompt__prefix_defval; const CHARSTRING& f__vty__set__prompts_prompt__prefix_defval = const_f__vty__set__prompts_prompt__prefix_defval; BOOLEAN const_f__vty__wait__for__prompt_strict_defval; const BOOLEAN& f__vty__wait__for__prompt_strict_defval = const_f__vty__wait__for__prompt_strict_defval; CHARSTRING const_f__vty__wait__for__prompt_log__label_defval; const CHARSTRING& f__vty__wait__for__prompt_log__label_defval = const_f__vty__wait__for__prompt_log__label_defval; BOOLEAN const_f__vty__transceive__ret_strict_defval; const BOOLEAN& f__vty__transceive__ret_strict_defval = const_f__vty__transceive__ret_strict_defval; BOOLEAN const_f__vty__transceive_strict_defval; const BOOLEAN& f__vty__transceive_strict_defval = const_f__vty__transceive_strict_defval; const XERdescriptor_t BtsNr_xer_ = { {"BtsNr>\n", "BtsNr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t BtsNr_descr_ = { "@Osmocom_VTY_Functions.BtsNr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &BtsNr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t BtsTrxNr_xer_ = { {"BtsTrxNr>\n", "BtsTrxNr>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t BtsTrxNr_descr_ = { "@Osmocom_VTY_Functions.BtsTrxNr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &BtsTrxNr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t BtsTimeslotNr_xer_ = { {"BtsTimeslotNr>\n", "BtsTimeslotNr>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t BtsTimeslotNr_descr_ = { "@Osmocom_VTY_Functions.BtsTimeslotNr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &BtsTimeslotNr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t MscNr_xer_ = { {"MscNr>\n", "MscNr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t MscNr_descr_ = { "@Osmocom_VTY_Functions.MscNr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MscNr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t Cs7Nr_xer_ = { {"Cs7Nr>\n", "Cs7Nr>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t Cs7Nr_descr_ = { "@Osmocom_VTY_Functions.Cs7Nr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Cs7Nr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t BtsGprsMode_xer_ = { {"BtsGprsMode>\n", "BtsGprsMode>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t BtsGprsMode_descr_ = { "@Osmocom_VTY_Functions.BtsGprsMode", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &BtsGprsMode_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; INTEGER const_f__vty__enter__cfg__bts_bts_defval; const INTEGER& f__vty__enter__cfg__bts_bts_defval = const_f__vty__enter__cfg__bts_bts_defval; INTEGER const_f__vty__enter__cfg__trx_bts_defval; const INTEGER& f__vty__enter__cfg__trx_bts_defval = const_f__vty__enter__cfg__trx_bts_defval; INTEGER const_f__vty__enter__cfg__trx_trx_defval; const INTEGER& f__vty__enter__cfg__trx_trx_defval = const_f__vty__enter__cfg__trx_trx_defval; INTEGER const_f__vty__enter__cfg__ts_bts_defval; const INTEGER& f__vty__enter__cfg__ts_bts_defval = const_f__vty__enter__cfg__ts_bts_defval; INTEGER const_f__vty__enter__cfg__ts_trx_defval; const INTEGER& f__vty__enter__cfg__ts_trx_defval = const_f__vty__enter__cfg__ts_trx_defval; INTEGER const_f__vty__enter__cfg__msc_msc_defval; const INTEGER& f__vty__enter__cfg__msc_msc_defval = const_f__vty__enter__cfg__msc_msc_defval; INTEGER const_f__vty__enter__cfg__cs7__inst_cs7__inst_defval; const INTEGER& f__vty__enter__cfg__cs7__inst_cs7__inst_defval = const_f__vty__enter__cfg__cs7__inst_cs7__inst_defval; // No XER for rof__charstring const TTCN_Typedescriptor_t rof__charstring_descr_ = { "@Osmocom_VTY_Functions.rof_charstring", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &CHARSTRING_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t rof__charstring_0_xer_ = { {"CHARSTRING>\n", "CHARSTRING>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t rof__charstring_0_descr_ = { "@Osmocom_VTY_Functions.rof_charstring.", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &rof__charstring_0_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; INTEGER const_f__vty__cfg__bts_bts_defval; const INTEGER& f__vty__cfg__bts_bts_defval = const_f__vty__cfg__bts_bts_defval; INTEGER const_f__vty__cfg__msc_msc_defval; const INTEGER& f__vty__cfg__msc_msc_defval = const_f__vty__cfg__msc_msc_defval; // No XER for StrList const TTCN_Typedescriptor_t StrList_descr_ = { "@Osmocom_VTY_Functions.StrList", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &CHARSTRING_descr_, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t StrList_0_xer_ = { {"CHARSTRING>\n", "CHARSTRING>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t StrList_0_descr_ = { "@Osmocom_VTY_Functions.StrList.", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &StrList_0_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; INTEGER const_f__verify__talloc__count_expect__count_defval; const INTEGER& f__verify__talloc__count_expect__count_defval = const_f__verify__talloc__count_expect__count_defval; INTEGER const_f__verify__talloc__count_attempts_defval; const INTEGER& f__verify__talloc__count_attempts_defval = const_f__verify__talloc__count_attempts_defval; FLOAT const_f__verify__talloc__count_wait__time_defval; const FLOAT& f__verify__talloc__count_wait__time_defval = const_f__verify__talloc__count_wait__time_defval; INTEGER const_f__verify__talloc__bytes_expect__bytes_defval; const INTEGER& f__verify__talloc__bytes_expect__bytes_defval = const_f__verify__talloc__bytes_expect__bytes_defval; INTEGER const_f__verify__talloc__bytes_attempts_defval; const INTEGER& f__verify__talloc__bytes_attempts_defval = const_f__verify__talloc__bytes_attempts_defval; FLOAT const_f__verify__talloc__bytes_wait__time_defval; const FLOAT& f__verify__talloc__bytes_wait__time_defval = const_f__verify__talloc__bytes_wait__time_defval; TTCN_Module module_object("Osmocom_VTY_Functions", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, NULL, NULL, NULL, NULL); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_9, current_runtime_version.requires_minor_version_0, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Bodies of functions, altsteps and testcases */ void f__vty__set__prompts(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& prompt__prefix) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 32, TTCN_Location::LOCATION_FUNCTION, "f_vty_set_prompts"); current_location.update_lineno(33); /* Osmocom_VTY_Functions.ttcn, line 33 */ VALUE_ARRAY vty__prompt; { TELNETasp__PortType::TelnetPrompt& tmp_0 = vty__prompt[0].prompt(); tmp_0.id() = 1; tmp_0.prompt() = (prompt__prefix + cs_1); tmp_0.has__wildcards() = FALSE; } { TELNETasp__PortType::TelnetPrompt& tmp_1 = vty__prompt[1].prompt(); tmp_1.id() = 2; tmp_1.prompt() = (prompt__prefix + cs_2); tmp_1.has__wildcards() = FALSE; } { TELNETasp__PortType::TelnetPrompt& tmp_2 = vty__prompt[2].prompt(); tmp_2.id() = 3; tmp_2.prompt() = (prompt__prefix + cs_3); tmp_2.has__wildcards() = TRUE; } { current_location.update_lineno(58); /* Osmocom_VTY_Functions.ttcn, line 58 */ INTEGER i(0); current_location.update_lineno(58); /* Osmocom_VTY_Functions.ttcn, line 58 */ for ( ; ; ) { current_location.update_lineno(58); /* Osmocom_VTY_Functions.ttcn, line 58 */ if (!(i < 3)) break; current_location.update_lineno(59); /* Osmocom_VTY_Functions.ttcn, line 59 */ pt.send(const_cast< const VALUE_ARRAY&>(vty__prompt)[i], NULL); current_location.update_lineno(58); /* Osmocom_VTY_Functions.ttcn, line 58 */ { INTEGER tmp_3; ++i; } } } } CHARSTRING f__vty__wait__for__prompt(TELNETasp__PortType::TELNETasp__PT& pt, const BOOLEAN& strict, const CHARSTRING& log__label) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 64, TTCN_Location::LOCATION_FUNCTION, "f_vty_wait_for_prompt"); current_location.update_lineno(66); /* Osmocom_VTY_Functions.ttcn, line 66 */ CHARSTRING rx; current_location.update_lineno(66); /* Osmocom_VTY_Functions.ttcn, line 66 */ CHARSTRING buf(cs_6); current_location.update_lineno(67); /* Osmocom_VTY_Functions.ttcn, line 67 */ INTEGER fd; current_location.update_lineno(68); /* Osmocom_VTY_Functions.ttcn, line 68 */ TIMER T("T"); current_location.update_lineno(70); /* Osmocom_VTY_Functions.ttcn, line 70 */ T.start(mp__prompt__timeout); current_location.update_lineno(71); /* Osmocom_VTY_Functions.ttcn, line 71 */ { tmp_4: alt_status tmp_4_alt_flag_0 = ALT_MAYBE; alt_status tmp_4_alt_flag_1 = ALT_MAYBE; alt_status tmp_4_alt_flag_2 = ALT_MAYBE; alt_status tmp_4_alt_flag_3 = ALT_MAYBE; alt_status tmp_4_alt_flag_4 = ALT_MAYBE; alt_status tmp_4_alt_flag_5 = ALT_MAYBE; alt_status tmp_4_alt_flag_6 = ALT_MAYBE; alt_status tmp_4_default_flag = ALT_MAYBE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_4_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(72); /* Osmocom_VTY_Functions.ttcn, line 72 */ { CHARSTRING_template tmp_5; tmp_5 = CHARSTRING_template(STRING_PATTERN, (CHARSTRING)cs_7, FALSE); tmp_4_alt_flag_0 = pt.receive(tmp_5, NULL, any_compref, NULL, NULL, NULL); } if (tmp_4_alt_flag_0 == ALT_YES) break; } if (tmp_4_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(73); /* Osmocom_VTY_Functions.ttcn, line 73 */ { CHARSTRING_template tmp_6; tmp_6 = CHARSTRING_template(STRING_PATTERN, (CHARSTRING)cs_8, FALSE); tmp_4_alt_flag_1 = pt.receive(tmp_6, NULL, any_compref, NULL, NULL, NULL); } if (tmp_4_alt_flag_1 == ALT_YES) break; } if (tmp_4_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(74); /* Osmocom_VTY_Functions.ttcn, line 74 */ { CHARSTRING_template tmp_7; tmp_7 = CHARSTRING_template(STRING_PATTERN, (CHARSTRING)cs_9, FALSE); tmp_4_alt_flag_2 = pt.receive(tmp_7, NULL, any_compref, NULL, NULL, NULL); } if (tmp_4_alt_flag_2 == ALT_YES) break; } if (tmp_4_alt_flag_3 == ALT_MAYBE) { current_location.update_lineno(75); /* Osmocom_VTY_Functions.ttcn, line 75 */ tmp_4_alt_flag_3 = pt.receive(t__vty__unknown, &(rx), any_compref, NULL, NULL, NULL); if (tmp_4_alt_flag_3 == ALT_YES) { current_location.update_lineno(76); /* Osmocom_VTY_Functions.ttcn, line 76 */ if (strict) { current_location.update_lineno(77); /* Osmocom_VTY_Functions.ttcn, line 77 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(cs_10 + log__label).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(78); /* Osmocom_VTY_Functions.ttcn, line 78 */ TTCN_Runtime::stop_component(MTC_COMPREF); } else { current_location.update_lineno(80); /* Osmocom_VTY_Functions.ttcn, line 80 */ try { TTCN_Logger::begin_event(TTCN_USER); (cs_11 + log__label).log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(81); /* Osmocom_VTY_Functions.ttcn, line 81 */ { CHARSTRING tmp_8; tmp_8 = (buf + rx); buf = tmp_8; } current_location.update_lineno(82); /* Osmocom_VTY_Functions.ttcn, line 82 */ goto tmp_4; } } } if (tmp_4_alt_flag_4 == ALT_MAYBE) { current_location.update_lineno(85); /* Osmocom_VTY_Functions.ttcn, line 85 */ tmp_4_alt_flag_4 = pt.receive(CHARSTRING_template(ANY_VALUE), &(rx), any_compref, NULL, NULL, NULL); if (tmp_4_alt_flag_4 == ALT_YES) { current_location.update_lineno(85); /* Osmocom_VTY_Functions.ttcn, line 85 */ { CHARSTRING tmp_9; tmp_9 = (buf + rx); buf = tmp_9; } current_location.update_lineno(85); /* Osmocom_VTY_Functions.ttcn, line 85 */ goto tmp_4; } } if (tmp_4_alt_flag_5 == ALT_MAYBE) { current_location.update_lineno(86); /* Osmocom_VTY_Functions.ttcn, line 86 */ tmp_4_alt_flag_5 = pt.receive(INTEGER_template(ANY_VALUE), &(fd), any_compref, NULL, NULL, NULL); if (tmp_4_alt_flag_5 == ALT_YES) { current_location.update_lineno(87); /* Osmocom_VTY_Functions.ttcn, line 87 */ if ((fd == -1)) { current_location.update_lineno(88); /* Osmocom_VTY_Functions.ttcn, line 88 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(cs_12 + log__label).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(89); /* Osmocom_VTY_Functions.ttcn, line 89 */ TTCN_Runtime::stop_component(MTC_COMPREF); } else { current_location.update_lineno(91); /* Osmocom_VTY_Functions.ttcn, line 91 */ goto tmp_4; } } } if (tmp_4_alt_flag_6 == ALT_MAYBE) { current_location.update_lineno(94); /* Osmocom_VTY_Functions.ttcn, line 94 */ tmp_4_alt_flag_6 = T.timeout(NULL); if (tmp_4_alt_flag_6 == ALT_YES) { current_location.update_lineno(95); /* Osmocom_VTY_Functions.ttcn, line 95 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),(cs_13 + log__label).log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(96); /* Osmocom_VTY_Functions.ttcn, line 96 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_4_default_flag == ALT_MAYBE) { tmp_4_default_flag = TTCN_Default::try_altsteps(); if (tmp_4_default_flag == ALT_YES || tmp_4_default_flag == ALT_BREAK) break; else if (tmp_4_default_flag == ALT_REPEAT) goto tmp_4; } current_location.update_lineno(71); /* Osmocom_VTY_Functions.ttcn, line 71 */ if (tmp_4_alt_flag_0 == ALT_NO && tmp_4_alt_flag_1 == ALT_NO && tmp_4_alt_flag_2 == ALT_NO && tmp_4_alt_flag_3 == ALT_NO && tmp_4_alt_flag_4 == ALT_NO && tmp_4_alt_flag_5 == ALT_NO && tmp_4_alt_flag_6 == ALT_NO && tmp_4_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file Osmocom_VTY_Functions.ttcn between lines 71 and 98."); TTCN_Snapshot::take_new(TRUE); } } current_location.update_lineno(99); /* Osmocom_VTY_Functions.ttcn, line 99 */ T.stop(); current_location.update_lineno(100); /* Osmocom_VTY_Functions.ttcn, line 100 */ return buf; } CHARSTRING f__vty__transceive__ret(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& tx, const BOOLEAN& strict) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 104, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive_ret"); current_location.update_lineno(105); /* Osmocom_VTY_Functions.ttcn, line 105 */ pt.send(tx, NULL); current_location.update_lineno(106); /* Osmocom_VTY_Functions.ttcn, line 106 */ return f__vty__wait__for__prompt(pt, strict, tx); } void f__vty__transceive(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& tx, const BOOLEAN& strict) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 110, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive"); current_location.update_lineno(111); /* Osmocom_VTY_Functions.ttcn, line 111 */ CHARSTRING unused(f__vty__transceive__ret(pt, tx, strict)); } void f__vty__enter__config(TELNETasp__PortType::TELNETasp__PT& pt) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 123, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_config"); current_location.update_lineno(124); /* Osmocom_VTY_Functions.ttcn, line 124 */ f__vty__transceive(pt, cs_14, f__vty__transceive_strict_defval); } void f__vty__enter__cfg__network(TELNETasp__PortType::TELNETasp__PT& pt) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 127, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_network"); current_location.update_lineno(128); /* Osmocom_VTY_Functions.ttcn, line 128 */ f__vty__enter__config(pt); current_location.update_lineno(129); /* Osmocom_VTY_Functions.ttcn, line 129 */ f__vty__transceive(pt, cs_15, f__vty__transceive_strict_defval); } void f__vty__enter__cfg__bts(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& bts) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 132, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_bts"); current_location.update_lineno(133); /* Osmocom_VTY_Functions.ttcn, line 133 */ f__vty__enter__cfg__network(pt); current_location.update_lineno(134); /* Osmocom_VTY_Functions.ttcn, line 134 */ f__vty__transceive(pt, (cs_16 + int2str(bts)), f__vty__transceive_strict_defval); } void f__vty__enter__cfg__trx(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& bts, const INTEGER& trx) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 137, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_trx"); current_location.update_lineno(138); /* Osmocom_VTY_Functions.ttcn, line 138 */ f__vty__enter__cfg__bts(pt, bts); current_location.update_lineno(139); /* Osmocom_VTY_Functions.ttcn, line 139 */ f__vty__transceive(pt, (cs_17 + int2str(trx)), f__vty__transceive_strict_defval); } void f__vty__enter__cfg__ts(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& bts, const INTEGER& trx, const INTEGER& ts) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 142, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_ts"); current_location.update_lineno(143); /* Osmocom_VTY_Functions.ttcn, line 143 */ f__vty__enter__cfg__trx(pt, bts, trx); current_location.update_lineno(144); /* Osmocom_VTY_Functions.ttcn, line 144 */ f__vty__transceive(pt, (cs_18 + int2str(ts)), f__vty__transceive_strict_defval); } void f__vty__enter__cfg__msc(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& msc) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 147, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_msc"); current_location.update_lineno(148); /* Osmocom_VTY_Functions.ttcn, line 148 */ f__vty__enter__config(pt); current_location.update_lineno(149); /* Osmocom_VTY_Functions.ttcn, line 149 */ f__vty__transceive(pt, (cs_19 + int2str(msc)), f__vty__transceive_strict_defval); } void f__vty__enter__cfg__cs7__inst(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& cs7__inst) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 152, TTCN_Location::LOCATION_FUNCTION, "f_vty_enter_cfg_cs7_inst"); current_location.update_lineno(153); /* Osmocom_VTY_Functions.ttcn, line 153 */ f__vty__enter__config(pt); current_location.update_lineno(154); /* Osmocom_VTY_Functions.ttcn, line 154 */ f__vty__transceive(pt, (cs_20 + int2str(cs7__inst)), f__vty__transceive_strict_defval); } void f__vty__config3(TELNETasp__PortType::TELNETasp__PT& pt, const rof__charstring& config__nodes, const rof__charstring& cmds) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 158, TTCN_Location::LOCATION_FUNCTION, "f_vty_config3"); current_location.update_lineno(161); /* Osmocom_VTY_Functions.ttcn, line 161 */ f__vty__enter__config(pt); { current_location.update_lineno(162); /* Osmocom_VTY_Functions.ttcn, line 162 */ INTEGER i(0); current_location.update_lineno(162); /* Osmocom_VTY_Functions.ttcn, line 162 */ for ( ; ; ) { current_location.update_lineno(162); /* Osmocom_VTY_Functions.ttcn, line 162 */ if (!(i < config__nodes.size_of())) break; current_location.update_lineno(163); /* Osmocom_VTY_Functions.ttcn, line 163 */ f__vty__transceive(pt, const_cast< const rof__charstring&>(config__nodes)[i], f__vty__transceive_strict_defval); current_location.update_lineno(162); /* Osmocom_VTY_Functions.ttcn, line 162 */ { INTEGER tmp_10; ++i; } } } { current_location.update_lineno(166); /* Osmocom_VTY_Functions.ttcn, line 166 */ INTEGER i(0); current_location.update_lineno(166); /* Osmocom_VTY_Functions.ttcn, line 166 */ for ( ; ; ) { current_location.update_lineno(166); /* Osmocom_VTY_Functions.ttcn, line 166 */ if (!(i < cmds.size_of())) break; current_location.update_lineno(167); /* Osmocom_VTY_Functions.ttcn, line 167 */ f__vty__transceive(pt, const_cast< const rof__charstring&>(cmds)[i], f__vty__transceive_strict_defval); current_location.update_lineno(166); /* Osmocom_VTY_Functions.ttcn, line 166 */ { INTEGER tmp_11; ++i; } } } current_location.update_lineno(170); /* Osmocom_VTY_Functions.ttcn, line 170 */ f__vty__transceive(pt, cs_21, f__vty__transceive_strict_defval); } void f__vty__config2(TELNETasp__PortType::TELNETasp__PT& pt, const rof__charstring& config__nodes, const CHARSTRING& cmd) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 173, TTCN_Location::LOCATION_FUNCTION, "f_vty_config2"); current_location.update_lineno(175); /* Osmocom_VTY_Functions.ttcn, line 175 */ { rof__charstring tmp_12; tmp_12.set_size(1); tmp_12[0] = cmd; f__vty__config3(pt, config__nodes, tmp_12); } } void f__vty__config(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& config__node, const CHARSTRING& cmd) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 178, TTCN_Location::LOCATION_FUNCTION, "f_vty_config"); current_location.update_lineno(180); /* Osmocom_VTY_Functions.ttcn, line 180 */ { rof__charstring tmp_13; tmp_13.set_size(1); tmp_13[0] = config__node; f__vty__config2(pt, tmp_13, cmd); } } void f__vty__cfg__bts(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& bts, const rof__charstring& cmds) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 183, TTCN_Location::LOCATION_FUNCTION, "f_vty_cfg_bts"); current_location.update_lineno(184); /* Osmocom_VTY_Functions.ttcn, line 184 */ { rof__charstring tmp_14; tmp_14.set_size(2); tmp_14[0] = cs_15; tmp_14[1] = (cs_16 + int2str(bts)); f__vty__config3(pt, tmp_14, cmds); } } void f__vty__cfg__msc(TELNETasp__PortType::TELNETasp__PT& pt, const INTEGER& msc, const rof__charstring& cmds) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 187, TTCN_Location::LOCATION_FUNCTION, "f_vty_cfg_msc"); current_location.update_lineno(188); /* Osmocom_VTY_Functions.ttcn, line 188 */ { rof__charstring tmp_15; tmp_15.set_size(1); tmp_15[0] = (cs_19 + int2str(msc)); f__vty__config3(pt, tmp_15, cmds); } } void f__vty__transceive__match(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& cmd, const CHARSTRING_template& exp__ret) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 191, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive_match"); current_location.update_lineno(192); /* Osmocom_VTY_Functions.ttcn, line 192 */ CHARSTRING ret(f__vty__transceive__ret(pt, cmd, f__vty__transceive__ret_strict_defval)); current_location.update_lineno(193); /* Osmocom_VTY_Functions.ttcn, line 193 */ if ((!(exp__ret.match(ret)))) { current_location.update_lineno(194); /* Osmocom_VTY_Functions.ttcn, line 194 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Non-matching VTY response: "),ret.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(195); /* Osmocom_VTY_Functions.ttcn, line 195 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } void f__vty__transceive__not__match(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& cmd, const CHARSTRING_template& exp__ret) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 199, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive_not_match"); current_location.update_lineno(200); /* Osmocom_VTY_Functions.ttcn, line 200 */ CHARSTRING ret(f__vty__transceive__ret(pt, cmd, f__vty__transceive__ret_strict_defval)); current_location.update_lineno(201); /* Osmocom_VTY_Functions.ttcn, line 201 */ if (exp__ret.match(ret)) { current_location.update_lineno(202); /* Osmocom_VTY_Functions.ttcn, line 202 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected matching VTY response: "),ret.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(203); /* Osmocom_VTY_Functions.ttcn, line 203 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } CHARSTRING f__vty__transceive__match__regex(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& cmd, const CHARSTRING& regex, const INTEGER& groupno) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 207, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive_match_regex"); current_location.update_lineno(209); /* Osmocom_VTY_Functions.ttcn, line 209 */ CHARSTRING resp(f__vty__transceive__ret(pt, cmd, f__vty__transceive__ret_strict_defval)); current_location.update_lineno(210); /* Osmocom_VTY_Functions.ttcn, line 210 */ return regexp(resp, regex, groupno, FALSE); } CHARSTRING f__vty__transceive__match__regexp__retry(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& cmd, const CHARSTRING& regex, const INTEGER& groupno, const INTEGER& num__attempts, const FLOAT& retry__delay) { INTEGER num__attempts_shadow(num__attempts); TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 213, TTCN_Location::LOCATION_FUNCTION, "f_vty_transceive_match_regexp_retry"); for ( ; ; ) { current_location.update_lineno(216); /* Osmocom_VTY_Functions.ttcn, line 216 */ if (!(num__attempts_shadow > 0)) break; current_location.update_lineno(217); /* Osmocom_VTY_Functions.ttcn, line 217 */ CHARSTRING ret(f__vty__transceive__match__regex(pt, cmd, regex, groupno)); current_location.update_lineno(218); /* Osmocom_VTY_Functions.ttcn, line 218 */ if ((ret != cs_6)) { current_location.update_lineno(219); /* Osmocom_VTY_Functions.ttcn, line 219 */ return ret; } current_location.update_lineno(221); /* Osmocom_VTY_Functions.ttcn, line 221 */ Osmocom__Types::f__sleep(retry__delay); current_location.update_lineno(222); /* Osmocom_VTY_Functions.ttcn, line 222 */ { INTEGER tmp_16; --num__attempts_shadow; } } current_location.update_lineno(225); /* Osmocom_VTY_Functions.ttcn, line 225 */ Misc__Helpers::f__shutdown(cs_22, 225, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No matching VTY response for regular expression '"),regex.log(),TTCN_Logger::log_event_str("' after "),num__attempts_shadow.log(),TTCN_Logger::log_event_str(" attempts."),TTCN_Logger::end_event_log2str())); current_location.update_lineno(228); /* Osmocom_VTY_Functions.ttcn, line 228 */ return cs_6; } void f__verify__talloc__count(TELNETasp__PortType::TELNETasp__PT& pt, const StrList& object__strs, const INTEGER& expect__count, const INTEGER& attempts, const FLOAT& wait__time) { INTEGER attempts_shadow(attempts); TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 236, TTCN_Location::LOCATION_FUNCTION, "f_verify_talloc_count"); current_location.update_lineno(239); /* Osmocom_VTY_Functions.ttcn, line 239 */ CHARSTRING show__cmd(cs_23); { current_location.update_lineno(240); /* Osmocom_VTY_Functions.ttcn, line 240 */ INTEGER i(0); current_location.update_lineno(240); /* Osmocom_VTY_Functions.ttcn, line 240 */ for ( ; ; ) { current_location.update_lineno(240); /* Osmocom_VTY_Functions.ttcn, line 240 */ if (!(i < object__strs.lengthof())) break; current_location.update_lineno(241); /* Osmocom_VTY_Functions.ttcn, line 241 */ CHARSTRING obj__str(const_cast< const StrList&>(object__strs)[i]); current_location.update_lineno(243); /* Osmocom_VTY_Functions.ttcn, line 243 */ obj__str = TCCConversion__Functions::f__replaceEveryOccurenceOfSubstring(obj__str, cs_24, cs_25); current_location.update_lineno(245); /* Osmocom_VTY_Functions.ttcn, line 245 */ { CHARSTRING tmp_18; tmp_18 = ((cs_26 + obj__str) + cs_27); obj__str = tmp_18; } current_location.update_lineno(246); /* Osmocom_VTY_Functions.ttcn, line 246 */ if ((i > 0)) { current_location.update_lineno(247); /* Osmocom_VTY_Functions.ttcn, line 247 */ { CHARSTRING tmp_19; tmp_19 = (show__cmd + cs_28); show__cmd = tmp_19; } } current_location.update_lineno(249); /* Osmocom_VTY_Functions.ttcn, line 249 */ { CHARSTRING tmp_20; tmp_20 = (show__cmd + obj__str); show__cmd = tmp_20; } current_location.update_lineno(240); /* Osmocom_VTY_Functions.ttcn, line 240 */ { INTEGER tmp_21; ++i; } } } for ( ; ; ) { current_location.update_lineno(252); /* Osmocom_VTY_Functions.ttcn, line 252 */ if (!(attempts_shadow > 0)) break; current_location.update_lineno(253); /* Osmocom_VTY_Functions.ttcn, line 253 */ { INTEGER tmp_22; --attempts_shadow; } current_location.update_lineno(254); /* Osmocom_VTY_Functions.ttcn, line 254 */ CHARSTRING ret(f__vty__transceive__ret(pt, show__cmd, f__vty__transceive__ret_strict_defval)); current_location.update_lineno(256); /* Osmocom_VTY_Functions.ttcn, line 256 */ BOOLEAN ok(TRUE); { current_location.update_lineno(257); /* Osmocom_VTY_Functions.ttcn, line 257 */ INTEGER i(0); current_location.update_lineno(257); /* Osmocom_VTY_Functions.ttcn, line 257 */ for ( ; ; ) { current_location.update_lineno(257); /* Osmocom_VTY_Functions.ttcn, line 257 */ if (!(i < object__strs.lengthof())) break; current_location.update_lineno(258); /* Osmocom_VTY_Functions.ttcn, line 258 */ CHARSTRING object__str(const_cast< const StrList&>(object__strs)[i]); current_location.update_lineno(259); /* Osmocom_VTY_Functions.ttcn, line 259 */ INTEGER count(Misc__Helpers::f__strstr__count(ret, object__str)); current_location.update_lineno(260); /* Osmocom_VTY_Functions.ttcn, line 260 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("talloc reports "); object__str.log(); TTCN_Logger::log_event_str(" x "); count.log(); TTCN_Logger::log_event_str(", expecting "); expect__count.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(261); /* Osmocom_VTY_Functions.ttcn, line 261 */ if ((count != expect__count)) { current_location.update_lineno(262); /* Osmocom_VTY_Functions.ttcn, line 262 */ ok = FALSE; } current_location.update_lineno(257); /* Osmocom_VTY_Functions.ttcn, line 257 */ { INTEGER tmp_24; ++i; } } } current_location.update_lineno(265); /* Osmocom_VTY_Functions.ttcn, line 265 */ if (ok) { current_location.update_lineno(266); /* Osmocom_VTY_Functions.ttcn, line 266 */ return; } current_location.update_lineno(268); /* Osmocom_VTY_Functions.ttcn, line 268 */ if ((attempts_shadow == 0)) { current_location.update_lineno(269); /* Osmocom_VTY_Functions.ttcn, line 269 */ break; } current_location.update_lineno(271); /* Osmocom_VTY_Functions.ttcn, line 271 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("count mismatch, retrying in "); wait__time.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(272); /* Osmocom_VTY_Functions.ttcn, line 272 */ Osmocom__Types::f__sleep(wait__time); } current_location.update_lineno(274); /* Osmocom_VTY_Functions.ttcn, line 274 */ Misc__Helpers::f__shutdown(cs_22, 274, FAIL, cs_29); } void f__verify__talloc__bytes(TELNETasp__PortType::TELNETasp__PT& pt, const Misc__Helpers::ro__charstring& object__strs, const INTEGER& expect__bytes, const INTEGER& attempts, const FLOAT& wait__time) { INTEGER attempts_shadow(attempts); TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 277, TTCN_Location::LOCATION_FUNCTION, "f_verify_talloc_bytes"); current_location.update_lineno(280); /* Osmocom_VTY_Functions.ttcn, line 280 */ CHARSTRING show__cmd(cs_30); for ( ; ; ) { current_location.update_lineno(282); /* Osmocom_VTY_Functions.ttcn, line 282 */ if (!(attempts_shadow > 0)) break; current_location.update_lineno(283); /* Osmocom_VTY_Functions.ttcn, line 283 */ { INTEGER tmp_25; --attempts_shadow; } current_location.update_lineno(284); /* Osmocom_VTY_Functions.ttcn, line 284 */ CHARSTRING ret(f__vty__transceive__ret(pt, show__cmd, f__vty__transceive__ret_strict_defval)); current_location.update_lineno(286); /* Osmocom_VTY_Functions.ttcn, line 286 */ Misc__Helpers::ro__charstring lines(Misc__Helpers::f__str__split(ret, Misc__Helpers::f__str__split_delim_defval)); current_location.update_lineno(288); /* Osmocom_VTY_Functions.ttcn, line 288 */ BOOLEAN ok(TRUE); { current_location.update_lineno(289); /* Osmocom_VTY_Functions.ttcn, line 289 */ INTEGER i(0); current_location.update_lineno(289); /* Osmocom_VTY_Functions.ttcn, line 289 */ for ( ; ; ) { current_location.update_lineno(289); /* Osmocom_VTY_Functions.ttcn, line 289 */ if (!(i < object__strs.lengthof())) break; current_location.update_lineno(290); /* Osmocom_VTY_Functions.ttcn, line 290 */ CHARSTRING object__str(const_cast< const Misc__Helpers::ro__charstring&>(object__strs)[i]); current_location.update_lineno(292); /* Osmocom_VTY_Functions.ttcn, line 292 */ INTEGER bytes(0); { current_location.update_lineno(294); /* Osmocom_VTY_Functions.ttcn, line 294 */ INTEGER j(0); current_location.update_lineno(294); /* Osmocom_VTY_Functions.ttcn, line 294 */ for ( ; ; ) { current_location.update_lineno(294); /* Osmocom_VTY_Functions.ttcn, line 294 */ if (!(j < lines.lengthof())) break; { current_location.update_lineno(295); /* Osmocom_VTY_Functions.ttcn, line 295 */ CHARSTRING line(const_cast< const Misc__Helpers::ro__charstring&>(lines)[j]); current_location.update_lineno(296); /* Osmocom_VTY_Functions.ttcn, line 296 */ if ((TCCConversion__Functions::f__strstr(line, object__str, TCCConversion__Functions::f__strstr_offset_defval) < 0)) { current_location.update_lineno(297); /* Osmocom_VTY_Functions.ttcn, line 297 */ goto tmp_26; } current_location.update_lineno(299); /* Osmocom_VTY_Functions.ttcn, line 299 */ Misc__Helpers::ro__charstring tokens(Misc__Helpers::f__str__split(line, cs_24)); current_location.update_lineno(300); /* Osmocom_VTY_Functions.ttcn, line 300 */ if ((tokens.lengthof() < 4)) { current_location.update_lineno(301); /* Osmocom_VTY_Functions.ttcn, line 301 */ goto tmp_26; } current_location.update_lineno(303); /* Osmocom_VTY_Functions.ttcn, line 303 */ if ((const_cast< const Misc__Helpers::ro__charstring&>(tokens)[3] != cs_31)) { current_location.update_lineno(304); /* Osmocom_VTY_Functions.ttcn, line 304 */ goto tmp_26; } current_location.update_lineno(306); /* Osmocom_VTY_Functions.ttcn, line 306 */ bytes = TCCConversion__Functions::f__str2int(const_cast< const Misc__Helpers::ro__charstring&>(tokens)[2]); } tmp_26: current_location.update_lineno(294); /* Osmocom_VTY_Functions.ttcn, line 294 */ { INTEGER tmp_28; ++j; } } } current_location.update_lineno(309); /* Osmocom_VTY_Functions.ttcn, line 309 */ if ((bytes != expect__bytes)) { current_location.update_lineno(310); /* Osmocom_VTY_Functions.ttcn, line 310 */ ok = FALSE; current_location.update_lineno(311); /* Osmocom_VTY_Functions.ttcn, line 311 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("ERROR: talloc reports "); object__str.log(); TTCN_Logger::log_event_str(" = "); bytes.log(); TTCN_Logger::log_event_str(" bytes, expecting "); expect__bytes.log(); TTCN_Logger::log_event_str(" from VTY response "); lines.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } } else { current_location.update_lineno(314); /* Osmocom_VTY_Functions.ttcn, line 314 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("ok: talloc reports "); object__str.log(); TTCN_Logger::log_event_str(" = "); bytes.log(); TTCN_Logger::log_event_str(" bytes"); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } } current_location.update_lineno(289); /* Osmocom_VTY_Functions.ttcn, line 289 */ { INTEGER tmp_30; ++i; } } } current_location.update_lineno(317); /* Osmocom_VTY_Functions.ttcn, line 317 */ if (ok) { current_location.update_lineno(318); /* Osmocom_VTY_Functions.ttcn, line 318 */ return; } current_location.update_lineno(320); /* Osmocom_VTY_Functions.ttcn, line 320 */ if ((attempts_shadow == 0)) { current_location.update_lineno(321); /* Osmocom_VTY_Functions.ttcn, line 321 */ break; } current_location.update_lineno(323); /* Osmocom_VTY_Functions.ttcn, line 323 */ try { TTCN_Logger::begin_event(TTCN_USER); TTCN_Logger::log_event_str("bytes count mismatch, retrying in "); wait__time.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(324); /* Osmocom_VTY_Functions.ttcn, line 324 */ Osmocom__Types::f__sleep(wait__time); } current_location.update_lineno(326); /* Osmocom_VTY_Functions.ttcn, line 326 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("talloc bytes count mismatch"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(327); /* Osmocom_VTY_Functions.ttcn, line 327 */ TTCN_Runtime::stop_component(MTC_COMPREF); } void f__logp(TELNETasp__PortType::TELNETasp__PT& pt, const CHARSTRING& log__msg) { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 330, TTCN_Location::LOCATION_FUNCTION, "f_logp"); current_location.update_lineno(333); /* Osmocom_VTY_Functions.ttcn, line 333 */ try { TTCN_Logger::begin_event(TTCN_USER); log__msg.log(); TTCN_Logger::end_event(); } catch (...) { TTCN_Logger::finish_event(); throw; } current_location.update_lineno(335); /* Osmocom_VTY_Functions.ttcn, line 335 */ if (pt.check_port_state(cs_32)) { current_location.update_lineno(336); /* Osmocom_VTY_Functions.ttcn, line 336 */ f__vty__transceive(pt, (cs_33 + log__msg), f__vty__transceive_strict_defval); } } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_VTY_Functions"); Misc__Helpers::module_object.pre_init_module(); TELNETasp__PortType::module_object.pre_init_module(); Osmocom__Types::module_object.pre_init_module(); Socket__API__Definitions::module_object.pre_init_module(); current_location.update_lineno(21); /* Osmocom_VTY_Functions.ttcn, line 21 */ modulepar_mp__prompt__prefix = cs_0; module_object.add_modulepar("mp_prompt_prefix"); current_location.update_lineno(22); /* Osmocom_VTY_Functions.ttcn, line 22 */ modulepar_mp__prompt__timeout = 2.0; module_object.add_modulepar("mp_prompt_timeout"); current_location.update_lineno(25); /* Osmocom_VTY_Functions.ttcn, line 25 */ const_VTY__VIEW__SUFFIX = cs_1; current_location.update_lineno(26); /* Osmocom_VTY_Functions.ttcn, line 26 */ const_VTY__ENABLE__SUFFIX = cs_2; current_location.update_lineno(27); /* Osmocom_VTY_Functions.ttcn, line 27 */ const_VTY__CFG__SUFFIX = cs_3; module_object.add_function("f_vty_set_prompts", (genericfunc_t)&f__vty__set__prompts, NULL); module_object.add_function("f_vty_wait_for_prompt", (genericfunc_t)&f__vty__wait__for__prompt, NULL); module_object.add_function("f_vty_transceive_ret", (genericfunc_t)&f__vty__transceive__ret, NULL); module_object.add_function("f_vty_transceive", (genericfunc_t)&f__vty__transceive, NULL); module_object.add_function("f_vty_enter_config", (genericfunc_t)&f__vty__enter__config, NULL); module_object.add_function("f_vty_enter_cfg_network", (genericfunc_t)&f__vty__enter__cfg__network, NULL); module_object.add_function("f_vty_enter_cfg_bts", (genericfunc_t)&f__vty__enter__cfg__bts, NULL); module_object.add_function("f_vty_enter_cfg_trx", (genericfunc_t)&f__vty__enter__cfg__trx, NULL); module_object.add_function("f_vty_enter_cfg_ts", (genericfunc_t)&f__vty__enter__cfg__ts, NULL); module_object.add_function("f_vty_enter_cfg_msc", (genericfunc_t)&f__vty__enter__cfg__msc, NULL); module_object.add_function("f_vty_enter_cfg_cs7_inst", (genericfunc_t)&f__vty__enter__cfg__cs7__inst, NULL); module_object.add_function("f_vty_config3", (genericfunc_t)&f__vty__config3, NULL); module_object.add_function("f_vty_config2", (genericfunc_t)&f__vty__config2, NULL); module_object.add_function("f_vty_config", (genericfunc_t)&f__vty__config, NULL); module_object.add_function("f_vty_cfg_bts", (genericfunc_t)&f__vty__cfg__bts, NULL); module_object.add_function("f_vty_cfg_msc", (genericfunc_t)&f__vty__cfg__msc, NULL); module_object.add_function("f_vty_transceive_match", (genericfunc_t)&f__vty__transceive__match, NULL); module_object.add_function("f_vty_transceive_not_match", (genericfunc_t)&f__vty__transceive__not__match, NULL); module_object.add_function("f_vty_transceive_match_regex", (genericfunc_t)&f__vty__transceive__match__regex, NULL); module_object.add_function("f_vty_transceive_match_regexp_retry", (genericfunc_t)&f__vty__transceive__match__regexp__retry, NULL); module_object.add_function("f_verify_talloc_count", (genericfunc_t)&f__verify__talloc__count, NULL); module_object.add_function("f_verify_talloc_bytes", (genericfunc_t)&f__verify__talloc__bytes, NULL); module_object.add_function("f_logp", (genericfunc_t)&f__logp, NULL); } void post_init_module() { TTCN_Location current_location("Osmocom_VTY_Functions.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_VTY_Functions"); Misc__Helpers::module_object.post_init_module(); TELNETasp__PortType::module_object.post_init_module(); Osmocom__Types::module_object.post_init_module(); Socket__API__Definitions::module_object.post_init_module(); current_location.update_lineno(29); /* Osmocom_VTY_Functions.ttcn, line 29 */ template_t__vty__unknown = CHARSTRING_template(STRING_PATTERN, (CHARSTRING)cs_4, FALSE); current_location.update_lineno(32); /* Osmocom_VTY_Functions.ttcn, line 32 */ const_f__vty__set__prompts_prompt__prefix_defval = mp__prompt__prefix; current_location.update_lineno(64); /* Osmocom_VTY_Functions.ttcn, line 64 */ const_f__vty__wait__for__prompt_strict_defval = TRUE; current_location.update_lineno(64); /* Osmocom_VTY_Functions.ttcn, line 64 */ const_f__vty__wait__for__prompt_log__label_defval = cs_5; current_location.update_lineno(104); /* Osmocom_VTY_Functions.ttcn, line 104 */ const_f__vty__transceive__ret_strict_defval = TRUE; current_location.update_lineno(110); /* Osmocom_VTY_Functions.ttcn, line 110 */ const_f__vty__transceive_strict_defval = TRUE; current_location.update_lineno(132); /* Osmocom_VTY_Functions.ttcn, line 132 */ const_f__vty__enter__cfg__bts_bts_defval = 0; current_location.update_lineno(137); /* Osmocom_VTY_Functions.ttcn, line 137 */ const_f__vty__enter__cfg__trx_bts_defval = 0; current_location.update_lineno(137); /* Osmocom_VTY_Functions.ttcn, line 137 */ const_f__vty__enter__cfg__trx_trx_defval = 0; current_location.update_lineno(142); /* Osmocom_VTY_Functions.ttcn, line 142 */ const_f__vty__enter__cfg__ts_bts_defval = 0; current_location.update_lineno(142); /* Osmocom_VTY_Functions.ttcn, line 142 */ const_f__vty__enter__cfg__ts_trx_defval = 0; current_location.update_lineno(147); /* Osmocom_VTY_Functions.ttcn, line 147 */ const_f__vty__enter__cfg__msc_msc_defval = 0; current_location.update_lineno(152); /* Osmocom_VTY_Functions.ttcn, line 152 */ const_f__vty__enter__cfg__cs7__inst_cs7__inst_defval = 0; current_location.update_lineno(183); /* Osmocom_VTY_Functions.ttcn, line 183 */ const_f__vty__cfg__bts_bts_defval = 0; current_location.update_lineno(187); /* Osmocom_VTY_Functions.ttcn, line 187 */ const_f__vty__cfg__msc_msc_defval = 0; current_location.update_lineno(236); /* Osmocom_VTY_Functions.ttcn, line 236 */ const_f__verify__talloc__count_expect__count_defval = 0; current_location.update_lineno(237); /* Osmocom_VTY_Functions.ttcn, line 237 */ const_f__verify__talloc__count_attempts_defval = 5; current_location.update_lineno(237); /* Osmocom_VTY_Functions.ttcn, line 237 */ const_f__verify__talloc__count_wait__time_defval = 3.0; current_location.update_lineno(277); /* Osmocom_VTY_Functions.ttcn, line 277 */ const_f__verify__talloc__bytes_expect__bytes_defval = 0; current_location.update_lineno(278); /* Osmocom_VTY_Functions.ttcn, line 278 */ const_f__verify__talloc__bytes_attempts_defval = 5; current_location.update_lineno(278); /* Osmocom_VTY_Functions.ttcn, line 278 */ const_f__verify__talloc__bytes_wait__time_defval = 3.0; } boolean set_module_param(Module_Param& param) { const char* const par_name = param.get_id()->get_current_name(); if (!strcmp(par_name, "mp_prompt_prefix")) { modulepar_mp__prompt__prefix.set_param(param); return TRUE; } else if (!strcmp(par_name, "mp_prompt_timeout")) { modulepar_mp__prompt__timeout.set_param(param); return TRUE; } else return FALSE; } void log_module_param() { TTCN_Logger::log_event_str("mp_prompt_prefix := "); mp__prompt__prefix.log(); TTCN_Logger::log_event_str(", mp_prompt_timeout := "); mp__prompt__timeout.log(); } } /* end of namespace */