This file contains functions to read and write the cache(s) to text format. More...
#include "config.h"
#include "daemon/cachedump.h"
#include "util/log.h"
#include <pthread.h>
#include "util/locks.h"
#include "util/storage/lruhash.h"
#include "util/data/msgreply.h"
#include "util/data/msgparse.h"
#include "util/alloc.h"
#include "util/data/packed_rrset.h"
#include "services/modstack.h"
#include "util/regional.h"
#include "util/net_help.h"
#include "util/module.h"
#include "util/rbtree.h"
#include "util/storage/dnstree.h"
Functions | |
static ldns_rr * | to_rr (struct ub_packed_rrset_key *k, struct packed_rrset_data *d, uint32_t now, size_t i, uint16_t type) |
convert to ldns rr | |
static int | dump_rrset_line (SSL *ssl, struct ub_packed_rrset_key *k, struct packed_rrset_data *d, uint32_t now, size_t i, uint16_t type) |
dump one rrset zonefile line | |
static int | dump_rrset (SSL *ssl, struct ub_packed_rrset_key *k, struct packed_rrset_data *d, uint32_t now) |
dump rrset key and data info | |
static int | dump_rrset_lruhash (SSL *ssl, struct lruhash *h, uint32_t now) |
dump lruhash rrset cache | |
static int | dump_rrset_cache (SSL *ssl, struct worker *worker) |
dump rrset cache | |
static int | dump_msg_ref (SSL *ssl, struct ub_packed_rrset_key *k) |
dump message to rrset reference | |
static int | dump_msg (SSL *ssl, struct query_info *k, struct reply_info *d, uint32_t now) |
dump message entry | |
static int | copy_msg (struct regional *region, struct lruhash_entry *e, struct query_info **k, struct reply_info **d) |
copy msg to worker pad | |
static int | dump_msg_lruhash (SSL *ssl, struct worker *worker, struct lruhash *h) |
dump lruhash msg cache | |
static int | dump_msg_cache (SSL *ssl, struct worker *worker) |
dump msg cache | |
int | dump_cache (SSL *ssl, struct worker *worker) |
Dump cache(s) to text. | |
static int | ssl_read_buf (SSL *ssl, ldns_buffer *buf) |
read a line from ssl into buffer | |
static int | read_fixed (SSL *ssl, ldns_buffer *buf, const char *str) |
check fixed text on line | |
static int | load_rr (SSL *ssl, ldns_buffer *buf, struct regional *region, struct ub_packed_rrset_key *rk, struct packed_rrset_data *d, unsigned int i, int is_rrsig, int *go_on, uint32_t now) |
load an RR into rrset | |
static int | move_into_cache (struct ub_packed_rrset_key *k, struct packed_rrset_data *d, struct worker *worker) |
move entry into cache | |
static int | load_rrset (SSL *ssl, ldns_buffer *buf, struct worker *worker) |
load an rrset entry | |
static int | load_rrset_cache (SSL *ssl, struct worker *worker) |
load rrset cache | |
static char * | load_qinfo (char *str, struct query_info *qinfo, ldns_buffer *buf, struct regional *region) |
read qinfo from next three words | |
static int | load_ref (SSL *ssl, ldns_buffer *buf, struct worker *worker, struct regional *region, struct ub_packed_rrset_key **rrset, int *go_on) |
load a msg rrset reference | |
static int | load_msg (SSL *ssl, ldns_buffer *buf, struct worker *worker) |
load a msg entry | |
static int | load_msg_cache (SSL *ssl, struct worker *worker) |
load msg cache | |
int | load_cache (SSL *ssl, struct worker *worker) |
Load cache(s) from text. | |
static void | print_dp_details (SSL *ssl, struct worker *worker, struct delegpt *dp) |
print details on a delegation point | |
static void | print_dp_main (SSL *ssl, struct delegpt *dp, struct dns_msg *msg) |
print main dp info | |
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. |
This file contains functions to read and write the cache(s) to text format.
int dump_cache | ( | SSL * | ssl, | |
struct worker * | worker | |||
) |
Dump cache(s) to text.
ssl,: | to print to | |
worker,: | worker that is available (buffers, etc) and has ptrs to the caches. |
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.
ssl,: | to read from | |
worker,: | worker that is available (buffers, etc) and has ptrs to the caches. |
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.
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. |
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().