diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 3a0b134..e7e7b1f 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,16 @@
+2004-09-24 Paul Jakma <paul@dishone.st>
+
+        * ospf_apiserver.{c,h}: lists typedef removal cleanup.
+          update some list loops to LIST_LOOP. some miscellaneous indent
+          fixups.
+          (ospf_apiserver_unregister_opaque_type) fix listnode_delete of
+          referenced node in loop.
+        * ospf_interface.h: lists typedef removal cleanup.
+        * ospf_opaque.{c,h}: lists typedef removal cleanup. update some list 
+          loops to LIST_LOOP. miscellaneous style and indent fixups.
+        * ospf_te.{c,h}: ditto
+	* ospf_packet.c: lists typedef removal cleanup.
+
 2004-09-23 Hasso Tepper <hasso at quagga.net>
 
 	* *.[c|h]: list -> struct list *, listnode -> struct listnode *.
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index 6ee1c00..fa2d993 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -73,7 +73,7 @@
  * daemon supports multiple applications concurrently.  */
 
 /* List of all active connections. */
-list apiserver_list;
+struct list *apiserver_list;
 
 /* -----------------------------------------------------------
  * Functions to lookup interfaces
@@ -83,7 +83,7 @@
 struct ospf_interface *
 ospf_apiserver_if_lookup_by_addr (struct in_addr address)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_interface *oi;
   struct ospf *ospf;
 
@@ -91,34 +91,28 @@
     return NULL;
 
   for (node = listhead (ospf->oiflist); node; nextnode (node))
-    {
-      if ((oi = getdata (node)) != NULL
-	  && oi->type != OSPF_IFTYPE_VIRTUALLINK)
-	{
-	  if (IPV4_ADDR_SAME (&address, &oi->address->u.prefix4))
-	    return oi;
-	}
-    }
+  LIST_LOOP (ospf->oiflist, oi, node)
+    if (oi->type != OSPF_IFTYPE_VIRTUALLINK)
+      if (IPV4_ADDR_SAME (&address, &oi->address->u.prefix4))
+        return oi;
+
   return NULL;
 }
 
 struct ospf_interface *
 ospf_apiserver_if_lookup_by_ifp (struct interface *ifp)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_interface *oi;
   struct ospf *ospf;
 
   if (!(ospf = ospf_lookup ()));
     return NULL;
 
-  for (node = listhead (ospf->oiflist); node; nextnode (node))
-    {
-      if ((oi = getdata (node)) && oi->ifp == ifp)
-	{
-	  return oi;
-	}
-    }
+  LIST_LOOP (ospf->oiflist, oi, node)
+    if (oi->ifp == ifp)
+      return oi;
+
   return NULL;
 }
 
@@ -186,19 +180,16 @@
 void
 ospf_apiserver_term (void)
 {
-  listnode node;
+  struct listnode *node;
+  struct ospf_apiserver *apiserv;
 
   /* Unregister wildcard [0/0] type */
   ospf_delete_opaque_functab (0 /* all LSAs */, 
 			      0 /* all opaque types */);
 
   /* Free all client instances */
-  for (node = listhead (apiserver_list); node; nextnode (node))
-    {
-      struct ospf_apiserver *apiserv =
-	(struct ospf_apiserver *) getdata (node);
-      ospf_apiserver_free (apiserv);
-    }
+  LIST_LOOP (apiserver_list, apiserv, node)
+    ospf_apiserver_free (apiserv);
 
   /* Free client list itself */
   list_delete (apiserver_list);
