#include <isc/lang.h>
#include <dns/types.h>
Go to the source code of this file.
Defines | |
#define | DNS_DBTABLE_H 1 |
#define | DNS_DBTABLEFIND_NOEXACT 0x01 |
Functions | |
ISC_LANG_BEGINDECLS isc_result_t | dns_dbtable_create (isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_dbtable_t **dbtablep) |
Make a new dbtable of class 'rdclass'. | |
void | dns_dbtable_attach (dns_dbtable_t *source, dns_dbtable_t **targetp) |
Attach '*targetp' to 'source'. | |
void | dns_dbtable_detach (dns_dbtable_t **dbtablep) |
Detach *dbtablep from its dbtable. | |
isc_result_t | dns_dbtable_add (dns_dbtable_t *dbtable, dns_db_t *db) |
Add 'db' to 'dbtable'. | |
void | dns_dbtable_remove (dns_dbtable_t *dbtable, dns_db_t *db) |
Remove 'db' from 'dbtable'. | |
void | dns_dbtable_adddefault (dns_dbtable_t *dbtable, dns_db_t *db) |
Use 'db' as the result of a dns_dbtable_find() if no better match is available. | |
void | dns_dbtable_getdefault (dns_dbtable_t *dbtable, dns_db_t **db) |
Get the 'db' used as the result of a dns_dbtable_find() if no better match is available. | |
void | dns_dbtable_removedefault (dns_dbtable_t *dbtable) |
Remove the default db from 'dbtable'. | |
isc_result_t | dns_dbtable_find (dns_dbtable_t *dbtable, dns_name_t *name, unsigned int options, dns_db_t **dbp) |
Find the deepest match to 'name' in the dbtable, and return it. |
XXX TBS XXX
MP:
Definition in file dbtable.h.
#define DNS_DBTABLEFIND_NOEXACT 0x01 |
ISC_LANG_BEGINDECLS isc_result_t dns_dbtable_create | ( | isc_mem_t * | mctx, | |
dns_rdataclass_t | rdclass, | |||
dns_dbtable_t ** | dbtablep | |||
) |
Make a new dbtable of class 'rdclass'.
Requires:
Definition at line 65 of file dbtable.c.
References dbdetach(), DBTABLE_MAGIC, dns_dbtable::default_db, DESTROYLOCK, dns_rbt_create(), dns_rbt_destroy(), isc_mem_attach(), isc_mem_get, isc_mem_putanddetach, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlock_init(), dns_dbtable::lock, dns_dbtable::magic, dns_dbtable::mctx, dns_dbtable::rbt, dns_dbtable::rdclass, dns_dbtable::references, REQUIRE, and dns_dbtable::tree_lock.
void dns_dbtable_attach | ( | dns_dbtable_t * | source, | |
dns_dbtable_t ** | targetp | |||
) |
Attach '*targetp' to 'source'.
Requires:
Definition at line 137 of file dbtable.c.
References INSIST, dns_dbtable::lock, LOCK, dns_dbtable::references, REQUIRE, UNLOCK, and VALID_DBTABLE.
void dns_dbtable_detach | ( | dns_dbtable_t ** | dbtablep | ) |
Detach *dbtablep from its dbtable.
Requires:
Definition at line 153 of file dbtable.c.
References dbtable_free(), INSIST, ISC_FALSE, ISC_TRUE, dns_dbtable::lock, LOCK, dns_dbtable::references, REQUIRE, UNLOCK, and VALID_DBTABLE.
isc_result_t dns_dbtable_add | ( | dns_dbtable_t * | dbtable, | |
dns_db_t * | db | |||
) |
Add 'db' to 'dbtable'.
Requires:
Definition at line 177 of file dbtable.c.
References dns_db_attach(), dns_db_class(), dns_db_origin(), dns_rbt_addname(), isc_rwlocktype_write, dns_dbtable::rbt, dns_dbtable::rdclass, REQUIRE, RWLOCK, RWUNLOCK, dns_dbtable::tree_lock, and VALID_DBTABLE.
void dns_dbtable_remove | ( | dns_dbtable_t * | dbtable, | |
dns_db_t * | db | |||
) |
Remove 'db' from 'dbtable'.
Requires:
Definition at line 195 of file dbtable.c.
References dns_db_origin(), dns_rbt_deletename(), dns_rbt_findname(), INSIST, ISC_FALSE, ISC_R_SUCCESS, isc_rwlocktype_write, name, dns_dbtable::rbt, REQUIRE, RWLOCK, RWUNLOCK, dns_dbtable::tree_lock, and VALID_DBTABLE.
void dns_dbtable_adddefault | ( | dns_dbtable_t * | dbtable, | |
dns_db_t * | db | |||
) |
Use 'db' as the result of a dns_dbtable_find() if no better match is available.
Definition at line 227 of file dbtable.c.
References dns_dbtable::default_db, dns_db_attach(), dns_db_origin(), dns_name_compare(), dns_rootname, isc_rwlocktype_write, REQUIRE, RWLOCK, RWUNLOCK, dns_dbtable::tree_lock, and VALID_DBTABLE.
void dns_dbtable_getdefault | ( | dns_dbtable_t * | dbtable, | |
dns_db_t ** | db | |||
) |
Get the 'db' used as the result of a dns_dbtable_find() if no better match is available.
Definition at line 241 of file dbtable.c.
References dns_dbtable::default_db, dns_db_attach(), isc_rwlocktype_read, REQUIRE, RWLOCK, RWUNLOCK, dns_dbtable::tree_lock, and VALID_DBTABLE.
void dns_dbtable_removedefault | ( | dns_dbtable_t * | dbtable | ) |
Remove the default db from 'dbtable'.
Definition at line 253 of file dbtable.c.
References dns_dbtable::default_db, dns_db_detach(), isc_rwlocktype_write, REQUIRE, RWLOCK, RWUNLOCK, dns_dbtable::tree_lock, and VALID_DBTABLE.
isc_result_t dns_dbtable_find | ( | dns_dbtable_t * | dbtable, | |
dns_name_t * | name, | |||
unsigned int | options, | |||
dns_db_t ** | dbp | |||
) |
Find the deepest match to 'name' in the dbtable, and return it.
Notes:
Definition at line 264 of file dbtable.c.
References dns_dbtable::default_db, dns_db_attach(), DNS_DBTABLEFIND_NOEXACT, DNS_R_PARTIALMATCH, dns_rbt_findname(), DNS_RBTFIND_NOEXACT, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_rwlocktype_read, dns_dbtable::rbt, REQUIRE, RWLOCK, RWUNLOCK, and dns_dbtable::tree_lock.