/contrib/bind9/bin/named/include/named/listenlist.h

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 105 lines · 32 code · 20 blank · 53 comment · 0 complexity · 74ab38f0c72c1e46c1a76e454be4ab61 MD5 · raw file

  1. /*
  2. * Copyright (C) 2004, 2005, 2007 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: listenlist.h,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
  18. #ifndef NAMED_LISTENLIST_H
  19. #define NAMED_LISTENLIST_H 1
  20. /*****
  21. ***** Module Info
  22. *****/
  23. /*! \file
  24. * \brief
  25. * "Listen lists", as in the "listen-on" configuration statement.
  26. */
  27. /***
  28. *** Imports
  29. ***/
  30. #include <isc/net.h>
  31. #include <dns/types.h>
  32. /***
  33. *** Types
  34. ***/
  35. typedef struct ns_listenelt ns_listenelt_t;
  36. typedef struct ns_listenlist ns_listenlist_t;
  37. struct ns_listenelt {
  38. isc_mem_t * mctx;
  39. in_port_t port;
  40. dns_acl_t * acl;
  41. ISC_LINK(ns_listenelt_t) link;
  42. };
  43. struct ns_listenlist {
  44. isc_mem_t * mctx;
  45. int refcount;
  46. ISC_LIST(ns_listenelt_t) elts;
  47. };
  48. /***
  49. *** Functions
  50. ***/
  51. isc_result_t
  52. ns_listenelt_create(isc_mem_t *mctx, in_port_t port,
  53. dns_acl_t *acl, ns_listenelt_t **target);
  54. /*%
  55. * Create a listen-on list element.
  56. */
  57. void
  58. ns_listenelt_destroy(ns_listenelt_t *elt);
  59. /*%
  60. * Destroy a listen-on list element.
  61. */
  62. isc_result_t
  63. ns_listenlist_create(isc_mem_t *mctx, ns_listenlist_t **target);
  64. /*%
  65. * Create a new, empty listen-on list.
  66. */
  67. void
  68. ns_listenlist_attach(ns_listenlist_t *source, ns_listenlist_t **target);
  69. /*%
  70. * Attach '*target' to '*source'.
  71. */
  72. void
  73. ns_listenlist_detach(ns_listenlist_t **listp);
  74. /*%
  75. * Detach 'listp'.
  76. */
  77. isc_result_t
  78. ns_listenlist_default(isc_mem_t *mctx, in_port_t port,
  79. isc_boolean_t enabled, ns_listenlist_t **target);
  80. /*%
  81. * Create a listen-on list with default contents, matching
  82. * all addresses with port 'port' (if 'enabled' is ISC_TRUE),
  83. * or no addresses (if 'enabled' is ISC_FALSE).
  84. */
  85. #endif /* NAMED_LISTENLIST_H */