]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: use monotime()
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 18 Jan 2017 00:30:43 +0000 (01:30 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 23 Jan 2017 17:26:32 +0000 (18:26 +0100)
This is largely a bulk-replace made with coccinelle.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
26 files changed:
bgpd/bgpd.c
isisd/isis_spf.c
lib/bfd.c
lib/thread.c
lib/thread.h
ospf6d/ospf6_abr.c
ospf6d/ospf6_bfd.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
ospfd/ospf_ase.c
ospfd/ospf_bfd.c
ospfd/ospf_lsa.c
ospfd/ospf_packet.c
ospfd/ospf_spf.c
ospfd/ospfd.c
tests/test-timer-performance.c
zebra/zebra_fpm.c
zebra/zebra_rnh.c
zebra/zserv.c

index 5457822f3be672e61dd2b14b30913fc6869a8acb..3cd1ac65c024386acc03daefb3e1c27ab96cc639 100644 (file)
@@ -348,7 +348,7 @@ time_t bgp_clock (void)
 {
   struct timeval tv;
 
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &tv);
+  monotime(&tv);
   return tv.tv_sec;
 }
 
index 086f5b23da0077ca8001e3108a1cce45df64d56a..c1fb062e5506b2d988fe9e23eba91d78f3c5ebc6 100644 (file)
@@ -1149,7 +1149,7 @@ isis_run_spf (struct isis_area *area, int level, int family, u_char *sysid)
   unsigned long long start_time, end_time;
 
   /* Get time that can't roll backwards. */
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &time_now);
+  monotime(&time_now);
   start_time = time_now.tv_sec;
   start_time = (start_time * 1000000) + time_now.tv_usec;
 
@@ -1243,7 +1243,7 @@ out:
   spftree->pending = 0;
   spftree->runcount++;
   spftree->last_run_timestamp = time (NULL);
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &time_now);
+  monotime(&time_now);
   end_time = time_now.tv_sec;
   end_time = (end_time * 1000000) + time_now.tv_usec;
   spftree->last_run_duration = end_time - start_time;
index 5db08fea60a67769463044f344e11d067cd7b37c..a5edaea21756626c24e8572bf9f4541fa76845dd 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -362,7 +362,7 @@ bfd_last_update (time_t last_update, char *buf, size_t len)
     }
 
   /* Get current time. */
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &tv);
+  monotime(&tv);
   curr = tv.tv_sec;
   diff = curr - last_update;
   tm = gmtime (&diff);
index acec80a636dbb7eff24cc4819a661c989866c0ae..cb7676f0e2fee7e8bb8afc6ec8ba254c06676d4b 100644 (file)
@@ -93,30 +93,6 @@ quagga_get_relative (struct timeval *tv)
   return ret;
 }
 
