summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/lib/command.c b/lib/command.c
index a9085eb7..4887f94f 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1,5 +1,5 @@
/*
- $Id: command.c,v 1.55 2007/04/28 22:14:10 ajs Exp $
+ $Id$
Command interpreter routine for virtual terminal [aka TeletYpe]
Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -41,31 +41,37 @@ vector cmdvec = NULL;
struct host host;
/* Standard command node structures. */
-static struct cmd_node auth_node =
+struct cmd_node auth_node =
{
AUTH_NODE,
"Password: ",
};
-static struct cmd_node view_node =
+struct cmd_node view_node =
{
VIEW_NODE,
"%s> ",
};
-static struct cmd_node auth_enable_node =
+struct cmd_node restricted_node =
+{
+ RESTRICTED_NODE,
+ "%s$ ",
+};
+
+struct cmd_node auth_enable_node =
{
AUTH_ENABLE_NODE,
"Password: ",
};
-static struct cmd_node enable_node =
+struct cmd_node enable_node =
{
ENABLE_NODE,
"%s# ",
};
-static struct cmd_node config_node =
+struct cmd_node config_node =
{
CONFIG_NODE,
"%s(config)# ",
@@ -1563,6 +1569,7 @@ cmd_try_do_shortcut (enum node_type node, char* first_word) {
node != VIEW_NODE &&
node != AUTH_ENABLE_NODE &&
node != ENABLE_NODE &&
+ node != RESTRICTED_NODE &&
0 == strcmp( "do", first_word ) )
return 1;
return 0;
@@ -2376,6 +2383,7 @@ DEFUN (config_exit,
{
case VIEW_NODE:
case ENABLE_NODE:
+ case RESTRICTED_NODE:
if (vty_shell (vty))
exit (0);
else
@@ -2431,6 +2439,7 @@ DEFUN (config_end,
{
case VIEW_NODE:
case ENABLE_NODE:
+ case RESTRICTED_NODE:
/* Nothing to do. */
break;
case CONFIG_NODE:
@@ -3538,6 +3547,7 @@ cmd_init (int terminal)
install_node (&enable_node, NULL);
install_node (&auth_node, NULL);
install_node (&auth_enable_node, NULL);
+ install_node (&restricted_node, NULL);
install_node (&config_node, config_write_host);
/* Each node's basic commands. */
@@ -3553,6 +3563,15 @@ cmd_init (int terminal)
install_element (VIEW_NODE, &config_terminal_no_length_cmd);
install_element (VIEW_NODE, &show_logging_cmd);
install_element (VIEW_NODE, &echo_cmd);
+
+ install_element (RESTRICTED_NODE, &config_list_cmd);
+ install_element (RESTRICTED_NODE, &config_exit_cmd);
+ install_element (RESTRICTED_NODE, &config_quit_cmd);
+ install_element (RESTRICTED_NODE, &config_help_cmd);
+ install_element (RESTRICTED_NODE, &config_enable_cmd);
+ install_element (RESTRICTED_NODE, &config_terminal_length_cmd);
+ install_element (RESTRICTED_NODE, &config_terminal_no_length_cmd);
+ install_element (RESTRICTED_NODE, &echo_cmd);
}
if (terminal)
@@ -3620,6 +3639,7 @@ cmd_init (int terminal)
install_element (VIEW_NODE, &show_thread_cpu_cmd);
install_element (ENABLE_NODE, &show_thread_cpu_cmd);
+ install_element (RESTRICTED_NODE, &show_thread_cpu_cmd);
install_element (VIEW_NODE, &show_work_queues_cmd);
install_element (ENABLE_NODE, &show_work_queues_cmd);
}