else
{
summary->type = route->type;
- gettimeofday (&summary->changed, NULL);
+ quagga_gettime (QUAGGA_CLK_MONOTONIC, &summary->changed);
}
summary->path.router_bits = route->path.router_bits;
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);
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)
{
}
}
- 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");
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)
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));
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);
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 */
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));
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;
}
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);
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))
}
#endif /*HAVE_GETNAMEINFO*/
- gettimeofday (&now, NULL);
+ quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
/* Dead time */
h = m = s = 0;
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));
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));
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;
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));
char duration[16];
int i;
- gettimeofday (&now, (struct timezone *) NULL);
+ quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
/* destination */
if (route->type == OSPF6_DEST_TYPE_LINKSTATE)
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))
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);
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);