acache.h File Reference

#include <isc/mutex.h>
#include <isc/lang.h>
#include <isc/refcount.h>
#include <isc/stdtime.h>
#include <dns/types.h>

Go to the source code of this file.

Defines

#define DNS_ACACHE_H   1

Functions

ISC_LANG_BEGINDECLS isc_result_t dns_acache_create (dns_acache_t **acachep, isc_mem_t *mctx, isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr)
void dns_acache_attach (dns_acache_t *source, dns_acache_t **targetp)
void dns_acache_detach (dns_acache_t **acachep)
void dns_acache_setcleaninginterval (dns_acache_t *acache, unsigned int t)
void dns_acache_setcachesize (dns_acache_t *acache, size_t size)
isc_result_t dns_acache_setdb (dns_acache_t *acache, dns_db_t *db)
isc_result_t dns_acache_putdb (dns_acache_t *acache, dns_db_t *db)
void dns_acache_shutdown (dns_acache_t *acache)
isc_result_t dns_acache_createentry (dns_acache_t *acache, dns_db_t *origdb, void(*callback)(dns_acacheentry_t *, void **), void *cbarg, dns_acacheentry_t **entryp)
isc_result_t dns_acache_getentry (dns_acacheentry_t *entry, dns_zone_t **zonep, dns_db_t **dbp, dns_dbversion_t **versionp, dns_dbnode_t **nodep, dns_name_t *fname, dns_message_t *msg, isc_stdtime_t now)
isc_result_t dns_acache_setentry (dns_acache_t *acache, dns_acacheentry_t *entry, dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, dns_name_t *fname)
isc_boolean_t dns_acache_cancelentry (dns_acacheentry_t *entry)
void dns_acache_attachentry (dns_acacheentry_t *source, dns_acacheentry_t **targetp)
void dns_acache_detachentry (dns_acacheentry_t **entryp)
void dns_acache_countquerymiss (dns_acache_t *acache)


Define Documentation

#define DNS_ACACHE_H   1

Definition at line 20 of file acache.h.


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t dns_acache_create ( dns_acache_t **  acachep,
isc_mem_t mctx,
isc_taskmgr_t taskmgr,
isc_timermgr_t timermgr 
)

Definition at line 1043 of file acache.c.

References acache_cleaner_init(), ACACHE_DESTROYLOCK, ACACHE_INITLOCK, ACACHE_MAGIC, ATRACE, dns_acache::cleaner, cleanup(), DEFAULT_ACACHE_ENTRY_LOCK_COUNT, DESTROYLOCK, DNS_EVENT_ACACHECONTROL, dns_result_totext(), dns_acache::entrylocks, ISC_EVENT_INIT, ISC_FALSE, ISC_LIST_INIT, isc_mem_attach(), isc_mem_detach(), isc_mem_get, isc_mem_put, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_refcount_decrement, isc_refcount_destroy, isc_refcount_init(), isc_task_create(), isc_task_detach(), isc_task_setname(), dns_acache::live_cleaners, dns_acache::lock, dns_acache::magic, dns_acache::mctx, dns_acache::refs, REQUIRE, reset_stats(), shutdown_task(), and UNEXPECTED_ERROR.

Referenced by configure_view().

void dns_acache_attach ( dns_acache_t source,
dns_acache_t **  targetp 
)

Definition at line 1153 of file acache.c.

References AATRACE, DNS_ACACHE_VALID, isc_refcount_increment, dns_acache::refs, and REQUIRE.

Referenced by dns_acache_createentry(), dns_acache_shutdown(), and dns_zone_setacache().

void dns_acache_detach ( dns_acache_t **  acachep  ) 

Definition at line 1171 of file acache.c.

References ATRACE, check_noentry(), destroy(), DNS_ACACHE_VALID, INSIST, ISC_FALSE, isc_refcount_decrement, isc_task_shutdown(), ISC_TRUE, dns_acache::live_cleaners, dns_acache::refs, and REQUIRE.

Referenced by destroy(), destroy_entry(), dns_zone_setacache(), shutdown_task(), and zone_free().

void dns_acache_setcleaninginterval ( dns_acache_t acache,
unsigned int  t 
)

Definition at line 1735 of file acache.c.

References ATRACE, dns_acache::cleaner, DNS_ACACHE_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, ISC_FALSE, isc_interval_set(), ISC_LOG_NOTICE, ISC_LOG_WARNING, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), isc_timer_reset(), isc_timertype_inactive, isc_timertype_ticker, ISC_TRUE, dns_acache::lock, LOCK, REQUIRE, and UNLOCK.

Referenced by configure_view(), and end_cleaning().

void dns_acache_setcachesize ( dns_acache_t acache,
size_t  size 
)

Definition at line 1785 of file acache.c.

References DNS_ACACHE_MINSIZE, DNS_ACACHE_VALID, isc_mem_setwater(), dns_acache::mctx, REQUIRE, and water().

Referenced by configure_view().

isc_result_t dns_acache_setdb ( dns_acache_t acache,
dns_db_t db 
)

Definition at line 1234 of file acache.c.

References ATRACE, dbentry::db, DNS_ACACHE_VALID, dns_db_attach(), finddbent(), isc_hash_calc(), ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_INIT, isc_mem_get, ISC_R_EXISTS, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_TRUE, dns_acache::lock, LOCK, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by dns_view_flushcache2(), dns_view_setcache2(), dns_zone_setacache(), and zone_attachdb().

