From 62ab20c5dd85bb8c14a44af73b674494447318e7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 14 May 2010 18:59:17 +0200 Subject: [VTY] Remove OpenBSC specific node-exit handling from src/vty The idea is to move the VTY code into libosmocore at some point, and for that we need to eliminate OpenBSC specifics from it --- openbsc/src/vty_interface_layer3.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'openbsc/src/vty_interface_layer3.c') diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c index 029f0c4ab..5aa24d3c2 100644 --- a/openbsc/src/vty_interface_layer3.c +++ b/openbsc/src/vty_interface_layer3.c @@ -51,6 +51,20 @@ struct cmd_node subscr_node = { 1, }; +/* Down vty node level. */ +DEFUN(subscr_node_exit, + subscr_node_exit_cmd, "exit", "Exit current mode and down to previous mode\n") +{ + switch (vty->node) { + case SUBSCR_NODE: + vty->node = VIEW_NODE; + subscr_put(vty->index); + vty->index = NULL; + break; + } + return CMD_SUCCESS; +} + static int dummy_config_write(struct vty *v) { return CMD_SUCCESS; @@ -542,6 +556,7 @@ int bsc_vty_init_extra(struct gsm_network *net) install_node(&subscr_node, dummy_config_write); install_default(SUBSCR_NODE); + install_element(SUBSCR_NODE, &subscr_node_exit_cmd); install_element(SUBSCR_NODE, &cfg_subscr_name_cmd); install_element(SUBSCR_NODE, &cfg_subscr_extension_cmd); install_element(SUBSCR_NODE, &cfg_subscr_authorized_cmd); -- cgit v1.2.3