diff --git a/ospf6d/ChangeLog b/ospf6d/ChangeLog
index b9181d0..5dd2a66 100644
--- a/ospf6d/ChangeLog
+++ b/ospf6d/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-02  Yasuhiro Ohara  <yasu@sfc.wide.ad.jp>
+
+	* *.[ch]: Logging LSAs of particular type is added.
+	lsa_handler is now using vector in order to adjust
+	existing LSA modules.
+	* ospf6d.h: version 0.9.7l
+
 2004-08-28  Hasso Tepper  <hasso at quagga.net>
 
 	* ospf6_main.c: Modify for sigevents.
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 2d4b10f..29188ab 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -158,29 +158,33 @@
   struct ospf6_inter_router_lsa *router_lsa;
   struct ospf6_route_table *summary_table = NULL;
   u_int16_t type;
+  char buf[64];
+  int is_debug = 0;
 
-  if (IS_OSPF6_DEBUG_ABR)
+  if (route->type == OSPF6_DEST_TYPE_ROUTER)
     {
-      char buf[64];
-      if (route->type == OSPF6_DEST_TYPE_ROUTER)
+      if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_ORIGINATE (INTER_ROUTER))
         {
+          is_debug++;
           inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
                      buf, sizeof (buf));
           zlog_info ("Originating summary in area %s for ASBR %s",
                      area->name, buf);
         }
-      else
+      summary_table = area->summary_router;
+    }
+  else
+    {
+      if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_ORIGINATE (INTER_PREFIX))
         {
+          is_debug++;
           prefix2str (&route->prefix, buf, sizeof (buf));
           zlog_info ("Originating summary in area %s for %s",
                      area->name, buf);
         }
+      summary_table = area->summary_prefix;
     }
 
-  if (route->type == OSPF6_DEST_TYPE_ROUTER)
-    summary_table = area->summary_router;
-  else
-    summary_table = area->summary_prefix;
   summary = ospf6_route_lookup (&route->prefix, summary_table);
   if (summary)
     old = ospf6_lsdb_lookup (summary->path.origin.type,
@@ -190,7 +194,7 @@
   /* if this route has just removed, remove corresponding LSA */
   if (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE))
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("The route has just removed, purge previous LSA");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -205,7 +209,7 @@
       (route->type != OSPF6_DEST_TYPE_ROUTER ||
        ! CHECK_FLAG (route->path.router_bits, OSPF6_ROUTER_BIT_E)))
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("Route type is none of network, range nor ASBR, withdraw");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -218,7 +222,7 @@
   if (route->path.type == OSPF6_PATH_TYPE_EXTERNAL1 ||
       route->path.type == OSPF6_PATH_TYPE_EXTERNAL2)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("Path type is external, withdraw");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -230,7 +234,7 @@
   /* do not generate if the path's area is the same as target area */
   if (route->path.area_id == area->area_id)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("The route is in the area itself, ignore");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -243,7 +247,7 @@
   oi = ospf6_interface_lookup_by_ifindex (route->nexthop[0].ifindex);
   if (oi && oi->area && oi->area == area)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("The route's nexthop is in the same area, ignore");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -255,7 +259,7 @@
   /* do not generate if the route cost is greater or equal to LSInfinity */
   if (route->path.cost >= LS_INFINITY)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("The cost exceeds LSInfinity, withdraw");
       if (summary)
         ospf6_route_remove (summary, summary_table);
