ttl.h File Reference

#include <isc/lang.h>
#include <isc/types.h>

Go to the source code of this file.

Defines

#define DNS_TTL_H   1

Functions

ISC_LANG_BEGINDECLS isc_result_t dns_ttl_totext (isc_uint32_t src, isc_boolean_t verbose, isc_buffer_t *target)
isc_result_t dns_ttl_totext2 (isc_uint32_t src, isc_boolean_t verbose, isc_boolean_t upcase, isc_buffer_t *target)
 Output a TTL or other time interval in a human-readable form. The time interval is given as a count of seconds in 'src'. The text representation is appended to 'target'.
isc_result_t dns_counter_fromtext (isc_textregion_t *source, isc_uint32_t *ttl)
 Converts a counter from either a plain number or a BIND 8 style value.
isc_result_t dns_ttl_fromtext (isc_textregion_t *source, isc_uint32_t *ttl)
 Converts a ttl from either a plain number or a BIND 8 style value.


Detailed Description

Definition in file ttl.h.


Define Documentation

#define DNS_TTL_H   1

Definition at line 21 of file ttl.h.


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t dns_ttl_totext ( isc_uint32_t  src,
isc_boolean_t  verbose,
isc_buffer_t target 
)

Definition at line 81 of file ttl.c.

References dns_ttl_totext2(), and ISC_TRUE.

Referenced by dns_message_pseudosectiontotext(), dump_rdataset(), and totext_soa().

isc_result_t dns_ttl_totext2 ( isc_uint32_t  src,
isc_boolean_t  verbose,
isc_boolean_t  upcase,
isc_buffer_t target 
)

Output a TTL or other time interval in a human-readable form. The time interval is given as a count of seconds in 'src'. The text representation is appended to 'target'.

If 'verbose' is ISC_FALSE, use the terse BIND 8 style, like "1w2d3h4m5s".

If 'verbose' is ISC_TRUE, use a verbose style like the SOA comments in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds".

If 'upcase' is ISC_TRUE, we conform to the BIND 8 style in which the unit letter is capitalized if there is only a single unit letter to print (for example, "1m30s", but "2M")

If 'upcase' is ISC_FALSE, unit letters are always in lower case.

Returns:

Definition at line 86 of file ttl.c.

References isc_region::base, days, INSIST, isc_buffer_usedregion, ISC_R_SUCCESS, ISC_TF, isc_region::length, POST, RETERR, and ttlfmt().

Referenced by dns_ttl_totext(), and rdataset_totext().

isc_result_t dns_counter_fromtext ( isc_textregion_t source,
isc_uint32_t ttl 
)

Converts a counter from either a plain number or a BIND 8 style value.

Returns:

Definition at line 143 of file ttl.c.

References bind_ttl().

Referenced by fromtext_soa().

isc_result_t dns_ttl_fromtext ( isc_textregion_t source,
isc_uint32_t ttl 
)

Converts a ttl from either a plain number or a BIND 8 style value.

Returns:

Definition at line 148 of file ttl.c.

References bind_ttl(), DNS_R_BADTTL, ISC_R_RANGE, and ISC_R_SUCCESS.

Referenced by dst_key_read_public(), load_text(), ns_server_nta(), and parse_ttlval().


Generated on Tue Apr 28 17:41:10 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha