cachedump.h File Reference

This file contains functions to read and write the cache(s) to text format. More...

Functions

int dump_cache (SSL *ssl, struct worker *worker)
 Dump cache(s) to text.
int load_cache (SSL *ssl, struct worker *worker)
 Load cache(s) from text.
int print_deleg_lookup (SSL *ssl, struct worker *worker, uint8_t *nm, size_t nmlen, int nmlabs)
 Print the delegation used to lookup for this name.

Detailed Description

This file contains functions to read and write the cache(s) to text format.

The format of the file is as follows: [RRset cache] [Message cache] EOF -- fixed string "EOF" before end of the file.

The RRset cache is: START_RRSET_CACHE [rrset]* END_RRSET_CACHE

rrset is: ;rrset [nsec_apex] TTL rr_count rrsig_count trust security resource records, one per line, in zonefile format rrsig records, one per line, in zonefile format If the text conversion fails, BADRR is printed on the line.

The Message cache is: START_MSG_CACHE [msg]* END_MSG_CACHE

msg is: msg name class type flags qdcount ttl security an ns ar list of rrset references, one per line. If conversion fails, BADREF reference is: name class type flags

Expired cache entries are not printed.


Function Documentation

int dump_cache ( SSL *  ssl,
struct worker worker 
)

Dump cache(s) to text.

Parameters:
ssl,: to print to
worker,: worker that is available (buffers, etc) and has ptrs to the caches.
Returns:
false on ssl print error.

References dump_msg_cache(), dump_rrset_cache(), and ssl_printf().

Referenced by execute_cmd().

int load_cache ( SSL *  ssl,
struct worker worker 
)

Load cache(s) from text.

Parameters:
ssl,: to read from
worker,: worker that is available (buffers, etc) and has ptrs to the caches.
Returns:
false on ssl error.

References worker::env, load_msg_cache(), load_rrset_cache(), read_fixed(), and module_env::scratch_buffer.

Referenced by execute_cmd().

int print_deleg_lookup ( SSL *  ssl,
struct worker worker,
uint8_t *  nm,
size_t  nmlen,
int  nmlabs 
)

Print the delegation used to lookup for this name.

Parameters:
ssl,: to read from
worker,: worker that is available (buffers, etc) and has ptrs to the caches.
nm,: name to lookup
nmlen,: length of name.
nmlabs,: labels in name.
Returns:
false on ssl error.

References BIT_RD, worker::daemon, dname_is_root(), dname_remove_label(), dname_str(), dns_cache_find_delegation(), iter_hints_stub::dp, worker::env, forwards_lookup(), module_env::fwds, iter_env::hints, hints_lookup_stub(), iter_dp_is_useless(), module_env::modinfo, daemon::mods, modstack_find(), delegpt::name, delegpt::namelen, iter_hints_stub::noprime, module_env::now, print_dp_details(), print_dp_main(), query_info::qclass, query_info::qname, query_info::qname_len, query_info::qtype, regional_free_all(), worker::scratchpad, and ssl_printf().

Referenced by do_lookup().

Generated on Thu Apr 22 00:30:15 2010 for unbound by  doxygen 1.6.3