Ensure all 'view' commands are availalbe from 'enable' too

This commit is contained in:
Harald Welte 2010-05-12 16:10:35 +00:00
parent 50a6dfee37
commit b4d5b17a8d
5 changed files with 34 additions and 27 deletions

View File

@ -350,6 +350,7 @@ struct desc {
void install_node(struct cmd_node *, int (*)(struct vty *));
void install_default(enum node_type);
void install_element(enum node_type, struct cmd_element *);
void install_element_ve(struct cmd_element *cmd);
void sort_node();
/* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated

View File

@ -478,6 +478,13 @@ void install_element(enum node_type ntype, struct cmd_element *cmd)
cmd->cmdsize = cmd_cmdsize(cmd->strvec);
}
/* Install a command into VIEW and ENABLE node */
void install_element_ve(struct cmd_element *cmd)
{
install_element(VIEW_NODE, cmd);
install_element(ENABLE_NODE, cmd);
}
#ifdef VTY_CRYPT_PW
static unsigned char itoa64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

View File

@ -1904,17 +1904,17 @@ int bsc_vty_init(struct gsm_network *net)
cmd_init(1);
vty_init();
install_element(VIEW_NODE, &show_net_cmd);
install_element(VIEW_NODE, &show_bts_cmd);
install_element(VIEW_NODE, &show_trx_cmd);
install_element(VIEW_NODE, &show_ts_cmd);
install_element(VIEW_NODE, &show_lchan_cmd);
install_element_ve(&show_net_cmd);
install_element_ve(&show_bts_cmd);
install_element_ve(&show_trx_cmd);
install_element_ve(&show_ts_cmd);
install_element_ve(&show_lchan_cmd);
install_element(VIEW_NODE, &show_e1drv_cmd);
install_element(VIEW_NODE, &show_e1line_cmd);
install_element(VIEW_NODE, &show_e1ts_cmd);
install_element_ve(&show_e1drv_cmd);
install_element_ve(&show_e1line_cmd);
install_element_ve(&show_e1ts_cmd);
install_element(VIEW_NODE, &show_paging_cmd);
install_element_ve(&show_paging_cmd);
openbsc_vty_add_cmds();

View File

@ -324,14 +324,13 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net)
void openbsc_vty_add_cmds()
{
install_element(VIEW_NODE, &enable_logging_cmd);
install_element(VIEW_NODE, &disable_logging_cmd);
install_element(VIEW_NODE, &logging_fltr_imsi_cmd);
install_element(VIEW_NODE, &logging_fltr_all_cmd);
install_element(VIEW_NODE, &logging_use_clr_cmd);
install_element(VIEW_NODE, &logging_prnt_timestamp_cmd);
install_element(VIEW_NODE, &logging_set_category_mask_cmd);
install_element(VIEW_NODE, &logging_level_cmd);
install_element(VIEW_NODE, &show_logging_vty_cmd);
install_element_ve(&enable_logging_cmd);
install_element_ve(&disable_logging_cmd);
install_element_ve(&logging_fltr_imsi_cmd);
install_element_ve(&logging_fltr_all_cmd);
install_element_ve(&logging_use_clr_cmd);
install_element_ve(&logging_prnt_timestamp_cmd);
install_element_ve(&logging_set_category_mask_cmd);
install_element_ve(&logging_level_cmd);
install_element_ve(&show_logging_vty_cmd);
}

View File

@ -544,16 +544,16 @@ int bsc_vty_init_extra(struct gsm_network *net)
register_signal_handler(SS_SCALL, scall_cbfn, NULL);
install_element(VIEW_NODE, &show_subscr_cmd);
install_element(VIEW_NODE, &show_subscr_cache_cmd);
install_element_ve(&show_subscr_cmd);
install_element_ve(&show_subscr_cache_cmd);
install_element(VIEW_NODE, &sms_send_pend_cmd);
install_element_ve(&sms_send_pend_cmd);
install_element(VIEW_NODE, &subscriber_send_sms_cmd);
install_element(VIEW_NODE, &subscriber_silent_sms_cmd);
install_element(VIEW_NODE, &subscriber_silent_call_start_cmd);
install_element(VIEW_NODE, &subscriber_silent_call_stop_cmd);
install_element(VIEW_NODE, &show_stats_cmd);
install_element_ve(&subscriber_send_sms_cmd);
install_element_ve(&subscriber_silent_sms_cmd);
install_element_ve(&subscriber_silent_call_start_cmd);
install_element_ve(&subscriber_silent_call_stop_cmd);
install_element_ve(&show_stats_cmd);
install_element(CONFIG_NODE, &cfg_subscr_cmd);
install_node(&subscr_node, dummy_config_write);