vty: Use new vty_install_default() function
This patch removes the local 'end' and 'exit' implementations and
uses the generic ones provided by libosmocore instead, which are
enabled automatically when vty_install_default() is used.
diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c
index b6e1438..faaebd8 100644
--- a/src/e1_input_vty.c
+++ b/src/e1_input_vty.c
@@ -276,6 +276,8 @@
{
install_element(CONFIG_NODE, &cfg_e1inp_cmd);
install_node(&e1inp_node, e1inp_config_write);
+
+ vty_install_default(L_E1INP_NODE);
install_element(L_E1INP_NODE, &cfg_e1_line_driver_cmd);
install_element(L_E1INP_NODE, &cfg_e1_line_port_cmd);
install_element(L_E1INP_NODE, &cfg_e1_line_name_cmd);
diff --git a/src/ipa_proxy.c b/src/ipa_proxy.c
index 74cf427..a394b8c 100644
--- a/src/ipa_proxy.c
+++ b/src/ipa_proxy.c
@@ -644,28 +644,6 @@
return CMD_SUCCESS;
}
-DEFUN(ournode_exit,
- ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n")
-{
- switch (vty->node) {
- case L_IPA_NODE:
- vty->node = CONFIG_NODE;
- vty->index = NULL;
- break;
- }
- return CMD_SUCCESS;
-}
-
-DEFUN(ournode_end,
- ournode_end_cmd, "end", "End current mode and change to enable mode.\n")
-{
- switch (vty->node) {
- case L_IPA_NODE:
- break;
- }
- return CMD_SUCCESS;
-}
-
void ipa_proxy_vty_init(void)
{
tall_ipa_proxy_ctx =
@@ -681,9 +659,7 @@
install_element(CONFIG_NODE, &ipa_cfg_cmd);
install_node(&ipa_node, ipa_cfg_write);
- install_default(L_IPA_NODE);
- install_element(L_IPA_NODE, &ournode_exit_cmd);
- install_element(L_IPA_NODE, &ournode_end_cmd);
+ vty_install_default(L_IPA_NODE);
install_element(L_IPA_NODE, &ipa_instance_cfg_add_cmd);
install_element(L_IPA_NODE, &ipa_route_cfg_add_cmd);
}