[quagga-dev 10322] [PATCH] ospfv3-code-refactor.patch.

Dinesh Dutt ddutt at cumulusnetworks.com
Wed Mar 6 08:35:13 GMT 2013


Rearranging common defs and structures for use betweeen OSPFv2 and OSPFv3.

Created a new file called libospf.h under lib directory to hold defines that are
common between OSPFv2 and OSPFv3 code bases. Also removed all timer related routines
which were duplicated between thread.c, ospf_lsa.c and in ospfv3 code. Now, all
refer to the common code in thread.c. Name changes implied some updates to code as
well.
---
 lib/Makefile.am          |    2 +
 lib/libospf.h            |   82 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/thread.c             |   46 ++++++++++++++++++++++++--
 lib/thread.h             |    9 +++++
 ospf6d/ospf6_abr.c       |    6 ++-
 ospf6d/ospf6_area.c      |    1 +
 ospf6d/ospf6_area.h      |    2 -
 ospf6d/ospf6_asbr.c      |    4 +-
 ospf6d/ospf6_flood.c     |   10 +++---
 ospf6d/ospf6_interface.c |   10 +++---
 ospf6d/ospf6_intra.c     |    4 +-
 ospf6d/ospf6_lsa.c       |   34 ++++++++++---------
 ospf6d/ospf6_lsa.h       |    2 +
 ospf6d/ospf6_lsdb.c      |    2 +
 ospf6d/ospf6_message.c   |    2 +
 ospf6d/ospf6_neighbor.c  |   14 ++++----
 ospf6d/ospf6_network.c   |    1 +
 ospf6d/ospf6_proto.h     |   21 ------------
 ospf6d/ospf6_route.c     |    6 ++-
 ospf6d/ospf6_spf.c       |    2 +
 ospf6d/ospf6_top.c       |    2 +
 ospf6d/ospf6d.h          |   15 ++------
 ospfd/ospf_dump.c        |    2 +
 ospfd/ospf_flood.c       |    2 +
 ospfd/ospf_lsa.c         |   81 ++-------------------------------------------
 ospfd/ospf_packet.c      |    8 ++--
 ospfd/ospf_spf.c         |    2 +
 ospfd/ospf_vty.c         |    6 ++-
 ospfd/ospfd.h            |   53 +-----------------------------
 29 files changed, 203 insertions(+), 228 deletions(-)
 create mode 100644 lib/libospf.h

diff --git a/lib/Makefile.am b/lib/Makefile.am
index d7c31ed..904bcd9 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -27,7 +27,7 @@ pkginclude_HEADERS = \
 	str.h stream.h table.h thread.h vector.h version.h vty.h zebra.h \
 	plist.h zclient.h sockopt.h smux.h md5.h if_rmap.h keychain.h \
 	privs.h sigevent.h pqueue.h jhash.h zassert.h memtypes.h \
-	workqueue.h route_types.h
+	workqueue.h route_types.h libospf.h
 
 EXTRA_DIST = \
 	regex.c regex-gnu.h \
diff --git a/lib/libospf.h b/lib/libospf.h
new file mode 100644
index 0000000..2282c07
--- /dev/null
+++ b/lib/libospf.h
@@ -0,0 +1,82 @@
+/*
+ * Defines and structures common to OSPFv2 and OSPFv3
+ * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _LIBOSPFD_H
+#define _LIBOSPFD_H
+
+/* IP precedence. */
+#ifndef IPTOS_PREC_INTERNETCONTROL
+#define IPTOS_PREC_INTERNETCONTROL	0xC0
+#endif /* IPTOS_PREC_INTERNETCONTROL */
+
+/* Default protocol, port number. */
+#ifndef IPPROTO_OSPFIGP
+#define IPPROTO_OSPFIGP         89
+#endif /* IPPROTO_OSPFIGP */
+
+/* Architectual Constants */
+#ifdef DEBUG
+#define OSPF_LS_REFRESH_TIME                    60
+#else
+#define OSPF_LS_REFRESH_TIME                  1800
+#endif
+#define OSPF_MIN_LS_INTERVAL                     5
+#define OSPF_MIN_LS_ARRIVAL                      1
+#define OSPF_LSA_INITIAL_AGE                     0	/* useful for debug */
+#define OSPF_LSA_MAXAGE                       3600
+#define OSPF_CHECK_AGE                         300
+#define OSPF_LSA_MAXAGE_DIFF                   900
+#define OSPF_LS_INFINITY                  0xffffff
+#define OSPF_DEFAULT_DESTINATION        0x00000000      /* 0.0.0.0 */
+#define OSPF_INITIAL_SEQUENCE_NUMBER    0x80000001
+#define OSPF_MAX_SEQUENCE_NUMBER        0x7fffffff
+
+/* OSPF interface default values. */
+#define OSPF_OUTPUT_COST_DEFAULT           10
+#define OSPF_OUTPUT_COST_INFINITE	   UINT16_MAX
+#define OSPF_ROUTER_DEAD_INTERVAL_DEFAULT  40
+#define OSPF_ROUTER_DEAD_INTERVAL_MINIMAL   1
+#define OSPF_HELLO_INTERVAL_DEFAULT        10
+#define OSPF_ROUTER_PRIORITY_DEFAULT        1
+#define OSPF_RETRANSMIT_INTERVAL_DEFAULT    5
+#define OSPF_TRANSMIT_DELAY_DEFAULT         1
+#define OSPF_DEFAULT_BANDWIDTH		 10000	/* Kbps */
+
+#define OSPF_DEFAULT_REF_BANDWIDTH	100000  /* Kbps */
+
+#define OSPF_POLL_INTERVAL_DEFAULT         60
+#define OSPF_NEIGHBOR_PRIORITY_DEFAULT      0
+
+#define OSPF_MTU_IGNORE_DEFAULT             0
+#define OSPF_FAST_HELLO_DEFAULT             0
+
+#define OSPF_AREA_BACKBONE              0x00000000      /* 0.0.0.0 */
+
+/* SPF Throttling timer values. */
+#define OSPF_SPF_DELAY_DEFAULT              200
+#define OSPF_SPF_HOLDTIME_DEFAULT           1000
+#define OSPF_SPF_MAX_HOLDTIME_DEFAULT	    10000
+
+#define OSPF_LSA_MAXAGE_CHECK_INTERVAL		30
+#define OSFP_LSA_MAXAGE_REMOVE_DELAY_DEFAULT	60
+
+#endif /* _LIBOSPFD_H */
diff --git a/lib/thread.c b/lib/thread.c
index 16c92c2..0126015 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -61,7 +61,7 @@ static struct hash *cpu_record = NULL;
 
 /* Adjust so that tv_usec is in the range [0,TIMER_SECOND_MICRO).
    And change negative values to 0. */
