2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2003 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: portlist.h,v 1.2.84.2 2004/03/06 08:13:58 marka Exp $ */
22 #include <isc/types.h>
24 #include <dns/types.h>
29 dns_portlist_create(isc_mem_t *mctx, dns_portlist_t **portlistp);
35 * 'portlistp' to be non NULL and '*portlistp' to be NULL;
44 dns_portlist_add(dns_portlist_t *portlist, int af, in_port_t port);
46 * Add the given <port,af> tuple to the portlist.
49 * 'portlist' to be valid.
50 * 'af' to be AF_INET or AF_INET6
58 dns_portlist_remove(dns_portlist_t *portlist, int af, in_port_t port);
60 * Remove the given <port,af> tuple to the portlist.
63 * 'portlist' to be valid.
64 * 'af' to be AF_INET or AF_INET6
68 dns_portlist_match(dns_portlist_t *portlist, int af, in_port_t port);
70 * Find the given <port,af> tuple to the portlist.
73 * 'portlist' to be valid.
74 * 'af' to be AF_INET or AF_INET6
77 * ISC_TRUE if the tuple is found, ISC_FALSE otherwise.
81 dns_portlist_attach(dns_portlist_t *portlist, dns_portlist_t **portlistp);
83 * Attach to a port list.
86 * 'portlist' to be valid.
87 * 'portlistp' to be non NULL and '*portlistp' to be NULL;
91 dns_portlist_detach(dns_portlist_t **portlistp);
93 * Detach from a port list.
96 * '*portlistp' to be valid.