summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhasso <hasso>2004-09-23 19:18:23 +0000
committerhasso <hasso>2004-09-23 19:18:23 +0000
commit52dc7ee65f8d887b0730abc0a5d44d27fc6ecafd (patch)
treea557339540c56dd3953c29a50ca0e48c1911efc8 /lib
parent44983cf8a9c587dfbcad294b9dfe4dccbb68ba98 (diff)
Remove usage of evil list and listnode typedefs.
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/if.c30
-rw-r--r--lib/if.h4
-rw-r--r--lib/linklist.c8
-rw-r--r--lib/linklist.h11
5 files changed, 30 insertions, 28 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 149403f6..7b325783 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-23 Hasso Tepper <hasso at quagga.net>
+
+ * linklist.h: Remove list and listnode typedefs.
+ * *.[c|h]: list -> struct list *, listnode -> struct listnode *.
+
2004-09-17 Paul Jakma <paul@dishone.st>
* sockopt.c: Add missing bracket
diff --git a/lib/if.c b/lib/if.c
index d80e2347..43e84a43 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -179,7 +179,7 @@ if_add_hook (int type, int (*func)(struct interface *ifp))
struct interface *
if_lookup_by_index (unsigned int index)
{
- listnode node;
+ struct listnode *node;
struct interface *ifp;
for (node = listhead (iflist); node; nextnode (node))
@@ -194,7 +194,7 @@ if_lookup_by_index (unsigned int index)
char *
ifindex2ifname (unsigned int index)
{
- listnode node;
+ struct listnode *node;
struct interface *ifp;
for (node = listhead (iflist); node; nextnode (node))
@@ -210,7 +210,7 @@ ifindex2ifname (unsigned int index)
struct interface *
if_lookup_by_name (char *name)
{
- listnode node;
+ struct listnode *node;
struct interface *ifp;
for (node = listhead (iflist); node; nextnode (node))
@@ -226,8 +226,8 @@ if_lookup_by_name (char *name)
struct interface *
if_lookup_exact_address (struct in_addr src)
{
- listnode node;
- listnode cnode;
+ struct listnode *node;
+ struct listnode *cnode;
struct interface *ifp;
struct prefix *p;
struct connected *c;
@@ -256,10 +256,10 @@ if_lookup_exact_address (struct in_addr src)
struct interface *
if_lookup_address (struct in_addr src)
{
- listnode node;
+ struct listnode *node;
struct prefix addr;
struct prefix best;
- listnode cnode;
+ struct listnode *cnode;
struct interface *ifp;
struct prefix *p;
struct connected *c;
@@ -429,7 +429,7 @@ if_flag_dump (unsigned long flag)
void
if_dump (struct interface *ifp)
{
- listnode node;
+ struct listnode *node;
zlog_info ("Interface %s index %d metric %d mtu %d "
#ifdef HAVE_IPV6
@@ -450,7 +450,7 @@ if_dump (struct interface *ifp)
void
if_dump_all ()
{
- listnode node;
+ struct listnode *node;
for (node = listhead (iflist); node; nextnode (node))
if_dump (getdata (node));
@@ -560,8 +560,8 @@ DEFUN (show_address,
SHOW_STR
"address\n")
{
- listnode node;
- listnode node2;
+ struct listnode *node;
+ struct listnode *node2;
struct interface *ifp;
struct connected *ifc;
struct prefix *p;
@@ -681,7 +681,7 @@ connected_lookup_address (struct interface *ifp, struct in_addr dst)
{
struct prefix addr;
struct prefix best;
- listnode cnode;
+ struct listnode *cnode;
struct prefix *p;
struct connected *c;
struct connected *match;
@@ -760,7 +760,7 @@ connected_add_by_prefix (struct interface *ifp, struct prefix *p,
unsigned int
if_nametoindex (const char *name)
{
- listnode node;
+ struct listnode *node;
struct interface *ifp;
for (node = listhead (iflist); node; nextnode (node))
@@ -777,7 +777,7 @@ if_nametoindex (const char *name)
char *
if_indextoname (unsigned int ifindex, char *name)
{
- listnode node;
+ struct listnode *node;
struct interface *ifp;
for (node = listhead (iflist); node; nextnode (node))
@@ -849,7 +849,7 @@ ifaddr_ipv4_lookup (struct in_addr *addr, unsigned int ifindex)
struct prefix_ipv4 p;
struct route_node *rn;
struct interface *ifp;
- listnode node;
+ struct listnode *node;
if (addr)
{
diff --git a/lib/if.h b/lib/if.h
index 70a12860..47e992c3 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -117,7 +117,7 @@ struct interface
void *distribute_out;
/* Connected address list. */
- list connected;
+ struct list *connected;
/* Daemon specific interface data pointer. */
void *info;
@@ -222,7 +222,7 @@ char *if_indextoname (unsigned int, char *);
#endif
/* Exported variables. */
-extern list iflist;
+extern struct list *iflist;
extern struct cmd_element interface_desc_cmd;
extern struct cmd_element no_interface_desc_cmd;
extern struct cmd_element interface_cmd;
diff --git a/lib/linklist.c b/lib/linklist.c
index 1c95da4a..3970c24f 100644
--- a/lib/linklist.c
+++ b/lib/linklist.c
@@ -244,7 +244,7 @@ list_delete (struct list *list)
struct listnode *
listnode_lookup (struct list *list, void *data)
{
- listnode node;
+ struct listnode *node;
assert(list);
for (node = list->head; node; nextnode (node))
@@ -255,7 +255,7 @@ listnode_lookup (struct list *list, void *data)
/* Delete the node from list. For ospfd and ospf6d. */
void
-list_delete_node (list list, listnode node)
+list_delete_node (struct list *list, struct listnode *node)
{
if (node->prev)
node->prev->next = node->next;
@@ -271,7 +271,7 @@ list_delete_node (list list, listnode node)
/* ospf_spf.c */
void
-list_add_node_prev (list list, listnode current, void *val)
+list_add_node_prev (struct list *list, struct listnode *current, void *val)
{
struct listnode *node;
@@ -292,7 +292,7 @@ list_add_node_prev (list list, listnode current, void *val)
/* ospf_spf.c */
void
-list_add_node_next (list list, listnode current, void *val)
+list_add_node_next (struct list *list, struct listnode *current, void *val)
{
struct listnode *node;
diff --git a/lib/linklist.h b/lib/linklist.h
index 303b0bce..b766420f 100644
--- a/lib/linklist.h
+++ b/lib/linklist.h
@@ -22,9 +22,6 @@
#ifndef _ZEBRA_LINKLIST_H
#define _ZEBRA_LINKLIST_H
-typedef struct list *list;
-typedef struct listnode *listnode;
-
struct listnode
{
struct listnode *next;
@@ -68,12 +65,12 @@ void list_delete (struct list *);
void list_delete_all_node (struct list *);
/* For ospfd and ospf6d. */
-void list_delete_node (list, listnode);
+void list_delete_node (struct list *, struct listnode *);
/* For ospf_spf.c */
-void list_add_node_prev (list, listnode, void *);
-void list_add_node_next (list, listnode, void *);
-void list_add_list (list, list);
+void list_add_node_prev (struct list *, struct listnode *, void *);
+void list_add_node_next (struct list *, struct listnode *, void *);
+void list_add_list (struct list *, struct list *);
/* List iteration macro. */
#define LIST_LOOP(L,V,N) \