-static struct timeval
+struct timeval
 timeval_adjust (struct timeval a)
 {
   while (a.tv_usec >= TIMER_SECOND_MICRO)
@@ -83,7 +83,18 @@ timeval_adjust (struct timeval a)
   return a;
 }
 
-static struct timeval
+struct timeval
+timeval_add (struct timeval a, struct timeval b)
+{
+  struct timeval ret;
+
+  ret.tv_sec = a.tv_sec + b.tv_sec;
+  ret.tv_usec = a.tv_usec + b.tv_usec;
+
+  return timeval_adjust (ret);
+}
+
+struct timeval
 timeval_subtract (struct timeval a, struct timeval b)
 {
   struct timeval ret;
@@ -94,19 +105,46 @@ timeval_subtract (struct timeval a, struct timeval b)
   return timeval_adjust (ret);
 }
 
-static long
+long
 timeval_cmp (struct timeval a, struct timeval b)
 {
   return (a.tv_sec == b.tv_sec
 	  ? a.tv_usec - b.tv_usec : a.tv_sec - b.tv_sec);
 }
 
-static unsigned long
+unsigned long
 timeval_elapsed (struct timeval a, struct timeval b)
 {
   return (((a.tv_sec - b.tv_sec) * TIMER_SECOND_MICRO)
 	  + (a.tv_usec - b.tv_usec));
 }
+
+int
+timeval_ceil (struct timeval a)
+{
+  a = timeval_adjust (a);
+
+  return (a.tv_usec ? a.tv_sec + 1 : a.tv_sec);
+}
+
+int
+timeval_floor (struct timeval a)
+{
+  a = timeval_adjust (a);
+
+  return a.tv_sec;
+}
+
+struct timeval
+int2tv (int a)
+{
+  struct timeval ret;
+
+  ret.tv_sec = a;
+  ret.tv_usec = 0;
+
+  return ret;
+}
 
 #if !defined(HAVE_CLOCK_MONOTONIC) && !defined(__APPLE__)
 static void
diff --git a/lib/thread.h b/lib/thread.h
index 67902cf..16979c2 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -222,6 +222,15 @@ extern time_t quagga_time (time_t *);
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
 					  unsigned long *cpu_time_elapsed);
 
+/* timeval operations */
+extern struct timeval timeval_adjust (struct timeval a);
+extern struct timeval timeval_add (struct timeval a, struct timeval b);
+extern struct timeval timeval_subtract (struct timeval a, struct timeval b);
+extern long timeval_cmp (struct timeval a, struct timeval b);
+extern int timeval_ceil (struct timeval a);
+extern int timeval_floor (struct timeval a);
+extern struct timeval int2tv (int a);
+
 /* Global variable containing a recent result from gettimeofday.  This can
    be used instead of calling gettimeofday if a recent value is sufficient.
    This is guaranteed to be refreshed before a thread is called. */
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index c3a63fe..3277e7d 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -253,7 +253,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
     }
 
   /* do not generate if the route cost is greater or equal to LSInfinity */
