]>
git.saurik.com Git - apple/ipsec.git/blob - ipsec-tools/racoon/schedule.h
1 /* $NetBSD: schedule.h,v 1.4.6.1 2007/03/21 14:29:48 vanhu Exp $ */
3 /* Id: schedule.h,v 1.5 2006/05/03 21:53:42 vanhu Exp */
6 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the project nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #include <sys/queue.h>
40 /* scheduling table */
41 /* the head is the nearest event. */
43 time_t xtime
; /* event time which is as time(3). */
45 * if defined FIXY2038PROBLEM, this time
46 * is from the time when called sched_init().
48 void (*func
) __P((void *)); /* call this function when timeout. */
49 void *param
; /* pointer to parameter */
51 int dead
; /* dead or alive */
52 long id
; /* for debug */
53 time_t created
; /* for debug */
54 time_t tick
; /* for debug */
56 TAILQ_ENTRY(sched
) chain
;
60 #define SCHED_KILL(s) \
68 /* must be called after it's called from scheduler. */
69 #define SCHED_INIT(s) (s) = NULL
78 struct timeval
*schedular
__P((void));
79 struct sched
*sched_new
__P((time_t, void (*func
) __P((void *)), void *));
80 void sched_kill
__P((struct sched
*));
81 int sched_dump
__P((caddr_t
*, int *));
82 void sched_init
__P((void));
83 void sched_scrub_param
__P((void *));
85 #endif /* _SCHEDULE_H */