-/* Exported Quagga timestamp function.
- * Modelled on POSIX clock_gettime.
- */
-int
-quagga_gettime (enum quagga_clkid clkid, struct timeval *tv)
-{
-  switch (clkid)
-    {
-      case QUAGGA_CLK_MONOTONIC:
-        return quagga_get_relative (tv);
-      default:
-        errno = EINVAL;
-        return -1;
-    }
-}
-
-time_t
-quagga_monotime (void)
-{
-  struct timeval tv;
-  quagga_get_relative(&tv);
-  return tv.tv_sec;
-}
-
 static unsigned int
 cpu_record_hash_key (struct cpu_thread_history *a)
 {
index a28768e50b370cca8baa890ebd3a1f638d93e7e3..348e4e155a1350cc81447dbb2ad525d12cc7297e 100644 (file)
@@ -23,6 +23,7 @@
 #define _ZEBRA_THREAD_H
 
 #include <zebra.h>
+#include "monotime.h"
 
 struct rusage_t
 {
@@ -247,13 +248,6 @@ extern void thread_set_yield_time (struct thread *, unsigned long);
 extern void thread_getrusage (RUSAGE_T *);
 extern void thread_cmd_init (void);
 
-/* replacements for the system gettimeofday(), clock_gettime() and
- * time() functions, providing support for non-decrementing clock on
- * all systems, and fully monotonic on /some/ systems.
- */
-extern int quagga_gettime (enum quagga_clkid, struct timeval *);
-extern time_t quagga_monotime (void);
-
 /* Returns elapsed real (wall clock) time. */
 extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
                                          unsigned long *cpu_time_elapsed);
index f75a35fa5073aa7813d580b7cb584155b7a29f33..2e31535d24cd3771e6a3674da86c7c96e25be9bf 100644 (file)
@@ -433,7 +433,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
   else
     {
       summary->type = route->type;
-      quagga_gettime (QUAGGA_CLK_MONOTONIC, &summary->changed);
+      monotime(&summary->changed);
     }
 
   summary->path.router_bits = route->path.router_bits;
index 28126918b5a1d0753f2bacba1e20de01e5757997..fed50212087f4c11bd968ffd625e7d0b0535baa6 100644 (file)
@@ -245,7 +245,7 @@ ospf6_bfd_interface_dest_update (int command, struct zclient *zclient,
 
       old_status = bfd_info->status;
       bfd_info->status = status;
-      quagga_gettime (QUAGGA_CLK_MONOTONIC, &tv);
+      monotime(&tv);
       bfd_info->last_update = tv.tv_sec;
 
       if ((status == BFD_STATUS_DOWN) && (old_status == BFD_STATUS_UP))
index 14c16c02418fa7259814acc92d2d51a0c388e41c..6ac93d8984a811ddfc2570daef4ed856189a28fa 100644 (file)
@@ -224,7 +224,7 @@ ospf6_install_lsa (struct ospf6_lsa *lsa)
       ospf6_flood_clear (old);
     }
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   if (! OSPF6_LSA_IS_MAXAGE (lsa))
     lsa->expire = thread_add_timer (master, ospf6_lsa_expire, lsa,
                                     OSPF_LSA_MAXAGE + lsa->birth.tv_sec - now.tv_sec);
@@ -862,7 +862,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
       if (old)
         {
           struct timeval now, res;
-          quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+          monotime(&now);
           timersub (&now, &old->installed, &res);
           time_delta_ms = (res.tv_sec * 1000) + (int)(res.tv_usec/1000);
           if (time_delta_ms < from->ospf6_if->area->ospf6->lsa_minarrival)
@@ -875,7 +875,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
             }
         }
 
-      quagga_gettime (QUAGGA_CLK_MONOTONIC, &new->received);
+      monotime(&new->received);
 
       if (is_debug)
         zlog_debug ("Install, Flood, Possibly acknowledge the received LSA");
index 0ed8d30a8bbecf77cd0e14787f637bc438e38779..c45809809913fa49e2df6c2c41401666b70f7ad1 100644 (file)
@@ -961,7 +961,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);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
 
   timerclear (&res);
   if (oi->thread_send_lsupdate)
index 586bd77f75f2d2e629b67a95b9db10aef76b6399..d93406fb68bfe1d5eb309edb5048d08dbb9ea418 100644 (file)
@@ -1485,11 +1485,11 @@ ospf6_brouter_debug_print (struct ospf6_route *brouter)
   ospf6_linkstate_prefix2str (&brouter->prefix, destination,
                               sizeof (destination));
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &brouter->installed, &res);
   timerstring (&res, installed, sizeof (installed));
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &brouter->changed, &res);
   timerstring (&res, changed, sizeof (changed));
 
index 92ee9662b72f15eb2cc21c9e91809838e2417300..bea153c9288cf03cfb0b9551dc02a9cfa87a52d4 100644 (file)
@@ -207,7 +207,7 @@ ospf6_lsa_age_set (struct ospf6_lsa *lsa)
 
   assert (lsa && lsa->header);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
 
   lsa->birth.tv_sec = now.tv_sec - ntohs (lsa->header->age);
   lsa->birth.tv_usec = now.tv_usec;
@@ -228,7 +228,7 @@ ospf6_lsa_age_current (struct ospf6_lsa *lsa)
   assert (lsa->header);
 
   /* current time */
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
 
   if (ntohs (lsa->header->age) >= OSPF_LSA_MAXAGE)
     {
@@ -509,7 +509,7 @@ ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
   inet_ntop (AF_INET, &lsa->header->adv_router,
              adv_router, sizeof (adv_router));
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &lsa->installed, &res);
   timerstring (&res, duration, sizeof (duration));
 