-  if (route->path.cost >= LS_INFINITY)
+  if (route->path.cost >= OSPF_LS_INFINITY)
     {
       if (is_debug)
         zlog_debug ("The cost exceeds LSInfinity, withdraw");
@@ -296,7 +296,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
       /* ranges are ignored when originate backbone routes to transit area.
          Otherwise, if ranges are configured, the route is suppressed. */
       if (range && ! CHECK_FLAG (range->flag, OSPF6_ROUTE_REMOVE) &&
-          (route->path.area_id != BACKBONE_AREA_ID ||
+          (route->path.area_id != OSPF_AREA_BACKBONE ||
            ! IS_AREA_TRANSIT (area)))
         {
           if (is_debug)
@@ -604,7 +604,7 @@ ospf6_abr_examin_summary (struct ospf6_lsa *lsa, struct ospf6_area *oa)
     }
 
   /* (1) if cost == LSInfinity or if the LSA is MaxAge */
-  if (cost == LS_INFINITY)
+  if (cost == OSPF_LS_INFINITY)
     {
       if (is_debug)
         zlog_debug ("cost is LS_INFINITY, ignore");
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 9934e6b..2d20e62 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -401,6 +401,7 @@ DEFUN (no_area_range,
     }
 
   ospf6_route_remove (range, oa->range_table);
+
   return CMD_SUCCESS;
 }
 
diff --git a/ospf6d/ospf6_area.h b/ospf6d/ospf6_area.h
index e8a4fbd..655967a 100644
--- a/ospf6d/ospf6_area.h
+++ b/ospf6d/ospf6_area.h
@@ -105,8 +105,6 @@ struct ospf6_area
 #define OSPF6_AREA_TRANSIT    0x04 /* TransitCapability */
 #define OSPF6_AREA_STUB       0x08
 
-#define BACKBONE_AREA_ID (htonl (0))
-#define IS_AREA_BACKBONE(oa) ((oa)->area_id == BACKBONE_AREA_ID)
 #define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE))
 #define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE))
 #define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT))
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index ae0a286..1a0634e 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -174,7 +174,7 @@ ospf6_asbr_lsa_add (struct ospf6_lsa *lsa)
       return;
     }
 
-  if (OSPF6_ASBR_METRIC (external) == LS_INFINITY)
+  if (OSPF6_ASBR_METRIC (external) == OSPF_LS_INFINITY)
     {
       if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL))
         zlog_debug ("Ignore LSA with LSInfinity Metric");
@@ -890,7 +890,7 @@ ospf6_routemap_rule_set_metric_compile (const char *arg)
   u_int32_t metric;
   char *endp;
   metric = strtoul (arg, &endp, 0);
-  if (metric > LS_INFINITY || *endp != '\0')
+  if (metric > OSPF_LS_INFINITY || *endp != '\0')
     return NULL;
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index b815972..e9e9cd7 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -113,7 +113,7 @@ ospf6_lsa_originate (struct ospf6_lsa *lsa)
   ospf6_lsdb_add (ospf6_lsa_copy (lsa), lsdb_self);
 
   lsa->refresh = thread_add_timer (master, ospf6_lsa_refresh, lsa,
-                                   LS_REFRESH_TIME);
+                                   OSPF_LS_REFRESH_TIME);
 
   if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type) ||
       IS_OSPF6_DEBUG_ORIGINATE_TYPE (lsa->header->type))
@@ -228,7 +228,7 @@ ospf6_install_lsa (struct ospf6_lsa *lsa)
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   if (! OSPF6_LSA_IS_MAXAGE (lsa))
     lsa->expire = thread_add_timer (master, ospf6_lsa_expire, lsa,
-                                    MAXAGE + lsa->birth.tv_sec - now.tv_sec);
+                                    OSPF_LSA_MAXAGE + lsa->birth.tv_sec - now.tv_sec);
   else
     lsa->expire = NULL;
 