@@ -210,10 +201,11 @@
 static struct ospf_apiserver *
 lookup_apiserver (u_char lsa_type, u_char opaque_type)
 {
-  listnode n1, n2;
+  struct listnode *n1, *n2;
   struct registered_opaque_type *r;
   struct ospf_apiserver *apiserv, *found = NULL;
 
+  /* XXX: this approaches O(n**2) */
   for (n1 = listhead (apiserver_list); n1; nextnode (n1))
     {
       apiserv = (struct ospf_apiserver *) getdata (n1);
@@ -351,7 +343,7 @@
 void
 ospf_apiserver_free (struct ospf_apiserver *apiserv)
 {
-  listnode node;
+  struct listnode *node;
 
   /* Cancel read and write threads. */
   if (apiserv->t_sync_read)
@@ -958,7 +950,10 @@
   listnode_add (apiserv->opaque_types, regtype);
 
   if (IS_DEBUG_OSPF_EVENT)
-    zlog_info ("API: Add LSA-type(%d)/Opaque-type(%d) into apiserv(%p), total#(%d)", lsa_type, opaque_type, apiserv, listcount (apiserv->opaque_types));
+    zlog_info ("API: Add LSA-type(%d)/Opaque-type(%d) into"
+               " apiserv(%p), total#(%d)", 
+               lsa_type, opaque_type, apiserv, 
+               listcount (apiserv->opaque_types));
 
   return 0;
 }
@@ -967,10 +962,12 @@
 ospf_apiserver_unregister_opaque_type (struct ospf_apiserver *apiserv,
 				       u_char lsa_type, u_char opaque_type)
 {
-  listnode node;
+  struct listnode *node, *nextnode;
 
-  for (node = listhead (apiserv->opaque_types); node; nextnode (node))
+  for (node = listhead (apiserv->opaque_types); node; node = nextnode)
     {
+      nextnode = node->next;
+      
       struct registered_opaque_type *regtype = node->data;
 
       /* Check if we really registered this opaque type */
@@ -988,7 +985,10 @@
 	  listnode_delete (apiserv->opaque_types, regtype);
 
           if (IS_DEBUG_OSPF_EVENT)
-            zlog_info ("API: Del LSA-type(%d)/Opaque-type(%d) from apiserv(%p), total#(%d)", lsa_type, opaque_type, apiserv, listcount (apiserv->opaque_types));
+            zlog_info ("API: Del LSA-type(%d)/Opaque-type(%d)"
+                       " from apiserv(%p), total#(%d)", 
+                       lsa_type, opaque_type, apiserv, 
+                       listcount (apiserv->opaque_types));
 
 	  return 0;
 	}
@@ -1005,12 +1005,12 @@
 apiserver_is_opaque_type_registered (struct ospf_apiserver *apiserv,
 				     u_char lsa_type, u_char opaque_type)
 {
-  listnode node;
+  struct listnode *node;
+  struct registered_opaque_type *regtype;
 
-  for (node = listhead (apiserv->opaque_types); node; nextnode (node))
+  /* XXX: how many types are there? if few, why not just a bitmap? */
+  LIST_LOOP (apiserv->opaque_types, regtype, node)
     {
-      struct registered_opaque_type *regtype = node->data;
-
       /* Check if we really registered this opaque type */
       if (regtype->lsa_type == lsa_type &&
 	  regtype->opaque_type == opaque_type)
@@ -1067,25 +1067,24 @@
 void
 ospf_apiserver_notify_ready_type9 (struct ospf_apiserver *apiserv)
 {
-  listnode node;
-  listnode n2;
+  struct listnode *node;
+  struct listnode *n2;
   struct ospf *ospf;
+  struct ospf_interface *oi;
+  struct registered_opaque_type *r;
 
   ospf = ospf_lookup ();
 
-  for (node = listhead (ospf->oiflist); node; nextnode (node))
+  LIST_LOOP (ospf->oiflist, oi, node)
     {
-      struct ospf_interface *oi = (struct ospf_interface *) getdata (node);
-
       /* Check if this interface is indeed ready for type 9 */
       if (!ospf_apiserver_is_ready_type9 (oi))
 	continue;
 
       /* Check for registered opaque type 9 types */
-      for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+      /* XXX: loop-de-loop - optimise me */
+      LIST_LOOP (apiserv->opaque_types, r, n2)
 	{
-	  struct registered_opaque_type *r =
-	    (struct registered_opaque_type *) getdata (n2);
 	  struct msg *msg;
 
 	  if (r->lsa_type == OSPF_OPAQUE_LINK_LSA)
@@ -1119,28 +1118,28 @@
 void
 ospf_apiserver_notify_ready_type10 (struct ospf_apiserver *apiserv)
 {
-  listnode node;
-  listnode n2;
+  struct listnode *node;
+  struct listnode *n2;
   struct ospf *ospf;
-
+  struct ospf_area *area;
+  
   ospf = ospf_lookup ();
 
-  for (node = listhead (ospf->areas); node; nextnode (node))
+  LIST_LOOP (ospf->areas, area, node)
     {
-      struct ospf_area *area = getdata (node);
-
+      struct registered_opaque_type *r;
+      
       if (!ospf_apiserver_is_ready_type10 (area))
 	{
 	  continue;
 	}
 
       /* Check for registered opaque type 10 types */
-      for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+      /* XXX: loop in loop - optimise me */
+      LIST_LOOP (apiserv->opaque_types, r, n2)
 	{
-	  struct registered_opaque_type *r =
-	    (struct registered_opaque_type *) getdata (n2);
 	  struct msg *msg;
-
+	  
 	  if (r->lsa_type == OSPF_OPAQUE_AREA_LSA)
 	    {
 	      /* Yes, this opaque type is ready */
@@ -1170,8 +1169,9 @@
 void
 ospf_apiserver_notify_ready_type11 (struct ospf_apiserver *apiserv)
 {
-  listnode n2;
+  struct listnode *node;
   struct ospf *ospf;
+  struct registered_opaque_type *r;
 
   ospf = ospf_lookup ();
 
@@ -1180,10 +1180,8 @@
     goto out;;
 
   /* Check for registered opaque type 11 types */
-  for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+  LIST_LOOP (apiserv->opaque_types, r, node)
     {
-      struct registered_opaque_type *r =
-	(struct registered_opaque_type *) getdata (n2);
       struct msg *msg;
       struct in_addr noarea_id = { 0L };
 
@@ -1349,7 +1347,7 @@
 ospf_apiserver_handle_sync_lsdb (struct ospf_apiserver *apiserv,
 				 struct msg *msg)
 {
-  listnode node;
+  struct listnode *node;
   u_int32_t seqnum;
   int rc = 0;
   struct msg_sync_lsdb *smsg;
@@ -1363,6 +1361,7 @@
   struct route_node *rn;
   struct ospf_lsa *lsa;
   struct ospf *ospf;
+  struct ospf_area *area;
 
   ospf = ospf_lookup ();
 
@@ -1379,11 +1378,11 @@
   mask = ntohs (smsg->filter.typemask);
 
   /* Iterate over all areas. */
-  for (node = listhead (ospf->areas); node; nextnode (node))
+  LIST_LOOP (ospf->areas, area, node)
     {
-      struct ospf_area *area = node->data;
       int i;
       u_int32_t *area_id = NULL;
+
       /* Compare area_id with area_ids in sync request. */
       if ((i = smsg->filter.num_areas) > 0)
 	{
@@ -1562,18 +1561,14 @@
   /* Type 10 opaque LSA can be originated if there is at least one
      interface belonging to the area that has an active opaque-capable
      neighbor. */
-  listnode node;
+  struct listnode *node;
+  struct ospf_interface *oi;
 
-  for (node = listhead (area->oiflist); node; nextnode (node))
-    {
-      struct ospf_interface *oi = getdata (node);
+  LIST_LOOP (area->oiflist, oi, node)
+    /* Is there an active neighbor attached to this interface? */
+    if (ospf_apiserver_is_ready_type9 (oi))
+      return 1;
 
-      /* Is there an active neighbor attached to this interface? */
-      if (ospf_apiserver_is_ready_type9 (oi))
-	{
-	  return 1;
-	}
-    }
   /* No active neighbor in area */
   return 0;
 }
@@ -1583,16 +1578,14 @@
 {
   /* Type 11 opaque LSA can be originated if there is at least one interface
      that has an active opaque-capable neighbor. */
-  listnode node;
+  struct listnode *node;
+  struct ospf_interface *oi;
 
-  for (node = listhead (ospf->oiflist); node; nextnode (node))
-    {
-      struct ospf_interface *oi = getdata (node);
+  LIST_LOOP (ospf->oiflist, oi, node)
+    /* Is there an active neighbor attached to this interface? */
+    if (ospf_apiserver_is_ready_type9 (oi))
+      return 1;
 
-      /* Is there an active neighbor attached to this interface? */
-      if (ospf_apiserver_is_ready_type9 (oi))
-	return 1;
-    }
   /* No active neighbor at all */
   return 0;
 }
@@ -2054,11 +2047,11 @@
     struct ospf_apiserver *apiserv;
     u_char lsa_type;
     u_char opaque_type;
-  }
-  param;
-  listnode node;
+  } param;
+  struct listnode *node;
   struct ospf * ospf;
-
+  struct ospf_area *area;
+  
   ospf = ospf_lookup();
   assert(ospf);
 
@@ -2067,45 +2060,20 @@
   param.lsa_type = lsa_type;
   param.opaque_type = opaque_type;
 
-#ifdef ORIGINAL_CODING
-  /* Iterate over all areas */
-  for (node = listhead (ospf_top->areas); node; nextnode (node))
-    {
-      struct ospf_area *area = node->data;
-
-      foreach_lsa (OPAQUE_LINK_LSDB (area), (void *) &param, 0,
-		   apiserver_flush_opaque_type_callback);
-      foreach_lsa (OPAQUE_AREA_LSDB (area), (void *) &param, 0,
-		   apiserver_flush_opaque_type_callback);
-    }
-
-  /* For AS-external opaque LSAs */
-  if (ospf->lsdb)
-    {
-      foreach_lsa (OPAQUE_AS_LSDB (ospf_top), (void *) &param, 0,
-		   apiserver_flush_opaque_type_callback);
-    }
-#else /* ORIGINAL_CODING */
   switch (lsa_type)
     {
       struct route_node *rn;
       struct ospf_lsa *lsa;
 
     case OSPF_OPAQUE_LINK_LSA:
-      for (node = listhead (ospf->areas); node; nextnode (node))
-        {
-          struct ospf_area *area = node->data;
-	  LSDB_LOOP (OPAQUE_LINK_LSDB (area), rn, lsa)
-	    apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
-        }
+      LIST_LOOP (ospf->areas, area, node)
+        LSDB_LOOP (OPAQUE_LINK_LSDB (area), rn, lsa)
+          apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
       break;
     case OSPF_OPAQUE_AREA_LSA:
-      for (node = listhead (ospf->areas); node; nextnode (node))
-        {
-          struct ospf_area *area = node->data;
-	  LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa)
-	    apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
-        }
+      LIST_LOOP (ospf->areas, area, node)
+        LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa)
+          apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
       break;
     case OSPF_OPAQUE_AS_LSA:
       LSDB_LOOP (OPAQUE_LINK_LSDB (ospf), rn, lsa)
@@ -2115,7 +2083,6 @@
       break;
     }
   return;
-#endif /* ORIGINAL_CODING */
 }
 
 
@@ -2234,13 +2201,9 @@
   olsa = (struct opaque_lsa *) lsa->data;
 
   if (VALID_OPAQUE_INFO_LEN (lsa->data))
-    {
-      opaquelen = ntohs (lsa->data->length) - OSPF_LSA_HEADER_SIZE;
-    }
+    opaquelen = ntohs (lsa->data->length) - OSPF_LSA_HEADER_SIZE;
   else
-    {
-      opaquelen = 0;
-    }
+    opaquelen = 0;
 
   /* Output information about opaque LSAs */
   if (vty != NULL)
@@ -2288,16 +2251,12 @@
 void
 ospf_apiserver_clients_notify_all (struct msg *msg)
 {
-  listnode node;
+  struct listnode *node;
+  struct ospf_apiserver *apiserv;
 
   /* Send message to all clients */
-  for (node = listhead (apiserver_list); node; nextnode (node))
-    {
-      struct ospf_apiserver *apiserv =
-	(struct ospf_apiserver *) getdata (node);
-
-      ospf_apiserver_send_msg (apiserv, msg);
-    }
+  LIST_LOOP (apiserver_list, apiserv, node)
+    ospf_apiserver_send_msg (apiserv, msg);
 }
 
 /* An interface is now ready to accept opaque LSAs. Notify all
@@ -2305,8 +2264,9 @@
 void
 ospf_apiserver_clients_notify_ready_type9 (struct ospf_interface *oi)
 {
-  listnode node;
+  struct listnode *node;
   struct msg *msg;
+  struct ospf_apiserver *apiserv;
 
   assert (oi);
   if (!oi->address)
@@ -2321,16 +2281,13 @@
       return;
     }
 
-  for (node = listhead (apiserver_list); node; nextnode (node))
+  LIST_LOOP (apiserver_list, apiserv, node)
     {
-      struct ospf_apiserver *apiserv =
-	(struct ospf_apiserver *) getdata (node);
-      listnode n2;
+      struct listnode *n2;
+      struct registered_opaque_type *r;
 
-      for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+      LIST_LOOP (apiserv->opaque_types, r, n2)
 	{
-	  struct registered_opaque_type *r =
-	    (struct registered_opaque_type *) getdata (n2);
 	  if (r->lsa_type == OSPF_OPAQUE_LINK_LSA)
 	    {
 	      msg = new_msg_ready_notify (0, OSPF_OPAQUE_LINK_LSA,
@@ -2360,8 +2317,9 @@
 void
 ospf_apiserver_clients_notify_ready_type10 (struct ospf_area *area)
 {
-  listnode node;
+  struct listnode *node;
   struct msg *msg;
+  struct ospf_apiserver *apiserv;
 
   assert (area);
 
@@ -2371,16 +2329,13 @@
       return;
     }
 
-  for (node = listhead (apiserver_list); node; nextnode (node))
+  LIST_LOOP (apiserver_list, apiserv, node)
     {
-      struct ospf_apiserver *apiserv =
-	(struct ospf_apiserver *) getdata (node);
-      listnode n2;
+      struct listnode *n2;
+      struct registered_opaque_type *r;
 
-      for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+      LIST_LOOP (apiserv->opaque_types, r, n2)
 	{
-	  struct registered_opaque_type *r =
-	    (struct registered_opaque_type *) getdata (n2);
 	  if (r->lsa_type == OSPF_OPAQUE_AREA_LSA)
 	    {
 	      msg = new_msg_ready_notify (0, OSPF_OPAQUE_AREA_LSA,
@@ -2393,7 +2348,7 @@
 		  /* Cannot allocate new message. What should we do? */
 		  ospf_apiserver_free (apiserv);
 #endif
-		  goto out;
+                  goto out;
 		}
 
 	      ospf_apiserver_send_msg (apiserv, msg);
@@ -2410,9 +2365,10 @@
 void
 ospf_apiserver_clients_notify_ready_type11 (struct ospf *top)
 {
-  listnode node;
+  struct listnode *node;
   struct msg *msg;
   struct in_addr id_null = { 0L };
+  struct ospf_apiserver *apiserv;
 
   assert (top);
 
@@ -2422,16 +2378,13 @@
       return;
     }
 
-  for (node = listhead (apiserver_list); node; nextnode (node))
+  LIST_LOOP (apiserver_list, apiserv, node)
     {
-      struct ospf_apiserver *apiserv =
-	(struct ospf_apiserver *) getdata (node);
-      listnode n2;
+      struct listnode *n2;
+      struct registered_opaque_type *r;
 
-      for (n2 = listhead (apiserv->opaque_types); n2; nextnode (n2))
+      LIST_LOOP (apiserv->opaque_types, r, n2)
 	{
-	  struct registered_opaque_type *r =
-	    (struct registered_opaque_type *) getdata (n2);
 	  if (r->lsa_type == OSPF_OPAQUE_AS_LSA)
 	    {
 	      msg = new_msg_ready_notify (0, OSPF_OPAQUE_AS_LSA,
@@ -2544,7 +2497,8 @@
 apiserver_clients_lsa_change_notify (u_char msgtype, struct ospf_lsa *lsa)
 {
   struct msg *msg;
-  listnode node;
+  struct listnode *node;
+  struct ospf_apiserver *apiserv;
 
   /* Default area for AS-External and Opaque11 LSAs */
   struct in_addr area_id = { 0L };
@@ -2574,9 +2528,8 @@
     }
 
   /* Now send message to all clients with a matching filter */
-  for (node = listhead (apiserver_list); node; nextnode (node))
+  LIST_LOOP (apiserver_list, apiserv, node)
     {
-      struct ospf_apiserver *apiserv = (struct ospf_apiserver *) node->data;
       struct lsa_filter_type *filter;
       u_int16_t mask;
       u_int32_t *area;
diff --git a/ospfd/ospf_apiserver.h b/ospfd/ospf_apiserver.h
index c714578..f4dc647 100644
--- a/ospfd/ospf_apiserver.h
+++ b/ospfd/ospf_apiserver.h
@@ -50,7 +50,7 @@
      a single connection with the OSPF daemon, multiple
      <lsa,opaque_type> pairs can be registered. However, each
      combination can only be registered once by all applications. */
-  list opaque_types;		/* of type registered_opaque_type */
+  struct list *opaque_types;		/* of type registered_opaque_type */
 
   /* Temporary storage for LSA instances to be refreshed. */
   struct ospf_lsdb reserve;
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h
index cdab122..0f3cecd 100644
--- a/ospfd/ospf_interface.h
+++ b/ospfd/ospf_interface.h
@@ -146,7 +146,7 @@
   /* self-originated LSAs. */
   struct ospf_lsa *network_lsa_self;	/* network-LSA. */
 #ifdef HAVE_OPAQUE_LSA
-  list opaque_lsa_self;			/* Type-9 Opaque-LSAs */
+  struct list *opaque_lsa_self;			/* Type-9 Opaque-LSAs */
 #endif /* HAVE_OPAQUE_LSA */
 
   struct route_table *ls_upd_queue;
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 73e9639..414ec74 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -253,10 +253,11 @@
   int (* del_lsa_hook)(struct ospf_lsa *lsa);
 };
 
-static list ospf_opaque_wildcard_funclist; /* Handle LSA-9/10/11 altogether. */
-static list ospf_opaque_type9_funclist;
-static list ospf_opaque_type10_funclist;
-static list ospf_opaque_type11_funclist;
+/* Handle LSA-9/10/11 altogether. */
+static struct list *ospf_opaque_wildcard_funclist;
+static struct list *ospf_opaque_type9_funclist;
+static struct list *ospf_opaque_type10_funclist;
+static struct list *ospf_opaque_type11_funclist;
 
 static void
 ospf_opaque_del_functab (void *val)
@@ -268,7 +269,7 @@
 static void
 ospf_opaque_funclist_init (void)
 {
-  list funclist;
+  struct list *funclist;
 
   funclist = ospf_opaque_wildcard_funclist = list_new ();
   funclist->del = ospf_opaque_del_functab;
@@ -287,7 +288,7 @@
 static void
 ospf_opaque_funclist_term (void)
 {
-  list funclist;
+  struct list *funclist;
 
   funclist = ospf_opaque_wildcard_funclist;
   list_delete (funclist);
@@ -303,10 +304,10 @@
   return;
 }
 
-static list
+static struct list *
 ospf_get_opaque_funclist (u_char lsa_type)
 {
-  list funclist = NULL;
+  struct list *funclist = NULL;
 
   switch (lsa_type)
     {
@@ -336,6 +337,7 @@
   return funclist;
 }
 
+/* XXX: such a huge argument list can /not/ be healthy... */
 int
 ospf_register_opaque_functab (
   u_char lsa_type,
@@ -353,33 +355,37 @@
   int (* new_lsa_hook)(struct ospf_lsa *lsa),
   int (* del_lsa_hook)(struct ospf_lsa *lsa))
 {
-  list funclist;
+  struct list *funclist;
   struct ospf_opaque_functab *new;
   int rc = -1;
 
   if ((funclist = ospf_get_opaque_funclist (lsa_type)) == NULL)
     {
-      zlog_warn ("ospf_register_opaque_functab: Cannot get funclist for Type-%u LSAs?", lsa_type);
+      zlog_warn ("ospf_register_opaque_functab: Cannot get funclist"
+                 " for Type-%u LSAs?",
+                 lsa_type);
       goto out;
     }
   else
     {
-      listnode node;
+      struct listnode *node;
       struct ospf_opaque_functab *functab;
-
-      for (node = listhead (funclist); node; nextnode (node))
-        if ((functab = getdata (node)) != NULL)
-          if (functab->opaque_type == opaque_type)
-            {
-              zlog_warn ("ospf_register_opaque_functab: Duplicated entry?: lsa_type(%u), opaque_type(%u)", lsa_type, opaque_type);
-              goto out;
-            }
+      
+      LIST_LOOP (funclist, functab, node)
+        if (functab->opaque_type == opaque_type)
+          {
+            zlog_warn ("ospf_register_opaque_functab: Duplicated entry?:"
+                       " lsa_type(%u), opaque_type(%u)", 
+                       lsa_type, opaque_type);
+            goto out;
+          }
     }
 
   if ((new = XCALLOC (MTYPE_OSPF_OPAQUE_FUNCTAB,
 		      sizeof (struct ospf_opaque_functab))) == NULL)
     {
-      zlog_warn ("ospf_register_opaque_functab: XMALLOC: %s", strerror (errno));
+      zlog_warn ("ospf_register_opaque_functab: XMALLOC: %s",
+                 strerror (errno));
       goto out;
     }
 
@@ -408,15 +414,15 @@
 void
 ospf_delete_opaque_functab (u_char lsa_type, u_char opaque_type)
 {
-  list funclist;
-  listnode node;
+  struct list *funclist;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
   if ((funclist = ospf_get_opaque_funclist (lsa_type)) != NULL)
     for (node = listhead (funclist); node; nextnode (node))
       {
         if ((functab = getdata (node)) != NULL
-        &&   functab->opaque_type == opaque_type)
+            && functab->opaque_type == opaque_type)
           {
             /* Cleanup internal control information, if it still remains. */
             if (functab->oipt != NULL)
@@ -430,26 +436,25 @@
               funclist->head = funclist->tail = NULL;
 
             XFREE (MTYPE_OSPF_OPAQUE_FUNCTAB, functab);
-            goto out;
+            break;
 	  }
       }
-out:
+
   return;
 }
 
 static struct ospf_opaque_functab *
 ospf_opaque_functab_lookup (struct ospf_lsa *lsa)
 {
-  list funclist;
-  listnode node;
+  struct list *funclist;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   u_char key = GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr));
 
   if ((funclist = ospf_get_opaque_funclist (lsa->data->type)) != NULL)
-    for (node = listhead (funclist); node; nextnode (node))
-      if ((functab = getdata (node)) != NULL)
-        if (functab->opaque_type == key)
-          return functab;
+    LIST_LOOP (funclist, functab, node)
+      if (functab->opaque_type == key)
+        return functab;
 
   return NULL;
 }
@@ -494,7 +499,7 @@
   struct ospf_opaque_functab *functab;
 
   /* List of Opaque-LSA control informations per opaque-id. */
-  list id_list;
+  struct list *id_list;
 };
 
 /* Opaque-LSA control information per opaque-id. */
@@ -580,7 +585,7 @@
   struct opaque_info_per_type *oipt = (struct opaque_info_per_type *) val;
   struct opaque_info_per_id *oipi;
   struct ospf_lsa *lsa;
-  listnode node;
+  struct listnode *node;
 
   /* Control information per opaque-id may still exist. */
   for (node = listhead (oipt->id_list); node; nextnode (node))
@@ -632,8 +637,8 @@
   struct ospf *top;
   struct ospf_area *area;
   struct ospf_interface *oi;
-  list listtop = NULL;
-  listnode node;
+  struct list *listtop = NULL;
+  struct listnode *node;
   struct opaque_info_per_type *oipt = NULL;
   u_char key = GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr));
 
@@ -666,10 +671,9 @@
     }
 
   if (listtop != NULL)
-    for (node = listhead (listtop); node; nextnode (node))
-      if ((oipt = getdata (node)) != NULL)
-        if (oipt->opaque_type == key)
-          return oipt;
+    LIST_LOOP (listtop, oipt, node)
+      if (oipt->opaque_type == key)
+        return oipt;
 
   return NULL;
 }
@@ -713,14 +717,13 @@
 lookup_opaque_info_by_id (struct opaque_info_per_type *oipt,
                           struct ospf_lsa *lsa)
 {
-  listnode node;
+  struct listnode *node;
   struct opaque_info_per_id   *oipi;
   u_int32_t key = GET_OPAQUE_ID (ntohl (lsa->data->id.s_addr));
 
-  for (node = listhead (oipt->id_list); node; nextnode (node))
-    if ((oipi = getdata (node)) != NULL)
-      if (oipi->opaque_id == key)
-        return oipi;
+  LIST_LOOP (oipt->id_list, oipi, node)
+    if (oipi->opaque_id == key)
+      return oipi;
 
   return NULL;
 }
@@ -819,155 +822,147 @@
  *------------------------------------------------------------------------*/
 
 static int
-opaque_lsa_new_if_callback (list funclist, struct interface *ifp)
+opaque_lsa_new_if_callback (struct list *funclist, struct interface *ifp)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   int rc = -1;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->new_if_hook != NULL)
-        if ((* functab->new_if_hook)(ifp) != 0)
-          goto out;
+  LIST_LOOP (funclist, functab, node)
+    if (functab->new_if_hook != NULL)
+      if ((* functab->new_if_hook)(ifp) != 0)
+        goto out;
   rc = 0;
 out:
   return rc;
 }
 
 static int
-opaque_lsa_del_if_callback (list funclist, struct interface *ifp)
+opaque_lsa_del_if_callback (struct list *funclist, struct interface *ifp)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   int rc = -1;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->del_if_hook != NULL)
-        if ((* functab->del_if_hook)(ifp) != 0)
-          goto out;
+  LIST_LOOP (funclist, functab, node)
+    if (functab->del_if_hook != NULL)
+      if ((* functab->del_if_hook)(ifp) != 0)
+        goto out;
   rc = 0;
 out:
   return rc;
 }
 
 static void
-opaque_lsa_ism_change_callback (list funclist,
+opaque_lsa_ism_change_callback (struct list *funclist,
                                 struct ospf_interface *oi, int old_status)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->ism_change_hook != NULL)
-        (* functab->ism_change_hook)(oi, old_status);
+  LIST_LOOP (funclist, functab, node)
+    if (functab->ism_change_hook != NULL)
+      (* functab->ism_change_hook)(oi, old_status);
+
   return;
 }
 
 static void
-opaque_lsa_nsm_change_callback (list funclist,
+opaque_lsa_nsm_change_callback (struct list *funclist,
                                 struct ospf_neighbor *nbr, int old_status)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->nsm_change_hook != NULL)
-        (* functab->nsm_change_hook)(nbr, old_status);
+  LIST_LOOP (funclist, functab, node)
+    if (functab->nsm_change_hook != NULL)
+      (* functab->nsm_change_hook)(nbr, old_status);
   return;
 }
 
 static void
-opaque_lsa_config_write_router_callback (list funclist, struct vty *vty)
+opaque_lsa_config_write_router_callback (struct list *funclist, 
+                                         struct vty *vty)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->config_write_router != NULL)
-        (* functab->config_write_router)(vty);
+  LIST_LOOP (funclist, functab, node)
+    if (functab->config_write_router != NULL)
+      (* functab->config_write_router)(vty);
   return;
 }
 
 static void
-opaque_lsa_config_write_if_callback (list funclist,
+opaque_lsa_config_write_if_callback (struct list *funclist,
                                      struct vty *vty, struct interface *ifp)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->config_write_if != NULL)
-        (* functab->config_write_if)(vty, ifp);
+  LIST_LOOP (funclist, functab, node)
+    if (functab->config_write_if != NULL)
+      (* functab->config_write_if)(vty, ifp);
   return;
 }
 
 static void