index 229c1ef557cdaf75538794bf391e7601671360ae..578b39a6418b3e672e54a5285b2a3e261aa2803a 100644 (file)
@@ -1817,7 +1817,7 @@ ospf6_dbdesc_send (struct thread *thread)
   if (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT) &&
       (on->dbdesc_seqnum == 0))
     {
-      on->dbdesc_seqnum = quagga_monotime ();
+      on->dbdesc_seqnum = monotime(NULL);
     }
 
   dbdesc->options[0] = on->ospf6_if->area->options[0];
index f8a0d7a317b7f6dd30d73bc5e9c2c4d81100b424..ec79a1552bf3a02f4e02dcdc573df0cd5508d214 100644 (file)
@@ -97,7 +97,7 @@ ospf6_neighbor_create (u_int32_t router_id, struct ospf6_interface *oi)
   on->ospf6_if = oi;
   on->state = OSPF6_NEIGHBOR_DOWN;
   on->state_change = 0;
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed);
+  monotime(&on->last_changed);
   on->router_id = router_id;
 
   on->summary_list = ospf6_lsdb_create (on);
@@ -163,7 +163,7 @@ ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on, int e
     return;
 
   on->state_change++;
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed);
+  monotime(&on->last_changed);
 
   /* log */
   if (IS_OSPF6_DEBUG_NEIGHBOR (STATE))
@@ -705,7 +705,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));
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &on->last_changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
@@ -729,7 +729,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));
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &on->last_changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
index 2f416e2689ebe06b942c5434df8c9e4a9611a0fd..29956c61a0c03514aaad570f4bd02b00334aef1b 100644 (file)
@@ -600,7 +600,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);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
 
   node = route_node_get (table->table, &route->prefix);
   route->rnode = node;
@@ -1020,7 +1020,7 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
   struct listnode *node;
   struct ospf6_nexthop *nh;
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &route->changed, &res);
   timerstring (&res, duration, sizeof (duration));
 
@@ -1068,7 +1068,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
   struct listnode *node;
   struct ospf6_nexthop *nh;
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
 
   /* destination */
   if (route->type == OSPF6_DEST_TYPE_LINKSTATE)
index 90144463747592e3ea2dfe865ed0da81884db1bd..333ce5588e6a2b83526de4085fc99a509adee3e7 100644 (file)
@@ -603,7 +603,7 @@ ospf6_spf_calculation_thread (struct thread *t)
   ospf6->t_spf_calc = NULL;
 
   /* execute SPF calculation */
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &start);
+  monotime(&start);
 
   if (ospf6_is_router_abr (ospf6))
     ospf6_abr_range_reset_cost (ospf6);
@@ -644,7 +644,7 @@ ospf6_spf_calculation_thread (struct thread *t)
   if (ospf6_is_router_abr (ospf6))
     ospf6_abr_defaults_to_stub (ospf6);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &end);
+  monotime(&end);
   timersub (&end, &start, &runtime);
 
   ospf6->ts_spf_duration = runtime;
index 6da9680fe2b3b28e0e349b2b5c71b62670f58e02..92111c73fc4ab53b1e062ae1386d6cd1a3d90ddc 100644 (file)
@@ -124,7 +124,7 @@ ospf6_create (void)
   o = XCALLOC (MTYPE_OSPF6_TOP, sizeof (struct ospf6));
 
   /* initialize */
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &o->starttime);
+  monotime(&o->starttime);
   o->area_list = list_new ();
   o->area_list->cmp = ospf6_area_cmp;
   o->lsdb = ospf6_lsdb_create (o);
@@ -891,7 +891,7 @@ ospf6_show (struct vty *vty, struct ospf6 *o)
            router_id, VNL);
 
   /* running time */
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
+  monotime(&now);
   timersub (&now, &o->starttime, &running);
   timerstring (&running, duration, sizeof (duration));
   vty_out (vty, " Running %s%s", duration, VNL);
index fe40b10171988d8c15876e75443098dcfdee247d..b063f317e2524ed188e2e0736a3476cba08bc65d 100644 (file)
@@ -649,7 +649,7 @@ ospf_ase_calculate_timer (struct thread *t)
     {
       ospf->ase_calc = 0;
 
-      quagga_gettime(QUAGGA_CLK_MONOTONIC, &start_time);
+      monotime(&start_time);
 
       /* Calculate external route for each AS-external-LSA */
       LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa)
@@ -681,7 +681,7 @@ ospf_ase_calculate_timer (struct thread *t)
       ospf->old_external_route = ospf->new_external_route;
       ospf->new_external_route = route_table_init ();
 