@@ -836,8 +836,8 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
         {
           struct timeval now, res;
           quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-          timersub (&now, &old->installed, &res);
-          if (res.tv_sec < MIN_LS_ARRIVAL)
+          res = timeval_subtract (now, old->installed);
+          if (res.tv_sec < OSPF_MIN_LS_ARRIVAL)
             {
               if (is_debug)
                 zlog_debug ("LSA can't be updated within MinLSArrival, discard");
@@ -944,7 +944,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
       /* If database copy is in 'Seqnumber Wrapping',
          simply discard the received LSA */
       if (OSPF6_LSA_IS_MAXAGE (old) &&
-          old->header->seqnum == htonl (MAX_SEQUENCE_NUMBER))
+          old->header->seqnum == htonl (OSPF_MAX_SEQUENCE_NUMBER))
         {
           if (is_debug)
             {
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 40cda24..c1dd97f 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -112,9 +112,9 @@ ospf6_interface_create (struct interface *ifp)
   oi->transdelay = OSPF6_INTERFACE_TRANSDELAY;
   oi->priority = OSPF6_INTERFACE_PRIORITY;
 
-  oi->hello_interval = OSPF6_INTERFACE_HELLO_INTERVAL;
-  oi->dead_interval = OSPF6_INTERFACE_DEAD_INTERVAL;
-  oi->rxmt_interval = OSPF6_INTERFACE_RXMT_INTERVAL;
+  oi->hello_interval = OSPF_HELLO_INTERVAL_DEFAULT;
+  oi->dead_interval = OSPF_ROUTER_DEAD_INTERVAL_DEFAULT;
+  oi->rxmt_interval = OSPF_RETRANSMIT_INTERVAL_DEFAULT;
   oi->cost = OSPF6_INTERFACE_COST;
   oi->state = OSPF6_INTERFACE_DOWN;
   oi->flag = 0;
@@ -827,7 +827,7 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
 
   timerclear (&res);
   if (oi->thread_send_lsupdate)
-    timersub (&oi->thread_send_lsupdate->u.sands, &now, &res);
+    res = timeval_subtract (oi->thread_send_lsupdate->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
            oi->lsupdate_list->count, duration,
@@ -839,7 +839,7 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
 
   timerclear (&res);
   if (oi->thread_send_lsack)
-    timersub (&oi->thread_send_lsack->u.sands, &now, &res);
+    res = timeval_subtract (oi->thread_send_lsack->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for LSAck in Time %s [thread %s]%s",
            oi->lsack_list->count, duration,
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 9bc603b..9444be4 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -1259,11 +1259,11 @@ ospf6_brouter_debug_print (struct ospf6_route *brouter)
                               sizeof (destination));
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &brouter->installed, &res);
+  res = timeval_subtract (now, brouter->installed);
   timerstring (&res, installed, sizeof (installed));
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &brouter->changed, &res);
+  res = timeval_subtract (now, brouter->changed);
   timerstring (&res, changed, sizeof (changed));
 
   inet_ntop (AF_INET, &brouter->path.origin.id, id, sizeof (id));
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index ff061df..b52d91d 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -139,11 +139,11 @@ ospf6_lsa_is_differ (struct ospf6_lsa *lsa1,
 
   ospf6_lsa_age_current (lsa1);
   ospf6_lsa_age_current (lsa2);
-  if (ntohs (lsa1->header->age) == MAXAGE &&
-      ntohs (lsa2->header->age) != MAXAGE)
+  if (ntohs (lsa1->header->age) == OSPF_LSA_MAXAGE &&
+      ntohs (lsa2->header->age) != OSPF_LSA_MAXAGE)
     return 1;
-  if (ntohs (lsa1->header->age) != MAXAGE &&
-      ntohs (lsa2->header->age) == MAXAGE)
+  if (ntohs (lsa1->header->age) != OSPF_LSA_MAXAGE &&
+      ntohs (lsa2->header->age) == OSPF_LSA_MAXAGE)
     return 1;
 
   /* compare body */
@@ -218,19 +218,19 @@ ospf6_lsa_age_current (struct ospf6_lsa *lsa)
     zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s",
                safe_strerror (errno));
 
-  if (ntohs (lsa->header->age) >= MAXAGE)
+  if (ntohs (lsa->header->age) >= OSPF_LSA_MAXAGE)
     {
       /* ospf6_lsa_premature_aging () sets age to MAXAGE; when using
          relative time, we cannot compare against lsa birth time, so
          we catch this special case here. */
-      lsa->header->age = htons (MAXAGE);
-      return MAXAGE;
+      lsa->header->age = htons (OSPF_LSA_MAXAGE);
+      return OSPF_LSA_MAXAGE;
     }
   /* calculate age */
   ulage = now.tv_sec - lsa->birth.tv_sec;
 
   /* if over MAXAGE, set to it */
-  age = (ulage > MAXAGE ? MAXAGE : ulage);
+  age = (ulage > OSPF_LSA_MAXAGE ? OSPF_LSA_MAXAGE : ulage);
 
   lsa->header->age = htons (age);
   return age;
@@ -243,8 +243,8 @@ ospf6_lsa_age_update_to_send (struct ospf6_lsa *lsa, u_int32_t transdelay)
   unsigned short age;
 
   age = ospf6_lsa_age_current (lsa) + transdelay;
-  if (age > MAXAGE)
-    age = MAXAGE;
+  if (age > OSPF_LSA_MAXAGE)
+    age = OSPF_LSA_MAXAGE;
   lsa->header->age = htons (age);
 }
 
@@ -258,7 +258,7 @@ ospf6_lsa_premature_aging (struct ospf6_lsa *lsa)
   THREAD_OFF (lsa->expire);
   THREAD_OFF (lsa->refresh);
 
-  lsa->header->age = htons (MAXAGE);
+  lsa->header->age = htons (OSPF_LSA_MAXAGE);
   thread_execute (master, ospf6_lsa_expire, lsa, 0);
 }
 
@@ -297,15 +297,15 @@ ospf6_lsa_compare (struct ospf6_lsa *a, struct ospf6_lsa *b)
   ageb = ospf6_lsa_age_current (b);
 
   /* MaxAge check */
-  if (agea == MAXAGE && ageb != MAXAGE)
+  if (agea == OSPF_LSA_MAXAGE && ageb != OSPF_LSA_MAXAGE)
     return -1;
-  else if (agea != MAXAGE && ageb == MAXAGE)
+  else if (agea != OSPF_LSA_MAXAGE && ageb == OSPF_LSA_MAXAGE)
     return 1;
 
   /* Age check */
-  if (agea > ageb && agea - ageb >= MAX_AGE_DIFF)
+  if (agea > ageb && agea - ageb >= OSPF_LSA_MAXAGE_DIFF)
     return 1;
-  else if (agea < ageb && ageb - agea >= MAX_AGE_DIFF)
+  else if (agea < ageb && ageb - agea >= OSPF_LSA_MAXAGE_DIFF)
     return -1;
 
   /* neither recent */
@@ -368,7 +368,7 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa)
              sizeof (adv_router));
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &lsa->installed, &res);
+  res = timeval_subtract (now, lsa->installed);
   timerstring (&res, duration, sizeof (duration));
 
   vty_out (vty, "%-12s %-15s %-15s %4hu %8lx %04hx %4hu %8s%s",
@@ -653,7 +653,7 @@ ospf6_lsa_refresh (struct thread *thread)
   new = ospf6_lsa_create (self->header);
   new->lsdb = old->lsdb;
   new->refresh = thread_add_timer (master, ospf6_lsa_refresh, new,
-                                   LS_REFRESH_TIME);
+                                   OSPF_LS_REFRESH_TIME);
 
   /* store it in the LSDB for self-originated LSAs */
   ospf6_lsdb_add (ospf6_lsa_copy (new), lsdb_self);
diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h
index 263411f..f10ee67 100644
--- a/ospf6d/ospf6_lsa.h
+++ b/ospf6d/ospf6_lsa.h
@@ -107,7 +107,7 @@ struct ospf6_lsa_header
   ((L)->header->adv_router == (a) && (L)->header->id == (i) && \
    (L)->header->type == (t))
 #define OSPF6_LSA_IS_DIFFER(L1, L2)  ospf6_lsa_is_differ (L1, L2)
-#define OSPF6_LSA_IS_MAXAGE(L) (ospf6_lsa_age_current (L) == MAXAGE)
+#define OSPF6_LSA_IS_MAXAGE(L) (ospf6_lsa_age_current (L) == OSPF_LSA_MAXAGE)
 #define OSPF6_LSA_IS_CHANGED(L1, L2) ospf6_lsa_is_changed (L1, L2)
 
 struct ospf6_lsa
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index 280bdf9..7455d83 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -572,7 +572,7 @@ ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id, u_int32_t adv_router,
   /* if current database copy not found, return InitialSequenceNumber */
   lsa = ospf6_lsdb_lookup (type, id, adv_router, lsdb);
   if (lsa == NULL)
-    seqnum = INITIAL_SEQUENCE_NUMBER;
+    seqnum = OSPF_INITIAL_SEQUENCE_NUMBER;
   else
     seqnum = (signed long) ntohl (lsa->header->seqnum) + 1;
 
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 5edb70c..b35aa1a 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -1282,7 +1282,7 @@ ospf6_rxpacket_examin (struct ospf6_interface *oi, struct ospf6_header *oh, cons
   {
     if (IS_OSPF6_DEBUG_MESSAGE (oh->type, RECV))
     {
-      if (oh->area_id == BACKBONE_AREA_ID)
+      if (oh->area_id == OSPF_AREA_BACKBONE)
         zlog_debug ("%s: Message may be via Virtual Link: not supported", __func__);
       else
         zlog_debug
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index 806767d..7391ac5 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -607,7 +607,7 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on)
     }
 
   /* Duration */
-  timersub (&now, &on->last_changed, &res);
+  res = timeval_subtract (now, on->last_changed);
   timerstring (&res, duration, sizeof (duration));
 
   /*
@@ -642,7 +642,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on)
   inet_ntop (AF_INET, &on->bdrouter, bdrouter, sizeof (bdrouter));
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &on->last_changed, &res);
+  res = timeval_subtract (now, on->last_changed);
   timerstring (&res, duration, sizeof (duration));
 
   vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s",
@@ -666,7 +666,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
   inet_ntop (AF_INET, &on->bdrouter, bdrouter, sizeof (bdrouter));
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &on->last_changed, &res);
+  res = timeval_subtract (now, on->last_changed);
   timerstring (&res, duration, sizeof (duration));
 
   vty_out (vty, " Neighbor %s%s", on->name,
@@ -712,7 +712,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
 
   timerclear (&res);
   if (on->thread_send_dbdesc)
-    timersub (&on->thread_send_dbdesc->u.sands, &now, &res);
+    res = timeval_subtract (on->thread_send_dbdesc->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for DbDesc in Time %s [thread %s]%s",
            on->dbdesc_list->count, duration,
@@ -724,7 +724,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
 
   timerclear (&res);
   if (on->thread_send_lsreq)
-    timersub (&on->thread_send_lsreq->u.sands, &now, &res);
+    res = timeval_subtract (on->thread_send_lsreq->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for LSReq in Time %s [thread %s]%s",
            on->lsreq_list->count, duration,
@@ -736,7 +736,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
 
   timerclear (&res);
   if (on->thread_send_lsupdate)
-    timersub (&on->thread_send_lsupdate->u.sands, &now, &res);
+    res = timeval_subtract (on->thread_send_lsupdate->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
            on->lsupdate_list->count, duration,
@@ -748,7 +748,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
 
   timerclear (&res);
   if (on->thread_send_lsack)
-    timersub (&on->thread_send_lsack->u.sands, &now, &res);
+    res = timeval_subtract (on->thread_send_lsack->u.sands, now);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "    %d Pending LSAs for LSAck in Time %s [thread %s]%s",
            on->lsack_list->count, duration,
diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c
index e5a1436..eed7f9d 100644
--- a/ospf6d/ospf6_network.c
+++ b/ospf6d/ospf6_network.c
@@ -27,6 +27,7 @@
 #include "sockopt.h"
 #include "privs.h"
 
+#include "libospf.h"
 #include "ospf6_proto.h"
 #include "ospf6_network.h"
 
diff --git a/ospf6d/ospf6_proto.h b/ospf6d/ospf6_proto.h
index 6462500..af60eb9 100644
--- a/ospf6d/ospf6_proto.h
+++ b/ospf6d/ospf6_proto.h
@@ -26,33 +26,12 @@
 /* OSPF protocol version */
 #define OSPFV3_VERSION           3
 
-/* OSPF protocol number. */
-#ifndef IPPROTO_OSPFIGP
-#define IPPROTO_OSPFIGP         89
-#endif
-
 /* TOS field normaly null */
 #define DEFAULT_TOS_VALUE      0x0
 
-/* Architectural Constants */
-#define LS_REFRESH_TIME                1800  /* 30 min */
-#define MIN_LS_INTERVAL                   5
-#define MIN_LS_ARRIVAL                    1
-#define MAXAGE                         3600  /* 1 hour */
-#define CHECK_AGE                       300  /* 5 min */
-#define MAX_AGE_DIFF                    900  /* 15 min */
-#define LS_INFINITY                0xffffff  /* 24-bit binary value */
-#define INITIAL_SEQUENCE_NUMBER  0x80000001  /* signed 32-bit integer */
-#define MAX_SEQUENCE_NUMBER      0x7fffffff  /* signed 32-bit integer */
-
 #define ALLSPFROUTERS6 "ff02::5"
 #define ALLDROUTERS6   "ff02::6"
 
-/* Configurable Constants */
-
-#define DEFAULT_HELLO_INTERVAL       10
-#define DEFAULT_ROUTER_DEAD_INTERVAL 40
-
 #define OSPF6_ROUTER_BIT_W     (1 << 3)
 #define OSPF6_ROUTER_BIT_V     (1 << 2)
 #define OSPF6_ROUTER_BIT_E     (1 << 1)
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 398acfa..2bf4614 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -791,7 +791,7 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
   struct timeval now, res;
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &route->changed, &res);
+  res = timeval_subtract (now, route->changed);
   timerstring (&res, duration, sizeof (duration));
 
   /* destination */
