cachedump.h File Reference

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

#include "daemon/remote.h"

Functions

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

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

◆ dump_cache()

int dump_cache ( RES ssl,
struct worker worker 
)

Dump cache(s) to text.

Parameters
sslto print to
workerworker 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().

◆ load_cache()

int load_cache ( RES ssl,
struct worker worker 
)

Load cache(s) from text.

Parameters
sslto read from
workerworker 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().

◆ print_deleg_lookup()

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

Print the delegation used to lookup for this name.

Parameters
sslto read from
workerworker that is available (buffers, etc) and has ptrs to the caches.
nmname to lookup
nmlenlength of name.
nmlabslabels in name.
Returns
false on ssl error.

Referenced by do_lookup().