-      quagga_gettime(QUAGGA_CLK_MONOTONIC, &stop_time);
+      monotime(&stop_time);
 
       zlog_info ("SPF Processing Time(usecs): External Routes: %lld\n",
                 (stop_time.tv_sec - start_time.tv_sec)*1000000LL+
index b4d50a6b9f8b3d312969e873f3db57024d856d07..74bc38220bcb0eca48134b2abecebd90953b54f2 100644 (file)
@@ -249,7 +249,7 @@ ospf_bfd_interface_dest_update (int command, struct zclient *zclient,
 
       old_status = bfd_info->status;
       bfd_info->status = status;
-      quagga_gettime (QUAGGA_CLK_MONOTONIC, &tv);
+      monotime(&tv);
       bfd_info->last_update = tv.tv_sec;
 
       if ((status == BFD_STATUS_DOWN) && (old_status == BFD_STATUS_UP))
index d4811c5b21972858bbbfc702f81b1c96724be53b..cf9943893ad15782fba0b80d57bc490667e9ed6d 100644 (file)
@@ -3638,8 +3638,8 @@ ospf_refresher_register_lsa (struct ospf *ospf, struct ospf_lsa *lsa)
        */
       delay = (random() % (max_delay - min_delay)) + min_delay;
 
-      current_index = ospf->lsa_refresh_queue.index + (quagga_monotime ()
-                - ospf->lsa_refresher_started)/OSPF_LSA_REFRESHER_GRANULARITY;
+      current_index = ospf->lsa_refresh_queue.index + (monotime(NULL)
+                                                       - ospf->lsa_refresher_started)/OSPF_LSA_REFRESHER_GRANULARITY;
       
       index = (current_index + delay/OSPF_LSA_REFRESHER_GRANULARITY)
              % (OSPF_LSA_REFRESHER_SLOTS);
@@ -3702,7 +3702,7 @@ ospf_lsa_refresh_walker (struct thread *t)
      modulus. */
   ospf->lsa_refresh_queue.index =
    ((unsigned long)(ospf->lsa_refresh_queue.index +
-                   (quagga_monotime () - ospf->lsa_refresher_started)
+                   (monotime(NULL) - ospf->lsa_refresher_started)
                    / OSPF_LSA_REFRESHER_GRANULARITY))
                    % OSPF_LSA_REFRESHER_SLOTS;
 
@@ -3743,7 +3743,7 @@ ospf_lsa_refresh_walker (struct thread *t)
 
   ospf->t_lsa_refresher = thread_add_timer (master, ospf_lsa_refresh_walker,
                                           ospf, ospf->lsa_refresh_interval);
-  ospf->lsa_refresher_started = quagga_monotime ();
+  ospf->lsa_refresher_started = monotime(NULL);
 
   for (ALL_LIST_ELEMENTS (lsa_to_refresh, node, nnode, lsa))
     {
index 2aa761d46fee12bfb3265c4355c9b83d459104a1..bf78336ad567c9abf3314899b2eea48a6be7816c 100644 (file)
@@ -3574,7 +3574,7 @@ ospf_db_desc_send (struct ospf_neighbor *nbr)
   if (nbr->last_send)
     ospf_packet_free (nbr->last_send);
   nbr->last_send = ospf_packet_dup (op);
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &nbr->last_send_ts);
+  monotime(&nbr->last_send_ts);
 }
 
 /* Re-send Database Description. */
index dcbb0151fdae331ba5665c3134286d40d1536c01..2b00ff3d744734aed6edd9a3071aff24ef7c10b3 100644 (file)
@@ -1280,7 +1280,7 @@ ospf_spf_calculate (struct ospf_area *area, struct route_table *new_table,
   /* Increment SPF Calculation Counter. */
   area->spf_calculation++;
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &area->ospf->ts_spf);
+  monotime(&area->ospf->ts_spf);
   area->ts_spf = area->ospf->ts_spf;
 
   if (IS_DEBUG_OSPF_EVENT)
@@ -1312,7 +1312,7 @@ ospf_spf_calculate_timer (struct thread *thread)
 
   ospf->t_spf_calc = NULL;
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &spf_start_time);
+  monotime(&spf_start_time);
   /* Allocate new table tree. */
   new_table = route_table_init ();
   new_rtrs = route_table_init ();