-opaque_lsa_config_write_debug_callback (list funclist, struct vty *vty)
+opaque_lsa_config_write_debug_callback (struct list *funclist, struct vty *vty)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->config_write_debug != NULL)
-        (* functab->config_write_debug)(vty);
+  LIST_LOOP (funclist, functab, node)
+    if (functab->config_write_debug != NULL)
+      (* functab->config_write_debug)(vty);
   return;
 }
 
 static int
-opaque_lsa_originate_callback (list funclist, void *lsa_type_dependent)
+opaque_lsa_originate_callback (struct list *funclist, void *lsa_type_dependent)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   int rc = -1;
 
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->lsa_originator != NULL)
-        if ((* functab->lsa_originator)(lsa_type_dependent) != 0)
-           goto out;
+  LIST_LOOP (funclist, functab, node)
+    if (functab->lsa_originator != NULL)
+      if ((* functab->lsa_originator)(lsa_type_dependent) != 0)
+         goto out;
   rc = 0;
 out:
   return rc;
 }
 
 static int
-new_lsa_callback (list funclist, struct ospf_lsa *lsa)
+new_lsa_callback (struct list *funclist, struct ospf_lsa *lsa)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   int rc = -1;
 
   /* This function handles ALL types of LSAs, not only opaque ones. */
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->new_lsa_hook != NULL)
-        if ((* functab->new_lsa_hook)(lsa) != 0)
-          goto out;
+  LIST_LOOP (funclist, functab, node)
+    if (functab->new_lsa_hook != NULL)
+      if ((* functab->new_lsa_hook)(lsa) != 0)
+        goto out;
   rc = 0;
 out:
   return rc;
 }
 
 static int
