unbound: daemon/cachedump.h File Reference

unbound 0.1

Functions
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.
int | load_cache (RES *ssl, struct worker *worker)
| Load cache(s) from text.
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.

## 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

  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(), dump_info::ssl, and ssl_printf().

Referenced by execute_cmd().

## ◆ load_cache()

int load_cache | ( | RES * | 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().

## ◆ 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

  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.