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

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 124 lines · 23 code · 13 blank · 88 comment · 0 complexity · 47ccc2fae115e3becf7f046317cb703f MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2008 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: rdatalist.h,v 1.22 2008/04/03 06:09:05 tbox Exp $ */
  18. #ifndef DNS_RDATALIST_H
  19. #define DNS_RDATALIST_H 1
  20. /*****
  21. ***** Module Info
  22. *****/
  23. /*! \file dns/rdatalist.h
  24. * \brief
  25. * A DNS rdatalist is a list of rdata of a common type and class.
  26. *
  27. * MP:
  28. *\li Clients of this module must impose any required synchronization.
  29. *
  30. * Reliability:
  31. *\li No anticipated impact.
  32. *
  33. * Resources:
  34. *\li TBS
  35. *
  36. * Security:
  37. *\li No anticipated impact.
  38. *
  39. * Standards:
  40. *\li None.
  41. */
  42. #include <isc/lang.h>
  43. #include <dns/types.h>
  44. /*%
  45. * Clients may use this type directly.
  46. */
  47. struct dns_rdatalist {
  48. dns_rdataclass_t rdclass;
  49. dns_rdatatype_t type;
  50. dns_rdatatype_t covers;
  51. dns_ttl_t ttl;
  52. ISC_LIST(dns_rdata_t) rdata;
  53. ISC_LINK(dns_rdatalist_t) link;
  54. };
  55. ISC_LANG_BEGINDECLS
  56. void
  57. dns_rdatalist_init(dns_rdatalist_t *rdatalist);
  58. /*%<
  59. * Initialize rdatalist.
  60. *
  61. * Ensures:
  62. *\li All fields of rdatalist have been initialized to their default
  63. * values.
  64. */
  65. isc_result_t
  66. dns_rdatalist_tordataset(dns_rdatalist_t *rdatalist,
  67. dns_rdataset_t *rdataset);
  68. /*%<
  69. * Make 'rdataset' refer to the rdata in 'rdatalist'.
  70. *
  71. * Note:
  72. *\li The caller must ensure that 'rdatalist' remains valid and unchanged
  73. * while 'rdataset' is associated with it.
  74. *
  75. * Requires:
  76. *
  77. *\li 'rdatalist' is a valid rdatalist.
  78. *
  79. *\li 'rdataset' is a valid rdataset that is not currently associated with
  80. * any rdata.
  81. *
  82. * Ensures,
  83. * on success,
  84. *
  85. *\li 'rdataset' is associated with the rdata in rdatalist.
  86. *
  87. * Returns:
  88. *\li #ISC_R_SUCCESS
  89. */
  90. isc_result_t
  91. dns_rdatalist_fromrdataset(dns_rdataset_t *rdataset,
  92. dns_rdatalist_t **rdatalist);
  93. /*%<
  94. * Point 'rdatalist' to the rdatalist in 'rdataset'.
  95. *
  96. * Requires:
  97. *
  98. *\li 'rdatalist' is a pointer to a NULL dns_rdatalist_t pointer.
  99. *
  100. *\li 'rdataset' is a valid rdataset associated with an rdatalist.
  101. *
  102. * Ensures,
  103. * on success,
  104. *
  105. *\li 'rdatalist' is pointed to the rdatalist in rdataset.
  106. *
  107. * Returns:
  108. *\li #ISC_R_SUCCESS
  109. */
  110. ISC_LANG_ENDDECLS
  111. #endif /* DNS_RDATALIST_H */