summaryrefslogtreecommitdiff
path: root/lib/keychain.c
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 /lib/keychain.c
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 'lib/keychain.c')
-rw-r--r--lib/keychain.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/keychain.c b/lib/keychain.c
index a3219ef4..2b5b0684 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -61,13 +61,13 @@ key_free (struct key *key)
struct keychain *
keychain_lookup (const char *name)
{
- struct listnode *nn;
+ struct listnode *node;
struct keychain *keychain;
if (name == NULL)
return NULL;
- LIST_LOOP (keychain_list, keychain, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain_list, node, keychain))
{
if (strcmp (keychain->name, name) == 0)
return keychain;
@@ -127,10 +127,10 @@ keychain_delete (struct keychain *keychain)
struct key *
key_lookup (const struct keychain *keychain, u_int32_t index)
{
- struct listnode *nn;
+ struct listnode *node;
struct key *key;
- LIST_LOOP (keychain->key, key, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain->key, node, key))
{
if (key->index == index)
return key;
@@ -141,13 +141,13 @@ key_lookup (const struct keychain *keychain, u_int32_t index)
struct key *
key_lookup_for_accept (const struct keychain *keychain, u_int32_t index)
{
- struct listnode *nn;
+ struct listnode *node;
struct key *key;
time_t now;
now = time (NULL);
- LIST_LOOP (keychain->key, key, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain->key, node, key))
{
if (key->index >= index)
{
@@ -165,13 +165,13 @@ key_lookup_for_accept (const struct keychain *keychain, u_int32_t index)
struct key *
key_match_for_accept (const struct keychain *keychain, const char *auth_str)
{
- struct listnode *nn;
+ struct listnode *node;
struct key *key;
time_t now;
now = time (NULL);
- LIST_LOOP (keychain->key, key, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain->key, node, key))
{
if (key->accept.start == 0 ||
(key->accept.start <= now &&
@@ -185,13 +185,13 @@ key_match_for_accept (const struct keychain *keychain, const char *auth_str)
struct key *
key_lookup_for_send (const struct keychain *keychain)
{
- struct listnode *nn;
+ struct listnode *node;
struct key *key;
time_t now;
now = time (NULL);
- LIST_LOOP (keychain->key, key, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain->key, node, key))
{
if (key->send.start == 0)
return key;
@@ -881,15 +881,15 @@ keychain_config_write (struct vty *vty)
{
struct keychain *keychain;
struct key *key;
- struct listnode *nn;
- struct listnode *nm;
+ struct listnode *node;
+ struct listnode *knode;
char buf[BUFSIZ];
- LIST_LOOP (keychain_list, keychain, nn)
+ for (ALL_LIST_ELEMENTS_RO (keychain_list, node, keychain))
{
vty_out (vty, "key chain %s%s", keychain->name, VTY_NEWLINE);
- LIST_LOOP (keychain->key, key, nm)
+ for (ALL_LIST_ELEMENTS_RO (keychain->key, knode, key))
{
vty_out (vty, " key %d%s", key->index, VTY_NEWLINE);