34static struct timeout *free_timeouts;
39 if (
cur_tv . tv_sec != t) {
62 t ->
next = free_timeouts;
72 return (
struct timeval *)0;
121 if (status == ISC_R_RELOAD) {
129 status = ISC_R_RELOAD;
133 if (status == ISC_R_TIMESHIFTED){
136 status = ISC_R_RELOAD;
137 log_info (
"System time has been changed. Unable to use existing leases. Restarting");
141 }
while (status == ISC_R_RELOAD);
143 log_fatal (
"Dispatch routine failed: %s -- exiting",
144 isc_result_totext (status));
155 gettimeofday (&
cur_tv, (
struct timezone *)0);
187 q->
next = free_timeouts;
196 log_error(
"Error finding timer structure");
199 isc_event_free(&eventp);
204#define USEC_MAX 1000000
207 struct timeval *when;
208 void (*where) (
void *);
218 isc_interval_t interval;
228 if ((where == NULL || q->
func == where) &&
245 free_timeouts = q->
next;
253 memset(q, 0,
sizeof *q);
283 if ((
when->tv_usec != 0) && (usec < 0)) {
293 "reducing to: %lu (TIME_MAX - 1)",
297 }
else if (usec < 0) {
309 q->
when.tv_usec = usec;
359 isc_interval_set(&interval, sec, usec * 1000);
360 status = isc_time_nowplusinterval(&expires, &interval);
367 isc_result_totext(status));
372 isc_timertype_once, &expires,
378 isc_timertype_once, &expires,
384 log_fatal(
"Unable to add timeout to isclib\n");
391 void (*where) (
void *);
425 q->
next = free_timeouts;
430#if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
439 t->
next = free_timeouts;
447 for (t = free_timeouts; t; t = n) {
void add_timeout(struct timeval *when, void *where, void *what, tvref_t ref, tvunref_t unref)
void isclib_timer_callback(isc_task_t *taskp, isc_event_t *eventp)
struct timeval * process_outstanding_timeouts(struct timeval *tvp)
struct timeout * timeouts
void cancel_timeout(void *where, void *what)
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
void cancel_all_timeouts(void)
void(* tvunref_t)(void *, const char *, int)
void relinquish_timeouts(void)
void(* tvref_t)(void *, void *, const char *, int)
dhcp_context_t dhcp_gbl_ctx
void * dmalloc(size_t, const char *, int)
void dfree(void *, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
void log_fatal(const char *,...) __attribute__((__format__(__printf__
int int log_info(const char *,...) __attribute__((__format__(__printf__
isc_timer_t * isc_timeout