@@ -270,7 +274,7 @@
       /* Only the prefered best path is considered */
       if (! CHECK_FLAG (route->flag, OSPF6_ROUTE_BEST))
         {
-          if (IS_OSPF6_DEBUG_ABR)
+          if (is_debug)
             zlog_info ("This is the secondary path to the ASBR, ignore");
           if (summary)
             ospf6_route_remove (summary, summary_table);
@@ -299,9 +303,8 @@
           (route->path.area_id != BACKBONE_AREA_ID ||
            ! IS_AREA_TRANSIT (area)))
         {
-          if (IS_OSPF6_DEBUG_ABR)
+          if (is_debug)
             {
-              char buf[64];
               prefix2str (&range->prefix, buf, sizeof (buf));
               zlog_info ("Suppressed by range %s of area %s",
                          buf, route_area->name);
@@ -321,7 +324,7 @@
       /* If DoNotAdvertise is set */
       if (CHECK_FLAG (route->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE))
         {
-          if (IS_OSPF6_DEBUG_ABR)
+          if (is_debug)
             zlog_info ("This is the range with DoNotAdvertise set. ignore");
           if (summary)
             ospf6_route_remove (summary, summary_table);
@@ -333,7 +336,7 @@
       /* Whether the route have active longer prefix */
       if (! CHECK_FLAG (route->flag, OSPF6_ROUTE_ACTIVE_SUMMARY))
         {
-          if (IS_OSPF6_DEBUG_ABR)
+          if (is_debug)
             zlog_info ("The range is not active. withdraw");
           if (summary)
             ospf6_route_remove (summary, summary_table);
@@ -427,9 +430,6 @@
   /* create LSA */
   lsa = ospf6_lsa_create (lsa_header);
 
-  if (IS_OSPF6_DEBUG_ABR)
-    zlog_info ("Originate as %s", lsa->name);
-
   /* Originate */
   ospf6_lsa_originate_area (lsa, area);
 }
@@ -500,13 +500,18 @@
   u_int32_t cost = 0;
   int i;
   char buf[64];
-
-  if (IS_OSPF6_DEBUG_ABR)
-    zlog_info ("Examin %s in area %s", lsa->name, oa->name);
+  int is_debug = 0;
 
   if (lsa->header->type == htons (OSPF6_LSTYPE_INTER_PREFIX))
     {
       struct ospf6_inter_prefix_lsa *prefix_lsa;
+
+      if (IS_OSPF6_DEBUG_EXAMIN (INTER_PREFIX))
+        {
+          is_debug++;
+          zlog_info ("Examin %s in area %s", lsa->name, oa->name);
+        }
+
       prefix_lsa = (struct ospf6_inter_prefix_lsa *)
         OSPF6_LSA_HEADER_END (lsa->header);
       prefix.family = AF_INET6;
@@ -521,6 +526,13 @@
   else if (lsa->header->type == htons (OSPF6_LSTYPE_INTER_ROUTER))
     {
       struct ospf6_inter_router_lsa *router_lsa;
+
+      if (IS_OSPF6_DEBUG_EXAMIN (INTER_ROUTER))
+        {
+          is_debug++;
+          zlog_info ("Examin %s in area %s", lsa->name, oa->name);
+        }
+
       router_lsa = (struct ospf6_inter_router_lsa *)
         OSPF6_LSA_HEADER_END (lsa->header);
       ospf6_linkstate_prefix (router_lsa->router_id, htonl (0), &prefix);
@@ -552,7 +564,7 @@
   /* (1) if cost == LSInfinity or if the LSA is MaxAge */
   if (cost == LS_INFINITY)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("cost is LS_INFINITY, ignore");
       if (old)
         ospf6_route_remove (old, oa->ospf6->route_table);
@@ -560,7 +572,7 @@
     }
   if (OSPF6_LSA_IS_MAXAGE (lsa))
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("LSA is MaxAge, ignore");
       if (old)
         ospf6_route_remove (old, oa->ospf6->route_table);
@@ -570,7 +582,7 @@
   /* (2) if the LSA is self-originated, ignore */
   if (lsa->header->adv_router == oa->ospf6->router_id)
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("LSA is self-originated, ignore");
       if (old)
         ospf6_route_remove (old, oa->ospf6->route_table);
@@ -583,7 +595,7 @@
       range = ospf6_route_lookup (&prefix, oa->range_table);
       if (range)
         {
-          if (IS_OSPF6_DEBUG_ABR)
+          if (is_debug)
             zlog_info ("Prefix is equal to address range, ignore");
           if (old)
             ospf6_route_remove (old, oa->ospf6->route_table);
@@ -598,7 +610,7 @@
       CHECK_FLAG (abr_entry->flag, OSPF6_ROUTE_REMOVE) ||
       ! CHECK_FLAG (abr_entry->path.router_bits, OSPF6_ROUTER_BIT_B))
     {
-      if (IS_OSPF6_DEBUG_ABR)
+      if (is_debug)
         zlog_info ("ABR router entry does not exist, ignore");
       if (old)
         ospf6_route_remove (old, oa->ospf6->route_table);
@@ -628,7 +640,7 @@
   for (i = 0; i < OSPF6_MULTI_PATH_LIMIT; i++)
     route->nexthop[i] = abr_entry->nexthop[i];
 
-  if (IS_OSPF6_DEBUG_ABR)
+  if (is_debug)
     zlog_info ("Install route: %s", buf);
   ospf6_route_add (route, table);
 }
@@ -641,14 +653,6 @@
   listnode node;
   u_int16_t type;
 
-  if (IS_OSPF6_DEBUG_ABR)
-    {
-      char buf[16];
-      inet_ntop (AF_INET, &router_id, buf, sizeof (buf));
-      zlog_info ("Router entry of %s changed", buf);
-      zlog_info ("Examin summary LSAs originated by the router");
-    }
-
   type = htons (OSPF6_LSTYPE_INTER_ROUTER);
   for (node = listhead (ospf6->area_list); node; nextnode (node))
     {
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 312d88f..78d70a2 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -59,6 +59,12 @@
     {
     case OSPF6_LSTYPE_ROUTER:
     case OSPF6_LSTYPE_NETWORK:
+      if (IS_OSPF6_DEBUG_EXAMIN_TYPE (lsa->header->type))
+        {
+          zlog_info ("Examin %s", lsa->name);
+          zlog_info ("Schedule SPF Calculation for %s",
+                     OSPF6_AREA (lsa->lsdb->data)->name);
+        }
       ospf6_spf_schedule (OSPF6_AREA (lsa->lsdb->data));
       break;
 
@@ -72,9 +78,6 @@
       break;
 
     default:
-      if (IS_OSPF6_DEBUG_LSA (RECV))
-	zlog_info ("Unknown LSA in Area %s's lsdb",
-                   OSPF6_AREA (lsa->lsdb->data)->name);
       break;
     }
 }
@@ -86,6 +89,12 @@
     {
     case OSPF6_LSTYPE_ROUTER:
     case OSPF6_LSTYPE_NETWORK:
+      if (IS_OSPF6_DEBUG_EXAMIN_TYPE (lsa->header->type))
+        {
+          zlog_info ("LSA disappearing: %s", lsa->name);
+          zlog_info ("Schedule SPF Calculation for %s",
+                     OSPF6_AREA (lsa->lsdb->data)->name);
+        }
       ospf6_spf_schedule (OSPF6_AREA (lsa->lsdb->data));
       break;
 
@@ -99,9 +108,6 @@
       break;
 
     default:
-      if (IS_OSPF6_DEBUG_LSA (RECV))
-	zlog_info ("Unknown LSA in Area %s's lsdb",
-                   OSPF6_AREA (lsa->lsdb->data)->name);
       break;
     }
 }
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 3352465..3b161ac 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -81,7 +81,7 @@
                            route->path.origin.id, ospf6->router_id,
                            ospf6->lsdb);
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ASBR || IS_OSPF6_DEBUG_ORIGINATE (AS_EXTERNAL))
     {
       prefix2str (&route->prefix, buf, sizeof (buf));
       zlog_info ("Originate AS-External-LSA for %s", buf);
@@ -175,19 +175,19 @@
   external = (struct ospf6_as_external_lsa *)
     OSPF6_LSA_HEADER_END (lsa->header);
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     zlog_info ("Calculate AS-External route for %s", lsa->name);
 
   if (lsa->header->adv_router == ospf6->router_id)
     {
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         zlog_info ("Ignore self-originated AS-External-LSA");
       return;
     }
 
   if (OSPF6_ASBR_METRIC (external) == LS_INFINITY)
     {
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         zlog_info ("Ignore LSA with LSInfinity Metric");
       return;
     }
@@ -196,7 +196,7 @@
   asbr_entry = ospf6_route_lookup (&asbr_id, ospf6->brouter_table);
   if (asbr_entry == NULL)
     {
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         {
           prefix2str (&asbr_id, buf, sizeof (buf));
           zlog_info ("ASBR entry not found: %s", buf);
@@ -234,7 +234,7 @@
   for (i = 0; i < OSPF6_MULTI_PATH_LIMIT; i++)
     ospf6_nexthop_copy (&route->nexthop[i], &asbr_entry->nexthop[i]);
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     {
       prefix2str (&route->prefix, buf, sizeof (buf));
       zlog_info ("AS-External route add: %s", buf);
@@ -254,12 +254,12 @@
   external = (struct ospf6_as_external_lsa *)
     OSPF6_LSA_HEADER_END (lsa->header);
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     zlog_info ("Withdraw AS-External route for %s", lsa->name);
 
   if (lsa->header->adv_router == ospf6->router_id)
     {
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         zlog_info ("Ignore self-originated AS-External-LSA");
       return;
     }
@@ -272,7 +272,7 @@
   route = ospf6_route_lookup (&prefix, ospf6->route_table);
   if (route == NULL)
     {
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         {
           prefix2str (&prefix, buf, sizeof (buf));
           zlog_info ("AS-External route %s not found", buf);
@@ -293,7 +293,7 @@
       if (route->path.origin.adv_router != lsa->header->adv_router)
         continue;
 
-      if (IS_OSPF6_DEBUG_ASBR)
+      if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         {
           prefix2str (&route->prefix, buf, sizeof (buf));
           zlog_info ("AS-External route remove: %s", buf);
@@ -310,7 +310,7 @@
   u_int16_t type;
   u_int32_t router;
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     {
       ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf));
       zlog_info ("New ASBR %s found", buf);
@@ -325,7 +325,7 @@
         ospf6_asbr_lsa_add (lsa);
     }
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     {
       ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf));
       zlog_info ("Calculation for new ASBR %s done", buf);
@@ -340,7 +340,7 @@
   u_int16_t type;
   u_int32_t router;
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     {
       ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf));
       zlog_info ("ASBR %s disappeared", buf);
@@ -352,7 +352,7 @@
        lsa; lsa = ospf6_lsdb_type_router_next (type, router, lsa))
     ospf6_asbr_lsa_remove (lsa);
 
-  if (IS_OSPF6_DEBUG_ASBR)
+  if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
     {
       ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf));
       zlog_info ("Calculation for old ASBR %s done", buf);
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index ec5c1c6..e9ba52b 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -25,6 +25,7 @@
 #include "thread.h"
 #include "linklist.h"
 #include "vty.h"
+#include "command.h"
 
 #include "ospf6d.h"
 #include "ospf6_proto.h"
@@ -41,6 +42,8 @@
 
 #include "ospf6_flood.h"
 
+unsigned char conf_debug_ospf6_flooding;
+
 struct ospf6_lsdb *
 ospf6_get_scoped_lsdb (struct ospf6_lsa *lsa)
 {
@@ -99,7 +102,7 @@
      suppress this update of the LSA */
   if (old && ! OSPF6_LSA_IS_DIFFER (lsa, old))
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE_TYPE (lsa->header->type))
         zlog_info ("Suppress updating LSA: %s", lsa->name);
       ospf6_lsa_delete (lsa);
       return;
@@ -112,7 +115,8 @@
   lsa->refresh = thread_add_timer (master, ospf6_lsa_refresh, lsa,
                                    LS_REFRESH_TIME);
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type) ||
+      IS_OSPF6_DEBUG_ORIGINATE_TYPE (lsa->header->type))
     {
       zlog_info ("LSA Originate:");
       ospf6_lsa_header_print (lsa);
@@ -185,14 +189,14 @@
 
   /* The LSA must be on the retrans-list of a neighbor. It means
      the "lsa" is a copied one, and we have to decrement the
-     retransmission count of the original one (instead of "lsa"'s).
+     retransmission count of the original one (instead of this "lsa"'s).
      In order to find the original LSA, first we have to find
      appropriate LSDB that have the original LSA. */
   lsdb = ospf6_get_scoped_lsdb (lsa);
 
   /* Find the original LSA of which the retrans_count should be decremented */
   orig = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id,
-                           lsa->header->adv_router, lsdb);
+                            lsa->header->adv_router, lsdb);
   if (orig)
     {
       orig->retrans_count--;
@@ -207,7 +211,8 @@
   struct ospf6_lsa *old;
   struct timeval now;
 
-  if (IS_OSPF6_DEBUG_LSA (RECV) || IS_OSPF6_DEBUG_LSA (DATABASE))
+  if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type) ||
+      IS_OSPF6_DEBUG_EXAMIN_TYPE (lsa->header->type))
     zlog_info ("Install LSA: %s", lsa->name);
 
   /* Remove the old instance from all neighbors' Link state
@@ -244,22 +249,27 @@
   struct ospf6_neighbor *on;
   struct ospf6_lsa *req;
   int retrans_added = 0;
+  int is_debug = 0;
 
-  if (IS_OSPF6_DEBUG_LSA (SEND))
-    zlog_info ("Flooding on %s: %s", oi->interface->name, lsa->name);
+  if (IS_OSPF6_DEBUG_FLOODING ||
+      IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type))
+    {
+      is_debug++;
+      zlog_info ("Flooding on %s: %s", oi->interface->name, lsa->name);
+    }
 
   /* (1) For each neighbor */
   for (node = listhead (oi->neighbor_list); node; nextnode (node))
     {
       on = (struct ospf6_neighbor *) getdata (node);
 
-      if (IS_OSPF6_DEBUG_LSA (SEND))
+      if (is_debug)
         zlog_info ("To neighbor %s", on->name);
 
       /* (a) if neighbor state < Exchange, examin next */
       if (on->state < OSPF6_NEIGHBOR_EXCHANGE)
         {
-          if (IS_OSPF6_DEBUG_LSA (SEND))
+          if (is_debug)
             zlog_info ("Neighbor state less than ExChange, next neighbor");
           continue;
         }
@@ -267,14 +277,14 @@
       /* (b) if neighbor not yet Full, check request-list */
       if (on->state != OSPF6_NEIGHBOR_FULL)
         {
-          if (IS_OSPF6_DEBUG_LSA (SEND))
+          if (is_debug)
             zlog_info ("Neighbor not yet Full");
 
           req = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id,
                                    lsa->header->adv_router, on->request_list);
           if (req == NULL)
             {
-              if (IS_OSPF6_DEBUG_LSA (SEND))
+              if (is_debug)
                 zlog_info ("Not on request-list for this neighbor");
               /* fall through */
             }
@@ -283,7 +293,7 @@
               /* If new LSA less recent, examin next neighbor */
               if (ospf6_lsa_compare (lsa, req) > 0)
                 {
-                  if (IS_OSPF6_DEBUG_LSA (SEND))
+                  if (is_debug)
                     zlog_info ("Requesting is newer, next neighbor");
                   continue;
                 }
@@ -292,7 +302,7 @@
                  examin next neighbor */
               if (ospf6_lsa_compare (lsa, req) == 0)
                 {
-                  if (IS_OSPF6_DEBUG_LSA (SEND))
+                  if (is_debug)
                     zlog_info ("Requesting the same, remove it, next neighbor");
                   ospf6_lsdb_remove (req, on->request_list);
                   continue;
@@ -301,7 +311,7 @@
               /* If the new LSA is more recent, delete from request-list */
               if (ospf6_lsa_compare (lsa, req) < 0)
                 {
-                  if (IS_OSPF6_DEBUG_LSA (SEND))
+                  if (is_debug)
                     zlog_info ("Received is newer, remove requesting");
                   ospf6_lsdb_remove (req, on->request_list);
                   /* fall through */
@@ -313,13 +323,13 @@
          examin next neighbor */
       if (from == on)
         {
-          if (IS_OSPF6_DEBUG_LSA (SEND))
+          if (is_debug)
             zlog_info ("Received is from the neighbor, next neighbor");
           continue;
         }
 
       /* (d) add retrans-list, schedule retransmission */
-      if (IS_OSPF6_DEBUG_LSA (SEND))
+      if (is_debug)
         zlog_info ("Add retrans-list of this neighbor");
       ospf6_increment_retrans_count (lsa);
       ospf6_lsdb_add (ospf6_lsa_copy (lsa), on->retrans_list);
@@ -333,7 +343,7 @@
   /* (2) examin next interface if not added to retrans-list */
   if (retrans_added == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (SEND))
+      if (is_debug)
         zlog_info ("No retransmission scheduled, next interface");
       return;
     }
@@ -343,7 +353,7 @@
   if (from && from->ospf6_if == oi &&
       (from->router_id == oi->drouter || from->router_id == oi->bdrouter))
     {
-      if (IS_OSPF6_DEBUG_LSA (SEND))
+      if (is_debug)
         zlog_info ("Received is from the I/F's DR or BDR, next interface");
       return;
     }
@@ -352,13 +362,13 @@
      and the interface state is BDR, examin next interface */
   if (from && from->ospf6_if == oi && oi->state == OSPF6_INTERFACE_BDR)
     {
-      if (IS_OSPF6_DEBUG_LSA (SEND))
+      if (is_debug)
         zlog_info ("Received is from the I/F, itself BDR, next interface");
       return;
     }
 
   /* (5) flood the LSA out the interface. */
-  if (IS_OSPF6_DEBUG_LSA (SEND))
+  if (is_debug)
     zlog_info ("Schedule flooding for the interface");
   if (if_is_broadcast (oi->interface))
     {
@@ -451,7 +461,8 @@
                                lsa->header->adv_router, on->retrans_list);
       if (rem && ! ospf6_lsa_compare (rem, lsa))
         {
-          if (IS_OSPF6_DEBUG_LSA (DATABASE))
+          if (IS_OSPF6_DEBUG_FLOODING ||
+              IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type))
             zlog_info ("Remove %s from retrans_list of %s",
                        rem->name, on->name);
           ospf6_decrement_retrans_count (rem);
@@ -522,6 +533,11 @@
                                 struct ospf6_neighbor *from)
 {
   struct ospf6_interface *oi;
+  int is_debug = 0;
+
+  if (IS_OSPF6_DEBUG_FLOODING ||
+      IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type))
+    is_debug++;
 
   assert (from && from->ospf6_if);
   oi = from->ospf6_if;
@@ -530,7 +546,7 @@
      No acknowledgement sent. */
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_FLOODBACK))
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("No acknowledgement (BDR & FloodBack)");
       return;
     }
