summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorpaul <paul>2005-04-07 07:30:20 +0000
committerpaul <paul>2005-04-07 07:30:20 +0000
commit1eb8ef2584833f18fb674e127d59cb5a7f771482 (patch)
treef5b09d4781de9a9b08839fefb6530e64d2d2ec31 /vtysh
parent5920990fecba7e2430af3cfaa8bcbaed40d0ba1a (diff)
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
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);