forked from Mirror/frr
Vtysh compiles cleanly as well.
This commit is contained in:
parent
ea8e9d972e
commit
dda095222f
|
@ -1,3 +1,10 @@
|
||||||
|
2004-10-07 Hasso Tepper <hasso at quagga.net>
|
||||||
|
|
||||||
|
* vtysh.c, vtysh.h, vtysh_config.c, vtysh_main.c: Fix compiler
|
||||||
|
warnings: make strings const, signed -> unsigned, remove unused
|
||||||
|
variables.
|
||||||
|
* vtysh_config.c: Fix crash introduced with previous patch.
|
||||||
|
|
||||||
2004-10-03 Hasso Tepper <hasso at quagga.net>
|
2004-10-03 Hasso Tepper <hasso at quagga.net>
|
||||||
|
|
||||||
* vtsyh_main.c: Enter into enable node by default. Disable node doesn't
|
* vtsyh_main.c: Enter into enable node by default. Disable node doesn't
|
||||||
|
|
|
@ -161,7 +161,7 @@ vtysh_client_config (struct vtysh_client *vclient, char *line)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
vtysh_client_execute (struct vtysh_client *vclient, char *line, FILE *fp)
|
vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char buf[1001];
|
char buf[1001];
|
||||||
|
@ -245,7 +245,7 @@ vtysh_pager_init ()
|
||||||
|
|
||||||
/* Command execution over the vty interface. */
|
/* Command execution over the vty interface. */
|
||||||
void
|
void
|
||||||
vtysh_execute_func (char *line, int pager)
|
vtysh_execute_func (const char *line, int pager)
|
||||||
{
|
{
|
||||||
int ret, cmd_stat;
|
int ret, cmd_stat;
|
||||||
vector vline;
|
vector vline;
|
||||||
|
@ -390,13 +390,13 @@ vtysh_execute_func (char *line, int pager)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vtysh_execute_no_pager (char *line)
|
vtysh_execute_no_pager (const char *line)
|
||||||
{
|
{
|
||||||
vtysh_execute_func (line, 0);
|
vtysh_execute_func (line, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vtysh_execute (char *line)
|
vtysh_execute (const char *line)
|
||||||
{
|
{
|
||||||
vtysh_execute_func (line, 1);
|
vtysh_execute_func (line, 1);
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ int
|
||||||
vtysh_rl_describe ()
|
vtysh_rl_describe ()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
unsigned int i;
|
||||||
vector vline;
|
vector vline;
|
||||||
vector describe;
|
vector describe;
|
||||||
int width;
|
int width;
|
||||||
|
@ -1576,9 +1576,6 @@ DEFUN (vtysh_write_memory,
|
||||||
{
|
{
|
||||||
int ret = CMD_SUCCESS;
|
int ret = CMD_SUCCESS;
|
||||||
char line[] = "write memory\n";
|
char line[] = "write memory\n";
|
||||||
char *vtysh_conf;
|
|
||||||
extern struct host host;
|
|
||||||
FILE *fp;
|
|
||||||
|
|
||||||
/* If integrated Quagga.conf explicitely set. */
|
/* If integrated Quagga.conf explicitely set. */
|
||||||
if (vtysh_writeconfig_integrated)
|
if (vtysh_writeconfig_integrated)
|
||||||
|
@ -1700,7 +1697,7 @@ DEFUN (vtysh_show_running_daemons,
|
||||||
|
|
||||||
/* Execute command in child process. */
|
/* Execute command in child process. */
|
||||||
int
|
int
|
||||||
execute_command (char *command, int argc, char *arg1, char *arg2)
|
execute_command (const char *command, int argc, char *arg1, char *arg2)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
@ -1871,7 +1868,7 @@ vtysh_install_default (enum node_type node)
|
||||||
|
|
||||||
/* Making connection to protocol daemon. */
|
/* Making connection to protocol daemon. */
|
||||||
int
|
int
|
||||||
vtysh_connect (struct vtysh_client *vclient, char *path)
|
vtysh_connect (struct vtysh_client *vclient, const char *path)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int sock, len;
|
int sock, len;
|
||||||
|
|
|
@ -51,8 +51,8 @@ void vtysh_connect_all ();
|
||||||
void vtysh_readline_init ();
|
void vtysh_readline_init ();
|
||||||
void vtysh_user_init ();
|
void vtysh_user_init ();
|
||||||
|
|
||||||
void vtysh_execute (char *);
|
void vtysh_execute (const char *);
|
||||||
void vtysh_execute_no_pager (char *);
|
void vtysh_execute_no_pager (const char *);
|
||||||
|
|
||||||
char *vtysh_prompt ();
|
char *vtysh_prompt ();
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ config_del (struct config* config)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct config *
|
struct config *
|
||||||
config_get (int index, char *line)
|
config_get (int index, const char *line)
|
||||||
{
|
{
|
||||||
struct config *config;
|
struct config *config;
|
||||||
struct config *config_loop;
|
struct config *config_loop;
|
||||||
|
@ -122,13 +122,13 @@ config_get (int index, char *line)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
config_add_line (struct list *config, char *line)
|
config_add_line (struct list *config, const char *line)
|
||||||
{
|
{
|
||||||
listnode_add (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
|
listnode_add (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
config_add_line_uniq (struct list *config, char *line)
|
config_add_line_uniq (struct list *config, const char *line)
|
||||||
{
|
{
|
||||||
struct listnode *nn;
|
struct listnode *nn;
|
||||||
char *pnt;
|
char *pnt;
|
||||||
|
@ -142,7 +142,7 @@ config_add_line_uniq (struct list *config, char *line)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vtysh_config_parse_line (char *line)
|
vtysh_config_parse_line (const char *line)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
static struct config *config = NULL;
|
static struct config *config = NULL;
|
||||||
|
@ -294,7 +294,7 @@ vtysh_config_dump (FILE *fp)
|
||||||
struct config *config;
|
struct config *config;
|
||||||
struct list *master;
|
struct list *master;
|
||||||
char *line;
|
char *line;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
LIST_LOOP (config_top, line, nn)
|
LIST_LOOP (config_top, line, nn)
|
||||||
{
|
{
|
||||||
|
@ -403,7 +403,7 @@ vtysh_read_config (char *config_default_dir)
|
||||||
void
|
void
|
||||||
vtysh_config_write ()
|
vtysh_config_write ()
|
||||||
{
|
{
|
||||||
char *line;
|
char line[81];
|
||||||
extern struct host host;
|
extern struct host host;
|
||||||
|
|
||||||
if (host.name)
|
if (host.name)
|
||||||
|
|
|
@ -190,7 +190,6 @@ main (int argc, char **argv, char **env)
|
||||||
int eval_flag = 0;
|
int eval_flag = 0;
|
||||||
int boot_flag = 0;
|
int boot_flag = 0;
|
||||||
char *eval_line = NULL;
|
char *eval_line = NULL;
|
||||||
char *integrated_file = NULL;
|
|
||||||
|
|
||||||
/* Preserve name of myself. */
|
/* Preserve name of myself. */
|
||||||
progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
|
progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
|
||||||
|
|
Loading…
Reference in a new issue