@@ -543,7 +559,7 @@
     {
       if (oi->drouter == from->router_id)
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             zlog_info ("Delayed acknowledgement (BDR & MoreRecent & from DR)");
           /* Delayed acknowledgement */
           ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list);
@@ -553,7 +569,7 @@
         }
       else
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             zlog_info ("No acknowledgement (BDR & MoreRecent & ! from DR)");
         }
       return;
@@ -567,7 +583,7 @@
     {
       if (oi->drouter == from->router_id)
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             zlog_info ("Delayed acknowledgement (BDR & Duplicate & ImpliedAck & from DR)");
           /* Delayed acknowledgement */
           ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list);
@@ -577,7 +593,7 @@
         }
       else
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             zlog_info ("No acknowledgement (BDR & Duplicate & ImpliedAck & ! from DR)");
         }
       return;
@@ -588,7 +604,7 @@
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_DUPLICATE) &&
       ! CHECK_FLAG (lsa->flag, OSPF6_LSA_IMPLIEDACK))
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Direct acknowledgement (BDR & Duplicate)");
       ospf6_lsdb_add (ospf6_lsa_copy (lsa), from->lsack_list);
       if (from->thread_send_lsack == NULL)
@@ -609,6 +625,11 @@
                                 struct ospf6_neighbor *from)
 {
   struct ospf6_interface *oi;
+  int is_debug = 0;
+
+  if (IS_OSPF6_DEBUG_FLOODING ||
+      IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type))
+    is_debug++;
 
   assert (from && from->ospf6_if);
   oi = from->ospf6_if;
@@ -617,7 +638,7 @@
      No acknowledgement sent. */
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_FLOODBACK))
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("No acknowledgement (AllOther & FloodBack)");
       return;
     }
@@ -626,7 +647,7 @@
      back out receiving interface. Delayed acknowledgement sent. */
   if (ismore_recent < 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Delayed acknowledgement (AllOther & MoreRecent)");
       /* Delayed acknowledgement */
       ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list);
@@ -641,7 +662,7 @@
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_DUPLICATE) &&
       CHECK_FLAG (lsa->flag, OSPF6_LSA_IMPLIEDACK))
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("No acknowledgement (AllOther & Duplicate & ImpliedAck)");
       return;
     }
@@ -651,7 +672,7 @@
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_DUPLICATE) &&
       ! CHECK_FLAG (lsa->flag, OSPF6_LSA_IMPLIEDACK))
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Direct acknowledgement (AllOther & Duplicate)");
       ospf6_lsdb_add (ospf6_lsa_copy (lsa), from->lsack_list);
       if (from->thread_send_lsack == NULL)
@@ -733,6 +754,7 @@
   struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
   int ismore_recent;
   unsigned short cksum;
+  int is_debug = 0;
 
   ismore_recent = 1;
   assert (from);
@@ -740,8 +762,10 @@
   /* make lsa structure for received lsa */
   new = ospf6_lsa_create (lsa_header);
 
-  if (IS_OSPF6_DEBUG_LSA (RECV))
+  if (IS_OSPF6_DEBUG_FLOODING ||
+      IS_OSPF6_DEBUG_FLOOD_TYPE (new->header->type))
     {
+      is_debug++;
       zlog_info ("LSA Receive from %s", from->name);
       ospf6_lsa_header_print (new);
     }
@@ -750,7 +774,7 @@
   cksum = ntohs (new->header->checksum);
   if (ntohs (ospf6_lsa_checksum (new->header)) != cksum)
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Wrong LSA Checksum, discard");
       ospf6_lsa_delete (new);
       return;
@@ -761,7 +785,7 @@
   if (IS_AREA_STUB (from->ospf6_if->area) &&
       OSPF6_LSA_SCOPE (new->header->type) == OSPF6_SCOPE_AS)
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("AS-External-LSA (or AS-scope LSA) in stub area, discard");
       ospf6_lsa_delete (new);
       return;
@@ -783,7 +807,7 @@
       new->lsdb = from->ospf6_if->area->ospf6->lsdb;
       break;
     default:
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("LSA has reserved scope, discard");
       ospf6_lsa_delete (new);
       return;
@@ -794,7 +818,7 @@
   if (ospf6_is_maxage_lsa_drop (new, from))
     {
       /* log */
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Drop MaxAge LSA with direct acknowledgement.");
 
       /* a) Acknowledge back to neighbor (Direct acknowledgement, 13.5) */
@@ -817,7 +841,7 @@
       ismore_recent = ospf6_lsa_compare (new, old);
       if (ntohl (new->header->seqnum) == ntohl (old->header->seqnum))
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             zlog_info ("Received is duplicated LSA");
           SET_FLAG (new->flag, OSPF6_LSA_DUPLICATE);
         }
@@ -837,7 +861,7 @@
           timersub (&now, &old->installed, &res);
           if (res.tv_sec < MIN_LS_ARRIVAL)
             {
-              if (IS_OSPF6_DEBUG_LSA (RECV) || IS_OSPF6_DEBUG_LSA (TIMER))
+              if (is_debug)
                 zlog_info ("LSA can't be updated within MinLSArrival, discard");
               ospf6_lsa_delete (new);
               return;   /* examin next lsa */
@@ -846,7 +870,7 @@
 
       gettimeofday (&new->received, (struct timezone *) NULL);
 
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Flood, Install, Possibly acknowledge the received LSA");
 
       /* (b) immediately flood and (c) remove from all retrans-list */
@@ -873,7 +897,7 @@
           /* Self-originated LSA (newer than ours) is received from
              another router. We have to make a new instance of the LSA
              or have to flush this LSA. */
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             {
               zlog_info ("Newer instance of the self-originated LSA");
               zlog_info ("Schedule reorigination");
@@ -891,7 +915,7 @@
       /* if no database copy, should go above state (5) */
       assert (old);
 
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         {
           zlog_info ("Received is not newer, on the neighbor's request-list");
           zlog_info ("BadLSReq, discard the received LSA");
@@ -907,7 +931,7 @@
   /* (7) if neither one is more recent */
   if (ismore_recent == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("The same instance as database copy (neither recent)");
 
       /* (a) if on retrans-list, Treat this LSA as an Ack: Implied Ack */
@@ -915,7 +939,7 @@
                                new->header->adv_router, from->retrans_list);
       if (rem)
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             {
               zlog_info ("It is on the neighbor's retrans-list.");
               zlog_info ("Treat as an Implied acknowledgement");
@@ -925,7 +949,7 @@
           ospf6_lsdb_remove (rem, from->retrans_list);
         }
 
-      if (IS_OSPF6_DEBUG_LSA (RECV))
+      if (is_debug)
         zlog_info ("Possibly acknowledge and then discard");
 
       /* (b) possibly acknowledge */
@@ -944,7 +968,7 @@
       if (OSPF6_LSA_IS_MAXAGE (old) &&
           old->header->seqnum == htonl (MAX_SEQUENCE_NUMBER))
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             {
               zlog_info ("The LSA is in Seqnumber Wrapping");
               zlog_info ("MaxAge & MaxSeqNum, discard");
@@ -955,7 +979,7 @@
 
       /* Otherwise, Send database copy of this LSA to this neighbor */
         {
-          if (IS_OSPF6_DEBUG_LSA (RECV))
+          if (is_debug)
             {
               zlog_info ("Database copy is more recent.");
               zlog_info ("Send back directly and then discard");
@@ -975,4 +999,49 @@
 }
 
 
+DEFUN (debug_ospf6_flooding,
+       debug_ospf6_flooding_cmd,
+       "debug ospf6 flooding",
+       DEBUG_STR
+       OSPF6_STR
+       "Debug OSPFv3 flooding function\n"
+      )
+{
+  OSPF6_DEBUG_FLOODING_ON ();
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_ospf6_flooding,
+       no_debug_ospf6_flooding_cmd,
+       "no debug ospf6 flooding",
+       NO_STR
+       DEBUG_STR
+       OSPF6_STR
+       "Debug OSPFv3 flooding function\n"
+      )
+{
+  OSPF6_DEBUG_FLOODING_OFF ();
+  return CMD_SUCCESS;
+}
+
+int
+config_write_ospf6_debug_flood (struct vty *vty)
+{
+  if (IS_OSPF6_DEBUG_FLOODING)
+    vty_out (vty, "debug ospf6 flooding%s", VNL);
+  return 0;
+}
+
+void
+install_element_ospf6_debug_flood ()
+{
+  install_element (ENABLE_NODE, &debug_ospf6_flooding_cmd);
+  install_element (ENABLE_NODE, &no_debug_ospf6_flooding_cmd);
+  install_element (CONFIG_NODE, &debug_ospf6_flooding_cmd);
+  install_element (CONFIG_NODE, &no_debug_ospf6_flooding_cmd);
+}
+
+
+
+
 
diff --git a/ospf6d/ospf6_flood.h b/ospf6d/ospf6_flood.h
index e894e56..4851c14 100644
--- a/ospf6d/ospf6_flood.h
+++ b/ospf6d/ospf6_flood.h
@@ -22,6 +22,15 @@
 #ifndef OSPF6_FLOOD_H
 #define OSPF6_FLOOD_H
 
+/* Debug option */
+extern unsigned char conf_debug_ospf6_flooding;
+#define OSPF6_DEBUG_FLOODING_ON() \
+  (conf_debug_ospf6_flooding = 1)
+#define OSPF6_DEBUG_FLOODING_OFF() \
+  (conf_debug_ospf6_flooding = 0)
+#define IS_OSPF6_DEBUG_FLOODING \
+  (conf_debug_ospf6_flooding)
+
 /* Function Prototypes */
 struct ospf6_lsdb *ospf6_get_scoped_lsdb (struct ospf6_lsa *lsa);
 struct ospf6_lsdb *ospf6_get_scoped_lsdb_self (struct ospf6_lsa *lsa);
@@ -49,6 +58,9 @@
                         struct ospf6_lsa_header *header);
 void ospf6_install_lsa (struct ospf6_lsa *lsa);
 
+int config_write_ospf6_debug_flood (struct vty *vty);
+void install_element_ospf6_debug_flood ();
+
 #endif /* OSPF6_FLOOD_H */
 
 
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 52986e0..a8ea1d3 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -98,9 +98,6 @@
         break;
 
       default:
-        if (IS_OSPF6_DEBUG_LSA (RECV))
-          zlog_info ("Unknown LSA in Interface %s's lsdb",
-                     OSPF6_INTERFACE (lsa->lsdb->data)->interface->name);
         break;
     }
 }
@@ -143,8 +140,9 @@
   iobuflen = ospf6_iobuf_size (ifp->mtu6);
   if (oi->ifmtu > iobuflen)
     {
-      zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
-                 ifp->name, iobuflen);
+      if (IS_OSPF6_DEBUG_INTERFACE)
+        zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
+                   ifp->name, iobuflen);
       oi->ifmtu = iobuflen;
     }
 
@@ -275,8 +273,9 @@
   iobuflen = ospf6_iobuf_size (ifp->mtu6);
   if (oi->ifmtu > iobuflen)
     {
-      zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
-                 ifp->name, iobuflen);
+      if (IS_OSPF6_DEBUG_INTERFACE)
+        zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
+                   ifp->name, iobuflen);
       oi->ifmtu = iobuflen;
     }
 
@@ -355,11 +354,11 @@
       if (c->address->family != AF_INET6)
         continue;
 
