* Update cli callbacks to work with libcli 1.6.

This supports privileged and unprivileged commands, as well as a configuration
  mode
* Add help for all cli commands
* Add "show version" command
* Fix uptime counter display
* Fix nasty bug where cluster basetime can be set to 0 when sending initial
  heartbeat
* Don't rmmod ip_conntrack, as this can take a lot of time
* Re-order logging in routeset such that the action is given before any error
* Use the correct gateway address when deleting routes
* Remove any routes when address changes
* Require authentication if telnet from remote ip
* Require enable password always
* Return error if show pool done on slave
* We MUST immediately exit if we're the wrong master!
This commit is contained in:
David Parrish 2004-06-28 02:43:13 +00:00
parent df561af44e
commit 7aa420ce9f
18 changed files with 765 additions and 332 deletions

26
bgp.c
View file

@ -10,7 +10,7 @@
* nor RFC2385 (which requires a kernel patch on 2.4 kernels).
*/
/* $Id: bgp.c,v 1.1 2004-06-23 03:52:24 fred_nerk Exp $ */
char const *cvs_id_bgp = "$Id: bgp.c,v 1.2 2004-06-28 02:43:13 fred_nerk Exp $";
#include <stdlib.h>
#include <unistd.h>
@ -1188,6 +1188,12 @@ int cmd_show_bgp(struct cli_def *cli, char *command, char **argv, int argc)
if (!bgp_configured)
return CLI_OK;
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, 1,
"A.B.C.D", "BGP peer address",
"NAME", "BGP peer name",
NULL);
cli_print(cli, "BGPv%d router identifier %s, local AS number %d, "
"hold time %ds", BGP_VERSION, inet_toa(my_address), (int) our_as,
BGP_HOLD_TIME);
@ -1235,6 +1241,12 @@ int cmd_suspend_bgp(struct cli_def *cli, char *command, char **argv, int argc)
if (!bgp_configured)
return CLI_OK;
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, 1,
"A.B.C.D", "BGP peer address",
"NAME", "BGP peer name",
NULL);
for (i = 0; i < BGP_NUM_PEERS; i++)
{
if (bgp_peers[i].state != Established)
@ -1262,6 +1274,12 @@ int cmd_no_suspend_bgp(struct cli_def *cli, char *command, char **argv, int argc
if (!bgp_configured)
return CLI_OK;
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, 1,
"A.B.C.D", "BGP peer address",
"NAME", "BGP peer name",
NULL);
for (i = 0; i < BGP_NUM_PEERS; i++)
{
if (bgp_peers[i].state != Established)
@ -1290,6 +1308,12 @@ int cmd_restart_bgp(struct cli_def *cli, char *command, char **argv, int argc)
if (!bgp_configured)
return CLI_OK;
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, 1,
"A.B.C.D", "BGP peer address",
"NAME", "BGP peer name",
NULL);
for (i = 0; i < BGP_NUM_PEERS; i++)
{
if (!*bgp_peers[i].name)