cache.h revision dd2a0a6d2dec1c23787351e51b434a838dec5603
5cd4555ad444fd391002ae32450572054369fd42Rob Austein/*
5cd4555ad444fd391002ae32450572054369fd42Rob Austein * Copyright (C) 2004-2007, 2009, 2011 Internet Systems Consortium, Inc. ("ISC")
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Copyright (C) 1999-2001 Internet Software Consortium.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington *
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews * Permission to use, copy, modify, and/or distribute this software for any
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews * purpose with or without fee is hereby granted, provided that the above
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington * copyright notice and this permission notice appear in all copies.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater *
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington * 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.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews */
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews/* $Id: cache.h,v 1.32 2011/08/02 23:47:52 tbox Exp $ */
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews#ifndef DNS_CACHE_H
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt#define DNS_CACHE_H 1
b5ad6dfea4cc3e7d1d322ac99f1e5a31096837c4Mark Andrews
c40265eba0c99708887d68e67901924065ba2514Brian Wellington/*****
c40265eba0c99708887d68e67901924065ba2514Brian Wellington ***** Module Info
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *****/
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington/*! \file dns/cache.h
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * \brief
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Defines dns_cache_t, the cache object.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Notes:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *\li A cache object contains DNS data of a single class.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Multiple classes will be handled by creating multiple
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * views, each with a different class and its own cache.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * MP:
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews *\li See notes at the individual functions.
fd4dcaddae08b0fb28b0ec4faf26a9d8b1f923caAutomatic Updater *
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews * Reliability:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Resources:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Security:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Standards:
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein/***
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *** Imports
c40265eba0c99708887d68e67901924065ba2514Brian Wellington ***/
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#include <isc/lang.h>
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#include <isc/stats.h>
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#include <isc/stdtime.h>
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#include <dns/types.h>
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsISC_LANG_BEGINDECLS
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafsson
bca7f81db58d4803fb6d8d352132445cf61eb1acMark Andrews/***
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *** Functions
c40265eba0c99708887d68e67901924065ba2514Brian Wellington ***/
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsisc_result_t
92551304a9abff9284de5b79a48e83d781989339Mark Andrewsdns_cache_create(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
c40265eba0c99708887d68e67901924065ba2514Brian Wellington isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
c40265eba0c99708887d68e67901924065ba2514Brian Wellington const char *db_type, unsigned int db_argc, char **db_argv,
c40265eba0c99708887d68e67901924065ba2514Brian Wellington dns_cache_t **cachep);
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonisc_result_t
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtondns_cache_create2(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt const char *cachename, const char *db_type,
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Huntisc_result_t
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Huntdns_cache_create3(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt const char *cachename, const char *db_type,
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt/*%<
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt * Create a new DNS cache.
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt *
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt * dns_cache_create2() will create a named cache.
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt *
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt * dns_cache_create3() will create a named cache using two separate memory
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt * contexts, one for cache data which can be cleaned and a separate one for
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt * memory allocated for the heap (which can grow without an upper limit and
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * has no mechanism for shrinking).
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * dns_cache_create() is a backward compatible version that internally
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * specifies an empty cache name and a single memory context.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Requires:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *\li 'cmctx' (and 'hmctx' if applicable) is a valid memory context.
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *\li 'taskmgr' is a valid task manager and 'timermgr' is a valid timer
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews * manager, or both are NULL. If NULL, no periodic cleaning of the
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews * cache will take place.
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *\li 'cachename' is a valid string. This must not be NULL.
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *\li 'cachep' is a valid pointer, and *cachep == NULL
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Ensures:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li '*cachep' is attached to the newly created cache
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Returns:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li #ISC_R_SUCCESS
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li #ISC_R_NOMEMORY
c40265eba0c99708887d68e67901924065ba2514Brian Wellington */
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafssonvoid
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafssondns_cache_attach(dns_cache_t *cache, dns_cache_t **targetp);
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein/*%<
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Attach *targetp to cache.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Requires:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li 'cache' is a valid cache.
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafsson *
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafsson *\li 'targetp' points to a NULL dns_cache_t *.
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews *
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews * Ensures:
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews *
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews *\li *targetp is attached to cache.
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews */
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrewsvoid
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrewsdns_cache_detach(dns_cache_t **cachep);
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews/*%<
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews * Detach *cachep from its cache.
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews * Requires:
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *\li 'cachep' points to a valid cache.
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews * Ensures:
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *\li *cachep is NULL.
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews *\li If '*cachep' is the last reference to the cache,
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews * all resources used by the cache will be freed
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews */
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsvoid
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsdns_cache_attachdb(dns_cache_t *cache, dns_db_t **dbp);
92551304a9abff9284de5b79a48e83d781989339Mark Andrews/*%<
92551304a9abff9284de5b79a48e83d781989339Mark Andrews * Attach *dbp to the cache's database.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Notes:
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark Andrews *
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark Andrews *\li This may be used to get a reference to the database for
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * the purpose of cache lookups (XXX currently it is also
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * the way to add data to the cache, but having a
92551304a9abff9284de5b79a48e83d781989339Mark Andrews * separate dns_cache_add() interface instead would allow
92551304a9abff9284de5b79a48e83d781989339Mark Andrews * more control over memory usage).
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark Andrews * The caller should call dns_db_detach() on the reference
e9359db5e958bf05f9b9c5fe3c27d533f0f05550Mark Andrews * when it is no longer needed.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Requires:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li 'cache' is a valid cache.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark Andrews *\li 'dbp' points to a NULL dns_db *.
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark Andrews *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Ensures:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li *dbp is attached to the database.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinisc_result_t
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeindns_cache_setfilename(dns_cache_t *cache, const char *filename);
c40265eba0c99708887d68e67901924065ba2514Brian Wellington/*%<
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * If 'filename' is non-NULL, make the cache persistent.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * The cache's data will be stored in the given file.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * If 'filename' is NULL, make the cache non-persistent.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Files that are no longer used are not unlinked automatically.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Returns:
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *\li #ISC_R_SUCCESS
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li #ISC_R_NOMEMORY
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *\li Various file-related failures
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonisc_result_t
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtondns_cache_load(dns_cache_t *cache);
c40265eba0c99708887d68e67901924065ba2514Brian Wellington/*%<
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * If the cache has a file name, load the cache contents from the file.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Previous cache contents are not discarded.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * If no file name has been set, do nothing and return success.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
6043e41fcf5dc91aa8a981c966512d73bdec31c1Mark Andrews * MT:
6043e41fcf5dc91aa8a981c966512d73bdec31c1Mark Andrews *\li Multiple simultaneous attempts to load or dump the cache
6043e41fcf5dc91aa8a981c966512d73bdec31c1Mark Andrews * will be serialized with respect to one another, but
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * the cache may be read and updated while the dump is
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * in progress. Updates performed during loading
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * may or may not be preserved, and reads may return
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * either the old or the newly loaded data.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * Returns:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein *
c40265eba0c99708887d68e67901924065ba2514Brian Wellington *\li #ISC_R_SUCCESS
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * \li Various failures depending on the database implementation type
c40265eba0c99708887d68e67901924065ba2514Brian Wellington */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonisc_result_t
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtondns_cache_dump(dns_cache_t *cache);
c40265eba0c99708887d68e67901924065ba2514Brian Wellington/*%<
c40265eba0c99708887d68e67901924065ba2514Brian Wellington * If the cache has a file name, write the cache contents to disk,
* overwriting any preexisting file. If no file name has been set,
* do nothing and return success.
*
* MT:
*\li Multiple simultaneous attempts to load or dump the cache
* will be serialized with respect to one another, but
* the cache may be read and updated while the dump is
* in progress. Updates performed during the dump may
* or may not be reflected in the dumped file.
*
* Returns:
*
*\li #ISC_R_SUCCESS
* \li Various failures depending on the database implementation type
*/
isc_result_t
dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now);
/*%<
* Force immediate cleaning of the cache, freeing all rdatasets
* whose TTL has expired as of 'now' and that have no pending
* references.
*/
void
dns_cache_setcleaninginterval(dns_cache_t *cache, unsigned int interval);
/*%<
* Set the periodic cache cleaning interval to 'interval' seconds.
*/
unsigned int
dns_cache_getcleaninginterval(dns_cache_t *cache);
/*%<
* Get the periodic cache cleaning interval to 'interval' seconds.
*/
isc_uint32_t
dns_cache_getcachesize(dns_cache_t *cache);
/*%<
* Get the maximum cache size.
*/
const char *
dns_cache_getname(dns_cache_t *cache);
/*%<
* Get the cache name.
*/
void
dns_cache_setcachesize(dns_cache_t *cache, isc_uint32_t size);
/*%<
* Set the maximum cache size. 0 means unlimited.
*/
isc_uint32_t
dns_cache_getcachesize(dns_cache_t *cache);
/*%<
* Get the maximum cache size.
*/
isc_result_t
dns_cache_flush(dns_cache_t *cache);
/*%<
* Flushes all data from the cache.
*
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_NOMEMORY
*/
isc_result_t
dns_cache_flushnode(dns_cache_t *cache, dns_name_t *name,
isc_boolean_t tree);
/*
* Flush a given name from the cache. If 'tree' is true, then
* also flush all names under 'name'.
*
* Requires:
*\li 'cache' to be valid.
*\li 'name' to be valid.
*
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_NOMEMORY
*\li other error returns.
*/
isc_result_t
dns_cache_flushname(dns_cache_t *cache, dns_name_t *name);
/*
* Flush a given name from the cache. Equivalent to
* dns_cache_flushpartial(cache, name, ISC_FALSE).
*
* Requires:
*\li 'cache' to be valid.
*\li 'name' to be valid.
*
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_NOMEMORY
*\li other error returns.
*/
isc_stats_t *
dns_cache_getstats(dns_cache_t *cache);
/*
* Return a pointer to the stats collection object for 'cache'
*/
void
dns_cache_dumpstats(dns_cache_t *cache, FILE *fp);
/*
* Dump cache statistics and status in text to 'fp'
*/
#ifdef HAVE_LIBXML2
void
dns_cache_renderxml(dns_cache_t *cache, xmlTextWriterPtr writer);
/*
* Render cache statistics and status in XML for 'writer'.
*/
#endif /* HAVE_LIBXML2 */
ISC_LANG_ENDDECLS
#endif /* DNS_CACHE_H */