-      CONTINUE_IF_ADDRESS_LINKLOCAL (c->address);
-      CONTINUE_IF_ADDRESS_UNSPECIFIED (c->address);
-      CONTINUE_IF_ADDRESS_LOOPBACK (c->address);
-      CONTINUE_IF_ADDRESS_V4COMPAT (c->address);
-      CONTINUE_IF_ADDRESS_V4MAPPED (c->address);
+      CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE, c->address);
+      CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE, c->address);
+      CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE, c->address);
+      CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE, c->address);
+      CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE, c->address);
 
       /* apply filter */
       if (oi->plist_name)
@@ -373,8 +372,9 @@
           ret = prefix_list_apply (plist, (void *) c->address);
           if (ret == PREFIX_DENY)
             {
-              zlog_info ("%s on %s filtered by prefix-list %s ",
-                         buf, oi->interface->name, oi->plist_name);
+              if (IS_OSPF6_DEBUG_INTERFACE)
+                zlog_info ("%s on %s filtered by prefix-list %s ",
+                           buf, oi->interface->name, oi->plist_name);
               continue;
             }
         }
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 8383fd9..d707ee7 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -121,7 +121,7 @@
   oa = (struct ospf6_area *) THREAD_ARG (thread);
   oa->thread_router_lsa = NULL;
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ORIGINATE (ROUTER))
     zlog_info ("Originate Router-LSA for Area %s", oa->name);
 
   memset (buffer, 0, sizeof (buffer));
@@ -179,7 +179,7 @@
           if ((caddr_t) lsdesc == (caddr_t) router_lsa +
                                   sizeof (struct ospf6_router_lsa))
             {
-              if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+              if (IS_OSPF6_DEBUG_ORIGINATE (ROUTER))
                 zlog_info ("Size limit setting for Router-LSA too short");
               return 0;
             }
@@ -292,7 +292,7 @@
     }
   else
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (ROUTER))
         zlog_info ("Nothing to describe in Router-LSA, suppress");
     }
 
@@ -377,7 +377,7 @@
       return 0;
     }
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ORIGINATE (NETWORK))
     zlog_info ("Originate Network-LSA for Interface %s", oi->interface->name);
 
   /* If none of neighbor is adjacent to us */
@@ -390,7 +390,7 @@
     }
   if (count == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (NETWORK))
         zlog_info ("Interface stub, ignore");
       if (old)
         ospf6_lsa_purge (old);
@@ -547,13 +547,13 @@
       return 0;
     }
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ORIGINATE (LINK))
     zlog_info ("Originate Link-LSA for Interface %s", oi->interface->name);
 
   /* can't make Link-LSA if linklocal address not set */
   if (oi->linklocal_addr == NULL)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (LINK))
         zlog_info ("No Linklocal address on %s, defer originating",
                    oi->interface->name);
       if (old)
@@ -639,7 +639,7 @@
   inet_ntop (AF_INET, &intra_prefix_lsa->ref_adv_router,
              adv_router, sizeof (adv_router));
   vty_out (vty, "     Reference: %s Id: %s Adv: %s%s",
-           OSPF6_LSTYPE_NAME (intra_prefix_lsa->ref_type), id, adv_router,
+           ospf6_lstype_name (intra_prefix_lsa->ref_type), id, adv_router,
            VNL);
 
   start = (char *) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa);
@@ -707,7 +707,7 @@
       return 0;
     }
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
     zlog_info ("Originate Intra-Area-Prefix-LSA for area %s's stub prefix",
                oa->name);
 
@@ -730,7 +730,7 @@
 
       if (oi->state == OSPF6_INTERFACE_DOWN)
         {
-          if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+          if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
             zlog_info ("  Interface %s is down, ignore", oi->interface->name);
           continue;
         }
@@ -746,20 +746,20 @@
           oi->state != OSPF6_INTERFACE_POINTTOPOINT &&
           full_count != 0)
         {
-          if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+          if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
             zlog_info ("  Interface %s is not stub, ignore",
                        oi->interface->name);
           continue;
         }
 
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("  Interface %s:", oi->interface->name);
 
       /* connected prefix to advertise */
       for (route = ospf6_route_head (oi->route_connected); route;
            route = ospf6_route_best_next (route))
         {
-          if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+          if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
             {
               prefix2str (&route->prefix, buf, sizeof (buf));
               zlog_info ("    include %s", buf);
@@ -796,7 +796,7 @@
 
   if (prefix_num == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("Quit to Advertise Intra-Prefix: no route to advertise");
       return 0;
     }
@@ -865,7 +865,7 @@
       return 0;
     }
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
     zlog_info ("Originate Intra-Area-Prefix-LSA for interface %s's prefix",
                oi->interface->name);
 
@@ -882,7 +882,7 @@
 
   if (oi->state != OSPF6_INTERFACE_DR)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("  Interface is not DR");
       if (old)
         ospf6_lsa_purge (old);
@@ -898,7 +898,7 @@
     }
   if (full_count == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("  Interface is stub");
       if (old)
         ospf6_lsa_purge (old);
@@ -915,7 +915,7 @@
       if (OSPF6_LSA_IS_MAXAGE (lsa))
         continue;
 
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("  include prefix from %s", lsa->name);
 
       if (lsa->header->adv_router != oi->area->ospf6->router_id)
@@ -923,7 +923,7 @@
           on = ospf6_neighbor_lookup (lsa->header->adv_router, oi);
           if (on == NULL || on->state != OSPF6_NEIGHBOR_FULL)
             {
-              if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+              if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
                 zlog_info ("    Neighbor not found or not Full, ignore");
               continue;
             }
@@ -962,7 +962,7 @@
           route->path.area_id = oi->area->area_id;
           route->path.type = OSPF6_PATH_TYPE_INTRA;
 
-          if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+          if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
             {
               prefix2str (&route->prefix, buf, sizeof (buf));
               zlog_info ("    include %s", buf);
@@ -971,7 +971,7 @@
           ospf6_route_add (route, route_advertise);
           prefix_num--;
         }
-      if (current != end && IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (current != end && IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("Trailing garbage in %s", lsa->name);
     }
 
@@ -995,7 +995,7 @@
 
   if (prefix_num == 0)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX))
         zlog_info ("Quit to Advertise Intra-Prefix: no route to advertise");
       return 0;
     }
@@ -1039,7 +1039,7 @@
   if (OSPF6_LSA_IS_MAXAGE (lsa))
     return;
 
-  if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+  if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
     zlog_info ("%s found", lsa->name);
 
   oa = OSPF6_AREA (lsa->lsdb->data);
@@ -1054,7 +1054,7 @@
                             intra_prefix_lsa->ref_id, &ls_prefix);
   else
     {
-      if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+      if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
         zlog_info ("Unknown reference LS-type: %#hx",
                    ntohs (intra_prefix_lsa->ref_type));
       return;
@@ -1063,7 +1063,7 @@
   ls_entry = ospf6_route_lookup (&ls_prefix, oa->spf_table);
   if (ls_entry == NULL)
     {
-      if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+      if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
         {
           ospf6_linkstate_prefix2str (&ls_prefix, buf, sizeof (buf));
           zlog_info ("LS entry does not exist: %s", buf);
@@ -1105,7 +1105,7 @@
            i < OSPF6_MULTI_PATH_LIMIT; i++)
         ospf6_nexthop_copy (&route->nexthop[i], &ls_entry->nexthop[i]);
 
-      if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+      if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
         {
           prefix2str (&route->prefix, buf, sizeof (buf));
           zlog_info ("  add %s", buf);
@@ -1115,7 +1115,7 @@
       prefix_num--;
     }
 
-  if (current != end && IS_OSPF6_DEBUG_ROUTE (INTRA))
+  if (current != end && IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
     zlog_info ("Trailing garbage ignored");
 }
 
@@ -1131,7 +1131,7 @@
   char *start, *current, *end;
   char buf[64];
 
-  if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+  if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
     zlog_info ("%s disappearing", lsa->name);
 
   oa = OSPF6_AREA (lsa->lsdb->data);
@@ -1176,7 +1176,7 @@
               route->path.origin.adv_router != lsa->header->adv_router)
             continue;
 
-          if (IS_OSPF6_DEBUG_ROUTE (INTRA))
+          if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
             {
               prefix2str (&route->prefix, buf, sizeof (buf));
               zlog_info ("remove %s", buf);
@@ -1185,7 +1185,7 @@
         }
     }
 
-  if (current != end && IS_OSPF6_DEBUG_ROUTE (INTRA))
+  if (current != end && IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
     zlog_info ("Trailing garbage ignored");
 }
 
@@ -1198,9 +1198,8 @@
   void (*hook_add) (struct ospf6_route *) = NULL;
   void (*hook_remove) (struct ospf6_route *) = NULL;
 
-  if (IS_OSPF6_DEBUG_ROUTE (INTRA))
-    zlog_info ("Intra-area routing table calculation for area %s",
-               oa->name);
+  if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
+    zlog_info ("Re-examin intra-routes for area %s", oa->name);
 
   hook_add = oa->route_table->hook_add;
   hook_remove = oa->route_table->hook_remove;
@@ -1241,9 +1240,8 @@
       route->flag = 0;
     }
 
-  if (IS_OSPF6_DEBUG_ROUTE (INTRA))
-    zlog_info ("Intra-area routing table calculation for area %s: Done",
-               oa->name);
+  if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
+    zlog_info ("Re-examin intra-routes for area %s: Done", oa->name);
 }
 
 void
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 6c8341f..6cc6f4d 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -24,6 +24,8 @@
 /* Include other stuffs */
 #include "log.h"
 #include "linklist.h"
+#include "vector.h"
+#include "vty.h"
 #include "command.h"
 #include "memory.h"
 #include "thread.h"
@@ -41,27 +43,85 @@
 #include "ospf6_flood.h"
 #include "ospf6d.h"
 
-unsigned char conf_debug_ospf6_lsa = 0;
+vector ospf6_lsa_handler_vector;
 
