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

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 103 lines · 36 code · 15 blank · 52 comment · 0 complexity · 44135e3b3d21ce633afd085f705d78b9 MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 2000, 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: soa.h,v 1.12 2009/09/10 01:47:09 each Exp $ */
  18. #ifndef DNS_SOA_H
  19. #define DNS_SOA_H 1
  20. /*****
  21. ***** Module Info
  22. *****/
  23. /*! \file dns/soa.h
  24. * \brief
  25. * SOA utilities.
  26. */
  27. /***
  28. *** Imports
  29. ***/
  30. #include <isc/lang.h>
  31. #include <isc/types.h>
  32. #include <dns/types.h>
  33. ISC_LANG_BEGINDECLS
  34. #define DNS_SOA_BUFFERSIZE ((2 * DNS_NAME_MAXWIRE) + (4 * 5))
  35. isc_result_t
  36. dns_soa_buildrdata(dns_name_t *origin, dns_name_t *contact,
  37. dns_rdataclass_t rdclass,
  38. isc_uint32_t serial, isc_uint32_t refresh,
  39. isc_uint32_t retry, isc_uint32_t expire,
  40. isc_uint32_t minimum, unsigned char *buffer,
  41. dns_rdata_t *rdata);
  42. /*%<
  43. * Build the rdata of an SOA record.
  44. *
  45. * Requires:
  46. *\li buffer Points to a temporary buffer of at least
  47. * DNS_SOA_BUFFERSIZE bytes.
  48. *\li rdata Points to an initialized dns_rdata_t.
  49. *
  50. * Ensures:
  51. * \li *rdata Contains a valid SOA rdata. The 'data' member
  52. * refers to 'buffer'.
  53. */
  54. isc_uint32_t
  55. dns_soa_getserial(dns_rdata_t *rdata);
  56. isc_uint32_t
  57. dns_soa_getrefresh(dns_rdata_t *rdata);
  58. isc_uint32_t
  59. dns_soa_getretry(dns_rdata_t *rdata);
  60. isc_uint32_t
  61. dns_soa_getexpire(dns_rdata_t *rdata);
  62. isc_uint32_t
  63. dns_soa_getminimum(dns_rdata_t *rdata);
  64. /*
  65. * Extract an integer field from the rdata of a SOA record.
  66. *
  67. * Requires:
  68. * rdata refers to the rdata of a well-formed SOA record.
  69. */
  70. void
  71. dns_soa_setserial(isc_uint32_t val, dns_rdata_t *rdata);
  72. void
  73. dns_soa_setrefresh(isc_uint32_t val, dns_rdata_t *rdata);
  74. void
  75. dns_soa_setretry(isc_uint32_t val, dns_rdata_t *rdata);
  76. void
  77. dns_soa_setexpire(isc_uint32_t val, dns_rdata_t *rdata);
  78. void
  79. dns_soa_setminimum(isc_uint32_t val, dns_rdata_t *rdata);
  80. /*
  81. * Change an integer field of a SOA record by modifying the
  82. * rdata in-place.
  83. *
  84. * Requires:
  85. * rdata refers to the rdata of a well-formed SOA record.
  86. */
  87. ISC_LANG_ENDDECLS
  88. #endif /* DNS_SOA_H */