// vim: sw=8 ts=8
char const *cvs_name = "$Name: $";
-char const *cvs_id_cli = "$Id: cli.c,v 1.25 2004/11/11 03:07:42 bodea Exp $";
+char const *cvs_id_cli = "$Id: cli.c,v 1.28 2004/11/16 07:54:32 bodea Exp $";
#include <stdio.h>
#include <stdarg.h>
extern radiust *radius;
extern ippoolt *ip_address_pool;
extern struct Tstats *_statistics;
-struct cli_def *cli = NULL;
-int cli_quit = 0;
+static struct cli_def *cli = NULL;
extern struct configt *config;
extern struct config_descriptt config_values[];
#ifdef RINGBUFFER
extern struct cli_tunnel_actions *cli_tunnel_actions;
extern tbft *filter_list;
-char *debug_levels[] = {
+static char *debug_levels[] = {
"CRIT",
"ERROR",
"WARN",
char data;
} debug_flags;
-int debug_session;
-int debug_tunnel;
-int debug_rb_tail;
-FILE *save_config_fh;
+static int debug_session;
+static int debug_tunnel;
+static int debug_rb_tail;
static int cmd_show_session(struct cli_def *cli, char *command, char **argv, int argc);
static int cmd_show_tunnels(struct cli_def *cli, char *command, char **argv, int argc);
#ifdef BGP
#define MODE_CONFIG_BGP 8
static int cmd_router_bgp(struct cli_def *cli, char *command, char **argv, int argc);
-static int cmd_router_bgp_exit(struct cli_def *cli, char *command, char **argv, int argc);
static int cmd_router_bgp_neighbour(struct cli_def *cli, char *command, char **argv, int argc);
static int cmd_router_bgp_no_neighbour(struct cli_def *cli, char *command, char **argv, int argc);
static int cmd_show_bgp(struct cli_def *cli, char *command, char **argv, int argc);
c = cli_register_command(cli, NULL, "router", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG, NULL);
cli_register_command(cli, c, "bgp", cmd_router_bgp, PRIVILEGE_PRIVILEGED, MODE_CONFIG, "Configure BGP");
- cli_register_command(cli, NULL, "exit", cmd_router_bgp_exit, PRIVILEGE_PRIVILEGED, MODE_CONFIG_BGP, "Exit from BGP configuration");
cli_register_command(cli, NULL, "neighbour", cmd_router_bgp_neighbour, PRIVILEGE_PRIVILEGED, MODE_CONFIG_BGP, "Configure BGP neighbour");
c = cli_register_command(cli, NULL, "no", NULL, PRIVILEGE_PRIVILEGED, MODE_CONFIG_BGP, NULL);
exit(0);
}
-void cli_print_log(struct cli_def *cli, char *string)
+static void cli_print_log(struct cli_def *cli, char *string)
{
LOG(3, 0, 0, 0, "%s\n", string);
}
return CLI_OK;
}
-void print_save_config(struct cli_def *cli, char *string)
+static FILE *save_config_fh = 0;
+static void print_save_config(struct cli_def *cli, char *string)
{
if (save_config_fh)
fprintf(save_config_fh, "%s\n", string);
cmd_show_run(cli, command, argv, argc);
cli_print_callback(cli, NULL);
fclose(save_config_fh);
+ save_config_fh = 0;
}
else
{
return CLI_OK;
}
-char *duration(time_t secs)
+static char *duration(time_t secs)
{
static char *buf = NULL;
int p = 0;
return CLI_OK;
}
-static int cmd_router_bgp_exit(struct cli_def *cli, char *command, char **argv, int argc)
-{
- if (CLI_HELP_REQUESTED)
- return CLI_HELP_NO_ARGS;
-
- cli_set_configmode(cli, MODE_CONFIG, NULL);
- return CLI_OK;
-}
-
static int find_bgp_neighbour(char *name)
{
int i;
{
cli_print(cli, "");
cli_print(cli, "Peer AS Address "
- "State Retries Retry in Route Pend Timers");
+ "State Retries Retry in Route Pend Timers");
cli_print(cli, "------------------ ----- --------------- "
"----------- ------- -------- ----- ---- ---------");
}