#include <stdio.h>
#include <string.h>
+#include "linklist.h"
#include "command.h"
#include "memory.h"
#include "vtysh/vtysh.h"
{ .fd = -1, .name = "pimd", .flag = VTYSH_PIMD, .path = PIM_VTYSH_PATH, .next = NULL},
};
-/*
- * Compiler is warning about prototypes not being declared.
- * The DEFUNSH and DEFUN macro's are messing with the
- * compiler I believe. This is just to make it happy.
- */
-int vtysh_end(void);
-int vtysh_rl_describe(void);
-void vtysh_exit_ripd_only(void);
-int vtysh_connect_all_instances(struct vtysh_client *);
-
-
-/* We need direct access to ripd to implement vtysh_exit_ripd_only. */
-static struct vtysh_client *ripd_client = NULL;
-
-
/* Using integrated config from Quagga.conf. Default is no. */
int vtysh_writeconfig_integrated = 0;
return CMD_SUCCESS;
}
-void
-vtysh_exit_ripd_only (void)
-{
- if (ripd_client)
- vtysh_client_execute (ripd_client, "exit", stdout);
-}
-
-
void
vtysh_pager_init (void)
{
}
/* We don't care about the point of the cursor when '?' is typed. */
-int
+static int
vtysh_rl_describe (void)
{
int ret;
extern struct cmd_node vty_node;
/* When '^Z' is received from vty, move down to the enable mode. */
-int
+static int
vtysh_end (void)
{
switch (vty->node)
}
}
-int
+static int
vtysh_connect_all_instances (struct vtysh_client *head_client)
{
struct vtysh_client *client;
matches++;
if (vtysh_connect(&vtysh_client[i]) == 0)
rc++;
- /* We need direct access to ripd in vtysh_exit_ripd_only. */
- if (vtysh_client[i].flag == VTYSH_RIPD)
- ripd_client = &vtysh_client[i];
rc += vtysh_connect_all_instances(&vtysh_client[i]);
}
int vtysh_config_from_file (struct vty *, FILE *);
+void config_add_line (struct list *, const char *);
+
int vtysh_mark_file(const char *filename);
int vtysh_read_config (const char *);
#include "vtysh/vtysh.h"
#include "vtysh/vtysh_user.h"
-/*
- * Compiler is warning about prototypes not being declared.
- * The DEFUNSH and DEFUN macro's are messing with the
- * compiler I believe. This is just to make it happy.
- */
-int line_cmp(char *, char*);
-void line_del(char *);
-struct config *config_new(void);
-int config_cmp(struct config *, struct config *);
-void config_del(struct config *);
-struct config *config_get(int, const char *);
-void config_add_line(struct list *, const char *);
-void config_add_line_uniq(struct list *, const char *);
-void vtysh_config_parse_line(const char *);
-
vector configvec;
extern int vtysh_writeconfig_integrated;
struct list *config_top;
-int
+static int
line_cmp (char *c1, char *c2)
{
return strcmp (c1, c2);
}
-void
+static void
line_del (char *line)
{
XFREE (MTYPE_VTYSH_CONFIG_LINE, line);
}
-struct config *
+static struct config *
config_new (void)
{
struct config *config;
return config;
}
-int
+static int
config_cmp (struct config *c1, struct config *c2)
{
return strcmp (c1->name, c2->name);
}
-void
+static void
config_del (struct config* config)
{
list_delete (config->line);
XFREE (MTYPE_VTYSH_CONFIG, config);
}
-struct config *
+static struct config *
config_get (int index, const char *line)
{
struct config *config;
listnode_add (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
}
-void
+static void
config_add_line_uniq (struct list *config, const char *line)
{
struct listnode *node, *nnode;
listnode_add_sort (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
}
-void
+static void
vtysh_config_parse_line (const char *line)
{
char c;
#include "command.h"
#include "memory.h"
#include "privs.h"
+#include "linklist.h"
#include "vtysh/vtysh.h"
#include "vtysh/vtysh_user.h"
#ifdef USE_PAM
static int vtysh_pam(const char *);
#endif
-struct vtysh_user *user_new(void);
-void user_free(struct vtysh_user *);
-struct vtysh_user *user_lookup(const char *);
-struct vtysh_user *user_get(const char *);
int vtysh_auth(void);
void vtysh_user_init(void);
struct list *userlist;
-struct vtysh_user *
+static struct vtysh_user *
user_new (void)
{
return XCALLOC (0, sizeof (struct vtysh_user));
}
-void
-user_free (struct vtysh_user *user)
-{
- XFREE (0, user);
-}
-
-struct vtysh_user *
+static struct vtysh_user *
user_lookup (const char *name)
{
struct listnode *node, *nnode;
}
}
-struct vtysh_user *
+static struct vtysh_user *
user_get (const char *name)
{
struct vtysh_user *user;
}
int
-vtysh_auth ()
+vtysh_auth (void)
{
struct vtysh_user *user;
struct passwd *passwd;
#ifndef _VTYSH_USER_H
#define _VTYSH_USER_H
-int vtysh_auth ();
+int vtysh_auth (void);
+void vtysh_user_init (void);
void user_config_write(void);
char *vtysh_get_home (void);