diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index 20bf6a5..9416784 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -85,8 +85,11 @@
 {
   listnode node;
   struct ospf_interface *oi;
+  struct ospf *ospf;
 
-  for (node = listhead (ospf_top->oiflist); node; nextnode (node))
+  ospf = ospf_lookup ();
+
+  for (node = listhead (ospf->oiflist); node; nextnode (node))
     {
       if ((oi = getdata (node)) != NULL
 	  && oi->type != OSPF_IFTYPE_VIRTUALLINK)
@@ -103,8 +106,11 @@
 {
   listnode node;
   struct ospf_interface *oi;
+  struct ospf *ospf;
 
-  for (node = listhead (ospf_top->oiflist); node; nextnode (node))
+  ospf = ospf_lookup ();
+
+  for (node = listhead (ospf->oiflist); node; nextnode (node))
     {
       if ((oi = getdata (node)) && oi->ifp == ifp)
 	{
@@ -1061,8 +1067,11 @@
 {
   listnode node;
   listnode n2;
+  struct ospf *ospf;
 
-  for (node = listhead (ospf_top->oiflist); node; nextnode (node))
+  ospf = ospf_lookup ();
+
+  for (node = listhead (ospf->oiflist); node; nextnode (node))
     {
       struct ospf_interface *oi = (struct ospf_interface *) getdata (node);
 
@@ -1110,8 +1119,11 @@
 {
   listnode node;
   listnode n2;
+  struct ospf *ospf;
 
-  for (node = listhead (ospf_top->areas); node; nextnode (node))
+  ospf = ospf_lookup ();
+
+  for (node = listhead (ospf->areas); node; nextnode (node))
     {
       struct ospf_area *area = getdata (node);
 
@@ -1157,9 +1169,12 @@
 ospf_apiserver_notify_ready_type11 (struct ospf_apiserver *apiserv)
 {
   listnode n2;
+  struct ospf *ospf;
+
+  ospf = ospf_lookup ();
 
   /* Can type 11 be originated? */
-  if (!ospf_apiserver_is_ready_type11 (ospf_top))
+  if (!ospf_apiserver_is_ready_type11 (ospf))
     goto out;;
 
   /* Check for registered opaque type 11 types */
@@ -1343,6 +1358,11 @@
   }
   param;
   u_int16_t mask;
+  struct route_node *rn;
+  struct ospf_lsa *lsa;
+  struct ospf *ospf;
+
+  ospf = ospf_lookup ();
 
   /* Get request sequence number */
   seqnum = msg_get_seq (msg);
@@ -1357,7 +1377,7 @@
   mask = ntohs (smsg->filter.typemask);
 
   /* Iterate over all areas. */
-  for (node = listhead (ospf_top->areas); node; nextnode (node))
+  for (node = listhead (ospf->areas); node; nextnode (node))
     {
       struct ospf_area *area = node->data;
       int i;
@@ -1388,40 +1408,40 @@
 	{
 	  /* Check msg type. */
 	  if (mask & Power2[OSPF_ROUTER_LSA])
-	    foreach_lsa (ROUTER_LSDB (area), (void *) &param, seqnum,
-			 apiserver_sync_callback);
+	    LSDB_LOOP (ROUTER_LSDB (area), rn, lsa)
+	      apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	  if (mask & Power2[OSPF_NETWORK_LSA])
-	    foreach_lsa (NETWORK_LSDB (area), (void *) &param, seqnum,
-			 apiserver_sync_callback);
+            LSDB_LOOP (NETWORK_LSDB (area), rn, lsa)
+              apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	  if (mask & Power2[OSPF_SUMMARY_LSA])
-	    foreach_lsa (SUMMARY_LSDB (area), (void *) &param, seqnum,
-			 apiserver_sync_callback);
+            LSDB_LOOP (SUMMARY_LSDB (area), rn, lsa)
+              apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	  if (mask & Power2[OSPF_ASBR_SUMMARY_LSA])
-	    foreach_lsa (ASBR_SUMMARY_LSDB (area), (void *) &param, seqnum,
-			 apiserver_sync_callback);
+            LSDB_LOOP (ASBR_SUMMARY_LSDB (area), rn, lsa)
+              apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	  if (mask & Power2[OSPF_OPAQUE_LINK_LSA])
-	    foreach_lsa (OPAQUE_LINK_LSDB (area), (void *) &param,
-			 seqnum, apiserver_sync_callback);
+            LSDB_LOOP (OPAQUE_LINK_LSDB (area), rn, lsa)
+              apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	  if (mask & Power2[OSPF_OPAQUE_AREA_LSA])
-	    foreach_lsa (OPAQUE_AREA_LSDB (area), (void *) &param,
-			 seqnum, apiserver_sync_callback);
+            LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa)
+              apiserver_sync_callback(lsa, (void *) &param, seqnum);
 	}
     }
 
   /* For AS-external LSAs */
-  if (ospf_top->lsdb)
+  if (ospf->lsdb)
     {
       if (mask & Power2[OSPF_AS_EXTERNAL_LSA])
-	foreach_lsa (EXTERNAL_LSDB (ospf_top), (void *) &param, seqnum,
-		     apiserver_sync_callback);
+	LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa)
+	  apiserver_sync_callback(lsa, (void *) &param, seqnum);
     }
 
   /* For AS-external opaque LSAs */
-  if (ospf_top->lsdb)
+  if (ospf->lsdb)
     {
       if (mask & Power2[OSPF_OPAQUE_AS_LSA])
-	foreach_lsa (OPAQUE_AS_LSDB (ospf_top), (void *) &param,
-		     seqnum, apiserver_sync_callback);
+	LSDB_LOOP (OPAQUE_AS_LSDB (ospf), rn, lsa)
+	  apiserver_sync_callback(lsa, (void *) &param, seqnum);
     }
 
   /* Send a reply back to client with return code */
@@ -1453,25 +1473,9 @@
   u_char options = 0x0;
   u_int16_t length;
 
-  struct ospf *ospf = ospf_top;
+  struct ospf *ospf;
 
-#if 0
-  struct ospf *ospf = NULL;
-
-  switch(protolsa->type)
-    {
-    case OSPF_OPAQUE_LINK_LSA:
-      ospf = oi_to_top (oi); /* ospf_opaque.c */
-      break;
-    case OSPF_OPAQUE_AREA_LSA:
-      ospf = area->ospf;
-      break;
-    case OSPF_OPAQUE_AS_LSA:
-      ospf = ospf_top; /* XXX */
-      break;
-    }
-#endif
-
+  ospf = ospf_lookup();
   assert(ospf);
 
   /* Create a stream for internal opaque LSA */
@@ -1605,10 +1609,13 @@
   struct ospf_area *area = NULL;
   struct ospf_interface *oi = NULL;
   struct ospf_lsdb *lsdb = NULL;
+  struct ospf *ospf;
   int lsa_type, opaque_type;
   int ready = 0;
   int rc = 0;
   
+  ospf = ospf_lookup();
+
   /* Extract opaque LSA data from message */
   omsg = (struct msg_originate_request *) STREAM_DATA (msg->s);
   data = &omsg->data;
@@ -1629,7 +1636,7 @@
       lsdb = area->lsdb;
       break;
     case OSPF_OPAQUE_AREA_LSA:
-      area = ospf_area_lookup_by_area_id (ospf_top, omsg->area_id);
+      area = ospf_area_lookup_by_area_id (ospf, omsg->area_id);
       if (!area)
 	{
 	  zlog_warn ("apiserver_originate: unknown area %s",
@@ -1640,7 +1647,7 @@
       lsdb = area->lsdb;
       break;
     case OSPF_OPAQUE_AS_LSA:
-      lsdb = ospf_top->lsdb;
+      lsdb = ospf->lsdb;
       break;
     default:
       /* We can only handle opaque types here */
@@ -1671,7 +1678,7 @@
       ready = ospf_apiserver_is_ready_type10 (area);
       break;
     case OSPF_OPAQUE_AS_LSA:
-      ready = ospf_apiserver_is_ready_type11 (ospf_top);
+      ready = ospf_apiserver_is_ready_type11 (ospf);
       break;
     default:
       break;
@@ -1754,10 +1761,15 @@
       break;
     case OSPF_OPAQUE_AS_LSA:
       {
+	struct ospf *ospf;
+
+	ospf = ospf_lookup();
+	assert(ospf);
+
 	/* Increment counters? XXX */
 
 	/* Flood LSA through AS. */
-	ospf_flood_through_as (ospf_top, NULL /*nbr */ , lsa);
+	ospf_flood_through_as (ospf, NULL /*nbr */ , lsa);
 	break;
       }
     }
@@ -1766,8 +1778,13 @@
 int
 ospf_apiserver_originate1 (struct ospf_lsa *lsa)
 {
+  struct ospf *ospf;
+
+  ospf = ospf_lookup();
+  assert(ospf);
+
   /* Install this LSA into LSDB. */
-  if (ospf_lsa_install (ospf_top, lsa->oi, lsa) == NULL)
+  if (ospf_lsa_install (ospf, lsa->oi, lsa) == NULL)
     {
       zlog_warn ("ospf_apiserver_originate1: ospf_lsa_install failed");
       return -1;
@@ -1836,6 +1853,10 @@
 {
   struct ospf_apiserver *apiserv;
   struct ospf_lsa *new = NULL;
+  struct ospf * ospf;
+
+  ospf = ospf_lookup();
+  assert(ospf);
 
   apiserv = lookup_apiserver_by_lsa (lsa);
   if (!apiserv)
@@ -1877,7 +1898,7 @@
   SET_FLAG (new->flags, OSPF_LSA_SELF);
 
   /* Install LSA into LSDB. */
-  if (ospf_lsa_install (ospf_top, new->oi, new) == NULL)
+  if (ospf_lsa_install (ospf, new->oi, new) == NULL)
     {
       zlog_warn ("ospf_apiserver_lsa_refresher: ospf_lsa_install failed");
       ospf_lsa_free (new);
@@ -1919,6 +1940,10 @@
   struct in_addr id;
   int lsa_type, opaque_type;
   int rc = 0;
+  struct ospf * ospf;
+
+  ospf = ospf_lookup();
+  assert(ospf);
 
   /* Extract opaque LSA from message */
   dmsg = (struct msg_delete_request *) STREAM_DATA (msg->s);
@@ -1928,7 +1953,7 @@
     {
     case OSPF_OPAQUE_LINK_LSA:
     case OSPF_OPAQUE_AREA_LSA:
-      area = ospf_area_lookup_by_area_id (ospf_top, dmsg->area_id);
+      area = ospf_area_lookup_by_area_id (ospf, dmsg->area_id);
       if (!area)
 	{
 	  zlog_warn ("ospf_apiserver_lsa_delete: unknown area %s",
@@ -1969,7 +1994,7 @@
    * the LSDB until it is finally handled by the maxage remover thread.
    * Therefore, the lookup function below may return non-NULL result.
    */
-  old = ospf_lsa_lookup (area, dmsg->lsa_type, id, ospf_top->router_id);
+  old = ospf_lsa_lookup (area, dmsg->lsa_type, id, ospf->router_id);
   if (!old)
     {
       zlog_warn ("ospf_apiserver_lsa_delete: LSA[Type%d:%s] not in LSDB",
@@ -2032,6 +2057,10 @@
   }
   param;
   listnode node;
+  struct ospf * ospf;
+
+  ospf = ospf_lookup();
+  assert(ospf);
 
   /* Set parameter struct. */
   param.apiserv = apiserv;
@@ -2051,7 +2080,7 @@
     }
 
   /* For AS-external opaque LSAs */
-  if (ospf_top->lsdb)
+  if (ospf->lsdb)
     {
       foreach_lsa (OPAQUE_AS_LSDB (ospf_top), (void *) &param, 0,
 		   apiserver_flush_opaque_type_callback);
@@ -2059,25 +2088,28 @@
 #else /* ORIGINAL_CODING */
   switch (lsa_type)
     {
+      struct route_node *rn;
+      struct ospf_lsa *lsa;
+
     case OSPF_OPAQUE_LINK_LSA:
-      for (node = listhead (ospf_top->areas); node; nextnode (node))
+      for (node = listhead (ospf->areas); node; nextnode (node))
         {
           struct ospf_area *area = node->data;
-          foreach_lsa (OPAQUE_LINK_LSDB (area), (void *) &param, 0,
-    		   apiserver_flush_opaque_type_callback);
+	  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_top->areas); node; nextnode (node))
+      for (node = listhead (ospf->areas); node; nextnode (node))
         {
           struct ospf_area *area = node->data;
-          foreach_lsa (OPAQUE_AREA_LSDB (area), (void *) &param, 0,
-    		   apiserver_flush_opaque_type_callback);
+	  LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa)
+	    apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
         }
       break;
     case OSPF_OPAQUE_AS_LSA:
-      foreach_lsa (OPAQUE_AS_LSDB (ospf_top), (void *) &param, 0,
-		   apiserver_flush_opaque_type_callback);
+      LSDB_LOOP (OPAQUE_LINK_LSDB (ospf), rn, lsa)
+	apiserver_flush_opaque_type_callback(lsa, (void *) &param, 0);
       break;
     default:
       break;
