]> git.puffer.fish Git - mirror/frr.git/commitdiff
Convert ospf6d over to quagga_gettime() wrappers.
authorTakashi Sogabe <sogabe@iij.ad.jp>
Mon, 22 Jun 2009 04:07:02 +0000 (13:07 +0900)
committerPaul Jakma <paul@quagga.net>
Mon, 22 Jun 2009 11:21:22 +0000 (12:21 +0100)
ospf6d/ospf6_abr.c
ospf6d/ospf6_flood.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_intra.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_message.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_route.c
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c

index 8224b109f832c50c5def24cbd095046d56c686da..d38ef21ac6ebd0c1b0034a9848177662844a3ee4 100644 (file)
@@ -402,7 +402,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
   else
     {
       summary->type = route->type;
-      gettimeofday (&summary->changed, NULL);
+      quagga_gettime (QUAGGA_CLK_MONOTONIC, &summary->changed);
     }
 
   summary->path.router_bits = route->path.router_bits;
index 8c460293e76bf7ea08a8eeba8906fc3149c2e9c3..670c5d1d13724bc73e78e23d7d3032c39d3db510 100644 (file)
@@ -225,7 +225,7 @@ ospf6_install_lsa (struct ospf6_lsa *lsa)
       ospf6_flood_clear (old);
     }
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  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);
@@ -837,7 +837,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
       if (old)
         {
           struct timeval now, res;
-          gettimeofday (&now, (struct timezone *) NULL);
+          quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
           timersub (&now, &old->installed, &res);
           if (res.tv_sec < MIN_LS_ARRIVAL)
             {
@@ -848,7 +848,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
             }
         }
 
-      gettimeofday (&new->received, (struct timezone *) NULL);
+      quagga_gettime (QUAGGA_CLK_MONOTONIC, &new->received);
 
       if (is_debug)
         zlog_debug ("Flood, Install, Possibly acknowledge the received LSA");
index 5a79862fe86bb1029c105c2724021310956028a0..2cd5303fdb27f9fdb437b6fc441b1e4554d5eaa3 100644 (file)
@@ -825,7 +825,7 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
   vty_out (vty, "  Number of I/F scoped LSAs is %u%s",
            oi->lsdb->count, VNL);
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
 
   timerclear (&res);
   if (oi->thread_send_lsupdate)
index 103e8fc2ef481fe9dcb24aaa1456d31af5789b5d..05b11ba36f9e73a2386a5056e1ed6d9718677d2d 100644 (file)
@@ -1256,11 +1256,11 @@ ospf6_brouter_debug_print (struct ospf6_route *brouter)
   ospf6_linkstate_prefix2str (&brouter->prefix, destination,
                               sizeof (destination));
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &brouter->installed, &res);
   timerstring (&res, installed, sizeof (installed));
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &brouter->changed, &res);
   timerstring (&res, changed, sizeof (changed));
 
index e8290b6369da813bc6ccff3751bd8a1b7cbf29c0..108c025d6c750f091600fb5355c66411a4900a64 100644 (file)
@@ -180,8 +180,8 @@ ospf6_lsa_age_set (struct ospf6_lsa *lsa)
 
   assert (lsa && lsa->header);
 
-  if (gettimeofday (&now, (struct timezone *)NULL) < 0)
-    zlog_warn ("LSA: gettimeofday failed, may fail LSA AGEs: %s",
+  if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &now) < 0)
+    zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s",
                safe_strerror (errno));
 
   lsa->birth.tv_sec = now.tv_sec - ntohs (lsa->header->age);
@@ -203,8 +203,8 @@ ospf6_lsa_age_current (struct ospf6_lsa *lsa)
   assert (lsa->header);
 
   /* current time */
-  if (gettimeofday (&now, (struct timezone *)NULL) < 0)
-    zlog_warn ("LSA: gettimeofday failed, may fail LSA AGEs: %s",
+  if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &now) < 0)
+    zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s",
                safe_strerror (errno));
 
   /* calculate age */
@@ -351,7 +351,7 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa)
   inet_ntop (AF_INET, &lsa->header->adv_router, adv_router,
              sizeof (adv_router));
 
-  gettimeofday (&now, NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &lsa->installed, &res);
   timerstring (&res, duration, sizeof (duration));
 
