#include <isc/lang.h>
#include <isc/result.h>
#include <dns/types.h>
Go to the source code of this file.
Data Structures | |
struct | dns_forwarder |
struct | dns_forwarders |
Defines | |
#define | DNS_FORWARD_H 1 |
Functions | |
typedef | ISC_LIST (struct dns_forwarder) dns_forwarderlist_t |
isc_result_t | dns_fwdtable_create (isc_mem_t *mctx, dns_fwdtable_t **fwdtablep) |
Creates a new forwarding table. | |
isc_result_t | dns_fwdtable_addfwd (dns_fwdtable_t *fwdtable, dns_name_t *name, dns_forwarderlist_t *fwdrs, dns_fwdpolicy_t policy) |
isc_result_t | dns_fwdtable_add (dns_fwdtable_t *fwdtable, dns_name_t *name, isc_sockaddrlist_t *addrs, dns_fwdpolicy_t policy) |
Adds an entry to the forwarding table. The entry associates a domain with a list of forwarders and a forwarding policy. The addrs/fwdrs list is copied if not empty, so the caller should free its copy. | |
isc_result_t | dns_fwdtable_delete (dns_fwdtable_t *fwdtable, dns_name_t *name) |
Removes an entry for 'name' from the forwarding table. If an entry that exactly matches 'name' does not exist, ISC_R_NOTFOUND will be returned. | |
isc_result_t | dns_fwdtable_find (dns_fwdtable_t *fwdtable, dns_name_t *name, dns_forwarders_t **forwardersp) |
Finds a domain in the forwarding table. The closest matching parent domain is returned. | |
isc_result_t | dns_fwdtable_find2 (dns_fwdtable_t *fwdtable, dns_name_t *name, dns_name_t *foundname, dns_forwarders_t **forwardersp) |
Finds a domain in the forwarding table. The closest matching parent domain is returned. | |
void | dns_fwdtable_destroy (dns_fwdtable_t **fwdtablep) |
Destroys a forwarding table. |
Definition in file forward.h.
typedef ISC_LIST | ( | struct | dns_forwarder | ) |
isc_result_t dns_fwdtable_create | ( | isc_mem_t * | mctx, | |
dns_fwdtable_t ** | fwdtablep | |||
) |
Creates a new forwarding table.
Requires:
Definition at line 51 of file forward.c.
References auto_detach(), dns_rbt_create(), dns_rbt_destroy(), FWDTABLEMAGIC, isc_mem_attach(), isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlock_init(), dns_fwdtable::magic, dns_fwdtable::mctx, REQUIRE, dns_fwdtable::rwlock, and dns_fwdtable::table.
Referenced by dns_view_create().
isc_result_t dns_fwdtable_addfwd | ( | dns_fwdtable_t * | fwdtable, | |
dns_name_t * | name, | |||
dns_forwarderlist_t * | fwdrs, | |||
dns_fwdpolicy_t | policy | |||
) |
Definition at line 87 of file forward.c.
References cleanup(), dns_rbt_addname(), dns_forwarders::fwdpolicy, dns_forwarders::fwdrs, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlocktype_write, dns_fwdtable::mctx, REQUIRE, dns_fwdtable::rwlock, RWLOCK, RWUNLOCK, dns_fwdtable::table, and VALID_FWDTABLE.
Referenced by configure_forward().
isc_result_t dns_fwdtable_add | ( | dns_fwdtable_t * | fwdtable, | |
dns_name_t * | name, | |||
isc_sockaddrlist_t * | addrs, | |||
dns_fwdpolicy_t | policy | |||
) |
Adds an entry to the forwarding table. The entry associates a domain with a list of forwarders and a forwarding policy. The addrs/fwdrs list is copied if not empty, so the caller should free its copy.
Requires:
Definition at line 136 of file forward.c.
References dns_forwarder::addr, cleanup(), dns_rbt_addname(), dns_forwarder::dscp, dns_forwarders::fwdpolicy, dns_forwarders::fwdrs, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlocktype_write, dns_fwdtable::mctx, REQUIRE, dns_fwdtable::rwlock, RWLOCK, RWUNLOCK, dns_fwdtable::table, and VALID_FWDTABLE.
Referenced by dns_client_setservers().
isc_result_t dns_fwdtable_delete | ( | dns_fwdtable_t * | fwdtable, | |
dns_name_t * | name | |||
) |
Removes an entry for 'name' from the forwarding table. If an entry that exactly matches 'name' does not exist, ISC_R_NOTFOUND will be returned.
Requires:
Definition at line 187 of file forward.c.
References DNS_R_PARTIALMATCH, dns_rbt_deletename(), ISC_FALSE, ISC_R_NOTFOUND, isc_rwlocktype_write, REQUIRE, dns_fwdtable::rwlock, RWLOCK, RWUNLOCK, dns_fwdtable::table, and VALID_FWDTABLE.
Referenced by dns_client_clearservers().
isc_result_t dns_fwdtable_find | ( | dns_fwdtable_t * | fwdtable, | |
dns_name_t * | name, | |||
dns_forwarders_t ** | forwardersp | |||
) |
Finds a domain in the forwarding table. The closest matching parent domain is returned.
Requires:
Definition at line 203 of file forward.c.
References dns_fwdtable_find2().
Referenced by configure_view().
isc_result_t dns_fwdtable_find2 | ( | dns_fwdtable_t * | fwdtable, | |
dns_name_t * | name, | |||
dns_name_t * | foundname, | |||
dns_forwarders_t ** | forwardersp | |||
) |
Finds a domain in the forwarding table. The closest matching parent domain is returned.
Requires:
Definition at line 210 of file forward.c.
References DNS_R_PARTIALMATCH, dns_rbt_findname(), ISC_R_SUCCESS, isc_rwlocktype_read, REQUIRE, dns_fwdtable::rwlock, RWLOCK, RWUNLOCK, dns_fwdtable::table, and VALID_FWDTABLE.
Referenced by dns_fwdtable_find(), fctx_create(), and fctx_getaddresses().
void dns_fwdtable_destroy | ( | dns_fwdtable_t ** | fwdtablep | ) |
Destroys a forwarding table.
Requires:
Definition at line 230 of file forward.c.
References dns_rbt_destroy(), isc_mem_detach(), isc_mem_put, isc_rwlock_destroy(), dns_fwdtable::magic, dns_fwdtable::mctx, mctx, REQUIRE, dns_fwdtable::rwlock, dns_fwdtable::table, and VALID_FWDTABLE.
Referenced by destroy(), and dns_view_create().