forward.h revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 2000, 2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and/or distribute this software for any
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * purpose with or without fee is hereby granted, provided that the above
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater/* $Id: forward.h,v 1.11 2007/06/19 23:47:16 tbox Exp $ */
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellingtondns_fwdtable_create(isc_mem_t *mctx, dns_fwdtable_t **fwdtablep);
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * Creates a new forwarding table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li mctx is a valid memory context.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li fwdtablep != NULL && *fwdtablep == NULL
fb827ed6df9a473770fb69a75a455b4ad0d14f52Mark Andrews * \li #ISC_R_SUCCESS
fb827ed6df9a473770fb69a75a455b4ad0d14f52Mark Andrews * \li #ISC_R_NOMEMORY
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellingtondns_fwdtable_add(dns_fwdtable_t *fwdtable, dns_name_t *name,
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington isc_sockaddrlist_t *addrs, dns_fwdpolicy_t policy);
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * Adds an entry to the forwarding table. The entry associates
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * a domain with a list of forwarders and a forwarding policy. The
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * addrs list is copied if not empty, so the caller should free its copy.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li fwdtable is a valid forwarding table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li name is a valid name
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li addrs is a valid list of sockaddrs, which may be empty.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_NOMEMORY
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellingtondns_fwdtable_find(dns_fwdtable_t *fwdtable, dns_name_t *name,
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Finds a domain in the forwarding table. The closest matching parent
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * domain is returned.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li fwdtable is a valid forwarding table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li name is a valid name
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li forwardersp != NULL && *forwardersp == NULL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_NOTFOUND
8a713ca49ddddb36e432d4717800f9258a5c2ea9Mark Andrewsdns_fwdtable_find2(dns_fwdtable_t *fwdtable, dns_name_t *name,
8a713ca49ddddb36e432d4717800f9258a5c2ea9Mark Andrews dns_name_t *foundname, dns_forwarders_t **forwardersp);
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * Finds a domain in the forwarding table. The closest matching parent
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * domain is returned.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li fwdtable is a valid forwarding table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li name is a valid name
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li forwardersp != NULL && *forwardersp == NULL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li foundname to be NULL or a valid name with buffer.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_R_NOTFOUND
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellingtondns_fwdtable_destroy(dns_fwdtable_t **fwdtablep);
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington * Destroys a forwarding table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li fwtablep != NULL && *fwtablep != NULL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li all memory associated with the forwarding table is freed.
30e6ea9dedbe0738f9729833b1b59042dbebc4dfBrian Wellington#endif /* DNS_FORWARD_H */