isc_result_t dns_acache_putdb ( dns_acache_t acache,
dns_db_t db 
)

Definition at line 1281 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, ATRACE, dns_acache::cleaner, dbentry::db, dns_acache_detachentry(), DNS_ACACHE_VALID, dns_db_detach(), dns_acache::entrylocks, finddbent(), INSIST, isc_hash_calc(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_put, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_rwlocktype_write, ISC_TRUE, dns_acache::lock, LOCK, dns_acacheentry::locknum, dns_acache::mctx, REQUIRE, unlink_dbentries(), and UNLOCK.

Referenced by destroy(), dns_view_flushcache2(), dns_view_setcache2(), and zone_detachdb().

void dns_acache_shutdown ( dns_acache_t acache  ) 

Definition at line 1202 of file acache.c.

References ATRACE, dns_acache_attach(), DNS_ACACHE_VALID, INSIST, isc_mem_setwater(), isc_task_send(), ISC_TRUE, dns_acache::lock, LOCK, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by view_flushanddetach().

isc_result_t dns_acache_createentry ( dns_acache_t acache,
dns_db_t origdb,
void(*)(dns_acacheentry_t *, void **)  callback,
void *  cbarg,
dns_acacheentry_t **  entryp 
)

Definition at line 1373 of file acache.c.

References dns_acacheentry::acache, ACACHEENTRY_MAGIC, dns_acache::cleaner, DEFAULT_ACACHE_ENTRY_LOCK_COUNT, dns_acache_attach(), DNS_ACACHE_VALID, dns_db_attach(), ISC_LINK_INIT, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_NORESOURCES, ISC_R_SUCCESS, isc_random_get(), isc_refcount_init(), isc_stdtime_get(), dns_acacheentry::locknum, dns_acacheentry::magic, dns_acache::mctx, r, dns_acacheentry::references, and REQUIRE.

Referenced by rdataset_setadditional().

isc_result_t dns_acache_getentry ( dns_acacheentry_t entry,
dns_zone_t **  zonep,
dns_db_t **  dbp,
dns_dbversion_t **  versionp,
dns_dbnode_t **  nodep,
dns_name_t fname,
dns_message_t msg,
isc_stdtime_t  now 
)

Definition at line 1445 of file acache.c.

References dns_acacheentry::acache, ACACHE_LOCK, acache_storetime, ACACHE_UNLOCK, DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_db_attach(), dns_db_attachnode(), dns_db_attachversion(), dns_db_closeversion(), dns_db_detach(), dns_db_detachnode(), dns_message_gettemprdataset(), dns_message_puttemprdataset(), dns_name_copy(), dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_zone_attach(), dns_zone_detach(), dns_acache::entrylocks, INSIST, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_R_SUCCESS, isc_rwlocktype_read, isc_stdtime_convert32, dns_acacheentry::locknum, and REQUIRE.

Referenced by rdataset_getadditional().

isc_result_t dns_acache_setentry ( dns_acache_t acache,
dns_acacheentry_t entry,
dns_zone_t zone,
dns_db_t db,
dns_dbversion_t version,
dns_dbnode_t node,
dns_name_t fname 
)

Definition at line 1540 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, clear_entry(), dns_acache_attachentry(), DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_db_attach(), dns_db_attachnode(), dns_db_attachversion(), dns_db_closeversion(), dns_db_currentversion(), dns_name_dup(), dns_name_init(), dns_rdataset_clone(), dns_rdataset_init(), dns_zone_attach(), dns_acache::entrylocks, finddbent(), INSIST, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlocktype_write, ISC_TRUE, dns_acache::lock, LOCK, dns_acacheentry::locknum, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by rdataset_setadditional().

isc_boolean_t dns_acache_cancelentry ( dns_acacheentry_t entry  ) 

Definition at line 1665 of file acache.c.

References dns_acacheentry::acache, ACACHE_LOCK, ACACHE_UNLOCK, clear_entry(), DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_acache::entrylocks, INSIST, isc_rwlocktype_write, ISC_TF, dns_acache::lock, LOCK, dns_acacheentry::locknum, REQUIRE, unlink_dbentries(), and UNLOCK.

Referenced by acache_cancelentry().

void dns_acache_attachentry ( dns_acacheentry_t source,
dns_acacheentry_t **  targetp 
)

Definition at line 1700 of file acache.c.

References DNS_ACACHEENTRY_VALID, isc_refcount_increment, dns_acacheentry::references, and REQUIRE.

Referenced by acache_incremental_cleaning_action(), begin_cleaning(), dns_acache_setentry(), and rdataset_getadditional().

void dns_acache_detachentry ( dns_acacheentry_t **  entryp  ) 

Definition at line 1712 of file acache.c.

References destroy_entry(), DNS_ACACHEENTRY_VALID, INSIST, ISC_LINK_LINKED, isc_refcount_decrement, dns_acacheentry::references, and REQUIRE.

Referenced by acache_callback(), acache_incremental_cleaning_action(), dns_acache_putdb(), end_cleaning(), rdataset_getadditional(), rdataset_putadditional(), rdataset_setadditional(), and shutdown_entries().

void dns_acache_countquerymiss ( dns_acache_t acache  ) 

Definition at line 1165 of file acache.c.

Referenced by rdataset_getadditional().


Generated on Tue Apr 28 17:41:08 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha