xref: /openbsd-src/usr.bin/dig/lib/dns/include/dns/ttl.h (revision 1a8dbaac879b9f3335ad7fb25429ce63ac1d6bac)
1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14  * PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /* $Id: ttl.h,v 1.4 2020/09/14 08:40:43 florian Exp $ */
18 
19 #ifndef DNS_TTL_H
20 #define DNS_TTL_H 1
21 
22 /*! \file dns/ttl.h */
23 
24 /***
25  ***	Imports
26  ***/
27 
28 #include <isc/types.h>
29 
30 /***
31  ***	Functions
32  ***/
33 
34 isc_result_t
35 dns_ttl_totext(uint32_t src, int verbose,
36 	       isc_buffer_t *target);
37 /*%<
38  * Output a TTL or other time interval in a human-readable form.
39  * The time interval is given as a count of seconds in 'src'.
40  * The text representation is appended to 'target'.
41  *
42  * If 'verbose' is 0, use the terse BIND 8 style, like "1w2d3h4m5s".
43  *
44  * If 'verbose' is 1, use a verbose style like the SOA comments
45  * in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds".
46  *
47  * Returns:
48  * \li	ISC_R_SUCCESS
49  * \li	ISC_R_NOSPACE
50  */
51 
52 #endif /* DNS_TTL_H */
53