aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-02-21 15:09:11 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-02-22 08:40:48 +0100
commitbbfd21a36cdd10c3b8d83a329042d9ebfb4c5250 (patch)
treedfdce045396aaf20514dc767886c259b9521e18d
parent4160e3d0f8de39954f107c03461e9594a61d4975 (diff)
bts/vty: Use new vty_install_default() function, adjust prompts
This patch removes the local 'end' and 'exit' implementations (which aren't used anyway) and uses the generic ones provided by libosmocore instead, which are enabled automatically when vty_install_default() is used. The prompt strings are modified to match those in libosmocore/openbsc. Ticket: OW#952 Sponsored-by: On-Waves ehf
-rw-r--r--src/common/vty.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index 5eddc8df..d818f3f5 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -71,37 +71,6 @@ int bts_vty_is_config_node(struct vty *vty, int node)
}
}
-gDEFUN(ournode_exit, ournode_exit_cmd, "exit",
- "Exit current node, go down to provious node")
-{
- switch (vty->node) {
- case TRX_NODE:
- vty->node = BTS_NODE;
- {
- struct gsm_bts_trx *trx = vty->index;
- vty->index = trx->bts;
- }
- break;
- default:
- break;
- }
- return CMD_SUCCESS;
-}
-
-gDEFUN(ournode_end, ournode_end_cmd, "end",
- "End current mode and change to enable mode")
-{
- switch (vty->node) {
- default:
- vty_config_unlock(vty);
- vty->node = ENABLE_NODE;
- vty->index = NULL;
- vty->index_sub = NULL;
- break;
- }
- return CMD_SUCCESS;
-}
-
static const char osmobts_copyright[] =
"Copyright (C) 2010, 2011 by Harald Welte, Andreas Eversberg and On-Waves\r\n"
"License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n"
@@ -140,13 +109,13 @@ struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num)
static struct cmd_node bts_node = {
BTS_NODE,
- "%s(bts)#",
+ "%s(config-bts)# ",
1,
};
static struct cmd_node trx_node = {
TRX_NODE,
- "%s(trx)#",
+ "%s(config-bts-trx)# ",
1,
};
@@ -509,7 +478,7 @@ int bts_vty_init(const struct log_info *cat)
install_node(&bts_node, config_write_bts);
install_element(CONFIG_NODE, &cfg_bts_cmd);
- install_default(BTS_NODE);
+ vty_install_default(BTS_NODE);
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_oml_ip_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_bind_ip_cmd);
@@ -523,7 +492,7 @@ int bts_vty_init(const struct log_info *cat)
/* add and link to TRX config node */
install_element(BTS_NODE, &cfg_bts_trx_cmd);
install_node(&trx_node, config_write_dummy);
- install_default(TRX_NODE);
+ vty_install_default(TRX_NODE);
install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd);