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
This commit is contained in:
parent
d0261b72de
commit
cc12f02658
|
@ -40,43 +40,10 @@ int pcu_vty_is_config_node(struct vty *vty, int node)
|
||||||
|
|
||||||
static struct cmd_node pcu_node = {
|
static struct cmd_node pcu_node = {
|
||||||
(enum node_type) PCU_NODE,
|
(enum node_type) PCU_NODE,
|
||||||
"%s(pcu)#",
|
"%s(config-pcu)# ",
|
||||||
1,
|
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)
|
static int config_write_pcu(struct vty *vty)
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_bts *bts = bts_main_data();
|
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_node(&pcu_node, config_write_pcu);
|
||||||
install_element(CONFIG_NODE, &cfg_pcu_cmd);
|
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_no_two_phase_cmd);
|
||||||
install_element(PCU_NODE, &cfg_pcu_cs_cmd);
|
install_element(PCU_NODE, &cfg_pcu_cs_cmd);
|
||||||
install_element(PCU_NODE, &cfg_pcu_no_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_gamma_cmd);
|
||||||
install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_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, &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_bts_stats_cmd);
|
||||||
install_element_ve(&show_tbf_cmd);
|
install_element_ve(&show_tbf_cmd);
|
||||||
|
|
|
@ -8,9 +8,6 @@ enum pcu_vty_node {
|
||||||
PCU_NODE = _LAST_OSMOVTY_NODE + 1,
|
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);
|
enum node_type pcu_vty_go_parent(struct vty *vty);
|
||||||
int pcu_vty_is_config_node(struct vty *vty, int node);
|
int pcu_vty_is_config_node(struct vty *vty, int node);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue