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

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 99 lines · 21 code · 13 blank · 65 comment · 0 complexity · 30d71aa8f19d2ffd60246189ce4e30ee MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 2002 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: order.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
  18. #ifndef DNS_ORDER_H
  19. #define DNS_ORDER_H 1
  20. /*! \file dns/order.h */
  21. #include <isc/lang.h>
  22. #include <isc/types.h>
  23. #include <dns/types.h>
  24. ISC_LANG_BEGINDECLS
  25. isc_result_t
  26. dns_order_create(isc_mem_t *mctx, dns_order_t **orderp);
  27. /*%<
  28. * Create a order object.
  29. *
  30. * Requires:
  31. * \li 'orderp' to be non NULL and '*orderp == NULL'.
  32. *\li 'mctx' to be valid.
  33. *
  34. * Returns:
  35. *\li ISC_R_SUCCESS
  36. *\li ISC_R_NOMEMORY
  37. */
  38. isc_result_t
  39. dns_order_add(dns_order_t *order, dns_name_t *name,
  40. dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
  41. unsigned int mode);
  42. /*%<
  43. * Add a entry to the end of the order list.
  44. *
  45. * Requires:
  46. * \li 'order' to be valid.
  47. *\li 'name' to be valid.
  48. *\li 'mode' to be one of #DNS_RDATASERATTR_RANDOMIZE,
  49. * #DNS_RDATASERATTR_RANDOMIZE or zero (#DNS_RDATASERATTR_CYCLIC).
  50. *
  51. * Returns:
  52. *\li #ISC_R_SUCCESS
  53. *\li #ISC_R_NOMEMORY
  54. */
  55. unsigned int
  56. dns_order_find(dns_order_t *order, dns_name_t *name,
  57. dns_rdatatype_t rdtype, dns_rdataclass_t rdclass);
  58. /*%<
  59. * Find the first matching entry on the list.
  60. *
  61. * Requires:
  62. *\li 'order' to be valid.
  63. *\li 'name' to be valid.
  64. *
  65. * Returns the mode set by dns_order_add() or zero.
  66. */
  67. void
  68. dns_order_attach(dns_order_t *source, dns_order_t **target);
  69. /*%<
  70. * Attach to the 'source' object.
  71. *
  72. * Requires:
  73. * \li 'source' to be valid.
  74. *\li 'target' to be non NULL and '*target == NULL'.
  75. */
  76. void
  77. dns_order_detach(dns_order_t **orderp);
  78. /*%<
  79. * Detach from the object. Clean up if last this was the last
  80. * reference.
  81. *
  82. * Requires:
  83. *\li '*orderp' to be valid.
  84. */
  85. ISC_LANG_ENDDECLS
  86. #endif /* DNS_ORDER_H */