aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-04-09 15:45:24 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-04-09 17:05:19 +0200
commitcc12f02658859b31d225f54fed5bae0742cbd9d3 (patch)
tree3e6f3b2ec85cc8696a486c355bdc903807a002a7
parentd0261b72dea475c1fccdf00b77d6be6317588232 (diff)
vty: Use libosmocore VTY standards
This commit applies to following changes to pcu_vty.c: - Use vty_install_default() instead of install_default() - Add a blank after the '#' of the prompt - Rename the 'pcu' configuration node to 'config-pcu' Sponsored-by: On-Waves ehf
-rw-r--r--src/pcu_vty.c38
-rw-r--r--src/pcu_vty.h3
2 files changed, 2 insertions, 39 deletions
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 00cd6fc..a4f01db 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -40,43 +40,10 @@ int pcu_vty_is_config_node(struct vty *vty, int node)
static struct cmd_node pcu_node = {
(enum node_type) PCU_NODE,
- "%s(pcu)#",
+ "%s(config-pcu)# ",
1,
};
-gDEFUN(ournode_exit, ournode_exit_cmd, "exit",
- "Exit current node, go down to provious node")
-{
- switch (vty->node) {
-#if 0
- case TRXV_NODE:
- vty->node = PCU_NODE;
- {
- struct gsm_bts_trx *trx = vty->index;
- vty->index = trx->bts;
- }
- break;
-#endif
- 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 int config_write_pcu(struct vty *vty)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@@ -421,7 +388,7 @@ int pcu_vty_init(const struct log_info *cat)
install_node(&pcu_node, config_write_pcu);
install_element(CONFIG_NODE, &cfg_pcu_cmd);
- install_default(PCU_NODE);
+ vty_install_default(PCU_NODE);
install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd);
install_element(PCU_NODE, &cfg_pcu_cs_cmd);
install_element(PCU_NODE, &cfg_pcu_no_cs_cmd);
@@ -439,7 +406,6 @@ int pcu_vty_init(const struct log_info *cat)
install_element(PCU_NODE, &cfg_pcu_gamma_cmd);
install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd);
install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd);
- install_element(PCU_NODE, &ournode_end_cmd);
install_element_ve(&show_bts_stats_cmd);
install_element_ve(&show_tbf_cmd);
diff --git a/src/pcu_vty.h b/src/pcu_vty.h
index 390d75c..17b1d3c 100644
--- a/src/pcu_vty.h
+++ b/src/pcu_vty.h
@@ -8,9 +8,6 @@ enum pcu_vty_node {
PCU_NODE = _LAST_OSMOVTY_NODE + 1,
};
-extern struct cmd_element ournode_exit_cmd;
-extern struct cmd_element ournode_end_cmd;
-
enum node_type pcu_vty_go_parent(struct vty *vty);
int pcu_vty_is_config_node(struct vty *vty, int node);