34 static struct timeout *free_timeouts;
39 if (
cur_tv . tv_sec != t) {
62 t ->
next = free_timeouts;
72 return (
struct timeval *)0;
122 if (status == ISC_R_RELOAD) {
129 if (status == ISC_R_SUCCESS)
130 status = ISC_R_RELOAD;
132 }
while (status == ISC_R_RELOAD);
134 log_fatal (
"Dispatch routine failed: %s -- exiting",
135 isc_result_totext (status));
146 gettimeofday (&
cur_tv, (
struct timezone *)0);
178 q->
next = free_timeouts;
187 log_error(
"Error finding timer structure");
190 isc_event_free(&eventp);
195 #define USEC_MAX 1000000 198 struct timeval *when;
199 void (*where) (
void *);
209 isc_interval_t interval;
219 if ((where == NULL || q->
func == where) &&
236 free_timeouts = q->
next;
244 memset(q, 0,
sizeof *q);
274 if ((
when->tv_usec != 0) && (usec < 0)) {
284 "reducing to: %lu (TIME_MAX - 1)",
288 }
else if (usec < 0) {
300 q->
when.tv_usec = usec;
302 #if defined (TRACING) 350 isc_interval_set(&interval, sec, usec * 1000);
351 status = isc_time_nowplusinterval(&expires, &interval);
352 if (status != ISC_R_SUCCESS) {
358 isc_result_totext(status));
363 isc_timertype_once, &expires,
369 isc_timertype_once, &expires,
374 if (status != ISC_R_SUCCESS) {
375 log_fatal(
"Unable to add timeout to isclib\n");
382 void (*where) (
void *);
406 #if defined (TRACING) 410 #if defined (TRACING) 416 q->
next = free_timeouts;
421 #if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT) 430 t->
next = free_timeouts;
438 for (t = free_timeouts; t; t = n) {
void cancel_timeout(void(*)(void *) where, void *what)
dhcp_context_t dhcp_gbl_ctx
isc_timermgr_t * timermgr
struct timeval * process_outstanding_timeouts(struct timeval *tvp)
int log_error(const char *,...) __attribute__((__format__(__printf__
void cancel_all_timeouts(void)
void add_timeout(struct timeval *when, void(*)(void *) where, void *what, tvref_t ref, tvunref_t unref)
void(* tvunref_t)(void *, const char *, int)
void(* tvref_t)(void *, void *, const char *, int)
void log_fatal(const char *,...) __attribute__((__format__(__printf__
void relinquish_timeouts(void)
isc_timer_t * isc_timeout
void dfree(void *, const char *, int)
void * dmalloc(size_t, const char *, int)
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
void isclib_timer_callback(isc_task_t *taskp, isc_event_t *eventp)
struct timeout * timeouts