aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty_interface_layer3.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-14 18:59:17 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-14 18:59:17 +0200
commit62ab20c5dd85bb8c14a44af73b674494447318e7 (patch)
treeb030427bde17387c6159d8712d74f91bf62edfa5 /openbsc/src/vty_interface_layer3.c
parent197dea95ff55acd86d5800f5a1cf7e339b24064d (diff)
[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
Diffstat (limited to 'openbsc/src/vty_interface_layer3.c')
-rw-r--r--openbsc/src/vty_interface_layer3.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c
index 029f0c4a..5aa24d3c 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);