-struct ospf6_lsa_handler *ospf6_lsa_handler[OSPF6_LSTYPE_SIZE];
+int
+ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
+{
+  u_char *start, *end, *current;
+  char byte[4];
 
-char *ospf6_lstype_str[OSPF6_LSTYPE_SIZE] =
-  {"Unknown", "Router", "Network", "Inter-Prefix", "Inter-Router",
-   "AS-External", "Group-Membership", "Type-7", "Link", "Intra-Prefix"};
+  start = (char *) lsa->header + sizeof (struct ospf6_lsa_header);
+  end = (char *) lsa->header + ntohs (lsa->header->length);
+
+  vty_out (vty, "        Unknown contents:%s", VNL);
+  for (current = start; current < end; current ++)
+    {
+      if ((current - start) % 16 == 0)
+        vty_out (vty, "%s        ", VNL);
+      else if ((current - start) % 4 == 0)
+        vty_out (vty, " ");
+
+      snprintf (byte, sizeof (byte), "%02x", *current);
+      vty_out (vty, "%s", byte);
+    }
+
+  vty_out (vty, "%s%s", VNL, VNL);
+  return 0;
+}
+
+struct ospf6_lsa_handler unknown_handler =
+{
+  OSPF6_LSTYPE_UNKNOWN,
+  "Unknown",
+  ospf6_unknown_lsa_show,
+  OSPF6_LSA_DEBUG,
+};
+
+void
+ospf6_install_lsa_handler (struct ospf6_lsa_handler *handler)
+{
+  /* type in handler is host byte order */
+  int index = handler->type & OSPF6_LSTYPE_FCODE_MASK;
+  vector_set_index (ospf6_lsa_handler_vector, index, handler);
+}
+
+struct ospf6_lsa_handler *
+ospf6_get_lsa_handler (u_int16_t type)
+{
+  struct ospf6_lsa_handler *handler = NULL;
+  int index = ntohs (type) & OSPF6_LSTYPE_FCODE_MASK;
+
+  if (index >= vector_max (ospf6_lsa_handler_vector))
+    handler = &unknown_handler;
+  else
+    handler = vector_slot (ospf6_lsa_handler_vector, index);
+
+  return handler;
+}
 
 char *
 ospf6_lstype_name (u_int16_t type)
 {
   static char buf[8];
-  int index = OSPF6_LSTYPE_INDEX (type);
+  struct ospf6_lsa_handler *handler;
 
-  if (ospf6_lsa_handler[index])
-    return ospf6_lsa_handler[index]->name;
+  handler = ospf6_get_lsa_handler (type);
+  if (handler && handler != &unknown_handler)
+    return handler->name;
 
   snprintf (buf, sizeof (buf), "0x%04hx", ntohs (type));
   return buf;
 }
 
+u_char
+ospf6_lstype_debug (u_int16_t type)
+{
+  struct ospf6_lsa_handler *handler;
+  handler = ospf6_get_lsa_handler (type);
+  return handler->debug;
+}
+
 /* RFC2328: Section 13.2 */
 int
 ospf6_lsa_is_differ (struct ospf6_lsa *lsa1,
@@ -170,7 +230,7 @@
 ospf6_lsa_premature_aging (struct ospf6_lsa *lsa)
 {
   /* log */
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type))
     zlog_info ("LSA: Premature aging: %s", lsa->name);
 
   THREAD_OFF (lsa->expire);
@@ -241,7 +301,7 @@
   inet_ntop (AF_INET, &lsa->header->adv_router, adv_router,
              sizeof (adv_router));
   snprintf (buf, size, "[%s Id:%s Adv:%s]",
-            OSPF6_LSTYPE_NAME (lsa->header->type), id, adv_router);
+            ospf6_lstype_name (lsa->header->type), id, adv_router);
   return buf;
 }
 
@@ -253,7 +313,7 @@
   inet_ntop (AF_INET, &header->adv_router, adv_router,
              sizeof (adv_router));
   zlog_info ("    [%s Id:%s Adv:%s]",
-             OSPF6_LSTYPE_NAME (header->type), id, adv_router);
+             ospf6_lstype_name (header->type), id, adv_router);
   zlog_info ("    Age: %4hu SeqNum: %#08lx Cksum: %04hx Len: %d",
              ntohs (header->age), (u_long) ntohl (header->seqnum),
              ntohs (header->checksum), ntohs (header->length));
@@ -293,7 +353,7 @@
   timerstring (&res, duration, sizeof (duration));
 
   vty_out (vty, "%-12s %-15s %-15s %4hu %8lx %04hx %4hu %8s%s",
-           OSPF6_LSTYPE_NAME (lsa->header->type),
+           ospf6_lstype_name (lsa->header->type),
            id, adv_router, ospf6_lsa_age_current (lsa),
            (u_long) ntohl (lsa->header->seqnum),
            ntohs (lsa->header->checksum), ntohs (lsa->header->length),
@@ -340,7 +400,7 @@
 
   vty_out (vty, "%s", VNL);
   vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa),
-           OSPF6_LSTYPE_NAME (lsa->header->type), VNL);
+           ospf6_lstype_name (lsa->header->type), VNL);
   vty_out (vty, "Link State ID: %s%s", id, VNL);
   vty_out (vty, "Advertising Router: %s%s", adv_router, VNL);
   vty_out (vty, "LS Sequence Number: %#010lx%s",
@@ -358,7 +418,7 @@
 ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
 {
   char adv_router[64], id[64];
-  int index;
+  struct ospf6_lsa_handler *handler;
 
   assert (lsa && lsa->header);
 
@@ -367,7 +427,7 @@
              adv_router, sizeof (adv_router));
 
   vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa),
-           OSPF6_LSTYPE_NAME (lsa->header->type), VNL);
+           ospf6_lstype_name (lsa->header->type), VNL);
   vty_out (vty, "Link State ID: %s%s", id, VNL);
   vty_out (vty, "Advertising Router: %s%s", adv_router, VNL);
   vty_out (vty, "LS Sequence Number: %#010lx%s",
@@ -376,14 +436,10 @@
            ntohs (lsa->header->checksum),
            ntohs (lsa->header->length), VNL);
 
-  index = OSPF6_LSTYPE_INDEX (lsa->header->type);
-  if (ospf6_lsa_handler[index]->show)
-    (*ospf6_lsa_handler[index]->show) (vty, lsa);
-  else
-    {
-      ospf6_lsa_show_dump (vty, lsa);
-      vty_out (vty, "%sUnknown LSA type ...%s", VNL, VNL);
-    }
+  handler = ospf6_get_lsa_handler (lsa->header->type);
+  if (handler->show == NULL)
+    handler = &unknown_handler;
+  (*handler->show) (vty, lsa);
 
   vty_out (vty, "%s", VNL);
 }
@@ -420,10 +476,6 @@
   /* calculate birth of this lsa */
   ospf6_lsa_age_set (lsa);
 
-  if (IS_OSPF6_DEBUG_LSA (MEMORY))
-    zlog_info ("Create LSA Memory: %s (%p/%p)",
-               lsa->name, lsa, lsa->header);
-
   return lsa;
 }
 
@@ -455,10 +507,6 @@
   /* calculate birth of this lsa */
   ospf6_lsa_age_set (lsa);
 
-  if (IS_OSPF6_DEBUG_LSA (MEMORY))
-    zlog_info ("Create LSA (Header-only) Memory: %s (%p/%p)",
-               lsa->name, lsa, lsa->header);
-
   return lsa;
 }
 
@@ -471,11 +519,6 @@
   THREAD_OFF (lsa->expire);
   THREAD_OFF (lsa->refresh);
 
-  if (IS_OSPF6_DEBUG_LSA (MEMORY))
-    zlog_info ("Delete LSA %s Memory: %s (%p/%p)",
-               (CHECK_FLAG (lsa->flag, OSPF6_LSA_HEADERONLY) ?
-                "(Header-only) " : ""), lsa->name, lsa, lsa->header);
-
   /* do free */
   XFREE (MTYPE_OSPF6_LSA, lsa->header);
   XFREE (MTYPE_OSPF6_LSA, lsa);
