Home | History | Annotate | Download | only in rtadvd

Lines Matching refs:timer

1 /*	$NetBSD: timer.c,v 1.20 2021/03/23 18:16:53 christos Exp $	*/
2 /* $KAME: timer.c,v 1.11 2005/04/14 06:22:35 suz Exp $ */
44 #include "timer.h"
89 rtadvd_remove_timer(struct rtadvd_timer **timer)
92 if (*timer) {
93 TAILQ_REMOVE(&ra_timer, *timer, next);
94 free(*timer);
95 *timer = NULL;
100 rtadvd_set_timer(struct timespec *tm, struct rtadvd_timer *timer)
104 /* reset the timer */
106 timespecadd(&now, tm, &timer->tm);
109 if (timespeccmp(&timer->tm, &tm_max, <))
110 tm_max = timer->tm;
112 /* enable the timer */
113 timer->enabled = true;
117 * Check expiration for each timer. If a timer expires,
118 * call the expire function for the timer and update the timer.
136 continue; /* the timer was removed */
156 rtadvd_timer_rest(struct rtadvd_timer *timer)
162 if (timespeccmp(&timer->tm, &now, <=)) {
163 if (timer->enabled)
165 "%s: a timer must be expired, but not yet",
171 timespecsub(&timer->tm, &now, &returnval);