2 * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2003 Internet Software Consortium.
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.
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.9 2007/06/19 23:47:17 tbox Exp $ */
20 /*! \file dns/portlist.h */
24 #include <isc/types.h>
26 #include <dns/types.h>
31 dns_portlist_create(isc_mem_t *mctx, dns_portlist_t **portlistp);
36 *\li 'mctx' to be valid.
37 *\li 'portlistp' to be non NULL and '*portlistp' to be NULL;
42 *\li #ISC_R_UNEXPECTED
46 dns_portlist_add(dns_portlist_t *portlist, int af, in_port_t port);
48 * Add the given <port,af> tuple to the portlist.
51 *\li 'portlist' to be valid.
52 *\li 'af' to be AF_INET or AF_INET6
60 dns_portlist_remove(dns_portlist_t *portlist, int af, in_port_t port);
62 * Remove the given <port,af> tuple to the portlist.
65 *\li 'portlist' to be valid.
66 *\li 'af' to be AF_INET or AF_INET6
70 dns_portlist_match(dns_portlist_t *portlist, int af, in_port_t port);
72 * Find the given <port,af> tuple to the portlist.
75 *\li 'portlist' to be valid.
76 *\li 'af' to be AF_INET or AF_INET6
79 * \li #ISC_TRUE if the tuple is found, ISC_FALSE otherwise.
83 dns_portlist_attach(dns_portlist_t *portlist, dns_portlist_t **portlistp);
85 * Attach to a port list.
88 *\li 'portlist' to be valid.
89 *\li 'portlistp' to be non NULL and '*portlistp' to be NULL;
93 dns_portlist_detach(dns_portlist_t **portlistp);
95 * Detach from a port list.
98 *\li '*portlistp' to be valid.