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

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 80 lines · 21 code · 13 blank · 46 comment · 0 complexity · 5a13b2ba67a6bd30b613ad165c688856 MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2008, 2012 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 1999-2001, 2003 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$ */
  18. #ifndef DNS_NSEC_H
  19. #define DNS_NSEC_H 1
  20. /*! \file dns/nsec.h */
  21. #include <isc/lang.h>
  22. #include <dns/types.h>
  23. #include <dns/name.h>
  24. #define DNS_NSEC_BUFFERSIZE (DNS_NAME_MAXWIRE + 8192 + 512)
  25. ISC_LANG_BEGINDECLS
  26. isc_result_t
  27. dns_nsec_buildrdata(dns_db_t *db, dns_dbversion_t *version,
  28. dns_dbnode_t *node, dns_name_t *target,
  29. unsigned char *buffer, dns_rdata_t *rdata);
  30. /*%<
  31. * Build the rdata of a NSEC record.
  32. *
  33. * Requires:
  34. *\li buffer Points to a temporary buffer of at least
  35. * DNS_NSEC_BUFFERSIZE bytes.
  36. *\li rdata Points to an initialized dns_rdata_t.
  37. *
  38. * Ensures:
  39. * \li *rdata Contains a valid NSEC rdata. The 'data' member refers
  40. * to 'buffer'.
  41. */
  42. isc_result_t
  43. dns_nsec_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
  44. dns_name_t *target, dns_ttl_t ttl);
  45. /*%<
  46. * Build a NSEC record and add it to a database.
  47. */
  48. isc_boolean_t
  49. dns_nsec_typepresent(dns_rdata_t *nsec, dns_rdatatype_t type);
  50. /*%<
  51. * Determine if a type is marked as present in an NSEC record.
  52. *
  53. * Requires:
  54. *\li 'nsec' points to a valid rdataset of type NSEC
  55. */
  56. isc_result_t
  57. dns_nsec_nseconly(dns_db_t *db, dns_dbversion_t *version,
  58. isc_boolean_t *answer);
  59. /*
  60. * Report whether the DNSKEY RRset has a NSEC only algorithm. Unknown
  61. * algorithms are assumed to support NSEC3.
  62. *
  63. * Requires:
  64. * 'answer' to be non NULL.
  65. */
  66. ISC_LANG_ENDDECLS
  67. #endif /* DNS_NSEC_H */