@@ -486,9 +529,6 @@
 {
   struct ospf6_lsa *copy = NULL;
 
-  if (IS_OSPF6_DEBUG_LSA (MEMORY))
-    zlog_info ("Create LSA Copy from %s", lsa->name);
-
   ospf6_lsa_age_current (lsa);
   if (CHECK_FLAG (lsa->flag, OSPF6_LSA_HEADERONLY))
     copy = ospf6_lsa_create_headeronly (lsa->header);
@@ -542,7 +582,7 @@
 
   lsa->expire = (struct thread *) NULL;
 
-  if (IS_OSPF6_DEBUG_LSA (TIMER))
+  if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type))
     {
       zlog_info ("LSA Expire:");
       ospf6_lsa_header_print (lsa);
@@ -555,8 +595,6 @@
   ospf6_flood (NULL, lsa);
 
   /* reinstall lsa */
-  if (IS_OSPF6_DEBUG_LSA (DATABASE))
-    zlog_info ("Reinstall MaxAge %s", lsa->name);
   ospf6_install_lsa (lsa);
 
   /* schedule maxage remover */
@@ -582,7 +620,7 @@
                             old->header->adv_router, lsdb_self);
   if (self == NULL)
     {
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+      if (IS_OSPF6_DEBUG_LSA_TYPE (old->header->type))
         zlog_info ("Refresh: could not find self LSA, flush %s", old->name);
       ospf6_lsa_premature_aging (old);
       return 0;
@@ -603,7 +641,7 @@
   /* store it in the LSDB for self-originated LSAs */
   ospf6_lsdb_add (ospf6_lsa_copy (new), lsdb_self);
 
-  if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
+  if (IS_OSPF6_DEBUG_LSA_TYPE (new->header->type))
     {
       zlog_info ("LSA Refresh:");
       ospf6_lsa_header_print (new);
@@ -661,211 +699,299 @@
   return (lsa_header->checksum);
 }
 
-int
-ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
-{
-  u_char *start, *end, *current;
-  char byte[4];
-
-  start = (char *) lsa->header + sizeof (struct ospf6_lsa_header);
-  end = (char *) lsa->header + ntohs (lsa->header->length);
-
-  vty_out (vty, "        Unknown contents:%s", VNL);
-  for (current = start; current < end; current ++)
-    {
-      if ((current - start) % 16 == 0)
-        vty_out (vty, "%s        ", VNL);
-      else if ((current - start) % 4 == 0)
-        vty_out (vty, " ");
-
-      snprintf (byte, sizeof (byte), "%02x", *current);
-      vty_out (vty, "%s", byte);
-    }
-
-  vty_out (vty, "%s%s", VNL, VNL);
-  return 0;
-}
-
-void
-ospf6_install_lsa_handler (struct ospf6_lsa_handler *handler)
-{
-  /* might need to adjust dynamic array length ... */
-  int index = OSPF6_LSTYPE_INDEX (htons (handler->type));
-  ospf6_lsa_handler[index] = handler;
-}
-
-struct ospf6_lsa_handler unknown_handler =
-{
-  OSPF6_LSTYPE_UNKNOWN,
-  "Unknown",
-  ospf6_unknown_lsa_show
-};
-
 void
 ospf6_lsa_init ()
 {
-  memset (ospf6_lsa_handler, 0, sizeof (ospf6_lsa_handler));
+  ospf6_lsa_handler_vector = vector_init (0);
   ospf6_install_lsa_handler (&unknown_handler);
 }
 
 
-
-DEFUN (debug_ospf6_lsa_sendrecv,
-       debug_ospf6_lsa_sendrecv_cmd,
-       "debug ospf6 lsa (send|recv|originate|timer|database|memory|all)",
-       DEBUG_STR
-       OSPF6_STR
-       "Debug Link State Advertisements (LSAs)\n"
-       "Debug Sending LSAs\n"
-       "Debug Receiving LSAs\n"
-       "Debug Originating LSAs\n"
-       "Debug Timer Event of LSAs\n"
-       "Debug LSA Database\n"
-       "Debug Memory of LSAs\n"
-       "Debug LSAs all\n"
-      )
+char *
+ospf6_lsa_handler_name (struct ospf6_lsa_handler *h)
 {
-  unsigned char level = 0;
+  static char buf[64];
+  int i, size = strlen (h->name);
 
-  if (argc)
+  if (h->name == "Unknown" &&
+      h->type != OSPF6_LSTYPE_UNKNOWN)
     {
-      if (! strncmp (argv[0], "s", 1))
-        level = OSPF6_DEBUG_LSA_SEND;
-      else if (! strncmp (argv[0], "r", 1))
-        level = OSPF6_DEBUG_LSA_RECV;
-      else if (! strncmp (argv[0], "o", 1))
-        level = OSPF6_DEBUG_LSA_ORIGINATE;
-      else if (! strncmp (argv[0], "t", 1))
-        level = OSPF6_DEBUG_LSA_TIMER;
-      else if (! strncmp (argv[0], "d", 1))
-        level = OSPF6_DEBUG_LSA_DATABASE;
-      else if (! strncmp (argv[0], "m", 1))
-        level = OSPF6_DEBUG_LSA_MEMORY;
-      else if (! strncmp (argv[0], "a", 1))
-        {
-          level = OSPF6_DEBUG_LSA_SEND | OSPF6_DEBUG_LSA_RECV |
-                  OSPF6_DEBUG_LSA_ORIGINATE | OSPF6_DEBUG_LSA_TIMER |
-                  OSPF6_DEBUG_LSA_DATABASE | OSPF6_DEBUG_LSA_MEMORY;
-        }
-    }
-  else
-    {
-      level = OSPF6_DEBUG_LSA_SEND | OSPF6_DEBUG_LSA_RECV |
-              OSPF6_DEBUG_LSA_ORIGINATE | OSPF6_DEBUG_LSA_TIMER;
+      snprintf (buf, sizeof (buf), "%#04hx", h->type);
+      return buf;
     }
 
-  OSPF6_DEBUG_LSA_ON (level);
-  return CMD_SUCCESS;
-}
-
-ALIAS (debug_ospf6_lsa_sendrecv,
-       debug_ospf6_lsa_cmd,
-       "debug ospf6 lsa",
-       NO_STR
-       DEBUG_STR
-       OSPF6_STR
-       "Debug Link State Advertisements (LSAs)\n"
-      );
-
-DEFUN (no_debug_ospf6_lsa_sendrecv,
-       no_debug_ospf6_lsa_sendrecv_cmd,
-       "no debug ospf6 lsa (send|recv|originate|timer|database|memory|all)",
-       NO_STR
-       DEBUG_STR
-       OSPF6_STR
-       "Debug Link State Advertisements (LSAs)\n"
-       "Debug Sending LSAs\n"
-       "Debug Receiving LSAs\n"
-       "Debug Originating LSAs\n"
-       "Debug Timer Event of LSAs\n"
-       "Debug LSA Database\n"
-       "Debug Memory of LSAs\n"
-       "Debug LSAs all\n"
-      )
-{
-  unsigned char level = 0;
-
-  if (argc)
+  for (i = 0; i < MIN (size, sizeof (buf)); i++)
     {
-      if (! strncmp (argv[0], "s", 1))
-        level = OSPF6_DEBUG_LSA_SEND;
-      else if (! strncmp (argv[0], "r", 1))
-        level = OSPF6_DEBUG_LSA_RECV;
-      else if (! strncmp (argv[0], "o", 1))
-        level = OSPF6_DEBUG_LSA_ORIGINATE;
-      else if (! strncmp (argv[0], "t", 1))
-        level = OSPF6_DEBUG_LSA_TIMER;
-      else if (! strncmp (argv[0], "d", 1))
-        level = OSPF6_DEBUG_LSA_DATABASE;
-      else if (! strncmp (argv[0], "m", 1))
-        level = OSPF6_DEBUG_LSA_MEMORY;
-      else if (! strncmp (argv[0], "a", 1))
-        {
-          level = OSPF6_DEBUG_LSA_SEND | OSPF6_DEBUG_LSA_RECV |
-                  OSPF6_DEBUG_LSA_ORIGINATE | OSPF6_DEBUG_LSA_TIMER |
-                  OSPF6_DEBUG_LSA_DATABASE | OSPF6_DEBUG_LSA_MEMORY;
-        }
-    }
-  else
-    {
-      level = OSPF6_DEBUG_LSA_SEND | OSPF6_DEBUG_LSA_RECV |
-              OSPF6_DEBUG_LSA_ORIGINATE | OSPF6_DEBUG_LSA_TIMER;
-    }
-
-  OSPF6_DEBUG_LSA_OFF (level);
-  return CMD_SUCCESS;
-}
-
-ALIAS (no_debug_ospf6_lsa_sendrecv,
-       no_debug_ospf6_lsa_cmd,
-       "no debug ospf6 lsa",
-       NO_STR
-       DEBUG_STR
-       OSPF6_STR
-       "Debug Link State Advertisements (LSAs)\n"
-      );
-
-int
-config_write_ospf6_debug_lsa (struct vty *vty)
-{
-  if (conf_debug_ospf6_lsa == OSPF6_DEBUG_LSA_ALL)
-    vty_out (vty, "debug ospf6 lsa all%s", VNL);
-  else
-    {
-      if (conf_debug_ospf6_lsa == OSPF6_DEBUG_LSA_DEFAULT)
-        vty_out (vty, "debug ospf6 lsa%s", VNL);
+      if (! islower (h->name[i]))
+        buf[i] = tolower (h->name[i]);
       else
-        {
-          if (IS_OSPF6_DEBUG_LSA (SEND))
-            vty_out (vty, "debug ospf6 lsa send%s", VNL);
-          if (IS_OSPF6_DEBUG_LSA (RECV))
-            vty_out (vty, "debug ospf6 lsa recv%s", VNL);
-          if (IS_OSPF6_DEBUG_LSA (ORIGINATE))
-            vty_out (vty, "debug ospf6 lsa originate%s", VNL);
-          if (IS_OSPF6_DEBUG_LSA (TIMER))
-            vty_out (vty, "debug ospf6 lsa timer%s", VNL);
-        }
+        buf[i] = h->name[i];
+    }
+  buf[size] = '\0';
+  return buf;
+}
 
-      if (IS_OSPF6_DEBUG_LSA (DATABASE))
-        vty_out (vty, "debug ospf6 lsa database%s", VNL);
-      if (IS_OSPF6_DEBUG_LSA (MEMORY))
-        vty_out (vty, "debug ospf6 lsa memory%s", VNL);
+DEFUN (debug_ospf6_lsa_type,
+       debug_ospf6_lsa_hex_cmd,
+       "debug ospf6 lsa XXXX/0xXXXX",
+       DEBUG_STR
+       OSPF6_STR
+       "Debug Link State Advertisements (LSAs)\n"
+       "Specify LS type as Hexadecimal\n"
+      )
+{
+  int i;
+  struct ospf6_lsa_handler *handler = NULL;
+  unsigned long val;
+  char *endptr = NULL;
+  u_int16_t type = 0;
+
+  assert (argc);
+
+  if ((strlen (argv[0]) == 6 && ! strncmp (argv[0], "0x", 2)) ||
+      (strlen (argv[0]) == 4))
+    {
+      val = strtoul (argv[0], &endptr, 16);
+      if (*endptr == '\0')
+        type = val;
     }
 
-  return 0;
+  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+    {
+      handler = vector_slot (ospf6_lsa_handler_vector, i);
+      if (handler == NULL)
+        continue;
+      if (type && handler->type == type)
+        break;
+      if (! strcasecmp (argv[0], handler->name))
+        break;
+      handler = NULL;
+    }
+
+  if (type && handler == NULL)
+    {
+      handler = (struct ospf6_lsa_handler *)
+        malloc (sizeof (struct ospf6_lsa_handler));
+      memset (handler, 0, sizeof (struct ospf6_lsa_handler));
+      handler->type = type;
+      handler->name = "Unknown";
+      handler->show = ospf6_unknown_lsa_show;
+      vector_set_index (ospf6_lsa_handler_vector,
+                        handler->type & OSPF6_LSTYPE_FCODE_MASK, handler);
+    }
+
+  if (handler == NULL)
+    handler = &unknown_handler;
+
+  if (argc >= 2)
+    {
+      if (! strcmp (argv[1], "originate"))
+        SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
+      if (! strcmp (argv[1], "examin"))
+        SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
+      if (! strcmp (argv[1], "flooding"))
+        SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
+    }
+  else
+    SET_FLAG (handler->debug, OSPF6_LSA_DEBUG);
+
+  return CMD_SUCCESS;
 }
 
+DEFUN (no_debug_ospf6_lsa_type,
+       no_debug_ospf6_lsa_hex_cmd,
+       "no debug ospf6 lsa XXXX/0xXXXX",
+       NO_STR
+       DEBUG_STR
+       OSPF6_STR
+       "Debug Link State Advertisements (LSAs)\n"
+       "Specify LS type as Hexadecimal\n"
+      )
+{
+  int i;
+  struct ospf6_lsa_handler *handler = NULL;
+  unsigned long val;
+  char *endptr = NULL;
+  u_int16_t type = 0;
+
+  assert (argc);
+
+  if ((strlen (argv[0]) == 6 && ! strncmp (argv[0], "0x", 2)) ||
+      (strlen (argv[0]) == 4))
+    {
+      val = strtoul (argv[0], &endptr, 16);
+      if (*endptr == '\0')
+        type = val;
+    }
+
+  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+    {
+      handler = vector_slot (ospf6_lsa_handler_vector, i);
+      if (handler == NULL)
+        continue;
+      if (type && handler->type == type)
+        break;
+      if (! strcasecmp (argv[0], handler->name))
+        break;
+    }
+
+  if (handler == NULL)
+    return CMD_SUCCESS;
+
+  if (argc >= 2)
+    {
+      if (! strcmp (argv[1], "originate"))
+        UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
+      if (! strcmp (argv[1], "examin"))
+        UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
+      if (! strcmp (argv[1], "flooding"))
+        UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
+    }
+  else
+    UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG);
+
+  if (handler->debug == 0 &&
+      handler->name == "Unknown" && type != OSPF6_LSTYPE_UNKNOWN)
+    {
+      free (handler);
+      vector_slot (ospf6_lsa_handler_vector, i) = NULL;
+    }
+
+  return CMD_SUCCESS;
+}
+
+struct cmd_element debug_ospf6_lsa_type_cmd;
+struct cmd_element debug_ospf6_lsa_type_detail_cmd;
+struct cmd_element no_debug_ospf6_lsa_type_cmd;
+struct cmd_element no_debug_ospf6_lsa_type_detail_cmd;
+
 void
 install_element_ospf6_debug_lsa ()
 {
-  install_element (ENABLE_NODE, &debug_ospf6_lsa_cmd);
-  install_element (ENABLE_NODE, &debug_ospf6_lsa_sendrecv_cmd);
-  install_element (ENABLE_NODE, &no_debug_ospf6_lsa_cmd);
-  install_element (ENABLE_NODE, &no_debug_ospf6_lsa_sendrecv_cmd);
-  install_element (CONFIG_NODE, &debug_ospf6_lsa_cmd);
-  install_element (CONFIG_NODE, &debug_ospf6_lsa_sendrecv_cmd);
-  install_element (CONFIG_NODE, &no_debug_ospf6_lsa_cmd);
-  install_element (CONFIG_NODE, &no_debug_ospf6_lsa_sendrecv_cmd);
+  int i;
+  struct ospf6_lsa_handler *handler;
+#define STRSIZE  256
+#define DOCSIZE  1024
+  static char strbuf[STRSIZE];
+  static char docbuf[DOCSIZE];
+  static char detail_strbuf[STRSIZE];
+  static char detail_docbuf[DOCSIZE];
+  char *str, *no_str;
+  char *doc, *no_doc;
+
+  strbuf[0] = '\0';
+  no_str = &strbuf[strlen (strbuf)];
+  strncat (strbuf, "no ", STRSIZE - strlen (strbuf));
+  str = &strbuf[strlen (strbuf)];
+
+  strncat (strbuf, "debug ospf6 lsa (", STRSIZE - strlen (strbuf));
+  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+    {
+      handler = vector_slot (ospf6_lsa_handler_vector, i);
+      if (handler == NULL)
+        continue;
+      strncat (strbuf, ospf6_lsa_handler_name (handler),
+               STRSIZE - strlen (strbuf));
+      strncat (strbuf, "|", STRSIZE - strlen (strbuf));
+    }
+  strbuf[strlen (strbuf) - 1] = ')';
+  strbuf[strlen (strbuf)] = '\0';
+
+  docbuf[0] = '\0';
+  no_doc = &docbuf[strlen (docbuf)];
+  strncat (docbuf, NO_STR, DOCSIZE - strlen (docbuf));
+  doc = &docbuf[strlen (docbuf)];
+
+  strncat (docbuf, DEBUG_STR, DOCSIZE - strlen (docbuf));
+  strncat (docbuf, OSPF6_STR, DOCSIZE - strlen (docbuf));
+  strncat (docbuf, "Debug Link State Advertisements (LSAs)\n",
+           DOCSIZE - strlen (docbuf));
+
+  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+    {
+      handler = vector_slot (ospf6_lsa_handler_vector, i);
+      if (handler == NULL)
+        continue;
+      strncat (docbuf, "Debug ", DOCSIZE - strlen (docbuf));
+      strncat (docbuf, handler->name, DOCSIZE - strlen (docbuf));
+      strncat (docbuf, "-LSA\n", DOCSIZE - strlen (docbuf));
+    }
+  docbuf[strlen (docbuf)] = '\0';
+
+  debug_ospf6_lsa_type_cmd.string = str;
+  debug_ospf6_lsa_type_cmd.func = debug_ospf6_lsa_type;
+  debug_ospf6_lsa_type_cmd.doc = doc;
+
+  no_debug_ospf6_lsa_type_cmd.string = no_str;
+  no_debug_ospf6_lsa_type_cmd.func = no_debug_ospf6_lsa_type;
+  no_debug_ospf6_lsa_type_cmd.doc = no_doc;
+
+  strncpy (detail_strbuf, strbuf, STRSIZE);
+  strncat (detail_strbuf, " (originate|examin|flooding)",
+           STRSIZE - strlen (detail_strbuf));
+  detail_strbuf[strlen (detail_strbuf)] = '\0';
+  no_str = &detail_strbuf[0];
+  str = &detail_strbuf[strlen ("no ")];
+
+  strncpy (detail_docbuf, docbuf, DOCSIZE);
+  strncat (detail_docbuf, "Debug Originating LSA\n",
+           DOCSIZE - strlen (detail_docbuf));
+  strncat (detail_docbuf, "Debug Examining LSA\n",
+           DOCSIZE - strlen (detail_docbuf));
+  strncat (detail_docbuf, "Debug Flooding LSA\n",
+           DOCSIZE - strlen (detail_docbuf));
+  detail_docbuf[strlen (detail_docbuf)] = '\0';
+  no_doc = &detail_docbuf[0];
+  doc = &detail_docbuf[strlen (NO_STR)];
+
+  debug_ospf6_lsa_type_detail_cmd.string = str;
+  debug_ospf6_lsa_type_detail_cmd.func = debug_ospf6_lsa_type;
+  debug_ospf6_lsa_type_detail_cmd.doc = doc;
+
+  no_debug_ospf6_lsa_type_detail_cmd.string = no_str;
+  no_debug_ospf6_lsa_type_detail_cmd.func = no_debug_ospf6_lsa_type;
+  no_debug_ospf6_lsa_type_detail_cmd.doc = no_doc;
+
+  install_element (ENABLE_NODE, &debug_ospf6_lsa_hex_cmd);
+  install_element (ENABLE_NODE, &debug_ospf6_lsa_type_cmd);
+  install_element (ENABLE_NODE, &debug_ospf6_lsa_type_detail_cmd);
+  install_element (ENABLE_NODE, &no_debug_ospf6_lsa_hex_cmd);
+  install_element (ENABLE_NODE, &no_debug_ospf6_lsa_type_cmd);
+  install_element (ENABLE_NODE, &no_debug_ospf6_lsa_type_detail_cmd);
+  install_element (CONFIG_NODE, &debug_ospf6_lsa_hex_cmd);
+  install_element (CONFIG_NODE, &debug_ospf6_lsa_type_cmd);
+  install_element (CONFIG_NODE, &debug_ospf6_lsa_type_detail_cmd);
+  install_element (CONFIG_NODE, &no_debug_ospf6_lsa_hex_cmd);
+  install_element (CONFIG_NODE, &no_debug_ospf6_lsa_type_cmd);
+  install_element (CONFIG_NODE, &no_debug_ospf6_lsa_type_detail_cmd);
+}
+
+int
+config_write_ospf6_debug_lsa (struct vty *vty)
+{
+  int i;
+  struct ospf6_lsa_handler *handler;
+
+  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+    {
+      handler = vector_slot (ospf6_lsa_handler_vector, i);
+      if (handler == NULL)
+        continue;
+      if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG))
+        vty_out (vty, "debug ospf6 lsa %s%s",
+                 ospf6_lsa_handler_name (handler), VNL);
+      if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE))
+        vty_out (vty, "debug ospf6 lsa %s originate%s",
+                 ospf6_lsa_handler_name (handler), VNL);
+      if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN))
+        vty_out (vty, "debug ospf6 lsa %s examin%s",
+                 ospf6_lsa_handler_name (handler), VNL);
+      if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD))
+        vty_out (vty, "debug ospf6 lsa %s flooding%s",
+                 ospf6_lsa_handler_name (handler), VNL);
+    }
+
+  return 0;
 }
 
 
diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h
index be28449..0f81b6a 100644
--- a/ospf6d/ospf6_lsa.h
+++ b/ospf6d/ospf6_lsa.h
@@ -23,21 +23,28 @@
 #define OSPF6_LSA_H
 
 /* Debug option */
-extern unsigned char conf_debug_ospf6_lsa;
-#define OSPF6_DEBUG_LSA_SEND      0x01
-#define OSPF6_DEBUG_LSA_RECV      0x02
-#define OSPF6_DEBUG_LSA_ORIGINATE 0x04
-#define OSPF6_DEBUG_LSA_TIMER     0x08
-#define OSPF6_DEBUG_LSA_DATABASE  0x10
-#define OSPF6_DEBUG_LSA_MEMORY    0x80
-#define OSPF6_DEBUG_LSA_ALL       0x9f
-#define OSPF6_DEBUG_LSA_DEFAULT   0x0f
-#define OSPF6_DEBUG_LSA_ON(level) \
-  (conf_debug_ospf6_lsa |= (level))
-#define OSPF6_DEBUG_LSA_OFF(level) \
-  (conf_debug_ospf6_lsa &= ~(level))
-#define IS_OSPF6_DEBUG_LSA(e) \
-  (conf_debug_ospf6_lsa & OSPF6_DEBUG_LSA_ ## e)
+#define OSPF6_LSA_DEBUG           0x01
+#define OSPF6_LSA_DEBUG_ORIGINATE 0x02
+#define OSPF6_LSA_DEBUG_EXAMIN    0x04
+#define OSPF6_LSA_DEBUG_FLOOD     0x08
+
+#define IS_OSPF6_DEBUG_LSA(name)                        \
+  (ospf6_lstype_debug (htons (OSPF6_LSTYPE_ ## name)) & \
+   OSPF6_LSA_DEBUG)
+#define IS_OSPF6_DEBUG_ORIGINATE(name)                  \
+  (ospf6_lstype_debug (htons (OSPF6_LSTYPE_ ## name)) & \
+   OSPF6_LSA_DEBUG_ORIGINATE)
+#define IS_OSPF6_DEBUG_EXAMIN(name)                     \
+  (ospf6_lstype_debug (htons (OSPF6_LSTYPE_ ## name)) & \
+   OSPF6_LSA_DEBUG_EXAMIN)
+#define IS_OSPF6_DEBUG_LSA_TYPE(type) \
+  (ospf6_lstype_debug (type) & OSPF6_LSA_DEBUG)
+#define IS_OSPF6_DEBUG_ORIGINATE_TYPE(type) \
+  (ospf6_lstype_debug (type) & OSPF6_LSA_DEBUG_ORIGINATE)
+#define IS_OSPF6_DEBUG_EXAMIN_TYPE(type) \
+  (ospf6_lstype_debug (type) & OSPF6_LSA_DEBUG_EXAMIN)
+#define IS_OSPF6_DEBUG_FLOOD_TYPE(type) \
+  (ospf6_lstype_debug (type) & OSPF6_LSA_DEBUG_FLOOD)
 
 /* LSA definition */
 
@@ -135,65 +142,60 @@
 
 struct ospf6_lsa_handler
 {
-  u_int16_t type; /* network byte order */
+  u_int16_t type; /* host byte order */
   char *name;
   int (*show) (struct vty *, struct ospf6_lsa *);
+  u_char debug;
 };
 
-#define OSPF6_LSTYPE_INDEX(type) \
-  ((ntohs (type) & OSPF6_LSTYPE_FCODE_MASK) < OSPF6_LSTYPE_SIZE ? \
-   (ntohs (type) & OSPF6_LSTYPE_FCODE_MASK) : OSPF6_LSTYPE_UNKNOWN)
-#define OSPF6_LSTYPE_NAME(type) (ospf6_lstype_name (type))
-
 /* Macro for LSA Origination */
-/* void (CONTINUE_IF_...) (struct prefix *addr); */
-
-#define CONTINUE_IF_ADDRESS_LINKLOCAL(addr)\
+/* addr is (struct prefix *) */
+#define CONTINUE_IF_ADDRESS_LINKLOCAL(debug,addr)      \
   if (IN6_IS_ADDR_LINKLOCAL (&(addr)->u.prefix6))      \
     {                                                  \
       char buf[64];                                    \
       prefix2str (addr, buf, sizeof (buf));            \
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))              \
+      if (debug)                                       \
         zlog_info ("Filter out Linklocal: %s", buf);   \
       continue;                                        \
     }
 
-#define CONTINUE_IF_ADDRESS_UNSPECIFIED(addr)          \
+#define CONTINUE_IF_ADDRESS_UNSPECIFIED(debug,addr)    \
   if (IN6_IS_ADDR_UNSPECIFIED (&(addr)->u.prefix6))    \
     {                                                  \
       char buf[64];                                    \
       prefix2str (addr, buf, sizeof (buf));            \
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))              \
+      if (debug)                                       \
         zlog_info ("Filter out Unspecified: %s", buf); \
       continue;                                        \
     }
 
-#define CONTINUE_IF_ADDRESS_LOOPBACK(addr)             \
+#define CONTINUE_IF_ADDRESS_LOOPBACK(debug,addr)       \
   if (IN6_IS_ADDR_LOOPBACK (&(addr)->u.prefix6))       \
     {                                                  \
       char buf[64];                                    \
       prefix2str (addr, buf, sizeof (buf));            \
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))              \
+      if (debug)                                       \
         zlog_info ("Filter out Loopback: %s", buf);    \
       continue;                                        \
     }
 
-#define CONTINUE_IF_ADDRESS_V4COMPAT(addr)             \
+#define CONTINUE_IF_ADDRESS_V4COMPAT(debug,addr)       \
   if (IN6_IS_ADDR_V4COMPAT (&(addr)->u.prefix6))       \
     {                                                  \
       char buf[64];                                    \
       prefix2str (addr, buf, sizeof (buf));            \
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))              \
+      if (debug)                                       \
         zlog_info ("Filter out V4Compat: %s", buf);    \
       continue;                                        \
     }
 
