{
int fd;
} vtysh_client[VTYSH_INDEX_MAX];
-\f
+
/* When '^Z' is received from vty, move down to the enable mode. */
int
vtysh_end ()
}
DEFUNSH (VTYSH_ALL,
- vtysh_log_file,
- vtysh_log_file_cmd,
- "log file FILENAME",
- "Logging control\n"
- "Logging to file\n"
- "Logging filename\n")
+ vtysh_log_file,
+ vtysh_log_file_cmd,
+ "log file FILENAME",
+ "Logging control\n"
+ "Logging to file\n"
+ "Logging filename\n")
{
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_ALL,
- no_vtysh_log_file,
- no_vtysh_log_file_cmd,
- "no log file [FILENAME]",
- NO_STR
- "Logging control\n"
- "Cancel logging to file\n"
- "Logging file name\n")
+ no_vtysh_log_file,
+ no_vtysh_log_file_cmd,
+ "no log file [FILENAME]",
+ NO_STR
+ "Logging control\n"
+ "Cancel logging to file\n"
+ "Logging file name\n")
{
return CMD_SUCCESS;
}
if (cmd_stat != CMD_WARNING)
cmd_stat = vtysh_client_execute (&vtysh_client[VTYSH_INDEX_BGP],
line, fp);
- if (cmd_stat != CMD_WARNING)
- cmd_stat = vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS], line, fp);
+ if (cmd_stat != CMD_WARNING)
+ cmd_stat = vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS], line, fp);
if (cmd_stat)
{
- line = "end";
- vline = cmd_make_strvec (line);
+ line = "end";
+ vline = cmd_make_strvec (line);
- if (vline == NULL)
+ if (vline == NULL)
{
if (pager && vtysh_pager_name && fp && closepager)
{
return;
}
- ret = cmd_execute_command (vline, vty, &cmd);
- cmd_free_strvec (vline);
- if (ret != CMD_SUCCESS_DAEMON)
- break;
+ ret = cmd_execute_command (vline, vty, &cmd);
+ cmd_free_strvec (vline);
+ if (ret != CMD_SUCCESS_DAEMON)
+ break;
}
else
if (cmd->func)
{
(*cmd->func) (cmd, vty, 0, NULL);
break;
- }
+ }
}
if (cmd->daemon & VTYSH_ZEBRA)
if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_BGP], line, fp)
!= CMD_SUCCESS)
break;
- if (cmd->daemon & VTYSH_ISISD)
- if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS], line, fp)
- != CMD_SUCCESS)
- break;
+ if (cmd->daemon & VTYSH_ISISD)
+ if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS], line, fp)
+ != CMD_SUCCESS)
+ break;
if (cmd->func)
(*cmd->func) (cmd, vty, 0, NULL);
}
if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_BGP],
vty->buf, stdout) != CMD_SUCCESS)
break;
- if (cmd->daemon & VTYSH_ISISD)
- if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS],
- vty->buf, stdout) != CMD_SUCCESS)
- break;
+ if (cmd->daemon & VTYSH_ISISD)
+ if (vtysh_client_execute (&vtysh_client[VTYSH_INDEX_ISIS],
+ vty->buf, stdout) != CMD_SUCCESS)
+ break;
if (cmd->func)
(*cmd->func) (cmd, vty, 0, NULL);
}
if (! desc->str)
fprintf (stdout," %-s\n",
- desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd);
+ desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd);
else
fprintf (stdout," %-*s %s\n",
- width,
- desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd,
- desc->str);
+ width,
+ desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd,
+ desc->str);
}
cmd_free_strvec (vline);
}
DEFUNSH (VTYSH_ISISD,
- router_isis,
- router_isis_cmd,
- "router isis WORD",
- ROUTER_STR
- "ISO IS-IS\n"
- "ISO Routing area tag")
+ router_isis,
+ router_isis_cmd,
+ "router isis WORD",
+ ROUTER_STR
+ "ISO IS-IS\n"
+ "ISO Routing area tag")
{
vty->node = ISIS_NODE;
return CMD_SUCCESS;
"Exit current mode and down to previous mode\n")
DEFUNSH (VTYSH_RIPNGD,
- vtysh_exit_ripngd,
- vtysh_exit_ripngd_cmd,
- "exit",
- "Exit current mode and down to previous mode\n")
+ vtysh_exit_ripngd,
+ vtysh_exit_ripngd_cmd,
+ "exit",
+ "Exit current mode and down to previous mode\n")
{
return vtysh_exit (vty);
}
"Exit current mode and down to previous mode\n")
DEFUNSH (VTYSH_OSPF6D,
- vtysh_exit_ospf6d,
- vtysh_exit_ospf6d_cmd,
- "exit",
- "Exit current mode and down to previous mode\n")
+ vtysh_exit_ospf6d,
+ vtysh_exit_ospf6d_cmd,
+ "exit",
+ "Exit current mode and down to previous mode\n")
{
return vtysh_exit (vty);
}
"Exit current mode and down to previous mode\n")
DEFUNSH (VTYSH_ISISD,
- vtysh_exit_isisd,
- vtysh_exit_isisd_cmd,
- "exit",
- "Exit current mode and down to previous mode\n")
+ vtysh_exit_isisd,
+ vtysh_exit_isisd_cmd,
+ "exit",
+ "Exit current mode and down to previous mode\n")
{
return vtysh_exit (vty);
}
} vtysh_wc = {-1,0};
DEFUN (vtysh_write_config,
- vtysh_write_config_cmd,
- "write-config (daemon|integrated)",
- "Specify config files to write to\n"
- "Write per daemon file\n"
- "Write integrated file\n"
-)
+ vtysh_write_config_cmd,
+ "write-config (daemon|integrated)",
+ "Specify config files to write to\n"
+ "Write per daemon file\n"
+ "Write integrated file\n"
+ )
{
if (!strncmp(argv[0],"d",1)) {
vtysh_wc.daemon = 1;
}
DEFUN (no_vtysh_write_config,
- no_vtysh_write_config_cmd,
- "no write-config (daemon|integrated)",
- "Negate per daemon and/or integrated config files\n"
-)
+ no_vtysh_write_config_cmd,
+ "no write-config (daemon|integrated)",
+ "Negate per daemon and/or integrated config files\n"
+ )
{
if (!strncmp(argv[0],"d",1)) {
vtysh_wc.daemon = 0;
"show running-config",
SHOW_STR
"Current operating configuration\n")
-\f
+
/* Execute command in child process. */
int
execute_command (char *command, int argc, char *arg1, char *arg2)
execute_command ("zsh", 0, NULL, NULL);
return CMD_SUCCESS;
}
-\f
+
/* Route map node structure. */
struct cmd_node rmap_node =
{
KEYCHAIN_KEY_NODE,
"%s(config-keychain-key)# "
};
-\f
+
void
vtysh_install_default (enum node_type node)
{
else if (strncmp (line, "router rip", strlen ("router rip")) == 0)
config = config_get (RIP_NODE, line);
else if (strncmp (line, "router ripng", strlen ("router ripng")) == 0)
- config = config_get (RIPNG_NODE, line);
+ config = config_get (RIPNG_NODE, line);
else if (strncmp (line, "router ospf", strlen ("router ospf")) == 0)
- config = config_get (OSPF_NODE, line);
+ config = config_get (OSPF_NODE, line);
else if (strncmp (line, "router ospf6", strlen ("router ospf6")) == 0)
- config = config_get (OSPF6_NODE, line);
+ config = config_get (OSPF6_NODE, line);
else if (strncmp (line, "router bgp", strlen ("router bgp")) == 0)
config = config_get (BGP_NODE, line);
else if (strncmp (line, "router isis", strlen ("router isis")) == 0)
else if (strncmp (line, "access-list", strlen ("access-list")) == 0)
config = config_get (ACCESS_NODE, line);
else if (strncmp (line, "ipv6 access-list", strlen ("ipv6 access-list")) == 0)
- config = config_get (ACCESS_IPV6_NODE, line);
+ config = config_get (ACCESS_IPV6_NODE, line);
else if (strncmp (line, "ip prefix-list", strlen ("ip prefix-list")) == 0)
config = config_get (PREFIX_NODE, line);
else if (strncmp (line, "ipv6 prefix-list", strlen ("ipv6 prefix-list")) == 0)
- config = config_get (PREFIX_IPV6_NODE, line);
+ config = config_get (PREFIX_IPV6_NODE, line);
else if (strncmp (line, "ip as-path access-list", strlen ("ip as-path access-list")) == 0)
config = config_get (AS_LIST_NODE, line);
else if (strncmp (line, "ip community-list", strlen ("ip community-list")) == 0)
LIST_LOOP (master, config, nn)
{
fprintf (fp, "%s\n", config->name);
- fflush (fp);
+ fflush (fp);
LIST_LOOP (config->line, line, nm)
{
#include "vtysh/vtysh.h"
#include "vtysh/vtysh_user.h"
-\f
+
/* VTY shell program name. */
char *progname;
/* Master of threads. */
struct thread_master *master;
-\f
+
/* SIGTSTP handler. This function care user's ^Z input. */
void
sigtstp (int sig)
signal_set (SIGTSTP, sigtstp);
signal_set (SIGPIPE, SIG_IGN);
}
-\f
+
/* Help information display. */
static void
usage (int status)
/* VTY shell options, we use GNU getopt library. */
struct option longopts[] =
{
- { "boot", no_argument, NULL, 'b'},
+ { "boot", no_argument, NULL, 'b'},
/* For compatibility with older zebra/quagga versions */
{ "eval", required_argument, NULL, 'e'},
{ "command", required_argument, NULL, 'c'},
{ "help", no_argument, NULL, 'h'},
{ 0 }
};
-\f
+
/* Read a string, and return a pointer to it. Returns NULL on EOF. */
char *
vtysh_rl_gets ()
return (line_read);
}
-\f
+
/* VTY shell main routine. */
int
main (int argc, char **argv, char **env)