-del_lsa_callback (list funclist, struct ospf_lsa *lsa)
+del_lsa_callback (struct list *funclist, struct ospf_lsa *lsa)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_opaque_functab *functab;
   int rc = -1;
 
   /* This function handles ALL types of LSAs, not only opaque ones. */
-  for (node = listhead (funclist); node; nextnode (node))
-    if ((functab = getdata (node)) != NULL)
-      if (functab->del_lsa_hook != NULL)
-        if ((* functab->del_lsa_hook)(lsa) != 0)
-          goto out;
+  LIST_LOOP (funclist, functab, node)
+    if (functab->del_lsa_hook != NULL)
+      if ((* functab->del_lsa_hook)(lsa) != 0)
+        goto out;
   rc = 0;
 out:
   return rc;
@@ -980,7 +975,7 @@
 int
 ospf_opaque_new_if (struct interface *ifp)
 {
-  list funclist;
+  struct list *funclist;
   int rc = -1;
 
   funclist = ospf_opaque_wildcard_funclist;
@@ -1007,7 +1002,7 @@
 int
 ospf_opaque_del_if (struct interface *ifp)
 {
-  list funclist;
+  struct list *funclist;
   int rc = -1;
 
   funclist = ospf_opaque_wildcard_funclist;
@@ -1034,7 +1029,7 @@
 void
 ospf_opaque_ism_change (struct ospf_interface *oi, int old_status)
 {
-  list funclist;
+  struct list *funclist;
 
   funclist = ospf_opaque_wildcard_funclist;
   opaque_lsa_ism_change_callback (funclist, oi, old_status);
@@ -1055,7 +1050,7 @@
 ospf_opaque_nsm_change (struct ospf_neighbor *nbr, int old_state)
 {
   struct ospf *top;
-  list funclist;
+  struct list *funclist;
 
   if ((top = oi_to_top (nbr->oi)) == NULL)
     goto out;
@@ -1107,7 +1102,7 @@
 void
 ospf_opaque_config_write_router (struct vty *vty, struct ospf *ospf)
 {
-  list funclist;
+  struct list *funclist;
 
   if (CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE))
     vty_out (vty, " capability opaque%s", VTY_NEWLINE);
@@ -1130,7 +1125,7 @@
 void
 ospf_opaque_config_write_if (struct vty *vty, struct interface *ifp)
 {
-  list funclist;
+  struct list *funclist;
 
   funclist = ospf_opaque_wildcard_funclist;
   opaque_lsa_config_write_if_callback (funclist, vty, ifp);
@@ -1150,7 +1145,7 @@
 void
 ospf_opaque_config_write_debug (struct vty *vty)
 {
-  list funclist;
+  struct list *funclist;
 
   funclist = ospf_opaque_wildcard_funclist;
   opaque_lsa_config_write_debug_callback (funclist, vty);
@@ -1220,7 +1215,7 @@
 static int
 ospf_opaque_lsa_install_hook (struct ospf_lsa *lsa)
 {
-  list funclist;
+  struct list *funclist;
   int rc = -1;
 
   /*
@@ -1251,7 +1246,7 @@
 static int
 ospf_opaque_lsa_delete_hook (struct ospf_lsa *lsa)
 {
-  list funclist;
+  struct list *funclist;
   int rc = -1;
 
   /*
@@ -1286,14 +1281,14 @@
 static int ospf_opaque_type9_lsa_originate (struct thread *t);
 static int ospf_opaque_type10_lsa_originate (struct thread *t);
 static int ospf_opaque_type11_lsa_originate (struct thread *t);
-static void ospf_opaque_lsa_reoriginate_resume (list listtop, void *arg);
+static void ospf_opaque_lsa_reoriginate_resume (struct list *listtop, void *arg);
 
 void
 ospf_opaque_lsa_originate_schedule (struct ospf_interface *oi, int *delay0)
 {
   struct ospf *top;
   struct ospf_area *area;
-  listnode node;
+  struct listnode *node;
   struct opaque_info_per_type *oipt;
   int delay = 0;
 
@@ -1504,9 +1499,9 @@
 }
 
 static void
-ospf_opaque_lsa_reoriginate_resume (list listtop, void *arg)
+ospf_opaque_lsa_reoriginate_resume (struct list *listtop, void *arg)
 {
-  listnode node;
+  struct listnode *node;
   struct opaque_info_per_type *oipt;
   struct ospf_opaque_functab *functab;
 
@@ -1517,16 +1512,15 @@
    * Pickup oipt entries those which in SUSPEND status, and give
    * them a chance to start re-origination now.
    */
-  for (node = listhead (listtop); node; nextnode (node))
+  LIST_LOOP (listtop, oipt, node)
     {
-      if ((oipt = getdata (node)) == NULL
-      ||   oipt->status != PROC_SUSPEND)
+      if (oipt->status != PROC_SUSPEND)
           continue;
 
       oipt->status = PROC_NORMAL;
 
       if ((functab = oipt->functab) == NULL
-      ||   functab->lsa_originator  == NULL)
+          || functab->lsa_originator  == NULL)
         continue;
 
       if ((* functab->lsa_originator)(arg) != 0)
@@ -1561,7 +1555,7 @@
 
   /* Replace the existing lsa with the new one. */
   if ((oipt = lookup_opaque_info_by_type (lsa)) != NULL
-  &&  (oipi = lookup_opaque_info_by_id (oipt, lsa)) != NULL)
+      && (oipi = lookup_opaque_info_by_id (oipt, lsa)) != NULL)
     {
       ospf_lsa_unlock (oipi->lsa);
       oipi->lsa = ospf_lsa_lock (lsa);
@@ -1626,7 +1620,7 @@
   ospf = ospf_lookup ();
 
   if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
-  ||   functab->lsa_refresher == NULL)
+      || functab->lsa_refresher == NULL)
     {
       /*
        * Though this LSA seems to have originated on this node, the
@@ -1672,7 +1666,7 @@
 
   struct ospf_lsa *lsa;
   struct opaque_info_per_type *oipt;
-  int (* func)(struct thread *t) = NULL;
+  int (*func) (struct thread * t) = NULL;
   int delay;
 
   switch (lsa_type)
@@ -1680,19 +1674,23 @@
     case OSPF_OPAQUE_LINK_LSA:
       if ((oi = (struct ospf_interface *) lsa_type_dependent) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: Type-9 Opaque-LSA: Invalid parameter?");
-	  goto out;
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " Type-9 Opaque-LSA: Invalid parameter?");
+          goto out;
         }
       if ((top = oi_to_top (oi)) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: OI(%s) -> TOP?", IF_NAME (oi));
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: OI(%s) -> TOP?",
+                     IF_NAME (oi));
           goto out;
         }
-      if (! list_isempty (ospf_opaque_type9_funclist)
-      &&    list_isempty (oi->opaque_lsa_self)
-      &&    oi->t_opaque_lsa_self != NULL)
+      if (!list_isempty (ospf_opaque_type9_funclist)
+          && list_isempty (oi->opaque_lsa_self)
+          && oi->t_opaque_lsa_self != NULL)
         {
-          zlog_warn ("Type-9 Opaque-LSA (opaque_type=%u): Common origination for OI(%s) has already started", opaque_type, IF_NAME (oi));
+          zlog_warn ("Type-9 Opaque-LSA (opaque_type=%u):"
+                     " Common origination for OI(%s) has already started",
+                     opaque_type, IF_NAME (oi));
           goto out;
         }
       func = ospf_opaque_type9_lsa_reoriginate_timer;
@@ -1700,19 +1698,23 @@
     case OSPF_OPAQUE_AREA_LSA:
       if ((area = (struct ospf_area *) lsa_type_dependent) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: Type-10 Opaque-LSA: Invalid parameter?");
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " Type-10 Opaque-LSA: Invalid parameter?");
           goto out;
         }
       if ((top = area->ospf) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: AREA(%s) -> TOP?", inet_ntoa (area->area_id));
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " AREA(%s) -> TOP?", inet_ntoa (area->area_id));
           goto out;
         }
-      if (! list_isempty (ospf_opaque_type10_funclist)
-      &&    list_isempty (area->opaque_lsa_self)
-      &&    area->t_opaque_lsa_self != NULL)
+      if (!list_isempty (ospf_opaque_type10_funclist)
+          && list_isempty (area->opaque_lsa_self)
+          && area->t_opaque_lsa_self != NULL)
         {
-          zlog_warn ("Type-10 Opaque-LSA (opaque_type=%u): Common origination for AREA(%s) has already started", opaque_type, inet_ntoa (area->area_id));
+          zlog_warn ("Type-10 Opaque-LSA (opaque_type=%u):"
+                     " Common origination for AREA(%s) has already started",
+                     opaque_type, inet_ntoa (area->area_id));
           goto out;
         }
       func = ospf_opaque_type10_lsa_reoriginate_timer;
@@ -1720,14 +1722,16 @@
     case OSPF_OPAQUE_AS_LSA:
       if ((top = (struct ospf *) lsa_type_dependent) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: Type-11 Opaque-LSA: Invalid parameter?");
-	  goto out;
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " Type-11 Opaque-LSA: Invalid parameter?");
+          goto out;
         }
-      if (! list_isempty (ospf_opaque_type11_funclist)
-      &&    list_isempty (top->opaque_lsa_self)
-      &&    top->t_opaque_lsa_self != NULL)
+      if (!list_isempty (ospf_opaque_type11_funclist)
+          && list_isempty (top->opaque_lsa_self)
+          && top->t_opaque_lsa_self != NULL)
         {
-          zlog_warn ("Type-11 Opaque-LSA (opaque_type=%u): Common origination has already started", opaque_type);
+          zlog_warn ("Type-11 Opaque-LSA (opaque_type=%u):"
+                     " Common origination has already started", opaque_type);
           goto out;
         }
 
@@ -1738,22 +1742,24 @@
       func = ospf_opaque_type11_lsa_reoriginate_timer;
       break;
     default:
-      zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: Unexpected LSA-type(%u)", lsa_type);
+      zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                 " Unexpected LSA-type(%u)",
+                 lsa_type);
       goto out;
     }
 
   /* It may not a right time to schedule reorigination now. */
-  if (! CHECK_FLAG (top->opaque, OPAQUE_OPERATION_READY_BIT))
+  if (!CHECK_FLAG (top->opaque, OPAQUE_OPERATION_READY_BIT))
     {
       if (IS_DEBUG_OSPF_EVENT)
         zlog_info ("ospf_opaque_lsa_reoriginate_schedule: Not operational.");
-      goto out; /* This is not an error. */
+      goto out;                 /* This is not an error. */
     }
   if (IS_OPAQUE_LSA_ORIGINATION_BLOCKED (top->opaque))
     {
       if (IS_DEBUG_OSPF_EVENT)
         zlog_info ("ospf_opaque_lsa_reoriginate_schedule: Under blockade.");
-      goto out; /* This is not an error, too. */
+      goto out;                 /* This is not an error, too. */
     }
 
   /* Generate a dummy lsa to be passed for a lookup function. */
@@ -1764,12 +1770,18 @@
       struct ospf_opaque_functab *functab;
       if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: No associated function?: lsa_type(%u), opaque_type(%u)", lsa_type, opaque_type);
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " No associated function?: lsa_type(%u),"
+                     " opaque_type(%u)",
+                     lsa_type, opaque_type);
           goto out;
         }
       if ((oipt = register_opaque_info_per_type (functab, lsa)) == NULL)
         {
-          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule: Cannot get a control info?: lsa_type(%u), opaque_type(%u)", lsa_type, opaque_type);
+          zlog_warn ("ospf_opaque_lsa_reoriginate_schedule:"
+                     " Cannot get a control info?: lsa_type(%u),"
+                     " opaque_type(%u)",
+                     lsa_type, opaque_type);
           goto out;
         }
     }
@@ -1777,7 +1789,9 @@
   if (oipt->t_opaque_lsa_self != NULL)
     {
       if (IS_DEBUG_OSPF_EVENT)
-        zlog_info ("Type-%u Opaque-LSA has already scheduled to RE-ORIGINATE: [opaque-type=%u]", lsa_type, GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)));
+        zlog_info ("Type-%u Opaque-LSA has already scheduled to"
+                   " RE-ORIGINATE: [opaque-type=%u]",
+                   lsa_type, GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)));
       goto out;
     }
 