@@ -1339,7 +1339,7 @@ ospf_spf_calculate_timer (struct thread *thread)
       areas_processed++;
     }
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   spf_time = timeval_elapsed (stop_time, spf_start_time);
 
   ospf_vl_shut_unapproved (ospf);
@@ -1348,14 +1348,14 @@ ospf_spf_calculate_timer (struct thread *thread)
 
   ospf_ia_routing (ospf, new_table, new_rtrs);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   ia_time = timeval_elapsed (stop_time, start_time);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &start_time);
+  monotime(&start_time);
   ospf_prune_unreachable_networks (new_table);
   ospf_prune_unreachable_routers (new_rtrs);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   prune_time = timeval_elapsed (stop_time, start_time);
   /* AS-external-LSA calculation should not be performed here. */
 
@@ -1366,12 +1366,12 @@ ospf_spf_calculate_timer (struct thread *thread)
 
   ospf_ase_calculate_timer_add (ospf);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &start_time);
+  monotime(&start_time);
 
   /* Update routing table. */
   ospf_route_install (ospf, new_table);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   rt_time = timeval_elapsed (stop_time, start_time);
   /* Update ABR/ASBR routing table */
   if (ospf->old_rtrs)
@@ -1384,14 +1384,14 @@ ospf_spf_calculate_timer (struct thread *thread)
   ospf->old_rtrs = ospf->new_rtrs;
   ospf->new_rtrs = new_rtrs;
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &start_time);
+  monotime(&start_time);
   if (IS_OSPF_ABR (ospf))
     ospf_abr_task (ospf);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   abr_time = timeval_elapsed (stop_time, start_time);
 
-  quagga_gettime (QUAGGA_CLK_MONOTONIC, &stop_time);
+  monotime(&stop_time);
   total_spf_time = timeval_elapsed (stop_time, spf_start_time);
   ospf->ts_spf_duration.tv_sec = total_spf_time/1000000;
   ospf->ts_spf_duration.tv_usec = total_spf_time % 1000000;
index b7542c2a8b8d6b71b7539f3206fc4993eddfc351..0398bc21b87dfa93af8f174d2cb18b84e178a41e 100644 (file)
@@ -273,7 +273,7 @@ ospf_new (u_short instance)
   new->lsa_refresh_interval = OSPF_LSA_REFRESH_INTERVAL_DEFAULT;
   new->t_lsa_refresher = thread_add_timer (master, ospf_lsa_refresh_walker,
                                           new, new->lsa_refresh_interval);
-  new->lsa_refresher_started = quagga_monotime ();
+  new->lsa_refresher_started = monotime(NULL);
 
   if ((new->fd = ospf_sock_init()) < 0)
     {
@@ -1583,7 +1583,7 @@ ospf_timers_refresh_set (struct ospf *ospf, int interval)
     return 1;
 
   time_left = ospf->lsa_refresh_interval -
-    (quagga_monotime () - ospf->lsa_refresher_started);
+    (monotime(NULL) - ospf->lsa_refresher_started);
   
   if (time_left > interval)
     {
@@ -1602,7 +1602,7 @@ ospf_timers_refresh_unset (struct ospf *ospf)
   int time_left;
 
   time_left = ospf->lsa_refresh_interval -
-    (quagga_monotime () - ospf->lsa_refresher_started);
+    (monotime(NULL) - ospf->lsa_refresher_started);
 
   if (time_left > OSPF_LSA_REFRESH_INTERVAL_DEFAULT)
     {
index ee45ede6ac70f1985fca41c3a3fc3e3e1a67b48d..a7d09beecc9b1b54a91890fd9cceeab533b6494c 100644 (file)
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
   for (i = 0; i < SCHEDULE_TIMERS; i++)
     thread_cancel(timers[i]);
 
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &tv_start);
+  monotime(&tv_start);
 
   for (i = 0; i < SCHEDULE_TIMERS; i++)
     {
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
                                         NULL, interval_msec);
     }
 
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &tv_lap);
+  monotime(&tv_lap);
 
   for (i = 0; i < REMOVE_TIMERS; i++)
     {
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
       timers[index] = NULL;
     }
 
-  quagga_gettime(QUAGGA_CLK_MONOTONIC, &tv_stop);
+  monotime(&tv_stop);
 
   t_schedule = 1000 * (tv_lap.tv_sec - tv_start.tv_sec);
   t_schedule += (tv_lap.tv_usec - tv_start.tv_usec) / 1000;