-#define CONTINUE_IF_ADDRESS_V4MAPPED(addr)             \
+#define CONTINUE_IF_ADDRESS_V4MAPPED(debug,addr)       \
   if (IN6_IS_ADDR_V4MAPPED (&(addr)->u.prefix6))       \
     {                                                  \
       char buf[64];                                    \
       prefix2str (addr, buf, sizeof (buf));            \
-      if (IS_OSPF6_DEBUG_LSA (ORIGINATE))              \
+      if (debug)                                       \
         zlog_info ("Filter out V4Mapped: %s", buf);    \
       continue;                                        \
     }
@@ -201,6 +203,7 @@
 
 /* Function Prototypes */
 char *ospf6_lstype_name (u_int16_t type);
+u_char ospf6_lstype_debug (u_int16_t type);
 int ospf6_lsa_is_differ (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2);
 int ospf6_lsa_is_changed (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2);
 u_int16_t ospf6_lsa_age_current (struct ospf6_lsa *);
@@ -234,6 +237,7 @@
 
 void ospf6_install_lsa_handler (struct ospf6_lsa_handler *handler);
 void ospf6_lsa_init ();
+void ospf6_lsa_cmd_init ();
 
 int config_write_ospf6_debug_lsa (struct vty *vty);
 void install_element_ospf6_debug_lsa ();
diff --git a/ospf6d/ospf6_lsdb.h b/ospf6d/ospf6_lsdb.h
index a10f001..d32f78d 100644
--- a/ospf6d/ospf6_lsdb.h
+++ b/ospf6d/ospf6_lsdb.h
@@ -41,10 +41,10 @@
       {                                                                  \
         if (! OSPF6_LSA_IS_MAXAGE (lsa))                                 \
           continue;                                                      \
-        if (lsa->retrans_count != 0)                                         \
+        if (lsa->retrans_count != 0)                                     \
           continue;                                                      \
-        if (IS_OSPF6_DEBUG_LSA (TIMER))                                  \
-          zlog_info (" remove maxage %s", lsa->name);                    \
+        if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type))                 \
+          zlog_info ("Remove MaxAge %s", lsa->name);                     \
         ospf6_lsdb_remove (lsa, lsdb);                                   \
       }                                                                  \
   } while (0)
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 276c847..ae699b9 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -147,7 +147,7 @@
       inet_ntop (AF_INET, &e->adv_router, adv_router, sizeof (adv_router));
       inet_ntop (AF_INET, &e->id, id, sizeof (id));
       zlog_info ("    [%s Id:%s Adv:%s]",
-                 OSPF6_LSTYPE_NAME (e->type), id, adv_router);
+                 ospf6_lstype_name (e->type), id, adv_router);
     }
 
   if (p != OSPF6_MESSAGE_END (oh))
@@ -937,7 +937,7 @@
               inet_ntop (AF_INET, &e->adv_router, adv_router,
                      sizeof (adv_router));
               zlog_info ("Can't find requested [%s Id:%s Adv:%s]",
-                         OSPF6_LSTYPE_NAME (e->type), id, adv_router);
+                         ospf6_lstype_name (e->type), id, adv_router);
             }
           thread_add_event (master, bad_lsreq, on, 0);
           return;
@@ -1752,9 +1752,6 @@
   if (oi->lsupdate_list->count == 0)
     return 0;
 
-  if (IS_OSPF6_DEBUG_LSA (SEND))
-    zlog_info ("LSA Send to %s", oi->interface->name);
-
   memset (sendbuf, 0, iobuflen);
   oh = (struct ospf6_header *) sendbuf;
   lsupdate = (struct ospf6_lsupdate *)((caddr_t) oh +
@@ -1773,9 +1770,6 @@
           break;
         }
 
-      if (IS_OSPF6_DEBUG_LSA (SEND))
-        ospf6_lsa_header_print (lsa);
-
       ospf6_lsa_age_update_to_send (lsa, oi->transdelay);
       memcpy (p, lsa->header, OSPF6_LSA_SIZE (lsa->header));
       p += OSPF6_LSA_SIZE (lsa->header);
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index e7818ab..402ca62 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -294,10 +294,6 @@
   for (lsa = ospf6_lsdb_head (on->ospf6_if->lsdb); lsa;
        lsa = ospf6_lsdb_next (lsa))
     {
-      if (IS_OSPF6_DEBUG_LSA (DATABASE))
-        zlog_info ("Add copy of %s to %s of %s", lsa->name,
-                   (OSPF6_LSA_IS_MAXAGE (lsa) ? "retrans_list" :
-                    "summary_list"), on->name);
       if (OSPF6_LSA_IS_MAXAGE (lsa))
         {
           ospf6_increment_retrans_count (lsa);
@@ -311,10 +307,6 @@
   for (lsa = ospf6_lsdb_head (on->ospf6_if->area->lsdb); lsa;
        lsa = ospf6_lsdb_next (lsa))
     {
-      if (IS_OSPF6_DEBUG_LSA (DATABASE))
-        zlog_info ("Add copy of %s to %s of %s", lsa->name,
-                   (OSPF6_LSA_IS_MAXAGE (lsa) ? "retrans_list" :
-                    "summary_list"), on->name);
       if (OSPF6_LSA_IS_MAXAGE (lsa))
         {
           ospf6_increment_retrans_count (lsa);
@@ -328,10 +320,6 @@
   for (lsa = ospf6_lsdb_head (on->ospf6_if->area->ospf6->lsdb); lsa;
        lsa = ospf6_lsdb_next (lsa))
     {
-      if (IS_OSPF6_DEBUG_LSA (DATABASE))
-        zlog_info ("Add copy of %s to %s of %s", lsa->name,
-                   (OSPF6_LSA_IS_MAXAGE (lsa) ? "retrans_list" :
-                    "summary_list"), on->name);
       if (OSPF6_LSA_IS_MAXAGE (lsa))
         {
           ospf6_increment_retrans_count (lsa);
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index dae9222..3ca21a3 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -720,7 +720,7 @@
   inet_ntop (AF_INET, &route->path.origin.adv_router, adv_router,
              sizeof (adv_router));
   vty_out (vty, "LS Origin: %s Id: %s Adv: %s%s",
-           OSPF6_LSTYPE_NAME (route->path.origin.type),
+           ospf6_lstype_name (route->path.origin.type),
            id, adv_router, VNL);
 
   /* Options */
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 63bc10a..6d4237a 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -160,7 +160,7 @@
         zlog_info ("  Link to: %s", lsa->name);
       else
         zlog_info ("  Link to: [%s Id:%s Adv:%s] No LSA",
-                   OSPF6_LSTYPE_NAME (type), ibuf, abuf);
+                   ospf6_lstype_name (type), ibuf, abuf);
     }
 
   return lsa;
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 23ad09f..5ab208b 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -61,8 +61,6 @@
         break;
 
       default:
-        if (IS_OSPF6_DEBUG_LSA (RECV))
-          zlog_info ("Unknown LSA in AS-scoped lsdb");
         break;
     }
 }
@@ -77,8 +75,6 @@
         break;
 
       default:
-        if (IS_OSPF6_DEBUG_LSA (RECV))
-          zlog_info ("Unknown LSA in AS-scoped lsdb");
         break;
     }
 }
@@ -216,8 +212,6 @@
   listnode i, j, k;
 
   o->maxage_remover = (struct thread *) NULL;
-  if (IS_OSPF6_DEBUG_LSA (TIMER))
-    zlog_info ("Maxage Remover");
 
   for (i = listhead (o->area_list); i; nextnode (i))
     {
@@ -232,9 +226,6 @@
                   on->state != OSPF6_NEIGHBOR_LOADING)
                 continue;
 
-              if (IS_OSPF6_DEBUG_LSA (TIMER))
-                zlog_info ("Maxage Remover End: %s exchange or loading",
-                           on->name);
               return 0;
             }
         }
@@ -252,9 +243,6 @@
     }
   OSPF6_LSDB_MAXAGE_REMOVER (o->lsdb);
 
-  if (IS_OSPF6_DEBUG_LSA (TIMER))
-    zlog_info ("Maxage Remover End");
-
   return 0;
 }
 
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index a67600a..b954172 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -41,6 +41,7 @@
 #include "ospf6_intra.h"
 #include "ospf6_asbr.h"
 #include "ospf6_abr.h"
+#include "ospf6_flood.h"
 #include "ospf6d.h"
 
 char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
@@ -111,6 +112,7 @@
   config_write_ospf6_debug_route (vty);
   config_write_ospf6_debug_asbr (vty);
   config_write_ospf6_debug_abr (vty);
+  config_write_ospf6_debug_flood (vty);
   vty_out (vty, "!%s", VNL);
   return 0;
 }
@@ -1717,6 +1719,18 @@
 void
 ospf6_init ()
 {
+  ospf6_top_init ();
+  ospf6_area_init ();
+  ospf6_interface_init ();
+  ospf6_neighbor_init ();
+  ospf6_zebra_init ();
+
+  ospf6_lsa_init ();
+  ospf6_spf_init ();
+  ospf6_intra_init ();
+  ospf6_asbr_init ();
+  ospf6_abr_init ();
+
   install_node (&debug_node, config_write_ospf6_debug);
 
   install_element_ospf6_debug_message ();
@@ -1728,6 +1742,7 @@
   install_element_ospf6_debug_route ();
   install_element_ospf6_debug_asbr ();
   install_element_ospf6_debug_abr ();
+  install_element_ospf6_debug_flood ();
 
   install_element (VIEW_NODE, &show_version_ospf6_cmd);
   install_element (ENABLE_NODE, &show_version_ospf6_cmd);
@@ -1818,18 +1833,6 @@
   INSTALL (ENABLE, database_type_id_self_originated_cmd);
   INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
 
-  ospf6_top_init ();
-  ospf6_area_init ();
-  ospf6_interface_init ();
-  ospf6_neighbor_init ();
-  ospf6_zebra_init ();
-
-  ospf6_lsa_init ();
-  ospf6_spf_init ();
-  ospf6_intra_init ();
-  ospf6_asbr_init ();
-  ospf6_abr_init ();
-
   /* Make ospf protocol socket. */
   ospf6_serv_sock ();
   thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h
index b08d07c..3df9ea6 100644
--- a/ospf6d/ospf6d.h
+++ b/ospf6d/ospf6d.h
@@ -22,7 +22,7 @@
 #ifndef OSPF6D_H
 #define OSPF6D_H
 
-#define OSPF6_DAEMON_VERSION    "0.9.7k"
+#define OSPF6_DAEMON_VERSION    "0.9.7l"
 
 /* global variables */
 extern int errno;
