From c5a08ef4f448d5fc0a0a02574eafb52c0eb7707b Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 23 Oct 2017 00:17:22 +0330 Subject: mobile/vty_interface.c: do not install default commands Since in recent version of libosmocore default commands (such as 'exit' and 'end') are being installed by default, no need to install them twice. This will crash the program. Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c --- src/host/layer23/src/mobile/vty_interface.c | 50 ----------------------------- 1 file changed, 50 deletions(-) (limited to 'src/host/layer23/src/mobile') diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index b26d471d..9a889e96 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2777,50 +2777,6 @@ enum node_type ms_vty_go_parent(struct vty *vty) return vty->node; } -/* Down vty node level. */ -gDEFUN(ournode_exit, - ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - switch (vty->node) { - case MS_NODE: - vty->node = CONFIG_NODE; - vty->index = NULL; - break; - case TESTSIM_NODE: - case SUPPORT_NODE: - vty->node = MS_NODE; - break; - default: - break; - } - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(ournode_end, - ournode_end_cmd, "end", "End current mode and change to enable mode.") -{ - switch (vty->node) { - case VIEW_NODE: - case ENABLE_NODE: - /* Nothing to do. */ - break; - case CONFIG_NODE: - case VTY_NODE: - case MS_NODE: - case TESTSIM_NODE: - case SUPPORT_NODE: - vty_config_unlock(vty); - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - DEFUN(off, off_cmd, "off", "Turn mobiles off (shutdown) and exit") { @@ -2886,8 +2842,6 @@ int ms_vty_init(void) install_element(CONFIG_NODE, &cfg_no_ms_cmd); install_node(&ms_node, config_write); install_default(MS_NODE); - install_element(MS_NODE, &ournode_exit_cmd); - install_element(MS_NODE, &ournode_end_cmd); install_element(MS_NODE, &cfg_ms_show_this_cmd); install_element(MS_NODE, &cfg_ms_layer2_cmd); install_element(MS_NODE, &cfg_ms_sap_cmd); @@ -2931,8 +2885,6 @@ int ms_vty_init(void) install_element(MS_NODE, &cfg_ms_support_cmd); install_node(&support_node, config_write_dummy); install_default(SUPPORT_NODE); - install_element(SUPPORT_NODE, &ournode_exit_cmd); - install_element(SUPPORT_NODE, &ournode_end_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_no_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_sms_cmd); @@ -2989,8 +2941,6 @@ int ms_vty_init(void) install_element(SUPPORT_NODE, &cfg_ms_sup_no_skip_max_per_band_cmd); install_node(&testsim_node, config_write_dummy); install_default(TESTSIM_NODE); - install_element(TESTSIM_NODE, &ournode_exit_cmd); - install_element(TESTSIM_NODE, &ournode_end_cmd); install_element(TESTSIM_NODE, &cfg_test_imsi_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_xor_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_comp128_cmd); -- cgit v1.2.3