@@ -858,11 +858,11 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
            VNL);
 
   /* Time */
-  timersub (&now, &route->installed, &res);
+  res = timeval_subtract (now, route->installed);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "Installed Time: %s ago%s", duration, VNL);
 
-  timersub (&now, &route->changed, &res);
+  res = timeval_subtract (now, route->changed);
   timerstring (&res, duration, sizeof (duration));
   vty_out (vty, "  Changed Time: %s ago%s", duration, VNL);
 
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index da0ee13..b6694e2 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -520,7 +520,7 @@ ospf6_spf_calculation_thread (struct thread *t)
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &start);
   ospf6_spf_calculation (oa->ospf6->router_id, oa->spf_table, oa);
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &end);
-  timersub (&end, &start, &runtime);
+  runtime = timeval_subtract (end, start);
 
   if (IS_OSPF6_DEBUG_SPF (PROCESS) || IS_OSPF6_DEBUG_SPF (TIME))
     zlog_debug ("SPF runtime: %ld sec %ld usec",
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index df856b4..4520a32 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -453,7 +453,7 @@ ospf6_show (struct vty *vty, struct ospf6 *o)
 
   /* running time */
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  timersub (&now, &o->starttime, &running);
+  running = timeval_subtract (now, o->starttime);
   timerstring (&running, duration, sizeof (duration));
   vty_out (vty, " Running %s%s", duration, VNL);
 
diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h
index 2ac6300..c041d36 100644
--- a/ospf6d/ospf6d.h
+++ b/ospf6d/ospf6d.h
@@ -24,6 +24,9 @@
 
 #define OSPF6_DAEMON_VERSION    "0.9.7r"
 
+#include "libospf.h"
+#include "thread.h"
+
 /* global variables */
 extern struct thread_master *master;
 
@@ -62,18 +65,6 @@ extern struct thread_master *master;
 #ifndef timerclear
 #define timerclear(a) (a)->tv_sec = (tvp)->tv_usec = 0
 #endif /*timerclear*/
-#ifndef timersub
-#define timersub(a, b, res)                           \
-  do {                                                \
-    (res)->tv_sec = (a)->tv_sec - (b)->tv_sec;        \
-    (res)->tv_usec = (a)->tv_usec - (b)->tv_usec;     \
-    if ((res)->tv_usec < 0)                           \
-      {                                               \
-        (res)->tv_sec--;                              \
-        (res)->tv_usec += 1000000;                    \
-      }                                               \
-  } while (0)
-#endif /*timersub*/
 #define timerstring(tv, buf, size)                    \
   do {                                                \
     if ((tv)->tv_sec / 60 / 60 / 24)                  \
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 7e11e25..ab3e4db 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -310,7 +310,7 @@ ospf_timer_dump (struct thread *t, char *buf, size_t size)
   if (!t)
     return "inactive";
   
-  result = tv_sub (t->u.sands, recent_relative_time());
+  result = timeval_subtract (t->u.sands, recent_relative_time());
   return ospf_timeval_dump (&result, buf, size);
 }
 
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c
index 2ebae89..f7061e3 100644
--- a/ospfd/ospf_flood.c
+++ b/ospfd/ospf_flood.c
@@ -265,7 +265,7 @@ ospf_flood (struct ospf *ospf, struct ospf_neighbor *nbr,
 		       "while local one is initial instance.");
           ; /* Accept this LSA for quick LSDB resynchronization. */
         }