index d44c75383b126862c8e801005ee5075a0e249ce1..1b2ae29eaabb74bb7a36fbe7dad0105c92d66069 100644 (file)
@@ -306,7 +306,7 @@ zfpm_get_elapsed_time (time_t reference)
 {
   time_t now;
 
-  now = quagga_monotime ();
+  now = monotime(NULL);
 
   if (now < reference)
     {
@@ -1163,7 +1163,7 @@ zfpm_connect_cb (struct thread *t)
    */
   zfpm_g->connect_calls++;
   zfpm_g->stats.connect_calls++;
-  zfpm_g->last_connect_call_time = quagga_monotime ();
+  zfpm_g->last_connect_call_time = monotime(NULL);
 
   ret = connect (sock, (struct sockaddr *) &serv, sizeof (serv));
   if (ret >= 0)
@@ -1517,7 +1517,7 @@ zfpm_clear_stats (struct vty *vty)
   zfpm_stop_stats_timer ();
   zfpm_start_stats_timer ();
 
-  zfpm_g->last_stats_clear_time = quagga_monotime();
+  zfpm_g->last_stats_clear_time = monotime(NULL);
 
   vty_out (vty, "Cleared FPM stats%s", VTY_NEWLINE);
 }
index 315d4832ddce6647e6d972b21ffc21110ae0f2c2..182cfe552d525ae549e36f46c61b23d3eaade56a 100644 (file)
@@ -922,7 +922,7 @@ send_client (struct rnh *rnh, struct zserv *client, rnh_type_t type, vrf_id_t vr
     }
   stream_putw_at (s, 0, stream_get_endp (s));
 
-  client->nh_last_upd_time = quagga_monotime();
+  client->nh_last_upd_time = monotime(NULL);
   client->last_write_cmd = cmd;
   return zebra_server_send_message(client);
 }
index 6a15b9a2513b50352406ccaa69d0755bda68bb40..dbf4262bd8be0042d0bd8626ab191049ed8559c8 100644 (file)
@@ -100,7 +100,7 @@ zserv_flush_data(struct thread *thread)
       break;
     }
 
-  client->last_write_time = quagga_monotime();
+  client->last_write_time = monotime(NULL);
   return 0;
 }
 
@@ -134,7 +134,7 @@ zebra_server_send_message(struct zserv *client)
       break;
     }
 
-  client->last_write_time = quagga_monotime();
+  client->last_write_time = monotime(NULL);
   return 0;
 }
 
@@ -826,7 +826,7 @@ zserv_rnh_register (struct zserv *client, int sock, u_short length,
 
   s = client->ibuf;
 
-  client->nh_reg_time = quagga_monotime();
+  client->nh_reg_time = monotime(NULL);
 
   while (l < length)
     {
@@ -914,7 +914,7 @@ zserv_rnh_unregister (struct zserv *client, int sock, u_short length,
       rnh = zebra_lookup_rnh(&p, zvrf_id (zvrf), type);
       if (rnh)
        {
-         client->nh_dereg_time = quagga_monotime();
+         client->nh_dereg_time = monotime(NULL);
          zebra_remove_rnh_client(rnh, client, type);
        }
     }
@@ -1826,7 +1826,7 @@ zebra_client_create (int sock)
   /* Set table number. */
   client->rtm_table = zebrad.rtm_table_default;
 
-  client->connect_time = quagga_monotime();
+  client->connect_time = monotime(NULL);
   /* Initialize flags */
   for (afi = AFI_IP; afi < AFI_MAX; afi++)
     for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
@@ -1952,7 +1952,7 @@ zebra_client_read (struct thread *thread)
     zlog_debug ("zebra message received [%s] %d in VRF %u",
               zserv_command_string (command), length, vrf_id);
 
-  client->last_read_time = quagga_monotime();
+  client->last_read_time = monotime(NULL);
   client->last_read_cmd = command;
 
   zvrf = zebra_vrf_lookup_by_id (vrf_id);
@@ -2263,7 +2263,7 @@ zserv_time_buf(time_t *time1, char *buf, int buflen)
       return (buf);
     }
 
-  now = quagga_monotime();
+  now = monotime(NULL);
   now -= *time1;
   tm = gmtime(&now);