/contrib/bind9/lib/dns/include/dns/ttl.h

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 78 lines · 14 code · 12 blank · 52 comment · 0 complexity · 2215539405d09d5eb2bfb61d4b7939e1 MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 1999-2001 Internet Software Consortium.
  4. *
  5. * Permission to use, copy, modify, and/or 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. /* $Id: ttl.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
  18. #ifndef DNS_TTL_H
  19. #define DNS_TTL_H 1
  20. /*! \file dns/ttl.h */
  21. /***
  22. *** Imports
  23. ***/
  24. #include <isc/lang.h>
  25. #include <isc/types.h>
  26. ISC_LANG_BEGINDECLS
  27. /***
  28. *** Functions
  29. ***/
  30. isc_result_t
  31. dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
  32. isc_buffer_t *target);
  33. /*%<
  34. * Output a TTL or other time interval in a human-readable form.
  35. * The time interval is given as a count of seconds in 'src'.
  36. * The text representation is appended to 'target'.
  37. *
  38. * If 'verbose' is ISC_FALSE, use the terse BIND 8 style, like "1w2d3h4m5s".
  39. *
  40. * If 'verbose' is ISC_TRUE, use a verbose style like the SOA comments
  41. * in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds".
  42. *
  43. * Returns:
  44. * \li ISC_R_SUCCESS
  45. * \li ISC_R_NOSPACE
  46. */
  47. isc_result_t
  48. dns_counter_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
  49. /*%<
  50. * Converts a counter from either a plain number or a BIND 8 style value.
  51. *
  52. * Returns:
  53. *\li ISC_R_SUCCESS
  54. *\li DNS_R_SYNTAX
  55. */
  56. isc_result_t
  57. dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
  58. /*%<
  59. * Converts a ttl from either a plain number or a BIND 8 style value.
  60. *
  61. * Returns:
  62. *\li ISC_R_SUCCESS
  63. *\li DNS_R_BADTTL
  64. */
  65. ISC_LANG_ENDDECLS
  66. #endif /* DNS_TTL_H */