OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / openswan / lib / libdns / include / dns / ttl.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2001  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $ISC-Id:ttl.h,v 1.12.206.1 2004/03/06 08:14:01 marka Exp $ */
19 /* $Id: ttl.h,v 1.1 2005/08/05 01:05:27 mcr Exp $ */
20
21 #ifndef DNS_TTL_H
22 #define DNS_TTL_H 1
23
24 /***
25  ***    Imports
26  ***/
27
28 #include <isc/lang.h>
29 #include <isc/types.h>
30
31 ISC_LANG_BEGINDECLS
32
33 /***
34  ***    Functions
35  ***/
36
37 isc_result_t
38 dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
39                isc_buffer_t *target);
40 /*
41  * Output a TTL or other time interval in a human-readable form.
42  * The time interval is given as a count of seconds in 'src'.
43  * The text representation is appended to 'target'.
44  *
45  * If 'verbose' is ISC_FALSE, use the terse BIND 8 style, like "1w2d3h4m5s".
46  *
47  * If 'verbose' is ISC_TRUE, use a verbose style like the SOA comments
48  * in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds".
49  *
50  * Returns:
51  *      ISC_R_SUCCESS
52  *      ISC_R_NOSPACE
53  */
54
55 isc_result_t
56 dns_counter_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
57 /*
58  * Converts a counter from either a plain number or a BIND 8 style value.
59  *
60  * Returns:
61  *      ISC_R_SUCCESS
62  *      DNS_R_SYNTAX
63  */
64
65 isc_result_t
66 dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
67 /*
68  * Converts a ttl from either a plain number or a BIND 8 style value.
69  *
70  * Returns:
71  *      ISC_R_SUCCESS
72  *      DNS_R_BADTTL
73  */
74
75 ISC_LANG_ENDDECLS
76
77 #endif /* DNS_TTL_H */