index c257092a42491b5d101ce7bbc4efb5b903df2ac1..790fc0ae72bd4c0eb302318550cee670654827df 100644 (file)
@@ -1456,7 +1456,7 @@ ospf6_dbdesc_send (struct thread *thread)
   if (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT))
     {
       struct timeval tv;
-      if (gettimeofday (&tv, (struct timezone *) NULL) < 0)
+      if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &tv) < 0)
         tv.tv_sec = 1;
       on->dbdesc_seqnum = tv.tv_sec;
     }
index 8a5d698dbf99276ac476fe9b7c95595e5bc8d2cc..f6c3aeac7be2ce101bf7e5e94bde47c71b5c3ca6 100644 (file)
@@ -89,7 +89,7 @@ ospf6_neighbor_create (u_int32_t router_id, struct ospf6_interface *oi)
             buf, oi->interface->name);
   on->ospf6_if = oi;
   on->state = OSPF6_NEIGHBOR_DOWN;
-  gettimeofday (&on->last_changed, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed);
   on->router_id = router_id;
 
   on->summary_list = ospf6_lsdb_create (on);
@@ -154,7 +154,7 @@ ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on)
   if (prev_state == next_state)
     return;
 
-  gettimeofday (&on->last_changed, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed);
 
   /* log */
   if (IS_OSPF6_DEBUG_NEIGHBOR (STATE))
@@ -568,7 +568,7 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on)
   }
 #endif /*HAVE_GETNAMEINFO*/
 
-  gettimeofday (&now, NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
 
   /* Dead time */
   h = m = s = 0;
@@ -630,7 +630,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on)
   inet_ntop (AF_INET, &on->drouter, drouter, sizeof (drouter));
   inet_ntop (AF_INET, &on->bdrouter, bdrouter, sizeof (bdrouter));
 
-  gettimeofday (&now, NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &on->last_changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
@@ -654,7 +654,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
   inet_ntop (AF_INET, &on->drouter, drouter, sizeof (drouter));
   inet_ntop (AF_INET, &on->bdrouter, bdrouter, sizeof (bdrouter));
 
-  gettimeofday (&now, NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &on->last_changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
index a89ed7e7c978e7e1b71ed4e3ba86176b74f0683f..9832f5702515fe6611c10bd4bc16be7dfaa9ef11 100644 (file)
@@ -378,7 +378,7 @@ ospf6_route_add (struct ospf6_route *route,
   else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
     zlog_debug ("%s: route add: %s", ospf6_route_table_name (table), buf);
 
-  gettimeofday (&now, NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
 
   node = route_node_get (table->table, &route->prefix);
   route->rnode = node;
@@ -792,7 +792,7 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
   char duration[16], ifname[IFNAMSIZ];
   struct timeval now, res;
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &route->changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
@@ -841,7 +841,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
   char duration[16];
   int i;
 
-  gettimeofday (&now, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
 
   /* destination */
   if (route->type == OSPF6_DEST_TYPE_LINKSTATE)
index 44e11f9d5e32dac90fbc44c9e2e7aad207952a71..bfb6df2ee5850e454d9320d92b43222c23df4dec 100644 (file)
@@ -527,9 +527,9 @@ ospf6_spf_calculation_thread (struct thread *t)
     ospf6_spf_log_database (oa);
 
   /* execute SPF calculation */
-  gettimeofday (&start, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &start);
   ospf6_spf_calculation (oa->ospf6->router_id, oa->spf_table, oa);
-  gettimeofday (&end, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &end);
   timersub (&end, &start, &runtime);
 
   if (IS_OSPF6_DEBUG_SPF (PROCESS) || IS_OSPF6_DEBUG_SPF (TIME))
index b42962c556b30dfedc6cbe1ad3d54c1e037e8b80..c4cc9fac8f7bca978013a86a56ba3965482cbc70 100644 (file)
@@ -117,7 +117,7 @@ ospf6_create (void)
   o = XCALLOC (MTYPE_OSPF6_TOP, sizeof (struct ospf6));
 
   /* initialize */
-  gettimeofday (&o->starttime, (struct timezone *) NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &o->starttime);
   o->area_list = list_new ();
   o->area_list->cmp = ospf6_area_cmp;
   o->lsdb = ospf6_lsdb_create (o);
@@ -447,7 +447,7 @@ ospf6_show (struct vty *vty, struct ospf6 *o)
            router_id, VNL);
 
   /* running time */
-  gettimeofday (&now, (struct timezone *)NULL);
+  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
   timersub (&now, &o->starttime, &running);
   timerstring (&running, duration, sizeof (duration));
   vty_out (vty, " Running %s%s", duration, VNL);