xref: /minix/external/bsd/bind/dist/lib/dns/include/dns/timer.h (revision bb9622b5)
1 /*	$NetBSD: timer.h,v 1.4 2014/12/10 04:37:58 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (C) 2000, 2001  Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* Id: timer.h,v 1.9 2007/06/19 23:47:17 tbox Exp  */
21 
22 #ifndef DNS_TIMER_H
23 #define DNS_TIMER_H 1
24 
25 /*! \file dns/timer.h */
26 
27 /***
28  ***	Imports
29  ***/
30 
31 #include <isc/buffer.h>
32 #include <isc/lang.h>
33 
34 ISC_LANG_BEGINDECLS
35 
36 /***
37  ***	Functions
38  ***/
39 
40 isc_result_t
41 dns_timer_setidle(isc_timer_t *timer, unsigned int maxtime,
42 		  unsigned int idletime, isc_boolean_t purge);
43 /*%<
44  * Convenience function for setting up simple, one-second-granularity
45  * idle timers as used by zone transfers.
46  * \brief
47  * Set the timer 'timer' to go off after 'idletime' seconds of inactivity,
48  * or after 'maxtime' at the very latest.  Events are purged iff
49  * 'purge' is ISC_TRUE.
50  */
51 
52 ISC_LANG_ENDDECLS
53 
54 #endif /* DNS_TIMER_H */
55