summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh_config.c18
-rw-r--r--vtysh/vtysh_user.c8
2 files changed, 13 insertions, 13 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index fe8d52fb..70c37462 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -88,7 +88,7 @@ config_get (int index, const char *line)
struct config *config;
struct config *config_loop;
struct list *master;
- struct listnode *nn;
+ struct listnode *node, *nnode;
config = config_loop = NULL;
@@ -102,7 +102,7 @@ config_get (int index, const char *line)
vector_set_index (configvec, index, master);
}
- LIST_LOOP (master, config_loop, nn)
+ for (ALL_LIST_ELEMENTS (master, node, nnode, config_loop))
{
if (strcmp (config_loop->name, line) == 0)
config = config_loop;
@@ -130,10 +130,10 @@ config_add_line (struct list *config, const char *line)
void
config_add_line_uniq (struct list *config, const char *line)
{
- struct listnode *nn;
+ struct listnode *node, *nnode;
char *pnt;
- LIST_LOOP (config, pnt, nn)
+ for (ALL_LIST_ELEMENTS (config, node, nnode, pnt))
{
if (strcmp (pnt, line) == 0)
return;
@@ -294,14 +294,14 @@ vtysh_config_parse (char *line)
void
vtysh_config_dump (FILE *fp)
{
- struct listnode *nn;
- struct listnode *nm;
+ struct listnode *node, *nnode;
+ struct listnode *mnode, *mnnode;
struct config *config;
struct list *master;
char *line;
unsigned int i;
- LIST_LOOP (config_top, line, nn)
+ for (ALL_LIST_ELEMENTS (config_top, node, nnode, line))
{
fprintf (fp, "%s\n", line);
fflush (fp);
@@ -312,12 +312,12 @@ vtysh_config_dump (FILE *fp)
for (i = 0; i < vector_active (configvec); i++)
if ((master = vector_slot (configvec, i)) != NULL)
{
- LIST_LOOP (master, config, nn)
+ for (ALL_LIST_ELEMENTS (master, node, nnode, config))
{
fprintf (fp, "%s\n", config->name);
fflush (fp);
- LIST_LOOP (config->line, line, nm)
+ for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line))
{
fprintf (fp, "%s\n", line);
fflush (fp);
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index f84cca83..1ae2d8cb 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -116,10 +116,10 @@ user_free (struct user *user)
struct user *
user_lookup (const char *name)
{
- struct listnode *nn;
+ struct listnode *node, *nnode;
struct user *user;
- LIST_LOOP (userlist, user, nn)
+ for (ALL_LIST_ELEMENTS (userlist, node, nnode, user))
{
if (strcmp (user->name, name) == 0)
return user;
@@ -130,10 +130,10 @@ user_lookup (const char *name)
void
user_config_write ()
{
- struct listnode *nn;
+ struct listnode *node, *nnode;
struct user *user;
- LIST_LOOP (userlist, user, nn)
+ for (ALL_LIST_ELEMENTS (userlist, node, nnode, user))
{
if (user->nopassword)
printf (" username %s nopassword\n", user->name);