@@ -1791,7 +1805,10 @@
   delay = OSPF_MIN_LS_INTERVAL; /* XXX */
 
   if (IS_DEBUG_OSPF_EVENT)
-    zlog_info ("Schedule Type-%u Opaque-LSA to RE-ORIGINATE in %d sec later: [opaque-type=%u]", lsa_type, delay, GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)));
+    zlog_info ("Schedule Type-%u Opaque-LSA to RE-ORIGINATE in %d"
+               " sec later: [opaque-type=%u]", 
+               lsa_type, delay, 
+               GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)));
 
   OSPF_OPAQUE_TIMER_ON (oipt->t_opaque_lsa_self, func, oipt, delay);
 
@@ -1869,7 +1886,7 @@
 {
   struct opaque_info_per_type *oipt;
   struct ospf_opaque_functab *functab;
-  listnode node;
+  struct listnode *node;
   struct ospf *top;
   struct ospf_area *area;
   struct ospf_interface *oi;
@@ -1894,10 +1911,8 @@
 
   /* There must be at least one "opaque-capable, full-state" neighbor. */
   n = 0;
-  for (node = listhead (area->oiflist); node; nextnode (node))
+  LIST_LOOP (area->oiflist, oi, node)
     {
-      if ((oi = getdata (node)) == NULL)
-        continue;
       if ((n = ospf_nbr_count_opaque_capable (oi)) > 0)
         break;
     }
@@ -1905,7 +1920,9 @@
   if (n == 0 || ! CHECK_FLAG (top->config, OSPF_OPAQUE_CAPABLE))
     {
       if (IS_DEBUG_OSPF_EVENT)
-        zlog_info ("Suspend re-origination of Type-10 Opaque-LSAs (opaque-type=%u) for a while...", oipt->opaque_type);
+        zlog_info ("Suspend re-origination of Type-10 Opaque-LSAs"
+                   " (opaque-type=%u) for a while...", 
+                   oipt->opaque_type);
 
       oipt->status = PROC_SUSPEND;
       rc = 0;
@@ -1913,7 +1930,9 @@
     }
 
   if (IS_DEBUG_OSPF_EVENT)
-    zlog_info ("Timer[Type10-LSA]: Re-originate Opaque-LSAs (opaque-type=%u) for Area %s", oipt->opaque_type, inet_ntoa (area->area_id));
+    zlog_info ("Timer[Type10-LSA]: Re-originate Opaque-LSAs"
+               " (opaque-type=%u) for Area %s", 
+               oipt->opaque_type, inet_ntoa (area->area_id));
 
   rc = (* functab->lsa_originator)(area);
 out:
@@ -1932,9 +1951,10 @@
   oipt->t_opaque_lsa_self = NULL;
 
   if ((functab = oipt->functab) == NULL
-  ||   functab->lsa_originator == NULL)
+      || functab->lsa_originator == NULL)
     {
-      zlog_warn ("ospf_opaque_type11_lsa_reoriginate_timer: No associated function?");
+      zlog_warn ("ospf_opaque_type11_lsa_reoriginate_timer:"
+                 " No associated function?");
       goto out;
     }
 
