Add BIND 9.2.4rc7.
[dragonfly.git] / contrib / bind-9.2.4rc7 / bin / named / include / named / listenlist.h
blobaf30de0dd347b5ab72ca8eaac3f2177456bd8f34
1 /*
2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2000, 2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and 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.
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.
18 /* $Id: listenlist.h,v 1.10.2.1 2004/03/09 06:09:21 marka Exp $ */
20 #ifndef NAMED_LISTENLIST_H
21 #define NAMED_LISTENLIST_H 1
23 /*****
24 ***** Module Info
25 *****/
28 * "Listen lists", as in the "listen-on" configuration statement.
31 /***
32 *** Imports
33 ***/
34 #include <isc/net.h>
36 #include <dns/types.h>
38 /***
39 *** Types
40 ***/
42 typedef struct ns_listenelt ns_listenelt_t;
43 typedef struct ns_listenlist ns_listenlist_t;
45 struct ns_listenelt {
46 isc_mem_t * mctx;
47 in_port_t port;
48 dns_acl_t * acl;
49 ISC_LINK(ns_listenelt_t) link;
52 struct ns_listenlist {
53 isc_mem_t * mctx;
54 int refcount;
55 ISC_LIST(ns_listenelt_t) elts;
58 /***
59 *** Functions
60 ***/
62 isc_result_t
63 ns_listenelt_create(isc_mem_t *mctx, in_port_t port,
64 dns_acl_t *acl, ns_listenelt_t **target);
66 * Create a listen-on list element.
69 void
70 ns_listenelt_destroy(ns_listenelt_t *elt);
72 * Destroy a listen-on list element.
75 isc_result_t
76 ns_listenlist_create(isc_mem_t *mctx, ns_listenlist_t **target);
78 * Create a new, empty listen-on list.
81 void
82 ns_listenlist_attach(ns_listenlist_t *source, ns_listenlist_t **target);
84 * Attach '*target' to '*source'.
87 void
88 ns_listenlist_detach(ns_listenlist_t **listp);
90 * Detach 'listp'.
93 isc_result_t
94 ns_listenlist_default(isc_mem_t *mctx, in_port_t port,
95 isc_boolean_t enabled, ns_listenlist_t **target);
97 * Create a listen-on list with default contents, matching
98 * all addresses with port 'port' (if 'enabled' is ISC_TRUE),
99 * or no addresses (if 'enabled' is ISC_FALSE).
102 #endif /* NAMED_LISTENLIST_H */