-      else if (tv_cmp (tv_sub (recent_relative_time (), current->tv_recv),
+      else if (timeval_cmp (timeval_subtract (recent_relative_time (), current->tv_recv),
 	               int2tv (OSPF_MIN_LS_ARRIVAL)) < 0)
         {
           if (IS_DEBUG_OSPF_EVENT)
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index dfd1a61..68b8913 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -62,79 +62,6 @@ get_metric (u_char *metric)
 }
 
 
-struct timeval
-tv_adjust (struct timeval a)
-{
-  while (a.tv_usec >= 1000000)
-    {
-      a.tv_usec -= 1000000;
-      a.tv_sec++;
-    }
-
-  while (a.tv_usec < 0)
-    {
-      a.tv_usec += 1000000;
-      a.tv_sec--;
-    }
-
-  return a;
-}
-
-int
-tv_ceil (struct timeval a)
-{
-  a = tv_adjust (a);
-
-  return (a.tv_usec ? a.tv_sec + 1 : a.tv_sec);
-}
-
-int
-tv_floor (struct timeval a)
-{
-  a = tv_adjust (a);
-
-  return a.tv_sec;
-}
-
-struct timeval
-int2tv (int a)
-{
-  struct timeval ret;
-
-  ret.tv_sec = a;
-  ret.tv_usec = 0;
-
-  return ret;
-}
-
-struct timeval
-tv_add (struct timeval a, struct timeval b)
-{
-  struct timeval ret;
-
-  ret.tv_sec = a.tv_sec + b.tv_sec;
-  ret.tv_usec = a.tv_usec + b.tv_usec;
-
-  return tv_adjust (ret);
-}
-
-struct timeval
-tv_sub (struct timeval a, struct timeval b)
-{
-  struct timeval ret;
-
-  ret.tv_sec = a.tv_sec - b.tv_sec;
-  ret.tv_usec = a.tv_usec - b.tv_usec;
-
-  return tv_adjust (ret);
-}
-
-int
-tv_cmp (struct timeval a, struct timeval b)
-{
-  return (a.tv_sec == b.tv_sec ?
-	  a.tv_usec - b.tv_usec : a.tv_sec - b.tv_sec);
-}
 
 int
 ospf_lsa_refresh_delay (struct ospf_lsa *lsa)
@@ -143,11 +70,11 @@ ospf_lsa_refresh_delay (struct ospf_lsa *lsa)
   int delay = 0;
 
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-  delta = tv_sub (now, lsa->tv_orig);
+  delta = timeval_subtract (now, lsa->tv_orig);
 
-  if (tv_cmp (delta, int2tv (OSPF_MIN_LS_INTERVAL)) < 0)
+  if (timeval_cmp (delta, int2tv (OSPF_MIN_LS_INTERVAL)) < 0)
     {
-      delay = tv_ceil (tv_sub (int2tv (OSPF_MIN_LS_INTERVAL), delta));
+      delay = timeval_ceil (timeval_subtract (int2tv (OSPF_MIN_LS_INTERVAL), delta));
 
       if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
         zlog_debug ("LSA[Type%d:%s]: Refresh timer delay %d seconds",
@@ -166,7 +93,7 @@ get_age (struct ospf_lsa *lsa)
   int age;
 
   age = ntohs (lsa->data->ls_age) 
-        + tv_floor (tv_sub (recent_relative_time (), lsa->tv_recv));
+        + timeval_floor (timeval_subtract (recent_relative_time (), lsa->tv_recv));
 
   return age;
 }
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 9a4587d..9e1bdaa 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -508,7 +508,7 @@ ospf_ls_upd_timer (struct thread *thread)
 		  fired.  This is a small tweak to what is in the RFC,
 		  but it will cut out out a lot of retransmit traffic
 		  - MAG */
-		if (tv_cmp (tv_sub (recent_relative_time (), lsa->tv_recv), 
+		if (timeval_cmp (timeval_subtract (recent_relative_time (), lsa->tv_recv),
 			    int2tv (retransmit_interval)) >= 0)
 		  listnode_add (update, rn->info);
 	    }
@@ -1428,8 +1428,8 @@ ospf_db_desc (struct ip *iph, struct ospf_header *ospfh,
 	    {
 	      struct timeval t, now;
 	      quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
-	      t = tv_sub (now, nbr->last_send_ts);
-	      if (tv_cmp (t, int2tv (nbr->v_inactivity)) < 0)
+	      t = timeval_subtract (now, nbr->last_send_ts);
+	      if (timeval_cmp (t, int2tv (nbr->v_inactivity)) < 0)
 		{
 		  /* In states Loading and Full the slave must resend
 		     its last Database Description packet in response to
@@ -2034,7 +2034,7 @@ ospf_ls_upd (struct ip *iph, struct ospf_header *ospfh,
 	      
 	      quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
 	      
-	      if (tv_cmp (tv_sub (now, current->tv_orig), 
+	      if (timeval_cmp (timeval_subtract (now, current->tv_orig),
 			  int2tv (OSPF_MIN_LS_ARRIVAL)) >= 0)
 		/* Trap NSSA type later.*/
 		ospf_ls_upd_send_lsa (nbr, current, OSPF_SEND_PACKET_DIRECT);
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index a5242b6..d7d6f31 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1341,7 +1341,7 @@ ospf_spf_calculate_schedule (struct ospf *ospf)
     }
   
   /* XXX Monotic timers: we only care about relative time here. */
-  result = tv_sub (recent_relative_time (), ospf->ts_spf);
+  result = timeval_subtract (recent_relative_time (), ospf->ts_spf);
   
   elapsed = (result.tv_sec * 1000) + (result.tv_usec / 1000);
   ht = ospf->spf_holdtime * ospf->spf_hold_multiplier;
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 2ba8188..84a44b9 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -2743,7 +2743,7 @@ DEFUN (show_ip_ospf,
   vty_out (vty, " SPF algorithm ");
   if (ospf->ts_spf.tv_sec || ospf->ts_spf.tv_usec)
     {
-      result = tv_sub (recent_relative_time (), ospf->ts_spf);
+      result = timeval_subtract (recent_relative_time (), ospf->ts_spf);
       vty_out (vty, "last executed %s ago%s",
                ospf_timeval_dump (&result, timebuf, sizeof (timebuf)),
                VTY_NEWLINE);
@@ -3216,7 +3216,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi,
   if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec)
     {
       struct timeval res
-        = tv_sub (recent_relative_time (), nbr->ts_last_progress);
+        = timeval_subtract (recent_relative_time (), nbr->ts_last_progress);
       vty_out (vty, "    Most recent state change statistics:%s",
                VTY_NEWLINE);
       vty_out (vty, "      Progressive change %s ago%s",
@@ -3226,7 +3226,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi,
   if (nbr->ts_last_regress.tv_sec || nbr->ts_last_regress.tv_usec)
     {
       struct timeval res
-        = tv_sub (recent_relative_time (), nbr->ts_last_regress);
+        = timeval_subtract (recent_relative_time (), nbr->ts_last_regress);
       vty_out (vty, "      Regressive change %s ago, due to %s%s",
                ospf_timeval_dump (&res, timebuf, sizeof(timebuf)),
                (nbr->last_regress_str ? nbr->last_regress_str : "??"),
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index fb57bf5..fe9d77e 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -24,22 +24,13 @@
 #define _ZEBRA_OSPFD_H
 
 #include <zebra.h>
+#include "libospf.h"
 
 #include "filter.h"
 #include "log.h"
 
 #define OSPF_VERSION            2
 
-/* Default protocol, port number. */
-#ifndef IPPROTO_OSPFIGP
-#define IPPROTO_OSPFIGP         89
-#endif /* IPPROTO_OSPFIGP */
-
-/* IP precedence. */
-#ifndef IPTOS_PREC_INTERNETCONTROL
-#define IPTOS_PREC_INTERNETCONTROL	0xC0
-#endif /* IPTOS_PREC_INTERNETCONTROL */
-
 /* VTY port number. */
 #define OSPF_VTY_PORT          2604
 
@@ -50,29 +41,11 @@
 /* Default configuration file name for ospfd. */
 #define OSPF_DEFAULT_CONFIG   "ospfd.conf"
 
-/* Architectual Constants */
-#ifdef DEBUG
-#define OSPF_LS_REFRESH_TIME                    60
-#else
-#define OSPF_LS_REFRESH_TIME                  1800
-#endif
-#define OSPF_MIN_LS_INTERVAL                     5
-#define OSPF_MIN_LS_ARRIVAL                      1
-#define OSPF_LSA_INITIAL_AGE                     0	/* useful for debug */
-#define OSPF_LSA_MAXAGE                       3600
-#define OSPF_CHECK_AGE                         300
-#define OSPF_LSA_MAXAGE_DIFF                   900
-#define OSPF_LS_INFINITY                  0xffffff
-#define OSPF_DEFAULT_DESTINATION        0x00000000      /* 0.0.0.0 */
-#define OSPF_INITIAL_SEQUENCE_NUMBER    0x80000001
-#define OSPF_MAX_SEQUENCE_NUMBER        0x7fffffff
-
 #define OSPF_NSSA_TRANS_STABLE_DEFAULT		40
 
 #define OSPF_ALLSPFROUTERS              0xe0000005      /* 224.0.0.5 */
 #define OSPF_ALLDROUTERS                0xe0000006      /* 224.0.0.6 */
 
-#define OSPF_AREA_BACKBONE              0x00000000      /* 0.0.0.0 */
 
 /* OSPF Authentication Type. */
 #define OSPF_AUTH_NULL                      0
@@ -85,30 +58,6 @@
    been given or not in VLink command handlers */
 #define OSPF_AUTH_CMD_NOTSEEN              -2
 
-/* OSPF SPF timer values. */
-#define OSPF_SPF_DELAY_DEFAULT              200
-#define OSPF_SPF_HOLDTIME_DEFAULT           1000
-#define OSPF_SPF_MAX_HOLDTIME_DEFAULT	    10000
-
-/* OSPF interface default values. */
-#define OSPF_OUTPUT_COST_DEFAULT           10
-#define OSPF_OUTPUT_COST_INFINITE	   UINT16_MAX
-#define OSPF_ROUTER_DEAD_INTERVAL_DEFAULT  40
-#define OSPF_ROUTER_DEAD_INTERVAL_MINIMAL   1
-#define OSPF_HELLO_INTERVAL_DEFAULT        10
-#define OSPF_ROUTER_PRIORITY_DEFAULT        1
-#define OSPF_RETRANSMIT_INTERVAL_DEFAULT    5
-#define OSPF_TRANSMIT_DELAY_DEFAULT         1
-#define OSPF_DEFAULT_BANDWIDTH		 10000	/* Kbps */
-
-#define OSPF_DEFAULT_REF_BANDWIDTH	100000  /* Kbps */
-
-#define OSPF_POLL_INTERVAL_DEFAULT         60
-#define OSPF_NEIGHBOR_PRIORITY_DEFAULT      0
-
-#define OSPF_MTU_IGNORE_DEFAULT             0
-#define OSPF_FAST_HELLO_DEFAULT             0
-
 /* OSPF options. */
 #define OSPF_OPTION_T                    0x01  /* TOS. */
 #define OSPF_OPTION_E                    0x02





More information about the Quagga-dev mailing list