@@ -2116,12 +2136,12 @@
 static unsigned long ospf_opaque_nrxmt_self (struct route_table *nbrs, int lsa_type);
 
 void
-ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, list lsas)
+ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, struct list *lsas)
 {
   struct ospf *top;
   struct ospf_area *area;
   struct ospf_interface *oi;
-  listnode node1, node2;
+  struct listnode *node1, *node2;
   struct ospf_lsa *lsa;
 
   if ((top = oi_to_top (nbr->oi)) == NULL)
@@ -2228,10 +2248,11 @@
 }
 
 void
-ospf_opaque_self_originated_lsa_received (struct ospf_neighbor *nbr, list lsas)
+ospf_opaque_self_originated_lsa_received (struct ospf_neighbor *nbr, 
+                                          struct list *lsas)
 {
   struct ospf *top;
-  listnode node, next;
+  struct listnode *node, *next;
   struct ospf_lsa *lsa;
   u_char before;
 
@@ -2287,21 +2308,18 @@
 }
 
 void
-ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, list acks)
+ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct list *acks)
 {
   struct ospf *top;
-  listnode node;
+  struct listnode *node;
   struct ospf_lsa *lsa;
   char type9_lsa_rcv = 0, type10_lsa_rcv = 0, type11_lsa_rcv = 0;
 
   if ((top = oi_to_top (nbr->oi)) == NULL)
     goto out;
 
-  for (node = listhead (acks); node; nextnode (node))
+  LIST_LOOP (acks, lsa, node)
     {
-      if ((lsa = getdata (node)) == NULL)
-        continue;
-
       switch (lsa->data->type)
         {
         case OSPF_OPAQUE_LINK_LSA:
@@ -2350,13 +2368,11 @@
 
       /* Ok, let's start origination of Opaque-LSAs. */
       delay = OSPF_MIN_LS_INTERVAL;
-      for (node = listhead (top->oiflist); node; nextnode (node))
-        {
-          if ((oi = getdata (node)) == NULL)
-            continue;
 
+      LIST_LOOP (top->oiflist, oi, node)
+        {
           if (! ospf_if_is_enable (oi)
-          ||    ospf_nbr_count_opaque_capable (oi) == 0)
+              || ospf_nbr_count_opaque_capable (oi) == 0)
             continue;
 
           ospf_opaque_lsa_originate_schedule (oi, &delay);
@@ -2386,7 +2402,7 @@
 static void
 ospf_opaque_type10_lsa_rxmt_nbr_check (struct ospf_area *area)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_interface *oi;
   unsigned long n = 0;
 
@@ -2418,7 +2434,7 @@
 static void
 ospf_opaque_type11_lsa_rxmt_nbr_check (struct ospf *top)
 {
-  listnode node;
+  struct listnode *node;
   struct ospf_interface *oi;
   unsigned long n = 0;
 
diff --git a/ospfd/ospf_opaque.h b/ospfd/ospf_opaque.h
index 9aa08e5..743f043 100644
--- a/ospfd/ospf_opaque.h
+++ b/ospfd/ospf_opaque.h
@@ -144,9 +144,12 @@
 extern void ospf_opaque_lsa_refresh_schedule (struct ospf_lsa *lsa);
 extern void ospf_opaque_lsa_flush_schedule (struct ospf_lsa *lsa);
 
-extern void ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, list lsas);
-extern void ospf_opaque_self_originated_lsa_received (struct ospf_neighbor *nbr, list lsas);
-extern void ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, list acks);
+extern void ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, 
+                                      struct list *lsas);
+extern void ospf_opaque_self_originated_lsa_received (struct ospf_neighbor *nbr, 
+                                                      struct list *lsas);
+extern void ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, 
+                                         struct list *acks);
 
 extern void htonf (float *src, float *dst);
 extern void ntohf (float *src, float *dst);
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index c4ecb79..111ee09 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1917,7 +1917,7 @@
 {
   struct ospf_neighbor *nbr;
 #ifdef HAVE_OPAQUE_LSA
-  list opaque_acks;
+  struct list *opaque_acks;
 #endif /* HAVE_OPAQUE_LSA */
 
   /* increment statistics. */
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 1a9946d..1d44250 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -67,7 +67,7 @@
   enum { disabled, enabled } status;
 
   /* List elements are zebra-interfaces (ifp), not ospf-interfaces (oi). */
-  list iflist;
+  struct list *iflist;
 
   /* Store Router-TLV in network byte order. */
   struct te_tlv_router_addr router_addr;
@@ -252,13 +252,12 @@
 static struct mpls_te_link *
 lookup_linkparams_by_ifp (struct interface *ifp)
 {
-  listnode node;
+  struct listnode *node;
   struct mpls_te_link *lp;
 
-  for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
-    if ((lp = getdata (node)) != NULL)
-      if (lp->ifp == ifp)
-        return lp;
+  LIST_LOOP (OspfMplsTE.iflist, lp, node)
+    if (lp->ifp == ifp)
+      return lp;
 
   return NULL;
 }
@@ -266,14 +265,13 @@
 static struct mpls_te_link *
 lookup_linkparams_by_instance (struct ospf_lsa *lsa)
 {
-  listnode node;
+  struct listnode *node;
   struct mpls_te_link *lp;
   int key = GET_OPAQUE_ID (ntohl (lsa->data->id.s_addr));
 
-  for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
-    if ((lp = getdata (node)) != NULL)
-      if (lp->instance == key)
-        return lp;
+  LIST_LOOP (OspfMplsTE.iflist, lp, node)
+    if (lp->instance == key)
+      return lp;
 
   zlog_warn ("lookup_linkparams_by_instance: Entry not found: key(%x)", key);
   return NULL;
@@ -284,14 +282,12 @@
   void (*func)(struct mpls_te_link *lp, enum sched_opcode),
   enum sched_opcode sched_opcode)
 {
-  listnode node, node2;
+  struct listnode *node, *node2;
   struct mpls_te_link *lp;
   struct ospf_area *area;
 
-  for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
+  LIST_LOOP (OspfMplsTE.iflist, lp, node)
     {
-      if ((lp = getdata (node)) == NULL)
-        continue;
       if ((area = lp->area) == NULL)
         continue;
       if (lp->flags & LPFLG_LOOKUP_DONE)
@@ -307,10 +303,9 @@
               lp->flags |= LPFLG_LOOKUP_DONE;
     }
 
-  for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
-    if ((lp = getdata (node)) != NULL)
-      if (lp->area != NULL)
-        lp->flags &= ~LPFLG_LOOKUP_DONE;
+  LIST_LOOP (OspfMplsTE.iflist, lp, node)
+    if (lp->area != NULL)
+      lp->flags &= ~LPFLG_LOOKUP_DONE;
 
   return;
 }
@@ -597,7 +592,7 @@
 
   if ((lp = lookup_linkparams_by_ifp (ifp)) != NULL)
     {
-      list iflist = OspfMplsTE.iflist;
+      struct list *iflist = OspfMplsTE.iflist;
 
       /* Dequeue listnode entry from the list. */
       listnode_delete (iflist, lp);
@@ -970,7 +965,7 @@
 ospf_mpls_te_lsa_originate (void *arg)
 {
   struct ospf_area *area = (struct ospf_area *) arg;
-  listnode node;
+  struct listnode *node;
   struct mpls_te_link *lp;
   int rc = -1;
 
@@ -1476,7 +1471,7 @@
        "Configure MPLS-TE parameters\n"
        "Enable the MPLS-TE functionality\n")
 {
-  listnode node;
+  struct listnode *node;
   struct mpls_te_link *lp;
 
   if (OspfMplsTE.status == enabled)
@@ -1515,7 +1510,7 @@
        "Configure MPLS-TE parameters\n"
        "Disable the MPLS-TE functionality\n")
 {
-  listnode node;
+  struct listnode *node;
   struct mpls_te_link *lp;
 
   if (OspfMplsTE.status == disabled)
@@ -1552,9 +1547,9 @@
     }
 
   if (ntohs (ra->header.type) == 0
-  ||  ntohl (ra->value.s_addr) != ntohl (value.s_addr))
+      || ntohl (ra->value.s_addr) != ntohl (value.s_addr))
     {
-      listnode node;
+      struct listnode *node;
       struct mpls_te_link *lp;
       int need_to_reoriginate = 0;
 
@@ -1563,10 +1558,8 @@
       if (OspfMplsTE.status == disabled)
         goto out;
 
-      for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
+      LIST_LOOP (OspfMplsTE.iflist, lp, node)
         {
-          if ((lp = getdata (node)) == NULL)
-            continue;
           if (lp->area == NULL)
             continue;
 
@@ -1577,9 +1570,8 @@
             }
         }
       for (node = listhead (OspfMplsTE.iflist); node; nextnode (node))
+      LIST_LOOP (OspfMplsTE.iflist, lp, node)
         {
-          if ((lp = getdata (node)) == NULL)
-            continue;
           if (lp->area == NULL)
             continue;
 
@@ -1876,12 +1868,12 @@
        "Interface name\n")
 {
   struct interface *ifp;
-  listnode node;
+  struct listnode *node;
 
   /* Show All Interfaces. */
   if (argc == 0)
-    for (node = listhead (iflist); node; nextnode (node))
-      show_mpls_te_link_sub (vty, node->data);
+    LIST_LOOP (iflist, ifp, node)
+      show_mpls_te_link_sub (vty, ifp);
   /* Interface name is specified. */
   else
     {
