#include "config.h"
This file contains a module that uses an external database to cache dns responses.
struct lock_ref * dfs_next
during depthfirstsearch, this is a linked list of the stack of locks.
Definition: lock_verify.c:82
struct respip_set * respip_set
response-ip set with associated actions and tags.
Definition: daemon.h:132
int udp_upstream_without_downstream
udp upstream enabled when no UDP downstream is enabled (do_udp no)
Definition: config_file.h:99
#define EDNS_RCODE_BADVERS
error codes, extended with EDNS, so > 15.
Definition: msgparse.h:206
lock_quick_type lock
lock on structure data
Definition: tcp_conn_limit.h:71
int auth_zones_lookup(struct auth_zones *az, struct query_info *qinfo, struct regional *region, struct dns_msg **msg, int *fallback, uint8_t *dp_nm, size_t dp_nmlen)
Use auth zones to lookup the answer to a query.
Definition: authzone.c:3240
struct config_file * cfg
config file with config options
Definition: module.h:327
uint8_t * data
rdata, in wireformat of the key RR.
Definition: val_anchor.h:83
comm_point_callback_type * callback
callback when done.
Definition: netevent.h:313
void tube_remove_bg_listen(struct tube *tube)
Remove bg listen setup from event base.
Definition: tube.c:116
int fptr_whitelist_mod_init(int(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module init call values.
Definition: fptr_wlist.c:389
int sldns_str2wire_apl_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_APL from string to wireformat.
Definition: str2wire.c:1118
void iter_mark_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
Mark targets that result in a dependency cycle as done, so they will not get selected as targets.
Definition: iter_utils.c:694
const char * strextstate(enum module_ext_state s)
Debug utility: module external qstate to string.
Definition: module.c:45
lruhash_delkeyfunc_type delkeyfunc
how to delete keys.
Definition: lruhash.h:155
void comm_base_timept(struct comm_base *b, time_t **tt, struct timeval **tv)
Obtain two pointers.
Definition: fake_event.c:945
static void chunkline_newline_removal(sldns_buffer *buf)
remove newlines from collated line
Definition: authzone.c:4363
#define INET6_SIZE
byte size of ip6 address
Definition: net_help.h:90
void neg_cache_delete(struct val_neg_cache *neg)
Destroy negative cache.
Definition: val_neg.c:133
enum transport_type transport
by what transport was the query sent out
Definition: replay.h:354
void sock_list_insert(struct sock_list **list, struct sockaddr_storage *addr, socklen_t len, struct regional *region)
Insert new socket list item.
Definition: net_help.c:782
void lruhash_status(struct lruhash *table, const char *id, int extended)
Output debug info to the log as to state of the hash table.
Definition: lruhash.c:459
struct trust_anchor * anchors_lookup(struct val_anchors *anchors, uint8_t *qname, size_t qname_len, uint16_t qclass)
Given a qname/qclass combination, find the trust anchor closest above it.
Definition: val_anchor.c:1162
int start_step
time range when this is valid.
Definition: replay.h:248
uint8_t timeout_other
timeouts counter for others
Definition: infra.h:106
struct auth_master * scan_specific
once notified, or the timeout has been reached.
Definition: authzone.h:331
void ub_event_free(struct ub_event *)
free the event
Definition: ub_event.c:380
int http_in_chunk_headers
Currently reading in chunk headers, 0=not, 1=firstline, 2=unused (more lines), 3=trailer headers afte...
Definition: netevent.h:212
int tls_use_sni
if SNI will be used for TLS connections
Definition: outside_network.h:136
int mesh_state_add_cb(struct mesh_state *s, struct edns_data *edns, sldns_buffer *buf, mesh_cb_func_type cb, void *cb_arg, uint16_t qid, uint16_t qflags)
Create new callback structure and attach it to a mesh state.
Definition: mesh.c:1447
static int make_sock_port(int stype, const char *ifname, const char *port, struct addrinfo *hints, int v6only, int *noip6, size_t rcv, size_t snd, int *reuseport, int transparent, int tcp_mss, int freebind, int use_systemd, int dscp)
make socket and first see if ifname contains port override info
Definition: listen_dnsport.c:1059
#define FAKE_COMMPOINT_TYPECODE
unique code to check that fake_commpoint is that structure
Definition: fake_event.c:71
int local_data_cmp(const void *d1, const void *d2)
Compare two local_data entries in rbtree.
Definition: localzone.c:121
int addr_is_any(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is 0.0.0.0 or ::0.
Definition: net_help.c:767
void addrtree_insert(struct addrtree *tree, const addrkey_t *addr, addrlen_t sourcemask, addrlen_t scope, void *elem, time_t ttl, time_t now)
Insert an element in the tree.
Definition: addrtree.c:359
int set_auth_name_on_ssl(void *ssl, char *auth_name, int use_sni)
set auth name on SSL for verification
Definition: net_help.c:1263
struct val_neg_zone * parent
pointer to parent zone in the negative cache
Definition: val_neg.h:105
int codeline_cmp(const void *a, const void *b)
compare two codeline structs for rbtree from memstats test app
Definition: unbound-dnstap-socket.c:1580
struct trust_anchor * anchor_store_str(struct val_anchors *anchors, sldns_buffer *buffer, const char *str)
Store one string as trust anchor RR.
Definition: val_anchor.c:397
int inplace_cb_edns_back_parsed_call(struct module_env *env, struct module_qstate *qstate)
Call the registered functions in the inplace_cb_edns_back_parsed linked list.
Definition: msgreply.c:1116
An "object" comprising a user defined pluggable event.
Definition: unbound-event.h:166
struct comm_timer * stat_timer
timer for statistics
Definition: worker.h:106
list of sockets
Definition: unbound-dnstap-socket.c:133
int sldns_str2wire_eui64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_EUI64 from string to wireformat.
Definition: str2wire.c:1992
static void serviced_node_del(rbnode_type *node, void *ATTR_UNUSED(arg))
helper serviced delete
Definition: outside_network.c:886
struct auth_addr * list
if the host is a hostname, the list of resolved addrs, if any
Definition: authzone.h:451
struct auth_xfer * auth_xfer_find(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
find an xfer zone by name (exact match by name or NULL returned)
Definition: authzone.c:457
Local zone override information.
Definition: localzone.h:190
rbnode_type * rbtree_last(rbtree_type *rbtree)
Returns last (largest) node in the tree.
Definition: rbtree.c:558
int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_type fptr)
Check function pointer whitelist for lruhash sizefunc callback values.
Definition: fptr_wlist.c:249
void dns64_clear(struct module_qstate *qstate, int id)
dns64 cleanup query state
Definition: dns64.c:996
void config_collate_func(char *line, void *arg)
function to collate the text strings into a strlist_head.
Definition: config_file.c:762
static void validate_any_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey)
Given an "ANY" response – a response that contains an answer to a qtype==ANY question,...
Definition: validator.c:1125
static int pkt_sub(sldns_buffer *pkt, uint8_t *comprname, uint8_t *zone)
check subdomain with decompression
Definition: iter_scrub.c:321
void wsvc_remove(FILE *out)
Remove installed service from servicecontrolmanager, registry entries.
Definition: w_inst.c:249
INLINE void sldns_buffer_read(sldns_buffer *buffer, void *data, size_t count)
copies count bytes of data at the current position to the given data-array
Definition: sbuffer.h:613
struct ub_packed_rrset_key * packed_rrset_copy_alloc(struct ub_packed_rrset_key *key, struct alloc_cache *alloc, time_t now)
Allocate rrset with malloc (from region or you are holding the lock).
Definition: packed_rrset.c:365
int sockaddr_cmp(struct sockaddr_storage *addr1, socklen_t len1, struct sockaddr_storage *addr2, socklen_t len2)
Compare two sockaddrs.
Definition: net_help.c:596
struct comm_timer * timer
timeout callback for next_probe or expiry(if that is sooner).
Definition: authzone.h:295
void algo_needs_init_list(struct algo_needs *n, uint8_t *sigalg)
Initialize algo needs structure from a signalled algo list.
Definition: val_sigcrypt.c:410
static int addr_in_list(struct auth_addr *list, struct sockaddr_storage *addr, socklen_t addrlen)
see if addr appears in the list
Definition: authzone.c:3438
void val_neg_addreferral(struct val_neg_cache *neg, struct reply_info *rep, uint8_t *zone)
Insert NSECs from this referral into the negative cache for reference.
Definition: val_neg.c:1070
@ UB_LIBCMD_NEWQUERY
New query, sent to bg worker.
Definition: context.h:220
struct comm_point * comm_point_create_tcp(struct comm_base *base, int fd, int num, int idle_timeout, struct tcl_list *tcp_conn_limit, size_t bufsize, struct sldns_buffer *spoolbuf, comm_point_callback_type *callback, void *callback_arg)
Create a TCP listener comm point.
Definition: netevent.c:2728
void outside_network_quit_prepare(struct outside_network *outnet)
Prepare for quit.
Definition: outside_network.c:903
size_t unbound_mem_alloc
global debug value to keep track of total memory mallocs
Definition: alloc.c:365
void worker_sighandler(int sig, void *arg)
Worker signal handler function.
Definition: worker.c:1625
static int validate_msg_signatures(struct module_qstate *qstate, struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *key_entry)
Validate if the ANSWER and AUTHORITY sections contain valid rrsets.
Definition: validator.c:586
size_t rpz_action[UB_STATS_RPZ_ACTION_NUM]
(extended stats) type of applied RPZ action
Definition: mesh.h:132
int so_reuseport
SO_REUSEPORT requested on port 53 sockets.
Definition: config_file.h:188
@ VERB_ALGO
4 - algorithm level information
Definition: log.h:59
void * sslctx
ssl context to create ssl wrapped TCP with DNS connections
Definition: outside_network.h:134
int context_finalize(struct ub_ctx *ctx)
finalize a context.
Definition: context.c:56
rbtree_type tree
The zone rbtree.
Definition: val_neg.h:72
int anchor_cmp(const void *k1, const void *k2)
compare two trust anchors
Definition: val_anchor.c:60
time_t ub_packed_rrset_ttl(struct ub_packed_rrset_key *key)
Get TTL of rrset.
Definition: packed_rrset.c:318
int ub_ctx_add_ta_file(struct ub_ctx *ctx, const char *fname)
Add trust anchors to the given context.
Definition: libunbound.c:409
static void fatal_win(FILE *out, const char *str)
exit with windows error
Definition: w_inst.c:62
enum sec_status nsec3_prove_nxornodata(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, int *nodata)
Prove NXDOMAIN or NODATA.
Definition: val_nsec3.c:1406
int local_zone_cmp(const void *z1, const void *z2)
Compare two local_zone entries in rbtree.
Definition: localzone.c:105
static struct auth_data * az_find_wildcard(struct auth_zone *z, struct query_info *qinfo, struct auth_data *ce)
find wildcard between qname and cename
Definition: authzone.c:2166
char * cfg_ptr_reverse(char *str)
Convert a ptr shorthand into a full reverse-notation PTR record.
Definition: config_file.c:2239
size_t qlist_size
size of querylist
Definition: perf.c:119
int iter_dp_cangodown(struct query_info *qinfo, struct delegpt *dp)
See if delegpt can go down a step to the qname or not.
Definition: iter_utils.c:1377
static void perftestpkt(sldns_buffer *pkt, struct alloc_cache *alloc, sldns_buffer *out, const char *hex)
perf test a packet
Definition: unitmsgparse.c:200
size_t tcp_req_info_get_stream_buffer_size(void)
get the size of currently used tcp stream wait buffers (in bytes)
Definition: fake_event.c:1823
static void change_parent_ptr(rbtree_type *rbtree, rbnode_type *parent, rbnode_type *old, rbnode_type *new)
Update parent pointers of child trees of 'parent'.
Definition: rbtree.c:305
int instance
the instance number of creation
Definition: unbound-dnstap-socket.c:1565
@ comm_raw
raw - not DNS format - for pipe readers and writers
Definition: netevent.h:237
int lineno
some number that names this entry, line number in file or so
Definition: testpkts.h:217
int(* func_init_t)(struct module_env *, int)
Global state for the module.
Definition: dynlibmod.h:104
void comm_timer_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
void slabhash_traverse(struct slabhash *table, int wr, void(*func)(struct lruhash_entry *, void *), void *arg)
Traverse a slabhash.
Definition: slabhash.c:226
int py_mod_count
counter for python module instances incremented by pythonmod_init(...)
Definition: pythonmod.c:71
size_t ipset_get_mem(struct module_env *env, int id)
return memory estimate for ipset module
Definition: ipset.c:363
static void generate_a_aaaa_check(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Generate A and AAAA checks for glue that is in-zone for the referral we just got to obtain authoritat...
Definition: iterator.c:1022
int fptr_whitelist_tube_listen(tube_callback_type *fptr)
Check function pointer whitelist for tube listen handler values.
Definition: fptr_wlist.c:566
long long num_queries
number of queries from clients received.
Definition: unbound.h:665
int sldns_wire2str_edns_n3u_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS N3U option data to string.
Definition: wire2str.c:1847
int tcp_check_nb_connect
if set, checks for pending error from nonblocking connect() call.
Definition: netevent.h:264
int key_entry_isbad(struct key_entry_key *kkey)
See if this entry is bad.
Definition: val_kentry.c:234
sldns_rr_type sldns_get_rr_type_by_name(const char *name)
retrieves a rrtype by looking up its name.
Definition: rrdef.c:688
static void insert_can_owner(sldns_buffer *buf, struct ub_packed_rrset_key *k, uint8_t *sig, uint8_t **can_owner, size_t *can_owner_len)
Insert canonical owner name into buffer.
Definition: val_sigcrypt.c:922
int cfg_strlist_append_ex(struct config_strlist **head, char *item)
Searches the end of a string list and appends the given text.
Definition: config_file.c:1725
int taglist_intersect(uint8_t *list1, size_t list1len, const uint8_t *list2, size_t list2len)
see if two taglists intersect (have tags in common).
Definition: config_file.c:2015
@ LDNS_RDF_TYPE_TIME
time (32 bits)
Definition: rrdef.h:302
static int domain_has_only_nsec3(struct auth_data *n)
true if domain has only nsec3
Definition: authzone.c:2136
struct outbound_entry * worker_send_query(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q)
Worker service routine to send serviced queries to authoritative servers.
Definition: worker.c:1998
void wsvc_setup_worker(struct worker *worker)
Setup lead worker events.
Definition: win_svc.c:607
static struct view * view_create(char *name)
create a new view
Definition: view.c:104
int fd
fd of socket
Definition: unbound-dnstap-socket.c:143
static int http_read_more(int fd, struct comm_point *c)
read more data for http
Definition: netevent.c:1905
@ serviced_query_UDP_EDNS_fallback
probe to test noEDNS0 (EDNS gives FORMERRorNOTIMP)
Definition: outside_network.h:369
static void get_mesh_age(struct mesh_state *m, char *buf, size_t len, struct module_env *env)
get age for the mesh state
Definition: remote.c:2323
void ipset_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
Operate on an event on a query (in qstate).
Definition: ipset.c:288
int ecs_whitelist_check(struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *cbargs)
Whitelist check, called just before query is sent upstream.
int cfg_parse_memsize(const char *str, size_t *res)
Convert a 'nice' memory or file size into a bytecount From '100k' to 102400.
Definition: config_file.c:1868
struct module_func_block * dns64_get_funcblock(void)
Function for returning the above function block.
Definition: dns64.c:1030
static SSL_CTX * setup_ctx(char *key, char *cert)
setup SSL context
Definition: petal.c:233
static int sentinel_get_keytag(char *start, uint16_t *keytag)
Get keytag as uint16_t from string.
Definition: validator.c:503
int tcp_keepalive_timeout
tcp keepalive timeout, in msec
Definition: config_file.h:109
static int processDLVLookup(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
The DLVLookup state.
Definition: validator.c:2335
void alloc_special_release(struct alloc_cache *alloc, alloc_special_type *mem)
Return special_type back to pool.
Definition: alloc.c:279
int respip_views_apply_cfg(struct views *vs, struct config_file *cfg, int *have_view_respip_cfg)
Iterate through raw view data and apply the view-specific respip configuration; at this point we shou...
Definition: respip.c:417
int val_nsec_proves_name_error(struct ub_packed_rrset_key *nsec, uint8_t *qname)
Determine if the given NSEC proves a NameError (NXDOMAIN) for a given qname.
Definition: val_nsec.c:404
int ds_digest_algo_is_supported(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
See if DS digest algorithm is supported.
Definition: val_sigcrypt.c:359
enum ub_ctx_cmd context_serial_getcmd(uint8_t *p, uint32_t len)
Obtain command code from serialized buffer.
Definition: context.c:411
static char * macro_expand(rbtree_type *store, struct replay_runtime *runtime, char **text)
Expand a macro.
Definition: replay.c:792
int extstrtoaddr(const char *str, struct sockaddr_storage *addr, socklen_t *addrlen)
Convert address string, with "@port" appendix, to sockaddr.
Definition: net_help.c:224
static void dname_test_valid(void)
Test dname_valid.
Definition: unitdname.c:753
static void prealloc_blocks(struct alloc_cache *alloc, size_t num)
prealloc region blocks
Definition: alloc.c:86
size_t key_cache_get_mem(struct key_cache *kcache)
Get memory in use by the key cache.
Definition: val_kcache.c:157
void macro_store_delete(rbtree_type *store)
Delete variable storage.
Definition: replay.c:580
int forwards_apply_cfg(struct iter_forwards *fwd, struct config_file *cfg)
Process forwards config.
Definition: iter_fwd.c:325
static void remove_spurious_authority(struct reply_info *chase_reply, struct reply_info *orig_reply)
For messages that are not referrals, if the chase reply contains an unsigned NS record in the authori...
Definition: validator.c:730
@ worker_cmd_stats_noreset
obtain statistics without statsclear
Definition: worker.h:73
void tcp_req_info_remove_mesh_state(struct tcp_req_info *req, struct mesh_state *m)
Remove mesh state entry from list in tcp_req_info.
Definition: listen_dnsport.c:1656
const void * key
pointer to sorting key
Definition: rbtree.h:63
static void remove_rrset(const char *str, sldns_buffer *pkt, struct msg_parse *msg, struct rrset_parse *prev, struct rrset_parse **rrset)
remove rrset, update loop variables
Definition: iter_scrub.c:63
static void read_lock(rbtree_type *all, FILE *in, int val)
read lock entry
Definition: lock_verify.c:226
int modstack_config(struct module_stack *stack, const char *module_conf)
Read config file module settings and set up the modfunc block.
Definition: modstack.c:99
void msg_cache_remove(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags)
delete message from message cache
Definition: dns.c:115
void lruhash_setmarkdel(struct lruhash *table, lruhash_markdelfunc_type md)
Set the markdelfunction (or NULL)
Definition: lruhash.c:516
int fptr_whitelist_hash_compfunc(lruhash_compfunc_type fptr)
Check function pointer whitelist for lruhash compfunc callback values.
Definition: fptr_wlist.c:269
void * cb_arg
user argument for incoming query callback
Definition: replay.h:296
int for_upstream
for upstream: this zone answers queries that unbound intends to send upstream.
Definition: authzone.h:134
uint32_t serial
current serial (from SOA), if we have no zone, 0
Definition: authzone.h:256
void remote_get_opt_ssl(char *line, void *arg)
routine to printout option values over SSL
Definition: remote.c:2585
int enabled
true is cachedb is enabled, the backend is turned on
Definition: cachedb.h:52
void iter_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
iterator operate on a query
Definition: iterator.c:3867
static void testremove_unlim(struct lruhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitlruhash.c:326
void lru_touch(struct lruhash *table, struct lruhash_entry *entry)
Touch entry, so it becomes the most recently used in the LRU list.
Definition: lruhash.c:288
struct dt_msg_queue * dt_msg_queue_create(void)
Create new (empty) worker message queue.
Definition: dtstream.c:102
struct comm_base * base
the communication base
Definition: netevent.h:337
INLINE uint8_t * sldns_buffer_current(sldns_buffer *buffer)
returns a pointer to the data at the buffer's current position.
Definition: sbuffer.h:367
static struct auth_rrset * az_find_nsec_cover(struct auth_zone *z, struct auth_data **node)
find NSEC record covering the query
Definition: authzone.c:2528
int val_favorite_ds_algo(struct ub_packed_rrset_key *ds_rrset)
Return algo number for favorite (best) algorithm that we support in DS.
Definition: val_utils.c:465
static int read_ssl_line(SSL *ssl, char *buf, size_t len)
Read one line from SSL zero terminates.
Definition: unbound-anchor.c:888
static struct ub_packed_rrset_key * find_closest_of_type(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qclass, time_t now, uint16_t searchtype, int stripfront)
find closest NS or DNAME and returns the rrset (locked)
Definition: dns.c:199
void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void *arg)
callback for the dnstap events, to write to the output
Definition: dtstream.c:1395
struct slabhash * slabhash_create(size_t numtables, size_t start_size, size_t maxmem, lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, lruhash_deldatafunc_type deldatafunc, void *arg)
Create new slabbed hash table.
Definition: slabhash.c:48
int sldns_wire2str_ilnp64_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat ILNP64 field to string, with user buffers.
Definition: wire2str.c:1653
int nsec3_hash
if 0: NSEC zone, else NSEC3 hash algorithm in use
Definition: val_neg.h:113
int sldns_wire2str_dname_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat domain name to string, with user buffers.
Definition: wire2str.c:781
@ VERB_DETAIL
2 - detailed information
Definition: log.h:55
static void check_lru(struct val_neg_cache *neg)
check if lru is still valid
Definition: unitneg.c:336
static int read_acl_view(struct acl_list *acl, struct config_file *cfg, struct views *v)
read acl view config
Definition: acl_list.c:368
uint16_t rrset_type
DNS RR type of the rrset data (host order)
Definition: val_kentry.h:86
size_t tcl_list_get_mem(struct tcl_list *tcl)
Get memory used by TCP connection limit structure.
Definition: tcp_conn_limit.c:190
#define URLNAME
name of server in URL to fetch HTTPS from
Definition: unbound-anchor.c:143
const char * ub_strerror(int err)
Convert error value to a human readable string.
Definition: libunbound.c:888
static struct trust_anchor * load_trustanchor(struct val_anchors *anchors, char *str, const char *fname, uint8_t *origin, size_t origin_len, uint8_t **prev, size_t *prev_len, int *skip)
Load single anchor.
Definition: autotrust.c:525
#define MAX_ADDR_STRLEN
max length of an IP address (the address portion) that we allow
Definition: net_help.c:66
int LOG_TAG_QUERYREPLY
log tag queries with name instead of 'info' for filtering
Definition: net_help.c:77
int sldns_wire2str_int32_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat int32 field to string, with user buffers.
Definition: wire2str.c:1047
sldns_lookup_table * sldns_tsig_errors
tsig errors are the rcodes with extra (higher) values
Definition: wire2str.c:197
List head for strlist processing, used for append operation.
Definition: config_file.h:57
Used during options parsing.
Definition: config_file.h:1201
uint8_t * name
name; the key
Definition: val_neg.h:98
void iter_mark_pside_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
Mark targets that result in a dependency cycle as done, so they will not get selected as targets.
Definition: iter_utils.c:716
struct fake_timer * next
next in list
Definition: replay.h:381
int local_zone_enter_rr(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs, uint16_t rrtype, uint16_t rrclass, time_t ttl, uint8_t *rdata, size_t rdata_len, const char *rrstr)
Add RR to local zone.
Definition: localzone.c:467
uint16_t flags
flags from message, host format.
Definition: msgparse.h:99
int mesh_detect_cycle(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec)
Find cycle; see if the given mesh is in the targets sub, or sub-sub, ...
Definition: mesh.c:1784
static int ssl_http_read_more(struct comm_point *c)
read more data for http (with ssl)
Definition: netevent.c:1864
void val_deinit(struct module_env *env, int id)
validator deinit
Definition: validator.c:193
static int generate_target_query(struct module_qstate *qstate, struct iter_qstate *iq, int id, uint8_t *name, size_t namelen, uint16_t qtype, uint16_t qclass)
Given a basic query, generate a "target" query.
Definition: iterator.c:1775
void tcp_req_info_handle_writedone(struct tcp_req_info *req)
Handle write done of the last result packet.
Definition: listen_dnsport.c:1783
int sldns_wire2str_apl_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat apl field to string, with user buffers.
Definition: wire2str.c:1155
void dns64_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
This is the module's main() function.
Definition: dns64.c:670
int iter_qname_indicates_dnssec(struct module_env *env, struct query_info *qinfo)
See if qname has DNSSEC needs.
Definition: iter_utils.c:778
static int sub_of_pkt(sldns_buffer *pkt, uint8_t *zone, uint8_t *comprname)
check subdomain with decompression, compressed is parent
Definition: iter_scrub.c:330
int ub_ctx_set_tls(struct ub_ctx *ctx, int tls)
Use DNS over TLS to send queries to machines set with ub_ctx_set_fwd().
Definition: libunbound.c:977
const char * name
text string name of module
Definition: module.h:673
struct ub_randstate * rand
master random table ; used for port div between threads on reload
Definition: daemon.h:107
struct tap_socket * s
the socket
Definition: unbound-dnstap-socket.c:137
enum dns64_state state
State of the DNS64 module.
Definition: dns64.c:89
uint8_t match_qtype
match qtype with answer qtype
Definition: testpkts.h:172
int reply_check_cname_chain(struct query_info *qinfo, struct reply_info *rep)
Check if cname chain in cached reply is still valid.
Definition: msgreply.c:890
struct listen_port * daemon_remote_open_ports(struct config_file *cfg)
Open and create listening ports for remote control.
Definition: remote.c:365
static int load_ref(RES *ssl, sldns_buffer *buf, struct worker *worker, struct regional *region, struct ub_packed_rrset_key **rrset, int *go_on)
load a msg rrset reference
Definition: cachedump.c:578
RTT information.
Definition: rtt.h:49
int delegpt_set_name(struct delegpt *dp, struct regional *region, uint8_t *name)
Set name of delegation point.
Definition: iter_delegpt.c:94
#define LOG_CRIT
define LOG_ constants
Definition: log.c:52
void anchors_test(void)
unit test trust anchor storage functions
Definition: unitanchor.c:125
@ QUERY_RESP_STATE
Responses to queries start at this state.
Definition: iterator.h:201
ECS option.
Definition: edns-subnet.h:52
struct autr_ta * next
next key
Definition: autotrust.h:69
int event_added
the event is added
Definition: dtstream.h:141
int comm_point_send_udp_msg(struct comm_point *c, struct sldns_buffer *packet, struct sockaddr *addr, socklen_t addrlen)
Send an udp message over a commpoint.
Definition: fake_event.c:1734
struct comm_point * comm_point_create_tcp_out(struct comm_base *base, size_t bufsize, comm_point_callback_type *callback, void *callback_arg)
Create an outgoing TCP commpoint.
Definition: netevent.c:2809
static int canonical_compare(struct ub_packed_rrset_key *rrset, size_t i, size_t j)
Compare two RRs in the same RRset and determine their relative canonical order.
Definition: val_sigcrypt.c:797
static uint8_t * nsec3_ce_wildcard(struct regional *region, uint8_t *ce, size_t celen, size_t *len)
allocate a wildcard for the closest encloser
Definition: val_nsec3.c:1002
uint8_t * zone
Zone name, only NSEC3 records for this zone are considered.
Definition: val_nsec3.c:99
#define MAX_CNAME_CHAIN
max number of CNAMEs we are willing to follow (in one answer)
Definition: authzone.c:76
int sldns_str2wire_long_str_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_LONG_STR from string to wireformat.
Definition: str2wire.c:2034
int mesh_state_compare(const void *ap, const void *bp)
compare two mesh_states
Definition: mesh.c:196
sldns_lookup_table * sldns_lookup_by_id(sldns_lookup_table table[], int id)
Looks up the table entry by id, returns NULL if not found.
@ LDNS_RR_TYPE_DS
RFC4034, RFC3658.
Definition: rrdef.h:169
enum minimisation_state caps_minimisation_state
State for capsfail: QNAME minimisation state for comparisons.
Definition: iterator.h:385
size_t low
low mark, items start here
Definition: delayer.c:68
static void send_em(const char *svr, int udp, int usessl, int noanswer, int onarrival, int delay, int num, char **qs)
send the TCP queries and print answers
Definition: streamtcp.c:329
static void xml_append_str(BIO *b, const char *s)
Append str to bio.
Definition: unbound-anchor.c:1462
int infra_find_ratelimit(struct infra_cache *infra, uint8_t *name, size_t namelen)
find the ratelimit in qps for a domain.
Definition: infra.c:752
int mesh_add_sub(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub)
Add detached query.
Definition: mesh.c:1001
const char * answer
expected answer to check against, multi-line string
Definition: unitauth.c:64
void dynlibmod_clear(struct module_qstate *qstate, int id)
dynlib module cleanup query state
Definition: dynlibmod.c:194
void listen_delete(struct listen_dnsport *listen)
delete the listening structure
Definition: listen_dnsport.c:1423
struct delegpt_addr * target_list
the target addresses for delegation
Definition: iter_delegpt.h:68
int fd
file descriptor for plain transfer
Definition: remote.h:117
size_t num_reg_blocks
how many regional blocks are kept now
Definition: alloc.h:95
int fwd_cmp(const void *k1, const void *k2)
compare two fwd entries
Definition: iter_fwd.c:53
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.
RES * ssl
the SSL connection
Definition: remote.c:2435
size_t qlist_idx
index into querylist, for walking the list
Definition: perf.c:127
Definition: unitmain.c:706
struct comm_timer super
the super struct from which derived
Definition: netevent.c:132
static int ptr_to_ipv6(const char *ptr, uint8_t ipv6[], size_t ipv6_len)
Converts an IPv6-related domain name string from a PTR query into an IPv6 address represented as a 12...
Definition: dns64.c:256
int sldns_wire2str_pkt_buf(uint8_t *d, size_t dlen, char *s, size_t slen)
Convert wireformat packet to a string representation with user buffer It appends every RR with defaul...
Definition: wire2str.c:247
Views storage, shared.
Definition: view.h:56
size_t numreuse
how many times repurposed
Definition: delayer.c:92
int pythonmod_init(struct module_env *env, int id)
python module init
Definition: pythonmod.c:250
@ INIT_MINIMISE_STATE
(Re)start minimisation.
Definition: iterator.h:152
Storage for algorithm needs.
Definition: val_sigcrypt.h:62
static int rrinternal_parse_rdata(sldns_buffer *strbuf, char *token, size_t token_len, uint8_t *rr, size_t *rr_len, size_t dname_len, uint16_t rr_type, uint8_t *origin, size_t origin_len)
parse rdata from string into rr buffer(-remainder after dname).
Definition: str2wire.c:620
int auth_xfer_transfer_tcp_callback(struct comm_point *c, void *arg, int err, struct comm_reply *ATTR_UNUSED(repinfo))
callback for task_transfer tcp connections
Definition: authzone.c:5824
int delegpt_add_rrset_AAAA(struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
Add AAAA RRset to delegpt.
Definition: iter_delegpt.c:445
int sldns_wire2str_edns_dhu_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS DHU option data to string.
Definition: wire2str.c:1832
struct pending * pending_udp_query(struct serviced_query *sq, struct sldns_buffer *packet, int timeout, comm_point_callback_type *callback, void *callback_arg)
Send UDP query, create pending answer.
Definition: outside_network.c:1239
sldns_lookup_table * sldns_hashes
DS record hash algorithms.
Definition: wire2str.c:68
size_t ratelimit_size
memory size in bytes for ratelimit cache
Definition: config_file.h:539
static void burden_test(size_t max)
put random stuff in a region and free it
Definition: unitregional.c:217
void log_edns_known_options(enum verbosity_value level, struct module_env *env)
Log the known edns options.
Definition: module.c:220
int argc
size of array to query
Definition: asynclook.c:180
int iter_init(struct module_env *env, int id)
iterator init
Definition: iterator.c:78
struct autr_global_data * autr_global_create(void)
Create new global 5011 data structure.
Definition: autotrust.c:74
int modstack_find(struct module_stack *stack, const char *name)
Find index of module by name.
Definition: modstack.c:261
int log_tag_queryreply
tag log_queries and log_replies for filtering
Definition: config_file.h:304
static int query_for_targets(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id, int maxtargets, int *num)
Given an event at a certain state, generate zero or more target queries for it's current delegation p...
Definition: iterator.c:1801
void iter_store_parentside_neg(struct module_env *env, struct query_info *qinfo, struct reply_info *rep)
Store parent-side negative element, the parentside rrset does not exist, creates an rrset with empty ...
Definition: iter_utils.c:1107
struct timeval time_boot
time when daemon started
Definition: daemon.h:123
static int msg_add_rrset_ns(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node, struct auth_rrset *rrset)
add rrset to authority section (no additonal section rrsets yet)
Definition: authzone.c:244
int id
module id
Definition: module.h:234
static void clean_node(struct addrtree *tree, struct addrnode *node)
Scrub a node clean of elem.
Definition: addrtree.c:153
static int check_data(const char *data, const struct config_strlist *head)
check wire data parse
Definition: acl_list.c:232
int auth_zone_set_zonefile(struct auth_zone *z, char *zonefile)
set auth zone zonefile string.
Definition: authzone.c:555
struct key_entry_key * val_verify_new_DNSKEYs(struct regional *region, struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ds_rrset, int downprot, char **reason, struct module_qstate *qstate)
Verify new DNSKEYs with DS rrset.
Definition: val_utils.c:559
static struct order_lock * insert_lock(rbtree_type *all, struct order_id *id)
insert lock entry (empty) into list
Definition: lock_verify.c:213
module_ev
Events that happen to modules, that start or wakeup modules.
Definition: module.h:553
static int error_response(struct module_qstate *qstate, int id, int rcode)
Return an error to the client.
Definition: iterator.c:277
static void do_proxy(struct proxy *p, int retsock, sldns_buffer *pkt)
do proxy for one readable client
Definition: delayer.c:390
int sldns_wire2str_dname_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat domain name to string, with user buffers.
Definition: wire2str.c:781
struct ub_packed_rrset_key * rrset
rrset
Definition: iterator.h:418
struct comm_base * base
the event base this worker works with
Definition: worker.h:92
void config_delstub(struct config_stub *p)
Delete a stub item.
Definition: config_file.c:1350
struct comm_point * c
the commpoint
Definition: remote.h:69
struct rrset_parse * rrset_last
last element of rrset list.
Definition: msgparse.h:135
int sldns_str2wire_alg_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ALG from string to wireformat.
Definition: str2wire.c:1386
size_t alloc_get_mem(struct alloc_cache *alloc)
Get memory size of alloc cache, alloc structure including special types.
Definition: alloc.c:310
lruhash_deldatafunc_type deldatafunc
how to delete data.
Definition: lruhash.h:157
size_t rrset_count
total number of rrsets found.
Definition: msgparse.h:115
struct internal_event * ev
behind the scenes structure, with say libevent info.
Definition: netevent.h:157
size_t key_entry_keysize(struct key_entry_key *kkey)
Get keysize of the keyentry.
Definition: val_kentry.c:397
uint8_t * dname_get_shared_topdomain(uint8_t *d1, uint8_t *d2)
Get the shared topdomain between two names.
Definition: dname.c:872
static void check_args_for_listcmd(int argc, char *argv[])
check args, to see if too many args.
Definition: unbound-control.c:717
static void dname_test_pdtl(sldns_buffer *loopbuf, sldns_buffer *boundbuf)
test pkt_dname_tolower
Definition: unitdname.c:827
A user defined pluggable event base is registered by providing a ub_event_base "object" with the ub_c...
Definition: unbound-event.h:115
int sldns_wire2str_class_buf(uint16_t rrclass, char *str, size_t len)
Convert wire RR class to a string, 'IN', 'CLASS12'.
Definition: wire2str.c:293
int ub_event_del(struct ub_event *ev)
Deactivate the event.
Definition: ub_event_pluggable.c:596
rbtree_type * rbtree_create(int(*cmpf)(const void *, const void *))
Create new tree (malloced) with given key compare function.
Definition: rbtree.c:78
@ UB_NOID
error async_id does not exist or result already been delivered
Definition: context.h:205
uint16_t chase_flags
query flags to use when chasing the answer (i.e.
Definition: iterator.h:274
void libworker_enter_result(struct ub_result *res, sldns_buffer *buf, struct regional *temp, enum sec_status msg_security)
fill result from parsed message, on error fills servfail
Definition: libworker.c:495
int delegpt_add_rrset_A(struct delegpt *dp, struct regional *region, struct ub_packed_rrset_key *ak, uint8_t lame, int *additions)
Add A RRset to delegpt.
Definition: iter_delegpt.c:421
static void xfr_note_notify_serial(struct auth_xfer *xfr, int has_serial, uint32_t serial)
note notify serial, updates the notify information in the xfr struct
Definition: authzone.c:3519
void log_thread_set(int *num)
Init a thread (will print this number for the thread log entries).
Definition: log.c:167
@ LDNS_RR_TYPE_TA
DNSSEC Trust Authorities.
Definition: rrdef.h:230
int sldns_wire2str_rr_comment_print(char **s, size_t *slen, uint8_t *rr, size_t rrlen, size_t dname_off, uint16_t rrtype)
Print to string the RR-information comment in default format, with user buffers.
Definition: wire2str.c:650
size_t dynlibmod_get_mem(struct module_env *env, int id)
dynlib module alloc size routine
Definition: dynlibmod.c:201
static void validate_cname_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey)
Validate CNAME response, or DNAME+CNAME.
Definition: validator.c:1236
static int processInitRequest2(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Process the second part of the initial request handling.
Definition: iterator.c:1609
size_t unwanted_replies
number of unwanted replies received (for statistics)
Definition: outside_network.h:90
const char * sec_status_to_string(enum sec_status s)
Get a printable string for a security status value.
Definition: packed_rrset.c:250
static void testremove(struct lruhash *table, testdata_type *ref[])
test adding a random element
Definition: unitlruhash.c:247
struct val_neg_data * next
next in LRU (next element was less recently used)
Definition: val_neg.h:166
void config_apply(struct config_file *config)
Apply config to global constants; this routine is called in single thread.
Definition: config_file.c:2029
void dynlibmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
dynlib module operate on a query
Definition: dynlibmod.c:178
int comm_signal_bind(struct comm_signal *comsig, int sig)
Bind signal struct to catch a signal.
Definition: netevent.c:3398
static void mesh_delete_helper(rbnode_type *n)
help mesh delete delete mesh states
Definition: mesh.c:279
int rtt_notimeout(const struct rtt_info *rtt)
RTT for valid responses.
Definition: rtt.c:119
int serviced_udp_callback(struct comm_point *c, void *arg, int error, struct comm_reply *rep)
callback for serviced query UDP answers
Definition: outside_network.c:1969
void autr_point_delete(struct trust_anchor *tp)
Delete autr anchor, deletes the autr data but does not do unlinking from trees, caller does that.
Definition: autotrust.c:390
ub_thread_type id
id
Definition: unitslabhash.c:304
char * fstrm_describe_control(void *pkt, size_t len)
Return string that describes a control packet.
Definition: dnstap_fstrm.c:173
void tube_close_write(struct tube *tube)
Close write part of the pipe.
Definition: tube.c:108
int dname_buffer_write(sldns_buffer *pkt, uint8_t *dname)
Copy over a valid dname to a packet.
Definition: dname.c:620
int sldns_wire2str_period_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat period field to string, with user buffers.
Definition: wire2str.c:1057
struct key_cache * key_cache_create(struct config_file *cfg)
Create the key cache.
Definition: val_kcache.c:50
int ip_dscp
IP_TOS socket option requested on the sockets.
Definition: outside_network.h:144
INLINE uint8_t * sldns_buffer_at(const sldns_buffer *buffer, size_t at)
returns a pointer to the data at the indicated position.
Definition: sbuffer.h:331
enum serviced_query::serviced_query_status status
variable with current status
int sldns_str2wire_loc_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_LOC from string to wireformat.
Definition: str2wire.c:1524
struct sockaddr_storage addr
remote address.
Definition: outside_network.h:225
uint8_t max_scope
longest received scope mask since track_max_scope is set.
Definition: subnetmod.h:92
static void rrset_update_id(struct rrset_ref *ref, struct alloc_cache *alloc)
Update RRSet special key ID.
Definition: rrset.c:170
static void daemon_setup_modules(struct daemon *daemon)
Setup modules.
Definition: daemon.c:372
int sldns_str2wire_b64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_B64 from string to wireformat.
Definition: str2wire.c:1205
static void do_lookup(RES *ssl, struct worker *worker, char *arg)
cache lookup of nameservers
Definition: remote.c:1530
struct mesh_state * forever_first
double linked list of the run-to-completion query states.
Definition: mesh.h:140
static size_t ds_digest_size_algo(struct ub_packed_rrset_key *k, size_t idx)
Return size of DS digest according to its hash algorithm.
Definition: val_sigcrypt.c:272
int started_no_cache_store
has the subnet module been started with no_cache_store?
Definition: subnetmod.h:94
uint8_t * item
the data item
Definition: delayer.c:102
@ LDNS_RR_TYPE_EID
draft-ietf-nimrod-dns-01.txt
Definition: rrdef.h:145
int sldns_wire2str_edns_llq_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS LLQ option data to string.
Definition: wire2str.c:1738
char * dnstap_socket_path
dnstap socket path
Definition: config_file.h:487
struct packed_rrset_data * data
RRset data item.
Definition: authzone.h:177
time_t now
the time now
Definition: remote.c:2437
void libworker_bg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with bg results
Definition: libworker.c:762
@ LDNS_RDF_TYPE_PERIOD
period
Definition: rrdef.h:304
static int xfr_probe_end_of_list(struct auth_xfer *xfr)
true if at end of list, task_probe
Definition: authzone.c:3892
long long qclass_big
bigger qclass values not in array
Definition: unbound.h:691
size_t numreturn
numberof answers returned to client (in total)
Definition: delayer.c:90
int hints_next_root(struct iter_hints *hints, uint16_t *qclass)
Find next root hints (to cycle through all root hints).
Definition: iter_hints.c:508
size_t ecs_whitelist_get_mem(struct ecs_whitelist *whitelist)
Get memory used by ecs_whitelist structure.
void anchors_delete_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
Delete insecure point trust anchor.
Definition: val_anchor.c:1241
static void usage(void)
print usage and exit
Definition: signit.c:66
Data structure to help domain name compression in outgoing messages.
Definition: msgencode.c:77
struct val_neg_zone * neg_find_zone(struct val_neg_cache *neg, uint8_t *nm, size_t len, uint16_t dclass)
Find the given zone, from the SOA owner name and class Does not do locking.
Definition: val_neg.c:280
int val_chase_cname(struct query_info *qchase, struct reply_info *rep, size_t *cname_skip)
Chase the cname to the next query name.
Definition: val_utils.c:811
@ LDNS_RDF_TYPE_INT16
16 bits
Definition: rrdef.h:272
int ub_ctx_add_ta_autr(struct ub_ctx *ctx, const char *fname)
Add trust anchor to the given context that is tracked with RFC5011 automated trust anchor maintenance...
Definition: libunbound.c:427
int cache_fill_missing(struct module_env *env, uint16_t qclass, struct regional *region, struct delegpt *dp)
find and add A and AAAA records for missing nameservers in delegpt
Definition: dns.c:319
struct config_strlist * allow_notify
list of allow-notify
Definition: config_file.h:664
uint8_t prev_rr[LDNS_MAX_DOMAINLEN+1]
the previous domain name, if len!=0.
Definition: str2wire.h:224
static int parse_chunk_header(char *buf, size_t *result)
parse chunk header
Definition: unbound-anchor.c:977
int edns_register_option(uint16_t opt_code, int bypass_cache_stage, int no_aggregation, struct module_env *env)
Register a known edns option.
Definition: module.c:93
int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_type fptr)
Check function pointer whitelist for lruhash markdel callback values.
Definition: fptr_wlist.c:322
int main(int argc, char *argv[])
main program.
Definition: unbound.c:718
struct replay_scenario * replay_scenario_read(FILE *in, const char *name, int *lineno)
Read a replay scenario from the file.
Definition: replay.c:439
void * cb_arg
callback user argument
Definition: netevent.h:329
uint8_t * name
domain name
Definition: localzone.h:167
static int is_caps_whitelisted(struct iter_env *ie, struct iter_qstate *iq)
see if target name is caps-for-id whitelisted
Definition: iterator.c:619
@ LDNS_RR_CLASS_NONE
None class, dynamic update.
Definition: rrdef.h:58
void listening_ports_free(struct listen_port *list)
Close and delete the (list of) listening ports.
Definition: listen_dnsport.c:1535
struct dt_io_thread * dt_io_thread_create(void)
Create IO thread.
Definition: dtstream.c:228
int qps[RATE_WINDOW]
queries counted, for that second.
Definition: infra.h:179
void anchors_delete(struct val_anchors *anchors)
Delete trust anchor storage.
Definition: val_anchor.c:140
static void autr_rrset_delete(struct ub_packed_rrset_key *r)
delete assembled rrsets
Definition: autotrust.c:381
struct pending * pending_udp_query(struct serviced_query *sq, sldns_buffer *packet, int timeout, comm_point_callback_type *callback, void *callback_arg)
Send UDP query, create pending answer.
Definition: fake_event.c:1076
static struct ub_packed_rrset_key * copy_rrset(const struct ub_packed_rrset_key *key, struct regional *region)
make a deep copy of 'key' in 'region'.
Definition: respip.c:487
keeping track of the async ids
Definition: asynclook.c:70
int sldns_wire2str_ttl_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat rr ttl to string, with user buffers.
Definition: wire2str.c:932
static int iter_filter_order(struct iter_env *iter_env, struct module_env *env, uint8_t *name, size_t namelen, uint16_t qtype, time_t now, struct delegpt *dp, int *selected_rtt, int open_target, struct sock_list *blacklist, time_t prefetch)
filter the address list, putting best targets at front, returns number of best targets (or 0,...
Definition: iter_utils.c:362
static void entry_to_buf(struct entry *e, sldns_buffer *pkt)
entry to packet buffer with wireformat
Definition: unitverify.c:69
#define HASHTESTMAX
number of hash test max
Definition: unitlruhash.c:231
int do_tcp
do tcp query support.
Definition: config_file.h:95
size_t rrset_count
number of RRsets: an_numrrsets + ns_numrrsets + ar_numrrsets
Definition: msgreply.h:184
void(* free)(struct ub_event_base *)
Destructor for the ub_event_base object, (not called by libunbound)
Definition: unbound-event.h:90
int sldns_str2wire_rr_question_buf(const char *str, uint8_t *rr, size_t *len, size_t *dname_len, uint8_t *origin, size_t origin_len, uint8_t *prev, size_t prev_len)
Same as sldns_str2wire_rr_buf, but there is no rdata, it returns an RR with zero rdata and no ttl.
Definition: str2wire.c:790
struct config_stub * next
next in list
Definition: config_file.h:634
static void negative_del_kcache(struct lruhash_entry *e, void *arg)
callback to delete negative key entries
Definition: remote.c:1874
struct config_strlist * first
first in list of text items
Definition: config_file.h:59
static int verb
verbosity for this application
Definition: petal.c:69
int ub_ctx_zone_add(struct ub_ctx *ctx, const char *zone_name, const char *zone_type)
Add a new zone with the zonetype to the local authority info of the library.
Definition: libunbound.c:1285
size_t tcp_byte_count
The current read/write count for TCP.
Definition: netevent.h:172
static int dtio_open_output_tcp(struct dt_io_thread *dtio)
open the output file descriptor for af_inet and af_inet6
Definition: dtstream.c:1894
struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
The function interprets time as the number of seconds since epoch with respect to now using serial ar...
Definition: parseutil.c:175
int fptr_whitelist_stop_accept(void(*fptr)(void *))
Check function pointer whitelist for stop_accept callback values.
Definition: fptr_wlist.c:157
struct ub_packed_rrset_key * packed_rrset_copy_alloc(struct ub_packed_rrset_key *key, struct alloc_cache *alloc, time_t now)
Allocate rrset with malloc (from region or you are holding the lock).
Definition: packed_rrset.c:365
Per query state for the iterator module.
Definition: pythonmod.c:109
static struct auth_master * xfr_transfer_current_master(struct auth_xfer *xfr)
pick up the master that is being scanned right now, task_transfer
Definition: authzone.c:3866
void algo_needs_init_list(struct algo_needs *n, uint8_t *sigalg)
Initialize algo needs structure from a signalled algo list.
Definition: val_sigcrypt.c:410
int create_local_accept_sock(const char *path, int *noproto, int use_systemd)
Create and bind local listening socket.
Definition: listen_dnsport.c:927
int infra_compfunc(void *key1, void *key2)
compare two addresses, returns -1, 0, or +1
Definition: infra.c:79
static void portcomm_loweruse(struct outside_network *outnet, struct port_comm *pc)
lower use count on pc, see if it can be closed
Definition: outside_network.c:487
@ local_zone_refuse
answer with error
Definition: localzone.h:71
void cachedb_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
Operate on an event on a query (in qstate).
void respip_sockaddr_delete(struct respip_set *set, struct resp_addr *node)
Delete resp_addr node from tree.
Definition: respip.c:127
int rate_compfunc(void *key1, void *key2)
compare two names, returns -1, 0, or +1
Definition: infra.c:121
void pending_udp_timer_delay_cb(void *arg)
callback for udp delay for timeout
Definition: outside_network.c:649
static uint32_t pkt_rrset_flags(sldns_buffer *pkt, uint16_t type, sldns_pkt_section sec)
Calculate rrset flags.
Definition: msgparse.c:155
void rpz_finish_config(struct rpz *r)
Prepare RPZ after procesing feed content.
Definition: rpz.c:328
static void xfr_nextprobe_disown(struct auth_xfer *xfr)
disown task_nextprobe.
Definition: authzone.c:6466
static void error_supers(struct module_qstate *qstate, int id, struct module_qstate *super)
Callback routine to handle errors in parent query states.
Definition: iterator.c:225
void hints_delete(struct iter_hints *hints)
Delete hints.
Definition: iter_hints.c:82
int dlv_checked
have we already checked the DLV?
Definition: validator.h:222
static void libworker_delete(struct libworker *w)
delete libworker struct
Definition: libworker.c:112
int dns64_init(struct module_env *env, int id)
Initializes this instance of the dns64 module.
Definition: dns64.c:397
void mesh_query_done(struct mesh_state *mstate)
Query state is done, send messages to reply entries.
Definition: mesh.c:1297
int tube_setup_bg_write(struct tube *tube, struct comm_base *base)
Start background write handler for the pipe.
Definition: tube.c:443
int enabled
if timer is enabled
Definition: replay.h:389
static void neg_clear_zones(rbnode_type *n, void *ATTR_UNUSED(arg))
clear zones on cache deletion
Definition: val_neg.c:123
struct internal_base * eb
behind the scenes structure.
Definition: netevent.h:99
int val_rrset_wildcard(struct ub_packed_rrset_key *rrset, uint8_t **wc, size_t *wc_len)
Determine by looking at a signed RRset whether or not the RRset name was the result of a wildcard exp...
Definition: val_utils.c:770
struct infra_cache * infra_create(struct config_file *cfg)
Create infra cache.
Definition: infra.c:233
int tube_setup_bg_listen(struct tube *tube, struct comm_base *base, tube_callback_type *cb, void *arg)
Start listening for information over the pipe.
Definition: tube.c:428
void test_slabhash_deldata(void *, void *)
test deldata for lruhash
static SSL * TLS_initiate(SSL_CTX *sslctx, int fd, const char *urlname, int use_sni)
initiate TLS on a connection
Definition: unbound-anchor.c:774
struct val_neg_data * first
the first in linked list of LRU of val_neg_data
Definition: val_neg.h:74
sldns_rr_type sldns_get_rr_type_by_name(const char *name)
retrieves a rrtype by looking up its name.
Definition: rrdef.c:688
int * outgoing_avail_ports
allowed udp port numbers, array with 0 if not allowed
Definition: config_file.h:141
int cfg_strlist_insert(struct config_strlist **head, char *item)
Insert string into strlist.
Definition: config_file.c:1706
static int memcanoncmp(uint8_t *p1, uint8_t len1, uint8_t *p2, uint8_t len2)
Compare labels in memory, lowercase while comparing.
Definition: dname.c:786
struct module_func_block * dynlibmod_get_funcblock(void)
Get the module function block.
Definition: dynlibmod.c:298
int parse_copy_decompress_rrset(sldns_buffer *pkt, struct msg_parse *msg, struct rrset_parse *pset, struct regional *region, struct ub_packed_rrset_key *pk)
Copy a parsed rrset into given key, decompressing and allocating rdata.
Definition: msgreply.c:375
List of proxy fds that return replies from the server to our clients.
Definition: delayer.c:76
static void neg_delete_zone(struct val_neg_cache *neg, struct val_neg_zone *z)
Delete a zone element from the negative cache.
Definition: val_neg.c:197
size_t msg_len
resulting message length.
Definition: context.h:168
int priv_rrset_bad(struct iter_priv *priv, struct sldns_buffer *pkt, struct rrset_parse *rrset)
See if rrset is bad.
Definition: iter_priv.c:232
int sldns_wire2str_unknown_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat type unknown field to string, with user buffers.
Definition: wire2str.c:1342
uint8_t * pkt
The query itself, the query packet to send.
Definition: outside_network.h:290
void daemon_remote_delete(struct daemon_remote *rc)
remote control state to delete.
Definition: remote.c:253
static int serviced_udp_send(struct serviced_query *sq, sldns_buffer *buff)
Perform serviced query UDP sending operation.
Definition: outside_network.c:1631
struct addrnode * node
child node this edge is connected to
Definition: addrtree.h:114
struct local_zone * local_zones_lookup(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, uint16_t dtype)
Lookup zone that contains the given name, class.
Definition: localzone.c:1087
void comm_point_close(struct comm_point *c)
Close a comm point fd.
Definition: netevent.c:3070
struct config_strlist * last
last in list of text items
Definition: config_file.h:61
struct waiting_tcp * pending_tcp_query(struct serviced_query *sq, sldns_buffer *packet, int timeout, comm_point_callback_type *callback, void *callback_arg)
Send TCP query.
Definition: fake_event.c:1126
int curmod
which module is executing
Definition: module.h:623
static void rate_list(struct lruhash_entry *e, void *arg)
list items in the ratelimit table
Definition: remote.c:2798
struct module_qstate s
the query state.
Definition: mesh.h:174
int qtype
the type asked for
Definition: unbound.h:127
int infra_ratelimit_exceeded(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow)
See if the query rate counter for a delegation point is exceeded.
Definition: infra.c:973
struct ub_packed_rrset_key * ds_rrset
the DS rrset
Definition: validator.h:200
static int keytag_compare(const void *x, const void *y)
compare two keytags, return -1, 0 or 1
Definition: val_anchor.c:1278
int sldns_str2wire_a_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_A from string to wireformat.
Definition: str2wire.c:1065
int val_nsec_proves_name_error(struct ub_packed_rrset_key *nsec, uint8_t *qname)
Determine if the given NSEC proves a NameError (NXDOMAIN) for a given qname.
Definition: val_nsec.c:404
int nocaps
ignore capsforid
Definition: outside_network.h:340
static void pretty_output(char *q, int t, int c, struct ub_result *result, int docname)
pretty line of output for results
Definition: unbound-host.c:288
int fake_sha1
fake SHA1 support for unit tests
Definition: val_secalgo.c:60
int iter_stub_fwd_no_cache(struct module_qstate *qstate, struct query_info *qinf)
Lookup if no_cache is set in stub or fwd.
Definition: iter_utils.c:1393
struct alloc_cache alloc
allocation service
Definition: subnetmod.h:63
static void dtio_sleep(struct dt_io_thread *dtio)
put the dtio thread to sleep
Definition: dtstream.c:1188
int respip_enter_rr(struct regional *region, struct resp_addr *raddr, uint16_t rrtype, uint16_t rrclass, time_t ttl, uint8_t *rdata, size_t rdata_len, const char *rrstr, const char *netblockstr)
Add RR to resp_addr's RRset.
Definition: respip.c:255
long long ans_rcode[UB_STATS_RCODE_NUM]
answer rcodes
Definition: unbound.h:723
@ repevt_assign
assignment to a variable
Definition: replay.h:212
#define LDNS_MAX_LABELLEN
Maximum length of a dname label.
Definition: rrdef.h:27
void lru_remove(struct lruhash *table, struct lruhash_entry *entry)
Remove entry from lru list.
Definition: lruhash.c:277
static int generate_parentside_target_query(struct module_qstate *qstate, struct iter_qstate *iq, int id, uint8_t *name, size_t namelen, uint16_t qtype, uint16_t qclass)
Given a basic query, generate a parent-side "target" query.
Definition: iterator.c:1723
#define NORMAL_UDP_SIZE
Size of an UDP datagram.
Definition: worker.c:96
@ respip_always_deny
answer with nodata response
Definition: localzone.h:558
int dns_cache_store(struct module_env *env, struct query_info *qinf, struct reply_info *rep, int is_referral, time_t leeway, int pside, struct regional *region, uint32_t flags)
Allocate a dns_msg with malloc/alloc structure and store in dns cache.
Definition: dns.c:967
struct comm_point * cp
UDP commpoint, fd=-1 if not in use.
Definition: outside_network.h:211
void timehist_print(struct timehist *hist)
Printout histogram.
Definition: timehist.c:147
#define AUTH_PROBE_TIMEOUT_STOP
when to stop with SOA probes (when exponential timeouts exceed this)
Definition: authzone.c:80
int dname_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
Compare dnames, sorted not canonical, but by label.
Definition: dname.c:486
int fptr_whitelist_inplace_cb_query(inplace_cb_query_func_type *fptr)
Check function pointer whitelist for inplace_cb_query func values.
Definition: fptr_wlist.c:630
int type_http_out
if this is a http outgoing type of commpoint.
Definition: fake_event.c:81
int supports_ipv6
A flag to indicate whether or not we have an IPv6 route.
Definition: iterator.h:111
int hide_identity
do not report identity (id.server, hostname.bind)
Definition: config_file.h:313
int optind
getopt global, in case header files fail to declare it.
@ LDNS_RR_TYPE_OPT
Pseudo OPT record...
Definition: rrdef.h:165
static void lowercase_pkt(uint8_t *pkt, size_t pktlen)
lowercase all names in the message
Definition: testpkts.c:1135
static struct ub_packed_rrset_key * assemble_it(struct trust_anchor *ta, size_t num, uint16_t type)
Assemble an rrset structure for the type.
Definition: val_anchor.c:856
static struct delegpt * read_fwds_name(struct config_stub *s)
set zone name
Definition: iter_fwd.c:179
void dt_msg_queue_submit(struct dt_msg_queue *mq, void *buf, size_t len)
Submit a message to the queue.
Definition: dtstream.c:168
struct views * views_create(void)
Create views storage.
Definition: view.c:57
void * ssl
the SSL object with rw bio (owned) or for commaccept ctx ref
Definition: netevent.h:192
static void xfr_write_after_update(struct auth_xfer *xfr, struct module_env *env)
write to zonefile after zone has been updated
Definition: authzone.c:4900
struct comm_point * comm_point_create_raw(struct comm_base *base, int fd, int writing, comm_point_callback_type *callback, void *callback_arg)
Create commpoint to listen to a local domain pipe descriptor.
Definition: netevent.c:3008
#define O_LTG(opt, name, lst)
compare and print taglist option
Definition: config_file.c:880
void ub_packed_rrset_parsedelete(struct ub_packed_rrset_key *pkey, struct alloc_cache *alloc)
Delete packed rrset key and data, not entered in hashtables yet.
Definition: packed_rrset.c:56
long long rrset_bogus
rrsets marked bogus by validator
Definition: unbound.h:731
int dnstap_log_resolver_response_messages
true to log dnstap RESOLVER_RESPONSE message events
Definition: config_file.h:512
void log_err(const char *format,...)
implementation of log_err
Definition: log.c:315
void pkt_dname_tolower(sldns_buffer *pkt, uint8_t *dname)
lowercase pkt dname (follows compression pointers)
Definition: dname.c:151
int ub_ctx_config(struct ub_ctx *ctx, const char *fname)
setup configuration for the given context.
Definition: libunbound.c:374
struct order_id id
lock id
Definition: lock_verify.c:73
@ LDNS_RDF_TYPE_LOC
location data
Definition: rrdef.h:317
struct mesh_state * jostle_first
double linked list of the query states that can be jostled out by new queries if too old.
Definition: mesh.h:146
void(* winsock_unregister_wsaevent)(struct ub_event *ev)
Destructor for a ub_event associated with a wsaevent, (not called by libunbound)
Definition: unbound-event.h:153
INLINE uint32_t sldns_buffer_read_u32_at(sldns_buffer *buffer, size_t at)
returns the 4-byte integer value at the given position in the buffer
Definition: sbuffer.h:678
hashvalue_type hash
hash value of the key.
Definition: lruhash.h:218
struct msgreply_entry * query_info_entrysetup(struct query_info *q, struct reply_info *r, hashvalue_type h)
Setup query info entry.
Definition: msgreply.c:639
struct iter_prep_list * next
next in list
Definition: iterator.h:416
int forwards_add_stub_hole(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Add stub hole (empty entry in forward table, that makes resolution skip a forward-zone because the st...
Definition: iter_fwd.c:497
size_t val_next_unchecked(struct reply_info *rep, size_t skip)
Find next unchecked rrset position, return it for skip.
Definition: val_utils.c:1048
@ VERB_CLIENT
5 - querier client information
Definition: log.h:61
int rcode
DNS RCODE for the result.
Definition: unbound.h:153
static void * ext_thread(void *arg)
extended thread worker
Definition: asynclook.c:298
int labs
labels in name
Definition: dnstree.h:65
rbtree_type * vars
Tree of macro values.
Definition: replay.h:322
static int az_domain_remove_rr(struct auth_data *node, uint16_t rr_type, uint8_t *rdata, size_t rdatalen, int *nonexist)
Remove rr from node, ignores nonexisting RRs, rdata points to buffer with rdatalen octets,...
Definition: authzone.c:1194
void errinf_rrset(struct module_qstate *qstate, struct ub_packed_rrset_key *rr)
Append text to error info: for RRset name type class.
Definition: config_file.c:2474
int context_query_cmp(const void *a, const void *b)
compare two ctx_query elements
Definition: context.c:103
void listen_stop_accept(struct listen_dnsport *listen)
stop accept handlers for TCP (until enabled again)
Definition: listen_dnsport.c:1571
INLINE void sldns_buffer_clear(sldns_buffer *buffer)
clears the buffer and make it ready for writing.
Definition: sbuffer.h:189
static void do_addtime(struct module_env *env, struct autr_ta *anchor, int *c)
Event: AddTime.
Definition: autotrust.c:1728
static void fake_pending_callback(struct replay_runtime *runtime, struct replay_moment *todo, int error)
Perform callback for fake pending message.
Definition: fake_event.c:484
struct packed_rrset_list * next
next in list
Definition: packed_rrset.h:278
size_t qbuflen
length of qbuf.
Definition: outside_network.h:334
int anchors_add_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
Add insecure point trust anchor.
Definition: val_anchor.c:1216
struct ecs_data ecs_client_in
ecs_data for client communication
Definition: subnetmod.h:80
A single bin with a linked list of entries in it.
Definition: lruhash.h:186
@ LDNS_RR_TYPE_CERT
RFC2538.
Definition: rrdef.h:157
int tcp_seen_keepalive
has TCP connection seen a keepalive?
Definition: replay.h:307
uint8_t * name
name to delete
Definition: remote.c:1601
Autotrust global metadata.
Definition: autotrust.h:127
size_t taglen
length of the taglist (in bytes)
Definition: respip.h:41
int wait_prime_ta
true if this state is waiting to prime a trust anchor
Definition: validator.h:219
int tcp_timeout_msec
timeout in msec for TCP wait times for this connection
Definition: netevent.h:258
int sldns_str2wire_long_str_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_LONG_STR from string to wireformat.
Definition: str2wire.c:2034
char * chroot
the chroot dir in use, NULL if none
Definition: daemon.h:80
void val_find_signer(enum val_classification subtype, struct query_info *qinf, struct reply_info *rep, size_t skip, uint8_t **signer_name, size_t *signer_len)
Given a response, determine the name of the "signer".
Definition: val_utils.c:217
int outnet_get_tcp_fd(struct sockaddr_storage *addr, socklen_t addrlen, int tcp_mss, int dscp)
get TCP file descriptor for address, returns -1 on failure, tcp_mss is 0 or maxseg size to set for TC...
Definition: outside_network.c:208
enum response_type response_type_from_cache(struct dns_msg *msg, struct query_info *request)
Classifies a response message from cache based on the current request.
Definition: iter_resptype.c:52
void * log_get_lock(void)
get log lock
Definition: log.c:208
static struct replay_var * macro_getvar(rbtree_type *store, char *name)
get var from store
Definition: replay.c:647
Per query state for the response-ip module.
Definition: respip.c:52
long long mesh_jostled
mesh stats: number of reply states overwritten with a new one
Definition: unbound.h:810
static const char * get_builtin_ds(void)
return the built in root DS trust anchor
Definition: unbound-anchor.c:244
PyObject * data
Module per query data.
Definition: pythonmod.c:112
static void dnsc_shared_secret_cache_insert(struct slabhash *cache, uint8_t key[DNSCRYPT_SHARED_SECRET_KEY_LENGTH], uint32_t hash, uint8_t nmkey[crypto_box_BEFORENMBYTES])
Inserts a shared secret into the shared_secrets_cache slabhash.
Definition: dnscrypt.c:109
int sldns_wire2str_str_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat str field to string, with user buffers.
Definition: wire2str.c:1137
void mesh_state_cleanup(struct mesh_state *mstate)
Cleanup a mesh state and its query state.
Definition: mesh.c:861
int main(int argc, char *argv[])
Main routine for unbound-control.
Definition: unbound-control.c:843
int sldns_wire2str_rrquestion_buf(uint8_t *rr, size_t rr_len, char *str, size_t str_len)
Convert question RR to string presentation format, on one line.
Definition: wire2str.c:259
int ub_ctx_set_fwd(struct ub_ctx *ctx, const char *addr)
Set machine to forward DNS queries to, the caching resolver to use.
Definition: libunbound.c:907
static void remove_missing_trustanchors(struct module_env *env, struct trust_anchor *tp, int *changed)
Remove missing trustanchors so the list does not grow forever.
Definition: autotrust.c:1881
int outnet_tcp_cb(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
callback for pending tcp connections
Definition: outside_network.c:460
static int match(char *line)
match logfile line to see if it needs accounting processing
Definition: memstats.c:78
static void serviced_delete(struct serviced_query *sq)
cleanup serviced query entry
Definition: outside_network.c:1511
int fwd_cmp(const void *k1, const void *k2)
compare two fwd entries
Definition: iter_fwd.c:53
struct dns_msg * dns_alloc_msg(sldns_buffer *pkt, struct msg_parse *msg, struct regional *region)
Allocate dns_msg from parsed msg, in regional.
Definition: iter_utils.c:622
static void do_cache_remove(struct worker *worker, uint8_t *nm, size_t nmlen, uint16_t t, uint16_t c)
flush something from rrset and msg caches
Definition: remote.c:1543
static void test_lru(struct lruhash *table)
test lru_front lru_remove
Definition: unitlruhash.c:162
Some global statistics that are not in struct stats_info, this struct is shared on a shm segment (shm...
Definition: unbound.h:626
void server_stats_init(struct ub_server_stats *stats, struct config_file *cfg)
Initialize server stats to 0.
Definition: stats.c:87
void log_file(FILE *f)
Set logging to go to the specified file *.
Definition: log.c:160
struct auth_zone * rpz_first
first auth zone containing rpz item in linked list
Definition: authzone.h:86
#define ERROR_RATELIMIT
ratelimit for error responses
Definition: worker.c:98
int forwards_next_root(struct iter_forwards *fwd, uint16_t *dclass)
Find next root item in forwards lookup tree.
Definition: iter_fwd.c:397
@ local_zone_always_refuse
answer with error, even when there is local data
Definition: localzone.h:92
int upstream_is_tcp
if the log server is connected to over TCP.
Definition: dtstream.h:193
static int lz_enter_overrides(struct local_zones *zones, struct config_file *cfg)
parse local-zone-override: statements
Definition: localzone.c:880
rbtree_type tree
Tree of the addresses that are TCP connection limited.
Definition: tcp_conn_limit.h:60
void hints_delete_stub(struct iter_hints *hints, uint16_t c, uint8_t *nm)
Remove stub from hints structure.
Definition: iter_hints.c:543
static int vbmp
verbose this unit test
Definition: unitldns.c:49
static void test_long_table(struct slabhash *table)
test with long sequence of adds, removes and updates, and lookups
Definition: unitslabhash.c:243
int ub_poll(struct ub_ctx *ctx)
Poll a context to see if it has any new results Do not poll in a loop, instead extract the fd below t...
Definition: libunbound.c:504
struct name_tree_node * name_tree_find(rbtree_type *tree, uint8_t *name, size_t len, int labs, uint16_t dclass)
Lookup exact match in name tree.
Definition: dnstree.c:166
static void do_insecure_remove(RES *ssl, struct worker *worker, char *arg)
do the insecure_remove command
Definition: remote.c:2257
size_t delegpt_get_mem(struct delegpt *dp)
get memory in use by dp
Definition: iter_delegpt.c:669
static void local_error_encode(struct query_info *qinfo, struct module_env *env, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, int rcode, int r)
encode local error answer
Definition: localzone.c:1230
char * name
domain name (in text) of the auth apex domain
Definition: config_file.h:658
static void waitforit(PROCESS_INFORMATION *pinfo)
wait for cron process to finish
Definition: win_svc.c:525
void iter_dec_attempts(struct delegpt *dp, int d)
Remove query attempts from all available ips.
Definition: iter_utils.c:1284
struct config_auth * next
next in list
Definition: config_file.h:656
static int already_validated(struct dns_msg *ret_msg)
Check to see if the response has already been validated.
Definition: validator.c:351
int inplace_cb_query_call(struct module_env *env, struct query_info *qinfo, uint16_t flags, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct module_qstate *qstate, struct regional *region)
Call the registered functions in the inplace_cb_query linked list.
Definition: msgreply.c:1100
rbnode_type rbtree_null_node
the global empty node
Definition: rbtree.c:53
static void chaos_replyonestr(sldns_buffer *pkt, const char *str, struct edns_data *edns, struct worker *worker, struct comm_reply *repinfo)
Reply with one string.
Definition: worker.c:854
uint64_t next_id
next id number to pass out
Definition: alloc.h:84
void mesh_stats_clear(struct mesh_area *mesh)
Clear the stats that the mesh keeps (number of queries serviced)
Definition: mesh.c:1751
size_t outnet_get_mem(struct outside_network *outnet)
Get memory size in use by outside network.
Definition: outside_network.c:2490
EDNS option.
Definition: msgparse.h:233
#define TRIES_PER_SELECT
number of reads per select for delayer
Definition: delayer.c:57
@ LDNS_RR_TYPE_A6
RFC2874.
Definition: rrdef.h:159
int log_local_actions
log every local-zone hit
Definition: config_file.h:306
char * config_taglist2str(struct config_file *cfg, uint8_t *taglist, size_t len)
convert tag bitlist to a malloced string with tag names.
Definition: config_file.c:1994
struct track_id * id_list
list of ids to free once threads are done
Definition: asynclook.c:186
int sldns_b32_ntop_extended_hex(const uint8_t *src, size_t src_sz, char *dst, size_t dst_sz)
This function we get from ldns-compat or from base system it returns the number of data bytes stored ...
Definition: parseutil.c:448
Address of target nameserver in delegation point.
Definition: iter_delegpt.h:132
int sldns_b32_pton_extended_hex(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize)
This function we get from ldns-compat or from base system it returns the number of data bytes stored ...
Definition: parseutil.c:601
socklen_t addrlen
length of addr
Definition: remote.c:1615
void outbound_list_init(struct outbound_list *list)
Init the user allocated outbound list structure.
Definition: outbound_list.c:48
minimisation_state
QNAME minimisation state.
Definition: iterator.h:147
static struct module_func_block dynlibmod_block
The module function block.
Definition: dynlibmod.c:292
struct pending * udp_wait_first
pending udp queries waiting to be sent out, waiting for fd
Definition: outside_network.h:121
int ub_fd(struct ub_ctx *ctx)
Get file descriptor.
Definition: libunbound.c:511
long long queries_ratelimited
number of queries that have been ratelimited by domain recursion.
Definition: unbound.h:733
int cache_fill_missing(struct module_env *env, uint16_t qclass, struct regional *region, struct delegpt *dp)
find and add A and AAAA records for missing nameservers in delegpt
Definition: dns.c:319
void priv_delete(struct iter_priv *priv)
Delete priv structure.
Definition: iter_priv.c:70
void dt_io_thread_delete(struct dt_io_thread *dtio)
Delete the IO thread structure.
Definition: dtstream.c:234
void iter_clear(struct module_qstate *qstate, int id)
iterator cleanup query state
Definition: iterator.c:3913
List of prepend items.
Definition: iterator.h:414
void table_grow(struct lruhash *table)
Grow the table lookup array.
Definition: lruhash.c:231
void config_deltrplstrlist(struct config_str3list *p)
Delete items in config triple string list.
Definition: config_file.c:1309
rbtree_type domain_limits
ratelimit settings for domains, struct domain_limit_data
Definition: infra.h:120
@ DNS64_SUBQUERY_FINISHED
Query for which we generated a sub-query, and for which this sub-query is finished.
Definition: dns64.c:80
long long nonce_cache_count
number of dnscrypt nonces cache entries
Definition: unbound.h:772
struct rbtree_type * caps_white
whitelist for capsforid names
Definition: iterator.h:123
int pending_cmp(const void *key1, const void *key2)
compare function of pending rbtree
Definition: outside_network.c:93
struct ub_ctx * ub_ctx_create_event(struct event_base *base)
Create a resolving and validation context.
Definition: libunbound.c:211
@ LDNS_RR_TYPE_SIG
2535typecode
Definition: rrdef.h:131
func_clear_t func_clear
Module clear function.
Definition: dynlibmod.h:128
struct edns_data edns
edns data from query
Definition: mesh.h:250
int comm_signal_bind(struct comm_signal *comsig, int sig)
Bind signal struct to catch a signal.
Definition: netevent.c:3398
static int az_nsec_wildcard_denial(struct auth_zone *z, struct regional *region, struct dns_msg *msg, uint8_t *cenm, size_t cenmlen)
Find NSEC and add for wildcard denial.
Definition: authzone.c:2554
int serviced_udp_callback(struct comm_point *c, void *arg, int error, struct comm_reply *rep)
callback for serviced query UDP answers
Definition: outside_network.c:1969
void ub_comm_base_now(struct comm_base *cb)
Equip the comm_base with the current time.
Definition: ub_event.c:448
uint8_t * ce
the closest encloser name
Definition: val_nsec3.c:80
int comm_point_perform_accept(struct comm_point *c, struct sockaddr_storage *addr, socklen_t *addrlen)
perform accept(2) with error checking.
Definition: netevent.c:789
acl_access
Enumeration of access control options for an address range.
Definition: acl_list.h:54
uint8_t bogus
if true, the A or AAAA RR was bogus, so this address is bad.
Definition: iter_delegpt.h:150
@ rrset_trust_glue
Glue from a primary zone, or glue from a zone transfer.
Definition: packed_rrset.h:155
static void authzone_read_test(void)
Test authzone read from file.
Definition: unitauth.c:877
void server_stats_log(struct ub_server_stats *stats, struct worker *worker, int threadnum)
display the stats to the log
Definition: stats.c:110
char * sldns_wire2str_pkt(uint8_t *data, size_t len)
Convert wireformat packet to a string representation.
Definition: wire2str.c:199
static int q_is_localhost
if true, we are testing against 'localhost' and extra checking is done
Definition: asynclook.c:190
void worker_alloc_cleanup(void *arg)
cleanup the cache to remove all rrset IDs from it, arg is worker
Definition: worker.c:2020
worker_commands
worker commands
Definition: worker.h:67
int key_entry_isnull(struct key_entry_key *kkey)
See if this is a null entry.
Definition: val_kentry.c:220
static int dtio_find_msg(struct dt_io_thread *dtio)
find a new message to write, search message queues, false if none
Definition: dtstream.c:447
static void perf_tv_add(struct timeval *t1, struct timeval *t2)
timeval add, t1 += t2
Definition: perf.c:175
static int lz_enter_rr_str(struct local_zones *zones, const char *rr)
enter a data RR into auth data; a zone for it must exist
Definition: localzone.c:555
void * regional_alloc_init(struct regional *r, const void *init, size_t size)
Allocate size bytes of memory inside regional and copy INIT into it.
Definition: regional.c:162
static int pkt_rrsig_covered_equals(sldns_buffer *pkt, uint8_t *here, uint16_t type)
true if covered type equals prevtype
Definition: msgparse.c:256
int reply_info_alloc_rrset_keys(struct reply_info *rep, struct alloc_cache *alloc, struct regional *region)
Allocate (special) rrset keys.
Definition: msgreply.c:144
static struct ub_packed_rrset_key * extract_keys(struct entry *e, struct alloc_cache *alloc, struct regional *region, sldns_buffer *pkt)
extract DNSKEY rrset from answer and convert it
Definition: unitverify.c:108
test structure contains test data
Definition: slabhash.h:212
void log_hex(const char *msg, void *data, size_t length)
Log a hex-string to the log.
Definition: log.c:401
ub_thread_type tid
thread id, of the io thread
Definition: dtstream.h:128
static void dns64_adjust_ptr(struct module_qstate *qstate, struct module_qstate *super)
Generate a response for the original IPv6 PTR query based on an IPv4 PTR sub-query's response.
Definition: dns64.c:900
struct outside_network * outnet
outside network this is part of
Definition: outside_network.h:390
void respip_set_delete(struct respip_set *set)
Delete response IP set.
Definition: respip.c:84
void reclaim_space(struct lruhash *table, struct lruhash_entry **list)
Try to make space available by deleting old entries.
Definition: lruhash.c:182
int main(int argc, char **argv)
main program for asynclook
Definition: asynclook.c:402
uint8_t * name
name of this trust anchor
Definition: val_anchor.h:100
void timehist_delete(struct timehist *hist)
Delete histogram.
Definition: timehist.c:102
char * optarg
getopt global, in case header files fail to declare it.
char * macro_process(rbtree_type *store, struct replay_runtime *runtime, char *text)
Apply macro substitution to string.
Definition: replay.c:865
void wsvc_rc_start(FILE *out)
Start the service from servicecontrolmanager, tells OS to start daemon.
Definition: w_inst.c:275
sldns_enum_rr_type
The different RR types.
Definition: rrdef.h:83
struct outside_network * outside_network_create(struct comm_base *base, size_t bufsize, size_t num_ports, char **ifs, int num_ifs, int do_ip4, int do_ip6, size_t num_tcp, int dscp, struct infra_cache *infra, struct ub_randstate *rnd, int use_caps_for_id, int *availports, int numavailports, size_t unwanted_threshold, int tcp_mss, void(*unwanted_action)(void *), void *unwanted_param, int do_udp, void *sslctx, int delayclose, int tls_use_sni, struct dt_env *dtenv)
Create outside_network structure with N udp ports.
Definition: outside_network.c:734
void neg_delete_data(struct val_neg_cache *neg, struct val_neg_data *el)
Delete a data element from the negative cache.
Definition: val_neg.c:226
static int load_rr(RES *ssl, sldns_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, time_t now)
load an RR into rrset
Definition: cachedump.c:321
struct reply_info * reply_info_copy(struct reply_info *rep, struct alloc_cache *alloc, struct regional *region)
Copy reply_info and all rrsets in it and allocate.
Definition: msgreply.c:700
sldns_enum_cert_algorithm
algorithms used in CERT rrs
Definition: rrdef.h:401
static void free_ignore_aaaa_node(rbnode_type *node, void *ATTR_UNUSED(arg))
free ignore AAAA elements
Definition: dns64.c:416
static void auth_zone_delete(struct auth_zone *z, struct auth_zones *az)
delete an auth zone structure (tree remove must be done elsewhere)
Definition: authzone.c:386
Global state for the subnet module.
Definition: subnetmod.h:55
struct config_strlist_head list
list of result items
Definition: config_file.c:757
The allocation statistics block.
Definition: memstats.c:52
static int anchors_assemble(struct trust_anchor *ta)
Assemble structures for the trust DS and DNSKEY rrsets.
Definition: val_anchor.c:931
@ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
nsec3 base32 string (with length byte on wire
Definition: rrdef.h:329
func_operate_t func_operate
Module operate function.
Definition: dynlibmod.h:124
struct outside_network * outnet
the outside network
Definition: module.h:473
#define EDNS_FRAG_SIZE_IP6
fallback size for EDNS in IPv6, fits one fragment with ip6-tunnel-ids
Definition: outside_network.h:318
size_t num_msg_cache
number of messages from cache
Definition: subnetmod.h:66
static int pkt_find_edns_opt(uint8_t **p, size_t *plen)
get ptr to EDNS OPT record (and remaining length); behind the type u16
Definition: testpkts.c:822
rbtree_type * serviced
serviced queries, sorted by qbuf, addr, dnssec
Definition: outside_network.h:128
static struct delegpt * read_stubs_name(struct config_stub *s)
set stub name
Definition: iter_hints.c:192
struct ub_event *(* new_event)(struct ub_event_base *, int fd, short bits, void(*cb)(int, short, void *), void *arg)
Instantiate a new ub_event associated with this event base.
Definition: unbound-event.h:97
TCP connection limit storage structure.
Definition: tcp_conn_limit.h:53
void int fake_dsa
debug option for unit tests.
Definition: val_secalgo.c:58
void mesh_list_remove(struct mesh_state *m, struct mesh_state **fp, struct mesh_state **lp)
Remove mesh state from a double linked list.
Definition: mesh.c:1806
int harden_large_queries
harden against very large query sizes
Definition: config_file.h:250
struct daemon * daemon
global shared daemon structure
Definition: worker.h:86
uint8_t * name
name of the key
Definition: val_kentry.h:59
static void use_free_buffer(struct outside_network *outnet)
see if buffers can be used to service TCP queries
Definition: outside_network.c:420
struct lruhash * lruhash_create(size_t start_size, size_t maxmem, lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, lruhash_deldatafunc_type deldatafunc, void *arg)
Create new hash table.
Definition: lruhash.c:62
static void del_tmp_file(char *fname)
delete temp file and free name string
Definition: unitauth.c:507
str2wire.h - read txt presentation of RRs
struct module_func_block * iter_get_funcblock(void)
Get the iterator function block.
Definition: iterator.c:3948
int sldns_str_vprint(char **str, size_t *slen, const char *format, va_list args)
Print to string, move string along for next content.
Definition: wire2str.c:317
int iter_state_is_responsestate(enum iter_state s)
See if iterator state is a response state.
Definition: iterator.c:3982
void dname_pkt_copy(sldns_buffer *pkt, uint8_t *to, uint8_t *dname)
Copy over a valid dname and decompress it.
Definition: dname.c:346
unsigned int add_holddown
autotrust add holddown time, in seconds
Definition: config_file.h:379
struct val_anchors * anchors
trusted key storage; these are the configured keys, if not NULL, otherwise configured by validator.
Definition: module.h:491
static void check_mod(struct config_file *cfg, struct module_func_block *fb)
check if module works with config
Definition: unbound-checkconf.c:130
@ sec_status_insecure
INSECURE means that the object is authoritatively known to be insecure.
Definition: packed_rrset.h:189
void dtio_cmd_cb(int fd, short bits, void *arg)
callback for the dnstap commandpipe, to stop the dnstap IO
dns64_state
State of DNS64 processing for a query.
Definition: dns64.c:75
struct port_if * ip4_ifs
array of outgoing IP4 interfaces
Definition: outside_network.h:111
struct lruhash_entry * overflow_next
next entry in overflow chain.
Definition: lruhash.h:212
size_t ar_rrsets
count of RRsets per section.
Definition: msgparse.h:113
void infra_delkeyfunc(void *k, void *arg)
delete key, and destroy the lock
void log_err_addr(const char *str, const char *err, struct sockaddr_storage *addr, socklen_t addrlen)
Log errno and addr.
Definition: net_help.c:575
static struct auth_data * az_nsec3_find_ce(struct auth_zone *z, uint8_t **cenm, size_t *cenmlen, int *no_exact_ce, int algo, size_t iter, uint8_t *salt, size_t saltlen)
Find the closest encloser that has exact NSEC3.
Definition: authzone.c:2767
void(* ub_callback_type)(void *, int, struct ub_result *)
Callback for results of async queries.
Definition: unbound.h:233
int canonical_tree_compare(const void *k1, const void *k2)
canonical compare for two tree entries
Definition: val_sigcrypt.c:879
int sldns_wire2str_b64_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat b64 field to string, with user buffers.
Definition: wire2str.c:1240
static int ssl_handle_write(struct comm_point *c)
ssl write callback on TCP
Definition: netevent.c:1289
int dump_cache(RES *ssl, struct worker *worker)
Dump cache(s) to text.
Definition: cachedump.c:294
struct ub_packed_rrset_key * reply_find_rrset_section_ns(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside the authority section.
Definition: msgreply.c:787
uint8_t * name
zone name, in uncompressed wireformat
Definition: authzone.h:101
@ LDNS_RR_TYPE_APL
RFC3123.
Definition: rrdef.h:167
A replay moment.
Definition: replay.h:180
struct comm_base * base
Base for select calls.
Definition: listen_dnsport.h:58
int worker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming replies from the network
Definition: worker.c:239
int if_automatic
automatic interface for incoming messages.
Definition: config_file.h:182
int sldns_wire2str_nsec_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat nsec bitmap field to string, with user buffers.
Definition: wire2str.c:1256
struct ub_packed_rrset_key ** list
the list of NSEC3s to filter; array
Definition: val_nsec3.c:103
static int rrinternal_write_typeclassttl(sldns_buffer *strbuf, uint8_t *rr, size_t len, size_t dname_len, uint16_t tp, uint16_t cl, uint32_t ttl, int question)
put type, class, ttl into rr buffer
Definition: str2wire.c:314
int log_time_ascii
log timestamp in ascii UTC
Definition: config_file.h:298
int is_drop
is the comm point dropped (by worker handle).
Definition: listen_dnsport.h:257
static int cmpbit(const addrkey_t *key1, const addrkey_t *key2, addrlen_t n)
Test for equality on N'th bit.
Definition: addrtree.c:314
int winsock_unused_symbol
symbol so this codefile defines symbols.
Definition: winsock_event.c:693
int delayclose
if udp is delay-closed (delayed answers do not meet closed port)
Definition: outside_network.h:106
int inplace_cb_query_response_call(struct module_env *env, struct module_qstate *qstate, struct dns_msg *response)
Call the registered functions in the inplace_cb_query_response linked list.
Definition: msgreply.c:1130
size_t namelen
length of name
Definition: val_kentry.h:61
static int if_is_ssl(const char *ifname, const char *port, int ssl_port, struct config_strlist *tls_additional_port)
see if interface is ssl, its port number == the ssl port number
Definition: listen_dnsport.c:1167
char * sldns_wire2str_rr(uint8_t *rr, size_t len)
Convert wireformat RR to a string representation.
Definition: wire2str.c:208
void comm_base_dispatch(struct comm_base *b)
Dispatch the comm base events.
Definition: fake_event.c:953
size_t rr_count
number of RRs in the rr list
Definition: msgparse.h:163
uint8_t color
colour of this node
Definition: rbtree.h:65
struct lruhash_entry entry
the hash table entry, data is uint8_t
Definition: dnscrypt.c:72
static struct autr_ta * add_key(struct trust_anchor *tp, uint32_t ttl, uint8_t *rdata, size_t rdata_len)
add key and clone RR and tp already locked.
Definition: autotrust.c:1429
static int auth_zone_write_domain(struct auth_zone *z, struct auth_data *n, FILE *out)
write domain to file
Definition: authzone.c:1702
int cfg_strlist_insert(struct config_strlist **head, char *item)
Insert string into strlist.
Definition: config_file.c:1706
comm_point_callback_type * cb
callback for the timeout, error or reply to the message
Definition: outside_network.h:233
uint8_t * opt_data
data of this edns option; allocated in region, or NULL if len=0
Definition: msgparse.h:241
uint8_t * dlv_lookup_name
The name for which the DLV is looked up.
Definition: validator.h:226
void addr_tree_init_parents_node(struct addr_tree_node *node)
Initialize parent pointers in partial addr tree.
Definition: dnstree.c:107
void addr_tree_init_parents(rbtree_type *tree)
Initialize parent pointers in addr tree.
Definition: dnstree.c:134
uint16_t flags
DNSKEY flags.
Definition: signit.c:61
struct ub_event * ub_winsock_register_wsaevent(struct ub_event_base *, void *wsaevent, void(*cb)(int, short, void *), void *arg)
Create a new ub_event associated with the wsaevent for the event base.
Definition: ub_event.c:338
void alloc_set_id_cleanup(struct alloc_cache *alloc, void(*cleanup)(void *), void *arg)
Set cleanup on ID overflow callback function.
Definition: alloc.c:357
int delegpt_add_rrset_A(struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
Add A RRset to delegpt.
Definition: iter_delegpt.c:421
int delegpt_add_rrset(struct delegpt *dp, struct regional *region, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
Add any RRset to delegpt.
Definition: iter_delegpt.c:469
struct sockaddr_storage addr
address ready to allocate new socket (except port no).
Definition: outside_network.h:171
size_t lruhash_get_mem(struct lruhash *table)
Get memory in use now by the lruhash table.
Definition: lruhash.c:493
static void service_tcp_listen(int s, fd_set *rorig, int *max, struct tcp_proxy **proxies, struct sockaddr_storage *srv_addr, socklen_t srv_len, struct timeval *now, struct timeval *tcp_timeout)
accept new TCP connections, and set them up
Definition: delayer.c:567
socklen_t addrlen
length of addr field in use.
Definition: outside_network.h:283
struct comm_point * comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer *buffer, comm_point_callback_type *callback, void *callback_arg)
Create an UDP comm point.
Definition: netevent.c:2516
struct local_zone * local_zones_lookup(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, uint16_t dtype)
Lookup zone that contains the given name, class.
Definition: localzone.c:1087
static int provide_builtin(const char *root_anchor_file, int *used_builtin)
Check the root anchor file.
Definition: unbound-anchor.c:2065
int ds_get_digest_algo(struct ub_packed_rrset_key *k, size_t idx)
Get DS RR digest algorithm.
Definition: val_sigcrypt.c:217
void comm_signal_delete(struct comm_signal *comsig)
Delete the signal communication point.
Definition: netevent.c:3428
int sockaddr_cmp_addr(struct sockaddr_storage *addr1, socklen_t len1, struct sockaddr_storage *addr2, socklen_t len2)
Compare two sockaddrs.
Definition: net_help.c:638
int edns_bypass_cache_stage(struct edns_option *list, struct module_env *env)
Check if an edns option needs to bypass the reply from cache stage.
Definition: module.c:194
static void neg_make_space(struct val_neg_cache *neg, size_t need)
Create more space in negative cache The oldest elements are deleted until enough space is present.
Definition: val_neg.c:272
static struct tap_socket * tap_socket_new_tcpaccept(char *ip, void(*ev_cb)(int, short, void *), void *data)
create new socket (unconnected, not base-added), or NULL malloc fail
Definition: unbound-dnstap-socket.c:214
#define UB_STATS_RCODE_NUM
number of rcodes in stats
Definition: unbound.h:654
int edns_known_options_init(struct module_env *env)
Initialize the edns known options by allocating the required space.
Definition: module.c:75
#define TCP_AUTH_QUERY_TIMEOUT
timeout in milliseconds for TCP queries to auth servers.
Definition: net_help.h:80
struct comm_signal * comm_signal_create(struct comm_base *base, void(*callback)(int, void *), void *cb_arg)
Create a signal handler.
Definition: fake_event.c:973
void fake_event_cleanup(void)
Deinit fake event services.
Definition: fake_event.c:129
int nxdomain
If there was no data, and the domain did not exist, this is true.
Definition: unbound.h:173
int sldns_parse_char(uint8_t *ch_p, const char **str_p)
parse one character, with escape codes
Definition: parseutil.c:318
static void service_recv(int s, struct ringbuf *ring, sldns_buffer *pkt, fd_set *rorig, int *max, struct proxy **proxies, struct sockaddr_storage *srv_addr, socklen_t srv_len, struct timeval *now, struct timeval *delay, struct timeval *reuse)
recv new waiting packets
Definition: delayer.c:491
size_t namelen
length of name
Definition: iter_delegpt.h:101
static int reply_info_sortref_cmp(const void *a, const void *b)
helper compare function to sort in lock order
Definition: msgreply.c:497
static int hints_insert(struct iter_hints *hints, uint16_t c, struct delegpt *dp, int noprime)
insert new hint info into hint structure
Definition: iter_hints.c:168
struct sockaddr_storage addr
address
Definition: dnstree.h:83
size_t hash_len
length of hash in bytes
Definition: val_nsec3.h:242
void pending_udp_timer_cb(void *arg)
callback for udp timeout
Definition: outside_network.c:660
struct outbound_entry *(* send_query)(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q)
Send serviced DNS query to server.
Definition: module.h:366
static int ds_create_dnskey_digest(struct module_env *env, struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx, struct ub_packed_rrset_key *ds_rrset, size_t ds_idx, uint8_t *digest)
Create a DS digest for a DNSKEY entry.
Definition: val_sigcrypt.c:289
int respip_enter_rr(struct regional *region, struct resp_addr *raddr, uint16_t rrtype, uint16_t rrclass, time_t ttl, uint8_t *rdata, size_t rdata_len, const char *rrstr, const char *netblockstr)
enter local data as resource records into a response-ip node
Definition: respip.c:255
void ub_ctx_delete(struct ub_ctx *ctx)
Destroy a validation context and free all its resources.
Definition: libunbound.c:284
enum sec_status dnskeyset_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, uint8_t *sigalg, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify rrset against dnskey rrset.
Definition: val_sigcrypt.c:486
static void read_file_content(FILE *in, int *lineno, struct replay_moment *mom)
Read FILE match content.
Definition: replay.c:215
void * event_base
event base, for event handling
Definition: dtstream.h:120
struct fake_pending * pending_list
List of pending queries in order they were sent out.
Definition: replay.h:280
void mesh_delete(struct mesh_area *mesh)
Delete mesh, and all query states and replies in it.
Definition: mesh.c:291
uint8_t * context_serialize_quit(uint32_t *len)
Serialize a 'quit' command.
Definition: context.c:401
void ub_comm_base_now(struct comm_base *cb)
Equip the comm_base with the current time.
Definition: ub_event_pluggable.c:673
size_t iter_get_mem(struct module_env *env, int id)
iterator alloc size routine
Definition: iterator.c:3929
@ LDNS_RR_TYPE_MG
a mail group member (EXPERIMENTAL)
Definition: rrdef.h:99
#define MAX_COMPRESS_PTRS
max number of compression ptrs to follow
Definition: dname.h:51
int algo_needs_missing(struct algo_needs *n)
See which algo is missing.
Definition: val_sigcrypt.c:471
static void service_loop(int udp_s, int listen_s, struct ringbuf *ring, struct timeval *delay, struct timeval *reuse, struct sockaddr_storage *srv_addr, socklen_t srv_len, sldns_buffer *pkt)
delayer service loop
Definition: delayer.c:928
int fptr_whitelist_mesh_cb(mesh_cb_func_type fptr)
Check function pointer whitelist for mesh state callback values.
Definition: fptr_wlist.c:573
rbnode_type * rbtree_next(rbnode_type *rbtree)
Returns next larger node in the tree.
Definition: rbtree.c:571
void(* unwanted_action)(void *)
what action to take, called when defensive action is needed
Definition: outside_network.h:96
uint16_t keytag
keytag
Definition: signit.c:59
void tcp_req_info_handle_readdone(struct tcp_req_info *req)
Handle read done of a new request from the client.
Definition: listen_dnsport.c:1803
static void check_table(struct slabhash *table)
check integrity of hash table
Definition: unitslabhash.c:187
void slabhash_clear(struct slabhash *table)
Clear hash table.
Definition: slabhash.c:100
struct key_entry_key * val_verify_new_DNSKEYs_with_ta(struct regional *region, struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ta_ds_rrset, struct ub_packed_rrset_key *ta_dnskey_rrset, int downprot, char **reason, struct module_qstate *qstate)
Verify rrset with trust anchor: DS and DNSKEY rrset.
Definition: val_utils.c:696
int dt_io_thread_start(struct dt_io_thread *dtio, void *event_base_nothr, int numworkers)
Start the io thread.
Definition: dtstream.c:2054
int inplace_cb_reply_local_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply_local linked list.
Definition: msgreply.c:1076
int main(int argc, char *argv[])
main program for pktview
Definition: pktview.c:189
static void delq(rbnode_type *n, void *ATTR_UNUSED(arg))
delete q
Definition: libunbound.c:231
rbtree_type run
set of runnable queries (mesh_state.run_node)
Definition: mesh.h:89
uint16_t sldns_wirerr_get_type(uint8_t *rr, size_t len, size_t dname_len)
Get the type of the RR.
Definition: str2wire.c:798
struct edns_option * opt_list
edns options to use for sending upstream packet
Definition: outside_network.h:388
int local_zones_add_RR(struct local_zones *zones, const char *rr)
Add RR data into the localzone data.
Definition: localzone.c:1881
static void service_ssl(SSL *ssl, struct sockaddr_storage *from, socklen_t falen)
provide service to the ssl descriptor
Definition: petal.c:537
int sldns_wire2str_nsap_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat NSAP field to string, with user buffers.
Definition: wire2str.c:1533
static void dname_test_qdtl(sldns_buffer *buff)
test query_dname_tolower
Definition: unitdname.c:78
static int print_ext(RES *ssl, struct ub_stats_info *s)
print extended stats
Definition: remote.c:917
void daemon_delete(struct daemon *daemon)
Delete workers, close listening ports.
Definition: daemon.c:737
static void do_revoked(struct module_env *env, struct autr_ta *anchor, int *c)
Event: Revoked.
Definition: autotrust.c:1781
void reply_info_parsedelete(struct reply_info *rep, struct alloc_cache *alloc)
Delete reply_info and packed_rrsets (while they are not yet added to the hashtables....
Definition: msgreply.c:533
struct sockaddr_storage prefix_addr
DNS64 prefix address.
Definition: dns64.c:120
static int equal_dname(uint8_t *q, size_t qlen, uint8_t *p, size_t plen)
see if domain names are equal
Definition: testpkts.c:1348
static void canonical_sort(struct ub_packed_rrset_key *rrset, struct packed_rrset_data *d, rbtree_type *sortree, struct canon_rr *rrs)
Sort RRs for rrset in canonical order.
Definition: val_sigcrypt.c:897
uint16_t qflags
flags of query, for reply flags
Definition: mesh.h:228
int number
which port number (when in use)
Definition: outside_network.h:203
void edns_known_options_delete(struct module_env *env)
Free the allocated space for the known edns options.
Definition: module.c:85
void authzone_test(void)
unit test for auth zone functions
Definition: unitauth.c:893
static void check_queries(const char *name, const char *zone, struct q_ans *queries)
check queries for a zone are returned as specified
Definition: unitauth.c:838
int secalgo_ds_digest(int algo, unsigned char *buf, size_t len, unsigned char *res)
static struct auth_master * auth_master_copy(struct auth_master *o)
copy a master to a new structure, NULL on alloc failure
Definition: authzone.c:3686
static int read_stubs(struct iter_hints *hints, struct config_file *cfg)
read stubs config
Definition: iter_hints.c:271
static int read_acl_tag_actions(struct acl_list *acl, struct config_file *cfg)
read acl tag actions config
Definition: acl_list.c:389
The global variable environment contents for the cachedb Shared between threads, this represents long...
Definition: cachedb.h:50
lock_basic_type lock
lock of the buffer structure.
Definition: dtstream.h:65
static int dump_msg_cache(RES *ssl, struct worker *worker)
dump msg cache
Definition: cachedump.c:277
void val_find_rrset_signer(struct ub_packed_rrset_key *rrset, uint8_t **sname, size_t *slen)
Find the signer name for an RRset.
Definition: val_utils.c:160
int key_entry_compfunc(void *k1, void *k2)
function for lruhash operation
Definition: val_kentry.c:68
struct sockaddr_storage addr
socket address for host deletion
Definition: remote.c:1617
int context_query_cmp(const void *a, const void *b)
compare two ctx_query elements
Definition: context.c:103
int cfg_str3list_insert(struct config_str3list **head, char *item, char *i2, char *i3)
Insert string into str3list.
Definition: config_file.c:1772
@ listen_type_tcp_dnscrypt
tcp type + dnscrypt
Definition: listen_dnsport.h:95
struct auth_master * scan_target
scan tries all the upstream masters.
Definition: authzone.h:334
#define BIT_RD
RD flag.
Definition: net_help.h:65
int sldns_str2wire_cert_alg_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_CERT_ALG from string to wireformat.
Definition: str2wire.c:1366
static void calc_num46(char **ifs, int num_ifs, int do_ip4, int do_ip6, int *num_ip4, int *num_ip6)
calculate number of ip4 and ip6 interfaces
Definition: outside_network.c:622
static void testpkt(sldns_buffer *pkt, struct alloc_cache *alloc, sldns_buffer *out, const char *hex)
test a packet
Definition: unitmsgparse.c:314
#define DNSKEY_BIT_ZSK
DNSKEY zone sign key flag.
Definition: net_help.h:93
static int parse_keyword(char **line, const char *keyword)
parse keyword in string.
Definition: replay.c:91
static void neg_lru_front(struct val_neg_cache *neg, struct val_neg_data *data)
Put data element at the front of the LRU list.
Definition: val_neg.c:147
struct ctx_query * context_deserialize_answer(struct ub_ctx *ctx, uint8_t *p, uint32_t len, int *err)
Deserialize an answer buffer.
Definition: context.c:332
func_inform_t func_inform
Module super_inform function.
Definition: dynlibmod.h:126
size_t msg_buffer_size
number of bytes buffer size for DNS messages
Definition: config_file.h:148
int sldns_wire2str_opcode_buf(int opcode, char *s, size_t slen)
Convert host format opcode to a string.
Definition: wire2str.c:305
int main(int argc, char **argv)
Install service main.
Definition: unbound-service-install.c:50
int sldns_wire2str_edns_subnet_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS SUBNET option data to string.
Definition: wire2str.c:1860
static int sldns_rr_tcttl_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
scan type, class and ttl and printout, for rr
Definition: wire2str.c:418
struct pending * pending_udp_query(struct serviced_query *sq, struct sldns_buffer *packet, int timeout, comm_point_callback_type *cb, void *cb_arg)
Send UDP query, create pending answer.
Definition: outside_network.c:1239
struct module_func_block ** mod
the module callbacks, array of num_modules length (ref only)
Definition: modstack.h:54
long long rrset_cache_count
number of rrset cache entries
Definition: unbound.h:751
Structure holding working information for unbound.
Definition: worker.h:82
void query_dname_tolower(uint8_t *dname)
lowercase query dname
Definition: dname.c:135
void dynlibmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
dynlib module
Definition: dynlibmod.c:186
int sldns_wire2str_rr_unknown_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat RR to string in unknown RR format, with user buffers.
Definition: wire2str.c:547
sldns_enum_pkt_section
The sections of a packet.
Definition: pkthdr.h:116
long long qtcp
number of queries over TCP
Definition: unbound.h:695
socklen_t len
length of addr
Definition: unbound-anchor.c:166
#define HASH_DEFAULT_STARTARRAY
default start size for hash arrays
Definition: lruhash.h:114
const char ** module_list_avail(void)
Get list of modules available.
Definition: modstack.c:138
struct ub_event_base * comm_base_internal(struct comm_base *b)
Access internal data structure (for util/tube.c on windows)
Definition: netevent.c:268
int respip_set_is_empty(const struct respip_set *set)
respip set emptiness test
Definition: respip.c:1299
struct regional * alloc_reg_obtain(struct alloc_cache *alloc)
Get a new regional for query states.
Definition: alloc.c:329
unsigned int sleeptime
in seconds
Definition: testpkts.h:214
sldns_enum_rr_compress
Used to specify whether compression is allowed.
Definition: rrdef.h:72
@ RESPIP_SUBQUERY_FINISHED
A subquery for CNAME chasing is completed.
Definition: respip.c:48
int reply_equal(struct reply_info *p, struct reply_info *q, struct regional *region)
Check if two replies are equal For fallback procedures.
Definition: iter_utils.c:967
static int nsec3_rrset_has_known(struct ub_packed_rrset_key *s)
see if at least one RR is known (flags, algo)
Definition: val_nsec3.c:382
static void spool_temp_file(FILE *in, int *lineno, char *id)
spool temp file
Definition: testbound.c:172
struct delegpt * dns_cache_find_delegation(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional *region, struct dns_msg **msg, time_t timenow)
Find a delegation from the cache.
Definition: dns.c:462
int config_get_option(struct config_file *cfg, const char *opt, void(*func)(char *, void *), void *arg)
Call print routine for the given option.
Definition: config_file.c:894
void dns64_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
This function is called when a sub-query finishes to inform the parent query.
Definition: dns64.c:935
uint8_t * qname
Salient data on the query: qname, in wireformat.
Definition: msgreply.h:75
static void verifytest_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, struct query_info *qinfo)
verify and test one rrset against the key rrset
Definition: unitverify.c:176
size_t caps_server
state for capsfail: current server number to try
Definition: iterator.h:288
int dname_strict_subdomain(uint8_t *d1, int labs1, uint8_t *d2, int labs2)
See if domain name d1 is a strict subdomain of d2.
Definition: dname.c:679
INLINE void sldns_buffer_write_u8(sldns_buffer *buffer, uint8_t data)
writes the given byte of data at the current position in the buffer
Definition: sbuffer.h:511
hashvalue_type qinfo_hash
We need the hash for both cache lookup and insert.
Definition: subnetmod.h:78
int(* del_timer)(struct ub_event *)
Deactivate the timeout event.
Definition: unbound-event.h:145
static int try_read_anchor(const char *file)
Try to read the root RFC5011 autotrust anchor file,.
Definition: unbound-anchor.c:1995
sldns_rr_class sldns_get_rr_class_by_name(const char *name)
retrieves a class by looking up its name.
Definition: rrdef.c:728
void mesh_state_make_unique(struct mesh_state *mstate)
Make a mesh state unique.
Definition: mesh.c:855
static int do_update(char *domain, char *file)
update domain to file
Definition: anchor-update.c:110
int mesh_state_attachment(struct mesh_state *super, struct mesh_state *sub)
Setup attachment super/sub relation between super and sub mesh state.
Definition: mesh.c:1069
const char * ub_event_get_version(void)
Returns event-base type.
Definition: ub_event.c:146
size_t bufsize
size of buffers
Definition: replay.h:317
struct auth_zone * auth_zones_find_zone(struct auth_zones *az, uint8_t *name, size_t name_len, uint16_t dclass)
Find the auth zone that is above the given qname.
Definition: authzone.c:486
void log_ident_set_default(const char *id)
Set default identity to print, default is 'unbound'.
Definition: log.c:185
size_t sldns_b32_ntop_calculate_size(size_t src_data_length)
calculates the size needed to store the result of b32_ntop
Definition: parseutil.c:332
struct port_comm * next
next in free list
Definition: outside_network.h:201
@ LDNS_RDF_TYPE_INT32
32 bits
Definition: rrdef.h:274
@ LDNS_RR_TYPE_NS
an authoritative name server
Definition: rrdef.h:87
static void autr_debug_print_ta(struct autr_ta *ta)
debug print a trust anchor key
Definition: autotrust.c:2256
static enum rrset_trust get_rrset_trust(struct msg_parse *msg, struct rrset_parse *rrset)
get trust value for rrset
Definition: msgreply.c:338
static int dump_msg_lruhash(RES *ssl, struct worker *worker, struct lruhash *h)
dump lruhash msg cache
Definition: cachedump.c:249
void val_neg_addreply(struct val_neg_cache *neg, struct reply_info *rep)
Insert NSECs from this message into the negative cache for reference.
Definition: val_neg.c:878
#define main
include the main program from the unbound daemon.
Definition: testbound.c:59
static void write_builtin_anchor(const char *file)
Write the builtin root anchor to a file.
Definition: unbound-anchor.c:2039
struct tcl_list * tcp_conn_limit
if set, check for connection limit on tcp accept.
Definition: netevent.h:267
struct outside_network * outnet
the outside network it is part of
Definition: outside_network.h:237
static int assemble_iterate_hasfirst(int iter(struct autr_ta **, uint8_t **, size_t *, size_t *), struct autr_ta *list)
see if iterator-list has any elements in it, or it is empty
Definition: autotrust.c:595
struct inplace_cb * next
next in list
Definition: module.h:229
int rrset_cache_update(struct rrset_cache *r, struct rrset_ref *ref, struct alloc_cache *alloc, time_t timenow)
Update an rrset in the rrset cache.
Definition: rrset.c:185
void edns_opt_list_free(struct edns_option *list)
Free edns option list allocated with malloc.
Definition: msgreply.c:1206
void ipsecmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
Operate on an event on a query (in qstate).
void * cb_arg
callback user argument
Definition: netevent.h:346
static int nsec3_get_salt(struct ub_packed_rrset_key *rrset, int r, uint8_t **salt, size_t *saltlen)
return nsec3 RR salt
Definition: val_nsec3.c:188
static int compress_any_dname(uint8_t *dname, sldns_buffer *pkt, int labs, struct regional *region, struct compress_tree_node **tree)
compress any domain name to the packet, return RETVAL_*
Definition: msgencode.c:336
static void verb_addr(const char *msg, struct ip_list *ip)
printout IP address with message
Definition: unbound-anchor.c:481
int algo_needs_set_secure(struct algo_needs *n, uint8_t algo)
Mark this algorithm as a success, sec_secure, and see if we are done.
Definition: val_sigcrypt.c:450
Iterator priv structure.
Definition: iter_priv.h:55
uint8_t query_failed
How many times did it fail.
Definition: autotrust.h:119
size_t dnscrypt_pad(uint8_t *buf, const size_t len, const size_t max_len, const uint8_t *nonce, const uint8_t *secretkey)
Add random padding to a buffer, according to a client nonce.
Definition: dnscrypt.c:392
#define MAXARG
Max number of arguments to pass to unbound.
Definition: testbound.c:107
void outbound_list_clear(struct outbound_list *list)
Clear the user owner outbound list structure.
Definition: outbound_list.c:54
int tcp_upstream
tcp upstream used, use tcp, or ssl_upstream for SSL
Definition: outside_network.h:342
#define MAX_TARGET_COUNT
max number of targets spawned for a query and its subqueries
Definition: iterator.h:57
struct comm_point * comm_point_create_http_out(struct comm_base *base, size_t bufsize, comm_point_callback_type *callback, void *callback_arg, sldns_buffer *temp)
Create an outgoing HTTP commpoint.
Definition: netevent.c:2874
#define UB_STATS_QCLASS_NUM
number of qclass that is stored for in array
Definition: unbound.h:652
int control_frame
are we reading a control frame
Definition: unbound-dnstap-socket.c:123
uint32_t bogus_ttl
TTL for bogus data; used instead of untrusted TTL from data.
Definition: validator.h:101
uint16_t dnskey_get_flags(struct ub_packed_rrset_key *k, size_t idx)
Get DNSKEY RR flags.
Definition: val_sigcrypt.c:147
struct auth_zone * auth_zone_create(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
create an auth zone.
Definition: authzone.c:411
static struct resp_addr * respip_find_or_create(struct respip_set *set, const char *ipstr, int create)
returns the node in the address tree for the specified netblock string; non-existent node will be cre...
Definition: respip.c:143
time_t backoff
increasing backoff for failures
Definition: authzone.h:290
static void az_find_domain(struct auth_zone *z, struct query_info *qinfo, int *node_exact, struct auth_data **node)
Find domain name (or closest match)
Definition: authzone.c:621
static int dtio_check_nb_connect(struct dt_io_thread *dtio)
check for pending nonblocking connect errors, returns 1 if it is okay.
Definition: dtstream.c:630
static uint16_t kd_get_flags(struct packed_rrset_data *data, size_t idx)
get dnskey flags from data
Definition: val_kentry.c:386
void * env
Environment for delfunc.
Definition: addrtree.h:81
size_t slabhash_get_size(struct slabhash *sl)
Retrieve slab hash total size.
Definition: slabhash.c:145
void alloc_clear_special(struct alloc_cache *alloc)
Free the special alloced items.
Definition: alloc.c:146
static void lowercase_rdata(uint8_t **p, size_t *remain, uint16_t rdatalen, uint16_t t)
lowercase rdata of type
Definition: testpkts.c:1074
void worker_stats_clear(struct worker *worker)
Init worker stats - includes server_stats_init, outside network and mesh.
Definition: worker.c:2027
char * config_taglist2str(struct config_file *cfg, uint8_t *taglist, size_t taglen)
convert tag bitlist to a malloced string with tag names.
Definition: config_file.c:1994
void mesh_walk_supers(struct mesh_area *mesh, struct mesh_state *mstate)
Call inform_super for the super query states that are interested in the results from this query state...
Definition: mesh.c:1408
void delegpt_count_addr(struct delegpt *dp, size_t *numaddr, size_t *numres, size_t *numavail)
count addresses, and number in result and available lists, for logging
Definition: iter_delegpt.c:240
struct outbound_entry * worker_send_query(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q)
Worker service routine to send serviced queries to authoritative servers.
Definition: worker.c:1998
char * str3
third string
Definition: config_file.h:751
int rpz_insert_rr(struct rpz *r, uint8_t *azname, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rdatawl, size_t rdatalen, uint8_t *rr, size_t rr_len)
Create policy from RR and add to this RPZ.
Definition: rpz.c:589
void comm_base_timept(struct comm_base *b, time_t **tt, struct timeval **tv)
Obtain two pointers.
Definition: netevent.c:236
int tube_handle_listen(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
for fptr wlist, callback function
enum sec_status verify_canonrrset(struct sldns_buffer *buf, int algo, unsigned char *sigblock, unsigned int sigblock_len, unsigned char *key, unsigned int keylen, char **reason)
Check a canonical sig+rrset and signature against a dnskey.
size_t num_detached_states
number of mesh_states that have no mesh_replies, and also an empty set of super-states,...
Definition: mesh.h:102
#define USEFUL_SERVER_TOP_TIMEOUT
maximum timeout before a host is deemed unsuitable, in msec.
Definition: iterator.h:96
int delay_close
delay close of udp-timeouted ports, if 0 no delayclose.
Definition: config_file.h:170
void server_stats_log(struct ub_server_stats *stats, struct worker *worker, int threadnum)
display the stats to the log
Definition: stats.c:110
char * sldns_wire2str_pkt(uint8_t *data, size_t len)
Convert wireformat packet to a string representation.
Definition: wire2str.c:199
uint16_t dclass
the class of this zone.
Definition: localzone.h:132
int auth_zone_write_file(struct auth_zone *z, const char *fname)
Write auth zone data to file, in zonefile format.
Definition: authzone.c:1724
void comm_timer_delete(struct comm_timer *timer)
delete timer.
Definition: fake_event.c:1525
struct val_neg_zone * zone
the zone that this denial is part of
Definition: val_neg.h:161
static void wipeout(struct val_neg_cache *neg, struct val_neg_zone *zone, struct val_neg_data *el, struct ub_packed_rrset_key *nsec)
Remove NSEC records between start and end points.
Definition: val_neg.c:673
int no_cache_store
whether modules should store answer in the cache
Definition: module.h:648
static void verify_respip_set_actions(struct respip_set *set, addr_action_t actions[], int actions_len)
Utility function that verifies that the respip set has actions as expected.
Definition: unitmain.c:571
struct config_strlist * trust_anchor_file_list
files with trusted DS and DNSKEYs in zonefile format, list
Definition: config_file.h:327
int inplace_cb_edns_back_parsed_call(struct module_env *env, struct module_qstate *qstate)
Call the registered functions in the inplace_cb_edns_back_parsed linked list.
Definition: msgreply.c:1116
struct timeval replies_sum_wait
sum of waiting times for the replies
Definition: mesh.h:120
Global state for the iterator.
Definition: iterator.h:109
static int val_error(struct module_qstate *qstate, int id)
Exit validation with an error status.
Definition: validator.c:276
static int dnskey_compare_skip_revbit(uint8_t *a, size_t a_len, uint8_t *b, size_t b_len)
Compare two RRs skipping the REVOKED bit.
Definition: autotrust.c:1351
uint8_t revoked
true if the trust point has been revoked
Definition: autotrust.h:121
time_t ttl
TTL (in seconds like time()) of the rrset.
Definition: packed_rrset.h:238
static int anchor_read_bind_file_wild(struct val_anchors *anchors, sldns_buffer *buffer, const char *pat)
Read a BIND9 like files with trust anchors in named.conf format.
Definition: val_anchor.c:785
static int chunkline_non_comment_RR(struct auth_chunk **chunk, size_t *chunk_pos, sldns_buffer *buf, struct sldns_file_parse_state *pstate)
find noncomment RR line in chunks, collates lines if ( ) format
Definition: authzone.c:4286
int ub_ctx_add_ta_file(struct ub_ctx *ctx, const char *fname)
Add trust anchors to the given context.
Definition: libunbound.c:409
struct comm_point * comm_point_create_udp_ancil(struct comm_base *base, int fd, sldns_buffer *buffer, comm_point_callback_type *callback, void *callback_arg)
Create an UDP with ancillary data comm point.
Definition: netevent.c:2574
static struct auth_data * az_nsec3_findnode(struct auth_zone *z, uint8_t *hashnm, size_t hashnmlen)
Find the datanode that covers the nsec3hash-name.
Definition: authzone.c:2681
struct trust_anchor * parent
the ancestor in the trustanchor tree
Definition: val_anchor.h:106
static struct auth_master * xfr_probe_current_master(struct auth_xfer *xfr)
pick up the master that is being scanned right now, task_probe
Definition: authzone.c:3875
int qname_minimisation
minimise outgoing QNAME and hide original QTYPE if possible
Definition: config_file.h:547
struct outside_network * outside_network_create(struct comm_base *base, size_t bufsize, size_t num_ports, char **ifs, int num_ifs, int do_ip4, int do_ip6, size_t num_tcp, int dscp, struct infra_cache *infra, struct ub_randstate *rnd, int use_caps_for_id, int *availports, int numavailports, size_t unwanted_threshold, int tcp_mss, void(*unwanted_action)(void *), void *unwanted_param, int do_udp, void *sslctx, int delayclose, int tls_use_sni, struct dt_env *dtenv)
Create outside_network structure with N udp ports.
Definition: outside_network.c:734
int caps_failed_rcode(struct reply_info *rep)
see if reply has a 'useful' rcode for capsforid comparison, so not SERVFAIL or REFUSED,...
Definition: iter_utils.c:1060
int apply_edns_options(struct edns_data *edns_out, struct edns_data *edns_in, struct config_file *cfg, struct comm_point *c, struct regional *region)
Apply common EDNS options.
Definition: edns.c:75
int delegpt_add_ns(struct delegpt *dp, struct regional *regional, uint8_t *name, uint8_t lame)
Add a name to the delegation point.
Definition: iter_delegpt.c:103
void void log_reply(const char *format,...) ATTR_FORMAT(printf
Log reply.
void config_collate_func(char *line, void *arg)
function to collate the text strings into a strlist_head.
Definition: config_file.c:762
@ respip_always_nodata
answer with nodata response
Definition: localzone.h:556
sldns_rdf_type _variable
Special rdf types.
Definition: rrdef.h:462
@ COLLECT_CLASS_STATE
Collecting query class information, for qclass=ANY, when it spawns off queries for every class,...
Definition: iterator.h:208
A auth data RRset.
Definition: authzone.h:171
int fptr_whitelist_modenv_detect_cycle(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec))
Check function pointer whitelist for module_env detect_cycle callback values.
Definition: fptr_wlist.c:380
enum minimisation_state minimisation_state
QNAME minimisation state, RFC7816.
Definition: iterator.h:382
int createResponse(struct module_qstate *qstate, sldns_buffer *pkt)
Create response according to the ldns packet content.
Definition: pythonmod_utils.c:111
int sldns_str2wire_nsec_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSEC from string to wireformat.
Definition: str2wire.c:1277
int iter_lookup_parent_glue_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
Add parent-side glue if that exists in the cache.
Definition: iter_utils.c:1187
void rrset_cache_update_wildcard(struct rrset_cache *rrset_cache, struct ub_packed_rrset_key *rrset, uint8_t *ce, size_t ce_len, struct alloc_cache *alloc, time_t timenow)
Update or add an rrset in the rrset cache using a wildcard dname.
Definition: rrset.c:241
void comm_point_drop_reply(struct comm_reply *repinfo)
Drop reply.
Definition: fake_event.c:1020
static void do_dump_requestlist(RES *ssl, struct worker *worker)
do the dump_requestlist command
Definition: remote.c:2396
static struct module_func_block dns64_block
The dns64 function block.
Definition: dns64.c:1020
uint8_t * name
name in uncompressed wireformat
Definition: dnstree.h:61
int config_get_option_list(struct config_file *cfg, const char *opt, struct config_strlist **list)
Get an option and return strlist.
Definition: config_file.c:771
static int host_name_is_safe(char *s)
check a host name for safety
Definition: petal.c:354
#define CMSG_LEN(len)
if CMSG_LEN is not defined on this platform, a workaround
Definition: netevent.c:75
int macro_assign(rbtree_type *store, char *name, char *value)
Set macro value.
Definition: replay.c:909
void tube_remove_bg_write(struct tube *tube)
Remove bg write setup from event base.
Definition: tube.c:126
int got_xfr_serial
did we detect the current AXFR/IXFR serial number yet, 0 not yet, 1 we saw the first,...
Definition: authzone.h:402
void caps_strip_reply(struct reply_info *rep)
Remove unused bits from the reply if possible.
Definition: iter_utils.c:1025
enum sec_status nsec3_prove_nxornodata(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, int *nodata)
Prove NXDOMAIN or NODATA.
Definition: val_nsec3.c:1406
int status
if a malloc error occurred, 0 is OK
Definition: config_file.c:759
static void write_root_anchor(const char *root_anchor_file, BIO *ds)
write root anchor file
Definition: unbound-anchor.c:1870
sldns_lookup_table * sldns_edns_options
EDNS option codes.
Definition: wire2str.c:175
void outnet_serviced_query_stop(struct serviced_query *sq, void *cb_arg)
Remove service query callback.
Definition: outside_network.c:2177
XML_Parser parser
the parser, reference
Definition: unbound-anchor.c:1195
int packed_rr_to_string(struct ub_packed_rrset_key *rrset, size_t i, time_t now, char *dest, size_t dest_len)
Convert RR from RRset to string.
Definition: packed_rrset.c:271
static struct auth_xfer * auth_zones_find_or_add_xfer(struct auth_zones *az, struct auth_zone *z)
find or create xfer zone with name str.
Definition: authzone.c:541
@ rrset_trust_add_AA
Additional information from an authoritative answer.
Definition: packed_rrset.h:148
void * fstrm_create_control_frame_start(char *contenttype, size_t *len)
This creates an FSTRM control frame of type START.
Definition: dnstap_fstrm.c:49
rpz_trigger
RPZ triggers, only the QNAME trigger is currently supported in Unbound.
Definition: rpz.h:57
int ub_signal_del(struct ub_event *)
Deactivate a signal event.
Definition: ub_event.c:421
An address span with response control information.
Definition: respip.h:33
size_t namelen
length of zone name
Definition: localzone.h:127
static int iter_add_prepend_answer(struct module_qstate *qstate, struct iter_qstate *iq, struct ub_packed_rrset_key *rrset)
Add rrset to ANSWER prepend list.
Definition: iterator.c:482
enum sec_status val_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *keys, uint8_t *sigalg, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify RRset with keys.
Definition: val_utils.c:336
@ sec_status_secure
SECURE means that the object (RRset or message) validated according to local policy.
Definition: packed_rrset.h:196
static void testremove_unlim(struct slabhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitslabhash.c:209
struct config_stub * cfg_stub_find(struct config_stub ***pp, const char *nm)
Find stub in config list, also returns prevptr (for deletion).
Definition: config_file.c:1271
int32_t val_sig_skew_min
the minimum for signature clock skew
Definition: config_file.h:348
rbnode_type * rbtree_previous(rbnode_type *node)
Returns previous smaller node in the tree.
Definition: rbtree.c:590
void subnetmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
subnet module
@ module_event_error
error
Definition: module.h:567
An answer that is pending to happen.
Definition: replay.h:366
void rate_delkeyfunc(void *k, void *arg)
delete key, and destroy the lock
int dnskey_algo_is_supported(struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx)
See if DNSKEY algorithm is supported.
Definition: val_sigcrypt.c:382
struct acl_list * acl
access control, which client IPs are allowed to connect
Definition: daemon.h:115
static enum rpz_action rpz_config_to_action(char *a)
RPZ action enum for config string.
Definition: rpz.c:75
static void add_bg_result(struct libworker *w, struct ctx_query *q, sldns_buffer *pkt, int err, char *reason, int was_ratelimited)
add result to the bg worker result queue
Definition: libworker.c:713
struct addr_tree_node node
node in address tree
Definition: acl_list.h:90
static void autr_holddown_exceed(struct module_env *env, struct trust_anchor *tp, int *c)
See if time alone makes ADDPEND to VALID transition.
Definition: autotrust.c:1958
time_t MIN_TTL
MIN TTL default for messages and rrsets.
Definition: msgreply.c:61
static int dtio_find_in_queue(struct dt_io_thread *dtio, struct dt_msg_queue *mq)
find message in queue, false if no message, true if message to send
Definition: dtstream.c:431
int tube_read_msg(struct tube *tube, uint8_t **buf, uint32_t *len, int nonblock)
Read length bytes followed by message.
Definition: tube.c:331
int dname_signame_label_count(uint8_t *dname)
Count labels for the RRSIG signature label field.
Definition: dname.c:750
int cp_is_ip6
is the cp for ip6 or ip4
Definition: authzone.h:344
struct module_func_block * dns64_get_funcblock(void)
Get the dns64 function block.
Definition: dns64.c:1030
int dump_cache(RES *ssl, struct worker *worker)
Dump cache(s) to text.
Definition: cachedump.c:294
static int str_contains_data(char *str, char comment)
Check if a line contains data (besides comments)
Definition: autotrust.c:261
enum response_type response_type_from_server(int rdset, struct dns_msg *msg, struct query_info *request, struct delegpt *dp)
Classifies a response message (from the wire) based on the current request.
Definition: iter_resptype.c:107
static int move_into_cache(struct ub_packed_rrset_key *k, struct packed_rrset_data *d, struct worker *worker)
move entry into cache
Definition: cachedump.c:379
int config_set_option(struct config_file *config, const char *option, const char *value)
Set the given keyword to the given value.
Definition: config_file.c:434
struct ub_packed_rrset_key * reply_find_rrset_section_ns(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside the authority section.
Definition: msgreply.c:787
enum acl_access acl_get_control(struct acl_addr *acl)
Lookup access control status for acl structure.
Definition: acl_list.c:470
Replay macro variable.
Definition: replay.h:397
int sldns_str2wire_nsec3_salt_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSEC3_SALT from string to wireformat.
Definition: str2wire.c:1923
static int compress_owner(struct ub_packed_rrset_key *key, sldns_buffer *pkt, struct regional *region, struct compress_tree_node **tree, size_t owner_pos, uint16_t *owner_ptr, int owner_labs)
compress owner name of RR, return RETVAL_OUTMEM RETVAL_TRUNC
Definition: msgencode.c:287
struct config_file * cfg
The config settings.
Definition: daemon.h:78
int sldns_wire2str_edns_dau_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS DAU option data to string.
Definition: wire2str.c:1817
List of three strings for config options.
Definition: config_file.h:743
void * cb_arg
user argument for user functions
Definition: lruhash.h:161
size_t ipset_get_mem(struct module_env *env, int id)
return memory estimate for ipset module
Definition: ipset.c:363
@ VAL_CLASS_NAMEERROR
A NXDOMAIN response.
Definition: val_utils.h:73
int libworker_attach_mesh(struct ub_ctx *ctx, struct ctx_query *q, int *async_id)
Attach context_query to mesh for callback in event-driven setup.
Definition: libworker.c:665
int check_auth_name_for_ssl(char *auth_name)
check if authname SSL functionality is available, false if not
Definition: net_help.c:1249
struct key_entry_key * key_entry_copy_toregion(struct key_entry_key *kkey, struct regional *region)
Copy a key entry, to be region-allocated.
Definition: val_kentry.c:111
char * create_file
the creation file
Definition: lock_verify.c:75
char * canonname
canonical name for the result (the final cname).
Definition: unbound.h:147
size_t key_cache_get_mem(struct key_cache *kcache)
Get memory in use by the key cache.
Definition: val_kcache.c:157
void dynlibmod_deinit(struct module_env *env, int id)
dynlib module deinit
Definition: dynlibmod.c:166
static size_t sumtrees_inuse(struct val_neg_cache *neg)
sum up the zone trees, in_use only
Definition: unitneg.c:321
static size_t rrset_get_count(struct ub_packed_rrset_key *rrset)
return number of rrs in an rrset
Definition: val_nsec3.c:112
int fast_server_permil
percent*10, how many times in 1000 to pick from the fastest destinations
Definition: config_file.h:176
int forwards_apply_cfg(struct iter_forwards *fwd, struct config_file *cfg)
Process forwards config.
Definition: iter_fwd.c:325
int sldns_str2wire_hex_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_HEX from string to wireformat.
Definition: str2wire.c:1248
void sldns_buffer_copy(sldns_buffer *result, sldns_buffer *from)
Copy contents of the from buffer to the result buffer and then flips the result buffer.
Definition: sbuffer.c:151
size_t dns64_get_mem(struct module_env *env, int id)
dns64 alloc size routine
Definition: dns64.c:1009
int data
data value
Definition: slabhash.h:214
@ LDNS_RR_TYPE_CDNSKEY
RFC 7344.
Definition: rrdef.h:195
@ INIT_REQUEST_2_STATE
Root priming events reactivate here, most other events pass through this naturally as the 2nd part of...
Definition: iterator.h:181
struct outbound_list outlist
list of pending queries to authoritative servers.
Definition: iterator.h:379
struct config_strlist * dns64_ignore_aaaa
ignore AAAAs for these domain names and use A record anyway
Definition: config_file.h:480
struct config_strlist * masters
list of masters
Definition: config_file.h:660
struct local_zone * local_zones_find_le(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, int *exact)
Find zone that with exactly or smaller name/class User must lock the tree or result zone.
Definition: localzone.c:1147
static void xfr_transfer_move_to_next_lookup(struct auth_xfer *xfr, struct module_env *env)
move to the next lookup of hostname for task_transfer
Definition: authzone.c:3765
static int local_encode(struct query_info *qinfo, struct module_env *env, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct ub_packed_rrset_key *rrset, int ansec, int rcode)
encode answer consisting of 1 rrset
Definition: localzone.c:1196
rbnode_type * rbtree_first(rbtree_type *rbtree)
Returns first (smallest) node in the tree.
Definition: rbtree.c:549
@ repevt_infra_rtt
store infra rtt cache entry: addr and string (int)
Definition: replay.h:214
#define alloc_special_clean(x)
clean the special type.
Definition: alloc.h:58
INLINE size_t sldns_buffer_capacity(sldns_buffer *buffer)
returns the number of bytes the buffer can hold.
Definition: sbuffer.h:297
time_t MIN_TTL
Minimum TTL that is allowed.
Definition: msgreply.c:61
int order_lock_cmp(const void *e1, const void *e2)
Due to module breakage by fptr wlist, these test app declarations are presented here.
Definition: unbound-dnstap-socket.c:1568
static int lz_nodefault(struct config_file *cfg, const char *name)
lookup a zone in cfg->nodefault list
Definition: localzone.c:738
int forwards_add_zone(struct iter_forwards *fwd, uint16_t c, struct delegpt *dp)
Add zone to forward structure.
Definition: iter_fwd.c:472
struct addrtree * addrtree_create(addrlen_t max_depth, void(*delfunc)(void *, void *), size_t(*sizefunc)(void *), void *env, uint32_t max_node_count)
Create a new tree.
Definition: addrtree.c:121
static struct auth_data * az_domain_create(struct auth_zone *z, uint8_t *nm, size_t nmlen)
create domain with the given name
Definition: authzone.c:585
struct dns_msg * dns_copy_msg(struct dns_msg *from, struct regional *region)
Copy a dns_msg to this regional.
Definition: iter_utils.c:638
static int read_acl_tag_datas(struct acl_list *acl, struct config_file *cfg)
read acl tag datas config
Definition: acl_list.c:414
int sldns_str2wire_ilnp64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ILNP64 from string to wireformat.
Definition: str2wire.c:1949
@ LDNS_RR_TYPE_EUI48
draft-jabley-dnsext-eui48-eui64-rrtypes
Definition: rrdef.h:212
size_t id
id number
Definition: perf.c:133
#define TCP_QUERY_TIMEOUT_MINIMUM
The minimum actual TCP timeout to use, regardless of what we advertise, in msec.
Definition: netevent.c:91
size_t num_neg_cache_nxdomain
number of times neg cache records were used to generate NXDOMAIN responses.
Definition: val_neg.h:88
struct sockaddr_storage addr
delegation point address
Definition: iter_delegpt.h:141
int ub_ctx_add_ta(struct ub_ctx *ctx, const char *ta)
Add a trust anchor to the given context.
Definition: libunbound.c:390
int val_nsec_proves_no_wc(struct ub_packed_rrset_key *nsec, uint8_t *qname, size_t qnamelen)
Determine if the given NSEC proves that a wildcard match does not exist.
Definition: val_nsec.c:510
struct port_comm * unused_fds
linked list of available commpoints, unused file descriptors, for use as outgoing UDP ports.
Definition: outside_network.h:102
@ listen_type_tcp
tcp type
Definition: listen_dnsport.h:87
PyObject * func_deinit
Module deinit function.
Definition: pythonmod.c:90
List of TCP proxy fd pairs to TCP connect client to server.
Definition: delayer.c:116
int iter_indicates_dnssec(struct module_env *env, struct delegpt *dp, struct dns_msg *msg, uint16_t dclass)
See if delegation is expected to have DNSSEC information (RRSIGs) in its answers, or not.
Definition: iter_utils.c:799
static void do_view_datas_remove(RES *ssl, struct worker *worker, char *arg)
Remove RR data from stdin from view.
Definition: remote.c:1509
#define SQ
what to put on statistics lines between var and value, ": " or "="
Definition: remote.c:107
static struct ta_key * anchor_new_ta_key(uint8_t *rdata, size_t rdata_len, uint16_t type)
create new trustanchor key
Definition: val_anchor.c:274
int qname_minimisation_strict
minimise QNAME in strict mode, minimise according to RFC.
Definition: config_file.h:550
Information to reference an rrset.
Definition: msgreply.h:104
int optind
getopt global, in case header files fail to declare it.
const sldns_rdf_type * _wireformat
Wireformat specification for the rr, i.e.
Definition: rrdef.h:460
@ VAL_INIT_STATE
initial state for validation
Definition: validator.h:133
int fptr_whitelist_alloc_cleanup(void(*fptr)(void *))
Check function pointer whitelist for alloc clear on id overflow call values.
Definition: fptr_wlist.c:560
static int set_next_probe(struct module_env *env, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset)
set next probe for trust anchor
Definition: autotrust.c:2046
static int ta_is_dnskey_sep(struct autr_ta *ta)
Check if TA is KSK DNSKEY.
Definition: autotrust.c:298
unsigned _fixed
If the buffer is fixed it cannot be resized.
Definition: sbuffer.h:131
ub_ctx_err
The error constants.
Definition: context.h:182
PyObject * func_init
Module init function.
Definition: pythonmod.c:88
static int rrset_canonical_sort_cmp(const void *x, const void *y)
compare rrsets and sort canonically.
Definition: iter_utils.c:946
void(* lruhash_deldatafunc_type)(void *, void *)
old data is deleted.
Definition: lruhash.h:138
int dname_pkt_compare(struct sldns_buffer *pkt, uint8_t *d1, uint8_t *d2)
Compare dnames in packet (compressed).
Definition: dname.c:233
Definition: dynlibmod.h:95
size_t size_bytes
Size of tree in bytes.
Definition: addrtree.h:74
static void moment_assign(struct replay_runtime *runtime, struct replay_moment *mom)
pass time
Definition: fake_event.c:529
int unittest_wrapper_addrtree_cmpbit(const addrkey_t *key1, const addrkey_t *key2, addrlen_t n)
Wrappers for static functions to unit test.
Definition: addrtree.c:517
The outbound list.
Definition: outbound_list.h:52
int respip_global_apply_cfg(struct respip_set *set, struct config_file *cfg)
Apply response-ip config settings to the global (default) view.
Definition: respip.c:398
static hashvalue_type pkt_hash_rrset_first(sldns_buffer *pkt, uint8_t *dname)
create partial dname hash for rrset hash
Definition: msgparse.c:182
#define RET_ERR_SHIFT(e, move)
Move parse error but keep its ID.
Definition: str2wire.c:31
static void set_tp_times(struct trust_anchor *tp, time_t rrsig_exp_interval, time_t origttl, int *changed)
update the time values for the trustpoint
Definition: autotrust.c:1469
struct comm_point * comm_point_create_tcp_out(struct comm_base *base, size_t bufsize, comm_point_callback_type *callback, void *callback_arg)
Create an outgoing TCP commpoint.
Definition: netevent.c:2809
struct mesh_state * s
the mesh state
Definition: mesh.h:210
static int dump_msg_ref(RES *ssl, struct ub_packed_rrset_key *k)
dump message to rrset reference
Definition: cachedump.c:140
int parse_create_msg(sldns_buffer *pkt, struct msg_parse *msg, struct alloc_cache *alloc, struct query_info *qinf, struct reply_info **rep, struct regional *region)
Allocate and decompress parsed message and rrsets.
Definition: msgreply.c:441
static int http_chunked_segment(struct comm_point *c)
handle nonchunked data segment, return 0=fail, 1=wait, 2=process more
Definition: netevent.c:2116
uint8_t * _data
The data contained in the buffer.
Definition: sbuffer.h:128
@ listen_type_udpancil
udp ipv6 (v4mapped) for use with ancillary data
Definition: listen_dnsport.h:89
size_t sldns_rr_dnskey_key_size_raw(const unsigned char *keydata, const size_t len, int alg)
get the length of the keydata in bits
Definition: keyraw.c:38
void packed_rrset_ttl_add(struct packed_rrset_data *data, time_t add)
Fixup TTLs in fixed data packed_rrset_data blob.
Definition: packed_rrset.c:219
static void chunk_rrlist_gonext(struct auth_chunk **rr_chunk, int *rr_num, size_t *rr_pos, size_t rr_nextpos)
RR list iterator, move to next RR.
Definition: authzone.c:4443
struct dns_msg * response
The response.
Definition: iterator.h:251
int ub_openssl_lock_init(void)
Initialize openssl locking for thread safety.
Definition: net_help.c:1334
int optind
getopt global, in case header files fail to declare it.
static void delete_fake_pending(struct fake_pending *pend)
delete a fake pending
Definition: fake_event.c:174
Iterator hints structure.
Definition: iter_hints.h:53
size_t infra_sizefunc(void *k, void *d)
calculate size for the hashtable, does not count size of lameness, so the hashtable is a fixed number...
static struct lruhash_entry * dnsc_nonces_lookup(struct slabhash *cache, const uint8_t nonce[crypto_box_HALF_NONCEBYTES], const uint8_t magic_query[DNSCRYPT_MAGIC_HEADER_LEN], const uint8_t pk[crypto_box_PUBLICKEYBYTES], uint32_t hash)
Lookup a record in nonces_cache.
Definition: dnscrypt.c:215
int key_entry_compfunc(void *k1, void *k2)
function for lruhash operation
Definition: val_kentry.c:68
XML parse private data during the parse.
Definition: unbound-anchor.c:1193
void dynlibmod_clear(struct module_qstate *qstate, int id)
dynlib module cleanup query state
Definition: dynlibmod.c:194
static void xfr_process_notify(struct auth_xfer *xfr, struct module_env *env, int has_serial, uint32_t serial, struct auth_master *fromhost)
process a notify serial, start new probe or note serial.
Definition: authzone.c:3543
int dnscrypt_port
port on which to provide dnscrypt service
Definition: config_file.h:560
@ LDNS_RDF_TYPE_NONE
none
Definition: rrdef.h:266
uint32_t sldns_wirerr_get_ttl(uint8_t *rr, size_t len, size_t dname_len)
Get the ttl of the RR.
Definition: str2wire.c:812
int retry
number of UDP retries
Definition: outside_network.h:380
struct key_entry_key * key_cache_obtain(struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class, struct regional *region, time_t now)
Lookup key entry in the cache.
Definition: val_kcache.c:128
struct serviced_query * outnet_serviced_query(struct outside_network *outnet, struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, int tcp_upstream, int ssl_upstream, char *tls_auth_name, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct module_qstate *qstate, comm_point_callback_type *callback, void *callback_arg, sldns_buffer *buff, struct module_env *env)
Perform a serviced query to the authoritative servers.
Definition: outside_network.c:2104
rrset_id_type id
the ID of this rrset.
Definition: packed_rrset.h:122
struct regional * region
in this region the zone's data is allocated.
Definition: localzone.h:152
struct module_func_block * val_get_funcblock(void)
Get the validator function block.
Definition: validator.c:3274
void iter_scrub_ds(struct dns_msg *msg, struct ub_packed_rrset_key *ns, uint8_t *z)
Remove DS records that are inappropriate before they are cached.
Definition: iter_utils.c:1243
struct auth_zones * auth_zones
auth zones
Definition: module.h:498
static int neg_params_ok(struct val_neg_zone *zone, struct ub_packed_rrset_key *rrset)
check nsec3 parameters on nsec3 rrset with current zone values
Definition: val_neg.c:1302
uint16_t qclass
query class, host order.
Definition: msgparse.h:124
struct rrset_parse * rrset_all_next
next in list of all rrsets
Definition: msgparse.h:145
static void check_auth(struct config_file *cfg)
check auth zones
Definition: unbound-checkconf.c:852
size_t anchor_list_keytags(struct trust_anchor *ta, uint16_t *list, size_t num)
Get a list of keytags for the trust anchor.
Definition: val_anchor.c:1288
ub_event_callback_type cb_event
for event callbacks the type is ub_event_callback_type
Definition: context.h:161
char * sldns_wire2str_rcode(int rcode)
Convert wire packet rcode to a string, 'NOERROR', 'NXDOMAIN'...
Definition: wire2str.c:240
void daemon_fork(struct daemon *daemon)
Fork workers and start service.
Definition: daemon.c:571
static void check_lru_table(struct lruhash *table)
check integrity of hash table
Definition: unitslabhash.c:151
int sldns_str2wire_class_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_CLASS from string to wireformat.
Definition: str2wire.c:1352
static void signit(ldns_rr_list *rrs, ldns_key_list *keys)
sign the rrs with the keys
Definition: signit.c:198
int ev_added
has the event been added
Definition: unbound-dnstap-socket.c:147
static void checkzonetree(struct val_neg_zone *zone)
check if tree of data in zone is valid
Definition: unitneg.c:417
int sldns_str2wire_aaaa_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_AAAA from string to wireformat.
Definition: str2wire.c:1077
rbnode_type node
rbtree node element, key is this struct: the name
Definition: val_neg.h:144
@ LDNS_RR_TYPE_MR
a mail rename domain name (EXPERIMENTAL)
Definition: rrdef.h:101
void key_entry_set_reason(struct key_entry_key *kkey, char *reason)
Set reason why a key is bad.
Definition: val_kentry.c:241
Tree of domain names.
Definition: dnstree.h:55
static void rr_tests(void)
read rrs to and from string, to and from wireformat
Definition: unitldns.c:209
struct ub_packed_rrset_key * ds_rrset
the DS RRset
Definition: val_anchor.h:118
int netblockstrtoaddr(const char *str, int port, struct sockaddr_storage *addr, socklen_t *addrlen, int *net)
Convert ip netblock (ip/netsize) string and port to sockaddr.
Definition: net_help.c:285
int dname_strict_subdomain(uint8_t *d1, int labs1, uint8_t *d2, int labs2)
See if domain name d1 is a strict subdomain of d2.
Definition: dname.c:679
uid_t cfg_uid
from cfg username, after daemonize setup performed
Definition: config_file.c:74
void * cur_msg
the buffer that currently getting written, or NULL if no (partial) message written now
Definition: dtstream.h:160
void sldns_fskipcs(FILE *fp, const char *s)
skips all of the characters in the given string in the fp, moving the position to the first character...
Definition: parse.c:419
int sldns_str2wire_alg_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ALG from string to wireformat.
Definition: str2wire.c:1386
#define FLAGS_GET_RCODE(f)
get RCODE bits from uint16 flags
Definition: net_help.h:73
enum localzone_type type
how to process zone
Definition: localzone.h:141
Module functionality block.
Definition: module.h:671
static int is_dir(const char *fname)
true if fname is a directory
Definition: unbound-checkconf.c:421
static void do_list_local_zones(RES *ssl, struct local_zones *zones)
do the list_local_zones command
Definition: remote.c:2691
static void do_flush_negative(RES *ssl, struct worker *worker)
remove all negative(NODATA,NXDOMAIN), and servfail messages from cache
Definition: remote.c:1889
char * macro_lookup(rbtree_type *store, char *name)
Look up a macro value.
Definition: replay.c:893
Data stored for an rrset during parsing.
Definition: msgparse.h:141
List of open items in TCP channel.
Definition: listen_dnsport.h:278
int harden_short_bufsize
harden against very small edns buffer sizes
Definition: config_file.h:248
void auth_xfer_delete(struct auth_xfer *xfr)
delete xfer structure (not its tree entry)
Definition: authzone.c:2080
void config_delstubs(struct config_stub *list)
Delete items in config stub list.
Definition: config_file.c:1360
static int remote_read(SSL *ssl, int fd, char *buf, size_t len)
read from ssl or fd, fatalexit on error, 0 EOF, 1 success
Definition: unbound-control.c:664
@ DSNS_FIND_STATE
Find NS record to resolve DS record from, walking to the right NS spot until we find it.
Definition: iterator.h:212
static void readfile(rbtree_type *tree, const char *fname)
read the logfile
Definition: memstats.c:190
enum localzone_type type
override for local zone type
Definition: localzone.h:194
void auth_xfer_transfer_lookup_callback(void *arg, int rcode, sldns_buffer *buf, enum sec_status ATTR_UNUSED(sec), char *ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
callback for task_transfer lookup of host name, of A or AAAA
Definition: authzone.c:5344
uint16_t dnskey_calc_keytag(struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx)
Get dnskey keytag, footprint value.
Definition: val_sigcrypt.c:373
int parse_extract_edns(struct msg_parse *msg, struct edns_data *edns, struct regional *region)
After parsing the packet, extract EDNS data from packet.
Definition: msgparse.c:967
static void qlist_add_line(struct perfinfo *info, char *line, int no)
setup query list in info
Definition: perf.c:531
static void alloc_clear_special_list(struct alloc_cache *alloc)
free the special list
Definition: alloc.c:131
sldns_lookup_table * sldns_wireparse_errors
error string from wireparse
Definition: wire2str.c:154
#define FLAGS_SET_RCODE(f, r)
set RCODE bits in uint16 flags
Definition: net_help.h:75
int serviced_tcp_callback(struct comm_point *c, void *arg, int error, struct comm_reply *rep)
TCP reply or error callback for serviced queries.
Definition: outside_network.c:1803
int rtt_timeout(const struct rtt_info *rtt)
Get timeout to use for sending a UDP packet.
Definition: rtt.c:72
uint64_t alloc
number of bytes allocated
Definition: memstats.c:60
int val_neg_data_compare(const void *a, const void *b)
Comparison function for rbtree val neg data elements.
Definition: val_neg.c:65
void edns_opt_list_free(struct edns_option *list)
Free edns option list allocated with malloc.
Definition: msgreply.c:1206
size_t sldns_b32_pton_calculate_size(size_t src_text_length)
calculates the size needed to store the result of b32_pton
Definition: parseutil.c:454
struct tube * tube_create(void)
Create a pipe.
Definition: tube.c:57
int serviced_cmp(const void *key1, const void *key2)
compare function of serviced query rbtree
Definition: outside_network.c:106
void fatal_exit(const char *format,...)
implementation of fatal_exit
Definition: log.c:341
size_t comm_point_get_mem(struct comm_point *c)
Get size of memory used by comm point.
Definition: netevent.c:3263
time_t retry
retry time (from SOA), time to wait with next_probe if no master responds
Definition: authzone.h:259
struct addrnode * addrtree_find(struct addrtree *tree, const addrkey_t *addr, addrlen_t sourcemask, time_t now)
Find a node containing an element in the tree.
Definition: addrtree.c:474
reference to a lock in a rbtree set
Definition: lock_verify.c:90
void cachedb_deinit(struct module_env *env, int id)
Deinit the cachedb module.
static char * do_macro_recursion(rbtree_type *store, struct replay_runtime *runtime, char *at, size_t remain)
do macro recursion
Definition: replay.c:630
static struct domain_limit_data * domain_limit_findcreate(struct infra_cache *infra, char *name)
find or create element in domainlimit tree
Definition: infra.c:152
void ub_event_set_fd(struct ub_event *, int fd)
Change or set the file descriptor on the event.
Definition: ub_event.c:374
static ssize_t tap_receive(struct tap_data *data, void *buf, size_t len)
receive bytes on the tap connection, prints errors if bad, returns 0: closed/error,...
Definition: unbound-dnstap-socket.c:748
void infra_delete(struct infra_cache *infra)
Delete infra cache.
Definition: infra.c:282
void server_stats_prefetch(struct ub_server_stats *stats, struct worker *worker)
add query if was cached and also resulted in a prefetch
Definition: stats.c:101
static int check_formerr_gone
do not accept formerr
Definition: unitmsgparse.c:61
struct dt_io_list_item * io_list
list of queues that is registered to get written
Definition: dtstream.h:122
char * reason
not NULL sometimes to give reason why bogus
Definition: val_kentry.h:82
@ comm_local
AF_UNIX socket - for internal commands.
Definition: netevent.h:235
static int skip_ttl_rdata(sldns_buffer *pkt)
skip rr ttl and rdata
Definition: msgparse.c:692
struct config_strlist * hosts
list of stub nameserver hosts (domain name)
Definition: config_file.h:638
long long num_neg_cache_nxdomain
number of times neg cache records were used to generate NXDOMAIN responses.
Definition: unbound.h:782
#define ALLOC_SPECIAL_MAX
how many blocks to cache locally.
Definition: alloc.h:66
static void send_eof(SSL *ssl, int fd)
send end-of-file marker to server
Definition: unbound-control.c:746
int local_zones_zone_answer(struct local_zone *z, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct local_data *ld, enum localzone_type lz_type)
Answer using the local zone only (not local data used).
Definition: localzone.c:1518
uint16_t dnskey_get_flags(struct ub_packed_rrset_key *k, size_t idx)
Get DNSKEY RR flags.
Definition: val_sigcrypt.c:147
static const char * prog_name
string to show in warnings and errors
Definition: testpkts.c:41
@ acl_refuse_non_local
disallow access to zones that aren't local, 'REFUSED' reply
Definition: acl_list.h:62
Query waiting for TCP buffer.
Definition: outside_network.h:269
static int ds_response_to_ke(struct module_qstate *qstate, struct val_qstate *vq, int id, int rcode, struct dns_msg *msg, struct query_info *qinfo, struct key_entry_key **ke)
In inform supers, with the resulting message and rcode and the current keyset in the super state,...
Definition: validator.c:2659
@ module_finished
module is finished with query
Definition: module.h:547
static int uitoa(unsigned n, char *s)
Convert an unsigned integer to a string.
Definition: dns64.c:177
uint64_t alloc_get_id(struct alloc_cache *alloc)
Set ID number of special type to a fresh new ID number.
Definition: alloc.c:195
int main(int argc, char *argv[])
main program to verify all traces passed
Definition: lock_verify.c:392
int want_quit
want to quit, stop handling new content
Definition: libworker.h:79
int infra_get_lame_rtt(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, uint16_t qtype, int *lame, int *dnsseclame, int *reclame, int *rtt, time_t timenow)
Get Lameness information and average RTT if host is in the cache.
Definition: infra.c:672
static int chunkline_get_line(struct auth_chunk **chunk, size_t *chunk_pos, sldns_buffer *buf)
read one line from chunks into buffer at current position
Definition: authzone.c:4112
static int log_time_asc
print time in UTC or in secondsfrom1970
Definition: log.c:83
struct auth_master * allow_notify_list
the list of masters for checking notifies.
Definition: authzone.h:245
int rrset_array_lock(struct rrset_ref *ref, size_t count, time_t timenow)
Obtain readlock on a (sorted) list of rrset references.
Definition: rrset.c:307
static int comm_point_tcp_handle_read(int fd, struct comm_point *c, int short_ok)
Handle tcp reading callback.
Definition: netevent.c:1412
int prefer_ip6
prefer ip6 upstream queries.
Definition: config_file.h:91
size_t namelen
length of name
Definition: iter_fwd.h:72
void comm_point_delete(struct comm_point *c)
Close and deallocate (free) the comm point.
Definition: netevent.c:3100
void anchors_delete_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
Delete insecure point trust anchor.
Definition: val_anchor.c:1241
uint8_t ** qlist_data
list of query packets (data)
Definition: perf.c:123
size_t num_neg_cache_noerror
number of times neg cache records were used to generate NOERROR responses.
Definition: val_neg.h:85
int stat_extended
if true, the statistics are kept in greater detail
Definition: config_file.h:77
void log_addr(enum verbosity_value v, const char *str, struct sockaddr_storage *addr, socklen_t addrlen)
Prints the sockaddr in readable format with log_info.
Definition: net_help.c:189
sldns_buffer * buf
all purpose buffer (for UDP send and receive)
Definition: perf.c:81
int ub_ctx_set_event(struct ub_ctx *ctx, struct event_base *base)
Set a new libevent event_base on a context created with ub_ctx_create_event.
Definition: libunbound.c:1386
int local_zones_answer(struct local_zones *zones, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, uint8_t *tagactions, size_t tagactionssize, struct config_strlist **tag_datas, size_t tag_datas_size, char **tagname, int num_tags, struct view *view)
Answer authoritatively for local zones.
Definition: localzone.c:1652
int addr_is_broadcast(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is 255.255.255.255.
Definition: net_help.c:759
int fptr_whitelist_start_accept(void(*fptr)(void *))
Check function pointer whitelist for start_accept callback values.
Definition: fptr_wlist.c:151
const char * rrset_trust_to_string(enum rrset_trust s)
Get a printable string for a rrset trust value.
Definition: packed_rrset.c:229
BIO * calgo
the current anchor: Algorithm
Definition: unbound-anchor.c:1212
enum acl_access control
access control on this netblock
Definition: acl_list.h:92
int main(int argc, char **argv)
Remove service main.
Definition: unbound-service-remove.c:50
static int test_buffers(sldns_buffer *pkt, sldns_buffer *out)
see if buffers contain the same packet
Definition: unitmsgparse.c:71
size_t total_recv
total number recvd
Definition: perf.c:103
int dname_is_wild(uint8_t *dname)
Return true if the label is a wildcard, *.example.com.
Definition: dname.c:769
int fptr_whitelist_mod_deinit(void(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module deinit call values.
Definition: fptr_wlist.c:417
static int az_remove_rr_decompress(struct auth_zone *z, uint8_t *pkt, size_t pktlen, struct sldns_buffer *scratch_buffer, uint8_t *dname, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rr_data, uint16_t rr_rdlen, int *nonexist)
remove RR from zone, from packet, decompress RR, if nonexist is nonNULL set the flag but otherwise ig...
Definition: authzone.c:1435
static void perfendstats(struct perfinfo *info)
show end stats
Definition: perf.c:414
void log_nametypeclass(enum verbosity_value v, const char *str, uint8_t *name, uint16_t type, uint16_t dclass)
Print string with neat domain name, type and class.
Definition: net_help.c:481
sldns_enum_rr_class
The different RR classes.
Definition: rrdef.h:50
struct ub_event_base * ub_default_event_base(int sigs, time_t *time_secs, struct timeval *time_tv)
Return a default event base.
Definition: ub_event_pluggable.c:351
static int pkt_rrsig_covered(sldns_buffer *pkt, uint8_t *here, uint16_t *type)
return type networkformat that rrsig in packet covers
Definition: msgparse.c:237
size_t num
the number of entries in the hash table.
Definition: lruhash.h:176
void lruhash_test(void)
unit test lruhashtable implementation
Definition: unitlruhash.c:480
void worker_start_accept(void *arg)
start accept callback handler
Definition: worker.c:2035
int sldns_wire2str_str_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat str field to string, with user buffers.
Definition: wire2str.c:1137
static int read_http_headers(SSL *ssl, char *file, size_t flen, char *host, size_t hlen, int *vs)
read http headers and process them
Definition: petal.c:215
void anchors_delete(struct val_anchors *anchors)
Delete trust anchor storage.
Definition: val_anchor.c:140
int sldns_wire2str_alg_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat alg field to string, with user buffers.
Definition: wire2str.c:1335
static void * test_thr_main(void *arg)
main routine for threaded hash table test
Definition: unitlruhash.c:432
static void resolve_host_ip(struct ub_ctx *ctx, const char *host, int port, int tp, int cl, struct ip_list **head)
Resolve name, type, class and add addresses to iplist.
Definition: unbound-anchor.c:548
int sock_list_find(struct sock_list *list, struct sockaddr_storage *addr, socklen_t len)
Find addr in list.
Definition: net_help.c:809
int auth_zone_read_zonefile(struct auth_zone *z, struct config_file *cfg)
read auth zone from zonefile.
Definition: authzone.c:1562
static int add_empty_default(struct local_zones *zones, struct config_file *cfg, const char *name)
enter (AS112) empty default zone
Definition: localzone.c:757
time_t now
current time
Definition: remote.c:2791
static void do_get_option(RES *ssl, struct worker *worker, char *arg)
do the get_option command
Definition: remote.c:2593
int sldns_str2wire_rr_question_buf(const char *str, uint8_t *rr, size_t *len, size_t *dname_len, uint8_t *origin, size_t origin_len, uint8_t *prev, size_t prev_len)
Same as sldns_str2wire_rr_buf, but there is no rdata, it returns an RR with zero rdata and no ttl.
Definition: str2wire.c:790
size_t incoming_num_tcp
number of incoming tcp buffers per (per thread)
Definition: config_file.h:139
struct config_file * config_create_forlib(void)
Create config file structure for library use.
Definition: config_file.c:356
static int check_rrsigs
see if RRSIGs are properly matched to RRsets.
Definition: unitmsgparse.c:65
struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
The function interprets time as the number of seconds since epoch with respect to now using serial ar...
Definition: parseutil.c:175
lock_rw_type lock
lock on the data in the structure For the node, parent, name, namelen, namelabs, dclass,...
Definition: authzone.h:114
struct dns_msg * dns_msg_create(uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional *region, size_t capacity)
Utility, create new, unpacked data structure for cache response.
Definition: dns.c:408
static void add_item(struct val_neg_cache *neg)
add a random item
Definition: unitneg.c:195
int sldns_str2wire_nsec_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSEC from string to wireformat.
Definition: str2wire.c:1277
static addr_data_t config_response_ip_data[]
Dataset used to test redirect rrset initialization for both global and per-view respip redirect confi...
Definition: unitmain.c:736
static struct auth_zone * auth_zones_find_or_add_zone(struct auth_zones *az, char *name)
find or create zone with name str.
Definition: authzone.c:518
static int perform_data_remove(RES *ssl, struct local_zones *zones, char *arg)
Remove RR data.
Definition: remote.c:1340
static struct ip_list * RR_to_ip(int tp, char *data, int len, int port)
create ip_list entry for a RR record
Definition: unbound-anchor.c:510
struct port_if * pif
interface it is used in
Definition: outside_network.h:205
void rrset_cache_update_wildcard(struct rrset_cache *rrset_cache, struct ub_packed_rrset_key *rrset, uint8_t *ce, size_t ce_len, struct alloc_cache *alloc, time_t timenow)
Update or add an rrset in the rrset cache using a wildcard dname.
Definition: rrset.c:241
static void rrset_get_rdata(struct ub_packed_rrset_key *k, size_t idx, uint8_t **rdata, size_t *len)
get rdata pointer and size
Definition: val_sigcrypt.c:137
static void pr_rrs(sldns_buffer *buf, struct reply_info *rep)
print RRs to string
Definition: unitauth.c:671
static int contact_server(const char *svr, struct config_file *cfg, int statuscmd)
contact the server with TCP connect
Definition: unbound-control.c:547
void fake_temp_file(const char *adj, const char *id, char *buf, size_t len)
Get filename to store temporary config stuff.
Definition: fake_event.c:111
int acl_list_apply_cfg(struct acl_list *acl, struct config_file *cfg, struct views *v)
Process access control config.
Definition: acl_list.c:437
size_t regional_get_mem(struct regional *r)
get total memory size in use by region
Definition: regional.c:230
struct ub_packed_rrset_key * resp_addr_get_rrset(struct resp_addr *addr)
returns rrset portion of the specified node in the respip address tree; returns NULL for NULL input; ...
Definition: respip.c:1293
static int az_nsec3_hashname(struct auth_zone *z, uint8_t *hashname, size_t *hashnmlen, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen)
Hash name and return b32encoded hashname for lookup, zone name appended.
Definition: authzone.c:2653
void log_packed_rrset(enum verbosity_value v, const char *str, struct ub_packed_rrset_key *rrset)
Print the string with prefix, one rr per line.
Definition: packed_rrset.c:299
static SSL_CTX * setup_sslctx(void)
create SSL context
Definition: unbound-anchor.c:762
Access control storage structure.
Definition: acl_list.h:74
static int udp_send_errno_needs_log(struct sockaddr *addr, socklen_t addrlen)
see if errno for udp has to be logged or not uses globals
Definition: netevent.c:275
void rrset_cache_touch(struct rrset_cache *r, struct ub_packed_rrset_key *key, hashvalue_type hash, rrset_id_type id)
Touch rrset, with given pointer and id.
Definition: rrset.c:94
struct auth_nextprobe * task_nextprobe
task to wait for next-probe-timeout, once timeouted, see if a SOA probe is needed,...
Definition: authzone.h:219
uint16_t query_flags
flags uint16 from query
Definition: module.h:600
static int fd_for_dest(struct outside_network *outnet, struct sockaddr_storage *to_addr, socklen_t to_addrlen)
create fd to send to this destination
Definition: outside_network.c:2191
unsigned long magic
magic must be UB_EVENT_MAGIC (0x44d74d78)
Definition: unbound-event.h:117
static void processTargetResponse(struct module_qstate *qstate, int id, struct module_qstate *forq)
Do final processing on responses to target queries.
Definition: iterator.c:3228
void delegpt_free_mlc(struct delegpt *dp)
free malloced delegation point.
Definition: iter_delegpt.c:547
uint8_t qdcount
Number of RRs in the query section.
Definition: msgreply.h:141
size_t hints_get_mem(struct iter_hints *hints)
Get memory in use by hints.
Definition: iter_hints.c:514
enum sec_status nsec3_prove_nameerror(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey)
Determine if the set of NSEC3 records provided with a response prove NAME ERROR.
Definition: val_nsec3.c:1065
void regional_test(void)
unit test for regional allocator functions
Definition: unitregional.c:243
static size_t node_size(const struct addrtree *tree, const struct addrnode *n)
Size in bytes of node and parent edge.
Definition: addrtree.c:114
void * fstrm_create_control_frame_start(char *contenttype, size_t *len)
This creates an FSTRM control frame of type START.
Definition: dnstap_fstrm.c:49
int sldns_str2wire_time_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TIME from string to wireformat.
Definition: str2wire.c:1416
int prefetch
if prefetching of messages should be performed.
Definition: config_file.h:278
void val_reply_remove_auth(struct reply_info *rep, size_t index)
Remove rrset with index from reply, from the authority section.
Definition: val_utils.c:914
int sldns_hexdigit_to_int(char ch)
Returns the int value of the given (hex) digit.
Definition: parseutil.c:187
int ixfr
use IXFR for this master
Definition: authzone.h:442
uint8_t isdnsseclame
is the host lame (does not serve the zone authoritatively), or is the host dnssec lame (does not serv...
Definition: infra.h:93
int sldns_wire2str_rr_buf(uint8_t *d, size_t dlen, char *s, size_t slen)
Convert RR to string presentation format, on one line.
Definition: wire2str.c:253
static void xfr_probe_nextmaster(struct auth_xfer *xfr)
move to next master in list, task_probe
Definition: authzone.c:3931
int dname_canon_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
Compare dnames, Canonical in rfc4034 sense, but by label.
Definition: dname.c:802
void listen_start_accept(struct listen_dnsport *listen)
start accept handlers for TCP (was stopped before)
Definition: listen_dnsport.c:1584
static int ports_create_if(const char *ifname, int do_auto, int do_udp, int do_tcp, struct addrinfo *hints, const char *port, struct listen_port **list, size_t rcv, size_t snd, int ssl_port, struct config_strlist *tls_additional_port, int *reuseport, int transparent, int tcp_mss, int freebind, int use_systemd, int dnscrypt_port, int dscp)
Helper for ports_open.
Definition: listen_dnsport.c:1210
void traverse_postorder(rbtree_type *tree, void(*func)(rbnode_type *, void *), void *arg)
Call function for all elements in the redblack tree, such that leaf elements are called before parent...
Definition: rbtree.c:622
void dtio_reconnect_timeout_cb(int fd, short bits, void *arg)
callback for the dnstap reconnect, to start reconnecting to output
uint16_t sldns_wirerr_get_rdatalen(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata length of the RR.
Definition: str2wire.c:819
static int find_matching_nsec3(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, uint8_t *nm, size_t nmlen, struct ub_packed_rrset_key **rrset, int *rr)
Find matching NSEC3 Find the NSEC3Record that matches a hash of a name.
Definition: val_nsec3.c:736
static int respip_nodata_answer(uint16_t qtype, enum respip_action action, const struct reply_info *rep, size_t rrset_id, struct reply_info **new_repp, struct regional *region)
apply response ip action in case where no action data is provided.
Definition: respip.c:788
#define UB_EV_TIMEOUT
event timeout
Definition: unbound-event.h:67
void tcl_close_connection(struct tcl_addr *tcl)
Decrement TCP connection count if found.
Definition: tcp_conn_limit.c:171
static int rr_comment_nsec3(char **s, size_t *slen, uint8_t *rr, size_t rrlen, size_t dname_off)
print rr comment for type NSEC3
Definition: wire2str.c:634
int tube_poll(struct tube *tube)
See if data is ready for reading on the tube without blocking.
Definition: tube.c:411
int main(int argc, char *argv[])
Main routine for unbound-host.
Definition: unbound-host.c:424
size_t stream_wait_size
size of the stream wait buffers, max
Definition: config_file.h:146
struct ub_event * ub_winsock_register_wsaevent(struct ub_event_base *base, void *wsaevent, void(*cb)(int, short, void *), void *arg)
Create a new ub_event associated with the wsaevent for the event base.
Definition: ub_event.c:338
Mesh of query states.
Definition: mesh.h:82
int sldns_wire2str_edns_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen)
Scan wireformat EDNS OPT to string, with user buffers.
Definition: wire2str.c:2021
@ serviced_initial
initial status
Definition: outside_network.h:359
void comm_timer_disable(struct comm_timer *timer)
disable timer.
Definition: netevent.c:3312
void comm_base_exit(struct comm_base *b)
Exit from dispatch loop.
Definition: fake_event.c:963
int ub_resolve_async(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, void *mydata, ub_callback_type callback, int *async_id)
Perform resolution and validation of the target name.
Definition: libunbound.c:766
long long qbit_RA
number of queries with RA bit
Definition: unbound.h:711
int sldns_str2wire_int32_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT32 from string to wireformat.
Definition: str2wire.c:1045
int sldns_wire2str_rdata_unknown_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat rdata to string in unknown format, with user buffers.
Definition: wire2str.c:748
struct comm_base * comm_base_create(int sigs)
Create a new comm base.
Definition: netevent.c:160
static void respip_conf_actions_test(void)
Global respip actions test; apply raw config data and verify that all the nodes in the respip set,...
Definition: unitmain.c:600
static int auth_zone_delegpt(struct module_qstate *qstate, struct iter_qstate *iq, uint8_t *delname, size_t delnamelen)
Generate a delegation point for an auth zone (unless cached dp is better) false on alloc failure.
Definition: iterator.c:926
static void view_and_respipchecks(struct config_file *cfg)
check view and response-ip configuration
Definition: unbound-checkconf.c:288
@ rrset_trust_ultimate
ultimately trusted, no more trust is possible; trusted keys from the unbound configuration setup.
Definition: packed_rrset.h:169
#define alloc_set_special_next(x, y)
set next pointer.
Definition: alloc.h:62
static struct val_neg_zone * neg_zone_chain(uint8_t *nm, size_t nm_len, int labs, uint16_t dclass, struct val_neg_zone *parent)
Create a linked list of parent zones, starting at longname ending on the parent (can be NULL,...
Definition: val_neg.c:482
void log_reply_info(enum verbosity_value v, struct query_info *qinf, struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur, int cached, struct sldns_buffer *rmsg)
Print string with neat domain name, type, class, status code from, and size of a query response.
Definition: msgreply.c:843
comm_point_callback_type * cb
the callback, stored for usage
Definition: fake_event.c:84
int no_cache_lookup
whether modules should answer from the cache
Definition: module.h:646
int local_data_find_tag_datas(const struct query_info *qinfo, struct config_strlist *list, struct ub_packed_rrset_key *r, struct regional *temp)
find local data tag string match for the given type in the list
Definition: localzone.c:1248
int libworker_attach_mesh(struct ub_ctx *ctx, struct ctx_query *q, int *async_id)
Attach context_query to mesh for callback in event-driven setup.
Definition: libworker.c:665
void mesh_report_reply(struct mesh_area *mesh, struct outbound_entry *e, struct comm_reply *reply, int what)
Handle new event from the wire.
Definition: mesh.c:756
Module environment.
Definition: module.h:324
static int az_xfr_allowed_notify(struct auth_xfer *xfr, struct sockaddr_storage *addr, socklen_t addrlen, struct auth_master **fromhost)
check access list for notifies
Definition: authzone.c:3489
int auth_xfer_transfer_http_callback(struct comm_point *c, void *arg, int err, struct comm_reply *repinfo)
callback for task_transfer http connections
Definition: authzone.c:5907
char * errinf_to_str_servfail(struct module_qstate *qstate)
Create error info in string.
Definition: config_file.c:2449
int ixfr_possible_timeout_count
we saw an ixfr-indicating timeout, count of them
Definition: authzone.h:397
int delegpt_add_ns(struct delegpt *dp, struct regional *region, uint8_t *name, uint8_t lame)
Add a name to the delegation point.
Definition: iter_delegpt.c:103
size_t get_rdf_size(sldns_rdf_type rdf)
Obtain size in the packet of an rr type, that is before dname type.
Definition: msgparse.c:599
int ratelimit_ok
if true, already tested for ratelimiting and passed the test
Definition: iterator.h:322
INLINE void sldns_buffer_set_limit(sldns_buffer *buffer, size_t limit)
changes the buffer's limit.
Definition: sbuffer.h:283
void slabhash_setmarkdel(struct slabhash *table, lruhash_markdelfunc_type md)
Set markdel function.
Definition: slabhash.c:218
struct waiting_tcp * tcp_wait_last
last of waiting query list
Definition: outside_network.h:162
int host_ttl
host cache ttl in seconds
Definition: config_file.h:162
struct dt_io_thread * dtio
reference to the io thread to wakeup
Definition: dtstream.h:75
static void replyline(char *line, uint8_t *reply, size_t reply_len, int *do_flag)
parse REPLY line
Definition: testpkts.c:160
int sldns_wire2str_type_buf(uint16_t rrtype, char *str, size_t len)
Convert wire RR type to a string, 'MX', 'TYPE12'.
Definition: wire2str.c:287
struct comm_timer * timer
timeout for packets.
Definition: authzone.h:347
void * memdup(void *data, size_t len)
Allocate memory and copy over contents.
Definition: net_help.c:177
void * cb_arg
callback user argument
Definition: outside_network.h:296
struct addr_tree_node * addr_tree_find(rbtree_type *tree, struct sockaddr_storage *addr, socklen_t addrlen, int net)
Find element in addr tree.
Definition: dnstree.c:241
int delegpt_add_rrset_AAAA(struct delegpt *dp, struct regional *region, struct ub_packed_rrset_key *ak, uint8_t lame, int *additions)
Add AAAA RRset to delegpt.
Definition: iter_delegpt.c:445
int qtype
qtype
Definition: replay.h:340
struct local_zone * local_zones_find_le(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, int *exact)
Find zone that with exactly or smaller name/class User must lock the tree or result zone.
Definition: localzone.c:1147
struct comm_point * outnet_comm_point_for_tcp(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen, sldns_buffer *query, int timeout, int ssl, char *host)
Create tcp commpoint suitable for communication to the destination.
Definition: outside_network.c:2344
#define UB_STATS_RPZ_ACTION_NUM
number of RPZ actions
Definition: unbound.h:660
#define NUM_TIMEOUTS_FALLBACK_IXFR
number of timeouts before we fallback from IXFR to AXFR, because some versions of servers (eg.
Definition: authzone.c:93
size_t pythonmod_get_mem(struct module_env *env, int id)
python module alloc size routine
Definition: pythonmod.c:569
void wsvc_rc_stop(FILE *out)
Stop the service from servicecontrolmanager, tells OS to stop daemon.
Definition: w_inst.c:300
void timehist_export(struct timehist *hist, long long *array, size_t sz)
Export histogram to an array.
Definition: timehist.c:228
struct addrtree * addrtree_create(addrlen_t max_depth, void(*delfunc)(void *, void *), size_t(*sizefunc)(void *), void *env, uint32_t max_node_count)
Create a new tree.
Definition: addrtree.c:121
int forwards_add_zone(struct iter_forwards *fwd, uint16_t c, struct delegpt *dp)
Add zone to forward structure.
Definition: iter_fwd.c:472
int trust_anchor_signaling
send key tag query
Definition: config_file.h:341
int sldns_str2wire_tsigtime_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TSIGTIME from string to wireformat.
Definition: str2wire.c:1458
static void log_rpz_apply(uint8_t *dname, enum rpz_action a, struct query_info *qinfo, struct comm_reply *repinfo, char *log_name)
print log information for an applied RPZ policy.
Definition: rpz.c:920
void log_name_addr(enum verbosity_value v, const char *str, uint8_t *zone, struct sockaddr_storage *addr, socklen_t addrlen)
Prints zone name and sockaddr in readable format with log_info.
Definition: net_help.c:543
static int xfer_link_data(sldns_buffer *pkt, struct auth_xfer *xfr)
Link the data from this packet into the worklist of transferred data.
Definition: authzone.c:5707
int infra_dp_ratelimit
ratelimit value for delegation point
Definition: infra.c:64
struct fake_timer * replay_get_oldest_timer(struct replay_runtime *runtime)
get oldest enabled fake timer
Definition: replay.c:547
int sldns_wire2str_int16_data_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat int16_data field to string, with user buffers.
Definition: wire2str.c:1628
int fptr_whitelist_rbtree_cmp(int(*fptr)(const void *, const void *))
Check function pointer whitelist for rbtree cmp callback values.
Definition: fptr_wlist.c:219
static void do_flush_requestlist(RES *ssl, struct worker *worker)
flush requestlist
Definition: remote.c:1677
static int load_rrset_cache(RES *ssl, struct worker *worker)
load rrset cache
Definition: cachedump.c:522
static void dtio_stop_flush_exit(struct stop_flush_info *info)
stop from stop_flush event loop
Definition: dtstream.c:1583
static int auth_xfer_setup(struct auth_zone *z, struct auth_xfer *x)
Setup auth_xfer zone This populates the have_zone, soa values, and so on times.
Definition: authzone.c:1815
void val_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
validator operate on a query
Definition: validator.c:2480
static int sldns_is_last_of_string(const char *str)
see if the string ends, or ends in whitespace
Definition: str2wire.c:1239
int zone_expired
the zone has expired (enabled by the xfer worker), fallback happens if that option is enabled.
Definition: authzone.h:126
struct auth_master * lookup_target
for the hostname lookups, which master is current
Definition: authzone.h:373
static void validate_cname_noanswer_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey)
Validate CNAME NOANSWER response, no more data after a CNAME chain.
Definition: validator.c:1350
static int nsec3_known_algo(struct ub_packed_rrset_key *rrset, int r)
return if nsec3 RR has known algorithm
Definition: val_nsec3.c:157
static int dnsc_parse_certs(struct dnsc_env *env, struct config_file *cfg)
Parse certificates files provided by the configuration and load them into dnsc_env.
Definition: dnscrypt.c:577
Region allocated message reply.
Definition: dns.h:61
int val_nsec_proves_no_wc(struct ub_packed_rrset_key *nsec, uint8_t *qname, size_t qnamelen)
Determine if the given NSEC proves that a wildcard match does not exist.
Definition: val_nsec.c:510
size_t key_entry_sizefunc(void *key, void *data)
function for lruhash operation
Definition: val_kentry.c:52
static void fd_close(int fd)
close the fd
Definition: petal.c:133
static int az_generate_notype_answer(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node)
generate answer for notype answer
Definition: authzone.c:2978
static void do_set_option(RES *ssl, struct worker *worker, char *arg)
do the set_option command
Definition: remote.c:2564
int addr_is_any(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is 0.0.0.0 or ::0.
Definition: net_help.c:767
void reply_info_set_ttls(struct reply_info *rep, time_t timenow)
Set TTLs inside the replyinfo to absolute values.
Definition: msgreply.c:514
static void wipe_ip_usage(struct ip_list *p)
clear used flags
Definition: unbound-anchor.c:671
int ipsecmod_whitelist_apply_cfg(struct ipsecmod_env *ie, struct config_file *cfg)
Process ipsecmod_whitelist config.
int serve_expired_client_timeout
serve expired entries only after trying to update the entries and this timeout (in milliseconds) is r...
Definition: config_file.h:375
int nsec3_has_type(struct ub_packed_rrset_key *rrset, int r, uint16_t type)
see if NSEC3 RR contains given type
Definition: val_nsec3.c:283
static time_t get_rrset_ttl(struct ub_packed_rrset_key *k)
get ttl of rrset
Definition: authzone.c:159
void unit_show_feature(const char *feature)
we are testing this functionality
Definition: unitmain.c:847
int local_zone_enter_defaults(struct local_zones *zones, struct config_file *cfg)
Enter defaults to local zone.
Definition: localzone.c:782
static int answer_norec_from_cache(struct worker *worker, struct query_info *qinfo, uint16_t id, uint16_t flags, struct comm_reply *repinfo, struct edns_data *edns)
answer nonrecursive query from the cache
Definition: worker.c:470
time_t last_success
last successful DNSKEY set
Definition: autotrust.h:106
static void xml_append_bio(BIO *b, BIO *a)
Append bio to bio.
Definition: unbound-anchor.c:1472
void errinf_rrset(struct module_qstate *qstate, struct ub_packed_rrset_key *rr)
Append text to error info: for RRset name type class.
Definition: config_file.c:2474
static struct entry * new_entry(void)
create new entry
Definition: testpkts.c:256
static void process_nsec3(int argc, char *argv[])
process nsec3 params and perform hashing
Definition: signit.c:236
int inplace_cb_reply_func_type(struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct edns_option **opt_list_out, struct comm_reply *repinfo, struct regional *region, int id, void *callback)
Inplace callback function called before replying.
Definition: module.h:257
uint8_t * name
the domain name of the delegation point.
Definition: iter_delegpt.h:59
void lruhash_clear(struct lruhash *table)
Clear hash table.
Definition: lruhash.c:438
void comm_timer_set(struct comm_timer *timer, struct timeval *tv)
reset timevalue for timer.
Definition: netevent.c:3321
long long ans_rcode_nodata
answers with pseudo rcode 'nodata'
Definition: unbound.h:725
size_t anchors_get_mem(struct val_anchors *anchors)
Get memory in use by the trust anchor storage.
Definition: val_anchor.c:1202
void donotq_delete(struct iter_donotq *donotq)
Delete donotqueryaddresses structure.
Definition: iter_donotq.c:67
int ub_ctx_trustedkeys(struct ub_ctx *ctx, const char *fname)
Add trust anchors to the given context.
Definition: libunbound.c:447
@ repevt_front_query
incoming query
Definition: replay.h:194
void config_delete(struct config_file *cfg)
Destroy the config file structure.
Definition: config_file.c:1421
#define NETEVENT_SLOW_ACCEPT_TIME
timeout to slow accept calls when not possible, in msec.
Definition: netevent.h:92
void init_cfg_parse(void)
init lex state
void dt_msg_queue_delete(struct dt_msg_queue *mq)
Delete a worker message queue.
Definition: dtstream.c:131
const char * local_zone_type2str(enum localzone_type t)
Print localzone type to a string.
Definition: localzone.c:1746
#define NETEVENT_CLOSED
to pass closed connection to callback function
Definition: netevent.h:83
mesh_cb_func_type cb
callback routine for results.
Definition: mesh.h:260
int tcp_req_info_handle_read_close(struct tcp_req_info *req)
the read channel has closed
Definition: listen_dnsport.c:1762
int outnet_get_tcp_fd(struct sockaddr_storage *addr, socklen_t addrlen, int tcp_mss, int dscp)
get TCP file descriptor for address, returns -1 on failure, tcp_mss is 0 or maxseg size to set for TC...
Definition: outside_network.c:208
rbnode_type node
The rbtree node, key is this record.
Definition: outside_network.h:328
struct auth_master * masters
list of upstream masters for this zone, from config
Definition: authzone.h:370
static size_t anchors_dnskey_unsupported(struct trust_anchor *ta)
Check DNSKEY algos for support, warn if not.
Definition: val_anchor.c:970
#define PROBE_MAXRTO
Timeout when only a single probe query per IP is allowed.
Definition: infra.c:56
char * why_bogus
If the result is bogus this contains a string (zero terminated) that describes the failure.
Definition: unbound.h:204
void verify_test(void)
unit test for verification functions
Definition: unitverify.c:506
View.
Definition: view.h:66
void ub_c_error(const char *msg)
parsing helpers: print error with file and line numbers
Definition: config_file.c:1638
struct local_zone * local_zones_find(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)
Find zone that with exactly given name, class.
Definition: localzone.c:1133
@ RESPIP_INIT
The general state.
Definition: respip.c:43
void log_info(const char *format,...)
implementation of log_info
Definition: log.c:302
void autr_debug_print(struct val_anchors *anchors)
Debug printout of rfc5011 tracked anchors.
Definition: autotrust.c:2312
struct edns_known_option * edns_option_is_known(uint16_t opt_code, struct module_env *env)
Check if an edns option is known.
Definition: module.c:184
int sldns_wire2str_rcode_buf(int rcode, char *s, size_t slen)
Convert wire RR rcode to a string, 'NOERROR', 'NXDOMAIN'.
Definition: wire2str.c:299
static int ssl_handle_it(struct comm_point *c)
handle ssl tcp connection with dns contents
Definition: netevent.c:1398
#define CMSG_SPACE(l)
if CMSG_SPACE is not defined on this platform, a workaround
Definition: netevent.c:83
struct local_rrset * local_alias
Alias local answer(s) for the qname.
Definition: msgreply.h:98
int config_set_option(struct config_file *cfg, const char *opt, const char *val)
Set the given keyword to the given value.
Definition: config_file.c:434
static int detect_cycle(struct lock_ref *visit, struct lock_ref *from)
Detect cycle by comparing visited now with all (unvisited) bigger nodes.
Definition: lock_verify.c:308
void comm_base_delete_no_base(struct comm_base *b)
Delete comm base structure but not the underlying lib event base.
Definition: netevent.c:220
struct internal_signal * ev_signal
the internal event stuff
Definition: netevent.h:340
size_t msg_cache_size
size of the message cache
Definition: config_file.h:150
static void entry_to_repinfo(struct entry *e, struct alloc_cache *alloc, struct regional *region, sldns_buffer *pkt, struct query_info *qi, struct reply_info **rep)
entry to reply info conversion
Definition: unitverify.c:84
struct delegpt * delegpt_copy(struct delegpt *dp, struct regional *regional)
Create a copy of a delegation point.
Definition: iter_delegpt.c:64
int edns_opt_list_compare(struct edns_option *p, struct edns_option *q)
Compare edns option lists, also the order and contents of edns-options.
Definition: msgreply.c:1188
char * socketpath
socketpath, if this is an AF_LOCAL socket
Definition: unbound-dnstap-socket.c:153
static void usage(char *argv[])
usage information for streamtcp
Definition: unbound-dnstap-socket.c:74
@ LDNS_RDF_TYPE_B32_EXT
b32 string
Definition: rrdef.h:284
void * cb_arg
the callback user argument
Definition: replay.h:387
char * sldns_wire2str_rcode(int rcode)
Convert wire packet rcode to a string, 'NOERROR', 'NXDOMAIN'...
Definition: wire2str.c:240
int nsec3_hash_name(rbtree_type *table, struct regional *region, sldns_buffer *buf, struct ub_packed_rrset_key *nsec3, int rr, uint8_t *dname, size_t dname_len, struct nsec3_cached_hash **hash)
Obtain the hash of an owner name.
Definition: val_nsec3.c:630
struct timeval start
when did the total test start
Definition: perf.c:101
struct iter_priv * priv
private address space and private domains
Definition: iterator.h:120
static int processDSNSFind(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Try to find the NS record set that will resolve a qtype DS query.
Definition: iterator.c:2091
int dnstap_send_identity
true to send "identity" via dnstap
Definition: config_file.h:501
struct view * views_find_view(struct views *vs, const char *name, int write)
find a view by name
Definition: view.c:224
struct ub_event_base * ub_libevent_event_base(struct event_base *libevent_base)
Return an ub_event_base constructed for the given libevent event base.
Definition: ub_event.c:241
int sldns_wire2str_rr_comment_buf(uint8_t *rr, size_t rr_len, size_t dname_len, char *str, size_t str_len)
This creates the comment to print after the RR.
Definition: wire2str.c:279
Data for ratelimits per domain name It is incremented when a non-cache-lookup happens for that domain...
Definition: infra.h:177
static void hdlr(DWORD ctrl)
Service control handler.
Definition: win_svc.c:105
static int open_svr(const char *svr, int udp)
open TCP socket to svr
Definition: streamtcp.c:85
enum localzone_type local_data_find_tag_action(const uint8_t *taglist, size_t taglen, const uint8_t *taglist2, size_t taglen2, const uint8_t *tagactions, size_t tagactionssize, enum localzone_type lzt, int *tag, char *const *tagname, int num_tags)
See if two sets of tag lists (in the form of bitmap) have the same tag that has an action.
Definition: localzone.c:1618
static void dname_test_strict_subdomain(void)
test dname_strict_subdomain
Definition: unitdname.c:411
@ rrset_trust_auth_AA
Data from the authority section of an authoritative answer.
Definition: packed_rrset.h:157
int auth_zones_can_fallback(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
see if the auth zone for the name can fallback
Definition: authzone.c:3390
int ssl_handshake_done
true if the handshake for SSL is done, 0 if not
Definition: dtstream.h:149
struct replay_scenario * scenario
The scenario.
Definition: replay.h:270
uint8_t * dsns_point
If nonNULL we are walking upwards from DS query to find NS.
Definition: iterator.h:345
lock_basic_type lock
lock on trees
Definition: val_anchor.h:62
size_t size
size of buffer
Definition: delayer.c:66
static int http_check_connect(int fd, struct comm_point *c)
check pending connect for http
Definition: netevent.c:2270
int sldns_wire2str_class_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat rr class to string, with user buffers.
Definition: wire2str.c:910
int inplace_cb_query_call(struct module_env *env, struct query_info *qinfo, uint16_t flags, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct module_qstate *qstate, struct regional *region)
Call the registered functions in the inplace_cb_query linked list.
Definition: msgreply.c:1100
static void found_cycle(struct lock_ref *visit, int level)
print cycle message
Definition: lock_verify.c:281
void outside_network_delete(struct outside_network *outnet)
Delete outside_network structure.
Definition: outside_network.c:912
int http_in_headers
Currently reading in http headers.
Definition: netevent.h:209
uint8_t * taglist
tag bitlist
Definition: acl_list.h:94
void config_delview(struct config_view *p)
Delete a view item.
Definition: config_file.c:1371
int ssl_upstream
use SSL for queries to this stub
Definition: config_file.h:646
size_t outnet_get_mem(struct outside_network *outnet)
Get memory size in use by outside network.
Definition: outside_network.c:2490
rbnode_type * rbtree_insert(rbtree_type *rbtree, rbnode_type *data)
Insert data into the tree.
Definition: rbtree.c:228
struct alloc_cache * super
global allocator above this one.
Definition: alloc.h:76
struct reply_info * parse_reply_in_temp_region(sldns_buffer *pkt, struct regional *region, struct query_info *qi)
get msg reply struct (in temp region)
Definition: msgreply.c:927
void server_stats_reply(struct worker *worker, int reset)
Send stats over comm tube in reply to query cmd.
Definition: stats.c:386
int fptr_whitelist_comm_signal(void(*fptr)(int, void *))
Check function pointer whitelist for comm_signal callback values.
Definition: fptr_wlist.c:145
int storeQueryInCache(struct module_qstate *qstate, struct query_info *qinfo, struct reply_info *msgrep, int is_referral)
Store the reply_info and query_info pair in message cache (qstate->msg_cache)
Definition: pythonmod_utils.c:59
struct alloc_cache alloc
allocation cache for this thread
Definition: worker.h:117
void regional_destroy(struct regional *r)
Destroy regional.
Definition: regional.c:114
long long qtcp_outgoing
number of outgoing queries over TCP
Definition: unbound.h:697
static void do_list_stubs(RES *ssl, struct worker *worker)
do the list_stubs command
Definition: remote.c:2633
int order_lock_cmp(const void *e1, const void *e2)
Due to module breakage by fptr wlist, these test app declarations are presented here.
Definition: worker_cb.c:224
static void TLS_shutdown(int fd, SSL *ssl, SSL_CTX *sslctx)
perform neat TLS shutdown
Definition: unbound-anchor.c:818
static int dnskey_get_protocol(struct ub_packed_rrset_key *k, size_t idx)
Get DNSKEY protocol value from rdata.
Definition: val_sigcrypt.c:167
int num_done_req
number of pending writeable results
Definition: listen_dnsport.h:270
void ub_event_add_bits(struct ub_event *ev, short bits)
Add event bits for this event to fire on.
Definition: ub_event_pluggable.c:545
#define IS_NUMBER_OR_ZERO
check that the value passed is >= 0
Definition: config_file.c:385
int timeout
timeout in msec
Definition: authzone.h:349
int timer_done
has the timer fired
Definition: dtstream.c:1571
void listen_delete(struct listen_dnsport *front)
delete the listening structure
Definition: listen_dnsport.c:1423
size_t zone_len
length of the zonename
Definition: val_nsec3.c:101
#define RTT_BAND
RTT band, within this amount from the best, servers are chosen randomly.
Definition: iterator.h:102
int use_rpz
If we need to use RPZ (value passed from daemon)
Definition: mesh.h:155
size_t numDS
number of DSs in the keylist
Definition: val_anchor.h:114
int max_active
max active commpoints
Definition: remote.h:99
static SSL_CTX * setup_ctx(struct config_file *cfg)
setup SSL context
Definition: unbound-control.c:499
void tube_callback_type(struct tube *, uint8_t *, size_t, int, void *)
Callback from pipe listen function void mycallback(tube, msg, len, error, user_argument); if error is...
Definition: tube.h:58
void worker_win_stop_cb(int fd, short ev, void *arg)
windows worker stop event callback handler
Definition: win_svc.c:515
int sldns_str2wire_dname_buf_origin(const char *str, uint8_t *buf, size_t *len, uint8_t *origin, size_t origin_len)
Same as sldns_str2wire_dname_buf, but concatenates origin if the domain name is relative (does not en...
Definition: str2wire.c:144
int to_be_deleted
true if serviced_query is scheduled for deletion already
Definition: outside_network.h:378
void pkt_dname_tolower(struct sldns_buffer *pkt, uint8_t *dname)
lowercase pkt dname (follows compression pointers)
Definition: dname.c:151
struct config_str3list * next
next item in list
Definition: config_file.h:745
enum val_classification val_classify_response(uint16_t query_flags, struct query_info *origqinf, struct query_info *qinf, struct reply_info *rep, size_t skip)
Given a response, classify ANSWER responses into a subtype.
Definition: val_utils.c:62
static ldns_rr_list * read_rrs(FILE *in)
read list of rrs from the file
Definition: signit.c:163
void subnet_markdel(void *key)
mark subnet msg to be deleted
int serviced_tcp_callback(struct comm_point *c, void *arg, int error, struct comm_reply *rep)
TCP reply or error callback for serviced queries.
Definition: outside_network.c:1803
hashvalue_type query_info_hash(struct query_info *q, uint16_t flags)
calculate hash value of query_info, lowercases the qname, uses CD flag for AAAA qtype
Definition: msgreply.c:627
static int chunkline_count_parens(sldns_buffer *buf, size_t start)
count number of open and closed parenthesis in a chunkline
Definition: authzone.c:4147
static int dynlib_mod_count
module counter for multiple dynlib modules
Definition: dynlibmod.c:70
int ssl_printf(RES *ssl, const char *format,...)
printf style printing to the ssl connection
Definition: remote.c:600
static int rpz_data_delete_rr(struct local_zone *z, uint8_t *policydname, size_t policydnamelen, uint16_t rr_type, uint8_t *rdata, size_t rdatalen)
Remove RR from RPZ's local-data.
Definition: rpz.c:747
int serviced_cmp(const void *key1, const void *key2)
compare function of serviced query rbtree
Definition: outside_network.c:106
int infra_ratelimit_inc(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow, struct query_info *qinfo, struct comm_reply *replylist)
Increment the query rate counter for a delegation point.
Definition: infra.c:911
static void purge_node(struct addrtree *tree, struct addrnode *node)
Purge a node from the tree.
Definition: addrtree.c:213
static void az_change_dnames(struct dns_msg *msg, uint8_t *oldname, uint8_t *newname, size_t newlen, int an_only)
Change a dname to a different one, for wildcard namechange.
Definition: authzone.c:2509
char * tls_cert_bundle
cert bundle for outgoing connections
Definition: config_file.h:120
static void seen_trustanchor(struct autr_ta *ta, uint8_t seen)
Set fetched value.
Definition: autotrust.c:1315
void fatal_exit(const char *format,...) ATTR_FORMAT(printf
Log fatal error message, and exit the current process.
static int processInitRequest3(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Process the third part of the initial request handling.
Definition: iterator.c:1670
struct worker * worker_create(struct daemon *daemon, int id, int *ports, int n)
Create the worker structure.
Definition: worker.c:1700
void hex_to_buf(struct sldns_buffer *pkt, const char *hex)
Helper to convert hex string to packet buffer.
Definition: readhex.c:65
static size_t macro_length(char *text)
return length of macro
Definition: replay.c:590
static void perf_tv_subtract(struct timeval *t1, struct timeval *t2)
timeval subtract, t1 -= t2
Definition: perf.c:189
static void distribute_cmd(struct daemon_remote *rc, RES *ssl, char *cmd)
tell other processes to execute the command
Definition: remote.c:2870
static int anchors_assemble_rrsets(struct val_anchors *anchors)
Assemble the rrsets in the anchors, ready for use by validator.
Definition: val_anchor.c:986
void ub_comm_base_now(struct comm_base *cb)
Equip the comm_base with the current time.
Definition: ub_event.c:448
time_t * now
time in seconds, converted to integer
Definition: module.h:481
const char ** as112_zones
Array of text-format domain names of the AS112 zones.
Definition: as112.c:143
int namelabs
number of labels in name
Definition: localzone.h:171
rbtree_type tree
Hints are stored in this tree.
Definition: iter_hints.h:62
void pythonmod_deinit(struct module_env *env, int id)
python module deinit
Definition: pythonmod.c:439
int inplace_cb_query_func_type(struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *callback)
Inplace callback function called before sending the query to a nameserver.
Definition: module.h:281
void sock_list_prepend(struct sock_list **list, struct sock_list *add)
Append one list to another.
Definition: net_help.c:798
void ub_randfree(struct ub_randstate *s)
Delete the random state.
Definition: random.c:204
autr_state_type s
5011 state
Definition: autotrust.h:77
rbtree_type vtree
rbtree of struct view
Definition: view.h:60
static enum rpz_trigger rpz_dname_to_trigger(uint8_t *dname, size_t dname_len)
Get RPZ trigger for dname.
Definition: rpz.c:275
#define NETEVENT_NOERROR
to pass no_error to callback function
Definition: netevent.h:81
struct rrset_parse * rrset_bucket_next
next in hash bucket
Definition: msgparse.h:143
struct regional * regional_create(void)
Create a new regional.
Definition: regional.c:66
void log_set_time_asc(int use_asc)
Set if the time value is printed ascii or decimal in log entries.
Definition: log.c:203
void rrset_check_sec_status(struct rrset_cache *r, struct ub_packed_rrset_key *rrset, time_t now)
Looks up security status of an rrset.
Definition: rrset.c:405
void dtio_stop_ev_cb(int fd, short bits, void *arg)
callback for the output when the thread stops and wants to finish up
IO thread that reads from the queues and writes them.
Definition: dtstream.h:115
void dt_io_thread_unregister_queue(struct dt_io_thread *dtio, struct dt_msg_queue *mq)
Unregister queue from io thread.
Definition: dtstream.c:384
const char * fname
Python script filename.
Definition: pythonmod.c:82
long long num_query_dnscrypt_crypted
number of queries that used dnscrypt
Definition: unbound.h:758
uint16_t flags
the flags for the answer, host byte order.
Definition: msgreply.h:127
static struct auth_data * az_find_candidate_ce(struct auth_zone *z, struct query_info *qinfo, struct auth_data *n)
domain is not exact, find first candidate ce (name that matches a part of qname) in tree
Definition: authzone.c:2190
size_t query_dname_len(struct sldns_buffer *query)
Determine length of dname in buffer, no compression ptrs allowed,.
Definition: dname.c:52
char * directory
working directory
Definition: config_file.h:289
static size_t get_rrset_bogus(struct worker *worker, int reset)
get rrsets bogus number from validator
Definition: stats.c:186
#define BIT_AD
AD flag.
Definition: net_help.h:59
const char * strextstate(enum module_ext_state s)
Debug utility: module external qstate to string.
Definition: module.c:45
struct local_rrset * rrsets
the data rrsets, with different types, linked list.
Definition: localzone.h:174
static int rrset_moveover_rrsigs(struct auth_data *node, uint16_t rr_type, struct auth_rrset *rrset, struct auth_rrset *rrsig)
See if rrsig set has covered sigs for rrset and move them over.
Definition: authzone.c:931
int ub_ctx_set_option(struct ub_ctx *ctx, const char *opt, const char *val)
Set an option for the context.
Definition: libunbound.c:345
void val_mark_indeterminate(struct reply_info *rep, struct val_anchors *anchors, struct rrset_cache *r, struct module_env *env)
Mark all unchecked rrset entries not below a trust anchor as indeterminate.
Definition: val_utils.c:1011
void comm_point_delete(struct comm_point *c)
Close and deallocate (free) the comm point.
Definition: fake_event.c:1341
void log_name_addr(enum verbosity_value v, const char *str, uint8_t *zone, struct sockaddr_storage *addr, socklen_t addrlen)
Prints zone name and sockaddr in readable format with log_info.
Definition: net_help.c:543
static int isalldigit(const char *str, size_t l)
all digit number
Definition: config_file.c:1858
void neg_cache_delete(struct val_neg_cache *neg)
Destroy negative cache.
Definition: val_neg.c:133
struct trust_anchor * anchors_lookup(struct val_anchors *anchors, uint8_t *qname, size_t qname_len, uint16_t qclass)
Given a qname/qclass combination, find the trust anchor closest above it.
Definition: val_anchor.c:1162
void lruhash_status(struct lruhash *table, const char *id, int extended)
Output debug info to the log as to state of the hash table.
Definition: lruhash.c:459
struct listen_list * cps
list of comm points used to get incoming events
Definition: listen_dnsport.h:67
int sldns_wire2str_a_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat ip4 A field to string, with user buffers.
Definition: wire2str.c:1091
@ UB_LIBCMD_CANCEL
Cancel query, sent to bg worker.
Definition: context.h:222
struct tcp_proxy * next
next in list
Definition: delayer.c:139
static size_t az_nsec3_hash(uint8_t *buf, size_t buflen, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen)
Hash a name with nsec3param into buffer, it has zone name appended.
Definition: authzone.c:2622
size_t buf_cap
Capacity of the buffer.
Definition: dtstream.h:100
#define log_assert(x)
an assertion that is thrown to the logfile.
Definition: log.h:229
void(* free)(struct ub_event *)
Destructor for the ub_event object.
Definition: unbound-event.h:136
const char * rrset_trust_to_string(enum rrset_trust s)
Get a printable string for a rrset trust value.
Definition: packed_rrset.c:229
struct config_auth * auths
the auth zone definitions, linked list
Definition: config_file.h:214
int ub_ctx_resolvconf(struct ub_ctx *ctx, const char *fname)
Read list of nameservers to use from the filename given.
Definition: libunbound.c:1072
size_t rrsig_count
number of RRSIGs over this rrset.
Definition: msgparse.h:171
static int apply_axfr(struct auth_xfer *xfr, struct auth_zone *z, struct sldns_buffer *scratch_buffer)
apply AXFR to zone in memory.
Definition: authzone.c:4724
struct comm_base * base
the comm base
Definition: netevent.c:134
int local_data_cmp(const void *d1, const void *d2)
Compare two local_data entries in rbtree.
Definition: localzone.c:121
@ LDNS_RDF_TYPE_A
A record.
Definition: rrdef.h:276
int tcp_idle_timeout
tcp idle timeout, in msec
Definition: config_file.h:105
void slabhash_traverse(struct slabhash *sh, int wr, void(*func)(struct lruhash_entry *, void *), void *arg)
Traverse a slabhash.
Definition: slabhash.c:226
static int find_arg2(RES *ssl, char *arg, char **arg2)
find second argument, modifies string
Definition: remote.c:1159
struct timeval timeout
timeout value
Definition: perf.c:137
int autr_process_prime(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset, struct module_qstate *qstate)
Perform autotrust processing.
Definition: autotrust.c:2141
static void create_cfg_parser(struct config_file *cfg, char *filename, const char *chroot)
initialize the global cfg_parser object
Definition: config_file.c:1169
static struct perfinfo * sig_info
signal handler global info
Definition: perf.c:148
void slabhash_test(void)
unit test slabhashtable implementation
Definition: unitslabhash.c:359
struct replay_answer * answer_last
last element in answer list.
Definition: replay.h:288
struct delegpt * forwards_find(struct iter_forwards *fwd, uint8_t *qname, uint16_t qclass)
Find forward zone exactly by name.
Definition: iter_fwd.c:342
#define UB_EVENT_MAGIC
magic number to identify this version of the pluggable event api
Definition: unbound-event.h:78
uint8_t origin[LDNS_MAX_DOMAINLEN+1]
the origin domain name, if len!=0.
Definition: str2wire.h:220
static void do_flush_name(RES *ssl, struct worker *w, char *arg)
remove name rrset from cache
Definition: remote.c:1917
static void read_calloc_stat(char *line, rbtree_type *tree)
read up the calloc stats
Definition: memstats.c:153
static struct module_func_block iter_block
The iterator function block.
Definition: iterator.c:3941
static void do_forward(RES *ssl, struct worker *worker, char *args)
do the status command
Definition: remote.c:2056
int inplace_cb_reply_servfail_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply linked list.
Definition: msgreply.c:1086
struct ub_shm_stat_info * ptr_ctl
the global stats block, shared memory segment
Definition: shm_main.h:58
void auth_xfer_timer(void *arg)
xfer nextprobe timeout callback, this is part of task_nextprobe
Definition: authzone.c:6480
size_t ip_ratelimit_size
memory size in bytes for ip_ratelimit cache
Definition: config_file.h:530
struct acl_list * acl_list_create(void)
Create acl structure.
Definition: acl_list.c:52
struct config_file * config_create_forlib(void)
Create config file structure for library use.
Definition: config_file.c:356
int is_priming
if this is a (stub or root) priming query (with hints)
Definition: module.h:602
int main(int argc, char *argv[])
Main routine for unbound-anchor.
Definition: unbound-anchor.c:2298
@ local_zone_inform_deny
log client address, and block (drop)
Definition: localzone.h:86
void wsvc_remove(FILE *out)
Remove installed service from servicecontrolmanager, registry entries.
Definition: w_inst.c:249
#define N3HASHBUFLEN
bytes to use for NSEC3 hash buffer.
Definition: authzone.c:74
rbtree_type xtree
rbtree of struct auth_xfer
Definition: authzone.h:78
static void do_zones_add(RES *ssl, struct local_zones *zones)
Do the local_zones command.
Definition: remote.c:1233
int root_key_sentinel
enable root key sentinel
Definition: config_file.h:343
#define O_LS2(opt, name, lst)
compare and print list option
Definition: config_file.c:864
static void tcp_callback_writer(struct comm_point *c)
do the callback when writing is done
Definition: netevent.c:998
#define NORR_TTL
Negative cache time (for entries without any RRs.)
Definition: msgparse.h:89
void packed_rrset_ptr_fixup(struct packed_rrset_data *data)
Fixup pointers in fixed data packed_rrset_data blob.
Definition: packed_rrset.c:178
void daemon_remote_delete(struct daemon_remote *rc)
remote control state to delete.
Definition: testbound.c:512
Definition: addrtree.h:65
@ LDNS_RDF_TYPE_CERT_ALG
certificate algorithm
Definition: rrdef.h:296
RPZ containing policies.
Definition: rpz.h:92
static int detect_wrongly_truncated(struct reply_info *rep)
Detect wrong truncated response (say from BIND 9.6.1 that is forwarding and saw the NS record without...
Definition: validator.c:693
static int caps_white_apply_cfg(rbtree_type *ntree, struct config_file *cfg)
apply config caps whitelist items to name tree
Definition: iter_utils.c:111
uint8_t match_qname
match qname with answer qname
Definition: testpkts.h:174
enum sec_status security
security status of the rrset data
Definition: packed_rrset.h:246
rbnode_type * rbtree_previous(rbnode_type *rbtree)
Returns previous smaller node in the tree.
Definition: rbtree.c:590
static int dnsc_parse_keys(struct dnsc_env *env, struct config_file *cfg)
Parse the secret key files from dnscrypt-secret-key config and populates a list of dnsccert with es_v...
Definition: dnscrypt.c:791
int(* lookup)(struct module_env *, struct cachedb_env *, char *, struct sldns_buffer *)
Lookup (env, cachedb_env, key, result_buffer): true if found.
Definition: cachedb.h:82
static void lz_freeup_cfg(struct config_file *cfg)
free memory from config
Definition: localzone.c:1041
void sock_list_prepend(struct sock_list **list, struct sock_list *add)
Append one list to another.
Definition: net_help.c:798
uint8_t match_opcode
match query opcode with answer opcode
Definition: testpkts.h:170
enum respip_action resp_addr_get_action(const struct resp_addr *addr)
returns respip action for the specified node in the respip address returns respip_none for NULL input...
Definition: respip.c:1287
int count
the number of elements, including this one and the ones whose parents (-parents) include this one,...
Definition: val_neg.h:158
void iter_store_parentside_rrset(struct module_env *env, struct ub_packed_rrset_key *rrset)
Store parent-side rrset in separate rrset cache entries for later last-resort * lookups in case the c...
Definition: iter_utils.c:1067
@ VAL_CLASS_ANY
A response to a qtype=ANY query.
Definition: val_utils.h:80
static int prime_root(struct module_qstate *qstate, struct iter_qstate *iq, int id, uint16_t qclass)
Generate and send a root priming request.
Definition: iterator.c:777
struct rr_parse * rrsig_last
last in list of RRSIG RRs over this rrset.
Definition: msgparse.h:175
static void check_read_exact(const char *name, const char *zone)
check that a zone (in string) can be read and reproduced
Definition: unitauth.c:586
int sldns_str2wire_time_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TIME from string to wireformat.
Definition: str2wire.c:1416
struct dns_msg * dns_msg_create(uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional *region, size_t capacity)
Utility, create new, unpacked data structure for cache response.
Definition: dns.c:408
Hash table formed from several smaller ones.
Definition: slabhash.h:57
int dname_canon_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
Compare dnames, Canonical in rfc4034 sense, but by label.
Definition: dname.c:802
char * sldns_wire2str_rr(uint8_t *rr, size_t len)
Convert wireformat RR to a string representation.
Definition: wire2str.c:208
struct tcp_req_info * tcp_req_info_create(struct sldns_buffer *spoolbuf)
Create tcp request info structure that keeps track of open requests on the TCP channel that are resol...
Definition: listen_dnsport.c:1598
int mesh_state_is_unique(struct mesh_state *mstate)
Check if the mesh state is unique.
Definition: mesh.c:849
void comm_base_set_slow_accept_handlers(struct comm_base *b, void(*stop_acc)(void *), void(*start_acc)(void *), void *arg)
Set the slow_accept mode handlers.
Definition: netevent.c:260
static struct auth_addr * auth_addr_list_copy(struct auth_addr *source)
copy a list of auth_addrs
Definition: authzone.c:3665
struct sldns_struct_lookup_table * sldns_rcodes
Response codes.
Definition: wire2str.c:101
void * ssl
ssl for current connection, type SSL*
Definition: dtstream.h:147
void query_info_clear(struct query_info *m)
clear out query info structure
Definition: msgreply.c:591
static void traverse_post(void(*func)(rbnode_type *, void *), void *arg, rbnode_type *node)
recursive descent traverse
Definition: rbtree.c:610
static void dosetup(struct timehist *hist)
do setup exponentially
Definition: timehist.c:71
struct dns_msg * val_find_DS(struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t c, struct regional *region, uint8_t *topname)
Find DS denial message in cache.
Definition: val_utils.c:1135
void fake_event_init(struct replay_scenario *scen)
Initialise fake event services.
Definition: fake_event.c:123
struct sldns_struct_lookup_table * sldns_edns_options
EDNS option codes.
Definition: wire2str.c:175
int do_ip6
do ip6 query support.
Definition: config_file.h:87
static void change(FILE *out, char *path, size_t max, const char *from, const char *to)
change suffix
Definition: w_inst.c:175
struct ctx_query * context_lookup_new_query(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Lookup query from new_query buffer.
Definition: context.c:278
static int read_names(struct iter_priv *priv, struct config_file *cfg)
Read private-domain declarations from config.
Definition: iter_priv.c:109
#define UB_EV_PERSIST
event must persist
Definition: unbound-event.h:75
struct lruhash_entry * lru_next
next entry in lru chain.
Definition: lruhash.h:214
static struct local_rrset * local_data_find_type(struct local_data *data, uint16_t type, int alias_ok)
Find an rrset in local data structure.
Definition: localzone.c:293
static struct rrset_parse * new_rrset(struct msg_parse *msg, uint8_t *dname, size_t dnamelen, uint16_t type, uint16_t dclass, hashvalue_type hash, uint32_t rrset_flags, sldns_pkt_section section, struct regional *region)
Allocate new rrset in region, fill with data.
Definition: msgparse.c:77
struct ub_packed_rrset_key ** rrsets
List of pointers (only) to the rrsets in the order in which they appear in the reply message.
Definition: msgreply.h:193
int * avail_ports
the available ports array.
Definition: outside_network.h:182
char * target_fetch_policy
the target fetch policy for the iterator
Definition: config_file.h:173
#define TARGET_FETCH_STOP
at what query-sent-count to stop target fetch policy
Definition: iterator.h:87
void mesh_stats(struct mesh_area *mesh, const char *str)
Print some stats about the mesh to the log.
Definition: mesh.c:1726
int ttl
TTL for the result, in seconds.
Definition: unbound.h:217
static void interfacechecks(struct config_file *cfg)
check interface strings
Definition: unbound-checkconf.c:332
static struct trust_anchor * todo_probe(struct module_env *env, time_t *next)
fetch first to-probe trust-anchor and lock it and set retrytime
Definition: autotrust.c:2391
char * val_nsec3_key_iterations
nsec3 maximum iterations per key size, string
Definition: config_file.h:377
void(* add_bits)(struct ub_event *, short)
Add event bits for this event to fire on.
Definition: unbound-event.h:128
static int skip_pkt_rr(sldns_buffer *pkt)
skip RR in packet
Definition: msgparse.c:1037
void delegpt_count_ns(struct delegpt *dp, size_t *numns, size_t *missing)
count NS and number missing for logging
Definition: iter_delegpt.c:227
void fake_event_cleanup(void)
Deinit fake event services.
Definition: fake_event.c:129
@ LDNS_RR_TYPE_NSAP
RFC1706.
Definition: rrdef.h:127
static void dlv_topdomain(struct ub_packed_rrset_key *nsec, uint8_t *qname, uint8_t **nm, size_t *nm_len)
Find shared topdomain that exists.
Definition: val_nsec.c:549
static int read_root_hints(struct iter_hints *hints, char *fname)
read root hints from file
Definition: iter_hints.c:299
static int xfr_process_chunk_list(struct auth_xfer *xfr, struct module_env *env, int *ixfr_fail)
process chunk list and update zone in memory, return false if it did not work
Definition: authzone.c:4972
uint16_t qclass
qclass, host byte order
Definition: msgreply.h:81
char * socket_path
the file path for unix socket (or NULL)
Definition: dtstream.h:209
sldns_lookup_table * sldns_opcodes
Operation codes.
Definition: wire2str.c:111
int harden_glue
harden against spoofed glue (out of zone data)
Definition: config_file.h:252
size_t ar_numrrsets
Count of additional section RRsets.
Definition: msgreply.h:181
int sldns_wire2str_dname_buf(uint8_t *dname, size_t dname_len, char *str, size_t len)
Convert wire dname to a string, "example.com.".
Definition: wire2str.c:311
static int serviced_check_qname(sldns_buffer *pkt, uint8_t *qbuf, size_t qbuflen)
check that perturbed qname is identical
Definition: outside_network.c:1663
enum sec_status val_verify_rrset_entry(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct key_entry_key *kkey, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify RRset with keys from a keyset.
Definition: val_utils.c:393
int addr_tree_compare(const void *k1, const void *k2)
compare addr tree nodes
Definition: dnstree.c:60
static int rrset_has_signer(struct ub_packed_rrset_key *rrset, uint8_t *name, size_t len)
see if rrset has signer name as one of the rrsig signers
Definition: val_utils.c:833
char * tls_auth_name
the name of the tls authentication name, eg.
Definition: outside_network.h:345
rbnode_type * rbtree_delete(rbtree_type *rbtree, const void *key)
Delete element from tree.
Definition: rbtree.c:329
void lru_touch(struct lruhash *table, struct lruhash_entry *entry)
Touch entry, so it becomes the most recently used in the LRU list.
Definition: lruhash.c:288
int sldns_wire2str_wks_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat WKS field to string, with user buffers.
Definition: wire2str.c:1470
size_t cmd_read
are we currently reading a command, 0 if not, else bytecount
Definition: tube.h:77
struct query_info qchase
The query name we have chased to; qname after following CNAMEs.
Definition: validator.h:168
int algo_needs_missing(struct algo_needs *n)
See which algo is missing.
Definition: val_sigcrypt.c:471
void server_stats_compile(struct worker *worker, struct ub_stats_info *s, int reset)
Compile stats into structure for this thread worker.
Definition: stats.c:254
int val_favorite_ds_algo(struct ub_packed_rrset_key *ds_rrset)
Return algo number for favorite (best) algorithm that we support in DS.
Definition: val_utils.c:465
int edns_opt_list_remove(struct edns_option **list, uint16_t code)
Remove any option found on the edns option list that matches the code.
Definition: msgreply.c:1003
size_t pythonmod_get_mem(struct module_env *env, int id)
python module alloc size routine
Definition: pythonmod.c:569
static void serviced_perturb_qname(struct ub_randstate *rnd, uint8_t *qbuf, size_t len)
perturb a dname capitalization randomly
Definition: outside_network.c:1544
size_t taglen
length of the taglist (in bytes)
Definition: localzone.h:145
int ub_poll(struct ub_ctx *ctx)
Poll a context to see if it has any new results Do not poll in a loop, instead extract the fd below t...
Definition: libunbound.c:504
void timehist_export(struct timehist *hist, long long *array, size_t sz)
Export histogram to an array.
Definition: timehist.c:228
static void prime_supers(struct module_qstate *qstate, int id, struct module_qstate *forq)
Return priming query results to interested super querystates.
Definition: iterator.c:3121
int inplace_cb_reply_local_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply_local linked list.
Definition: msgreply.c:1076
struct ub_packed_rrset_key * dnskey_rrset
The DNSKEY RRset.
Definition: val_anchor.h:120
int sldns_wire2str_hip_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat HIP (algo, HIT, pubkey) field to string, with user buffers.
Definition: wire2str.c:1603
void(* inform_super)(struct module_qstate *qstate, int id, struct module_qstate *super)
inform super querystate about the results from this subquerystate.
Definition: module.h:724
int sldns_wire2str_eui64_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat EUI64 field to string, with user buffers.
Definition: wire2str.c:1678
void msgparse_bucket_remove(struct msg_parse *msg, struct rrset_parse *rrset)
Remove rrset from hash table.
Definition: msgparse.c:265
struct iter_forward_zone * parent
pointer to parent in tree (or NULL if none)
Definition: iter_fwd.h:82
int optind
getopt global, in case header files fail to declare it.
#define FSTRM_CONTROL_FRAME_START
control frame value to denote the control frame START
Definition: dnstap_fstrm.h:102
INLINE uint8_t sldns_buffer_read_u8_at(sldns_buffer *buffer, size_t at)
returns the byte value at the given position in the buffer
Definition: sbuffer.h:626
static void provide_file_chunked(SSL *ssl, char *fname)
provide file over SSL, chunked encoding
Definition: petal.c:438
int tcp_connect_errno_needs_log(struct sockaddr *addr, socklen_t addrlen)
See if errno for tcp connect has to be logged or not.
Definition: netevent.c:328
uint8_t * config_parse_taglist(struct config_file *cfg, char *str, size_t *listlen)
parse taglist from string into bytestring with bitlist.
Definition: config_file.c:1956
@ LDNS_SECTION_ANY
bogus section, if not interested
Definition: pkthdr.h:122
union comm_reply::@6 pktinfo
the return source interface data
void(* winsock_tcp_wouldblock)(struct ub_event *, int eventbit)
Libunbound will signal the eventloop when a TCP windows socket will block on next read or write (give...
Definition: unbound-event.h:158
void reply_info_parsedelete(struct reply_info *rep, struct alloc_cache *alloc)
Delete reply_info and packed_rrsets (while they are not yet added to the hashtables....
Definition: msgreply.c:533
struct worker * worker_create(struct daemon *daemon, int id, int *ports, int n)
Create the worker structure.
Definition: worker.c:1700
static int az_generate_answer_with_node(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg *msg, struct auth_data *node)
Create answers when an exact match exists for the domain name.
Definition: authzone.c:3132
static int key_created
if key has been created
Definition: log.c:68
@ RESPONSE_TYPE_UNTYPED
'untyped' means that the type of this response hasn't been assigned.
Definition: iter_resptype.h:57
void(* store)(struct module_env *, struct cachedb_env *, char *, uint8_t *, size_t, time_t)
Store (env, cachedb_env, key, data, data_len)
Definition: cachedb.h:86
static int print_hex_buf(char **s, size_t *slen, uint8_t *buf, size_t len)
print hex format into text buffer for specified length
Definition: wire2str.c:344
static int tcp_req_info_add_result(struct tcp_req_info *req, uint8_t *buf, size_t len)
Add a result to the result list.
Definition: listen_dnsport.c:1872
#define EDNSSUBNET_ADDRFAM_IP4
In use by the edns subnet option code, as assigned by IANA.
Definition: edns-subnet.h:46
static time_t calc_next_probe(struct module_env *env, time_t wait)
calculate next probe time
Definition: autotrust.c:1999
void reply_info_sortref(struct reply_info *rep)
Sorts the ref array.
Definition: msgreply.c:507
void reply_info_set_ttls(struct reply_info *rep, time_t timenow)
Set TTLs inside the replyinfo to absolute values.
Definition: msgreply.c:514
int addr_in_common(struct sockaddr_storage *addr1, int net1, struct sockaddr_storage *addr2, int net2, socklen_t addrlen)
See how many bits are shared, equal, between two addrs.
Definition: net_help.c:698
long long ans_bogus
answers that were bogus (withheld as SERVFAIL)
Definition: unbound.h:729
int time_step
The replay time step number.
Definition: replay.h:185
lruhash_sizefunc_type sizefunc
the size function for entries in this table
Definition: lruhash.h:151
size_t qlist_capacity
allocated size of qlist array
Definition: perf.c:121
int ub_c_wrap(void)
wrap function
Definition: config_file.c:1645
int trust_anchor_labs
trust anchor labels
Definition: validator.h:195
struct dt_msg_queue * queue
buffer of this worker
Definition: dtstream.h:231
int(* del)(struct ub_event *)
Deactivate the event.
Definition: unbound-event.h:140
int outgoing_num_ports
outgoing port range number of ports (per thread)
Definition: config_file.h:135
static int sldns_wire2str_b64_scan_num(uint8_t **d, size_t *dl, char **s, size_t *sl, size_t num)
scan number of bytes from wire into b64 presentation format
Definition: wire2str.c:1221
void rrset_array_unlock(struct rrset_ref *ref, size_t count)
Unlock array (sorted) of rrset references.
Definition: rrset.c:326
long long qipv6
number of queries over IPv6
Definition: unbound.h:701
Reply to a client.
Definition: mesh.h:216
static void xml_parse_setup(XML_Parser parser, struct xml_data *data, time_t now)
XML parser setup of the callbacks for the tags.
Definition: unbound-anchor.c:1558
ssize_t sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr)
returns a token/char from the stream F.
Definition: parse.c:33
static struct ub_packed_rrset_key * filter_first(struct nsec3_filter *filter, size_t *rrsetnum, int *rrnum)
Start iterating over NSEC3 records.
Definition: val_nsec3.c:373
int delegpt_add_ns_mlc(struct delegpt *dp, uint8_t *name, uint8_t lame)
add a name to malloced delegation point.
Definition: iter_delegpt.c:579
int ip_dscp
IP_TOS socket option requested on port 53 sockets.
Definition: config_file.h:194
int optind
getopt global, in case header files fail to declare it.
struct lruhash ** array
lookup array of hash tables
Definition: slabhash.h:65
@ acl_deny_non_local
disallow any access to zones that aren't local, drop it
Definition: acl_list.h:60
struct outbound_entry * first
The linked list of outbound query entries.
Definition: outbound_list.h:54
static void check_chroot_filelist(const char *desc, struct config_strlist *list, const char *chrootdir, struct config_file *cfg)
check file list, every file must be inside the chroot location
Definition: unbound-checkconf.c:476
int reconnect_timeout
the current reconnection timeout, it is increased with exponential backoff, in msec
Definition: dtstream.h:186
static void xfr_transfer_start_lookups(struct auth_xfer *xfr)
start the lookups for task_transfer
Definition: authzone.c:3752
size_t pkt_dname_len(sldns_buffer *pkt)
Determine correct, compressed, dname present in packet.
Definition: dname.c:183
void alloc_clear(struct alloc_cache *alloc)
Free the alloc.
Definition: alloc.c:160
void ub_event_set_fd(struct ub_event *ev, int fd)
Change or set the file descriptor on the event.
Definition: ub_event_pluggable.c:565
struct comm_timer * comm_timer_create(struct comm_base *base, void(*cb)(void *), void *cb_arg)
create timer.
Definition: fake_event.c:1494
uint16_t dclass
the class of this zone, in host byteorder.
Definition: authzone.h:214
int hide_version
do not report version (version.server, version.bind)
Definition: config_file.h:315
long long qtls_resume
number of TLS connection resume
Definition: unbound.h:791
size_t ce_len
length of ce
Definition: val_nsec3.c:82
int dnssec
If an EDNS section is included, the DO/CD bit will be turned on.
Definition: outside_network.h:336
uint8_t _minimum
Minimum number of rdata fields in the RRs of this type.
Definition: rrdef.h:456
struct entry * find_match(struct entry *entries, uint8_t *query_pkt, size_t len, enum transport_type transport)
finds entry in list, or returns NULL.
Definition: testpkts.c:1427
struct comm_base * worker_base
the worker event base
Definition: module.h:471
int mesh_add_sub(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub)
Add detached query.
Definition: mesh.c:1001
int codeline_cmp(const void *a, const void *b)
compare two codeline structs for rbtree from memstats test app
Definition: unbound-dnstap-socket.c:1580
int delegpt_rrset_add_ns(struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *ns_rrset, uint8_t lame)
Add NS rrset; calls add_ns repeatedly.
Definition: iter_delegpt.c:399
Definition: ub_event_pluggable.c:142
respip_action
Valid response ip actions for the IP-response-driven-action feature; defined here instead of in the r...
Definition: localzone.h:536
const char * ub_version(void)
Get a version string from the libunbound implementation.
Definition: libunbound.c:1380
static int check_packet_ok(sldns_buffer *pkt, uint16_t qtype, struct auth_xfer *xfr, uint32_t *serial)
check if returned packet is OK
Definition: authzone.c:4032
void ecs_whitelist_delete(struct ecs_whitelist *whitelist)
Delete ecs_whitelist structure.
static int donotq_str_cfg(struct iter_donotq *dq, const char *str)
apply donotq string
Definition: iter_donotq.c:92
struct rc_state * busy_list
current commpoints busy; should be a short list, malloced
Definition: remote.h:101
static int isip6(const char *nm, char **res)
determine if str is ip6 and put into reverse lookup format
Definition: unbound-host.c:134
int ipset_init(struct module_env *env, int id)
Init the ipset module.
Definition: ipset.c:226
Reply information for a communication point.
Definition: netevent.h:113
int ub_openssl_lock_init(void)
Initialize openssl locking for thread safety.
Definition: net_help.c:1334
void dtio_stop_timer_cb(int fd, short bits, void *arg)
callback for the timer when the thread stops and wants to finish up
struct dns_msg * mesh_serve_expired_lookup(struct module_qstate *qstate, struct query_info *lookup_qinfo)
Try to get a (expired) cached answer.
Definition: mesh.c:363
static int processLastResort(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id)
Called by processQueryTargets when it would like extra targets to query but it seems to be out of opt...
Definition: iterator.c:1910
const char * val_state_to_string(enum val_state state)
Get validator state as a string.
Definition: validator.c:3280
const char * iter_state_to_string(enum iter_state state)
Get iterator state as a string.
Definition: iterator.c:3954
char * optarg
getopt global, in case header files fail to declare it.
struct slabhash * domain_rates
hash table with query rates per name: rate_key, rate_data
Definition: infra.h:118
void * command_event
the event to listen to the commandpipe
Definition: dtstream.h:173
int query_info_parse(struct query_info *m, sldns_buffer *query)
Parse wire query into a queryinfo structure, return 0 on parse error.
Definition: msgreply.c:546
char * client_cert_file
client cert files: the .pem file
Definition: dtstream.h:220
@ VAL_CLASS_UNTYPED
Not subtyped yet.
Definition: val_utils.h:63
uint8_t * nsec_closest_encloser(uint8_t *qname, struct ub_packed_rrset_key *nsec)
Determine closest encloser of a query name and the NSEC that covers it (and thus disproved it).
Definition: val_nsec.c:475
void delegpt_add_neg_msg(struct delegpt *dp, struct msgreply_entry *msg)
Add negative message to delegation point.
Definition: iter_delegpt.c:497
int sldns_wire2str_rr_unknown_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat RR to string in unknown RR format, with user buffers.
Definition: wire2str.c:547
INLINE uint8_t * sldns_buffer_begin(const sldns_buffer *buffer)
returns a pointer to the beginning of the buffer (the data at position 0).
Definition: sbuffer.h:344
enum verbosity_value verbosity
The global verbosity setting.
Definition: log.c:64
static void stat_printout(struct perfinfo *info, struct timeval *now, struct timeval *elapsed)
print nice stats about qps
Definition: perf.c:338
size_t ratelimit_slabs
number of slabs for ratelimit cache
Definition: config_file.h:537
struct ub_event * ub_signal_new(struct ub_event_base *, int fd, void(*cb)(int, short, void *), void *arg)
Create a new ub_event signal for the event base.
Definition: ub_event.c:314
int fptr_whitelist_modenv_kill_sub(void(*fptr)(struct module_qstate *newq))
Check function pointer whitelist for module_env kill_sub callback values.
Definition: fptr_wlist.c:373
int val_log_level
log bogus messages by the validator
Definition: config_file.h:356
int fptr_whitelist_event(void(*fptr)(int, short, void *))
Check function pointer whitelist for event structure callback values.
Definition: fptr_wlist.c:164
rbtree_type all
rbtree of all current queries (mesh_state.node)
Definition: mesh.h:91
int delegpt_rrset_add_ns(struct delegpt *dp, struct regional *region, struct ub_packed_rrset_key *ns_rrset, uint8_t lame)
Add NS rrset; calls add_ns repeatedly.
Definition: iter_delegpt.c:399
void rrset_data_delete(void *data, void *userdata)
Old data to be deleted.
int sldns_wire2str_nsec3_salt_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat nsec3_salt field to string, with user buffers.
Definition: wire2str.c:1302
struct key_entry_key * key_entry
the current key entry
Definition: validator.h:208
void iter_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Return priming query results to interested super querystates.
Definition: iterator.c:3588
static int find_key(struct trust_anchor *tp, uint16_t t, uint8_t *rdata, size_t rdata_len, struct autr_ta **result)
Find key.
Definition: autotrust.c:1409
static int go_cmd(SSL *ssl, int fd, int quiet, int argc, char *argv[])
send command and display result
Definition: unbound-control.c:754
static int handle_origin(char *line, uint8_t **origin, size_t *origin_len)
handle origin lines
Definition: autotrust.c:904
static void perfsetup(struct perfinfo *info)
setup perf test environment
Definition: perf.c:205
socklen_t addrlen
len of addr
Definition: replay.h:334
void rrset_update_sec_status(struct rrset_cache *r, struct ub_packed_rrset_key *rrset, time_t now)
Update security status of an rrset.
Definition: rrset.c:366
struct tcp_send_list * answerlast
last in answerlist
Definition: delayer.c:136
int mesh_state_ref_compare(const void *ap, const void *bp)
compare two mesh references
Definition: mesh.c:234
The identifying information for an RRset.
Definition: packed_rrset.h:74
long long num_query_subnet_cache
number of queries answered from edns-subnet specific data, and the answer was from the edns-subnet ca...
Definition: unbound.h:787
static void resp_addr_del(rbnode_type *n, void *ATTR_UNUSED(arg))
helper traverse to delete resp_addr nodes
Definition: respip.c:74
Connection to print to, either SSL or plain over fd.
Definition: remote.h:111
@ repevt_traffic
cause traffic to flow
Definition: replay.h:216
@ LDNS_RR_TYPE_RKEY
draft-reid-dnsext-rkey
Definition: rrdef.h:191
static int port_insert(struct listen_port **list, int s, enum listen_type ftype)
Add port to open ports list.
Definition: listen_dnsport.c:1097
static uint32_t subtract_1982(uint32_t a, uint32_t b)
if we know that b is larger than a, return the difference between them, that is the distance between ...
Definition: val_sigcrypt.c:1249
#define S_MEMSIZE(str, var)
put memsize into variable
Definition: config_file.c:415
static void reset_holddown(struct module_env *env, struct autr_ta *ta, int *changed)
Set last_change to now.
Definition: autotrust.c:1700
static int rdata_copy(sldns_buffer *pkt, struct packed_rrset_data *data, uint8_t *to, struct rr_parse *rr, time_t *rr_ttl, uint16_t type, sldns_pkt_section section)
do the rdata copy
Definition: msgreply.c:181
static void test_anchor_empty(struct val_anchors *a)
test empty set
Definition: unitanchor.c:51
int name_tree_insert(rbtree_type *tree, struct name_tree_node *node, uint8_t *name, size_t len, int labs, uint16_t dclass)
insert element into name tree.
Definition: dnstree.c:84
void listen_sslctx_setup_2(void *ctxt)
Further setup of listening SSL context, after keys loaded.
Definition: net_help.c:952
uint8_t match_do
match DO bit
Definition: testpkts.h:190
static BIO * https_to_ip(struct ip_list *ip, const char *pathname, const char *urlname, struct ip_list *src, int use_sni)
https to an IP addr, return BIO with pathname or NULL
Definition: unbound-anchor.c:1127
void ub_winsock_unregister_wsaevent(struct ub_event *ev)
Free a with a wsaevent associated event.
Definition: ub_event_pluggable.c:652
struct tcp_req_done_item * done_req_list
list of pending writable result packets, malloced one at a time
Definition: listen_dnsport.h:272
size_t key_entry_keysize(struct key_entry_key *kkey)
Get keysize of the keyentry.
Definition: val_kentry.c:397
int async
was this an async query?
Definition: context.h:154
int load_cache(RES *ssl, struct worker *worker)
Load cache(s) from text.
Definition: cachedump.c:702
rbtree_type * rbtree_create(int(*cmpf)(const void *, const void *))
Create new tree (malloced) with given key compare function.
Definition: rbtree.c:78
struct val_neg_data * parent
pointer to parent node in the negative cache
Definition: val_neg.h:153
struct listen_port * listening_ports_open(struct config_file *cfg, int *reuseport)
Create shared listening ports Getaddrinfo, create socket, bind and listen to zero or more interfaces ...
Definition: listen_dnsport.c:1443
int created_bg
is bg worker created yet ?
Definition: context.h:87
static int mesh_continue(struct mesh_area *mesh, struct mesh_state *mstate, enum module_ext_state s, enum module_ev *ev)
Continue processing the mesh state at another module.
Definition: mesh.c:1585
struct sldns_struct_lookup_table * sldns_rr_classes
lookuptable for rr classes
Definition: rrdef.c:28
struct auth_addr * scan_addr
what address we are scanning for the master, or NULL if the master is in IP format itself
Definition: authzone.h:385
char * str
config option string
Definition: config_file.h:725
static void handle_newq(struct libworker *w, uint8_t *buf, uint32_t len)
handle new query command for bg worker
Definition: libworker.c:793
@ module_event_capsfail
reply is there, but capitalisation check failed
Definition: module.h:563
void slabhash_insert(struct slabhash *sl, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *arg)
Insert a new element into the hashtable, uses lruhash_insert.
Definition: slabhash.c:116
void log_thread_set(int *num)
Init a thread (will print this number for the thread log entries).
Definition: log.c:167
void delegpt_no_ipv4(struct delegpt *dp)
Register the fact that there is no ipv4 and thus As are not going to be queried for or be useful.
Definition: iter_delegpt.c:520
sldns_lookup_table * sldns_cert_algorithms
Taken from RFC 2538, section 2.1.
Definition: wire2str.c:84
int ub_ctx_debugout(struct ub_ctx *ctx, void *out)
Set debug output (and error output) to the specified stream.
Definition: libunbound.c:475
void wsvc_desetup_worker(struct worker *worker)
Desetup lead worker events.
Definition: win_svc.c:627
char * file
why is this ref
Definition: lock_verify.c:96
size_t dynlibmod_get_mem(struct module_env *env, int id)
dynlib module alloc size routine
Definition: dynlibmod.c:201
static int insert_section(struct reply_info *rep, size_t num_rrsets, uint16_t *num_rrs, sldns_buffer *pkt, size_t rrsets_before, time_t timenow, struct regional *region, struct compress_tree_node **tree, sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset)
store msg section in wireformat buffer, return RETVAL_*
Definition: msgencode.c:542
static void testfromdrillfile(sldns_buffer *pkt, struct alloc_cache *alloc, sldns_buffer *out, const char *fname)
simple test of parsing, drill file
Definition: unitmsgparse.c:467
struct respip_action_info * respip_action_info
Extended result of response-ip action processing, mainly for logging purposes.
Definition: module.h:662
static void pretty_class(char *s, size_t len, int c)
nice string for class
Definition: unbound-host.c:238
int libworker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming replies from the network
Definition: libworker.c:876
void ub_winsock_tcp_wouldblock(struct ub_event *ev, int eventbits)
Signal the eventloop when a TCP windows socket will block on next read or write (given by the eventbi...
Definition: ub_event_pluggable.c:663
size_t unwanted_threshold
threshold when to take defensive action.
Definition: outside_network.h:94
int view_cmp(const void *v1, const void *v2)
Compare two view entries in rbtree.
Definition: view.c:48
static size_t hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len)
Converts a hex string to binary data.
Definition: testpkts.c:295
int rpz_insert_rr(struct rpz *r, uint8_t *azname, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rdatawl, size_t rdatalen, uint8_t *rr, size_t rr_len)
Create policy from RR and add to this RPZ.
Definition: rpz.c:589
void infra_deldatafunc(void *d, void *arg)
delete data and destroy the lameness hashtable
struct delegpt_addr * iter_server_selection(struct iter_env *iter_env, struct module_env *env, struct delegpt *dp, uint8_t *name, size_t namelen, uint16_t qtype, int *dnssec_lame, int *chase_to_rd, int open_target, struct sock_list *blacklist, time_t prefetch)
Select a valid, nice target to send query to.
Definition: iter_utils.c:549
socklen_t addr_len
length of address
Definition: delayer.c:125
PyObject * func_operate
Module operate function.
Definition: pythonmod.c:92
struct ub_ctx * ctx
context we are operating under
Definition: libworker.h:72
void ub_c_error(const char *str)
parsing helpers: print error with file and line numbers
Definition: config_file.c:1638
void dname_remove_label(uint8_t **dname, size_t *len)
Snip off first label from a dname, returning the parent zone.
Definition: dname.c:728
int sldns_wire2str_rcode_print(char **s, size_t *slen, int rcode)
Print host format rcode to string.
Definition: wire2str.c:871
static struct trust_anchor * parse_id(struct val_anchors *anchors, char *line)
parse id sequence for anchor
Definition: autotrust.c:810
int ub_ctx_async(struct ub_ctx *ctx, int dothread)
Set a context behaviour for asynchronous action.
Definition: libunbound.c:487
int ub_signal_add(struct ub_event *ev, struct timeval *tv)
Activate a signal event.
Definition: ub_event.c:415
struct rr_parse * rr_last
last in list of RRs in this rrset.
Definition: msgparse.h:169
struct tcl_list * tcl
TCP connection limit, limit connections from client IPs.
Definition: daemon.h:117
BIO * ds
the compiled anchors as DS records
Definition: unbound-anchor.c:1203
static struct ub_result * do_lookup(struct ub_ctx *ctx, char *domain)
lookup data
Definition: anchor-update.c:66
void(* lruhash_delkeyfunc_type)(void *, void *)
old keys are deleted.
Definition: lruhash.h:135
int delegpt_set_name(struct delegpt *dp, struct regional *regional, uint8_t *name)
Set name of delegation point.
Definition: iter_delegpt.c:94
int SERVE_EXPIRED
If we serve expired entries and prefetch them.
Definition: msgreply.c:65
transport_type
Type of transport, since some entries match based on UDP or TCP of query.
Definition: testpkts.h:146
struct reply_packet * reply_list
pre canned reply
Definition: testpkts.h:201
void auth_xfer_transfer_timer_callback(void *arg)
xfer transfer timeout callback, part of task_transfer
Definition: authzone.c:5784
int sldns_str2wire_rdf_buf(const char *str, uint8_t *rd, size_t *len, sldns_rdf_type rdftype)
Convert one rdf in rdata to wireformat and parse from string.
Definition: str2wire.c:937
int namelabs
number of labels in zone name
Definition: localzone.h:129
#define UB_STATS_RCODE_NUM
number of rcodes in stats
Definition: unbound.h:654
static int respip_action_cfg(struct respip_set *set, const char *ipstr, const char *actnstr)
set action for the node specified by the netblock string
Definition: respip.c:180
unsigned int id
the ID for the query.
Definition: outside_network.h:223
static int rrinternal_parse_unknown(sldns_buffer *strbuf, char *token, size_t token_len, uint8_t *rr, size_t *rr_len, size_t *rr_cur_len, size_t pre_data_pos)
read unknown rr type format
Definition: str2wire.c:426
static void dnsc_nonce_cache_insert(struct slabhash *cache, const uint8_t nonce[crypto_box_HALF_NONCEBYTES], const uint8_t magic_query[DNSCRYPT_MAGIC_HEADER_LEN], const uint8_t pk[crypto_box_PUBLICKEYBYTES], uint32_t hash)
Inserts a nonce, magic_query, pk tuple into the nonces_cache slabhash.
Definition: dnscrypt.c:179
@ acl_allow_setrd
allow full access for recursion queries and set RD flag regardless of request
Definition: acl_list.h:68
enum sec_status val_verify_DNSKEY_with_DS(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ds_rrset, uint8_t *sigalg, char **reason, struct module_qstate *qstate)
Verify DNSKEYs with DS rrset.
Definition: val_utils.c:483
struct config_strlist * local_zones_nodefault
local zones nodefault list
Definition: config_file.h:704
int outnet_udp_cb(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
callback for incoming udp answers from the network
Definition: outside_network.c:540
#define UB_EV_READ
event fd readable
Definition: unbound-event.h:69
static void neg_lru_remove(struct val_neg_cache *neg, struct val_neg_data *data)
Remove data element from LRU list.
Definition: val_neg.c:163
int fptr_whitelist_modenv_attach_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq))
Check function pointer whitelist for module_env attach_sub callback values.
Definition: fptr_wlist.c:354
static void do_ip_ratelimit_list(RES *ssl, struct worker *worker, char *arg)
do the ip_ratelimit_list command
Definition: remote.c:2852
int zone_is_slave
zone is a slave zone (it has masters)
Definition: authzone.h:128
struct respip_set * respip_set_create(void)
Create response IP set.
Definition: respip.c:57
static int timeval_smaller(const struct timeval *x, const struct timeval *y)
histogram compare of time values
Definition: mesh.c:117
struct respip_client_info * client_info
Attributes of clients that share the qstate that may affect IP-based actions.
Definition: module.h:658
int tube_queue_item(struct tube *tube, uint8_t *msg, size_t len)
Append data item to background list of writes.
Definition: tube.c:455
int ub_signal_add(struct ub_event *, struct timeval *)
Activate a signal event.
Definition: ub_event.c:415
int sldns_wire2str_hex_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat hex field to string, with user buffers.
Definition: wire2str.c:1248
char ** out_ifs
outgoing interface description strings (IP addresses)
Definition: config_file.h:205
static int dns64_insert_ignore_aaaa(struct dns64_env *dns64_env, char *str)
insert ignore_aaaa element into the tree
Definition: dns64.c:327
struct local_zones * local_zones
local authority zones
Definition: daemon.h:119
int ub_ctx_zone_add(struct ub_ctx *ctx, const char *zone_name, const char *zone_type)
Add a new zone with the zonetype to the local authority info of the library.
Definition: libunbound.c:1285
@ local_zone_always_nodata
answer with noerror/nodata, even when there is local data
Definition: localzone.h:96
struct ub_packed_rrset_key * reply_find_answer_rrset(struct query_info *qinfo, struct reply_info *rep)
Find answer rrset in reply, the one matching qinfo.
Definition: msgreply.c:746
static void dtio_close_output(struct dt_io_thread *dtio)
close and stop the output file descriptor event
Definition: dtstream.c:599
int32_t skew_min
clock skew min for signatures
Definition: validator.h:93
#define COMPARE_IT(x, y)
tiny subroutine for msgreply_compare
Definition: msgreply.c:569
int iter_lookup_parent_glue_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
Add parent-side glue if that exists in the cache.
Definition: iter_utils.c:1187
long long qbit_TC
number of queries with TC bit
Definition: unbound.h:707
#define UB_STATS_BUCKET_NUM
number of histogram buckets
Definition: unbound.h:658
uint16_t dclass
class.
Definition: iter_fwd.h:84
struct perfinfo * info
ptr back to perfinfo
Definition: perf.c:139
static void testlookup(struct lruhash *table, testdata_type *ref[])
test adding a random element
Definition: unitlruhash.c:258
size_t num_query_up
number of queries upstream
Definition: authzone.h:82
static int generate_keytag_query(struct module_qstate *qstate, int id, struct trust_anchor *ta)
Generate, send and detach key tag signaling query.
Definition: validator.c:444
static void change_child_ptr(rbnode_type *child, rbnode_type *old, rbnode_type *new)
Update parent pointer of a node 'child'.
Definition: rbtree.c:320
uint8_t increment_ecs_scope
increment the ECS scope copied from the sourcemask by one
Definition: testpkts.h:212
uint32_t ixfr_soa_serial
match query serial with this value.
Definition: testpkts.h:196
struct addr_tree_node node
node in address tree
Definition: respip.h:35
int config_get_option_list(struct config_file *cfg, const char *opt, struct config_strlist **list)
Get an option and return strlist.
Definition: config_file.c:771
static int match_answer(uint8_t *q, size_t qlen, uint8_t *p, size_t plen, int mttl)
match answer section of packet
Definition: testpkts.c:1232
static void checkconf(const char *cfgfile, const char *opt, int final)
check config file
Definition: unbound-checkconf.c:864
int namelabs
number of labels in name
Definition: iter_fwd.h:74
int ub_timer_del(struct ub_event *ev)
Deactivate the timeout event.
Definition: ub_event_pluggable.c:619
char * config_collate_cat(struct config_strlist *list)
take a strlist_head list and return a malloc string.
Definition: config_file.c:802
A trust anchor in the trust anchor store.
Definition: val_anchor.h:94
void probe_answer_cb(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *errinf, int was_ratelimited)
callback for query answer to 5011 probe
struct edns_option * edns_opt_copy_region(struct edns_option *list, struct regional *region)
Copy edns option list allocated to the new region.
Definition: msgreply.c:1143
struct ub_packed_rrset_key * key_entry_get_rrset(struct key_entry_key *kkey, struct regional *region)
Obtain rrset from a key entry, allocated in region.
Definition: val_kentry.c:342
void addr_mask(struct sockaddr_storage *addr, socklen_t len, int net)
Make sure the sockaddr ends in zeroes.
Definition: net_help.c:677
char * name
domain name (in text) of the stub apex domain
Definition: config_file.h:636
size_t high
high mark, items end here
Definition: delayer.c:70
size_t cur_msg_len_done
number of bytes of the length that have been written, for the current message length that precedes th...
Definition: dtstream.h:167
ssize_t sldns_bget_token(struct sldns_buffer *b, char *token, const char *delim, size_t limit)
returns a token/char from the buffer b.
Definition: parse.c:238
A pipe.
Definition: tube.h:63
static int sldns_parse_rdf_token(sldns_buffer *strbuf, char *token, size_t token_len, int *quoted, int *parens, size_t *pre_data_pos, const char *delimiters, sldns_rdf_type rdftype, size_t *token_strlen)
Parse one rdf token.
Definition: str2wire.c:541
struct ub_stats_info * ptr_arr
stats_info array, shared memory segment.
Definition: shm_main.h:56
int fptr_whitelist_inplace_cb_reply_generic(inplace_cb_reply_func_type *fptr, enum inplace_cb_list_type type)
Check function pointer whitelist for inplace_cb_reply, inplace_cb_reply_cache, inplace_cb_reply_local...
Definition: fptr_wlist.c:592
struct config_stub * cfg_stub_find(struct config_stub ***pp, const char *nm)
Find stub in config list, also returns prevptr (for deletion).
Definition: config_file.c:1271
int sldns_str2wire_period_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_PERIOD from string to wireformat.
Definition: str2wire.c:1476
@ module_event_new
new query
Definition: module.h:555
uint8_t lame_type_A
the host is lame (not authoritative) for A records
Definition: infra.h:97
enum listen_type ftype
type of file descriptor, udp or tcp
Definition: listen_dnsport.h:111
static void set_cron_timer(void)
Set the timer for cron for the next wake up.
Definition: win_svc.c:577
size_t ans_nodata
(extended stats) rcode nodata in replies
Definition: mesh.h:130
int dnskey_algo_is_supported(struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx)
See if DNSKEY algorithm is supported.
Definition: val_sigcrypt.c:382
size_t mesh_get_mem(struct mesh_area *mesh)
Calculate memory size in use by mesh and all queries inside it.
Definition: mesh.c:1770
int rate_compfunc(void *key1, void *key2)
compare two names, returns -1, 0, or +1
Definition: infra.c:121
rbnode_type node
rbtree node, key is name and class
Definition: authzone.h:195
static void clean_point(struct daemon_remote *rc, struct rc_state *s)
decrease active count and remove commpoint from busy list
Definition: remote.c:541
struct mesh_state * mesh_state_create(struct module_env *env, struct query_info *qinfo, struct respip_client_info *cinfo, uint16_t qflags, int prime, int valrec)
Create and initialize a new mesh state and its query state Does not put the mesh state into rbtrees a...
Definition: mesh.c:770
@ local_zone_always_deny
drop query, even when there is local data
Definition: localzone.h:98
The global variable environment contents for the ipsecmod Shared between threads, this represents lon...
Definition: ipsecmod.h:53
static int nsec3_get_algo(struct ub_packed_rrset_key *rrset, int r)
return nsec3 RR algorithm
Definition: val_nsec3.c:145
void neg_test(void)
unit test for negative cache functions
Definition: unitneg.c:532
int infra_rate_max(void *data, time_t now)
find the maximum rate stored, not too old.
Definition: infra.c:898
int mesh_attach_sub(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq)
Attach subquery.
Definition: mesh.c:1047
uint16_t udp_size
UDP reassembly size.
Definition: msgparse.h:225
struct dns_msg * dns_cache_lookup(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, struct regional *region, struct regional *scratch, int no_partial)
Find cached message.
Definition: dns.c:801
struct comm_point * comm_point_create_local(struct comm_base *base, int fd, size_t bufsize, comm_point_callback_type *callback, void *callback_arg)
Create commpoint to listen to a local domain file descriptor.
Definition: netevent.c:2943
void tube_handle_signal(int fd, short events, void *arg)
for fptr wlist, winsock signal event callback function
int sldns_str2wire_ipseckey_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_IPSECKEY from string to wireformat.
Definition: str2wire.c:1850
void iter_store_parentside_rrset(struct module_env *env, struct ub_packed_rrset_key *rrset)
Store parent-side rrset in separate rrset cache entries for later last-resort * lookups in case the c...
Definition: iter_utils.c:1067
void anchors_test(void)
unit test trust anchor storage functions
Definition: unitanchor.c:125
@ VAL_CLASS_NODATA
A NOERROR/NODATA response.
Definition: val_utils.h:71
struct timehist * histogram
histogram of time values
Definition: mesh.h:122
int dt_io_thread_apply_cfg(struct dt_io_thread *dtio, struct config_file *cfg)
Apply config to the dtio thread.
Definition: dtstream.c:257
void(* mesh_cb_func_type)(void *cb_arg, int rcode, struct sldns_buffer *, enum sec_status, char *why_bogus, int was_ratelimited)
Mesh result callback func.
Definition: mesh.h:240
int ready_frame_sent
Set if the READY control frame has been sent.
Definition: dtstream.h:202
char * rpz_action_override
Override RPZ action for this zone, regardless of zone content.
Definition: config_file.h:681
int ub_ctx_add_ta_autr(struct ub_ctx *ctx, const char *fname)
Add trust anchor to the given context that is tracked with RFC5011 automated trust anchor maintenance...
Definition: libunbound.c:427
int port
the port number (for urls)
Definition: authzone.h:449
int ub_timer_del(struct ub_event *ev)
Deactivate the timeout event.
Definition: ub_event.c:409
void name_tree_init(rbtree_type *tree)
Init a name tree to be empty.
Definition: dnstree.c:74
Authoritative zone transfer structure.
Definition: authzone.h:193
int tube_setup_bg_listen(struct tube *tube, struct comm_base *base, tube_callback_type *cb, void *arg)
Start listening for information over the pipe.
Definition: tube.c:428
@ LDNS_RDF_TYPE_CLASS
a class
Definition: rrdef.h:294
static void print_dp_details(RES *ssl, struct worker *worker, struct delegpt *dp)
print details on a delegation point
Definition: cachedump.c:713
size_t dns64_get_mem(struct module_env *env, int id)
Returns the amount of global memory that this module uses, not including per-query data.
Definition: dns64.c:1009
uint16_t type
DNS type (host format) of the key, DS or DNSKEY.
Definition: val_anchor.h:87
void slabhash_clear(struct slabhash *sl)
Clear hash table.
Definition: slabhash.c:100
@ respip_inform_redirect
log query source and redirect
Definition: localzone.h:548
void val_mark_insecure(struct reply_info *rep, uint8_t *kname, struct rrset_cache *r, struct module_env *env)
Mark all unchecked rrset entries below a NULL key entry as insecure.
Definition: val_utils.c:1031
@ LDNS_RDF_TYPE_ALG
a key algorithm
Definition: rrdef.h:298
static int prepend_is_duplicate(struct ub_packed_rrset_key **sets, size_t to, struct ub_packed_rrset_key *dup)
check if prepend item is duplicate item
Definition: iterator.c:380
size_t dname_len
length of the dname uncompressed wireformat
Definition: msgparse.h:155
static size_t timehist_count(struct timehist *hist)
total number in histogram
Definition: timehist.c:189
static size_t get_max_iter(struct val_env *ve, size_t bits)
Find max iteration count using config settings and key size.
Definition: val_nsec3.c:453
int auth_zone_get_serial(struct auth_zone *z, uint32_t *serial)
find serial number of zone or false if none
Definition: authzone.c:1765
struct delegpt_ns * nslist
the nameservers, names from the NS RRset rdata.
Definition: iter_delegpt.h:66
#define O_STR(opt, str, var)
compare and print string option
Definition: config_file.c:845
Subset of resp_addr.node, used for inform-variant logging.
Definition: respip.c:31
uint8_t * hash
the hash result (not base32 encoded)
Definition: val_nsec3.h:240
int sr
pipe end to read from
Definition: tube.h:66
struct config_strlist * dlv_anchor_list
DLV anchor inline.
Definition: config_file.h:337
struct sockaddr_storage addr
and to what address this is sent to.
Definition: replay.h:332
socklen_t addrlen
length of addr field
Definition: outside_network.h:173
int http
use HTTP for this master
Definition: authzone.h:440
void * fstrm_create_control_frame_ready(char *contenttype, size_t *len)
This creates an FSTRM control frame of type READY.
Definition: dnstap_fstrm.c:95
void log_ident_set(const char *id)
Set identity to print, default is 'unbound'.
Definition: log.c:180
static struct compress_tree_node * compress_tree_newnode(uint8_t *dname, int labs, size_t offset, struct regional *region)
Create node for domain name compression tree.
Definition: msgencode.c:178
int sldns_str2wire_ilnp64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ILNP64 from string to wireformat.
Definition: str2wire.c:1949
int sldns_wire2str_rdf_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, int rdftype, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rdf field to string, with user buffers.
Definition: wire2str.c:943
static enum sec_status check_delegation_secure(struct reply_info *rep)
check if a delegation is secure
Definition: worker.c:422
static int processPrimeResponse(struct module_qstate *qstate, int id)
This handles the response to a priming query.
Definition: iterator.c:3173
int nsec3_hash_cmp(const void *c1, const void *c2)
Rbtree for hash cache comparison function.
Definition: val_nsec3.c:496
void dtio_output_cb(int fd, short bits, void *arg)
callback for the dnstap events, to write to the output
static int processValidate(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
Process the VALIDATE stage, the init and findkey stages are finished, and the right keys are availabl...
Definition: validator.c:1824
void modstack_init(struct module_stack *stack)
Init a stack of modules.
Definition: modstack.c:92
size_t msg_cache_slabs
slabs in the message cache.
Definition: config_file.h:152
size_t space_max
the amount of space the hash table is maximally allowed to use.
Definition: lruhash.h:180
struct ip_list * next
next in list
Definition: unbound-anchor.c:164
static void quote_it(FILE *out, char *str, size_t maxlen)
put quotes around string.
Definition: w_inst.c:162
static struct trust_anchor * anchor_read_file(struct val_anchors *anchors, sldns_buffer *buffer, const char *fname, int onlyone)
Read a file with trust anchors.
Definition: val_anchor.c:427
static int get_line(char **s, char **n)
get one line ( ) from a string, move next to after the , zero
Definition: testpkts.c:921
static int populate_action_info(struct respip_action_info *actinfo, enum respip_action action, const struct resp_addr *raddr, const struct ub_packed_rrset_key *ATTR_UNUSED(rrset), int ATTR_UNUSED(tag), const struct respip_set *ATTR_UNUSED(ipset), int ATTR_UNUSED(action_only), struct regional *region, int rpz_used, int rpz_log, char *log_name, int rpz_cname_override)
Populate action info structure with the results of response-ip action processing, iff as the result o...
Definition: respip.c:833
static void ub_stop_bg(struct ub_ctx *ctx)
stop the bg thread
Definition: libunbound.c:238
struct rc_state * next
the next item in list
Definition: remote.h:67
#define REGIONAL_LARGE_OBJECT_SIZE
Default size for large objects - allocated outside of chunks.
Definition: regional.c:62
struct replay_scenario * replay_scenario_read(FILE *in, const char *name, int *lineno)
Read a replay scenario from the file.
Definition: replay.c:439
static void validate_positive_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey)
Given a "positive" response – a response that contains an answer to the question, and no CNAME chain,...
Definition: validator.c:784
static int skip_pkt_rrs(sldns_buffer *pkt, int num)
skip RRs from packet
Definition: msgparse.c:1051
uint8_t * context_serialize_cancel(struct ctx_query *q, uint32_t *len)
Serialize a query cancellation.
Definition: context.c:375
int ub_signal_del(struct ub_event *ev)
Deactivate a signal event.
Definition: ub_event.c:421
static int connect_to_ip(struct ip_list *ip, struct ip_list *src)
connect to IP address
Definition: unbound-anchor.c:737
int donotquery_localhost
use default localhost donotqueryaddr entries
Definition: config_file.h:242
structure to threaded test the lru hash table
Definition: unitslabhash.c:300
long int ub_random(struct ub_randstate *state)
Generate next random number from the state passed along.
Structure holding worker list.
Definition: daemon.h:76
int server_s
the fd to listen for server answer
Definition: delayer.c:120
void respip_clear(struct module_qstate *qstate, int id)
response-ip cleanup query state
Definition: respip.c:1258
int dname_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
Compare dnames, sorted not canonical, but by label.
Definition: dname.c:486
int fptr_whitelist_inplace_cb_query(inplace_cb_query_func_type *fptr)
Check function pointer whitelist for inplace_cb_query func values.
Definition: fptr_wlist.c:630
struct lruhash_entry * infra_lookup_nottl(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, int wr)
lookup version that does not check host ttl (you check it)
Definition: infra.c:362
void log_query_info(enum verbosity_value v, const char *str, struct query_info *qinf)
Print string with neat domain name, type, class from query info.
Definition: msgreply.c:883
#define MESH_MAX_SUBSUB
Max number of references-to-references-to-references.
Definition: mesh.h:77
int sldns_wire2str_edns_dhu_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS DHU option data to string.
Definition: wire2str.c:1832
int reply_info_encode(struct query_info *qinfo, struct reply_info *rep, uint16_t id, uint16_t flags, struct sldns_buffer *buffer, time_t timenow, struct regional *region, uint16_t udpsize, int dnssec, int minimise)
Regenerate the wireformat from the stored msg reply.
Definition: msgencode.c:667
void slabhash_status(struct slabhash *sl, const char *id, int extended)
Output debug info to the log as to state of the hash table.
Definition: slabhash.c:133
lock_quick_type lock
lock for exclusive access, to the lookup array
Definition: lruhash.h:149
int log_replies
log replies with one line per reply
Definition: config_file.h:302
#define RED
Node colour red.
Definition: rbtree.c:50
listen_type
type of ports
Definition: listen_dnsport.h:83
void val_clear(struct module_qstate *qstate, int id)
validator cleanup query state
Definition: validator.c:3245
socklen_t addrlen
length of addr
Definition: iter_delegpt.h:143
size_t rr_idx
which RR in the rrset
Definition: val_sigcrypt.c:644
static void respip_view_conf_data_test(void)
Test per-view respip redirect w/ data directives.
Definition: unitmain.c:794
int sldns_wire2str_b32_ext_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat b32_ext field to string, with user buffers.
Definition: wire2str.c:1198
rbnode_type * left
left node (smaller items)
Definition: rbtree.h:59
void * data
data
Definition: lruhash.h:222
#define NSEC3_UNKNOWN_FLAGS
The unknown flags in the NSEC3 flags field.
Definition: val_nsec3.h:95
int reply_info_parse(struct sldns_buffer *pkt, struct alloc_cache *alloc, struct query_info *qinf, struct reply_info **rep, struct regional *region, struct edns_data *edns)
Parse query reply.
Definition: msgreply.c:461
void rtt_update(struct rtt_info *rtt, int ms)
Update the statistics with a new roundtrip estimate observation.
Definition: rtt.c:89
static void provide_file_10(SSL *ssl, char *fname)
provide file in whole transfer
Definition: petal.c:367
enum sec_status nsec3_prove_wildcard(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, uint8_t *wc)
Prove that a positive wildcard match was appropriate (no direct match RRset).
Definition: val_nsec3.c:1243
int fallback_enabled
fallback to recursion to authorities if zone expired and other reasons perhaps (like,...
Definition: config_file.h:673
static struct ub_packed_rrset_key * neg_find_nsec(struct val_neg_cache *neg_cache, uint8_t *qname, size_t qname_len, uint16_t qclass, struct rrset_cache *rrset_cache, time_t now, struct regional *region)
Get best NSEC record for qname.
Definition: val_neg.c:1210
static int insert_query(struct query_info *qinfo, struct compress_tree_node **tree, sldns_buffer *buffer, struct regional *region)
store query section in wireformat buffer, return RETVAL
Definition: msgencode.c:597
int rrstr_get_rr_content(const char *str, uint8_t **nm, uint16_t *type, uint16_t *dclass, time_t *ttl, uint8_t *rr, size_t len, uint8_t **rdata, size_t *rdata_len)
Parses resource record string into wire format, also returning its field values.
Definition: localzone.c:233
int respip_global_apply_cfg(struct respip_set *set, struct config_file *cfg)
Apply response-ip config settings to the global (default) view.
Definition: respip.c:398
int below
ratelimit for names below this name, -1 if not set
Definition: infra.h:137
struct lruhash_entry * slabhash_lookup(struct slabhash *sl, hashvalue_type hash, void *key, int wr)
Lookup an entry in the hashtable.
Definition: slabhash.c:122
Key cache.
Definition: val_kcache.h:54
comm_point_callback_type * callback
The callback function to call when answer arrives (or timeout)
Definition: replay.h:342
void ipset_deinit(struct module_env *env, int id)
Deinit the ipset module.
Definition: ipset.c:253
int num_outstanding
number of outstanding queries on this port
Definition: outside_network.h:209
static void usage(void)
print program usage help
Definition: lock_verify.c:108
rbtree_type ignore_aaaa
Tree of names for which AAAA is ignored.
Definition: dns64.c:135
static void libworker_fillup_fg(struct ctx_query *q, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
fillup fg results
Definition: libworker.c:524
static void dtio_setup_on_base(struct dt_io_thread *dtio)
perform the setup of the writer thread on the established event_base
Definition: dtstream.c:2018
int ub_event_base_dispatch(struct ub_event_base *base)
Run the event base.
Definition: ub_event.c:278
#define DNSSEC_LAME_DETECT_COUNT
max number of queries for which to perform dnsseclameness detection, (rrsigs missing detection) after...
Definition: iterator.h:71
static int error_response(struct module_qstate *qstate, int id, int rcode)
Return an error.
Definition: ipset.c:34
struct port_comm * pc
comm point it was sent on (and reply must come back on).
Definition: outside_network.h:229
static int setup_qinfo_edns(struct libworker *w, struct ctx_query *q, struct query_info *qinfo, struct edns_data *edns)
setup qinfo and edns
Definition: libworker.c:562
struct lruhash_entry * slabhash_lookup(struct slabhash *table, hashvalue_type hash, void *key, int wr)
Lookup an entry in the hashtable.
Definition: slabhash.c:122
static int nsec3_no_type(struct ub_packed_rrset_key *k, uint16_t t)
Check that an NSEC3 rrset does not have a type set.
Definition: val_neg.c:1134
size_t val_next_unchecked(struct reply_info *rep, size_t skip)
Find next unchecked rrset position, return it for skip.
Definition: val_utils.c:1048
size_t sldns_rr_dnskey_key_size_raw(const unsigned char *keydata, const size_t len, int alg)
get the length of the keydata in bits
Definition: keyraw.c:38
void * key
key
Definition: lruhash.h:220
static struct val_neg_data * neg_find_nsec3_ce(struct val_neg_zone *zone, uint8_t *qname, size_t qname_len, int qlabs, sldns_buffer *buf, uint8_t *hashnc, size_t *nclen)
find nsec3 closest encloser in neg cache
Definition: val_neg.c:1266
int ub_event_del(struct ub_event *)
Deactivate the event.
Definition: ub_event.c:393
void packed_rrset_ttl_add(struct packed_rrset_data *data, time_t add)
Fixup TTLs in fixed data packed_rrset_data blob.
Definition: packed_rrset.c:219
int forwards_next_root(struct iter_forwards *fwd, uint16_t *qclass)
Find next root item in forwards lookup tree.
Definition: iter_fwd.c:397
size_t delegpt_count_missing_targets(struct delegpt *dp)
Count number of missing targets.
Definition: iter_delegpt.c:326
struct sldns_buffer * buffer
buffer pointer.
Definition: netevent.h:166
INLINE size_t sldns_buffer_remaining_at(sldns_buffer *buffer, size_t at)
returns the number of bytes remaining between the indicated position and the limit.
Definition: sbuffer.h:380
int timeout_count
Count number of time-outs.
Definition: iterator.h:403
int sldns_wire2str_rdf_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, int rdftype, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rdf field to string, with user buffers.
Definition: wire2str.c:943
struct delegpt * forwards_lookup(struct iter_forwards *fwd, uint8_t *qname, uint16_t qclass)
Find forward zone information For this qname/qclass find forward zone information,...
Definition: iter_fwd.c:356
static int priv_lookup_addr(struct iter_priv *priv, struct sockaddr_storage *addr, socklen_t addrlen)
See if an address is blocked.
Definition: iter_priv.c:174
@ LDNS_RDF_TYPE_ATMA
ATMA.
Definition: rrdef.h:323
static void msg_del_servfail(struct module_env *env, struct query_info *qinfo, uint32_t flags)
remove servfail msg cache entry
Definition: dns.c:132
void delete_entry(struct entry *list)
Delete linked list of entries.
Definition: testpkts.c:1711
uint8_t match_ednsdata_raw
match edns data field given in hex
Definition: testpkts.h:194
uint32_t sldns_wirerr_get_ttl(uint8_t *rr, size_t len, size_t dname_len)
Get the ttl of the RR.
Definition: str2wire.c:812
static hashvalue_type hash_addr(struct sockaddr_storage *addr, socklen_t addrlen, int use_port)
calculate the hash value for a host key set use_port to a non-0 number to use the port in the hash ca...
Definition: infra.c:330
char * dnstap_identity
dnstap "identity", hostname is used if "".
Definition: config_file.h:505
int val_nsec_proves_insecuredelegation(struct ub_packed_rrset_key *nsec, struct query_info *qinfo)
Determine if an nsec proves an insecure delegation towards the qname.
Definition: val_nsec.c:453
int authextstrtoaddr(char *str, struct sockaddr_storage *addr, socklen_t *addrlen, char **auth_name)
Convert address string, with "@port" appendix, to sockaddr.
Definition: net_help.c:423
int infra_rtt_update(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen, int qtype, int roundtrip, int orig_rtt, time_t timenow)
Update rtt information for the host.
Definition: infra.c:562
size_t anchor_list_keytags(struct trust_anchor *ta, uint16_t *list, size_t num)
Get a list of keytags for the trust anchor.
Definition: val_anchor.c:1288
void ub_winsock_unregister_wsaevent(struct ub_event *ev)
Free a with a wsaevent associated event.
Definition: ub_event.c:427
static void apply_settings(struct daemon *daemon, struct config_file *cfg, int cmdline_verbose, int debug_mode)
set verbosity, check rlimits, cache settings
Definition: unbound.c:272
static void check_order_lock(struct order_lock *lock)
Check ordering of one lock.
Definition: lock_verify.c:350
static void verify_and_update_anchor(const char *root_anchor_file, BIO *xml, BIO *p7s, STACK_OF(X509) *cert, const char *p7signer)
Perform the verification and update of the trustanchor file.
Definition: unbound-anchor.c:1902
int was_ratelimited
If the query or one of its subqueries was ratelimited.
Definition: unbound.h:211
struct sockaddr_storage addr
remote address.
Definition: outside_network.h:281
static void timeval_subtract(struct timeval *d, const struct timeval *end, const struct timeval *start)
subtract timers and the values do not overflow or become negative
Definition: mesh.c:69
void server_stats_querymiss(struct ub_server_stats *stats, struct worker *worker)
add query if it missed the cache
Definition: stats.c:93
Per query state for the cachedb module.
Definition: cachedb.h:64
char * dnscrypt_provider
provider name 2.dnscrypt-cert.example.com
Definition: config_file.h:562
struct ub_event * ev
the ub event
Definition: unbound-dnstap-socket.c:109
@ worker_cmd_stats
obtain statistics
Definition: worker.h:71
struct tube * rr_pipe
the result read pipe
Definition: context.h:74
void ub_c_error_msg(const char *fmt,...)
print error with file and line number
Definition: config_file.c:1630
char * log_identity
log identity to report
Definition: config_file.h:310
int query_restart_count
the number of times this query has been restarted.
Definition: iterator.h:304
static void testadd_unlim(struct slabhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitslabhash.c:196
struct comm_point * outnet_comm_point_for_http(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen, int timeout, int ssl, char *host, char *path)
Create http commpoint suitable for communication to the destination.
Definition: outside_network.c:2405
void mesh_state_cleanup(struct mesh_state *mstate)
Cleanup a mesh state and its query state.
Definition: mesh.c:861
void log_rrset_key(enum verbosity_value v, const char *str, struct ub_packed_rrset_key *rrset)
Print string with neat domain name, type, class from rrset.
Definition: packed_rrset.c:263
static int az_domain_add_rr(struct auth_data *node, uint16_t rr_type, uint32_t rr_ttl, uint8_t *rdata, size_t rdatalen, int *duplicate)
Add rr to node, ignores duplicate RRs, rdata points to buffer with rdatalen octets,...
Definition: authzone.c:1093
static const dnsccert * dnsc_find_cert(struct dnsc_env *dnscenv, struct sldns_buffer *buffer)
Find the cert matching a DNSCrypt query.
Definition: dnscrypt.c:655
static int service_init(int r, struct daemon **d, struct config_file **c)
Init service.
Definition: win_svc.c:304
enum iter_state final_state
Final state for the iterator module.
Definition: iterator.h:239
lock_basic_type lock
the big lock on the negative cache.
Definition: val_neg.h:70
void auth_zones_cleanup(struct auth_zones *az)
Cleanup auth zones.
Definition: authzone.c:6674
int outnet_tcp_cb(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
callback for pending tcp connections
Definition: outside_network.c:460
struct lruhash_entry * lruhash_lookup(struct lruhash *table, hashvalue_type hash, void *key, int wr)
Lookup an entry in the hashtable.
Definition: lruhash.c:356
uid_t cfg_uid
from cfg username, after daemonize setup performed
Definition: config_file.c:74
unsigned int del_holddown
autotrust del holddown time, in seconds
Definition: config_file.h:381
int use_caps_for_id
use x20 bits to encode additional ID random bits
Definition: outside_network.h:85
static int auth_zone_write_rrset(struct auth_zone *z, struct auth_data *node, struct auth_rrset *r, FILE *out)
write rrset to file
Definition: authzone.c:1683
char ** tagname
tag list, array with tagname[i] is malloced string
Definition: config_file.h:429
Keep histogram of time values.
Definition: timehist.h:63
struct timeval since
when did this time slice start
Definition: perf.c:89
static int position_in_string(char *str, const char *sub)
Position in string.
Definition: autotrust.c:120
void * reconnect_timer
the timer event for connection retries
Definition: dtstream.h:181
size_t rpz_taglistlen
length of the taglist (in bytes)
Definition: config_file.h:679
int ub_event_base_dispatch(struct ub_event_base *)
Run the event base.
Definition: ub_event.c:278
int32_t date_override
for debug testing a fixed validation date can be entered.
Definition: validator.h:90
struct trust_anchor * anchor_store_str(struct val_anchors *anchors, struct sldns_buffer *buffer, const char *str)
Store one string as trust anchor RR.
Definition: val_anchor.c:397
int attempts
number of attempts for this addr
Definition: iter_delegpt.h:145
uint32_t expi
signature expiration
Definition: signit.c:55
size_t so_sndbuf
SO_SNDBUF size to set on port 53 UDP socket.
Definition: config_file.h:186
char * dnstap_tls_client_key_file
dnstap client key for client authentication
Definition: config_file.h:497
uint16_t ds_get_keytag(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
Get DS keytag, footprint value that matches the DNSKEY keytag it signs.
Definition: val_sigcrypt.c:228
static void del_local_rrset(struct local_data *d, uint16_t dtype)
find and remove type from list in domain struct
Definition: localzone.c:1950
struct local_rrset * next
next in list
Definition: localzone.h:182
struct pending_tcp ** tcp_conns
Array of tcp pending used for outgoing TCP connections.
Definition: outside_network.h:152
static int unitest_nsec_has_type_rdata(char *bitmap, size_t len, uint16_t type)
helper for unittest of NSEC routines
Definition: unitverify.c:370
void neg_test(void)
unit test for negative cache functions
Definition: unitneg.c:532
static void print_sock_err(const char *msg)
printout socket errno
Definition: unbound-anchor.c:726
int auth_zones_answer(struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, struct sldns_buffer *buf, struct regional *temp)
Answer query from auth zone.
Definition: authzone.c:3320
size_t len
length of the buffer
Definition: listen_dnsport.h:296
long long qbit_CD
number of queries with CD bit
Definition: unbound.h:717
lock_rw_type lock
lock on the node item
Definition: respip.h:37
int addr_is_broadcast(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is 255.255.255.255.
Definition: net_help.c:759
uint8_t * nsec_closest_encloser(uint8_t *qname, struct ub_packed_rrset_key *nsec)
Determine closest encloser of a query name and the NSEC that covers it (and thus disproved it).
Definition: val_nsec.c:475
static void verifytest_file(const char *fname, const char *at_date)
verify from a file
Definition: unitverify.c:288
static void usage(void)
Give checkconf usage, and exit (1).
Definition: unbound-checkconf.c:83
void bin_init(struct lruhash_bin *array, size_t size)
init the hash bins for the table
Definition: lruhash.c:48
time_t ttl
the TTL of this entry (absolute time)
Definition: val_kentry.h:78
struct name_tree_node * name_tree_find(rbtree_type *tree, uint8_t *name, size_t len, int labs, uint16_t dclass)
Lookup exact match in name tree.
Definition: dnstree.c:166
int want_to_exit_flush
did we already want to exit this stop-flush event base
Definition: dtstream.c:1569
static void time_passes(struct replay_runtime *runtime, struct replay_moment *mom)
pass time
Definition: fake_event.c:544
struct dt_frame_read_buf read_frame
(partially) read frame
Definition: dtstream.h:206
#define MAX_PACKETLEN
max size of a packet
Definition: testpkts.c:37
struct dt_io_list_item * io_list_iter
iterator point in the io_list, to pick from them in a round-robin fashion, instead of only from the f...
Definition: dtstream.h:126
void iter_dec_attempts(struct delegpt *dp, int d)
Remove query attempts from all available ips.
Definition: iter_utils.c:1284
int inplace_cb_reply_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply linked list.
Definition: msgreply.c:1057
int parse_dname(const char *str, uint8_t **res, size_t *len, int *labs)
Form wireformat from text format domain name.
Definition: localzone.c:132
void * fstrm_create_control_frame_accept(char *contenttype, size_t *len)
This creates an FSTRM control frame of type ACCEPT.
Definition: dnstap_fstrm.c:123
#define HTTPS_PORT
port number for https access
Definition: unbound-anchor.c:151
long long infra_get_host_rto(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen, struct rtt_info *rtt, int *delay, time_t timenow, int *tA, int *tAAAA, int *tother)
Get additional (debug) info on timing.
Definition: infra.c:615
static void analyze_rdata(sldns_buffer *pkt, const sldns_rr_descriptor *desc, uint16_t rdlen)
analyze rdata in packet
Definition: pktview.c:88
static int lz_find_create_node(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs, struct local_data **res)
find a node, create it if not and all its empty nonterminal parents
Definition: localzone.c:432
char * ip_str
the ip address and port number (or NULL)
Definition: dtstream.h:211
static void worker_mem_report(struct worker *ATTR_UNUSED(worker), struct serviced_query *ATTR_UNUSED(cur_serv))
Report on memory usage by this thread and global.
Definition: worker.c:114
int ub_timer_del(struct ub_event *)
Deactivate the timeout event.
Definition: ub_event.c:409
int ub_ctx_trustedkeys(struct ub_ctx *ctx, const char *fname)
Add trust anchors to the given context.
Definition: libunbound.c:447
static void lz_inform_print(struct local_zone *z, struct query_info *qinfo, struct comm_reply *repinfo)
print log information for an inform zone query
Definition: localzone.c:1582
int nsec3_covers(uint8_t *zone, struct nsec3_cached_hash *hash, struct ub_packed_rrset_key *rrset, int rr, sldns_buffer *buf)
nsec3Covers Given a hash and a candidate NSEC3Record, determine if that NSEC3Record covers the hash.
Definition: val_nsec3.c:769
tap callback variables
Definition: unbound-dnstap-socket.c:105
static int sig_record_reload
How many reload requests happened.
Definition: daemon.c:102
struct query_info qchase
query name used for chasing the results.
Definition: iterator.h:272
void wsvc_install(FILE *out, const char *rename)
Install service in servicecontrolmanager, setup registry.
Definition: w_inst.c:189
struct config_str2list * respip_actions
list of response-driven access control entries, linked list
Definition: config_file.h:425
struct compress_tree_node * left
left node in tree, all smaller to this
Definition: msgencode.c:79
static void test_threaded_table(struct slabhash *table)
test hash table access by multiple threads
Definition: unitslabhash.c:341
socklen_t addrlen
length of address
Definition: netevent.h:119
const char * strmodulevent(enum module_ev e)
Debug utility: module event to string.
Definition: module.c:60
#define P7SNAME
path on HTTPS server to p7s file
Definition: unbound-anchor.c:147
void forwards_delete_stub_hole(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Remove stub hole, if one exists.
Definition: iter_fwd.c:507
static void bogus_del_kcache(struct lruhash_entry *e, void *arg)
callback to delete bogus keys
Definition: remote.c:1801
void regional_log_stats(struct regional *r)
Debug print regional statistics to log.
Definition: regional.c:217
int fd_set_nonblock(int s)
Set fd nonblocking.
Definition: net_help.c:121
@ respip_invalid
type invalid
Definition: localzone.h:572
static int processInit(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
Process init state for validator.
Definition: validator.c:1483
struct timeval now
timeval with current time
Definition: netevent.c:120
char * qname
The original question, name text string.
Definition: unbound.h:125
void error_encode(struct sldns_buffer *pkt, int r, struct query_info *qinfo, uint16_t qid, uint16_t qflags, struct edns_data *edns)
Encode an error.
Definition: msgencode.c:910
void log_query(const char *format,...) ATTR_FORMAT(printf
Log query.
int infra_get_lame_rtt(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, uint16_t qtype, int *lame, int *dnsseclame, int *reclame, int *rtt, time_t timenow)
Get Lameness information and average RTT if host is in the cache.
Definition: infra.c:672
An entry in the dt_msg_queue.
Definition: dtstream.h:82
static int add_rr_to_rrset(struct rrset_parse *rrset, sldns_buffer *pkt, struct msg_parse *msg, struct regional *region, sldns_pkt_section section, uint16_t type)
Add rr (from packet here) to rrset, skips rr.
Definition: msgparse.c:749
size_t num_reply_states
count of the number of mesh_states that have mesh_replies Because a state can send results to multipl...
Definition: mesh.h:98
int harden_below_nxdomain
harden against queries that fall under known nxdomain names
Definition: config_file.h:256
int rrset_array_lock(struct rrset_ref *ref, size_t count, time_t timenow)
Obtain readlock on a (sorted) list of rrset references.
Definition: rrset.c:307
static struct replay_scenario * setup_playback(const char *filename, int *pass_argc, char *pass_argv[])
read playback file
Definition: testbound.c:313
struct infra_cache * infra
the infra cache
Definition: remote.c:2785
const char * rpz_action_to_string(enum rpz_action a)
string for RPZ action enum
Definition: rpz.c:56
size_t an_rrsets
count of RRsets per section.
Definition: msgparse.h:109
struct order_lock * lock
the lock referenced
Definition: lock_verify.c:94
int name_tree_compare(const void *k1, const void *k2)
compare name tree nodes
Definition: dnstree.c:47
struct iter_prep_list * ns_prepend_list
This is the list of RRsets that must be prepended to the AUTHORITY section of the response before bei...
Definition: iterator.h:265
static int forwards_insert_data(struct iter_forwards *fwd, uint16_t c, uint8_t *nm, size_t nmlen, int nmlabs, struct delegpt *dp)
insert info into forward structure
Definition: iter_fwd.c:109
#define DTIO_MESSAGES_PER_CALLBACK
number of messages to process in one output callback
Definition: dtstream.c:64
struct iter_hints_stub * hints_lookup_stub(struct iter_hints *hints, uint8_t *qname, uint16_t qclass, struct delegpt *dp)
Given a qname/qclass combination, and the delegation point from the cache for this qname/qclass,...
Definition: iter_hints.c:472
size_t len
length
Definition: remote.c:1603
#define PTR_CREATE(offset)
create a compression pointer to the given offset.
Definition: msgparse.h:203
static int sldns_affix_token(sldns_buffer *strbuf, char *token, size_t *token_len, int *quoted, int *parens, size_t *pre_data_pos, const char *delimiters, sldns_rdf_type rdftype, size_t *token_strlen)
Add space and one more rdf token onto the existing token string.
Definition: str2wire.c:597
struct port_if * ip6_ifs
array of outgoing IP6 interfaces
Definition: outside_network.h:116
uint8_t * algo
list of algorithms signalled, ends with 0, or NULL
Definition: val_kentry.h:84
struct mesh_cb * next
next in list
Definition: mesh.h:248
void views_delete(struct views *v)
Delete views storage.
Definition: view.c:93
#define O_DEC(opt, str, var)
compare and print decimal option
Definition: config_file.c:834
static void rnd_test(void)
test randomness
Definition: unitmain.c:536
@ VERB_OPS
1 - operational information
Definition: log.h:53
static int rtt_compare(const void *x, const void *y)
compare two rtts, return -1, 0 or 1
Definition: iter_utils.c:315
time_t timestamp[RATE_WINDOW]
what the timestamp is of the qps array members, counter is valid for that timestamp.
Definition: infra.h:182
struct autr_global_data * autr
Autotrust global data, anchors sorted by next probe time.
Definition: val_anchor.h:73
struct auth_addr * next
next in list
Definition: authzone.h:424
void macro_store_delete(rbtree_type *store)
Delete variable storage.
Definition: replay.c:580
uint8_t * reply_find_final_cname_target(struct query_info *qinfo, struct reply_info *rep)
Find final cname target in reply, the one matching qinfo.
Definition: msgreply.c:725
@ serviced_query_TCP
TCP without EDNS sent.
Definition: outside_network.h:367
struct listen_dnsport * listen_create(struct comm_base *base, struct listen_port *ports, size_t bufsize, int tcp_accept_count, int tcp_idle_timeout, struct tcl_list *tcp_conn_limit, void *sslctx, struct dt_env *dtenv, comm_point_callback_type *cb, void *cb_arg)
Create commpoints with for this thread for the shared ports.
Definition: listen_dnsport.c:1325
struct iter_priv * priv_create(void)
Create priv structure.
Definition: iter_priv.c:55
struct config_str2list * acl_view
list of aclname, view
Definition: config_file.h:421
val_classification
Response classifications for the validator.
Definition: val_utils.h:61
size_t ds_digest_size_supported(int algo)
Return size of DS digest according to its hash algorithm.
uint8_t * buf
base of buffer
Definition: delayer.c:64
int fptr_whitelist_serviced_query(comm_point_callback_type *fptr)
Check function pointer whitelist for serviced query callback values.
Definition: fptr_wlist.c:211
void local_zones_print(struct local_zones *zones)
Debug helper.
Definition: localzone.c:1177
The SHM info.
Definition: shm_main.h:53
static int daemon_get_shufport(struct daemon *daemon, int *shufport)
Obtain allowed port numbers, concatenate the list, and shuffle them (ready to be handed out to thread...
Definition: daemon.c:392
void reclaim_space(struct lruhash *table, struct lruhash_entry **list)
Try to make space available by deleting old entries.
Definition: lruhash.c:182
int sldns_wire2str_header_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat packet header to string, with user buffers.
Definition: wire2str.c:663
int outnet_udp_cb(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
callback for incoming udp answers from the network
Definition: outside_network.c:540
struct edns_known_option * edns_known_options
Shared array of known edns options (size MAX_KNOWN_EDNS_OPTS).
Definition: module.h:520
struct auth_zone * auth_zones_find_zone(struct auth_zones *az, uint8_t *name, size_t name_len, uint16_t dclass)
find the auth zone that is above the given name
Definition: authzone.c:486
void daemon_remote_clear(struct daemon_remote *rc)
remote control state to clear up.
Definition: remote.c:231
void * dyn_env
Pointer to any data the dynamic library might want to keep.
Definition: dynlibmod.h:135
void * data
data element, (arg for the tap_socket struct)
Definition: unbound-dnstap-socket.c:151
struct config_file * config_create(void)
Create config file structure.
Definition: config_file.c:89
struct delegpt * delegpt_copy(struct delegpt *dp, struct regional *region)
Create a copy of a delegation point.
Definition: iter_delegpt.c:64
void neg_delete_data(struct val_neg_cache *neg, struct val_neg_data *el)
Delete a data element from the negative cache.
Definition: val_neg.c:226
static void q_ans_parse(struct q_ans *q, struct regional *region, struct query_info **qinfo, int *fallback, uint8_t **dp_nm, size_t *dp_nmlen)
parse q_ans structure for making query
Definition: unitauth.c:611
int ip_transparent
IP_TRANSPARENT socket option requested on port 53 sockets.
Definition: config_file.h:190
static void adjust_ttl(struct val_env *ve, uint32_t unow, struct ub_packed_rrset_key *rrset, uint8_t *orig_p, uint8_t *expi_p, uint8_t *incep_p)
adjust rrset TTL for verified rrset, compare to original TTL and expi
Definition: val_sigcrypt.c:1327
size_t len
size of item
Definition: delayer.c:104
@ MINIMISE_STATE
QNAME minimisation ongoing.
Definition: iterator.h:156
void inplace_cb_delete(struct module_env *env, enum inplace_cb_list_type type, int id)
Delete callback for specified type and module id.
Definition: module.c:157
void dtio_mainfdcallback(int fd, short ATTR_UNUSED(bits), void *arg)
callback for main listening file descriptor
Definition: unbound-dnstap-socket.c:1072
struct ub_packed_rrset_key * reply_find_answer_rrset(struct query_info *qinfo, struct reply_info *rep)
Find answer rrset in reply, the one matching qinfo.
Definition: msgreply.c:746
struct entry * match
The sent packet must match this.
Definition: replay.h:222
int sldns_buffer_reserve(sldns_buffer *buffer, size_t amount)
ensures BUFFER can contain at least AMOUNT more bytes.
Definition: sbuffer.c:93
static void autr_debug_print_tp(struct trust_anchor *tp)
debug print a trust point
Definition: autotrust.c:2275
struct sockaddr_storage addr
address ready to connect to
Definition: unbound-anchor.c:168
int addr_tree_insert(rbtree_type *tree, struct addr_tree_node *node, struct sockaddr_storage *addr, socklen_t addrlen, int net)
insert element into addr tree.
Definition: dnstree.c:96
#define S_NUMBER_NONZERO(str, var)
put integer_nonzero into variable
Definition: config_file.c:400
uint8_t lame
if true, this address is dispreferred: it is a lame IP address
Definition: iter_delegpt.h:152
void val_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
inform validator super.
Definition: validator.c:3209
void errinf_dname(struct module_qstate *qstate, const char *str, uint8_t *dname)
Append text to error info: str dname.
Definition: config_file.c:2488
static int rrinternal_parse_rdf(sldns_buffer *strbuf, char *token, size_t token_len, uint8_t *rr, size_t rr_len, size_t *rr_cur_len, sldns_rdf_type rdftype, uint16_t rr_type, size_t r_cnt, size_t r_max, size_t dname_len, uint8_t *origin, size_t origin_len)
parse normal RR rdata element
Definition: str2wire.c:473
void fake_temp_file(const char *adj, const char *id, char *buf, size_t len)
Get filename to store temporary config stuff.
Definition: fake_event.c:111
@ LDNS_RR_TYPE_LOC
LOC record RFC1876.
Definition: rrdef.h:141
@ listen_type_udp
udp type
Definition: listen_dnsport.h:85
void mesh_list_remove(struct mesh_state *m, struct mesh_state **fp, struct mesh_state **lp)
Remove mesh state from a double linked list.
Definition: mesh.c:1806
void sock_list_merge(struct sock_list **list, struct regional *region, struct sock_list *add)
Merge socklist into another socket list.
Definition: net_help.c:823
long long hist[UB_STATS_BUCKET_NUM]
histogram data exported to array if the array is the same size, no data is lost, and if all histogram...
Definition: unbound.h:746
void rrset_cache_touch(struct rrset_cache *r, struct ub_packed_rrset_key *key, hashvalue_type hash, rrset_id_type id)
Touch rrset, with given pointer and id.
Definition: rrset.c:94
struct ub_server_stats stats
per thread statistics
Definition: worker.h:119
static void adjust_file(char *file)
adjust filename
Definition: petal.c:344
static void donotquerylocalhostcheck(struct config_file *cfg)
check do-not-query-localhost
Definition: unbound-checkconf.c:162
void comm_point_delete(struct comm_point *c)
Close and deallocate (free) the comm point.
Definition: fake_event.c:1341
static void ds_get_sigdata(struct ub_packed_rrset_key *k, size_t idx, uint8_t **digest, size_t *len)
Return pointer to the digest in a DS RR.
Definition: val_sigcrypt.c:250
void qinfo_query_encode(struct sldns_buffer *pkt, struct query_info *qinfo)
Encode query packet.
Definition: msgencode.c:890
size_t first_size
initial chunk size
Definition: regional.h:72
struct alloc_cache * alloc_list
List of alloc-cache-id points per threadnum for notinuse threads.
Definition: context.h:107
struct auth_zone * auth_zone_create(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
create an auth zone.
Definition: authzone.c:411
int edns_opt_compare(struct edns_option *p, struct edns_option *q)
Compare an edns option.
Definition: msgreply.c:1173
func_init_t func_init
Module init function.
Definition: dynlibmod.h:120
static int chunkline_is_comment_line_or_empty(sldns_buffer *buf)
see if a chunkline is a comment line (or empty line)
Definition: authzone.c:4199
struct delegpt_ns * delegpt_find_ns(struct delegpt *dp, uint8_t *name, size_t namelen)
Find NS record in name list of delegation point.
Definition: iter_delegpt.c:132
size_t numDNSKEY
number of DNSKEYs in the keylist
Definition: val_anchor.h:116
size_t num_query_down
number of queries downstream
Definition: authzone.h:84
static void dtio_reconnect_del(struct dt_io_thread *dtio)
remove dtio reconnect timer
Definition: dtstream.c:529
void regional_test(void)
unit test for regional allocator functions
Definition: unitregional.c:243
static int needs_validation(struct module_qstate *qstate, int ret_rc, struct dns_msg *ret_msg)
Check to see if a given response needs to go through the validation process.
Definition: validator.c:296
struct timeval last_sent_time
time last UDP was sent
Definition: outside_network.h:382
uint8_t replies_sent
true if replies have been sent out (at end for alignment)
Definition: mesh.h:199
int respip_init(struct module_env *env, int id)
response-ip init
Definition: respip.c:550
hashvalue_type dname_pkt_hash(sldns_buffer *pkt, uint8_t *dname, hashvalue_type h)
Hash dname, label by label, lowercasing, into hashvalue.
Definition: dname.c:311
static void authzone_query_test(void)
Test authzone query from zone.
Definition: unitauth.c:885
static int count_reply_packets(struct entry *entry)
number of replies in entry
Definition: fake_event.c:311
static void morechecks(struct config_file *cfg)
check configuration for errors
Definition: unbound-checkconf.c:560
void reply_addr2str(struct comm_reply *reply, char *dest, int maxlen)
Convert reply->addr to string.
Definition: pythonmod_utils.c:169
static ub_thread_type cron_thread
the cron thread
Definition: win_svc.c:74
static void write_unsigned_root(const char *root_anchor_file)
write unsigned root anchor file, a 5011 revoked tp
Definition: unbound-anchor.c:1838
static void mesh_send_reply(struct mesh_state *m, int rcode, struct reply_info *rep, struct mesh_reply *r, struct sldns_buffer *r_buffer, struct mesh_reply *prev, struct sldns_buffer *prev_buffer)
Send reply to mesh reply entry.
Definition: mesh.c:1186
void replay_scenario_delete(struct replay_scenario *scen)
Delete scenario.
Definition: replay.c:508
@ sec_status_unchecked
UNCHECKED means that object has yet to be validated.
Definition: packed_rrset.h:178
static int iter_fill_rtt(struct iter_env *iter_env, struct module_env *env, uint8_t *name, size_t namelen, uint16_t qtype, time_t now, struct delegpt *dp, int *best_rtt, struct sock_list *blacklist, size_t *num_suitable_results)
lookup RTT information, and also store fastest rtt (if any)
Definition: iter_utils.c:283
void delegpt_add_unused_targets(struct delegpt *dp)
Add all usable targets to the result list.
Definition: iter_delegpt.c:304
static struct ub_packed_rrset_key * find_NS(struct reply_info *rep, size_t from, size_t to)
find NS rrset in given list
Definition: iter_delegpt.c:338
static void check_table(struct lruhash *table)
check integrity of hash table
Definition: unitlruhash.c:277
int sldns_str2wire_int8_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT8 from string to wireformat.
Definition: str2wire.c:1019
PyObject * dict
Python dictionary.
Definition: pythonmod.c:97
@ repevt_autotrust_check
check autotrust key file
Definition: replay.h:206
int netblockstrtoaddr(const char *ip, int port, struct sockaddr_storage *addr, socklen_t *addrlen, int *net)
Convert ip netblock (ip/netsize) string and port to sockaddr.
Definition: net_help.c:285
static void do_flush_stats(RES *ssl, struct worker *worker)
flush statistics
Definition: remote.c:1588
static void respip_test(void)
respip unit tests
Definition: unitmain.c:834
rbtree_type * pending
pending udp answers.
Definition: outside_network.h:126
struct replay_moment * now
Current moment.
Definition: replay.h:274
#define MAX_LINE_LEN
maximum line length for lines in the replay file.
Definition: testbound.c:64
static int dtio_open_output_local(struct dt_io_thread *dtio)
open the output file descriptor for af_local
Definition: dtstream.c:1849
static int xfr_serial_means_update(struct auth_xfer *xfr, uint32_t serial)
see if the serial means the zone has to be updated, i.e.
Definition: authzone.c:3504
#define UB_STATS_OPCODE_NUM
number of opcodes in stats
Definition: unbound.h:656
uint8_t * zone
zone name, uncompressed wire format (as used when sent)
Definition: replay.h:336
struct outbound_entry * prev
prev in list
Definition: outbound_list.h:65
struct timeval elapse
the amount of time that passes
Definition: replay.h:225
static void daemon_start_others(struct daemon *daemon)
Fork and init the other threads.
Definition: daemon.c:530
time_t autr_probe_timer(struct module_env *env)
Process probe timer.
Definition: autotrust.c:2426
struct local_zone * local_zones_add_zone(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, enum localzone_type tp)
Add a new zone.
Definition: localzone.c:1835
static int packed_rrset_encode(struct ub_packed_rrset_key *key, sldns_buffer *pkt, uint16_t *num_rrs, time_t timenow, struct regional *region, int do_data, int do_sig, struct compress_tree_node **tree, sldns_pkt_section s, uint16_t qtype, int dnssec, size_t rr_offset)
store rrset in buffer in wireformat, return RETVAL_*
Definition: msgencode.c:449
@ local_zone_static
answer nxdomain or nodata
Definition: localzone.h:73
static struct autr_ta * add_trustanchor_frm_str(struct val_anchors *anchors, char *str, struct trust_anchor **tp, uint8_t *origin, size_t origin_len, uint8_t **prev, size_t *prev_len, int *skip)
Add new trust anchor from a string in file.
Definition: autotrust.c:472
static void ring_delete(struct ringbuf *r)
delete ring buffer
Definition: delayer.c:216
void * cb_arg
callback user argument
Definition: outside_network.h:235
int local_data_find_tag_datas(const struct query_info *qinfo, struct config_strlist *list, struct ub_packed_rrset_key *r, struct regional *temp)
Find local data tag string match for the given type (in qinfo) in the list.
Definition: localzone.c:1248
static void process_prime_response(struct module_qstate *qstate, struct val_qstate *vq, int id, int rcode, struct dns_msg *msg, struct sock_list *origin)
Process prime response Sets the key entry in the state.
Definition: validator.c:3047
list of packed rrsets
Definition: packed_rrset.h:276
enum ub_ctx_cmd context_serial_getcmd(uint8_t *p, uint32_t len)
Obtain command code from serialized buffer.
Definition: context.c:411
int create_udp_sock(int family, int socktype, struct sockaddr *addr, socklen_t addrlen, int v6only, int *inuse, int *noproto, int rcv, int snd, int listen, int *reuseport, int transparent, int freebind, int use_systemd, int dscp)
Create and bind nonblocking UDP socket.
Definition: listen_dnsport.c:179
View config options.
Definition: config_file.h:694
void forwards_delete_zone(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Remove zone from forward structure.
Definition: iter_fwd.c:486
int dname_canonical_compare(uint8_t *d1, uint8_t *d2)
Canonical dname compare.
Definition: dname.c:864
static int can_have_last_resort(struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t qclass, struct delegpt **retdp)
see if last resort is possible - does config allow queries to parent
Definition: iterator.c:590
static void dname_test_count_labels(void)
test dname_count_labels
Definition: unitdname.c:132
int sldns_wire2str_rcode_buf(int rcode, char *str, size_t len)
Convert wire RR rcode to a string, 'NOERROR', 'NXDOMAIN'.
Definition: wire2str.c:299
int prefix_net
This is the CIDR length of the prefix.
Definition: dns64.c:130
Structure only for making timeout events.
Definition: netevent.h:321
static void deldata(struct slabhash_testdata *d)
delete data
Definition: slabhash.c:189
static void ext_callback(void *mydata, int err, struct ub_result *result)
extended bg result callback, this function is ub_callback_t
Definition: asynclook.c:267
size_t ns_numrrsets
Count of authority section RRsets.
Definition: msgreply.h:179
static void strip_end_white(char *p)
strip whitespace from end of string
Definition: replay.c:129
static void lru_pop(struct addrtree *tree, struct addrnode *node)
Remove specified node from LRU list.
Definition: addrtree.c:163
void verbose(enum verbosity_value level, const char *format,...)
implementation of verbose
Definition: log.c:356
size_t numsent
number of queries sent out in that time
Definition: perf.c:93
void ipsecmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Subordinate query done, inform this super request of its conclusion.
int ub_ctx_print_local_zones(struct ub_ctx *ctx)
Debug routine.
Definition: libunbound.c:1274
@ LDNS_RDF_TYPE_UNKNOWN
unknown types
Definition: rrdef.h:300
void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size)
Setup a buffer with the data pointed to.
Definition: sbuffer.c:65
int local_zones_answer(struct local_zones *zones, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, uint8_t *tagactions, size_t tagactionssize, struct config_strlist **tag_datas, size_t tag_datas_size, char **tagname, int num_tags, struct view *view)
Answer authoritatively for local zones.
Definition: localzone.c:1652
static int make_tcp_accept(char *ip)
setup tcp accept socket on IP string
Definition: unbound-dnstap-socket.c:264
struct comm_signal * comm_signal_create(struct comm_base *base, void(*callback)(int, void *), void *cb_arg)
Create a signal handler.
Definition: fake_event.c:973
int is_bg
is this the bg worker?
Definition: libworker.h:75
static struct ringbuf * ring_create(size_t sz)
create new ring buffer
Definition: delayer.c:202
lock_rw_type lock
lock on the data in the structure For the node, parent, name, namelen, namelabs, dclass,...
Definition: localzone.h:138
const char * chroot
the current chroot dir (or NULL if none)
Definition: config_file.h:1211
int check_nb_connect
check for nonblocking connect errors on fd
Definition: dtstream.h:145
int sldns_str2wire_tsigtime_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TSIGTIME from string to wireformat.
Definition: str2wire.c:1458
static int randomize_and_send_udp(struct pending *pend, sldns_buffer *packet, int timeout)
with a fd available, randomize and send UDP
Definition: outside_network.c:1191
int main(int argc, char **argv)
main program for streamtcp
Definition: unbound-dnstap-socket.c:1264
void key_entry_delkeyfunc(void *key, void *userarg)
function for lruhash operation
int delegpt_add_addr_mlc(struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name)
add an address to a malloced delegation point.
Definition: iter_delegpt.c:609
void mesh_log_list(struct mesh_area *mesh)
Print all the states in the mesh to the log.
Definition: mesh.c:1705
struct config_strlist * cfg_strlist_find(struct config_strlist *head, const char *item)
Find string in strlist.
Definition: config_file.c:1690
int infra_dp_ratelimit
ratelimit, unless overridden by domain_limits, 0 is off
Definition: infra.c:64
static int dump_rrset(RES *ssl, struct ub_packed_rrset_key *k, struct packed_rrset_data *d, time_t now)
dump rrset key and data info
Definition: cachedump.c:76
int main(int argc, char **argv)
anchor update main
Definition: anchor-update.c:135
static void do_zones_remove(RES *ssl, struct local_zones *zones)
Do the local_zones_remove command.
Definition: remote.c:1282
static void test_short_table(struct slabhash *table)
test hashtable using short sequence
Definition: unitslabhash.c:83
#define SENTINEL_KEYTAG_LEN
Root key sentinal keytag length.
Definition: validator.h:75
char * rpz_log_name
Display this name in the log when RPZ policy is applied.
Definition: config_file.h:685
hashvalue_type dname_pkt_hash(struct sldns_buffer *pkt, uint8_t *dname, hashvalue_type h)
Hash dname, label by label, lowercasing, into hashvalue.
Definition: dname.c:311
static struct trust_anchor * autr_tp_create(struct val_anchors *anchors, uint8_t *own, size_t own_len, uint16_t dc)
create tp
Definition: autotrust.c:332
uint8_t has_parent_side_NS
if true, the parent-side NS record has been applied: its names have been added and their addresses ca...
Definition: iter_delegpt.h:81
static int rrinternal_get_owner(sldns_buffer *strbuf, uint8_t *rr, size_t *len, size_t *dname_len, uint8_t *origin, size_t origin_len, uint8_t *prev, size_t prev_len, char *token, size_t token_len)
read owner name
Definition: str2wire.c:186
int packed_rrset_find_rr(struct packed_rrset_data *d, uint8_t *rdata, size_t len, size_t *index)
Find RR index in packed rrset Raw comparison, does not canonicalize RDATA.
Definition: packed_rrset.c:392
void key_cache_delete(struct key_cache *kcache)
Delete the key cache.
Definition: val_kcache.c:74
static int read_header(FILE *in)
read header entry.
Definition: lock_verify.c:117
struct ub_randstate * rndstate
random() table for this worker.
Definition: worker.h:113
long long num_query_dnscrypt_replay
number of queries which are replays
Definition: unbound.h:770
hashvalue_type pkt_hash_rrset(struct sldns_buffer *pkt, uint8_t *dname, uint16_t type, uint16_t dclass, uint32_t rrset_flags)
Calculate hash value for rrset in packet.
Definition: msgparse.c:167
struct infra_cache * infra
host cache, pointer but not owned by outnet.
Definition: outside_network.h:130
size_t key_entry_sizefunc(void *key, void *data)
function for lruhash operation
Definition: val_kentry.c:52
int tube_write_msg(struct tube *tube, uint8_t *buf, uint32_t len, int nonblock)
Write length bytes followed by message.
Definition: tube.c:285
int cancelled
was this query cancelled (for bg worker)
Definition: context.h:156
static int nsec_get_next(struct ub_packed_rrset_key *nsec, uint8_t **nm, size_t *ln)
Get next owner name from nsec record.
Definition: val_nsec.c:120
struct lruhash_entry * infra_lookup_nottl(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, int wr)
Plain find infra data function (used by the the other functions)
Definition: infra.c:362
#define INFRA_HOST_STARTSIZE
infra host cache default hash lookup size
Definition: infra.h:188
struct mesh_state * forever_last
last entry in run forever list
Definition: mesh.h:142
char * ip
IP, if this is a TCP socket.
Definition: unbound-dnstap-socket.c:155
long long qEDNS_DO
number of queries with EDNS with DO flag
Definition: unbound.h:721
void qinfo_query_encode(sldns_buffer *pkt, struct query_info *qinfo)
Encode query packet.
Definition: msgencode.c:890
The queries outstanding for the libunbound resolver.
Definition: context.h:148
int nsec3_has_type(struct ub_packed_rrset_key *rrset, int r, uint16_t type)
see if NSEC3 RR contains given type
Definition: val_nsec3.c:283
void unit_show_feature(const char *feature)
we are testing this functionality
Definition: unitmain.c:847
struct key_entry_key * val_verify_new_DNSKEYs_with_ta(struct regional *region, struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ta_ds_rrset, struct ub_packed_rrset_key *ta_dnskey_rrset, int downprot, char **reason, struct module_qstate *qstate)
Verify rrset with trust anchor: DS and DNSKEY rrset.
Definition: val_utils.c:696
int val_nsec_check_dlv(struct query_info *qinfo, struct reply_info *rep, uint8_t **nm, size_t *nm_len)
Determine the DLV result, what to do with NSEC DLV reply.
Definition: val_nsec.c:568
@ module_restart_next
module is waiting for another module; that other is restarted
Definition: module.h:541
void libworker_fg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with fg results
Definition: libworker.c:550
int ub_event_add(struct ub_event *, struct timeval *)
Activate the event.
Definition: ub_event.c:387
@ LDNS_RR_CLASS_IN
the Internet
Definition: rrdef.h:52
int log_thread_get(void)
Get the thread id from logging system.
Definition: log.c:172
int ub_resolve(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, struct ub_result **result)
Perform resolution and validation of the target name.
Definition: libunbound.c:680
struct comm_point * c
the comm_point with fd to send reply on to.
Definition: netevent.h:115
struct module_func_block * respip_get_funcblock(void)
Get the response-ip function block.
Definition: respip.c:1281
int nsecbitmap_has_type_rdata(uint8_t *bitmap, size_t len, uint16_t type)
nsec typemap check, takes an NSEC-type bitmap as argument, checks for type.
Definition: val_nsec.c:61
static struct ub_packed_rrset_key * new_cname_override(struct regional *region, uint8_t *ct, size_t ctlen)
new rrset containing CNAME override, does not yet contain a dname
Definition: rpz.c:337
time_t prefetch_ttl
TTL for prefetch.
Definition: msgreply.h:157
int main(int argc, char *argv[])
main program for perf
Definition: perf.c:581
int rrstr_get_rr_content(const char *str, uint8_t **nm, uint16_t *type, uint16_t *dclass, time_t *ttl, uint8_t *rr, size_t len, uint8_t **rdata, size_t *rdata_len)
Parses resource record string into wire format, also returning its field values.
Definition: localzone.c:233
struct edns_data edns
edns data from query
Definition: mesh.h:222
static struct local_zone * local_zone_create(uint8_t *nm, size_t len, int labs, enum localzone_type t, uint16_t dclass)
create a new localzone
Definition: localzone.c:146
@ respip_always_nxdomain
answer with 'no such domain' response
Definition: localzone.h:554
iter_state
State of the iterator for a query.
Definition: iterator.h:170
Internal signal structure, to store signal event in.
Definition: netevent.c:144
static uint32_t dnsc_shared_secrets_cache_key(uint8_t *key, uint8_t esversion, uint8_t *pk, uint8_t *sk)
Generate a key suitable to find shared secret in slabhash.
Definition: dnscrypt.c:86
@ NO_VERBOSE
0 - no verbose messages
Definition: log.h:51
int auth_zones_can_fallback(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
see if the auth zone for the name can fallback
Definition: authzone.c:3390
int upstream_is_unix
If the log server is connected to over unix domain sockets, eg.
Definition: dtstream.h:190
#define NUM_UDP_PER_SELECT
number of UDP reads to perform per read indication from select
Definition: netevent.c:95
struct listen_port * rc_ports
listening ports for remote control
Definition: daemon.h:95
void dns64_deinit(struct module_env *env, int id)
dns64 deinit
Definition: dns64.c:431
void respip_inform_print(struct respip_action_info *respip_actinfo, uint8_t *qname, uint16_t qtype, uint16_t qclass, struct local_rrset *local_alias, struct comm_reply *repinfo)
print log information for a query subject to an inform or inform-deny response-ip action.
Definition: respip.c:1305
int delegpt_add_target(struct delegpt *dp, struct regional *region, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, int *additions)
Add target address to the delegation point.
Definition: iter_delegpt.c:162
static size_t get_queries_ratelimit(struct worker *worker, int reset)
get number of ratelimited queries from iterator
Definition: stats.c:204
static struct ub_ctx * ub_ctx_create_nopipe(void)
create context functionality, but no pipes
Definition: libunbound.c:86
int mesh_state_add_cb(struct mesh_state *s, struct edns_data *edns, struct sldns_buffer *buf, mesh_cb_func_type cb, void *cb_arg, uint16_t qid, uint16_t qflags)
Create new callback structure and attach it to a mesh state.
Definition: mesh.c:1447
int fptr_whitelist_mod_inform_super(void(*fptr)(struct module_qstate *qstate, int id, struct module_qstate *super))
Check function pointer whitelist for module inform_super call values.
Definition: fptr_wlist.c:474
static int follow_cname_chain(struct auth_zone *z, uint16_t qtype, struct regional *region, struct dns_msg *msg, struct packed_rrset_data *d)
follow cname chain and add more data to the answer section
Definition: authzone.c:2930
void delete_entry(struct entry *list)
Delete linked list of entries.
Definition: testpkts.c:1711
static int str_addr_is_localhost(const char *a)
true if addr is a localhost address, 127.0.0.1 or ::1 (with maybe "@port" after it)
Definition: unbound-checkconf.c:153
int fptr_whitelist_modenv_detach_subs(void(*fptr)(struct module_qstate *qstate))
Check function pointer whitelist for module_env detach_subs callback values.
Definition: fptr_wlist.c:346
time_t sldns_mktime_from_utc(const struct tm *tm)
Convert TM to seconds since epoch (midnight, January 1st, 1970).
Definition: parseutil.c:72
time_t MAX_TTL
MAX TTL default for messages and rrsets.
Definition: msgreply.c:59
static void ext_check_result(const char *desc, int err, struct ub_result *result)
check result structure for the 'correct' answer
Definition: asynclook.c:194
structure for argument data for dump infra host
Definition: remote.c:2431
int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_type fptr)
Check function pointer whitelist for lruhash delkeyfunc callback values.
Definition: fptr_wlist.c:286
void * sig_cb_arg
signal handler user arg
Definition: replay.h:312
int edns_opt_list_compare(struct edns_option *p, struct edns_option *q)
Compare edns option lists, also the order and contents of edns-options.
Definition: msgreply.c:1188
struct name_tree_node * parent
parent in tree
Definition: dnstree.h:59
int verbosity
verbosity level as specified in the config file
Definition: config_file.h:70
void ub_winsock_unregister_wsaevent(struct ub_event *ev)
Free a with a wsaevent associated event.
Definition: ub_event.c:427
struct libworker * event_worker
libworker for event based interface
Definition: context.h:126
#define TCP_QUERY_TIMEOUT
The TCP writing query timeout in milliseconds.
Definition: netevent.c:88
@ QUERYTARGETS_STATE
Each time a delegation point changes for a given query or a query times out and/or wakes up,...
Definition: iterator.h:195
size_t algo_needs_num_missing(struct algo_needs *n)
See how many algorithms are missing (not bogus or secure, but not processed)
Definition: val_sigcrypt.c:466
Key settings.
Definition: signit.c:51
struct alloc_cache superalloc
shared caches, and so on
Definition: context.h:110
static int parse_get_cname_target(struct rrset_parse *rrset, uint8_t **sname, size_t *snamelen, sldns_buffer *pkt)
Get target name of a CNAME.
Definition: iter_scrub.c:187
#define UDP_AUTH_QUERY_TIMEOUT
timeout in milliseconds for UDP queries to auth servers.
Definition: net_help.h:78
int fptr_whitelist_modenv_add_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub))
Check function pointer whitelist for module_env add_sub callback values.
Definition: fptr_wlist.c:363
int num
thread num, first entry.
Definition: unitslabhash.c:302
int ub_process(struct ub_ctx *ctx)
Call this routine to continue processing results from the validating resolver (when the fd becomes re...
Definition: libunbound.c:602
static void pretty_rdata(char *q, char *cstr, char *tstr, int t, const char *sec, char *data, size_t len)
pretty line of RR data for results
Definition: unbound-host.c:265
Internal timer structure, to store timer event in.
Definition: netevent.c:130
Module state, per query.
Definition: module.h:596
const char ** module_list_avail(void)
The list of module names.
Definition: modstack.c:138
rbnode_type * rbtree_search(rbtree_type *rbtree, const void *key)
Find key in tree.
Definition: rbtree.c:281
int auth_data_cmp(const void *z1, const void *z2)
compare auth_data for sorted rbtree
Definition: authzone.c:324
void config_del_strbytelist(struct config_strbytelist *p)
delete stringbytelist
Definition: config_file.c:1408
enum respip_action rpz_action_to_respip_action(enum rpz_action a)
Classify respip action for RPZ action.
Definition: rpz.c:223
static void timeval_add(struct timeval *d, const struct timeval *add)
add timers and the values do not overflow or become negative
Definition: mesh.c:84
rbtree_type * tree
Zones are stored in this tree.
Definition: iter_fwd.h:60
int anchor_has_keytag(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass, uint16_t keytag)
Check if there is a trust anchor for given zone with this keytag.
Definition: val_anchor.c:1314
struct ub_packed_rrset_key * pside_glue
the parent-side-glue element (NULL if none, its first match)
Definition: iterator.h:342
int config_get_option(struct config_file *cfg, const char *opt, void(*func)(char *, void *), void *arg)
Call print routine for the given option.
Definition: config_file.c:894
void query_entry_delete(void *q, void *arg)
delete msgreply_entry key structure
void auth_zones_delete(struct auth_zones *az)
Delete auth zones structure.
Definition: authzone.c:2124
void autr_write_file(struct module_env *env, struct trust_anchor *tp)
Write autotrust file.
Definition: autotrust.c:1173
INLINE void sldns_buffer_write_u32(sldns_buffer *buffer, uint32_t data)
writes the given 4 byte integer at the current position in the buffer
Definition: sbuffer.h:574
@ LDNS_RR_TYPE_NXT
2535typecode
Definition: rrdef.h:143
struct key_entry_key * key_entry_create_rrset(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, struct ub_packed_rrset_key *rrset, uint8_t *sigalg, time_t now)
Create a key entry from an rrset, in the given region.
Definition: val_kentry.c:296
static int verify_p7sig(BIO *data, BIO *p7s, STACK_OF(X509) *trust, const char *p7signer)
verify a PKCS7 signature, false on failure
Definition: unbound-anchor.c:1760
static void dtio_reconnect_enable(struct dt_io_thread *dtio)
start reconnection attempts
Definition: dtstream.c:496
static void verbose_key(struct autr_ta *ta, enum verbosity_value level, const char *format,...) ATTR_FORMAT(printf
Debug routine to print pretty key information.
Definition: autotrust.c:140
Outgoing interface.
Definition: outside_network.h:169
struct ctx_query * context_deserialize_new_query(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Deserialize a new_query buffer.
Definition: context.c:245
struct timehist * timehist_setup(void)
Setup a histogram, default.
Definition: timehist.c:84
int nsec3_has_optout(struct ub_packed_rrset_key *rrset, int r)
return if nsec3 RR has the optout flag
Definition: val_nsec3.c:133
void mesh_state_make_unique(struct mesh_state *mstate)
Make a mesh state unique.
Definition: mesh.c:855
int(* del_signal)(struct ub_event *)
Deactivate a signal event (not called by libunbound).
Definition: unbound-event.h:149
struct lruhash_entry entry
lru hash entry
Definition: val_kentry.h:57
void dname_test(void)
unit test dname handling functions
Definition: unitdname.c:861
void inplace_cb_lists_delete(struct module_env *env)
Delete all the inplace callback linked lists.
static int do_certupdate(const char *root_anchor_file, const char *root_cert_file, const char *urlname, const char *xmlname, const char *p7sname, const char *p7signer, const char *res_conf, const char *root_hints, const char *debugconf, const char *srcaddr, int ip4only, int ip6only, int port, int use_sni)
perform actual certupdate work
Definition: unbound-anchor.c:1931
int worker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming replies from the network
Definition: worker.c:239
void wsvc_command_option(const char *wopt, const char *cfgfile, int v, int c)
Handle commandline service for windows.
Definition: win_svc.c:498
int dns_msg_ansadd(struct dns_msg *msg, struct regional *region, struct ub_packed_rrset_key *rrset, time_t now)
Add rrset to authority section in unpacked dns_msg message.
Definition: dns.c:451
Host information encompasses host capabilities and retransmission timeouts.
Definition: infra.h:75
void(* kill_sub)(struct module_qstate *newq)
Kill newly attached sub.
Definition: module.h:445
void ub_openssl_lock_delete(void)
De-init the allocated openssl locks.
Definition: net_help.c:1355
struct edns_option * edns_opt_copy_alloc(struct edns_option *list)
Copy edns option list allocated with malloc.
Definition: msgreply.c:1217
int auth_zone_write_file(struct auth_zone *z, const char *fname)
Write auth zone data to file, in zonefile format.
Definition: authzone.c:1724
char * str
first string
Definition: config_file.h:762
static void specific_cases(void)
test specific cases
Definition: unitregional.c:202
struct alloc_cache * alloc
allocation service
Definition: module.h:477
int auth_zones_startprobesequence(struct auth_zones *az, struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t dclass)
for the zone and if not already going, starts the probe sequence.
Definition: authzone.c:3593
char * tls_ciphersuites
TLS chiphersuites (TLSv1.3)
Definition: config_file.h:130
struct timeval timeout
timeout on this entry
Definition: delayer.c:127
rbtree_type upstream
Tree of the address spans that are whitelisted.
Definition: subnet-whitelist.h:61
void listen_sslctx_setup_2(void *ctxt)
Further setup of listening SSL context, after keys loaded.
Definition: net_help.c:952
struct comm_point * cp
the SOA probe udp event.
Definition: authzone.h:342
static void timeval_subtract(struct timeval *d, const struct timeval *end, const struct timeval *start)
subtract timers and the values do not overflow or become negative
Definition: remote.c:113
static struct delegpt * compile_time_root_prime(int do_ip4, int do_ip6)
obtain compiletime provided root hints
Definition: iter_hints.c:115
static int write_compressed_dname(sldns_buffer *pkt, uint8_t *dname, int labs, struct compress_tree_node *p)
compress a domain name
Definition: msgencode.c:252
@ LDNS_RDF_TYPE_TYPE
a RR type
Definition: rrdef.h:292
static int autr_assemble(struct trust_anchor *tp)
Assemble the trust anchors into DS and DNSKEY packed rrsets.
Definition: autotrust.c:742
int started_no_cache_store
If the dns64 module started with no_cache bool set in the qstate, a message to tell it to not modify ...
Definition: dns64.c:95
int fptr_whitelist_modenv_send_query(struct outbound_entry *(*fptr)(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q))
Check function pointer whitelist for module_env send_query callback values.
Definition: fptr_wlist.c:334
size_t size
the size of the array - must be power of 2
Definition: slabhash.h:59
struct lruhash_entry * lruhash_insert_or_retrieve(struct lruhash *table, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *cb_arg)
Insert a new element into the hashtable, or retrieve the corresponding element of it exits.
Definition: lruhash.c:576
rbtree_type data
auth data for this zone rbtree of struct auth_data
Definition: authzone.h:118
static void usage(void)
usage
Definition: anchor-update.c:50
struct comm_timer * timer
timeout for the transfer.
Definition: authzone.h:418
void context_query_delete(struct ctx_query *q)
delete context query
Definition: context.c:113
#define XMLNAME
path on HTTPS server to xml file
Definition: unbound-anchor.c:145
int remote_control_callback(struct comm_point *, void *, int, struct comm_reply *)
handle remote control data callbacks
rbnode_type * right
right node (larger items)
Definition: rbtree.h:61
int ds_digest_match_dnskey(struct module_env *env, struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx, struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
Check if dnskey matches a DS digest Does not check dnskey-keyid footprint, just the digest.
Definition: val_sigcrypt.c:314
void regional_log_stats(struct regional *r)
Debug print regional statistics to log.
Definition: regional.c:217
int val_dsset_isusable(struct ub_packed_rrset_key *ds_rrset)
Determine if DS rrset is usable for validator or not.
Definition: val_utils.c:724
void pending_delete(struct outside_network *outnet, struct pending *p)
Delete pending answer.
Definition: outside_network.c:1001
static int subdomain_dname(uint8_t *q, size_t qlen, uint8_t *p, size_t plen)
see if domain names are subdomain q of p
Definition: testpkts.c:1364
struct config_stub * stubs
the stub definitions, linked list
Definition: config_file.h:210
INLINE uint32_t sldns_buffer_read_u32(sldns_buffer *buffer)
returns the 4-byte integer value at the current position in the buffer
Definition: sbuffer.h:690
static int az_empty_nonterminal(struct auth_zone *z, struct query_info *qinfo, struct auth_data *node)
See if the query goes to empty nonterminal (that has no auth_data, but there are nodes underneath.
Definition: authzone.c:2365
int ssl_failed
ssl failure? stop writing and skip the rest.
Definition: remote.c:2440
@ DONOT_MINIMISE_STATE
Send out full QNAME + original QTYPE.
Definition: iterator.h:164
uint16_t sldns_calc_keytag_raw(uint8_t *key, size_t keysize)
Calculates keytag of DNSSEC key, operates on wireformat rdata.
Definition: keyraw.c:106
int ipstrtoaddr(const char *ip, int port, struct sockaddr_storage *addr, socklen_t *addrlen)
Convert ip address string and port to sockaddr.
Definition: net_help.c:247
static int ssl_read_buf(RES *ssl, sldns_buffer *buf)
read a line from ssl into buffer
Definition: cachedump.c:305
static void decommission_pending_tcp(struct outside_network *outnet, struct pending_tcp *pend)
decommission a tcp buffer, closes commpoint and frees waiting_tcp entry
Definition: outside_network.c:441
int32_t val_date_override
if not 0, this value is the validation date for RRSIGs
Definition: config_file.h:346
int need_to_exit
do we need to exit unbound (or is it only a reload?)
Definition: daemon.h:105
uint8_t * nsec3_salt
nsec3 salt in use
Definition: val_neg.h:117
static void sigdate_error(const char *str, int32_t expi, int32_t incep, int32_t now)
pretty print rrsig error with dates
Definition: val_sigcrypt.c:1204
void respip_set_delete(struct respip_set *set)
This prototype is defined in in respip.h, but we want to avoid unnecessary dependencies.
Definition: respip.c:84
int reply_info_answer_encode(struct query_info *qinf, struct reply_info *rep, uint16_t id, uint16_t qflags, struct sldns_buffer *dest, time_t timenow, int cached, struct regional *region, uint16_t udpsize, struct edns_data *edns, int dnssec, int secure)
Generate answer from reply_info.
Definition: msgencode.c:838
int sldns_str2wire_int16_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT16 from string to wireformat.
Definition: str2wire.c:1032
struct waiting_tcp * pending_tcp_query(struct serviced_query *sq, struct sldns_buffer *packet, int timeout, comm_point_callback_type *callback, void *callback_arg)
Send TCP query.
Definition: outside_network.c:1319
@ rrset_trust_validated
DNSSEC(rfc4034) validated with trusted keys.
Definition: packed_rrset.h:166
int hints_apply_cfg(struct iter_hints *hints, struct config_file *cfg)
Process hints config.
Definition: iter_hints.c:431
static void answer_callback_from_entry(struct replay_runtime *runtime, struct entry *entry, struct fake_pending *pend)
Perform range entry on pending message.
Definition: fake_event.c:365
#define socketpair(f, t, p, sv)
no socketpair() available, like on Minix 3.1.7, use pipe
Definition: tube.c:54
void bin_delete(struct lruhash *table, struct lruhash_bin *bin)
delete the hash bin and entries inside it
Definition: lruhash.c:98
int RTT_MIN_TIMEOUT
min retransmit timeout value, in milliseconds
Definition: rtt.c:47
const char * rpz_action_to_string(enum rpz_action a)
String for RPZ action enum.
Definition: rpz.c:56
ub_ctx_cmd
Command codes for libunbound pipe.
Definition: context.h:216
void mesh_walk_supers(struct mesh_area *mesh, struct mesh_state *mstate)
Call inform_super for the super query states that are interested in the results from this query state...
Definition: mesh.c:1408
void delegpt_count_addr(struct delegpt *dp, size_t *numaddr, size_t *numres, size_t *numavail)
count addresses, and number in result and available lists, for logging
Definition: iter_delegpt.c:240
struct infra_cache * infra_adjust(struct infra_cache *infra, struct config_file *cfg)
Adjust infra cache to use updated configuration settings.
Definition: infra.c:294
uint64_t calls
number allocations and frees
Definition: memstats.c:64
#define STRMAX
max length of strings: filenames and function names.
Definition: lock_verify.c:162
BIO * ctag
the current anchor: KeyTag
Definition: unbound-anchor.c:1210
void ub_get_event_sys(struct ub_event_base *, const char **n, const char **s, const char **m)
Return the name, system and method for the pluggable event base.
Definition: ub_event.c:167
static int compress_rdata(sldns_buffer *pkt, uint8_t *rdata, size_t todolen, struct regional *region, struct compress_tree_node **tree, const sldns_rr_descriptor *desc)
compress domain names in rdata, return RETVAL_*
Definition: msgencode.c:367
static void autr_tp_remove(struct module_env *env, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset)
Revoke and Delete a trust point.
Definition: autotrust.c:2089
char * large_list
first large object, cast to char** to obtain next ptr
Definition: regional.h:68
struct val_anchors * anchors_create(void)
Create trust anchor storage.
Definition: val_anchor.c:76
int stat_cumulative
if false, statistics values are reset after printing them
Definition: config_file.h:75
static struct acl_addr * acl_find_or_create(struct acl_list *acl, const char *str)
find or create node (NULL on parse or error)
Definition: acl_list.c:134
uint8_t * context_serialize_new_query(struct ctx_query *q, uint32_t *len)
Serialize a context query that questions data.
Definition: context.c:222
int ub_ctx_data_remove(struct ub_ctx *ctx, const char *data)
Remove localdata from the library local authority info.
Definition: libunbound.c:1362
char * optarg
getopt global, in case header files fail to declare it.
static void checkrlimits(struct config_file *cfg)
check file descriptor count
Definition: unbound.c:174
struct ub_event_base * base
the event base (to loopexit)
Definition: unbound-dnstap-socket.c:99
#define BLACK
Node colour black.
Definition: rbtree.c:48
static void rbtree_delete_fixup(rbtree_type *rbtree, rbnode_type *child, rbnode_type *child_parent)
Fixup node colours when delete happened.
Definition: rbtree.c:406
static void chaos_trustanchor(sldns_buffer *pkt, struct edns_data *edns, struct worker *w, struct comm_reply *repinfo)
Create CH class trustanchor answer.
Definition: worker.c:868
@ RESPONSE_TYPE_REFERRAL
'delegation' means that the response is a delegation.
Definition: iter_resptype.h:66
void local_zones_print(struct local_zones *zones)
Debug helper.
Definition: localzone.c:1177
static void worker_restart_timer(struct worker *worker)
restart statistics timer for worker, if enabled
Definition: worker.c:1658
uint16_t id
the ID for the query; checked in reply
Definition: outside_network.h:259
static size_t get_qname_len(uint8_t *pkt, size_t pktlen)
get qtype from packet
Definition: testpkts.c:722
size_t len
the length to send.
Definition: dtstream.h:88
static void nsec3_hash_test_entry(struct entry *e, rbtree_type *ct, struct alloc_cache *alloc, struct regional *region, sldns_buffer *buf)
Test hash algo - NSEC3 hash it and compare result.
Definition: unitverify.c:419
int sldns_wire2str_type_print(char **str, size_t *str_len, uint16_t rrtype)
Print host format rr type to string.
Definition: wire2str.c:890
static int acl_list_tag_action_cfg(struct acl_list *acl, struct config_file *cfg, const char *str, const char *tag, const char *action)
apply acl_tag_action string
Definition: acl_list.c:194
enum rc_state::@0 shake_state
in the handshake part
int rtt_unclamped(const struct rtt_info *rtt)
Get unclamped timeout to use for server selection.
Definition: rtt.c:78
long long qtype_big
bigger qtype values not in array
Definition: unbound.h:687
static void validate_nodata_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey)
Validate a NOERROR/NODATA signed response – a response that has a NOERROR Rcode but no ANSWER section...
Definition: validator.c:888
static void signal_handling_record(void)
Signal handling during the time when netevent is disabled.
Definition: daemon.c:156
void mesh_delete_all(struct mesh_area *mesh)
Delete all mesh states from the mesh.
Definition: mesh.c:304
static int is_terminal(struct local_data *d)
returns true if the node is terminal so no deeper domain names exist
Definition: localzone.c:1916
@ comm_udp
UDP socket - handle datagrams.
Definition: netevent.h:227
static int print_edns_opts(char **s, size_t *sl, uint8_t *rdata, size_t rdatalen)
print the edns options to string
Definition: wire2str.c:1987
int createResponse(struct module_qstate *qstate, sldns_buffer *pkt)
Create response according to the ldns packet content.
Definition: pythonmod_utils.c:111
struct ub_event * ub_winsock_register_wsaevent(struct ub_event_base *base, void *wsaevent, void(*cb)(int, short, void *), void *arg)
Create a new ub_event associated with the wsaevent for the event base.
Definition: ub_event_pluggable.c:532
void config_delauth(struct config_auth *p)
Delete an auth item.
Definition: config_file.c:1323
struct sldns_buffer * qbuf_bak
backup of query if other operations recurse and need the network buffers
Definition: mesh.h:136
time_t SERVE_EXPIRED_TTL
Time to serve records after expiration.
Definition: msgreply.c:67
static void fake_front_query(struct replay_runtime *runtime, struct replay_moment *todo)
Create commpoint (as return address) for a fake incoming query.
Definition: fake_event.c:447
struct module_func_block * subnetmod_get_funcblock(void)
Get the module function block.
int donotq_lookup(struct iter_donotq *donotq, struct sockaddr_storage *addr, socklen_t addrlen)
See if an address is blocked.
Definition: iter_donotq.c:142
static struct auth_zone * addzone(struct auth_zones *az, const char *name, char *fname)
Add zone from file for testing.
Definition: unitauth.c:521
int lineno
line number information
Definition: str2wire.h:231
static void dname_test_query_dname_compare(void)
test query_dname_compare
Definition: unitdname.c:102
static struct val_neg_zone * neg_closest_zone_parent(struct val_neg_cache *neg, uint8_t *nm, size_t nm_len, int labs, uint16_t qclass)
Find closest existing parent zone of the given name.
Definition: val_neg.c:370
void wsvc_cron_cb(void *arg)
windows cron timer callback handler
Definition: win_svc.c:594
char * tls_server_name
is the TLS upstream authenticated by name, if nonNULL, we use the same cert bundle as used by other T...
Definition: dtstream.h:214
struct internal_signal * next
next in signal list
Definition: netevent.c:148
int iter_msg_has_dnssec(struct dns_msg *msg)
See if a message contains DNSSEC.
Definition: iter_utils.c:843
static void do_keypres(struct module_env *env, struct autr_ta *anchor, int *c)
Event: KeyPres.
Definition: autotrust.c:1773
static struct auth_data * az_nsec3_find_cover(struct auth_zone *z, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen)
Find cover for hashed(nm, nmlen) (or NULL)
Definition: authzone.c:2707
static void auth_zone_del(rbnode_type *n, void *ATTR_UNUSED(arg))
helper traverse to delete zones
Definition: authzone.c:2110
static int fill_nsec3_iter(struct val_env *ve, char *s, int c)
fill up nsec3 key iterations config entry
Definition: validator.c:74
struct packed_rrset_data * rrset_data
the key rrdata.
Definition: val_kentry.h:80
#define BOGUS_KEY_TTL
TTL for bogus key entries.
Definition: validator.h:65
static int readup_str(char **str, FILE *in)
read a string from file, false on error
Definition: lock_verify.c:164
int ub_ctx_data_add(struct ub_ctx *ctx, const char *data)
Add localdata to the library local authority info.
Definition: libunbound.c:1352
int ssl_port
port on which to provide ssl service
Definition: config_file.h:116
void comm_timer_disable(struct comm_timer *timer)
disable timer.
Definition: fake_event.c:1508
void tube_remove_bg_write(struct tube *tube)
Remove bg write setup from event base.
Definition: tube.c:126
void caps_strip_reply(struct reply_info *rep)
Remove unused bits from the reply if possible.
Definition: iter_utils.c:1025
int cfg_condense_ports(struct config_file *cfg, int **avail)
Get a condensed list of ports returned.
Definition: config_file.c:1601
enum respip_action resp_addr_get_action(const struct resp_addr *addr)
returns respip action for the specified node in the respip address returns respip_none for NULL input...
Definition: respip.c:1287
int edns_opt_compare(struct edns_option *p, struct edns_option *q)
Compare an edns option.
Definition: msgreply.c:1173
static void tap_socket_delev(struct tap_socket *s)
del the tap event
Definition: unbound-dnstap-socket.c:161
void outnet_serviced_query_stop(struct serviced_query *sq, void *cb_arg)
Remove service query callback.
Definition: outside_network.c:2177
static void lookup(struct ub_ctx *ctx, const char *nm, const char *qt, const char *qc)
perform host lookup
Definition: unbound-host.c:385
static struct local_rrset * new_local_rrset(struct regional *region, struct local_data *node, uint16_t rrtype, uint16_t rrclass)
new local_rrset
Definition: localzone.c:321
#define S_STRLIST_UNIQ(str, var)
put string into strlist if not present yet
Definition: config_file.c:427
int config_read(struct config_file *config, const char *filename, const char *chroot)
Read the config file from the specified filename.
Definition: config_file.c:1182
int packed_rr_to_string(struct ub_packed_rrset_key *rrset, size_t i, time_t now, char *dest, size_t dest_len)
Convert RR from RRset to string.
Definition: packed_rrset.c:271
static void rpz_insert_qname_trigger(struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len)
Insert RR into RPZ's local-zone.
Definition: rpz.c:469
int dnscrypt
DNSCrypt.
Definition: config_file.h:558
size_t serviced_get_mem(struct serviced_query *sq)
Get memory size in use by serviced query while it is servicing callbacks.
Definition: outside_network.c:2536
const sldns_rr_descriptor * sldns_rr_descript(uint16_t type)
returns the resource record descriptor for the given rr type.
Definition: rrdef.c:631
static int select_id(struct outside_network *outnet, struct pending *pend, sldns_buffer *packet)
Select random ID.
Definition: outside_network.c:1089
const char * _name
Textual name of the RR type.
Definition: rrdef.h:454
@ rrset_trust_ans_AA
The authoritative data included in the answer section of an authoritative reply.
Definition: packed_rrset.h:160
@ comm_ssl_shake_read
ssl initial handshake wants to read
Definition: netevent.h:198
#define INET_SIZE
byte size of ip4 address
Definition: net_help.h:88
struct config_strlist * tls_additional_port
additional tls ports
Definition: config_file.h:124
static void print_option(struct config_file *cfg, const char *opt, int final)
Print given option to stdout.
Definition: unbound-checkconf.c:105
int auth_zone_read_zonefile(struct auth_zone *z, struct config_file *cfg)
read auth zone from zonefile.
Definition: authzone.c:1562
struct ta_key * keylist
List of DS or DNSKEY rrs that form the trust anchor.
Definition: val_anchor.h:110
struct tube_res_list * next
next in list
Definition: tube.h:117
struct addr_tree_node * addr_tree_lookup(rbtree_type *tree, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup closest encloser in addr tree.
Definition: dnstree.c:210
void infra_ratelimit_dec(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow)
Decrement the query rate counter for a delegation point.
Definition: infra.c:958
void tcp_req_info_delete(struct tcp_req_info *req)
Delete tcp request structure.
Definition: listen_dnsport.c:1611
int ub_ctx_hosts(struct ub_ctx *ctx, const char *fname)
Read list of hosts from the filename given.
Definition: libunbound.c:1158
int bogus
if true, the NS RRset was bogus.
Definition: iter_delegpt.h:76
lock_rw_type lock
lock on the data in the structure For the node and name you need to also hold the views_tree lock to ...
Definition: view.h:83
int hints_add_stub(struct iter_hints *hints, uint16_t c, struct delegpt *dp, int noprime)
Add stub to hints structure.
Definition: iter_hints.c:527
static int nsec_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *nsec, struct key_entry_key *kkey, char **reason, struct module_qstate *qstate)
check security status from cache or verify rrset, returns true if secure
Definition: val_nsec.c:177
#define IO_TIMEOUT
number of msec timeout on io ports
Definition: perf.c:145
static struct trust_anchor * anchor_store_new_rr(struct val_anchors *anchors, uint8_t *rr, size_t rl, size_t dl)
Add new RR.
Definition: val_anchor.c:357
char * identity
identity, hostname is returned if "".
Definition: config_file.h:319
int want_dnssec
We want signatures, or else the answer is likely useless.
Definition: outside_network.h:338
struct ub_event_vmt * vmt
Virtual Method Table for ub_event.
Definition: unbound-event.h:170
int is_bidirectional
are we bi-directional (if false, uni-directional)
Definition: unbound-dnstap-socket.c:125
size_t nsec3_saltlen
length of salt in bytes
Definition: val_neg.h:119
int tube_read_msg(struct tube *tube, uint8_t **buf, uint32_t *len, int nonblock)
Read length bytes followed by message.
Definition: tube.c:331
static void search_cycle(struct lock_ref *visit, int level, struct lock_ref *from)
recursive function to depth first search for cycles.
Definition: lock_verify.c:326
static void echo_cmdline(int argc, char *argv[])
pretty print commandline for unbound in this test
Definition: testbound.c:145
@ LDNS_RR_TYPE_SINK
dnsind-kitchen-sink-02.txt
Definition: rrdef.h:163
int python_inplace_cb_reply_generic(struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct edns_option **opt_list_out, struct comm_reply *repinfo, struct regional *region, int id, void *python_callback)
Declared here for fptr_wlist access.
int auth_xfer_transfer_http_callback(struct comm_point *c, void *arg, int err, struct comm_reply *repinfo)
callback for task_transfer http connections
Definition: authzone.c:5907
enum acl_access acl_get_control(struct acl_addr *acl)
Lookup access control status for acl structure.
Definition: acl_list.c:470
int ub_ctx_resolvconf(struct ub_ctx *ctx, const char *fname)
Read list of nameservers to use from the filename given.
Definition: libunbound.c:1072
struct reply_info * construct_reply_info_base(struct regional *region, uint16_t flags, size_t qd, time_t ttl, time_t prettl, time_t expttl, size_t an, size_t ns, size_t ar, size_t total, enum sec_status sec)
constructor for replyinfo
Definition: msgreply.c:93
int cachedb_init(struct module_env *env, int id)
Init the cachedb module.
int replay_var_compare(const void *a, const void *b)
compare two replay_vars
Definition: replay.c:556
struct key_entry_key * key_entry_create_bad(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
Create a bad entry, in the given region.
Definition: val_kentry.c:324
static int apply_respip_action(struct worker *worker, const struct query_info *qinfo, struct respip_client_info *cinfo, struct reply_info *rep, struct comm_reply *repinfo, struct ub_packed_rrset_key **alias_rrset, struct reply_info **encode_repp, struct auth_zones *az)
Apply, if applicable, a response IP action to a cached answer.
Definition: worker.c:574
struct ub_ctx * ub_ctx_create_ub_event(struct ub_event_base *ueb)
Create a resolving and validation context.
Definition: libunbound.c:197
size_t num
the number of entries in the array that are unfulfilled
Definition: val_sigcrypt.h:71
hashvalue_type dname_query_hash(uint8_t *dname, hashvalue_type h)
Hash dname, label by label, lowercasing, into hashvalue.
Definition: dname.c:287
struct comm_signal * comsig
the signal handler
Definition: worker.h:102
uint32_t cmd_len
size of current read command, may be partially read
Definition: tube.h:79
INLINE void sldns_buffer_write(sldns_buffer *buffer, const void *data, size_t count)
writes count bytes of data to the current position of the buffer
Definition: sbuffer.h:463
struct worker * worker
the worker for this remote control
Definition: remote.h:91
int outside_packet
true if ttl_data is not part of the packet, but elsewhere in mem.
Definition: msgparse.h:190
void dynlibmod_deinit(struct module_env *env, int id)
dynlib module deinit
Definition: dynlibmod.c:166
struct entry * next
next in list
Definition: testpkts.h:220
static const char * rrinternal_get_delims(sldns_rdf_type rdftype, size_t r_cnt, size_t r_max)
find delimiters for type
Definition: str2wire.c:340
uint8_t copy_query
copy the query nametypeclass from query into the answer
Definition: testpkts.h:207
int ub_cancel(struct ub_ctx *ctx, int async_id)
Cancel an async query in progress.
Definition: libunbound.c:829
int type_tcp_out
if this is a tcp outgoing type of commpoint
Definition: fake_event.c:79
static void auth_answer_encode(struct query_info *qinfo, struct module_env *env, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct dns_msg *msg)
encode auth answer
Definition: authzone.c:3277
#define NETEVENT_TIMEOUT
to pass timeout happened to callback function
Definition: netevent.h:85
BIO * cdigest
the current anchor: Digest
Definition: unbound-anchor.c:1216
uint32_t hashvalue_type
the type of a hash value
Definition: lruhash.h:119
struct ub_event * slow_accept
the event used for slow_accept timeouts
Definition: netevent.c:122
struct ub_event * ev
ub_event event type
Definition: netevent.c:146
struct port_comm ** out
array of the commpoints currently in use.
Definition: outside_network.h:189
size_t acl_list_get_mem(struct acl_list *acl)
Get memory used by acl structure.
Definition: acl_list.c:485
static struct lruhash_entry * infra_find_ratedata(struct infra_cache *infra, uint8_t *name, size_t namelen, int wr)
find data item in array, for write access, caller unlocks
Definition: infra.c:800
void rtt_init(struct rtt_info *rtt)
Initialize RTT estimators.
Definition: rtt.c:62
void bin_overflow_remove(struct lruhash_bin *bin, struct lruhash_entry *entry)
Remove entry from bin overflow chain.
Definition: lruhash.c:167
@ LDNS_RR_TYPE_IPSECKEY
IPsec Key.
Definition: rrdef.h:173
void server_stats_compile(struct worker *worker, struct ub_stats_info *s, int reset)
Compile stats into structure for this thread worker.
Definition: stats.c:254
uint8_t key[DNSCRYPT_SHARED_SECRET_KEY_LENGTH]
the hash table key
Definition: dnscrypt.c:58
long long qbit_RD
number of queries with RD bit
Definition: unbound.h:709
char * name
view name.
Definition: view.h:72
static int msg_add_rrset_an(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node, struct auth_rrset *rrset)
add rrset to answer section (no auth, add rrsets yet)
Definition: authzone.c:219
Definition: dnscrypt.c:56
int reply_info_parse(sldns_buffer *pkt, struct alloc_cache *alloc, struct query_info *qinf, struct reply_info **rep, struct regional *region, struct edns_data *edns)
Parse query reply.
Definition: msgreply.c:461
enum sec_status val_verify_DNSKEY_with_TA(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ta_ds, struct ub_packed_rrset_key *ta_dnskey, uint8_t *sigalg, char **reason, struct module_qstate *qstate)
Verify DNSKEYs with DS and DNSKEY rrset.
Definition: val_utils.c:585
static void replay_range_delete(struct replay_range *rng)
delete range
Definition: replay.c:119
int auth_xfer_cmp(const void *z1, const void *z2)
compare auth_xfer for sorted rbtree
Definition: authzone.c:334
void dt_io_thread_stop(struct dt_io_thread *dtio)
Stop the io thread.
Definition: dtstream.c:2084
uint16_t type
type, host order.
Definition: msgparse.h:157
static void dtio_cur_msg_free(struct dt_io_thread *dtio)
delete the current message in the dtio, and reset counters
Definition: dtstream.c:554
static void tap_socket_delete(struct tap_socket *s)
delete tap socket
Definition: unbound-dnstap-socket.c:180
time_t cfg_convert_timeval(const char *str)
Convert 14digit to time value.
Definition: config_file.c:1808
int delegpt_add_target_mlc(struct delegpt *dp, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame)
Add target address to the delegation point.
Definition: iter_delegpt.c:649
int sldns_str2wire_atma_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ATMA from string to wireformat.
Definition: str2wire.c:1819
long int ub_random_max(struct ub_randstate *state, long int x)
Generate random number between 0 and x-1.
static int fwd_add_stub_hole(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
insert a stub hole (if necessary) for stub name
Definition: iter_fwd.c:289
int ssl_handshake_done
is the ssl handshake done
Definition: unbound-dnstap-socket.c:113
INLINE void sldns_buffer_set_at(sldns_buffer *buffer, size_t at, int c, size_t count)
set the given byte to the buffer at the specified position
Definition: sbuffer.h:449
struct rbnode_type node
node in rbtree, must be first entry, key is ptr to the querynum
Definition: context.h:150
ecs_whitelist structure
Definition: subnet-whitelist.h:53
void tcl_list_delete(struct tcl_list *tcl)
Delete TCP connection limit structure.
Definition: tcp_conn_limit.c:76
struct config_strlist * caps_whitelist
0x20 whitelist, domains that do not use capsforid
Definition: config_file.h:264
struct sldns_buffer * reply_from_hex
or reply pkt in hex if not parsable
Definition: testpkts.h:159
struct comm_point * cp
the TCP comm point for this.
Definition: listen_dnsport.h:248
int daemon_open_shared_ports(struct daemon *daemon)
Open shared listening ports (if needed).
Definition: daemon.c:297
size_t tag_actions_size
size of the tag_actions_array
Definition: acl_list.h:100
static int rrinternal_get_ttl(sldns_buffer *strbuf, char *token, size_t token_len, int *not_there, uint32_t *ttl, uint32_t default_ttl)
read ttl
Definition: str2wire.c:247
struct edns_option * edns_opt_list_find(struct edns_option *list, uint16_t code)
Find edns option in edns list.
Definition: msgreply.c:1251
int answer_len
length of the answer packet in octets.
Definition: unbound.h:160
INLINE uint8_t sldns_buffer_read_u8(sldns_buffer *buffer)
returns the byte value at the current position in the buffer
Definition: sbuffer.h:638
struct msgreply_entry * query_info_entrysetup(struct query_info *q, struct reply_info *r, hashvalue_type h)
Setup query info entry.
Definition: msgreply.c:639
static void report_status(DWORD state, DWORD exitcode, DWORD wait)
Report current service status to service control manager.
Definition: win_svc.c:84
socklen_t len
length of addr
Definition: module.h:578
static const XML_Char * find_att(const XML_Char **atts, const XML_Char *name)
XML fetch value of particular attribute(by name) or NULL if not present.
Definition: unbound-anchor.c:1285
void dtio_reconnect_timeout_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits), void *arg)
callback for the dnstap reconnect, to start reconnecting to output
Definition: dtstream.c:477
size_t cachedb_get_mem(struct module_env *env, int id)
return memory estimate for cachedb module
sldns_lookup_table * sldns_rr_classes
lookuptable for rr classes
Definition: rrdef.c:28
int rpz_log
Log when this RPZ policy is applied.
Definition: config_file.h:683
enum sec_status val_nsec_prove_nodata_dsreply(struct module_env *env, struct val_env *ve, struct query_info *qinfo, struct reply_info *rep, struct key_entry_key *kkey, time_t *proof_ttl, char **reason, struct module_qstate *qstate)
Check DS absence.
Definition: val_nsec.c:198
The ring buffer.
Definition: delayer.c:62
char * control_key_file
private key file for unbound-control
Definition: config_file.h:446
static int dtio_add_output_event_write(struct dt_io_thread *dtio)
add output event for read and write
Definition: dtstream.c:1164
void iter_deinit(struct module_env *env, int id)
iterator deinit
Definition: iterator.c:112
void void log_init(const char *filename, int use_syslog, const char *chrootdir)
call this to initialize logging services.
Definition: log.c:86
long long shared_secret_cache_count
number of dnscrypt shared secret cache entries
Definition: unbound.h:768
int query_dname_compare(uint8_t *d1, uint8_t *d2)
Compare query dnames (uncompressed storage).
INLINE void sldns_buffer_read_at(sldns_buffer *buffer, size_t at, void *data, size_t count)
copies count bytes of data at the given position to the given data-array
Definition: sbuffer.h:600
int optind
getopt global, in case header files fail to declare it.
struct comm_base * comm_base_create_event(struct ub_event_base *base)
Create comm base that uses the given ub_event_base (underlying pluggable event mechanism pointer).
Definition: netevent.c:186
void tcp_req_info_clear(struct tcp_req_info *req)
Clear tcp request structure.
Definition: listen_dnsport.c:1621
int sldns_wire2str_edns_nsid_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS NSID option data to string.
Definition: wire2str.c:1797
static int anchor_read_bind_file(struct val_anchors *anchors, sldns_buffer *buffer, const char *fname)
Read a BIND9 like file with trust anchors in named.conf format.
Definition: val_anchor.c:734
@ LDNS_RDF_TYPE_NSEC
nsec type codes
Definition: rrdef.h:290
uint8_t * frame
data of the frame
Definition: unbound-dnstap-socket.c:127
int nsecbitmap_has_type_rdata(uint8_t *bitmap, size_t len, uint16_t type)
nsec typemap check, takes an NSEC-type bitmap as argument, checks for type.
Definition: val_nsec.c:61
static void xfr_start_transfer(struct auth_xfer *xfr, struct module_env *env, struct auth_master *master)
start transfer task by this worker , xfr is locked.
Definition: authzone.c:5974
static int rrset_canonical(struct regional *region, sldns_buffer *buf, struct ub_packed_rrset_key *k, uint8_t *sig, size_t siglen, struct rbtree_type **sortree, sldns_pkt_section section, struct module_qstate *qstate)
Create canonical form of rrset in the scratch buffer.
Definition: val_sigcrypt.c:1133
int32_t skew_max
clock skew max for signatures
Definition: validator.h:96
int addr_is_ip4mapped(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is an ipv6 mapped ipv4 address, "::ffff:0.0.0.0".
Definition: net_help.c:746
@ module_wait_reply
waiting for reply to outgoing network query
Definition: module.h:537
static int sum_subtree_inuse(struct val_neg_zone *zone, struct val_neg_data *data)
sum up number of items inuse in subtree
Definition: unitneg.c:365
void dname_remove_labels(uint8_t **dname, size_t *len, int n)
Snip off first N labels from a dname, returning the parent zone.
Definition: dname.c:742
int(* attach_sub)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq)
Attach subquery.
Definition: module.h:403
long long num_query_dnscrypt_secret_missed_cache
number of queries which did not have a shared secret in cache
Definition: unbound.h:766
long long key_cache_count
number of key cache entries
Definition: unbound.h:755
char * str
first string
Definition: config_file.h:747
#define MAX_LINE_LEN
max length of lines in file
Definition: replay.c:56
static int num_wait
global variable to see how many queries we have left
Definition: asynclook.c:94
sldns_enum_algorithm
Algorithms used in dns.
Definition: rrdef.h:364
@ local_zone_inform
log client address, but no block (transparent)
Definition: localzone.h:84
int dnstap_tls
dnstap TLS enable
Definition: config_file.h:491
void respip_inform_print(struct respip_action_info *respip_actinfo, uint8_t *qname, uint16_t qtype, uint16_t qclass, struct local_rrset *local_alias, struct comm_reply *repinfo)
print log information for a query subject to an inform or inform-deny response-ip action.
Definition: respip.c:1305
int sldns_wire2str_loc_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat LOC field to string, with user buffers.
Definition: wire2str.c:1384
void mesh_state_delete(struct module_qstate *qstate)
Delete mesh state, cleanup and also rbtrees and so on.
Definition: mesh.c:907
int sldns_str_print(char **str, size_t *slen, const char *format,...) ATTR_FORMAT(printf
Print to string, move string along for next content.
void tube_delete(struct tube *tube)
Delete and destroy a pipe.
Definition: tube.c:88
int line
line number
Definition: lock_verify.c:98
@ respip_transparent
gives response data (if any), else nodata answer.
Definition: localzone.h:568
@ local_zone_inform_redirect
log client address, and direct
Definition: localzone.h:88
static struct auth_xfer * auth_xfer_new(struct auth_zone *z)
malloc the xfer and tasks
Definition: authzone.c:6700
int dname_lab_startswith(uint8_t *label, char *prefix, char **endptr)
Check if labels starts with given prefix.
Definition: dname.c:569
void iter_scrub_ds(struct dns_msg *msg, struct ub_packed_rrset_key *ns, uint8_t *z)
Remove DS records that are inappropriate before they are cached.
Definition: iter_utils.c:1243
size_t forwards_get_mem(struct iter_forwards *fwd)
Get memory in use by forward storage.
Definition: iter_fwd.c:447
void slabhash_delete(struct slabhash *table)
Delete hash table.
Definition: slabhash.c:87
static void lru_cleanup(struct addrtree *tree)
If a limit is set remove old nodes while above that limit.
Definition: addrtree.c:242
struct listen_port ** ports
array of listening ports, opened.
Definition: daemon.h:87
int event_added_is_write
event added is a write event
Definition: dtstream.h:143
static void pushintosuper(struct alloc_cache *alloc, alloc_special_type *mem)
push mem and some more items to the super
Definition: alloc.c:254
const char * val_state_to_string(enum val_state state)
Get validator state as a string.
Definition: validator.c:3280
char * sldns_wire2str_dname(uint8_t *dname, size_t dname_len)
Conver wire dname to a string.
Definition: wire2str.c:231
A mesh query state Unique per qname, qtype, qclass (from the qstate).
Definition: mesh.h:167
void * outgoing_ssl_fd(void *sslctx, int fd)
connect a new fd and wrap it in a BIO in SSL
Definition: net_help.c:1227
struct module_env env
module environment passed to modules, changed for this thread
Definition: worker.h:124
struct iter_hints * hints_create(void)
Create hints.
Definition: iter_hints.c:54
struct packed_rrset_data * d
ttl, count and rdatas (and rrsig)
Definition: packed_rrset.h:270
struct dns_msg * val_neg_getmsg(struct val_neg_cache *neg, struct query_info *qinfo, struct regional *region, struct rrset_cache *rrset_cache, struct sldns_buffer *buf, time_t now, int addsoa, uint8_t *topname, struct config_file *cfg)
For the given query, try to get a reply out of the negative cache.
Definition: val_neg.c:1479
void daemon_apply_cfg(struct daemon *daemon, struct config_file *cfg)
Apply config settings.
Definition: daemon.c:816
static void find_add_ds(struct module_env *env, struct regional *region, struct dns_msg *msg, struct delegpt *dp, time_t now)
find and add DS or NSEC to delegation msg
Definition: dns.c:375
static void dname_test_count_size_labels(void)
test dname_count_size_labels
Definition: unitdname.c:145
enum respip_action rpz_action_to_respip_action(enum rpz_action a)
Classify respip action for RPZ action.
Definition: rpz.c:223
static void proxy_list_clear(struct proxy *p)
clear proxy list
Definition: delayer.c:881
static int ext_test(struct ub_ctx *ctx, int argc, char **argv)
perform extended threaded test
Definition: asynclook.c:359
struct config_strlist_head tls_session_ticket_keys
secret key used to encrypt and decrypt TLS session ticket
Definition: config_file.h:126
static int setup_domain_limits(struct infra_cache *infra, struct config_file *cfg)
setup domain limits tree (0 on failure)
Definition: infra.c:222
int rbtree_find_less_equal(rbtree_type *rbtree, const void *key, rbnode_type **result)
Find, but match does not have to be exact.
Definition: rbtree.c:511
struct acl_addr * acl_addr_lookup(struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup address to see its acl structure.
Definition: acl_list.c:477
void rrset_update_sec_status(struct rrset_cache *r, struct ub_packed_rrset_key *rrset, time_t now)
Update security status of an rrset.
Definition: rrset.c:366
static void auth_xfer_set_expired(struct auth_xfer *xfr, struct module_env *env, int expired)
set a zone expired
Definition: authzone.c:3612
static int init_zsk_to_ksk(struct module_env *env, struct trust_anchor *tp, int *changed)
if ZSK init then trust KSKs
Definition: autotrust.c:1849
struct tcl_list * tcl_list_create(void)
Create TCP connection limit structure.
Definition: tcp_conn_limit.c:51
static int find_in_subsub(struct mesh_state *m, struct mesh_state *tofind, size_t *c)
helper recursive rbtree find routine
Definition: mesh.c:946
struct ub_packed_rrset_key * nsec3
where are the parameters for conversion, in this rrset data
Definition: val_nsec3.h:232
void config_delstubs(struct config_stub *p)
Delete items in config stub list.
Definition: config_file.c:1360
time_t lease_time
zone lease start time (start+expiry is expiration time).
Definition: authzone.h:271
static void alloc_setup_special(alloc_special_type *t)
setup new special type
Definition: alloc.c:55
int is_drop
whether the reply should be dropped
Definition: module.h:665
void get_cname_target(struct ub_packed_rrset_key *rrset, uint8_t **dname, size_t *dname_len)
Utility procedure to extract CNAME target name from its rdata.
Definition: packed_rrset.c:196
char * autotrust_id
the autotrust file id to check
Definition: replay.h:238
int sldns_str2wire_type_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TYPE from string to wireformat.
Definition: str2wire.c:1340
struct ctx_query * context_deserialize_new_query(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Deserialize a new_query buffer.
Definition: context.c:245
int iter_dp_is_useless(struct query_info *qinfo, uint16_t qflags, struct delegpt *dp)
See if delegation is useful or offers immediately no targets for further recursion.
Definition: iter_utils.c:741
static int getbit(const addrkey_t *addr, addrlen_t addrlen, addrlen_t n)
Get N'th bit from address.
Definition: addrtree.c:302
int deny_any
deny queries of type ANY with an empty answer
Definition: config_file.h:282
int UNKNOWN_SERVER_NICENESS
how nice is a server without further information, in msec Equals rtt initial timeout value.
Definition: iterator.c:73
int num_open_req
number of outstanding requests
Definition: listen_dnsport.h:266
The rrset cache Thin wrapper around hashtable, like a typedef.
Definition: rrset.h:56
wire parse state for parsing files
Definition: str2wire.h:218
int val_neg_dlvlookup(struct val_neg_cache *neg, uint8_t *qname, size_t len, uint16_t qclass, struct rrset_cache *rrset_cache, time_t now)
Perform a DLV style lookup During the lookup, we could find out that data has expired.
Definition: val_neg.c:968
size_t pkt_dname_len(struct sldns_buffer *pkt)
Determine correct, compressed, dname present in packet.
Definition: dname.c:183
int dns_msg_authadd(struct dns_msg *msg, struct regional *region, struct ub_packed_rrset_key *rrset, time_t now)
Add rrset to authority section in unpacked dns_msg message.
Definition: dns.c:440
size_t dsns_point_len
length of the dname in dsns_point
Definition: iterator.h:347
@ LDNS_RR_TYPE_A
a host address
Definition: rrdef.h:85
int ecs_edns_back_parsed(struct module_qstate *qstate, int id, void *cbargs)
Check whether response from server contains ECS record, if so, skip cache store.
static int fill_canon(struct ub_result *res, uint8_t *s)
insert canonname
Definition: libworker.c:430
void wsvc_command_option(const char *wopt, const char *cfgfile, int v, int c)
Handle commandline service for windows.
Definition: win_svc.c:498
struct key_entry_key * key_entry_copy(struct key_entry_key *kkey)
Copy a key entry, malloced.
Definition: val_kentry.c:155
static struct q_ans example_com_queries[]
queries for example.com: zone, query, flags, answer.
Definition: unitauth.c:146
void config_lookup_uid(struct config_file *cfg)
Find username, sets cfg_uid and cfg_gid.
Definition: config_file.c:2048
void handle_query(uint8_t *inbuf, ssize_t inlen, struct entry *entries, int *count, enum transport_type transport, void(*sendfunc)(uint8_t *, size_t, void *), void *userdata, FILE *verbose_out)
Parses data buffer to a query, finds the correct answer and calls the given function for every packet...
Definition: testpkts.c:1629
double timehist_quartile(struct timehist *hist, double q)
Find time value for given quartile, such as 0.25, 0.50, 0.75.
Definition: timehist.c:198
struct config_strlist * private_domain
allow domain (and subdomains) to use private address space
Definition: config_file.h:268
struct mesh_state * prev
previous in linked list for reply states
Definition: mesh.h:189
static int xfr_find_soa(struct auth_zone *z, struct auth_xfer *xfr)
Find auth_zone SOA and populate the values in xfr(soa values).
Definition: authzone.c:1783
ub_callback_type cb
for async query, the callback function of type ub_callback_type
Definition: context.h:159
static void setup_tcp_handler(struct comm_point *c, int fd, int cur, int max)
Use a new tcp handler for new query fd, set to read query.
Definition: netevent.c:739
struct delegpt * store_parent_NS
The query must store NS records from referrals as parentside RRs Enabled once it hits resolution prob...
Definition: iterator.h:330
lock_basic_type lock
lock on this structure, and on the workernum elements of the tasks.
Definition: authzone.h:204
static void init_events(struct trust_anchor *tp)
init events to zero
Definition: autotrust.c:1513
uint8_t * name
domain name in uncompressed wireformat
Definition: infra.h:147
void mesh_state_remove_reply(struct mesh_area *mesh, struct mesh_state *m, struct comm_point *cp)
Remove mesh reply entry from the reply entry list.
Definition: mesh.c:1817
int rtt_timeout(const struct rtt_info *rtt)
Get timeout to use for sending a UDP packet.
Definition: rtt.c:72
#define MSG_GENERIC_SUCCESS
from gen_msg.h - success message record for windows message log
Definition: win_svc.h:55
@ LDNS_RDF_TYPE_TSIGERROR
TSIG extended 16bit error value.
Definition: rrdef.h:353
static void tap_socket_list_delete(struct tap_socket_list *list)
delete the list
Definition: unbound-dnstap-socket.c:384
sldns_buffer * sldns_buffer_new(size_t capacity)
creates a new buffer with the specified capacity.
Definition: sbuffer.c:19
struct tube * tube_create(void)
Create a pipe.
Definition: tube.c:57
void mesh_list_insert(struct mesh_state *m, struct mesh_state **fp, struct mesh_state **lp)
Insert mesh state into a double linked list.
Definition: mesh.c:1794
size_t ans_expired
stats, number of expired replies sent
Definition: mesh.h:116
int do_udp
if udp is done
Definition: outside_network.h:104
struct delegpt * delegpt_from_message(struct dns_msg *msg, struct regional *regional)
Create new delegation point from a dns message.
Definition: iter_delegpt.c:349
void context_query_delete(struct ctx_query *q)
delete context query
Definition: context.c:113
void unit_show_func(const char *file, const char *func)
we are now testing this function
Definition: unitmain.c:842
static int dt_msg_queue_pop(struct dt_msg_queue *mq, void **buf, size_t *len)
pick a message from the queue, the routine locks and unlocks, returns true if there is a message
Definition: dtstream.c:410
@ acl_allow_snoop
allow full access for all queries, recursion and cache snooping
Definition: acl_list.h:66
size_t donotq_get_mem(struct iter_donotq *donotq)
Get memory used by donotqueryaddresses structure.
Definition: iter_donotq.c:149
struct delegpt_addr * iter_server_selection(struct iter_env *iter_env, struct module_env *env, struct delegpt *dp, uint8_t *name, size_t namelen, uint16_t qtype, int *dnssec_lame, int *chase_to_rd, int open_target, struct sock_list *blacklist, time_t prefetch)
Select a valid, nice target to send query to.
Definition: iter_utils.c:549
int ds_digest_match_dnskey(struct module_env *env, struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx, struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
Check if dnskey matches a DS digest Does not check dnskey-keyid footprint, just the digest.
Definition: val_sigcrypt.c:314
void comm_base_set_slow_accept_handlers(struct comm_base *b, void(*stop_accept)(void *), void(*start_accept)(void *), void *arg)
Set the slow_accept mode handlers.
Definition: netevent.c:260
char * macro_lookup(rbtree_type *store, char *name)
Look up a macro value.
Definition: replay.c:893
static int setup_if(struct port_if *pif, const char *addrstr, int *avail, int numavail, size_t numfd)
setup an outgoing interface, ready address
Definition: outside_network.c:711
lock_basic_type rrpipe_lock
mutex on result read pipe
Definition: context.h:72
#define UB_EV_SIGNAL
event signal
Definition: unbound-event.h:73
static void analyze(sldns_buffer *pkt)
analyse pkt
Definition: pktview.c:154
uint8_t * trust_anchor_name
trust anchor name
Definition: validator.h:193
void dname_str(uint8_t *dname, char *str)
Debug helper.
Definition: dname.c:639
int LOG_TAG_QUERYREPLY
log tag queries with name instead of 'info' for filtering
Definition: net_help.c:77
time_t SERVE_EXPIRED_REPLY_TTL
TTL to use for expired records.
Definition: msgreply.c:69
static int compare_1982(uint32_t a, uint32_t b)
RFC 1982 comparison, uses unsigned integers, and tries to avoid compiler optimization (eg.
Definition: val_sigcrypt.c:1232
int local_zones_zone_answer(struct local_zone *z, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct local_data *ld, enum localzone_type lz_type)
Answer using the local zone only (not local data used).
Definition: localzone.c:1518
int cfg_strlist_append(struct config_strlist_head *list, char *item)
Append text at end of list.
Definition: config_file.c:1650
@ LDNS_RR_TYPE_NAPTR
RFC2915.
Definition: rrdef.h:153
INLINE uint16_t sldns_buffer_read_u16(sldns_buffer *buffer)
returns the 2-byte integer value at the current position in the buffer
Definition: sbuffer.h:664
uint64_t last_id
last id number possible
Definition: alloc.h:86
size_t priv_get_mem(struct iter_priv *priv)
Get memory used by priv structure.
Definition: iter_priv.c:204
void worker_sighandler(int sig, void *arg)
Worker signal handler function.
Definition: worker.c:1625
@ UB_LIBCMD_QUIT
QUIT.
Definition: context.h:218
uint64_t alloc_get_id(struct alloc_cache *alloc)
Set ID number of special type to a fresh new ID number.
Definition: alloc.c:195
@ LDNS_RR_TYPE_MINFO
mailbox or mail list information
Definition: rrdef.h:111
int reply_info_alloc_rrset_keys(struct reply_info *rep, struct alloc_cache *alloc, struct regional *region)
Allocate (special) rrset keys.
Definition: msgreply.c:144
#define RTT_MAX_TIMEOUT
max retransmit timeout value, in milliseconds
Definition: rtt.h:61
static int count_modules(const char *s)
count number of modules (words) in the string
Definition: modstack.c:72
struct sockaddr_storage addr
client ip information
Definition: infra.h:162
#define BIT_TC
TC flag.
Definition: net_help.h:67
void val_neg_addreferral(struct val_neg_cache *neg, struct reply_info *rep, uint8_t *zone_name)
Insert NSECs from this referral into the negative cache for reference.
Definition: val_neg.c:1070
void tube_remove_bg_listen(struct tube *tube)
Remove bg listen setup from event base.
Definition: tube.c:116
int sldns_str2wire_apl_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_APL from string to wireformat.
Definition: str2wire.c:1118
int count
the number of elements, including this one and the ones whose parents (-parents) include this one,...
Definition: val_neg.h:110
static size_t strlen_after_chroot(const char *fname, struct config_file *cfg, int use_chdir)
Calculate string length of full pathname in original filesys.
Definition: config_file.c:2074
void cachedb_clear(struct module_qstate *qstate, int id)
clear the cachedb query-specific contents out of qstate
const char * sldns_get_errorstr_parse(int e)
Get reference to a constant string for the (parse) error.
Definition: str2wire.c:840
int serviced
if this is a serviced query
Definition: replay.h:356
void subnetmod_deinit(struct module_env *env, int id)
subnet module deinit
struct val_anchors * anchors_create(void)
Create trust anchor storage.
Definition: val_anchor.c:76
long long qbit_QR
number of queries with QR bit
Definition: unbound.h:703
static int udp_sockport(struct sockaddr_storage *addr, socklen_t addrlen, int pfxlen, int port, int *inuse, struct ub_randstate *rnd, int dscp)
Try to open a UDP socket for outgoing communication.
Definition: outside_network.c:1060
int authextstrtoaddr(char *str, struct sockaddr_storage *addr, socklen_t *addrlen, char **auth_name)
Convert address string, with "@port" appendix, to sockaddr.
Definition: net_help.c:423
static int parse_arg_name(RES *ssl, char *str, uint8_t **res, size_t *len, int *labs)
parse commandline argument domain name
Definition: remote.c:1129
int sldns_str2wire_str_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_STR from string to wireformat.
Definition: str2wire.c:1093
int dname_is_wild(uint8_t *dname)
Return true if the label is a wildcard, *.example.com.
Definition: dname.c:769
struct auth_master * next
next master in list
Definition: authzone.h:434
int daemon_remote_open_accept(struct daemon_remote *rc, struct listen_port *ports, struct worker *worker)
Setup comm points for accepting remote control connections.
Definition: remote.c:414
struct iter_hints_stub * hints_lookup_stub(struct iter_hints *hints, uint8_t *qname, uint16_t qclass, struct delegpt *cache_dp)
Given a qname/qclass combination, and the delegation point from the cache for this qname/qclass,...
Definition: iter_hints.c:472
int client_s
the fd to listen for client query
Definition: delayer.c:118
struct config_strlist * domain_insecure
insecure domain list
Definition: config_file.h:339
Iterator donotqueryaddresses structure.
Definition: iter_donotq.h:53
struct tcp_req_open_item * open_req_list
list of outstanding requests
Definition: listen_dnsport.h:268
struct lruhash_entry * bin_find_entry(struct lruhash *table, struct lruhash_bin *bin, hashvalue_type hash, void *key)
Find entry in hash bin.
Definition: lruhash.c:218
int sldns_str2wire_eui64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_EUI64 from string to wireformat.
Definition: str2wire.c:1992
void cachedb_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Subordinate query done, inform this super request of its conclusion.
struct timeval * timeout
timeout (NULL if it does not).
Definition: netevent.h:163
struct dns_msg * val_neg_getmsg(struct val_neg_cache *neg, struct query_info *qinfo, struct regional *region, struct rrset_cache *rrset_cache, sldns_buffer *buf, time_t now, int addsoa, uint8_t *topname, struct config_file *cfg)
For the given query, try to get a reply out of the negative cache.
Definition: val_neg.c:1479
uint16_t EDNS_ADVERTISED_SIZE
default value for EDNS ADVERTISED size
Definition: net_help.c:68
char ** ifs
interface description strings (IP addresses)
Definition: config_file.h:199
int ub_resolve(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, struct ub_result **result)
Perform resolution and validation of the target name.
Definition: libunbound.c:680
static void xfr_create_ixfr_packet(struct auth_xfer *xfr, sldns_buffer *buf, uint16_t id, struct auth_master *master)
create IXFR/AXFR packet for xfr
Definition: authzone.c:3977
lruhash_markdelfunc_type markdelfunc
how to mark a key pending deletion
Definition: lruhash.h:159
struct tap_socket_list * acceptlist
the list of accept sockets
Definition: unbound-dnstap-socket.c:101
rbnode_type * rbtree_last(rbtree_type *rbtree)
Returns last (largest) node in the tree.
Definition: rbtree.c:558
int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_type fptr)
Check function pointer whitelist for lruhash sizefunc callback values.
Definition: fptr_wlist.c:249
int read_again
read again
Definition: listen_dnsport.h:264
int rtt_unclamped(const struct rtt_info *rtt)
Get unclamped timeout to use for server selection.
Definition: rtt.c:78
void val_blacklist(struct sock_list **blacklist, struct regional *region, struct sock_list *origin, int cross)
Add existing list to blacklist.
Definition: val_utils.c:1088
static int az_generate_answer_nonexistnode(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg *msg, struct auth_data *ce, struct auth_rrset *rrset, struct auth_data *node)
Generate answer without an existing-node that we can use.
Definition: authzone.c:3156
static struct config_strlist * cfgfiles
config files (removed at exit)
Definition: testbound.c:66
int ssl_brief_write
true if SSL_read is waiting for a write event.
Definition: dtstream.h:156
void config_delauth(struct config_auth *p)
Delete an auth item.
Definition: config_file.c:1323
struct config_str3list * acl_tag_datas
list of aclname, tagname, redirectdata
Definition: config_file.h:419
time_t date
current date to use during the parse
Definition: unbound-anchor.c:1199
struct query_info qinfo
which query is being answered: name, type, class
Definition: module.h:598
int donotq_lookup(struct iter_donotq *donotq, struct sockaddr_storage *addr, socklen_t addrlen)
See if an address is blocked.
Definition: iter_donotq.c:142
static int dtio_add_output_event_read(struct dt_io_thread *dtio)
add the output file descriptor event for listening, read only
Definition: dtstream.c:1140
static int scrub_normalize(sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinfo, struct regional *region)
This routine normalizes a response.
Definition: iter_scrub.c:361
size_t reply_len
length of reply pkt
Definition: testpkts.h:155
int iter_msg_has_dnssec(struct dns_msg *msg)
See if a message contains DNSSEC.
Definition: iter_utils.c:843
struct ta_key * next
next in list
Definition: val_anchor.h:81
int anchor_cmp(const void *k1, const void *k2)
compare two trust anchors
Definition: val_anchor.c:60
The transfer task.
Definition: authzone.h:357
void invalidateQueryInCache(struct module_qstate *qstate, struct query_info *qinfo)
Invalidate the message associated with query_info stored in message cache.
Definition: pythonmod_utils.c:75
int infra_rate_max(void *data, time_t now)
find the maximum rate stored, not too old.
Definition: infra.c:898
#define unit_assert(x)
test bool x, exits on failure, increases testcount.
Definition: unitmain.h:51
size_t num_queries_ratelimited
number of queries that have been ratelimited
Definition: iterator.h:141
int cfg_condense_ports(struct config_file *cfg, int **avail)
Get a condensed list of ports returned.
Definition: config_file.c:1601
char * cfg_ptr_reverse(char *str)
Convert a ptr shorthand into a full reverse-notation PTR record.
Definition: config_file.c:2239
struct comm_point * comm_point_create_local(struct comm_base *base, int fd, size_t bufsize, comm_point_callback_type *callback, void *callback_arg)
Create commpoint to listen to a local domain file descriptor.
Definition: netevent.c:2943
size_t hints_get_mem(struct iter_hints *hints)
Get memory in use by hints.
Definition: iter_hints.c:514
int labs
labels in name
Definition: val_neg.h:102
static char * read_chunked_zero_terminate(SSL *ssl, size_t *len)
read chunked data and zero terminate; len is without zero
Definition: unbound-anchor.c:1070
static int parse_create_repinfo(struct msg_parse *msg, struct reply_info **rep, struct regional *region)
allocate replyinfo, return 0 on error
Definition: msgreply.c:132
void * buf
Buffer containing frame, except length counter(s).
Definition: dtstream.h:96
int sldns_wire2str_ilnp64_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat ILNP64 field to string, with user buffers.
Definition: wire2str.c:1653
void config_deldblstrlist(struct config_str2list *p)
Delete items in config double string list.
Definition: config_file.c:1296
struct auth_zone * auth_zone_find(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
find an auth zone by name (exact match by name or NULL returned)
Definition: authzone.c:444
int sldns_wire2str_rr_unknown_buf(uint8_t *d, size_t dlen, char *s, size_t slen)
3597 printout of an RR in unknown rr format.
Definition: wire2str.c:273
static SERVICE_STATUS_HANDLE service_status_handle
global service status handle
Definition: win_svc.c:60
static int * infra_rate_find_second(void *data, time_t t)
find the second and return its rate counter, if none, remove oldest
Definition: infra.c:879
int inplace_cb_query_response_call(struct module_env *env, struct module_qstate *qstate, struct dns_msg *response)
Call the registered functions in the inplace_cb_query_response linked list.
Definition: msgreply.c:1130
static void check_fwd(struct config_file *cfg)
check forwards
Definition: unbound-checkconf.c:830
void comm_point_listen_for_rw(struct comm_point *c, int rd, int wr)
Stop listening and start listening again for reading or writing.
Definition: netevent.c:3249
void config_del_strbytelist(struct config_strbytelist *list)
delete stringbytelist
Definition: config_file.c:1408
void mesh_serve_expired_callback(void *arg)
Callback for when the serve expired client timer has run out.
Definition: mesh.c:1881
void listen_start_accept(struct listen_dnsport *listen)
start accept handlers for TCP (was stopped before)
Definition: listen_dnsport.c:1584
int query_for_pside_glue
The query is for parent-side glue(A or AAAA) for a nameserver.
Definition: iterator.h:340
static void setup_tls_list(struct main_tap_data *maindata, struct config_strlist_head *tls_list, char *server_key, char *server_cert, char *verifypem)
setup tls accept sockets
Definition: unbound-dnstap-socket.c:1185
void static void error(const char *msg,...) ATTR_NORETURN
print error and exit
Definition: testpkts.c:52
int sldns_fp2wire_rr_buf(FILE *in, uint8_t *rr, size_t *len, size_t *dname_len, struct sldns_file_parse_state *parse_state)
Read one RR from zonefile with buffer for the data.
Definition: str2wire.c:861
size_t ub_rrset_sizefunc(void *key, void *data)
Calculate memory size of rrset entry.
Definition: packed_rrset.c:70
int key_entry_isbad(struct key_entry_key *kkey)
See if this entry is bad.
Definition: val_kentry.c:234
void tcl_close_connection(struct tcl_addr *tcl)
Decrement TCP connection count if found.
Definition: tcp_conn_limit.c:171
int tube_poll(struct tube *tube)
See if data is ready for reading on the tube without blocking.
Definition: tube.c:411
void tube_close_read(struct tube *tube)
Close read part of the pipe.
Definition: tube.c:100
void log_cert(unsigned level, const char *str, void *cert)
Log certificate details verbosity, string, of X509 cert.
static int match_noloc_section(char **q, char **nq, char **p, char **np, uint16_t num)
match two RR sections without ordering
Definition: testpkts.c:940
Rbtree reference to a mesh_state.
Definition: mesh.h:206
static int rrset_get_sig_algo(struct ub_packed_rrset_key *k, size_t sig_idx)
Get signature signing algorithm value.
Definition: val_sigcrypt.c:126
int ub_ctx_print_local_zones(struct ub_ctx *ctx)
Debug routine.
Definition: libunbound.c:1274
static void do_datas_add(RES *ssl, struct local_zones *zones)
Do the local_datas command.
Definition: remote.c:1321
int sldns_str2wire_int32_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT32 from string to wireformat.
Definition: str2wire.c:1045
struct ub_packed_rrset_key alloc_special_type
The special type, packed rrset.
Definition: alloc.h:56
struct auth_xfer * auth_xfer_find(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
find an xfer zone by name (exact match by name or NULL returned)
Definition: authzone.c:457
int check_auth_name_for_ssl(char *auth_name)
check if authname SSL functionality is available, false if not
Definition: net_help.c:1249
@ serviced_query_UDP_EDNS
UDP with EDNS sent.
Definition: outside_network.h:361
void modstack_desetup(struct module_stack *stack, struct module_env *env)
Desetup the modules, deinit, delete.
Definition: modstack.c:248
void log_ident_set(const char *id)
Set identity to print, default is 'unbound'.
Definition: log.c:180
void val_neg_zone_take_inuse(struct val_neg_zone *zone)
take a zone into use.
Definition: val_neg.c:518
static void autotrust_check(struct replay_runtime *runtime, struct replay_moment *mom)
check autotrust file contents
Definition: fake_event.c:578
void libworker_handle_control_cmd(struct tube *ATTR_UNUSED(tube), uint8_t *msg, size_t len, int err, void *arg)
handle control command coming into server
Definition: libworker.c:319
void sock_list_insert(struct sock_list **list, struct sockaddr_storage *addr, socklen_t len, struct regional *region)
Insert new socket list item.
Definition: net_help.c:782
int sldns_str2wire_rr_buf(const char *str, uint8_t *rr, size_t *len, size_t *dname_len, uint32_t default_ttl, uint8_t *origin, size_t origin_len, uint8_t *prev, size_t prev_len)
Convert text RR to wireformat, with user buffer.
Definition: str2wire.c:782
void alloc_special_release(struct alloc_cache *alloc, alloc_special_type *mem)
Return special_type back to pool.
Definition: alloc.c:279
void(* callback)(void *)
callback function, takes user arg only
Definition: netevent.h:326
size_t tcp_req_info_get_stream_buffer_size(void)
get the size of currently used tcp stream wait buffers (in bytes)
Definition: listen_dnsport.c:1957
INLINE uint16_t sldns_buffer_read_u16_at(sldns_buffer *buffer, size_t at)
returns the 2-byte integer value at the given position in the buffer
Definition: sbuffer.h:652
struct query_info qinfo
query info
Definition: dns.h:63
int tcp_mss
maximum segment size of tcp socket
Definition: outside_network.h:142
static int sum_zone_subtree_inuse(struct val_neg_cache *neg, struct val_neg_zone *zone)
sum up number of items inuse in subtree
Definition: unitneg.c:380
void comm_base_exit(struct comm_base *b)
Exit from dispatch loop.
Definition: fake_event.c:963
struct rrset_parse * hashtable[PARSE_TABLE_SIZE]
Hash table array used during parsing to lookup rrset types.
Definition: msgparse.h:130
Single linked list to store event points.
Definition: listen_dnsport.h:73
char * errinf_to_str_servfail(struct module_qstate *qstate)
Create error info in string.
Definition: config_file.c:2449
static struct tcp_req_done_item * tcp_req_info_pop_done(struct tcp_req_info *req)
remove first item from list of pending results
Definition: listen_dnsport.c:1722
size_t(* sizefunc)(void *)
External function returning size of elem.
Definition: addrtree.h:84
int sel_rtt
rtt stored here in the selection algorithm
Definition: iter_delegpt.h:147
struct tap_socket_list * next
next in list
Definition: unbound-dnstap-socket.c:135
int val_init(struct module_env *env, int id)
validator init
Definition: validator.c:168
void lruhash_setmarkdel(struct lruhash *table, lruhash_markdelfunc_type md)
Set the markdelfunction (or NULL)
Definition: lruhash.c:516
static void dtio_del_output_event(struct dt_io_thread *dtio)
del the output file descriptor event for listening
Definition: dtstream.c:578
#define FSTRM_CONTROL_FIELD_TYPE_CONTENT_TYPE
the constant that denotes the control field type that is the string for the content type of the strea...
Definition: dnstap_fstrm.h:111
void(* lruhash_markdelfunc_type)(void *)
mark a key as pending to be deleted (and not to be used by anyone).
Definition: lruhash.h:142
void * listen_arg
listen callback user arg
Definition: tube.h:75
struct msgreply_entry * msg_cache_lookup(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, time_t now, int wr)
lookup message in message cache the returned nonNULL entry is locked and has to be unlocked by the ca...
Definition: dns.c:240
uint32_t max_node_count
Maximum number of allowed nodes, will be enforced by LRU list.
Definition: addrtree.h:72
static struct rrset_parse * change_rrsig_rrset(struct rrset_parse *sigset, struct msg_parse *msg, sldns_buffer *pkt, uint16_t datatype, uint32_t rrset_flags, int hasother, sldns_pkt_section section, struct regional *region)
change an rrsig rrset for use as data rrset
Definition: msgparse.c:390
void rtt_init(struct rtt_info *rtt)
Initialize RTT estimators.
Definition: rtt.c:62
int reply_info_answer_encode(struct query_info *qinf, struct reply_info *rep, uint16_t id, uint16_t qflags, sldns_buffer *pkt, time_t timenow, int cached, struct regional *region, uint16_t udpsize, struct edns_data *edns, int dnssec, int secure)
Generate answer from reply_info.
Definition: msgencode.c:838
struct rrset_cache * rrset_cache_create(struct config_file *cfg, struct alloc_cache *alloc)
Create rrset cache.
Definition: rrset.c:59
rbtree_type sub_set
set of substates (that this state needs to continue) contains struct mesh_state_ref*
Definition: mesh.h:184
int sldns_wire2str_period_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat period field to string, with user buffers.
Definition: wire2str.c:1057
@ UB_READFILE
error reading from file (resolv.conf)
Definition: context.h:203
int reply_all_rrsets_secure(struct reply_info *rep)
Check security status of all RRs in the message.
Definition: msgreply.c:915
#define MAX_LINE
max line length
Definition: testpkts.c:39
static void dname_setup_bufs(sldns_buffer *loopbuf, sldns_buffer *boundbuf)
setup looped dname and out-of-bounds dname ptr
Definition: unitdname.c:836
rbnode_type node
rbtree node, key is this struct : dclass and name
Definition: dnstree.h:57
int sldns_buffer_printf(sldns_buffer *buffer, const char *format,...) ATTR_FORMAT(printf
prints to the buffer, increasing the capacity if required using buffer_reserve().
rbtree_type tree
Tree of the addresses that are allowed/blocked.
Definition: acl_list.h:81
static void set_trustanchor_state(struct module_env *env, struct autr_ta *ta, int *changed, autr_state_type s)
Set the state for this trust anchor.
Definition: autotrust.c:1708
static size_t assemble_iterate_count(int iter(struct autr_ta **, uint8_t **, size_t *, size_t *), struct autr_ta *list)
number of elements in iterator list
Definition: autotrust.c:605
static void perfsend(struct perfinfo *info, size_t n, struct timeval *now)
send new query for io
Definition: perf.c:279
struct dns_msg * dns_alloc_msg(struct sldns_buffer *pkt, struct msg_parse *msg, struct regional *regional)
Allocate dns_msg from parsed msg, in regional.
Definition: iter_utils.c:622
static int dtio_write_more_of_data(struct dt_io_thread *dtio)
write more of the data frame.
Definition: dtstream.c:848
struct auth_zone * rpz_az_next
next auth zone containing RPZ data, or NULL
Definition: authzone.h:143
@ module_state_initial
initial state - new query
Definition: module.h:535
void attach_edns_record(struct sldns_buffer *pkt, struct edns_data *edns)
Attach EDNS record to buffer.
Definition: msgencode.c:802
int ub_process(struct ub_ctx *ctx)
Call this routine to continue processing results from the validating resolver (when the fd becomes re...
Definition: libunbound.c:602
int sldns_str2wire_dname_buf(const char *str, uint8_t *buf, size_t *len)
Convert text string into dname wireformat, mallocless, with user buffer.
Definition: str2wire.c:139
int sldns_wire2str_pkt_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat packet to a string representation with user buffer It appends every RR with default c...
Definition: wire2str.c:367
static int forwards_insert(struct iter_forwards *fwd, uint16_t c, struct delegpt *dp)
insert new info into forward structure given dp
Definition: iter_fwd.c:142
socklen_t addrlen
length of addr
Definition: dnstree.h:85
void config_print_func(char *line, void *arg)
function to print to a file, use as func with config_get_option.
Definition: config_file.c:748
void tcl_list_delete(struct tcl_list *tcl)
Delete TCP connection limit structure.
Definition: tcp_conn_limit.c:76
static void read_malloc_stat(char *line, rbtree_type *tree)
read up the malloc stats
Definition: memstats.c:128
struct resp_addr * respip_sockaddr_find_or_create(struct respip_set *set, struct sockaddr_storage *addr, socklen_t addrlen, int net, int create, const char *ipstr)
Find resp_addr in tree, create and add to tree if it does not exist.
Definition: respip.c:103
size_t buf_count
Number of bytes written to buffer.
Definition: dtstream.h:98
int use_caps_bits_for_id
use 0x20 bits in query as random ID bits
Definition: config_file.h:262
void comm_point_drop_reply(struct comm_reply *repinfo)
Drop reply.
Definition: fake_event.c:1020
uint16_t nscount
count of RRs, host format
Definition: msgparse.h:105
static int do_root_update_work(const char *root_anchor_file, const char *root_cert_file, const char *urlname, const char *xmlname, const char *p7sname, const char *p7signer, const char *res_conf, const char *root_hints, const char *debugconf, const char *srcaddr, int ip4only, int ip6only, int force, int res_conf_fallback, int port, int use_sni)
perform the unbound-anchor work
Definition: unbound-anchor.c:2237
int ub_ctx_set_fwd(struct ub_ctx *ctx, const char *addr)
Set machine to forward DNS queries to, the caching resolver to use.
Definition: libunbound.c:907
static int setup_fd(char *addr, int port)
setup listening TCP
Definition: petal.c:270
int do_tcp_keepalive
do edns tcp keepalive
Definition: config_file.h:107
int tube_wait(struct tube *tube)
Wait for data to be ready for reading on the tube.
Definition: tube.c:418
static void dump_infra_host(struct lruhash_entry *e, void *arg)
callback for every host element in the infra cache
Definition: remote.c:2445
size_t available
number of bytes available in the current chunk.
Definition: regional.h:74
int iter_qname_indicates_dnssec(struct module_env *env, struct query_info *qinfo)
See if qname has DNSSEC needs.
Definition: iter_utils.c:778
static struct ub_event * service_stop_ev
event struct for stop callbacks
Definition: win_svc.c:64
static void auth_chunks_delete(struct auth_transfer *at)
delete chunks
Definition: authzone.c:2033
void * cb_arg
user argument for stop_accept and start_accept functions
Definition: netevent.h:107
void timehist_import(struct timehist *hist, long long *array, size_t sz)
Import histogram from an array.
Definition: timehist.c:239
enum sec_status val_nsec_prove_nodata_dsreply(struct module_env *env, struct val_env *ve, struct query_info *qinfo, struct reply_info *rep, struct key_entry_key *kkey, time_t *proof_ttl, char **reason, struct module_qstate *qstate)
Check DS absence.
Definition: val_nsec.c:198
size_t qname_len
length of query dname in octets, 0 if none
Definition: msgparse.h:120
void dname_pkt_copy(struct sldns_buffer *pkt, uint8_t *to, uint8_t *dname)
Copy over a valid dname and decompress it.
Definition: dname.c:346
static int str_keyword(char **str, const char *keyword)
true if the string starts with the keyword given.
Definition: testpkts.c:78
struct delegpt * forwards_lookup(struct iter_forwards *fwd, uint8_t *qname, uint16_t qclass)
Find forward zone information For this qname/qclass find forward zone information,...
Definition: iter_fwd.c:356
@ VAL_DLVLOOKUP_STATE
DLV lookup state, processing DLV queries.
Definition: validator.h:141
List of results (arbitrary command serializations) to write back.
Definition: tube.h:115
static int rrset_has_sigover(sldns_buffer *pkt, struct rrset_parse *rrset, uint16_t type, int *hasother)
see if rrset of type RRSIG contains sig over given type
Definition: msgparse.c:324
int sldns_wire2str_int16_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat int16 field to string, with user buffers.
Definition: wire2str.c:1037
int anchors_apply_cfg(struct val_anchors *anchors, struct config_file *cfg)
Process trust anchor config.
Definition: val_anchor.c:1047
static BIO * read_http_result(SSL *ssl)
read HTTP result from SSL
Definition: unbound-anchor.c:1099
@ serviced_query_UDP_EDNS_FRAG
send UDP query with EDNS1480 (or 1280)
Definition: outside_network.h:373
uint16_t qtype
query type, host order.
Definition: msgparse.h:122
struct listen_port * daemon_remote_open_ports(struct config_file *cfg)
Open and create listening ports for remote control.
Definition: remote.c:365
#define MAX_TARGET_NX
max number of nxdomains allowed for target lookups for a query and its subqueries
Definition: iterator.h:62
void * listen_sslctx_create(char *key, char *pem, char *verifypem)
create SSL listen context
Definition: net_help.c:979
void lruhash_clear(struct lruhash *table)
Clear hash table.
Definition: lruhash.c:438
int auth_zone_cmp(const void *z1, const void *z2)
compare auth_zones for sorted rbtree
Definition: authzone.c:307
static void handle_req(struct daemon_remote *rc, struct rc_state *s, RES *res)
handle remote control request
Definition: remote.c:3090
static int xfr_start_probe(struct auth_xfer *xfr, struct module_env *env, struct auth_master *spec)
pick up probe task with specified(or NULL) destination first, or transfer task if nothing to probe,...
Definition: authzone.c:6524
static void dname_test_dname_lab_cmp(void)
test dname_lab_cmp
Definition: unitdname.c:272
struct outbound_entry * libworker_send_query(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q)
Worker service routine to send serviced queries to authoritative servers.
Definition: libworker.c:853
func_deinit_t func_deinit
Module deinit function.
Definition: dynlibmod.h:122
static int answer_from_cache(struct worker *worker, struct query_info *qinfo, struct respip_client_info *cinfo, int *need_drop, int *is_expired_answer, int *is_secure_answer, struct ub_packed_rrset_key **alias_rrset, struct reply_info **partial_repp, struct reply_info *rep, uint16_t id, uint16_t flags, struct comm_reply *repinfo, struct edns_data *edns)
answer query from the cache.
Definition: worker.c:628
struct module_func_block * ipset_get_funcblock(void)
Get the function block with pointers to the ipset functions.
Definition: ipset.c:380
int auth_data_cmp(const void *z1, const void *z2)
compare auth_data for sorted rbtree
Definition: authzone.c:324
uint32_t node_count
Number of elements in the tree (not always equal to number of nodes)
Definition: addrtree.h:69
struct config_strlist * dnscrypt_provider_cert
dnscrypt provider certs 1.cert
Definition: config_file.h:566
void auth_xfer_probe_lookup_callback(void *arg, int rcode, sldns_buffer *buf, enum sec_status ATTR_UNUSED(sec), char *ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
callback for task_probe lookup of host name, of A or AAAA
Definition: authzone.c:6401
int ds_get_key_algo(struct ub_packed_rrset_key *k, size_t idx)
Get DS RR key algorithm.
Definition: val_sigcrypt.c:206
int dns_msg_authadd(struct dns_msg *msg, struct regional *region, struct ub_packed_rrset_key *rrset, time_t now)
Add rrset to authority section in unpacked dns_msg message.
Definition: dns.c:440
time_t prefetch_leeway
how many seconds before expiry is this prefetched (0 if not)
Definition: module.h:633
const char * local_zone_type2str(enum localzone_type t)
Print localzone type to a string.
Definition: localzone.c:1746
void dt_msg_queue_delete(struct dt_msg_queue *mq)
Delete a worker message queue.
Definition: dtstream.c:131
int dname_count_labels(uint8_t *dname)
Count the number of labels in an uncompressed dname in memory.
Definition: dname.c:431
uint16_t qflags
flags of query, for reply flags
Definition: mesh.h:254
struct entry * read_datafile(const char *name, int skip_whitespace)
reads the canned reply file and returns a list of structs does an exit on error.
Definition: testpkts.c:673
struct ub_ctx * ub_ctx_create(void)
Create a resolving and validation context.
Definition: libunbound.c:165
uint8_t enabled
is timer enabled
Definition: netevent.c:138
int sldns_wire2str_edns_llq_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS LLQ option data to string.
Definition: wire2str.c:1738
static void analyze_rr(sldns_buffer *pkt, int q)
analyze rr in packet
Definition: pktview.c:128
void alloc_stats(struct alloc_cache *alloc)
Print debug information (statistics).
Definition: alloc.c:304
int fptr_whitelist_serve_expired_lookup(serve_expired_lookup_func_type *fptr)
Check function pointer whitelist for serve_expired_lookup func values.
Definition: fptr_wlist.c:680
int fptr_whitelist_comm_timer(void(*fptr)(void *))
Check function pointer whitelist for comm_timer callback values.
Definition: fptr_wlist.c:127
struct regional * region
regional for allocation
Definition: tcp_conn_limit.h:55
int sldns_str2wire_tsigerror_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TSIGERROR from string to wireformat.
Definition: str2wire.c:1401
INLINE int sldns_buffer_status_ok(sldns_buffer *buffer)
returns true if the status of the buffer is LDNS_STATUS_OK, false otherwise
Definition: sbuffer.h:714
struct local_zone * local_zones_find(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)
Find zone that with exactly given name, class.
Definition: localzone.c:1133
size_t tag_datas_size
size of the tag_datas array
Definition: acl_list.h:105
struct key_entry_key * key_entry_create_null(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
Create a null entry, in the given region.
Definition: val_kentry.c:278
void ub_event_free(struct ub_event *ev)
free the event
Definition: ub_event_pluggable.c:575
int harden_dnssec_stripped
harden against receiving no DNSSEC data for trust anchor
Definition: config_file.h:254
void autr_debug_print(struct val_anchors *anchors)
Debug printout of rfc5011 tracked anchors.
Definition: autotrust.c:2312
int ub_cancel(struct ub_ctx *ctx, int async_id)
Cancel an async query in progress.
Definition: libunbound.c:829
int sldns_wire2str_nsec3_next_owner_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat nsec3_next_owner field to string, with user buffers.
Definition: wire2str.c:1647
int iter_msg_from_zone(struct dns_msg *msg, struct delegpt *dp, enum response_type type, uint16_t dclass)
See if a message is known to be from a certain zone.
Definition: iter_utils.c:858
static void verbose_print_addr(struct addrinfo *addr)
Debug print of the getaddrinfo returned address.
Definition: listen_dnsport.c:93
int rrsetdata_equal(struct packed_rrset_data *d1, struct packed_rrset_data *d2)
compare two rrset data structures.
Definition: packed_rrset.c:146
int tcp_mss
maximum segment size of tcp socket which queries are answered
Definition: config_file.h:101
static void usage(char *argv[])
usage information for delayer
Definition: delayer.c:143
int name_tree_next_root(rbtree_type *tree, uint16_t *dclass)
Find next root item in name tree.
Definition: dnstree.c:255
static int read_if_pending_keys(const char *file)
see if ADDPEND keys exist in autotrust file (if possible)
Definition: unbound-anchor.c:2124
int parse_packet(sldns_buffer *pkt, struct msg_parse *msg, struct regional *region)
Parse the packet.
Definition: msgparse.c:906
int sldns_wire2str_edns_subnet_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS SUBNET option data to string.
Definition: wire2str.c:1860
static int add_soa(struct rrset_cache *rrset_cache, time_t now, struct regional *region, struct dns_msg *msg, struct val_neg_zone *zone)
Add SOA record for external responses.
Definition: val_neg.c:1449
void server_stats_insquery(struct ub_server_stats *stats, struct comm_point *c, uint16_t qtype, uint16_t qclass, struct edns_data *edns, struct comm_reply *repinfo)
Add stats for this query.
Definition: stats.c:467
static int rrinternal_get_class(sldns_buffer *strbuf, char *token, size_t token_len, int *not_there, uint16_t *cl)
read class
Definition: str2wire.c:271
void local_zone_delete(struct local_zone *z)
Delete one zone.
Definition: localzone.c:93
static int infra_ratelimit_cfg_insert(struct infra_cache *infra, struct config_file *cfg)
insert rate limit configuration into lookup tree
Definition: infra.c:200
void log_edns_known_options(enum verbosity_value level, struct module_env *env)
Log the known edns options.
Definition: module.c:220
int sldns_wire2str_rdata_buf(uint8_t *rdata, size_t rdata_len, char *str, size_t str_len, uint16_t rrtype)
Convert RDATA to string presentation format, on one line.
Definition: wire2str.c:265
static void do_view_data_remove(RES *ssl, struct worker *worker, char *arg)
Remove RR data from view.
Definition: remote.c:1486
int chase_to_rd
true if we set RD bit because of last resort recursion lame query
Definition: iterator.h:276
int modstack_find(struct module_stack *stack, const char *name)
Find index of module by name.
Definition: modstack.c:261
struct ub_result * res
result structure, also contains original query, type, class.
Definition: context.h:176
void iter_store_parentside_neg(struct module_env *env, struct query_info *qinfo, struct reply_info *rep)
Store parent-side negative element, the parentside rrset does not exist, creates an rrset with empty ...
Definition: iter_utils.c:1107
int dname_buffer_write(struct sldns_buffer *pkt, uint8_t *dname)
Copy over a valid dname to a packet.
Definition: dname.c:620
void comm_point_tcp_accept_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:918
size_t size
sum of RR rdata sizes
Definition: msgparse.h:165
static void dt_msg_queue_clear(struct dt_msg_queue *mq)
clear the message list, caller must hold the lock
Definition: dtstream.c:116
static int rrset_belongs_in_reply(sldns_pkt_section s, uint16_t rrtype, uint16_t qtype, int dnssec)
Returns true if RR type should be included.
Definition: msgencode.c:421
uint8_t * name
domain name
Definition: authzone.h:155
rbtree_type tree
Tree of the address spans that are blocked.
Definition: iter_donotq.h:61
int ub_ctx_set_event(struct ub_ctx *ctx, struct event_base *base)
Set a new libevent event_base on a context created with ub_ctx_create_event.
Definition: libunbound.c:1386
enum sec_status dnskey_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t dnskey_idx, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset against one specific dnskey (from rrset)
Definition: val_sigcrypt.c:555
const char * flags
additional flags or ""
Definition: unitauth.c:62
rbnode_type * rbtree_insert(rbtree_type *rbtree, rbnode_type *data)
Insert data into the tree.
Definition: rbtree.c:228
void comm_point_tcp_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:1768
INLINE void sldns_buffer_write_string(sldns_buffer *buffer, const char *str)
copies the given (null-delimited) string to the current position at the buffer
Definition: sbuffer.h:487
rbnode_type node
rbtree node, key is name and class
Definition: localzone.h:120
struct ub_packed_rrset_key * data
"local data" for this node
Definition: respip.h:45
void * buf
the buffer with the data to send, an encoded DNSTAP message
Definition: dtstream.h:86
void get_cname_target(struct ub_packed_rrset_key *rrset, uint8_t **dname, size_t *dname_len)
Utility procedure to extract CNAME target name from its rdata.
Definition: packed_rrset.c:196
int iter_dp_is_useless(struct query_info *qinfo, uint16_t qflags, struct delegpt *dp)
See if delegation is useful or offers immediately no targets for further recursion.
Definition: iter_utils.c:741
int used
has the address been used
Definition: unbound-anchor.c:170
void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size)
creates a buffer with the specified data.
Definition: sbuffer.c:44
INLINE void sldns_buffer_write_u8_at(sldns_buffer *buffer, size_t at, uint8_t data)
writes the given byte of data at the given position in the buffer
Definition: sbuffer.h:499
static struct val_neg_data * neg_data_chain(uint8_t *nm, size_t nm_len, int labs, struct val_neg_data *parent)
Create chain of data element and parents.
Definition: val_neg.c:629
struct auth_master * masters
list of upstream masters for this zone, from config
Definition: authzone.h:316
size_t numsent
number of queries sent to server (in total)
Definition: delayer.c:88
uint8_t * dname
the domain name for this node.
Definition: msgencode.c:86
void forwards_delete_stub_hole(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Remove stub hole, if one exists.
Definition: iter_fwd.c:507
static void rpz_remove_qname_trigger(struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen)
Remove RR from RPZ's local-zone.
Definition: rpz.c:820
static int tcp_relay_write(int s, struct tcp_send_list **first, struct tcp_send_list **last, struct timeval *now)
relay TCP, write a part
Definition: delayer.c:695
struct ub_packed_rrset_key * packed_rrset_copy_region(struct ub_packed_rrset_key *key, struct regional *region, time_t now)
Allocate rrset in region - no more locks needed.
Definition: packed_rrset.c:326
double timehist_quartile(struct timehist *hist, double q)
Find time value for given quartile, such as 0.25, 0.50, 0.75.
Definition: timehist.c:198
static int priv_lookup_name(struct iter_priv *priv, sldns_buffer *pkt, uint8_t *name, size_t name_len, uint16_t dclass)
See if a name is whitelisted.
Definition: iter_priv.c:190
The NSEC3 hash result storage.
Definition: val_nsec3.h:228
int nsec_proves_nodata(struct ub_packed_rrset_key *nsec, struct query_info *qinfo, uint8_t **wc)
Determine if a NSEC proves the NOERROR/NODATA conditions.
Definition: val_nsec.c:289
int edns_version
edns version that the host supports, -1 means no EDNS
Definition: infra.h:85
size_t rrset_skip
The cname skip value; the number of rrsets that have been skipped due to chasing cnames.
Definition: validator.h:190
int dynlibmod_init(struct module_env *env, int id)
dynlib module init
Definition: dynlibmod.c:73
void rtt_lost(struct rtt_info *rtt, int orig)
Update the statistics with a new timeout expired observation.
Definition: rtt.c:100
int thr
the thread id that created it
Definition: unbound-dnstap-socket.c:1563
@ rrset_trust_prim_noglue
Data from a primary zone file, other than glue data.
Definition: packed_rrset.h:164
static void perfselect(struct perfinfo *info)
wait for new events for performance test
Definition: perf.c:360
size_t maxsize
the maximum size of the buffer, in bytes
Definition: dtstream.h:67
int ub_ctx_hosts(struct ub_ctx *ctx, const char *fname)
Read list of hosts from the filename given.
Definition: libunbound.c:1158
int extstrtoaddr(const char *str, struct sockaddr_storage *addr, socklen_t *addrlen)
Convert address string, with "@port" appendix, to sockaddr.
Definition: net_help.c:224
void config_apply(struct config_file *config)
Apply config to global constants; this routine is called in single thread.
Definition: config_file.c:2029
int sldns_wire2str_type_print(char **s, size_t *slen, uint16_t rrtype)
Print host format rr type to string.
Definition: wire2str.c:890
void unit_show_func(const char *file, const char *func)
we are now testing this function
Definition: unitmain.c:842
static void check_az_q_ans(struct auth_zones *az, struct q_ans *queries)
check queries on a loaded zone
Definition: unitauth.c:818
char * value
the variable value
Definition: replay.h:403
char * fstrm_describe_control(void *pkt, size_t len)
Return string that describes a control packet.
Definition: dnstap_fstrm.c:173
struct outbound_entry * libworker_send_query(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q)
Worker service routine to send serviced queries to authoritative servers.
Definition: libworker.c:853
static void check_the_rrsigs(struct query_info *qinfo, struct reply_info *rep)
check RRSIGs in packet
Definition: unitmsgparse.c:293
int started
if the io processing has started
Definition: dtstream.h:130
struct edns_option * edns_opts_front_in
incoming edns options from the front end
Definition: module.h:638
size_t infra_get_mem(struct infra_cache *infra)
Get memory used by the infra cache.
Definition: infra.c:997
static void detach(void)
detach from command line
Definition: unbound.c:382
void pythonmod_deinit(struct module_env *env, int id)
python module deinit
Definition: pythonmod.c:439
void dname_str(uint8_t *dname, char *str)
Debug helper.
Definition: dname.c:639
int rc_port
port number for remote that has ports opened.
Definition: daemon.h:93
int sldns_str2wire_loc_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_LOC from string to wireformat.
Definition: str2wire.c:1524
Containing buffer and counter for reading DNSTAP frames.
Definition: dtstream.h:94
int sldns_wire2str_class_print(char **s, size_t *slen, uint16_t rrclass)
Print host format rr class to string.
Definition: wire2str.c:880
struct regional * regional_create(void)
Create a new regional.
Definition: regional.c:66
void ub_thr_fork_wait(ub_thread_type thread)
There is no threading.
Definition: locks.c:134
static void reverse(char *begin, char *end)
Reverses a string.
Definition: dns64.c:159
void * cb_arg
user arg for callback
Definition: mesh.h:262
size_t rate_sizefunc(void *k, void *d)
calculate size for the hashtable
void alloc_init(struct alloc_cache *alloc, struct alloc_cache *super, int thread_num)
Init alloc (zeroes the struct).
Definition: alloc.c:103
@ VAL_VALIDATE_STATE
validate the answer, using found key entry
Definition: validator.h:137
void log_ident_revert_to_default(void)
Revert identity to print, back to the recorded default value.
Definition: log.c:190
uint8_t match_rcode
match rcode with answer rcode
Definition: testpkts.h:176
struct comm_reply repinfo
reply information
Definition: replay.h:370
size_t dnsc_nonces_sizefunc(void *k, void *ATTR_UNUSED(d))
Definition: dnscrypt.c:1069
void view_delete(struct view *v)
Delete one view.
Definition: view.c:74
void rrset_cache_delete(struct rrset_cache *r)
Delete rrset cache.
Definition: rrset.c:73
size_t unwanted_total
cumulative total of unwanted replies (for defense)
Definition: outside_network.h:92
void comm_point_start_listening(struct comm_point *c, int newfd, int msec)
Start listening again for input on the comm point.
Definition: netevent.c:3204
static void do_zone_add(RES *ssl, struct local_zones *zones, char *arg)
Do the local_zone command.
Definition: remote.c:1224
struct config_file * config_create(void)
Create config file structure.
Definition: config_file.c:89
static void check_neg_invariants(struct val_neg_cache *neg)
check if negative cache is still valid
Definition: unitneg.c:472
int wait_priming_stub
This is flag that, if true, means that this event is waiting for a stub priming query.
Definition: iterator.h:366
int hints_next_root(struct iter_hints *hints, uint16_t *qclass)
Find next root hints (to cycle through all root hints).
Definition: iter_hints.c:508
alloc_special_type * quar
singly linked lists of special type.
Definition: alloc.h:78
static struct view * views_enter_view_name(struct views *vs, char *name)
enter a new view returns with WRlock
Definition: view.c:121
int tcl_list_apply_cfg(struct tcl_list *tcl, struct config_file *cfg)
Process TCP connection limit config.
Definition: tcp_conn_limit.c:144
int cfg_mark_ports(const char *str, int allow, int *avail, int num)
Mark "number" or "low-high" as available or not in ports array.
Definition: config_file.c:1545
int edns_lame_known
do we know edns probe status already, for UDP_EDNS queries
Definition: outside_network.h:386
static void reclaim_tcp_handler(struct comm_point *c)
Make tcp handler free for next assignment.
Definition: netevent.c:974
Outgoing commpoint for UDP port.
Definition: outside_network.h:199
ssize_t sldns_bget_token_par(struct sldns_buffer *b, char *token, const char *delim, size_t limit, int *par, const char *skipw)
returns a token/char from the buffer b.
Definition: parse.c:244
static void callback_list_remove(struct serviced_query *sq, void *cb_arg)
remove callback from list
Definition: outside_network.c:2163
int edns_register_option(uint16_t opt_code, int bypass_cache_stage, int no_aggregation, struct module_env *env)
Register a known edns option.
Definition: module.c:93
static void verifytest_entry(struct entry *e, struct alloc_cache *alloc, struct regional *region, sldns_buffer *pkt, struct ub_packed_rrset_key *dnskey, struct module_env *env, struct val_env *ve)
verify and test an entry - every rr in the message
Definition: unitverify.c:205
static void answer_check_it(struct replay_runtime *runtime)
Check the now moment answer check event.
Definition: fake_event.c:404
struct rrset_parse * rrset_first
linked list of rrsets that have been found (in order).
Definition: msgparse.h:133
alloc_special_type * alloc_special_obtain(struct alloc_cache *alloc)
Get a new special_type element.
Definition: alloc.c:214
int sldns_str2wire_str_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_STR from string to wireformat.
Definition: str2wire.c:1093
rbnode_type * parent
parent in rbtree, RBTREE_NULL for root
Definition: rbtree.h:57
int main(int argc, char **argv)
main program for delayer
Definition: delayer.c:1129
int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_type fptr)
Check function pointer whitelist for lruhash markdel callback values.
Definition: fptr_wlist.c:322
void worker_probe_timer_cb(void *arg)
probe timer callback handler
Definition: worker.c:1687
void respip_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
response-ip operate on a query
Definition: respip.c:1077
int ub_ctx_zone_remove(struct ub_ctx *ctx, const char *zone_name)
Remove zone from local authority info of the library.
Definition: libunbound.c:1326
int autr_process_prime(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset, struct module_qstate *qstate)
Perform autotrust processing.
Definition: autotrust.c:2141
Auth data.
Definition: authzone.h:151
void forwards_delete(struct iter_forwards *fwd)
Delete forwards.
Definition: iter_fwd.c:99
int num_current_queries
outstanding direct queries
Definition: iterator.h:301
struct delegpt * forwards_find(struct iter_forwards *fwd, uint8_t *qname, uint16_t qclass)
Find forward zone exactly by name.
Definition: iter_fwd.c:342
int tcp_is_reading
Read/Write state for TCP.
Definition: netevent.h:170
struct dt_io_thread * dt_io_thread_create(void)
Create IO thread.
Definition: dtstream.c:228
struct listen_dnsport * front
the frontside listening interface where request events come in
Definition: worker.h:94
int num_out_ifs
number of outgoing interfaces to open.
Definition: config_file.h:203
char * pidfile
pidfile to write pid to.
Definition: config_file.h:293
int tube_read_fd(struct tube *tube)
Get FD that is readable when new information arrives.
Definition: tube.c:423
rbtree_type * smaller
set of all locks that are smaller than this one (locked earlier)
Definition: lock_verify.c:79
int(* add_timer)(struct ub_event *, struct ub_event_base *, void(*cb)(int, short, void *), void *arg, struct timeval *)
Reconfigure and activate a timeout event.
Definition: unbound-event.h:142
int auth_zone_parse_notify_serial(struct sldns_buffer *pkt, uint32_t *serial)
process notify packet and read serial number from SOA.
Definition: authzone.c:3410
static void do_data_remove(RES *ssl, struct local_zones *zones, char *arg)
Do the local_data_remove command.
Definition: remote.c:1355
struct replay_runtime * runtime
the runtime structure this is part of
Definition: replay.h:360
List of string, bytestring for config options.
Definition: config_file.h:758
#define S_YNO(str, var)
put yesno into variable
Definition: config_file.c:412
@ SKIP_MINIMISE_STATE
Don't increment QNAME this iteration.
Definition: iterator.h:160
static void validate_referral_response(struct reply_info *chase_reply)
Given a referral response, validate rrsets and take least trusted rrset as the current validation sta...
Definition: validator.c:1083
static int ah(struct delegpt *dp, const char *sv, const char *ip)
add hint to delegation hints
Definition: iter_hints.c:92
int labs
labels
Definition: remote.c:1605
@ local_zone_always_transparent
resolve normally, even when there is local data
Definition: localzone.h:90
Data items representing the result of response-ip processing.
Definition: respip.h:80
int respip_init(struct module_env *env, int id)
response-ip init
Definition: respip.c:550
list of addresses
Definition: authzone.h:422
uint16_t rrset_class
class, network order.
Definition: msgparse.h:159
int probetree_cmp(const void *x, const void *y)
probe tree compare function
Definition: autotrust.c:92
static int dl_tv_smaller(struct timeval *t1, const struct timeval *t2)
timeval compare, t1 < t2
Definition: delayer.c:158
long long unwanted_queries
unwanted traffic received on client-facing ports
Definition: unbound.h:737
int isprime
if stub-prime is set
Definition: config_file.h:642
struct sock_list * blacklist
IP blacklist for queries.
Definition: module.h:616
int infra_compfunc(void *key1, void *key2)
compare two addresses, returns -1, 0, or +1
Definition: infra.c:79
static int check_nosameness
do not check buffer sameness
Definition: unitmsgparse.c:67
int host_ttl
TTL value for host information, in seconds.
Definition: infra.h:116
#define MAX_KNOWN_EDNS_OPTS
Maximum number of known edns options.
Definition: module.h:188
static void dname_test_subdomain(void)
test dname_subdomain_c
Definition: unitdname.c:374
int sldns_wire2str_rrquestion_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat question rr to string, with user buffers.
Definition: wire2str.c:523
static void bogus_del_rrset(struct lruhash_entry *e, void *arg)
callback to delete bogus rrsets
Definition: remote.c:1775
struct lruhash_entry entry
the hash table entry, data is struct reply_info*
Definition: msgreply.h:221
ub_thread_type id
id
Definition: unitlruhash.c:425
uint32_t sldns_str2period(const char *nptr, const char **endptr)
converts a ttl value (like 5d2h) to a long.
Definition: parseutil.c:212
int respip_merge_cname(struct reply_info *base_rep, const struct query_info *qinfo, const struct reply_info *tgt_rep, const struct respip_client_info *cinfo, int must_validate, struct reply_info **new_repp, struct regional *region, struct auth_zones *az)
Merge two replies to build a complete CNAME chain.
Definition: respip.c:1162
struct config_parser_state * cfg_parser
global config parser object used during config parsing
Definition: config_file.c:83
#define NSEC3_HASH_SHA1
The SHA1 hash algorithm for NSEC3.
Definition: val_nsec3.h:98
static void domain_limit_free(rbnode_type *n, void *ATTR_UNUSED(arg))
delete domain_limit entries
Definition: infra.c:273
size_t namelen
length of name
Definition: authzone.h:157
long long qEDNS
number of queries with EDNS OPT record
Definition: unbound.h:719
void libworker_event_done_cb(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with event results
Definition: libworker.c:637
struct local_zone * local_zones_add_zone(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, enum localzone_type tp)
Add a new zone.
Definition: localzone.c:1835
static void stress_test(struct val_neg_cache *neg)
perform stress test on insert and delete in neg cache
Definition: unitneg.c:502
struct daemon * daemon_init(void)
Initialize daemon structure.
Definition: daemon.c:194
struct fake_timer * timer_list
list of fake timer callbacks that are pending
Definition: replay.h:291
int tube_setup_bg_write(struct tube *tube, struct comm_base *base)
Start background write handler for the pipe.
Definition: tube.c:443
int sldns_fp2wire_rr_buf(FILE *in, uint8_t *rr, size_t *len, size_t *dname_len, struct sldns_file_parse_state *parse_state)
Read one RR from zonefile with buffer for the data.
Definition: str2wire.c:861
static uint8_t * get_qname(uint8_t *pkt, size_t pktlen)
returns owner from packet
Definition: testpkts.c:740
static const char * get_builtin_cert(void)
return the built in root update certificate
Definition: unbound-anchor.c:214
int sldns_wire2str_long_str_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat long_str field to string, with user buffers.
Definition: wire2str.c:1710
struct sockaddr_storage addr
IP address.
Definition: authzone.h:426
struct infra_cache * infra_create(struct config_file *cfg)
Create infra cache.
Definition: infra.c:233
int val_rrset_wildcard(struct ub_packed_rrset_key *rrset, uint8_t **wc, size_t *wc_len)
Determine by looking at a signed RRset whether or not the RRset name was the result of a wildcard exp...
Definition: val_utils.c:770
void forwards_delete_zone(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Remove zone from forward structure.
Definition: iter_fwd.c:486
static void random_burden(void)
randomly allocate stuff
Definition: unitregional.c:235
static void state_list_remove_elem(struct rc_state **list, struct comm_point *c)
delete from list
Definition: remote.c:528
static void delkey(struct slabhash_testkey *k)
delete key
Definition: slabhash.c:186
struct module_func_block * pythonmod_get_funcblock(void)
Get the module function block.
Definition: pythonmod.c:587
long long unwanted_replies
unwanted traffic received on server-facing ports
Definition: unbound.h:735
int permit_small_holddown
permit small holddown values, allowing 5011 rollover very fast
Definition: config_file.h:385
static void handle_cancel(struct libworker *w, uint8_t *buf, uint32_t len)
handle cancel command for bg worker
Definition: libworker.c:274
void daemon_remote_delete(struct daemon_remote *rc)
remote control state to delete.
Definition: remote.c:253
static size_t rrset_get_count(struct ub_packed_rrset_key *rrset)
return number of rrs in an rrset
Definition: unitverify.c:149
static void dl_tv_add(struct timeval *t1, const struct timeval *t2)
timeval add, t1 += t2
Definition: delayer.c:172
static void autr_cleanup_keys(struct trust_anchor *tp)
cleanup key list
Definition: autotrust.c:1970
void void void log_warn(const char *format,...) ATTR_FORMAT(printf
Log warning message.
struct ub_packed_rrset_key * ipseckey_rrset
Pointer to IPSECKEY rrset allocated in the qstate region.
Definition: ipsecmod.h:71
size_t numrecv
number of queries received in that time
Definition: perf.c:91
int sldns_wire2str_int8_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat int8 field to string, with user buffers.
Definition: wire2str.c:1027
static void store_rrsets(struct module_env *env, struct reply_info *rep, time_t now, time_t leeway, int pside, struct reply_info *qrep, struct regional *region)
store rrsets in the rrset cache.
Definition: dns.c:73
size_t listen_get_mem(struct listen_dnsport *listen)
get memory size used by the listening structs
Definition: listen_dnsport.c:1552
uint8_t * signer_name
signer name
Definition: validator.h:214
void slabhash_status(struct slabhash *table, const char *id, int extended)
Output debug info to the log as to state of the hash table.
Definition: slabhash.c:133
struct config_strlist * cfg_strlist_find(struct config_strlist *head, const char *item)
Find string in strlist.
Definition: config_file.c:1690
static void do_forward_remove(RES *ssl, struct worker *worker, char *args)
do the forward_remove command
Definition: remote.c:2160
int dnstap_log_resolver_query_messages
true to log dnstap RESOLVER_QUERY message events
Definition: config_file.h:510
int sldns_str2wire_rr_buf(const char *str, uint8_t *rr, size_t *len, size_t *dname_len, uint32_t default_ttl, uint8_t *origin, size_t origin_len, uint8_t *prev, size_t prev_len)
Convert text RR to wireformat, with user buffer.
Definition: str2wire.c:782
int dname_strict_subdomain_c(uint8_t *d1, uint8_t *d2)
Like dname_strict_subdomain but counts labels.
Definition: dname.c:693
int local_rrset_remove_rr(struct packed_rrset_data *pd, size_t index)
Delete RR from local-zone RRset, wastes memory as the deleted RRs cannot be free'd (regionally alloc'...
Definition: localzone.c:400
#define MAX_DP_TARGET_COUNT
max number of target lookups per qstate, per delegation point
Definition: iterator.h:59
void delegpt_count_ns(struct delegpt *dp, size_t *numns, size_t *missing)
count NS and number missing for logging
Definition: iter_delegpt.c:227
static SERVICE_STATUS service_status
global service status
Definition: win_svc.c:58
void key_cache_remove(struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class)
Remove an entry from the key cache.
Definition: val_kcache.c:162
static int is_bind_special(int c)
true for special characters in bind configs
Definition: val_anchor.c:497
static int write_http_get(SSL *ssl, const char *pathname, const char *urlname)
start HTTP1.1 transaction on SSL
Definition: unbound-anchor.c:1053
size_t namelen
length of name
Definition: infra.h:149
List of done items in TCP channel.
Definition: listen_dnsport.h:290
char * name
view name
Definition: config_file.h:698
struct serve_expired_data * serve_expired_data
serve expired data
Definition: module.h:635
Outbound list entry.
Definition: outbound_list.h:61
int val_init(struct module_env *env, int id)
validator init
Definition: validator.c:168
#define P7SIGNER
name of the signer of the certificate
Definition: unbound-anchor.c:149
hashvalue_type hash
hash value of rrset
Definition: msgparse.h:147
enum sec_status val_verify_rrset_entry(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct key_entry_key *kkey, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify RRset with keys from a keyset.
Definition: val_utils.c:393
sldns_enum_directive
different type of directives in zone files We now deal with $TTL, $ORIGIN and $INCLUDE.
Definition: parse.h:39
int(* init)(struct module_env *, struct cachedb_env *)
Init(env, cachedb_env): false on setup failure.
Definition: cachedb.h:76
int auth_zone_set_zonefile(struct auth_zone *z, char *zonefile)
set auth zone zonefile string.
Definition: authzone.c:555
time_t MAX_TTL
Maximum TTL that is allowed.
Definition: msgreply.c:59
static void do_auth_zone_reload(RES *ssl, struct worker *worker, char *arg)
do the auth_zone_reload command
Definition: remote.c:2511
#define HASHTESTMAX
number of hash test max
Definition: unitslabhash.c:105
static void do_stop(RES *ssl, struct worker *worker)
do the stop command
Definition: remote.c:678
int num_ifs
number of interfaces to open.
Definition: config_file.h:197
size_t trust_anchor_len
trust anchor length
Definition: validator.h:197
struct config_str2list * ratelimit_below_domain
ratelimits below domain
Definition: config_file.h:543
static void read_input(sldns_buffer *pkt, FILE *in)
read hex input
Definition: pktview.c:60
int ub_ctx_set_stub(struct ub_ctx *ctx, const char *zone, const char *addr, int isprime)
Add a stub zone, with given address to send to.
Definition: libunbound.c:990
Stub config options.
Definition: config_file.h:632
#define RATE_WINDOW
number of seconds to track qps rate
Definition: infra.h:168
addrlen_t scope
Number of significant bits in address.
Definition: addrtree.h:97
static void print_exit(const char *str)
fatal exit
Definition: petal.c:91
void msgparse_bucket_remove(struct msg_parse *msg, struct rrset_parse *rrset)
Remove rrset from hash table.
Definition: msgparse.c:265
static int pick_outgoing_tcp(struct waiting_tcp *w, int s)
Pick random outgoing-interface of that family, and bind it.
Definition: outside_network.c:155
struct ctx_query * context_new(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, ub_callback_type cb, ub_event_callback_type cb_event, void *cbarg)
Create new query in context, add to querynum list.
Definition: context.c:139
void ub_packed_rrset_parsedelete(struct ub_packed_rrset_key *pkey, struct alloc_cache *alloc)
Delete packed rrset key and data, not entered in hashtables yet.
Definition: packed_rrset.c:56
rbnode_type node
rbtree node, key is name and class
Definition: authzone.h:98
void ub_ctx_delete(struct ub_ctx *ctx)
Destroy a validation context and free all its resources.
Definition: libunbound.c:284
void errinf_origin(struct module_qstate *qstate, struct sock_list *origin)
Append text to error info: from 1.2.3.4.
Definition: config_file.c:2404
int ub_ctx_async(struct ub_ctx *ctx, int dothread)
Set a context behaviour for asynchronous action.
Definition: libunbound.c:487
size_t zonelen
length of zone name
Definition: replay.h:338
struct replay_answer * next
Next in list.
Definition: replay.h:368
@ LDNS_RR_TYPE_ATMA
http://www.jhsoft.com/rfc/af-saa-0069.000.rtf
Definition: rrdef.h:151
struct auth_zone * rpz_az_prev
previous auth zone containing RPZ data, or NULL
Definition: authzone.h:145
size_t namelen
length of zone name
Definition: authzone.h:103
static int process_answer(struct ub_ctx *ctx, uint8_t *msg, uint32_t len)
process answer from bg worker
Definition: libunbound.c:583
struct resp_addr * respip_sockaddr_find_or_create(struct respip_set *set, struct sockaddr_storage *addr, socklen_t addrlen, int net, int create, const char *ipstr)
Find resp_addr in tree, create and add to tree if it does not exist.
Definition: respip.c:103
structure to threaded test the lru hash table
Definition: unitlruhash.c:421
void ub_winsock_tcp_wouldblock(struct ub_event *ev, int eventbits)
Signal the eventloop when a TCP windows socket will block on next read or write (given by the eventbi...
Definition: ub_event.c:438
int forwards_add_stub_hole(struct iter_forwards *fwd, uint16_t c, uint8_t *nm)
Add stub hole (empty entry in forward table, that makes resolution skip a forward-zone because the st...
Definition: iter_fwd.c:497
static void localzonechecks(struct config_file *cfg)
check localzones
Definition: unbound-checkconf.c:188
struct msgreply_entry * msg_cache_lookup(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, time_t now, int wr)
lookup message in message cache
Definition: dns.c:240
double mesh_time_median
mesh stats: median of waiting times for replies (in sec)
Definition: unbound.h:818
struct config_strlist_head control_ifs
the interfaces the remote control should listen on
Definition: config_file.h:436
void dns64_deinit(struct module_env *env, int id)
Deinitializes this instance of the dns64 module.
Definition: dns64.c:431
void auth_xfer_timer(void *arg)
xfer nextprobe timeout callback, this is part of task_nextprobe
Definition: authzone.c:6480
time_t expired
time to invalidate to
Definition: remote.c:1607
void listen_stop_accept(struct listen_dnsport *listen)
stop accept handlers for TCP (until enabled again)
Definition: listen_dnsport.c:1571
struct ctx_query * context_deserialize_cancel(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Deserialize a cancel buffer.
Definition: context.c:388
char * ssl_service_pem
public key file for dnstcp-ssl service
Definition: config_file.h:114
int rrset_canonical_equal(struct regional *region, struct ub_packed_rrset_key *k1, struct ub_packed_rrset_key *k2)
Compare two rrsets and see if they are the same, canonicalised.
Definition: val_sigcrypt.c:1053
Timers with callbacks, fake replay version.
Definition: replay.h:379
void log_init(const char *filename, int use_syslog, const char *chrootdir)
call this to initialize logging services.
Definition: log.c:86
struct local_zones * local_zones
view specific local authority zones
Definition: view.h:74
int delegpt_set_name_mlc(struct delegpt *dp, uint8_t *name)
Set name of delegation point.
Definition: iter_delegpt.c:571
int type_udp_out
if this is a udp outgoing type of commpoint
Definition: fake_event.c:77
INLINE void sldns_buffer_write_string_at(sldns_buffer *buffer, size_t at, const char *str)
copies the given (null-delimited) string to the specified position at the buffer
Definition: sbuffer.h:476
rbnode_type node
rbtree node
Definition: memstats.c:54
static int final_state(struct iter_qstate *iq)
Transition an event to its final state.
Definition: iterator.c:213
#define FSTRM_CONTROL_FRAME_STOP
control frame value to denote the control frame STOP
Definition: dnstap_fstrm.h:104
void worker_stat_timer_cb(void *arg)
statistics timer callback handler
Definition: worker.c:1670
void listening_ports_free(struct listen_port *list)
Close and delete the (list of) listening ports.
Definition: fake_event.c:1299
#define TCP_BACKLOG
number of queued TCP connections for listen()
Definition: listen_dnsport.c:74
sldns_enum_hash
Hashing algorithms used in the DS record.
Definition: rrdef.h:389
int auth_zone_set_fallback(struct auth_zone *z, char *fallbackstr)
set auth zone fallback.
Definition: authzone.c:572
static struct dns_msg * neg_nsec3_proof_ds(struct val_neg_zone *zone, uint8_t *qname, size_t qname_len, int qlabs, sldns_buffer *buf, struct rrset_cache *rrset_cache, struct regional *region, time_t now, uint8_t *topname)
neg cache nsec3 proof procedure
Definition: val_neg.c:1349
struct dt_msg_entry * first
list of messages.
Definition: dtstream.h:73
static int calc_rto(const struct rtt_info *rtt)
calculate RTO from rtt information
Definition: rtt.c:50
static void xfr_transfer_nexttarget_or_end(struct auth_xfer *xfr, struct module_env *env)
perform next lookup, next transfer TCP, or end and resume wait time task
Definition: authzone.c:5239
int ub_ctx_set_stub(struct ub_ctx *ctx, const char *zone, const char *addr, int isprime)
Add a stub zone, with given address to send to.
Definition: libunbound.c:990
size_t test_slabhash_sizefunc(void *, void *)
test sizefunc for lruhash
void alloc_clear(struct alloc_cache *alloc)
Free the alloc.
Definition: alloc.c:160
Client-specific attributes that can affect IP-based actions.
Definition: respip.h:64
struct timeval start_time
the time when request was entered
Definition: mesh.h:224
rbtree_type * tree
Anchors are store in this tree.
Definition: val_anchor.h:69
int sldns_wire2str_time_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat time field to string, with user buffers.
Definition: wire2str.c:1347
@ VAL_CLASS_CNAME
A positive response, with a CNAME/DNAME chain.
Definition: val_utils.h:69
size_t total_sent
total number sent
Definition: perf.c:105
struct config_strbytelist * respip_tags
list of IP-netblock, tagbitlist
Definition: config_file.h:423
void server_stats_obtain(struct worker *worker, struct worker *who, struct ub_stats_info *s, int reset)
Obtain the stats info for a given thread.
Definition: stats.c:361
@ FINISHED_STATE
Responses that are to be returned upstream end at this state.
Definition: iterator.h:216
struct key_entry_key * key_entry_create_null(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
Create a null entry, in the given region.
Definition: val_kentry.c:278
struct for user arg ratelimit list
Definition: remote.c:2783
struct replay_moment * mom_last
The last element in list of replay moments.
Definition: replay.h:162
struct config_strlist * addrs
list of stub nameserver addresses (IP address)
Definition: config_file.h:640
struct config_strlist * donotqueryaddrs
list of donotquery addresses, linked list
Definition: config_file.h:218
The negative cache.
Definition: val_neg.h:67
int infra_set_lame(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen, time_t timenow, int dnsseclame, int reclame, uint16_t qtype)
Set a host to be lame for the given zone.
Definition: infra.c:506
int namelabs
number of labels in zone name
Definition: authzone.h:105
struct dns_msg * return_msg
the reply message, with message for client and calling module
Definition: module.h:610
static void usage(void)
Give unbound-control usage, and exit (1).
Definition: unbound-control.c:81
module_ext_state
External visible states of the module state machine Modules may also have an internal state.
Definition: module.h:533
static void change_section(struct msg_parse *msg, struct rrset_parse *rrset, sldns_pkt_section section)
change section of rrset from previous to current section
Definition: msgparse.c:280
struct ub_packed_rrset_key * rrset
rrset the RR is in
Definition: val_sigcrypt.c:642
void comm_timer_delete(struct comm_timer *timer)
delete timer.
Definition: netevent.c:3333
static void service_start(const char *cfgfile, int v, int c)
start the service
Definition: win_svc.c:474
void comm_point_local_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:2484
struct pending_tcp * tcp_free
list of tcp comm points that are free for use
Definition: outside_network.h:158
size_t ans_secure
(extended stats) secure replies
Definition: mesh.h:124
struct iter_forwards * fwds
Mapping of forwarding zones to targets.
Definition: module.h:501
static void do_stub_add(RES *ssl, struct worker *worker, char *args)
do the stub_add command
Definition: remote.c:2177
void testbound_selftest(void)
testbounds self test
Definition: replay.c:936
static void service_send(struct ringbuf *ring, struct timeval *now, sldns_buffer *pkt, struct sockaddr_storage *srv_addr, socklen_t srv_len)
send out waiting packets
Definition: delayer.c:356
static int local_zone_does_not_cover(struct local_zone *z, struct query_info *qinfo, int labs)
See if the local zone does not cover the name, eg.
Definition: localzone.c:1492
struct replay_moment * mom_first
The list of replay moments.
Definition: replay.h:160
static enum sec_status nsec3_prove_closest_encloser(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, struct query_info *qinfo, int prove_does_not_exist, struct ce_response *ce)
proveClosestEncloser Given a List of nsec3 RRs, find and prove the closest encloser to qname.
Definition: val_nsec3.c:942
struct addr_tree_node node
node in addrtree
Definition: localzone.h:192
struct sldns_buffer * buffer
what is important only that we remember the query, copied here.
Definition: replay.h:330
size_t count
The number of the nodes in the tree.
Definition: rbtree.h:81
struct dns_msg * orig_msg
The original message we have been given to validate.
Definition: validator.h:156
int macro_assign(rbtree_type *store, char *name, char *value)
Set macro value.
Definition: replay.c:909
int sldns_wire2str_rr_unknown_buf(uint8_t *rr, size_t rr_len, char *str, size_t str_len)
3597 printout of an RR in unknown rr format.
Definition: wire2str.c:273
static int process_bind_contents(struct val_anchors *anchors, sldns_buffer *buf, int *line, FILE *in)
read contents of trusted-keys{ ...
Definition: val_anchor.c:636
static const char * ident
the identity of this executable/process
Definition: log.c:76
int str_is_ip6(const char *str)
callback TLS session ticket encrypt and decrypt For use with SSL_CTX_set_tlsext_ticket_key_cb or SSL_...
Definition: net_help.c:113
struct delegpt * dp
This is the current delegation point for an in-progress query.
Definition: iterator.h:283
void server_stats_insquery(struct ub_server_stats *stats, struct comm_point *c, uint16_t qtype, uint16_t qclass, struct edns_data *edns, struct comm_reply *repinfo)
Add stats for this query.
Definition: stats.c:467
void timehist_log(struct timehist *hist, const char *name)
Log histogram, print it to the logfile.
Definition: timehist.c:164
size_t delegpt_get_mem(struct delegpt *dp)
get memory in use by dp
Definition: iter_delegpt.c:669
INLINE size_t sldns_buffer_limit(sldns_buffer *buffer)
returns the maximum size of the buffer
Definition: sbuffer.h:271
int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_type fptr)
Check function pointer whitelist for lruhash deldata callback values.
Definition: fptr_wlist.c:303
static int pending_matches_current(struct replay_runtime *runtime, struct entry **entry, struct fake_pending **pend)
return: true if pending query matches the now event.
Definition: fake_event.c:202
int mesh_make_new_space(struct mesh_area *mesh, struct sldns_buffer *qbuf)
Make space for another recursion state for a reply in the mesh.
Definition: mesh.c:323
int fptr_whitelist_modenv_kill_sub(void(*fptr)(struct module_qstate *newq))
Check function pointer whitelist for module_env kill_sub callback values.
Definition: fptr_wlist.c:373
int ub_timer_add(struct ub_event *ev, struct ub_event_base *base, void(*cb)(int, short, void *), void *arg, struct timeval *tv)
Reconfigure and activate a timeout event.
Definition: ub_event_pluggable.c:607
void log_crypto_err(const char *str)
Log libcrypto error with descriptive string.
Definition: net_help.c:834
static int rrset_parse_equals(struct rrset_parse *p, sldns_buffer *pkt, hashvalue_type h, uint32_t rrset_flags, uint8_t *dname, size_t dnamelen, uint16_t type, uint16_t dclass)
compare rrset_parse with data
Definition: msgparse.c:208
void iter_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Return priming query results to interested super querystates.
Definition: iterator.c:3588
rbnode_type rbtree_null_node
the NULL node, global alloc
Definition: rbtree.c:53
char * optarg
getopt global, in case header files fail to declare it.
enum sec_status dnskey_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t dnskey_idx, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset against one specific dnskey (from rrset)
Definition: val_sigcrypt.c:555
void iter_scrub_nxdomain(struct dns_msg *msg)
Prepare an NXDOMAIN message to be used for a subdomain answer by removing all RRs from the ANSWER sec...
Definition: iter_utils.c:1272
void listen_delete(struct listen_dnsport *listen)
delete the listening structure
Definition: fake_event.c:892
static void prealloc_setup(struct alloc_cache *alloc)
prealloc some entries in the cache.
Definition: alloc.c:67
static int auth_zone_generate_answer(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg **msg, int *fallback)
Lookup answer in a zone.
Definition: authzone.c:3187
rrset_id_type id
id needed
Definition: msgreply.h:108
static void do_flush_type(RES *ssl, struct worker *worker, char *arg)
flush a type
Definition: remote.c:1568
void pending_delete(struct outside_network *outnet, struct pending *p)
Delete pending answer.
Definition: outside_network.c:1001
char * optarg
getopt global, in case header files fail to declare it.
int sldns_wire2str_rrquestion_buf(uint8_t *d, size_t dlen, char *s, size_t slen)
Convert question RR to string presentation format, on one line.
Definition: wire2str.c:259
void * fstrm_create_control_frame_stop(size_t *len)
This creates an FSTRM control frame of type STOP.
Definition: dnstap_fstrm.c:75
int fptr_whitelist_mod_clear(void(*fptr)(struct module_qstate *qstate, int id))
Check function pointer whitelist for module clear call values.
Definition: fptr_wlist.c:503
A replay scenario.
Definition: replay.h:155
void iter_clear(struct module_qstate *qstate, int id)
iterator cleanup query state
Definition: iterator.c:3913
static void remove_item(struct val_neg_cache *neg)
remove a random item
Definition: unitneg.c:243
struct comm_timer * timer
timeout event; timer keeps running whether the query is waiting for a buffer or the tcp reply is pend...
Definition: outside_network.h:277
void log_vmsg(int pri, const char *type, const char *format, va_list args)
va_list argument version of log_info.
Definition: log.c:220
void alloc_reg_release(struct alloc_cache *alloc, struct regional *r)
Put regional for query states back into alloc cache.
Definition: alloc.c:342
Conceptual set of IP addresses for response AAAA or A records that should trigger special actions.
Definition: respip.h:23
void mesh_run(struct mesh_area *mesh, struct mesh_state *mstate, enum module_ev ev, struct outbound_entry *e)
Run the mesh.
Definition: mesh.c:1668
@ local_zone_redirect
answer with data at zone apex
Definition: localzone.h:79
static struct reply_packet * entry_add_reply(struct entry *entry)
Add reply packet to entry.
Definition: testpkts.c:92
static struct replay_moment * replay_moment_read(char *remain, FILE *in, const char *name, struct sldns_file_parse_state *pstate)
Read a replay moment 'STEP' from file.
Definition: replay.c:268
size_t replies_sent
number of replies sent
Definition: mesh.h:118
static int lz_enter_rr_into_zone(struct local_zone *z, const char *rrstr)
enter data RR into auth zone
Definition: localzone.c:522
static int dns64_always_synth_for_qname(struct module_qstate *qstate, int id)
See if query name is in the always synth config.
Definition: dns64.c:544
#define REGIONAL_CHUNK_SIZE
Default reasonable size for chunks.
Definition: regional.c:56
Global state for the module.
Definition: pythonmod.c:79
void wsvc_desetup_worker(struct worker *worker)
Desetup lead worker events.
Definition: win_svc.c:627
rbnode_type node
rbtree node element, key is this struct: the name, class
Definition: val_neg.h:96
@ LDNS_RDF_TYPE_LONG_STR
A <character-string> encoding of the value field as specified [RFC1035], Section 5....
Definition: rrdef.h:350
static void deleg_remove_nonsecure_additional(struct reply_info *rep)
remove nonsecure from a delegation referral additional section
Definition: worker.c:448
void config_lookup_uid(struct config_file *config)
Find username, sets cfg_uid and cfg_gid.
Definition: config_file.c:2048
size_t by_rcode[32]
numbers by rcode
Definition: perf.c:107
int id
the id to pass to libunbound to cancel
Definition: asynclook.c:72
void delegpt_no_ipv6(struct delegpt *dp)
Register the fact that there is no ipv6 and thus AAAAs are not going to be queried for or be useful.
Definition: iter_delegpt.c:510
size_t nsec3_get_hashed(struct sldns_buffer *buf, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen, uint8_t *res, size_t max)
Get NSEC3 hashed in a buffer.
Definition: val_nsec3.c:536
struct rr_parse * rr_first
linked list of RRs in this rrset.
Definition: msgparse.h:167
size_t stats_dropped
stats, cumulative number of incoming client msgs dropped
Definition: mesh.h:114
static void xfr_probe_move_to_next_lookup(struct auth_xfer *xfr, struct module_env *env)
move to the next lookup of hostname for task_probe
Definition: authzone.c:3796
static void check_order(rbtree_type *all_locks)
Check ordering of locks.
Definition: lock_verify.c:370
struct sock_list * next
next in list
Definition: module.h:576
void comm_base_delete(struct comm_base *b)
Destroy a comm base.
Definition: fake_event.c:913
#define MESH_MAX_ACTIVATION
Maximum number of mesh state activations.
Definition: mesh.h:70
char * tls_ciphers
TLS ciphers.
Definition: config_file.h:128
struct delegpt * hints_lookup_root(struct iter_hints *hints, uint16_t qclass)
Find root hints for the given class.
Definition: iter_hints.c:460
static size_t rrset_get_sigcount(struct ub_packed_rrset_key *k)
Get RR signature count.
Definition: val_sigcrypt.c:95
int sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity)
changes the buffer's capacity.
Definition: sbuffer.c:74
static int auth_zones_read_zones(struct auth_zones *az, struct config_file *cfg)
read all auth zones from file (if they have)
Definition: authzone.c:1746
struct addr_tree_node * parent
parent in tree
Definition: dnstree.h:81
void log_addr(enum verbosity_value v, const char *str, struct sockaddr_storage *addr, socklen_t addrlen)
Prints the sockaddr in readable format with log_info.
Definition: net_help.c:189
static int generate_request(struct module_qstate *qstate, int id, uint8_t *name, size_t namelen, uint16_t qtype, uint16_t qclass, uint16_t flags, struct module_qstate **newq, int detached)
Generate a request for DNS data.
Definition: validator.c:379
void tcp_req_info_send_reply(struct tcp_req_info *req)
Send reply on tcp simultaneous answer channel.
Definition: listen_dnsport.c:1917
int id
the key id
Definition: slabhash.h:207
static struct local_zone * rpz_find_zone(struct rpz *r, uint8_t *qname, size_t qname_len, uint16_t qclass, int only_exact, int wr, int zones_keep_lock)
Find RPZ local-zone by qname.
Definition: rpz.c:655
void comm_base_delete(struct comm_base *b)
Destroy a comm base.
Definition: netevent.c:203
uint8_t * context_serialize_new_query(struct ctx_query *q, uint32_t *len)
Serialize a context query that questions data.
Definition: context.c:222
int sldns_wire2str_opcode_print(char **s, size_t *slen, int opcode)
Print host format opcode to string.
Definition: wire2str.c:862
struct reply_info * rep
reply info - ptr to packed repinfo structure
Definition: dns.h:65
int num_keys
number of keys usefully read in
Definition: unbound-anchor.c:1201
int key_entry_isgood(struct key_entry_key *kkey)
See if this entry is good.
Definition: val_kentry.c:227
static RETSIGTYPE perf_sigh(int sig)
signal handler for user quit
Definition: perf.c:151
Communication point to the network These behaviours can be accomplished by setting the flags and pass...
Definition: netevent.h:155
static int find_covering_nsec3(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, uint8_t *nm, size_t nmlen, struct ub_packed_rrset_key **rrset, int *rr)
findCoveringNSEC3 Given a name, find a covering NSEC3 from among a list of NSEC3s.
Definition: val_nsec3.c:829
uint16_t opt_code
type of this edns option
Definition: module.h:217
static int memlowercmp(uint8_t *p1, uint8_t *p2, uint8_t len)
Compare labels in memory, lowercase while comparing.
Definition: dname.c:471
int ub_c_lex_destroy(void)
remove buffers for parsing and init
static void del_macro(rbnode_type *x, void *ATTR_UNUSED(arg))
helper function to delete macro values
Definition: replay.c:571
int remote_control_enable
remote control section.
Definition: config_file.h:434
int avail_total
the total number of available ports (size of the array)
Definition: outside_network.h:184
static struct replay_range * replay_range_read(char *remain, FILE *in, const char *name, struct sldns_file_parse_state *pstate, char *line)
Read a range from file.
Definition: replay.c:151
void(* start_accept)(void *)
callback to start listening on accept sockets, performed after stop_accept() then a timeout has passe...
Definition: netevent.h:105
char * string
string argument, for assign.
Definition: replay.h:235
long long ans_expired
expired answers served from cache
Definition: unbound.h:741
sec_status
Security status from validation for data.
Definition: packed_rrset.h:176
void wsvc_rc_start(FILE *out)
Start the service from servicecontrolmanager, tells OS to start daemon.
Definition: w_inst.c:275
void key_entry_hash(struct key_entry_key *kk)
calculate hash for key entry
Definition: val_kentry.c:102
static void reclaim_http_handler(struct comm_point *c)
Make http handler free for next assignment.
Definition: netevent.c:1840
rrset_trust
RRset trustworthiness.
Definition: packed_rrset.h:140
int tube_queue_item(struct tube *tube, uint8_t *msg, size_t len)
Append data item to background list of writes.
Definition: tube.c:455
RR entries in a canonical sorted tree of RRs.
Definition: val_sigcrypt.c:638
void bin_split(struct lruhash *table, struct lruhash_bin *newa, int newmask)
Split hash bin into two new ones.
Definition: lruhash.c:117
socklen_t addrlen
addr length
Definition: authzone.h:428
struct ub_result * result
result from lookup
Definition: asynclook.c:90
int sldns_str2wire_nsap_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSAP from string to wireformat.
Definition: str2wire.c:1785
struct comm_point * comm_point_create_http_out(struct comm_base *base, size_t bufsize, comm_point_callback_type *callback, void *callback_arg, struct sldns_buffer *temp)
Create an outgoing HTTP commpoint.
Definition: netevent.c:2874
struct fake_timer * replay_get_oldest_timer(struct replay_runtime *runtime)
get oldest enabled fake timer
Definition: replay.c:547
#define BIT_QR
QR flag.
Definition: net_help.h:71
void log_edns_opt_list(enum verbosity_value level, const char *info_str, struct edns_option *list)
Log the edns options in the edns option list.
Definition: msgparse.c:1111
uint8_t ssl_upstream
use SSL for upstream query
Definition: iter_delegpt.h:85
int mini_ev_cmp(const void *a, const void *b)
compare events in tree, based on timevalue, ptr for uniqueness
long long infra_get_host_rto(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, struct rtt_info *rtt, int *delay, time_t timenow, int *tA, int *tAAAA, int *tother)
Get additional (debug) info on timing.
Definition: infra.c:615
int main(int argc, char *argv[])
Main routine for petal.
Definition: petal.c:611
void dtio_mainfdcallback(int fd, short bits, void *arg)
callback for unbound-dnstap-socket
struct packed_rrset_key * k
domain name, type and class
Definition: packed_rrset.h:268
struct comm_point * comm_point_create_tcp(struct comm_base *base, int fd, int num, int idle_timeout, struct tcl_list *tcp_conn_limit, size_t bufsize, struct sldns_buffer *spoolbuf, comm_point_callback_type *callback, void *callback_arg)
Create a TCP listener comm point.
Definition: netevent.c:2728
int have_new_lease
we have seen a new lease this scan, because one of the masters replied with the current SOA serial ve...
Definition: authzone.h:327
uint8_t * pkt
the buffer parsed into a sldns_pkt
Definition: replay.h:351
collate func arg
Definition: config_file.c:755
int test_slabhash_compfunc(void *key1, void *key2)
test comparefunc for lruhash
Definition: slabhash.c:197
static void processDSNSResponse(struct module_qstate *qstate, int id, struct module_qstate *forq)
Process response for DS NS Find queries, that attempt to find the delegation point where we ask the D...
Definition: iterator.c:3321
void ub_c_error_msg(const char *fmt,...) ATTR_FORMAT(printf
parsing helpers: print error with file and line numbers
struct val_neg_cache * val_neg_create(struct config_file *cfg, size_t maxiter)
Create negative cache.
Definition: val_neg.c:86
struct config_strlist * dynlib_file
Dynamic library file.
Definition: config_file.h:454
@ LDNS_RR_TYPE_CNAME
the canonical name for an alias
Definition: rrdef.h:93
static int acl_list_tag_data_cfg(struct acl_list *acl, struct config_file *cfg, const char *str, const char *tag, const char *data)
apply acl_tag_data string
Definition: acl_list.c:283
int * ports
ports to be used by this worker.
Definition: worker.h:98
static void dtio_read_frame_free(struct dt_frame_read_buf *rb)
delete the buffer and counters used to read frame
Definition: dtstream.c:564
#define alloc_special_next(x)
access next pointer.
Definition: alloc.h:60
struct timeval lastuse
last time this was used
Definition: delayer.c:80
struct lruhash * lruhash_create(size_t start_size, size_t maxmem, lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, lruhash_deldatafunc_type deldatafunc, void *arg)
Create new hash table.
Definition: lruhash.c:62
#define S_SIZET_NONZERO(str, var)
put integer_nonzero into size_t
Definition: config_file.c:409
const sldns_rr_descriptor * sldns_rr_descript(uint16_t type)
returns the resource record descriptor for the given rr type.
Definition: rrdef.c:631
int libworker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming serviced query replies from the network
Definition: libworker.c:905
struct infra_cache * infra
ref the infra cache (was passed to outside_network_create)
Definition: replay.h:299
static void setup_local_list(struct main_tap_data *maindata, struct config_strlist_head *local_list)
setup local accept sockets
Definition: unbound-dnstap-socket.c:1155
struct rpz * rpz_create(struct config_auth *p)
Create RPZ.
Definition: rpz.c:382
@ listen_type_udpancil_dnscrypt
udp ipv6 (v4mapped) for use with ancillary data + dnscrypt
Definition: listen_dnsport.h:97
static int parse_url(char *url, char **host, char **file, int *port, int *ssl)
parse URL into host and file parts, false on malloc or parse error
Definition: authzone.c:6846
static int rr_is_dnskey_revoked(uint16_t t, uint8_t *rdata, size_t len)
Check if REVOKED DNSKEY pass rdata without rdatalen in front of it.
Definition: autotrust.c:310
int ub_event_base_loopexit(struct ub_event_base *base)
exit that loop
Definition: ub_event_pluggable.c:497
static int no_data_for_rrsig(struct reply_info *rep, struct ub_packed_rrset_key *rrsig)
check that there is no data element that matches the RRSIG
Definition: unitmsgparse.c:277
static void config_memsize_test(void)
test config_file: cfg_parse_memsize
Definition: unitmain.c:347
struct ub_event * ub_event_new(struct ub_event_base *base, int fd, short bits, void(*cb)(int, short, void *), void *arg)
Create a new ub_event for the event base.
Definition: ub_event_pluggable.c:508
int sldns_str2wire_period_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_PERIOD from string to wireformat.
Definition: str2wire.c:1476
static int http_process_initial_header(struct comm_point *c)
a http header is complete, process it
Definition: netevent.c:1985
static void check_chroot_string(const char *desc, char **ss, const char *chrootdir, struct config_file *cfg)
check chroot for a file string
Definition: unbound-checkconf.c:454
static void check_modules_exist(const char *module_conf)
check that the modules exist, are compiled in
Definition: unbound-checkconf.c:522
struct dns_msg * tomsg(struct module_env *env, struct query_info *q, struct reply_info *r, struct regional *region, time_t now, int allow_expired, struct regional *scratch)
generate dns_msg from cached message
Definition: dns.c:538
size_t mesh_get_mem(struct mesh_area *mesh)
Calculate memory size in use by mesh and all queries inside it.
Definition: mesh.c:1770
@ LDNS_RR_TYPE_OPENPGPKEY
RFC 7344.
Definition: rrdef.h:196
static int process_one_header(char *buf, char *file, size_t flen, char *host, size_t hlen, int *vs)
process one http header
Definition: petal.c:191
struct regional * region
regional for allocation
Definition: iter_priv.h:57
void algo_needs_set_bogus(struct algo_needs *n, uint8_t algo)
Mark this algorithm a failure, sec_bogus.
Definition: val_sigcrypt.c:461
struct ub_ctx * ctx
context
Definition: asynclook.c:178
int max_dependency_depth
The maximum dependency depth that this resolver will pursue.
Definition: iterator.h:126
int canonical_tree_compare(const void *k1, const void *k2)
canonical compare for two tree entries
Definition: val_sigcrypt.c:879
static struct ub_event_base * sig_base
signal variable
Definition: unbound-dnstap-socket.c:1201
int respip_merge_cname(struct reply_info *base_rep, const struct query_info *qinfo, const struct reply_info *tgt_rep, const struct respip_client_info *cinfo, int must_validate, struct reply_info **new_repp, struct regional *region, struct auth_zones *az)
Merge two replies to build a complete CNAME chain.
Definition: respip.c:1162
struct trust_anchor * anchor_find(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass)
Find a trust anchor.
Definition: val_anchor.c:197
int mesh_attach_sub(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq)
Attach subquery.
Definition: mesh.c:1047
int sldns_str2wire_ipseckey_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_IPSECKEY from string to wireformat.
Definition: str2wire.c:1850
rbnode_type node
redblacktree node, key is this structure: class and name
Definition: iter_fwd.h:68
struct comm_timer * comm_timer_create(struct comm_base *base, void(*cb)(void *), void *cb_arg)
create timer.
Definition: fake_event.c:1494
struct ub_event_base * base
ub_event event_base type.
Definition: netevent.c:116
static int read_fwds_addr(struct config_stub *s, struct delegpt *dp)
set fwd server addresses
Definition: iter_fwd.c:229
#define REMOTE_CONTROL_TCP_TIMEOUT
number of milliseconds timeout on incoming remote control handshake
Definition: remote.h:60
void mesh_detach_subs(struct module_qstate *qstate)
Detach-subqueries.
Definition: mesh.c:974
static struct ip_list * pick_random_ip(struct ip_list *list)
pick random unused element from IP list
Definition: unbound-anchor.c:693
struct sldns_struct_lookup_table * sldns_wireparse_errors
error string from wireparse
Definition: wire2str.c:154
int dt_io_thread_apply_cfg(struct dt_io_thread *dtio, struct config_file *cfg)
Apply config to the dtio thread.
Definition: dtstream.c:257
Structure to store DNS query and the reply packet.
Definition: msgreply.h:125
uint16_t type
the rrset type in network format
Definition: packed_rrset.h:94
struct daemon * daemon_init(void)
Initialize daemon structure.
Definition: daemon.c:194
size_t fast_server_num
number of fastest server to select from
Definition: config_file.h:178
static struct tap_socket * tap_socket_new_tlsaccept(char *ip, void(*ev_cb)(int, short, void *), void *data, char *server_key, char *server_cert, char *verifypem)
create new socket (unconnected, not base-added), or NULL malloc fail
Definition: unbound-dnstap-socket.c:235
void log_dns_msg(const char *str, struct query_info *qinfo, struct reply_info *rep)
Debug send the query info and reply info to the log in readable form.
Definition: msgreply.c:820
static int parse_create_qinfo(sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinf, struct regional *region)
allocate qinfo, return 0 on error
Definition: msgreply.c:73
#define swap(t, a, b)
Generic macro for swapping two variables.
Definition: dns64.c:150
static struct ub_packed_rrset_key * find_NS(struct reply_info *rep, size_t from, size_t to)
find NS rrset in given list
Definition: iterator.c:2633
void name_tree_init(rbtree_type *tree)
Init a name tree to be empty.
Definition: dnstree.c:74
static char * do_macro_range(char *buf)
Do range macro on expanded buffer.
Definition: replay.c:775
struct timeval now_tv
the current time in microseconds
Definition: replay.h:304
int need_to_exit
do we need to restart or quit (on signal)
Definition: worker.h:115
int fptr_whitelist_inplace_cb_query_response(inplace_cb_query_response_func_type *fptr)
Check function pointer whitelist for inplace_cb_query_response func values.
Definition: fptr_wlist.c:664
void log_nametypeclass(enum verbosity_value v, const char *str, uint8_t *name, uint16_t type, uint16_t dclass)
Print string with neat domain name, type and class.
Definition: net_help.c:481
long long num_query_dnscrypt_cert
number of queries that queried dnscrypt certificates
Definition: unbound.h:760
struct comm_point * comm_point_create_udp(struct comm_base *base, int fd, struct sldns_buffer *buffer, comm_point_callback_type *callback, void *callback_arg)
Create an UDP comm point.
Definition: netevent.c:2516
int is_pow2(size_t num)
See if number is a power of 2.
Definition: net_help.c:170
void ipset_deinit(struct module_env *env, int id)
Deinit the ipset module.
Definition: ipset.c:253
void val_mark_insecure(struct reply_info *rep, uint8_t *kname, struct rrset_cache *r, struct module_env *env)
Mark all unchecked rrset entries below a NULL key entry as insecure.
Definition: val_utils.c:1031
void dname_print(FILE *out, struct sldns_buffer *pkt, uint8_t *dname)
Debug helper.
Definition: dname.c:389
int ctx_logfile_overridden
store that the logfile has a debug override
Definition: libunbound.c:83
struct auth_chunk * next
next chunk in list
Definition: authzone.h:457
size_t dlv_insecure_at_len
length of dlv insecure point name
Definition: validator.h:233
int for_upstream
provide upstream answers
Definition: config_file.h:670
The context structure.
Definition: context.h:65
static void pretty_rcode(char *s, size_t len, int r)
nice string for rcode
Definition: unbound-host.c:247
time_t ttl
Abs time in seconds in which elem is meaningful.
Definition: addrtree.h:95
int comm_point_send_udp_msg(struct comm_point *c, sldns_buffer *packet, struct sockaddr *addr, socklen_t addrlen)
Send an udp message over a commpoint.
Definition: netevent.c:335
size_t lruhash_get_mem(struct lruhash *table)
Get memory in use now by the lruhash table.
Definition: lruhash.c:493
int outnet_tcp_connect(int s, struct sockaddr_storage *addr, socklen_t addrlen)
connect tcp connection to addr, 0 on failure
Definition: outside_network.c:270
int sldns_wire2str_int16_data_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat int16_data field to string, with user buffers.
Definition: wire2str.c:1628
int sldns_wire2str_class_print(char **str, size_t *str_len, uint16_t rrclass)
Print host format rr class to string.
Definition: wire2str.c:880
@ LDNS_RR_TYPE_ISDN
RFC1183.
Definition: rrdef.h:123
static void testbound_usage(void)
give commandline usage for testbound.
Definition: testbound.c:87
int optind
getopt global, in case header files fail to declare it.
int modstack_setup(struct module_stack *stack, const char *module_conf, struct module_env *env)
Setup modules.
Definition: modstack.c:223
static int is_file(const char *fname)
true if fname is a file
Definition: unbound-checkconf.c:401
void verify_test(void)
unit test for verification functions
Definition: unitverify.c:506
static struct auth_data * az_find_name(struct auth_zone *z, uint8_t *nm, size_t nmlen)
find domain with exactly the given name
Definition: authzone.c:609
int dname_has_label(uint8_t *dname, size_t dnamelen, uint8_t *label)
Check if dname contains label.
Definition: dname.c:592
size_t num_reply_addrs
count of the total number of mesh_reply entries
Definition: mesh.h:94
time_t cfg_convert_timeval(const char *str)
Convert 14digit to time value.
Definition: config_file.c:1808
int respip_views_apply_cfg(struct views *vs, struct config_file *cfg, int *have_view_respip_cfg)
Apply response-ip config settings in named views.
Definition: respip.c:417
int dname_strict_subdomain_c(uint8_t *d1, uint8_t *d2)
Like dname_strict_subdomain but counts labels.
Definition: dname.c:693
int fd
file descriptor of socket
Definition: perf.c:135
void modstack_init(struct module_stack *stack)
Init a stack of modules.
Definition: modstack.c:92
static void add_rr(char *rrstr, uint8_t *pktbuf, size_t pktsize, size_t *pktlen, struct sldns_file_parse_state *pstate, sldns_pkt_section add_section, const char *fname)
add RR to packet
Definition: testpkts.c:458
struct comm_point * outnet_comm_point_for_tcp(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen, struct sldns_buffer *query, int timeout, int ssl, char *host)
Create tcp commpoint suitable for communication to the destination.
Definition: outside_network.c:2344
int for_downstream
for downstream: this zone answers queries towards the downstream clients
Definition: authzone.h:131
struct reply_info * chase_reply
The chased reply, extract from original message.
Definition: validator.h:177
static int pollit(int fd, struct timeval *t)
perform a select() on the fd
Definition: tube.c:397
int iter_ds_toolow(struct dns_msg *msg, struct delegpt *dp)
See if a DS response (type ANSWER) is too low: a nodata answer with a SOA record in the authority sec...
Definition: iter_utils.c:1330
static void event_reg_remove(FILE *out)
remove registry entries for eventlog
Definition: w_inst.c:131
struct edns_option * next
next item in list
Definition: msgparse.h:235
char * optarg
getopt global, in case header files fail to declare it.
static int longformat
long format option, for multiline printout per message
Definition: unbound-dnstap-socket.c:92
int MINIMAL_RESPONSES
minimal responses when positive answer
Definition: net_help.c:71
int tcp_pkt_counter
if we are handling a multi pkt tcp stream, non 0 and the pkt nr
Definition: replay.h:358
static char * dup_all(char *str)
dup string and print error on error
Definition: authzone.c:6822
int shm_enable
SHM data - true if shm is enabled.
Definition: config_file.h:552
@ LDNS_RDF_TYPE_INT16_DATA
variable length any type rdata where the length is specified by the first 2 bytes
Definition: rrdef.h:313
int auth_zones_notify(struct auth_zones *az, struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t dclass, struct sockaddr_storage *addr, socklen_t addrlen, int has_serial, uint32_t serial, int *refused)
process notify for auth zones.
Definition: authzone.c:3561
time_t last_change
last update of key state (new pending count keeps date the same)
Definition: autotrust.h:75
int ratelimit_factor
ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic
Definition: config_file.h:545
int fake_dsa
fake DSA support for unit tests
Definition: val_secalgo.c:58
struct auth_xfer * auth_xfer_create(struct auth_zones *az, struct auth_zone *z)
Create auth_xfer structure.
Definition: authzone.c:6771
size_t opt_len
length of this edns option (cannot exceed uint16 in encoding)
Definition: msgparse.h:239
Per query state for the ipsecmod module.
Definition: ipsecmod.h:61
int sldns_wire2str_atma_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat ATMA field to string, with user buffers.
Definition: wire2str.c:1538
static void az_nsec3_get_nextcloser(uint8_t *cenm, uint8_t *qname, size_t qname_len, uint8_t **nx, size_t *nxlen)
Return nextcloser name (as a ref into the qname).
Definition: authzone.c:2751
static size_t calc_data_need(struct reply_info *rep)
Calculate space needed for the data and all its parents.
Definition: val_neg.c:324
static int xml_is_zone_name(BIO *zone, const char *name)
See if XML element equals the zone name.
Definition: unbound-anchor.c:1399
uint8_t * rpz_taglist
rpz tags (or NULL)
Definition: config_file.h:677
int fptr_whitelist_comm_point_raw(comm_point_callback_type *fptr)
Check function pointer whitelist for raw comm_point callback values.
Definition: fptr_wlist.c:117
struct comm_base * comm_base_create_event(struct ub_event_base *base)
Create comm base that uses the given ub_event_base (underlying pluggable event mechanism pointer).
Definition: netevent.c:186
static void dtio_setup_reconnect(struct dt_io_thread *dtio)
setup the reconnect event for dnstap io
Definition: dtstream.c:1552
int fptr_whitelist_mod_get_mem(size_t(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module get_mem call values.
Definition: fptr_wlist.c:532
int local_zones_add_RR(struct local_zones *zones, const char *rr)
Add RR data into the localzone data.
Definition: localzone.c:1881
struct tcl_addr * tcl_addr_lookup(struct tcl_list *tcl, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup address to see its TCP connection limit structure.
Definition: tcp_conn_limit.c:182
int accept_frame_received
Set if valid ACCEPT frame is received.
Definition: dtstream.h:204
void msgparse_test(void)
unit test for msgreply and msgparse
Definition: unitmsgparse.c:503
void acl_list_delete(struct acl_list *acl)
Delete acl structure.
Definition: acl_list.c:67
void rtt_update(struct rtt_info *rtt, int ms)
Update the statistics with a new roundtrip estimate observation.
Definition: rtt.c:89
void log_crypto_err_code(const char *str, unsigned long err)
Log libcrypto error from errcode with descriptive string, calls log_err.
Definition: net_help.c:843
static lock_basic_type log_lock
pthread mutex to protect FILE*
Definition: log.c:73
static STACK_OF(X509)
read certificates from a PEM bio
Definition: unbound-anchor.c:348
int ub_resolve_async(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, void *mydata, ub_callback_type callback, int *async_id)
Perform resolution and validation of the target name.
Definition: libunbound.c:766
int tcp_do_toggle_rw
if set, read/write completes: read/write state of tcp is toggled.
Definition: netevent.h:255
size_t rrset_cache_size
size of the rrset cache
Definition: config_file.h:158
int auth_xfer_probe_udp_callback(struct comm_point *c, void *arg, int err, struct comm_reply *repinfo)
callback for commpoint udp replies to task_probe
Definition: authzone.c:6157
@ DTIO_COMMAND_WAKEUP
DTIO command channel wakeup.
Definition: dtstream.c:81
char * dnstap_ip
dnstap IP
Definition: config_file.h:489
struct trust_anchor * dlv_anchor
The DLV trust anchor (if one is configured, else NULL)
Definition: val_anchor.h:71
struct config_str2list * acls
list of access control entries, linked list
Definition: config_file.h:240
uint8_t in_use
if this element is in use, boolean
Definition: val_neg.h:169
size_t stream_wait_max
size (in bytes) of stream wait buffers max
Definition: config_file.c:80
void val_find_rrset_signer(struct ub_packed_rrset_key *rrset, uint8_t **sname, size_t *slen)
Find the signer name for an RRset.
Definition: val_utils.c:160
struct config_strlist * python_script
Python script file.
Definition: config_file.h:451
void auth_xfer_probe_timer_callback(void *arg)
callback for task_probe timer
Definition: authzone.c:6122
static int donotq_insert(struct iter_donotq *dq, struct sockaddr_storage *addr, socklen_t addrlen, int net)
insert new address into donotq structure
Definition: iter_donotq.c:77
result list for the lookups
Definition: asynclook.c:82
static int mesh_detect_cycle_found(struct module_qstate *qstate, struct mesh_state *dep_m)
find cycle for already looked up mesh_state
Definition: mesh.c:960
int notify_has_serial
true if the notify_received has a serial number
Definition: authzone.h:239
int rrset_canonical_equal(struct regional *region, struct ub_packed_rrset_key *k1, struct ub_packed_rrset_key *k2)
Compare two rrsets and see if they are the same, canonicalised.
Definition: val_sigcrypt.c:1053
struct comm_point * outnet_comm_point_for_http(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen, int timeout, int ssl, char *host, char *path)
Create http commpoint suitable for communication to the destination.
Definition: fake_event.c:1704
static struct autr_ta * add_trustanchor_frm_rr(struct val_anchors *anchors, uint8_t *rr, size_t rr_len, size_t dname_len, struct trust_anchor **tp)
Add trust anchor from RR.
Definition: autotrust.c:440
static struct auth_data * az_domain_go_up(struct auth_zone *z, struct auth_data *n)
go up the auth tree to next existing name.
Definition: authzone.c:2214
int dname_lab_startswith(uint8_t *label, char *prefix, char **endptr)
Check if labels starts with given prefix.
Definition: dname.c:569
char * optarg
getopt global, in case header files fail to declare it.
int ipstrtoaddr(const char *ip, int port, struct sockaddr_storage *addr, socklen_t *addrlen)
Convert ip address string and port to sockaddr.
Definition: net_help.c:247
@ LDNS_RR_TYPE_MD
a mail destination (Obsolete - use MX)
Definition: rrdef.h:89
static void do_list_forwards(RES *ssl, struct worker *worker)
do the list_forwards command
Definition: remote.c:2605
static void dname_test_iswild(void)
test dname_is_wild routine
Definition: unitdname.c:500
static struct ip_list * parse_ip_addr(const char *str, int port)
parse a text IP address into a sockaddr
Definition: unbound-anchor.c:583
@ LDNS_RDF_TYPE_NSEC3_SALT
nsec3 hash salt
Definition: rrdef.h:327
static void data_entry_init(struct infra_cache *infra, struct lruhash_entry *e, time_t timenow)
init the data elements
Definition: infra.c:378
uint32_t default_ttl
default TTL, this is used if the text does not specify a TTL, host byteorder
Definition: str2wire.h:229
static int setup_http_request(sldns_buffer *buf, char *host, char *path)
setup http request headers in buffer for sending query to destination
Definition: outside_network.c:2386
void(* detach_subs)(struct module_qstate *qstate)
Detach-subqueries.
Definition: module.h:379
int(* add)(struct ub_event *, struct timeval *)
Activate the event.
Definition: unbound-event.h:138
the regional* is the first block*.
Definition: regional.h:60
static void mesh_do_callback(struct mesh_state *m, int rcode, struct reply_info *rep, struct mesh_cb *r)
callback results to mesh cb entry
Definition: mesh.c:1114
void query_dname_tolower(uint8_t *dname)
lowercase query dname
Definition: dname.c:135
void dynlibmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
dynlib module
Definition: dynlibmod.c:186
int query_dname_compare(register uint8_t *d1, register uint8_t *d2)
compare uncompressed, noncanonical, registers are hints for speed
Definition: dname.c:100
static char * msgtostr(struct dns_msg *msg)
create string for message
Definition: unitauth.c:702
struct module_env * env
environment for new states
Definition: mesh.h:86
static int rdata_duplicate(struct packed_rrset_data *d, uint8_t *rdata, size_t len)
see if rdata is duplicate
Definition: authzone.c:700
static void az_setall_deleted(struct auth_zones *az)
set all auth zones deleted, then in auth_zones_cfg, it marks them as nondeleted (if they are still in...
Definition: authzone.c:1952
void daemon_apply_cfg(struct daemon *daemon, struct config_file *cfg)
Apply config settings.
Definition: daemon.c:816
void * backend_data
backend specific data here
Definition: cachedb.h:58
struct comm_point * outnet_comm_point_for_http(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen, int timeout, int ssl, char *host, char *path)
Create http commpoint suitable for communication to the destination.
Definition: outside_network.c:2405
void log_rrset_key(enum verbosity_value v, const char *str, struct ub_packed_rrset_key *rrset)
Print string with neat domain name, type, class from rrset.
Definition: packed_rrset.c:263
struct regional * alloc_reg_obtain(struct alloc_cache *alloc)
Get a new regional for query states.
Definition: alloc.c:329
@ UB_PIPE
error in pipe communication with async bg worker
Definition: context.h:201
#define VAL_MAX_RESTART_COUNT
max number of query restarts, number of IPs to probe
Definition: validator.h:68
int maxout
max number of fds, size of out array
Definition: outside_network.h:191
void rbtree_init(rbtree_type *rbtree, int(*cmpf)(const void *, const void *))
Init a new tree (malloced by caller) with given key compare function.
Definition: rbtree.c:95
Iterator forward zones structure.
Definition: iter_fwd.h:52
char * optarg
getopt global, in case header files fail to declare it.
static void verify_rrset(struct respip_set *set, const char *ipstr, const char *rdatastr, size_t rdi, uint16_t type)
find the respip address node in the specified tree (by address lookup) and verify type and address of...
Definition: unitmain.c:712
static void xfr_master_add_addrs(struct auth_master *m, struct ub_packed_rrset_key *rrset, uint16_t rrtype)
add addrs from A or AAAA rrset to the master
Definition: authzone.c:5292
size_t ans_rcode[UB_STATS_RCODE_NUM]
(extended stats) rcodes in replies
Definition: mesh.h:128
struct lruhash_entry * lruhash_lookup(struct lruhash *table, hashvalue_type hash, void *key, int wr)
Lookup an entry in the hashtable.
Definition: lruhash.c:356
struct sldns_buffer * udp_buff
buffer shared by UDP connections, since there is only one datagram at any time.
Definition: listen_dnsport.h:62
sldns_rr_class sldns_get_rr_class_by_name(const char *name)
retrieves a class by looking up its name.
Definition: rrdef.c:728
static void * win_do_cron(void *arg)
Do the cron action and wait for result exit value.
Definition: win_svc.c:546
int parse_packet(struct sldns_buffer *pkt, struct msg_parse *msg, struct regional *region)
Parse the packet.
Definition: msgparse.c:906
void libworker_fg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with fg results
Definition: libworker.c:550
int sldns_str2wire_type_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TYPE from string to wireformat.
Definition: str2wire.c:1340
static void get_origin(const char *name, struct sldns_file_parse_state *pstate, char *parse)
parse ORIGIN
Definition: testpkts.c:436
struct waiting_tcp * next_waiting
next in waiting list.
Definition: outside_network.h:274
@ LDNS_RDF_TYPE_APL
apl data
Definition: rrdef.h:282
void * regional_alloc(struct regional *r, size_t size)
Allocate size bytes of memory inside regional.
Definition: regional.c:122
comm_point_callback_type * callback_query
callback to call for incoming queries
Definition: replay.h:294
int mesh_new_callback(struct mesh_area *mesh, struct query_info *qinfo, uint16_t qflags, struct edns_data *edns, struct sldns_buffer *buf, uint16_t qid, mesh_cb_func_type cb, void *cb_arg)
New query with callback.
Definition: mesh.c:598
rpz_action
RPZ actions.
Definition: rpz.h:70
static struct libworker * libworker_setup(struct ub_ctx *ctx, int is_bg, struct ub_event_base *eb)
setup fresh libworker struct
Definition: libworker.c:131
void log_ident_set_default(const char *id)
Set default identity to print, default is 'unbound'.
Definition: log.c:185
uint32_t mask
size bitmask - uses high bits.
Definition: slabhash.h:61
void handle_query(uint8_t *inbuf, ssize_t inlen, struct entry *entries, int *count, enum transport_type transport, void(*sendfunc)(uint8_t *, size_t, void *), void *userdata, FILE *verbose_out)
Parses data buffer to a query, finds the correct answer and calls the given function for every packet...
Definition: testpkts.c:1629
static size_t rrset_get_count(struct ub_packed_rrset_key *rrset)
return number of rrs in an rrset
Definition: val_sigcrypt.c:83
#define MSG_GENERIC_WARN
from gen_msg.h - warning message record for windows message log
Definition: win_svc.h:59
static void usage(char *nm)
usage information for perf
Definition: perf.c:59
void timehist_log(struct timehist *hist, const char *name)
Log histogram, print it to the logfile.
Definition: timehist.c:164
static int msg_add_rrset_ar(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node, struct auth_rrset *rrset)
add rrset to additional section
Definition: authzone.c:268
static void usage(char *argv[])
usage information for streamtcp
Definition: streamtcp.c:69
static void perform_setup(struct daemon *daemon, struct config_file *cfg, int debug_mode, const char **cfgfile, int need_pidfile)
daemonize, drop user privileges and chroot if needed
Definition: unbound.c:419
int num
num threads allocated
Definition: daemon.h:101
void val_neg_addreply(struct val_neg_cache *neg, struct reply_info *rep)
Insert NSECs from this message into the negative cache for reference.
Definition: val_neg.c:878
void worker_send_cmd(struct worker *worker, enum worker_commands cmd)
Send a command to a worker.
Definition: worker.c:230
Per query state for the validator module.
Definition: validator.h:147
static void qlist_grow_capacity(struct perfinfo *info)
grow query list capacity
Definition: perf.c:509
int sldns_str2wire_tag_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TAG from string to wireformat.
Definition: str2wire.c:2015
static volatile int do_quit
signal handler global info
Definition: delayer.c:345
sldns_buffer * sldns_buffer_new(size_t capacity)
creates a new buffer with the specified capacity.
Definition: sbuffer.c:19
void(* operate)(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
accept a new query, or work further on existing query.
Definition: module.h:711
static int vbmp
verbosity for this test
Definition: unitauth.c:53
size_t query_dname_len(sldns_buffer *query)
Determine length of dname in buffer, no compression ptrs allowed,.
Definition: dname.c:52
int tcp_req_info_add_meshstate(struct tcp_req_info *req, struct mesh_area *mesh, struct mesh_state *m)
Add mesh state to the tcp req list of open requests.
Definition: listen_dnsport.c:1855
int isrpz
this zone is used to create local-zone policies
Definition: config_file.h:675
int algo_needs_set_secure(struct algo_needs *n, uint8_t algo)
Mark this algorithm as a success, sec_secure, and see if we are done.
Definition: val_sigcrypt.c:450
void autr_global_delete(struct autr_global_data *global)
Delete global 5011 data structure.
Definition: autotrust.c:84
char * server_cert_file
certificate file for server
Definition: config_file.h:444
@ LDNS_RR_TYPE_PX
RFC2163.
Definition: rrdef.h:135
int sldns_wire2str_eui64_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat EUI64 field to string, with user buffers.
Definition: wire2str.c:1678
struct perfio * io
I/O ports array.
Definition: perf.c:112
#define O_IFC(opt, str, num, arr)
compare and print array option
Definition: config_file.c:848
static int find_add_addrs(struct module_env *env, uint16_t qclass, struct regional *region, struct delegpt *dp, time_t now, struct dns_msg **msg)
find and add A and AAAA records for nameservers in delegpt
Definition: dns.c:265
static const char * rpz_trigger_to_string(enum rpz_trigger r)
string for RPZ trigger enum
Definition: rpz.c:96
int parent_index
Index of this edge in parent_node.
Definition: addrtree.h:118
int cfg_scan_ports(int *avail, int num)
Scan ports available.
Definition: config_file.c:1590
void * fstrm_create_control_frame_stop(size_t *len)
This creates an FSTRM control frame of type STOP.
Definition: dnstap_fstrm.c:75
uint16_t calc_edns_field_size(struct edns_data *edns)
Estimate size of EDNS record in packet.
Definition: msgencode.c:788
char * str2
second string
Definition: config_file.h:737
int enabled
State of the IPsec module.
Definition: ipsecmod.h:65
@ rrset_trust_nonauth_ans_AA
non-authoritative data from the answer section of authoritative answers
Definition: packed_rrset.h:151
static int az_insert_rr(struct auth_zone *z, uint8_t *rr, size_t rr_len, size_t dname_len, int *duplicate)
insert RR into zone, ignore duplicates
Definition: authzone.c:1156
static void do_flush_bogus(RES *ssl, struct worker *worker)
remove all bogus rrsets, msgs and keys from cache
Definition: remote.c:1814
int need_refetch
whether to refetch a fresh answer on finishing this state
Definition: module.h:650
static void infra_create_ratedata(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow)
create rate data item for name, number 1 in now
Definition: infra.c:827
int cfg_strlist_append(struct config_strlist_head *list, char *item)
Append text at end of list.
Definition: config_file.c:1650
struct slabhash table
uses partitioned hash table
Definition: rrset.h:58
static void tcp_req_info_read_again(int fd, struct comm_point *c)
read again to drain buffers when there could be more to read
Definition: netevent.c:1746
Definition: addrtree.h:108
size_t namelen
length of name
Definition: localzone.h:169
struct rr_parse * next
next in list of RRs.
Definition: msgparse.h:194
struct config_strlist * root_hints
the root hints
Definition: config_file.h:208
void log_vmsg(int pri, const char *type, const char *format, va_list args)
va_list argument version of log_info.
Definition: log.c:220
static void tmpfilecleanup(void)
cleanup tmp files at exit
Definition: unitauth.c:466
static addrlen_t bits_common(const addrkey_t *s1, addrlen_t l1, const addrkey_t *s2, addrlen_t l2, addrlen_t skip)
Common number of bits in prefix.
Definition: addrtree.c:330
enum replay_moment::replay_event_type evt_type
variable with what is to happen this moment
static void auth_free_masters(struct auth_master *list)
free the masters list
Definition: authzone.c:2063
uint8_t auth_dp
delegpt from authoritative zone that is locally hosted
Definition: iter_delegpt.h:87
A local data RRset.
Definition: localzone.h:180
uint8_t * qname
qname from this query.
Definition: mesh.h:230
static void spool_auto_file(FILE *in, int *lineno, FILE *cfg, char *id)
spool autotrust file
Definition: testbound.c:217
#define MAX_SENT_COUNT
max number of queries-sent-out.
Definition: iterator.h:68
void comm_point_udp_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:681
static void process_response(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id, struct outbound_entry *outbound, enum module_ev event)
process authoritative server reply
Definition: iterator.c:3682
static int print_mem(RES *ssl, struct worker *worker, struct daemon *daemon, struct ub_stats_info *s)
print mem stats
Definition: remote.c:793
void * unwanted_param
user param for action
Definition: outside_network.h:98
static void xfr_probe_start_lookups(struct auth_xfer *xfr)
start the lookups for task_probe
Definition: authzone.c:3783
uint8_t * name
name
Definition: iter_fwd.h:70
static void validate_nameerror_response(struct module_env *env, struct val_env *ve, struct query_info *qchase, struct reply_info *chase_reply, struct key_entry_key *kkey, int *rcode)
Validate a NAMEERROR signed response – a response that has a NXDOMAIN Rcode.
Definition: validator.c:987
size_t num_forever_states
number of reply states in the forever list
Definition: mesh.h:104
struct comm_point * res_com
background write queue, commpoint to write results back
Definition: tube.h:84
struct entry * find_match(struct entry *entries, uint8_t *query_pkt, size_t query_pkt_len, enum transport_type transport)
finds entry in list, or returns NULL.
Definition: testpkts.c:1427
static unsigned int slab_idx(struct slabhash *sl, hashvalue_type hash)
helper routine to calculate the slabhash index
Definition: slabhash.c:111
static void get_mesh_status(struct mesh_area *mesh, struct mesh_state *m, char *buf, size_t len)
get status of a mesh state
Definition: remote.c:2342
void hex_to_buf(sldns_buffer *pkt, const char *hex)
Helper to convert hex string to packet buffer.
Definition: readhex.c:65
#define LISTEN_BACKLOG
listen backlog on TCP connections for dnstap logs
Definition: unbound-dnstap-socket.c:71
int dt_io_thread_register_queue(struct dt_io_thread *dtio, struct dt_msg_queue *mq)
Register a msg queue to the io thread.
Definition: dtstream.c:369
struct local_zone * local_zones_tags_lookup(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, uint16_t dtype, uint8_t *taglist, size_t taglen, int ignoretags)
Lookup zone that contains the given name, class and taglist.
Definition: localzone.c:1095
Global info for perf.
Definition: perf.c:77
struct key_cache * key_cache_create(struct config_file *cfg)
Create the key cache.
Definition: val_kcache.c:50
size_t num_activated
number of activations for the mesh state
Definition: mesh.h:186
void comm_base_delete(struct comm_base *b)
Destroy a comm base.
Definition: fake_event.c:913
static struct key_entry_key * key_cache_search(struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class, int wr)
Lookup exactly in the key cache.
Definition: val_kcache.c:111
FILE * ub_c_in
lex in file
int key_entry_isgood(struct key_entry_key *kkey)
See if this entry is good.
Definition: val_kentry.c:227
int comm_timer_is_set(struct comm_timer *timer)
see if timeout has been set to a value.
Definition: netevent.c:3358
void remote_get_opt_ssl(char *line, void *arg)
routine to printout option values over SSL
Definition: remote.c:2585
static int respip_data_answer(enum respip_action action, struct ub_packed_rrset_key *data, uint16_t qtype, const struct reply_info *rep, size_t rrset_id, struct reply_info **new_repp, int tag, struct config_strlist **tag_datas, size_t tag_datas_size, char *const *tagname, int num_tags, struct ub_packed_rrset_key **redirect_rrsetp, struct regional *region)
See if response-ip or tag data should override the original answer rrset (which is rep->rrsets[rrset_...
Definition: respip.c:699
#define DTIO_RECONNECT_TIMEOUT_MAX
the msec to wait for reconnect max after backoff
Definition: dtstream.c:68
struct listen_dnsport * listen_create(struct comm_base *base, struct listen_port *ports, size_t bufsize, int tcp_accept_count, int tcp_idle_timeout, struct tcl_list *tcp_conn_limit, void *sslctx, struct dt_env *dtenv, comm_point_callback_type *cb, void *cb_arg)
Create commpoints with for this thread for the shared ports.
Definition: listen_dnsport.c:1325
void lruhash_delete(struct lruhash *table)
Delete hash table.
Definition: lruhash.c:153
struct ub_randstate * rnd
where to get random numbers
Definition: outside_network.h:132
int rrset_insert_rr(struct regional *region, struct packed_rrset_data *pd, uint8_t *rdata, size_t rdata_len, time_t ttl, const char *rrstr)
Insert specified rdata into the specified resource record.
Definition: localzone.c:358
void pythonmod_clear(struct module_qstate *qstate, int id)
python module cleanup query state
Definition: pythonmod.c:549
uint8_t * buf
serialized buffer to write
Definition: tube.h:119
enum sec_status dnskey_verify_rrset_sig(struct regional *region, struct sldns_buffer *buf, struct val_env *ve, time_t now, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t dnskey_idx, size_t sig_idx, struct rbtree_type **sortree, int *buf_canon, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset, with specific dnskey(from set), for a specific rrsig
Definition: val_sigcrypt.c:1376
int num_ip6
number of outgoing IP6 interfaces
Definition: outside_network.h:118
int fptr_whitelist_serviced_query(comm_point_callback_type *fptr)
Check function pointer whitelist for serviced query callback values.
Definition: fptr_wlist.c:211
static void dname_test_has_label(void)
Test dname_has_label.
Definition: unitdname.c:799
static enum rpz_action rpz_rr_to_action(uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen)
Classify RPZ action for RR type/rdata.
Definition: rpz.c:148
struct infra_cache * infra_cache
shared infrastructure cache (edns, lameness)
Definition: module.h:333
localzone_type
Local zone type This type determines processing for queries that did not match local-data directly.
Definition: localzone.h:65
int fptr_whitelist_pending_udp(comm_point_callback_type *fptr)
Check function pointer whitelist for pending udp callback values.
Definition: fptr_wlist.c:193
int duration
duration of test in seconds
Definition: perf.c:96
static void do_verbosity(RES *ssl, char *str)
do the verbosity command
Definition: remote.c:696
uint8_t lame_other
the host is lame (not authoritative) for other query types
Definition: infra.h:99
struct iter_donotq * donotq_create(void)
Create donotqueryaddresses structure.
Definition: iter_donotq.c:52
static int dtio_control_ready_send(struct dt_io_thread *dtio)
setup a ready control message
Definition: dtstream.c:1830
int sldns_str2wire_eui48_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_EUI48 from string to wireformat.
Definition: str2wire.c:1971
int libworker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming serviced query replies from the network
Definition: libworker.c:905
static int verb
verbosity for this application
Definition: unbound-anchor.c:159
static void chaos_replystr(sldns_buffer *pkt, char **str, int num, struct edns_data *edns, struct worker *worker, struct comm_reply *repinfo)
Fill CH class answer into buffer.
Definition: worker.c:811
size_t respip_get_mem(struct module_env *env, int id)
response-ip alloc size routine
Definition: respip.c:1264
void regional_free_all(struct regional *r)
Free all memory associated with regional.
Definition: regional.c:96
struct replay_runtime * runtime
runtime ptr
Definition: fake_event.c:88
int mesh_state_add_reply(struct mesh_state *s, struct edns_data *edns, struct comm_reply *rep, uint16_t qid, uint16_t qflags, const struct query_info *qinfo)
Create new reply structure and attach it to a mesh state.
Definition: mesh.c:1474
rbnode_type node
rbtree node, key is this structure
Definition: val_sigcrypt.c:640
int thr_next_num
next thread number for new threads
Definition: context.h:96
int is_bg_thread
is this a bg worker that is threaded (not forked)?
Definition: libworker.h:77
static char * get_random_zone(void)
get static pointer to random zone name
Definition: unitneg.c:95
static size_t count_large(struct regional *r)
also reasonably slow, counts the number of large objects
Definition: regional.c:205
struct delegpt * delegpt_create_mlc(uint8_t *name)
create malloced delegation point, with the given name
Definition: iter_delegpt.c:530
int sldns_buffer_reserve(sldns_buffer *buffer, size_t amount)
ensures BUFFER can contain at least AMOUNT more bytes.
Definition: sbuffer.c:93
static void xfr_create_soa_probe_packet(struct auth_xfer *xfr, sldns_buffer *buf, uint16_t id)
create SOA probe packet for xfr
Definition: authzone.c:3961
#define SERVICE_NAME
service name for unbound (internal to ServiceManager)
Definition: win_svc.h:52
void ub_randfree(struct ub_randstate *state)
Delete the random state.
Definition: random.c:204
int addr_tree_insert(rbtree_type *tree, struct addr_tree_node *node, struct sockaddr_storage *addr, socklen_t addrlen, int net)
insert element into addr tree.
Definition: dnstree.c:96
struct name_tree_node * name_tree_lookup(rbtree_type *tree, uint8_t *name, size_t len, int labs, uint16_t dclass)
Lookup closest encloser in name tree.
Definition: dnstree.c:178
static size_t read_http_headers(SSL *ssl, size_t *clen)
read http headers and process them
Definition: unbound-anchor.c:927
void val_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
inform validator super.
Definition: validator.c:3209
int num_threads
number of threads to create
Definition: config_file.h:80
static int rrsigs_copy_from_rrset_to_rrsigset(struct auth_rrset *rrset, struct auth_rrset *rrsigset)
copy the rrsigs from the rrset to the rrsig rrset, because the rrset is going to be deleted.
Definition: authzone.c:1066
static int write_ssl_line(SSL *ssl, const char *str, const char *sec)
write a line over SSL
Definition: unbound-anchor.c:831
int auth_xfer_cmp(const void *z1, const void *z2)
compare auth_xfer for sorted rbtree
Definition: authzone.c:334
struct iter_priv * priv_create(void)
Create priv structure.
Definition: iter_priv.c:55
static void sock_list_logentry(enum verbosity_value v, const char *s, struct sock_list *p)
log a sock_list entry
Definition: val_utils.c:1081
int is_pow2(size_t num)
See if number is a power of 2.
Definition: net_help.c:170
struct val_neg_cache * val_neg_create(struct config_file *cfg, size_t maxiter)
Create negative cache.
Definition: val_neg.c:86
struct val_neg_zone * neg_create_zone(struct val_neg_cache *neg, uint8_t *nm, size_t nm_len, uint16_t dclass)
Create a new zone.
Definition: val_neg.c:530
static void fetch_fill(struct iter_env *ie, const char *str)
fillup fetch policy array
Definition: iter_utils.c:77
struct rbtree_type * respip_set_get_tree(struct respip_set *set)
returns address of the IP address tree of the specified respip set; returns NULL for NULL input; exis...
Definition: respip.c:95
enum iter_state state
State of the iterator module.
Definition: iterator.h:230
size_t neg_cache_size
size of the neg cache
Definition: config_file.h:392
int local_data_answer(struct local_zone *z, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, int labs, struct local_data **ldp, enum localzone_type lz_type, int tag, struct config_strlist **tag_datas, size_t tag_datas_size, char **tagname, int num_tags)
Get local data from local zone and encode answer.
Definition: localzone.c:1359
#define DNSKEY_BIT_SEP
DNSKEY secure entry point, KSK flag.
Definition: net_help.h:95
static int az_remove_rr(struct auth_zone *z, uint8_t *rr, size_t rr_len, size_t dname_len, int *nonexist)
remove RR from zone, ignore if it does not exist, false on alloc failure
Definition: authzone.c:1265
static int rrset_remove_rr(struct auth_rrset *rrset, size_t index)
remove RR from existing RRset.
Definition: authzone.c:728
void msgparse_test(void)
unit test for msgreply and msgparse
Definition: unitmsgparse.c:503
int ub_event_add(struct ub_event *ev, struct timeval *tv)
Activate the event.
Definition: ub_event_pluggable.c:585
static int probe_date_allows_certupdate(const char *root_anchor_file)
Read autotrust 5011 probe file and see if the date compared to the current date allows a certupdate.
Definition: unbound-anchor.c:2183
uint8_t ** rr_data
Array of pointers to every rr's rdata.
Definition: packed_rrset.h:258
static int find_id(struct ub_ctx *ctx, int *id)
find next useful id number of 0 on error
Definition: context.c:125
void outbound_list_remove(struct outbound_list *list, struct outbound_entry *e)
Remove an entry from the list, and deletes it.
Definition: outbound_list.c:78
int rpz_apply_qname_trigger(struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, struct ub_server_stats *stats)
Walk over the RPZ zones to find and apply a QNAME trigger policy.
Definition: rpz.c:939
static struct packed_rrset_data * packed_rrset_heap_data(int iter(struct autr_ta **, uint8_t **, size_t *, size_t *), struct autr_ta *list)
Create packed_rrset data on the heap.
Definition: autotrust.c:655
static int should_be_bogus(struct ub_packed_rrset_key *rrset, struct query_info *qinfo)
return true if answer should be bogus
Definition: unitverify.c:133
void algo_needs_reason(struct module_env *env, int alg, char **reason, char *s)
Format error reason for algorithm missing.
Definition: val_sigcrypt.c:541
int bypass_cache_stage
whether the option needs to bypass the cache stage
Definition: module.h:219
int test_slabhash_compfunc(void *, void *)
test comparefunc for lruhash
Definition: slabhash.c:197
static int vbmp
verbose message parse unit test
Definition: unitmsgparse.c:59
size_t b32_len
length of base32 encoding (as a label)
Definition: val_nsec3.h:246
struct rpz * rpz_create(struct config_auth *p)
Create RPZ.
Definition: rpz.c:382
struct config_strlist * file_content
file contents to match, one string per line
Definition: replay.h:240
@ RESPONSE_TYPE_ANSWER
'answer' means that the response terminates the resolution process.
Definition: iter_resptype.h:63
static uint16_t rrset_get_sig_keytag(struct ub_packed_rrset_key *k, size_t sig_idx)
Get signature keytag value.
Definition: val_sigcrypt.c:108
static void dname_test_qdl(sldns_buffer *buff)
test query_dname_len function
Definition: unitdname.c:66
void ldns_test(void)
unit test for ldns functions
Definition: unitldns.c:224
uint8_t * context_serialize_answer(struct ctx_query *q, int err, struct sldns_buffer *pkt, uint32_t *len)
Serialize a context_query result to hand back to user.
Definition: context.c:296
size_t ub_rrset_sizefunc(void *key, void *data)
Calculate memory size of rrset entry.
Definition: packed_rrset.c:70
char * title
name of replay scenario.
Definition: replay.h:157
int use_key
do we want to use this anchor?
Definition: unbound-anchor.c:1206
static struct auth_master * find_master_by_host(struct auth_master *list, char *host)
find master (from notify or probe) in list of masters
Definition: authzone.c:3640
struct delegpt * dp
delegation point with forward server information for this zone.
Definition: iter_fwd.h:80
The rbnode_type struct definition.
Definition: rbtree.h:55
struct slabhash * msg_cache
shared message cache
Definition: module.h:329
static int az_rrset_find_rrsig(struct packed_rrset_data *d, uint8_t *rdata, size_t len, size_t *index)
find an rrsig index in the rrset.
Definition: authzone.c:683
lruhash_compfunc_type compfunc
the compare function for entries in this table.
Definition: lruhash.h:153
int MINIMAL_RESPONSES
minimal responses when positive answer: default is no
Definition: net_help.c:71
static void xml_append_ds(struct xml_data *data)
write the parsed xml-DS to the DS list
Definition: unbound-anchor.c:1496
lock_basic_type lock
a lock on this structure for thread safety
Definition: asynclook.c:76
@ VAL_CLASS_CNAMENOANSWER
A CNAME/DNAME chain, and the offset is at the end of it, but there is no answer here,...
Definition: val_utils.h:76
#define DNSCRYPT_SHARED_SECRET_KEY_LENGTH
Shared secret cache key length.
Definition: dnscrypt.c:52
void * fstrm_create_control_frame_finish(size_t *len)
This creates an FSTRM control frame of type FINISH.
Definition: dnstap_fstrm.c:151
int dname_signame_label_count(uint8_t *dname)
Count labels for the RRSIG signature label field.
Definition: dname.c:750
static void cfg_insert_respip_data(struct config_str2list **respip_actions, struct config_str2list **respip_data)
Populate raw respip redirect config data, used for both global and view-based respip redirect test ca...
Definition: unitmain.c:746
static void remote_write(SSL *ssl, int fd, const char *buf, size_t len)
write to ssl or fd, fatalexit on error
Definition: unbound-control.c:697
INLINE void sldns_buffer_write_u48_at(sldns_buffer *buffer, size_t at, uint64_t data)
writes the given 6 byte integer at the given position in the buffer
Definition: sbuffer.h:562
void key_cache_insert(struct key_cache *kcache, struct key_entry_key *kkey, struct module_qstate *qstate)
Insert or update a key cache entry.
Definition: val_kcache.c:83
rbtree_type * whitelist
White listed domains for ipsecmod.
Definition: ipsecmod.h:55
int commandpipe[2]
command pipe that stops the pipe if closed.
Definition: dtstream.h:171
long long qopcode[UB_STATS_OPCODE_NUM]
query opcodes
Definition: unbound.h:693
static int lz_enter_zone_tag(struct local_zones *zones, char *zname, uint8_t *list, size_t len, uint16_t rr_class)
enter tagstring into zone
Definition: localzone.c:584
@ rrset_trust_none
initial value for trust
Definition: packed_rrset.h:142
void timehist_clear(struct timehist *hist)
Clear histogram.
Definition: timehist.c:110
int sldns_str2wire_nsec3_salt_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSEC3_SALT from string to wireformat.
Definition: str2wire.c:1923
static struct dns_msg * rrset_msg(struct ub_packed_rrset_key *rrset, struct regional *region, time_t now, struct query_info *q)
synthesize RRset-only response from cached RRset item
Definition: dns.c:613
int auth_zone_set_fallback(struct auth_zone *z, char *fallbackstr)
set auth zone fallback.
Definition: authzone.c:572
void auth_xfer_pickup_initial(struct auth_zones *az, struct module_env *env)
initial pick up of worker timeouts, ties events to worker event loop
Definition: authzone.c:6655
struct config_file * cfg
the result of parsing is stored here.
Definition: config_file.h:1209
static int32_t read_last_success_time(const char *file)
read last successful probe time from autotrust file (if possible)
Definition: unbound-anchor.c:2146
size_t space_used
the amount of space used, roughly the number of bytes in use.
Definition: lruhash.h:178
static void tcp_proxy_list_clear(struct tcp_proxy *p)
clear TCP proxy list
Definition: delayer.c:916
#define TIMEOUT_COUNT_MAX
number of timeouts for a type when the domain can be blocked ; even if another type has completely rt...
Definition: infra.c:61
size_t len
length of name
Definition: val_neg.h:148
int bogus
If the result was not secure (secure==0), and this result is due to a security failure,...
Definition: unbound.h:196
int main(int argc, char *argv[])
Main routine for checkconf.
Definition: unbound-checkconf.c:907
int create_udp_sock(int family, int socktype, struct sockaddr *addr, socklen_t addrlen, int v6only, int *inuse, int *noproto, int rcv, int snd, int listen, int *reuseport, int transparent, int freebind, int use_systemd, int dscp)
Create and bind nonblocking UDP socket.
Definition: listen_dnsport.c:179
void name_tree_init_parents(rbtree_type *tree)
Initialize parent pointers in name tree.
Definition: dnstree.c:140
struct ub_packed_rrset_key * soa
if data contains zone apex SOA data, this is a ptr to it.
Definition: localzone.h:157
void sldns_buffer_copy(sldns_buffer *result, sldns_buffer *from)
Copy contents of the from buffer to the result buffer and then flips the result buffer.
Definition: sbuffer.c:151
tap socket
Definition: unbound-dnstap-socket.c:141
static void line_diff(const char *p, const char *q, const char *pdesc, const char *qdesc)
find line diff between strings
Definition: unitauth.c:722
struct ub_event * ev
ub_event event type
Definition: netevent.c:136
int sldns_wire2str_cert_alg_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat cert_alg field to string, with user buffers.
Definition: wire2str.c:1320
struct rrset_cache * rrset_cache_create(struct config_file *cfg, struct alloc_cache *alloc)
Create rrset cache.
Definition: rrset.c:59
Definition: subnetmod.h:71
static struct addredge * edge_create(struct addrnode *node, const addrkey_t *addr, addrlen_t addrlen, struct addrnode *parent_node, int parent_index)
Create a new edge.
Definition: addrtree.c:55
int use_client_certs
are client certificates in use
Definition: dtstream.h:216
static void xfr_set_timeout(struct auth_xfer *xfr, struct module_env *env, int failure, int lookup_only)
pick up nextprobe task to start waiting to perform transfer actions
Definition: authzone.c:6572
size_t nsec3_get_nextowner_b32(struct ub_packed_rrset_key *rrset, int r, uint8_t *buf, size_t max)
Get next owner name, converted to base32 encoding and with the zone name (taken from the nsec3 owner ...
Definition: val_nsec3.c:268
size_t val_neg_get_mem(struct val_neg_cache *neg)
see how much memory is in use by the negative cache.
Definition: val_neg.c:103
int dname_has_label(uint8_t *dname, size_t dnamelen, uint8_t *label)
Check if dname contains label.
Definition: dname.c:592
void mesh_log_list(struct mesh_area *mesh)
Print all the states in the mesh to the log.
Definition: mesh.c:1705
static void do_view_zone_add(RES *ssl, struct worker *worker, char *arg)
Add a new zone to view.
Definition: remote.c:1383
lock_basic_type qqpipe_lock
mutex on query write pipe
Definition: context.h:68
static void regional_init(struct regional *r)
init regional struct with first block
Definition: regional.c:73
int tcp_connect_errno_needs_log(struct sockaddr *addr, socklen_t addrlen)
See if errno for tcp connect has to be logged or not.
Definition: netevent.c:328
int sldns_wire2str_edns_option_print(char **str, size_t *str_len, uint16_t option_code, uint8_t *option_data, size_t option_len)
Print an EDNS option as OPT: VALUE.
Definition: wire2str.c:1943
void listen_list_delete(struct listen_list *list)
delete listen_list of commpoints.
Definition: listen_dnsport.c:1411
struct ub_packed_rrset_key * nc_rrset
NSEC3 record that proved nc.
Definition: val_nsec3.c:88
struct lruhash_entry entry
lruhash key entry
Definition: infra.h:160
char * str2
second string
Definition: config_file.h:749
void comm_point_drop_reply(struct comm_reply *repinfo)
Drop reply.
Definition: netevent.c:3181
void sock_list_merge(struct sock_list **list, struct regional *region, struct sock_list *add)
Merge socklist into another socket list.
Definition: net_help.c:823
int iter_indicates_dnssec(struct module_env *env, struct delegpt *dp, struct dns_msg *msg, uint16_t dclass)
See if delegation is expected to have DNSSEC information (RRSIGs) in its answers, or not.
Definition: iter_utils.c:799
int priv_apply_cfg(struct iter_priv *priv, struct config_file *cfg)
Process priv config.
Definition: iter_priv.c:147
struct mesh_area * mesh_create(struct module_stack *stack, struct module_env *env)
Allocate mesh, to empty.
Definition: mesh.c:242
@ UB_SOCKET
socket operation.
Definition: context.h:187
int tube_write_msg(struct tube *tube, uint8_t *buf, uint32_t len, int nonblock)
Write length bytes followed by message.
Definition: tube.c:285
void ub_openssl_lock_delete(void)
De-init the allocated openssl locks.
Definition: net_help.c:1355
static struct auth_data * az_domain_find_or_create(struct auth_zone *z, uint8_t *dname, size_t dname_len)
find or create domain with name in zone
Definition: authzone.c:635
int infra_edns_update(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, int edns_version, time_t timenow)
Update edns information for the host.
Definition: infra.c:641
EDNS data storage rdata is parsed in a list (has accessor functions).
Definition: msgparse.h:215
void comm_point_stop_listening(struct comm_point *c)
Stop listening for input on the commpoint.
Definition: netevent.c:3195
int fptr_whitelist_comm_point(comm_point_callback_type *fptr)
Check function pointer whitelist for comm_point callback values.
Definition: fptr_wlist.c:104
static void do_view_list_local_zones(RES *ssl, struct worker *worker, char *arg)
do the view_list_local_zones command
Definition: remote.c:2752
int anchors_apply_cfg(struct val_anchors *anchors, struct config_file *cfg)
Process trust anchor config.
Definition: val_anchor.c:1047
static int iter_new(struct module_qstate *qstate, int id)
new query for iterator
Definition: iterator.c:132
int val_nsec_check_dlv(struct query_info *qinfo, struct reply_info *rep, uint8_t **nm, size_t *nm_len)
Determine the DLV result, what to do with NSEC DLV reply.
Definition: val_nsec.c:568
void neg_insert_data(struct val_neg_cache *neg, struct val_neg_zone *zone, struct ub_packed_rrset_key *nsec)
Insert data into the data tree of a zone Does not do locking.
Definition: val_neg.c:748
response_type
The response type is used to interpret the response.
Definition: iter_resptype.h:52
static uint8_t rrsig_get_labcount(struct packed_rrset_data *d, size_t sig)
get label count for a signature
Definition: val_utils.c:762
int cfg_region_strlist_insert(struct regional *region, struct config_strlist **head, char *item)
insert with region for allocation.
Definition: config_file.c:1673
INLINE void sldns_buffer_flip(sldns_buffer *buffer)
makes the buffer ready for reading the data that has been written to the buffer.
Definition: sbuffer.h:207
struct delegpt_addr * next_usable
next delegation point in usable list
Definition: iter_delegpt.h:136
static int do_statetable(struct module_env *env, struct trust_anchor *tp, int *changed)
Do the statetable from RFC5011 transition matrix.
Definition: autotrust.c:1943
void dns_cache_store_msg(struct module_env *env, struct query_info *qinfo, hashvalue_type hash, struct reply_info *rep, time_t leeway, int pside, struct reply_info *qrep, uint32_t flags, struct regional *region)
Store message in the cache.
Definition: dns.c:156
struct ub_event_base * event_base
event base for event oriented interface
Definition: context.h:121
static void target_count_create(struct iter_qstate *iq)
create target count structure for this query
Definition: iterator.c:629
INLINE void sldns_buffer_skip(sldns_buffer *buffer, ssize_t count)
changes the buffer's position by COUNT bytes.
Definition: sbuffer.h:259
uint8_t done_pside4
if the parent-side ipv4 address has been looked up (last resort).
Definition: iter_delegpt.h:122
void ipset_clear(struct module_qstate *qstate, int id)
clear the ipset query-specific contents out of qstate
Definition: ipset.c:350
int ub_ctx_get_option(struct ub_ctx *ctx, const char *opt, char **str)
Get an option from the context.
Definition: libunbound.c:361
struct entry * read_datafile(const char *name, int skip_whitespace)
reads the canned reply file and returns a list of structs does an exit on error.
Definition: testpkts.c:673
static size_t waiting_udp_get_mem(struct pending *w)
get memory used by waiting udp
Definition: outside_network.c:2483
int listen_sslctx_setup_ticket_keys(void *sslctx, struct config_strlist *tls_session_ticket_keys)
setup TLS session ticket
Definition: net_help.c:1374
void ub_event_del_bits(struct ub_event *ev, short bits)
Configure the event so it will not longer fire on given bits.
Definition: ub_event.c:368
static uint32_t rrset_get_ttl(struct ub_packed_rrset_key *rrset)
return TTL of rrset
Definition: val_utils.c:327
struct comm_reply query_reply
the query reply destination, packet buffer and where to send.
Definition: mesh.h:220
uint8_t noprime
does the stub need to forego priming (like on other ports)
Definition: iter_hints.h:74
int auth_zones_notify(struct auth_zones *az, struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t dclass, struct sockaddr_storage *addr, socklen_t addrlen, int has_serial, uint32_t serial, int *refused)
process notify for auth zones.
Definition: authzone.c:3561
int sldns_str2wire_tsigerror_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TSIGERROR from string to wireformat.
Definition: str2wire.c:1401
static int sig_record_quit
How many quit requests happened.
Definition: daemon.c:100
long long num_query_dnscrypt_cleartext
number of queries in clear text and not asking for the certificates
Definition: unbound.h:762
#define LDNS_TSIG_ERROR_NOERROR
TSIG and TKEY extended rcodes (16bit), 0-15 are the normal rcodes.
Definition: rrdef.h:436
struct config_str2list * ratelimit_for_domain
ratelimits for domain (exact match)
Definition: config_file.h:541
void errinf(struct module_qstate *qstate, const char *str)
Append text to the error info for validation.
Definition: config_file.c:2379
#define BIT_RA
RA flag.
Definition: net_help.h:63
int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_type fptr)
Check function pointer whitelist for lruhash delkeyfunc callback values.
Definition: fptr_wlist.c:286
Contains all information about resource record types.
Definition: rrdef.h:450
static int mesh_serve_expired_init(struct mesh_state *mstate, int timeout)
Init the serve expired data structure.
Definition: mesh.c:419
static int dnsc_load_local_data(struct dnsc_env *dnscenv, struct config_file *cfg)
Insert local-zone and local-data into configuration.
Definition: dnscrypt.c:683
static void do_remtime(struct module_env *env, struct autr_ta *anchor, int *c)
Event: RemTime.
Definition: autotrust.c:1750
static void caps_free(struct rbnode_type *n, void *ATTR_UNUSED(d))
delete caps_whitelist element
Definition: iterator.c:103
void daemon_fork(struct daemon *daemon)
Fork workers and start service.
Definition: daemon.c:571
#define BIT_AA
AA flag.
Definition: net_help.h:69
int create_tcp_accept_sock(struct addrinfo *addr, int v6only, int *noproto, int *reuseport, int transparent, int mss, int freebind, int use_systemd, int dscp)
Create and bind TCP listening socket.
Definition: listen_dnsport.c:644
static void delete_replay_answer(struct replay_answer *a)
delete a replay answer
Definition: fake_event.c:186
uint8_t done_pside6
if the parent-side ipv6 address has been looked up (last resort).
Definition: iter_delegpt.h:126
char * dnstap_version
dnstap "version", package version is used if "".
Definition: config_file.h:507
static struct trust_anchor * anchor_new_ta(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass, int lockit)
create new trust anchor object
Definition: val_anchor.c:221
void ub_get_event_sys(struct ub_event_base *ub_base, const char **n, const char **s, const char **m)
Return the name, system and method for the pluggable event base.
Definition: ub_event_pluggable.c:437
static int ssl_http_write_more(struct comm_point *c)
write more data for http (with ssl)
Definition: netevent.c:2316
static char * next_space_pos(const char *str)
return next space character in string
Definition: config_file.c:2168
char * host
master IP address (and port), or hostname, string
Definition: authzone.h:436
struct module_func_block * cachedb_get_funcblock(void)
Get the function block with pointers to the cachedb functions.
void local_zone_delete(struct local_zone *z)
Delete one zone.
Definition: localzone.c:93
struct local_zones * local_zones
local authority zones
Definition: context.h:116
int sldns_wire2str_int16_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat int16 field to string, with user buffers.
Definition: wire2str.c:1037
rbnode_type * rbtree_search(rbtree_type *rbtree, const void *key)
Find key in tree.
Definition: rbtree.c:281
@ LDNS_RR_TYPE_RP
RFC1183.
Definition: rrdef.h:117
void key_entry_set_reason(struct key_entry_key *kkey, char *reason)
Set reason why a key is bad.
Definition: val_kentry.c:241
void val_check_nonsecure(struct module_env *env, struct reply_info *rep)
Remove all unsigned or non-secure status rrsets from NS and AR sections.
Definition: val_utils.c:927
INLINE void sldns_buffer_write_u48(sldns_buffer *buffer, uint64_t data)
writes the given 6 byte integer at the current position in the buffer
Definition: sbuffer.h:586
int edns_opt_append(struct edns_data *edns, struct regional *region, uint16_t code, size_t len, uint8_t *data)
Append edns option to edns data structure.
Definition: msgreply.c:946
@ local_zone_always_nxdomain
answer with nxdomain, even when there is local data
Definition: localzone.h:94
static struct auth_rrset * az_domain_rrset(struct auth_data *n, uint16_t t)
find rrset of given type in the domain
Definition: authzone.c:647
int inuse
number of queries outstanding on this socket, used by outside network for udp ports
Definition: netevent.h:287
struct slabhash * subnet_msg_cache
shared message cache key: struct query_info* data: struct subnet_msg_cache_data*
Definition: subnetmod.h:59
int ub_ctx_set_tls(struct ub_ctx *ctx, int tls)
Use DNS over TLS to send queries to machines set with ub_ctx_set_fwd().
Definition: libunbound.c:977
enum sec_status security
The security status from DNSSEC validation of this message.
Definition: msgreply.h:168
#define AUTH_PROBE_TIMEOUT
timeout for probe packets for SOA
Definition: authzone.c:78
static struct timeval * ring_peek_time(struct ringbuf *r)
peek at timevalue for next item in ring
Definition: delayer.c:294
static void q_ans_query(struct q_ans *q, struct auth_zones *az, struct query_info *qinfo, struct regional *region, int expected_fallback, uint8_t *dp_nm, size_t dp_nmlen)
make q_ans query
Definition: unitauth.c:765
size_t num_msgs
number of msgs removed
Definition: remote.c:1611
Definition: dynlibmod.h:114
void lruhash_insert(struct lruhash *table, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *cb_arg)
Insert a new element into the hashtable.
Definition: lruhash.c:300
size_t _capacity
The amount of data the buffer can contain.
Definition: sbuffer.h:125
int cfg_str2list_insert(struct config_str2list **head, char *item, char *i2)
Insert string into str2list.
Definition: config_file.c:1750
void * regional_alloc(struct regional *r, size_t size)
Allocate size bytes of memory inside regional.
Definition: regional.c:122
struct sock_list * reply_origin
origin of the reply (can be NULL from cache, list for cnames)
Definition: module.h:614
uint16_t bits
the EDNS bits field from ttl (host order): Z
Definition: msgparse.h:223
static enum module_ext_state handle_ipv6_ptr(struct module_qstate *qstate, int id)
Handle PTR queries for IPv6 addresses.
Definition: dns64.c:455
size_t unwanted_threshold
what threshold for unwanted action.
Definition: config_file.h:270
static void fill_buffer_with_reply(sldns_buffer *buffer, struct entry *entry, uint8_t *q, size_t qlen, int tcp_pkt_counter)
Fill buffer with reply from the entry.
Definition: fake_event.c:326
int ub_ctx_data_add(struct ub_ctx *ctx, const char *data)
Add localdata to the library local authority info.
Definition: libunbound.c:1352
lock_rw_type lock
rwlock for access to the contents of the entry Note that it does not cover the lru_ and overflow_ ptr...
Definition: lruhash.h:210
static void swap_np(rbnode_type **x, rbnode_type **y)
helpers for delete: swap node pointers
Definition: rbtree.c:299
int parse_extract_edns(struct msg_parse *msg, struct edns_data *edns, struct regional *region)
After parsing the packet, extract EDNS data from packet.
Definition: msgparse.c:967
struct autr_point_data * autr
Autotrust anchor point data, or NULL.
Definition: val_anchor.h:112
int dynlibmod_init(struct module_env *env, int id)
dynlib module init
Definition: dynlibmod.c:73
void rtt_lost(struct rtt_info *rtt, int orig)
Update the statistics with a new timeout expired observation.
Definition: rtt.c:100
size_t packed_rrset_sizeof(struct packed_rrset_data *d)
Memory size of rrset data.
Definition: packed_rrset.c:80
void * cb_arg
callback user argument
Definition: replay.h:344
static uint8_t * reply_nsec_signer(struct reply_info *rep, size_t *signer_len, uint16_t *dclass)
see if the reply has signed NSEC records and return the signer
Definition: val_neg.c:852
int val_neg_data_compare(const void *a, const void *b)
Comparison function for rbtree val neg data elements.
Definition: val_neg.c:65
static void event_reg_install(FILE *out, const char *pathname)
install registry entries for eventlog
Definition: w_inst.c:73
socklen_t addrlen
length of addr, if 0, then any address will do
Definition: replay.h:230
struct sldns_struct_lookup_table * sldns_opcodes
Operation codes.
Definition: wire2str.c:111
size_t sldns_b32_pton_calculate_size(size_t src_text_length)
calculates the size needed to store the result of b32_pton
Definition: parseutil.c:454
struct addrnode * addrtree_find(struct addrtree *tree, const addrkey_t *addr, addrlen_t sourcemask, time_t now)
Find a node containing an element in the tree.
Definition: addrtree.c:474
void lru_demote(struct lruhash *table, struct lruhash_entry *entry)
Demote entry, so it becomes the least recently used in the LRU list.
Definition: lruhash.c:553
void(* callback)(int, void *)
callback function, takes signal number and user arg
Definition: netevent.h:343
struct module_func_block * ipsecmod_get_funcblock(void)
Get the function block with pointers to the ipsecmod functions.
void infra_delete(struct infra_cache *infra)
Delete infra cache.
Definition: infra.c:282
static void print_dp_main(RES *ssl, struct delegpt *dp, struct dns_msg *msg)
print main dp info
Definition: cachedump.c:789
#define START_IO_INTERVAL
number of msec between starting io ports
Definition: perf.c:143
int timeout
original timeout in seconds from 'then'
Definition: replay.h:346
#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT
Definition: rrdef.c:627
long long qtls
number of queries over (DNS over) TLS
Definition: unbound.h:699
int fptr_whitelist_pending_tcp(comm_point_callback_type *fptr)
Check function pointer whitelist for pending tcp callback values.
Definition: fptr_wlist.c:202
struct service_callback * next
next in callback list
Definition: outside_network.h:308
int depth
The depth of this query, this means the depth of recursion.
Definition: iterator.h:246
static void init_parents(struct val_anchors *anchors)
initialise parent pointers in the tree
Definition: val_anchor.c:189
static int chunkline_get_line_collated(struct auth_chunk **chunk, size_t *chunk_pos, sldns_buffer *buf)
find a line with ( ) collated
Definition: authzone.c:4214
int dns_msg_ansadd(struct dns_msg *msg, struct regional *region, struct ub_packed_rrset_key *rrset, time_t now)
Add rrset to authority section in unpacked dns_msg message.
Definition: dns.c:451
static void do_view_datas_add(RES *ssl, struct worker *worker, char *arg)
Add new RR data from stdin to view.
Definition: remote.c:1464
static void checkfile(char *f1, char *f2)
check that file is the same as other file
Definition: unitauth.c:549
void * incoming_ssl_fd(void *sslctx, int fd)
accept a new fd and wrap it in a BIO in SSL
Definition: net_help.c:1205
struct ub_event * ub_event_new(struct ub_event_base *, int fd, short bits, void(*cb)(int, short, void *), void *arg)
Create a new ub_event for the event base.
Definition: ub_event.c:290
int ub_c_parse(void)
the yacc lex generated parse function
int sldns_wire2str_apl_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat apl field to string, with user buffers.
Definition: wire2str.c:1155
int use_rpz
some RPZ policies are configured
Definition: daemon.h:136
INLINE void sldns_buffer_write_at(sldns_buffer *buffer, size_t at, const void *data, size_t count)
writes the given data to the buffer at the specified position
Definition: sbuffer.h:434
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval)
Hash key made of 4byte chunks.
Definition: lookup3.c:218
PyObject * func_inform
Module super_inform function.
Definition: pythonmod.c:94
int ub_wait(struct ub_ctx *ctx)
Wait for a context to finish with results.
Definition: libunbound.c:626
static int copy_msg(struct regional *region, struct lruhash_entry *e, struct query_info **k, struct reply_info **d)
copy msg to worker pad
Definition: cachedump.c:223
static int check_no_anchor(struct val_anchors *anchors, uint8_t *nm, size_t l, uint16_t c)
check no anchor and unlock
Definition: val_utils.c:1001
void respip_set_delete(struct respip_set *set)
Delete response IP set.
Definition: respip.c:84
static int msg_rrset_duplicate(struct dns_msg *msg, uint8_t *nm, size_t nmlen, uint16_t type, uint16_t dclass)
see if rrset is a duplicate in the answer message
Definition: authzone.c:203
void tap_data_free(struct tap_data *data)
delete the tap structure
Definition: unbound-dnstap-socket.c:758
int optind
getopt global, in case header files fail to declare it.
int use_syslog
should log messages be sent to syslogd
Definition: config_file.h:296
void log_err_addr(const char *str, const char *err, struct sockaddr_storage *addr, socklen_t addrlen)
Log errno and addr.
Definition: net_help.c:575
static int delno
number of deleted files
Definition: unitauth.c:462
int netblockdnametoaddr(uint8_t *dname, size_t dnamelen, struct sockaddr_storage *addr, socklen_t *addrlen, int *net, int *af)
RPZ format netblock to network byte order address and netblock example RPZ netblock format dnames:
Definition: net_help.c:396
int hints_apply_cfg(struct iter_hints *hints, struct config_file *cfg)
Process hints config.
Definition: iter_hints.c:431
void comm_point_udp_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:681
static void do_moment_and_advance(struct replay_runtime *runtime)
Perform actions or checks determined by the moment.
Definition: fake_event.c:736
int inplace_cb_register(void *cb, enum inplace_cb_list_type type, void *cbarg, struct module_env *env, int id)
Register an inplace callback function.
Definition: module.c:127
uint8_t revoked
revoked TA was seen
Definition: autotrust.h:83
static int answer_chaos(struct worker *w, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *pkt)
Answer CH class queries.
Definition: worker.c:928
int local_zone_str2type(const char *str, enum localzone_type *t)
Parse the string into localzone type.
Definition: localzone.c:1771
struct infra_cache * infra_adjust(struct infra_cache *infra, struct config_file *cfg)
Adjust infra cache to use updated configuration settings.
Definition: infra.c:294
int num
the number of modules
Definition: modstack.h:52
void val_find_signer(enum val_classification subtype, struct query_info *qinf, struct reply_info *rep, size_t cname_skip, uint8_t **signer_name, size_t *signer_len)
Given a response, determine the name of the "signer".
Definition: val_utils.c:217
int fptr_whitelist_mod_init(int(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module init call values.
Definition: fptr_wlist.c:389
struct reply_info * reply_info_copy(struct reply_info *rep, struct alloc_cache *alloc, struct regional *region)
Copy reply_info and all rrsets in it and allocate.
Definition: msgreply.c:700
#define UB_STATS_OPCODE_NUM
number of opcodes in stats
Definition: unbound.h:656
int fptr_whitelist_mod_operate(void(*fptr)(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound))
Check function pointer whitelist for module operate call values.
Definition: fptr_wlist.c:445
@ LDNS_RDF_TYPE_ILNP64
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
Definition: rrdef.h:334
uint8_t magic_query[DNSCRYPT_MAGIC_HEADER_LEN]
the client_magic used by the client, this is associated to 1 cert only
Definition: dnscrypt.c:68
struct outside_network * back
the backside outside network interface to the auth servers
Definition: worker.h:96
@ comm_ssl_shake_hs_read
ssl_write wants to read
Definition: netevent.h:202
@ module_event_noreply
no reply, timeout or other error
Definition: module.h:561
struct service_callback * cblist
list of interested parties that need callback on results.
Definition: outside_network.h:392
void auth_zones_cleanup(struct auth_zones *az)
Cleanup auth zones.
Definition: authzone.c:6674
static char * massage_qname(const char *nm, int *reverse)
massage input name
Definition: unbound-host.c:164
void daemon_remote_start_accept(struct daemon_remote *rc)
Stop accept handlers for TCP (until enabled again)
Definition: remote.c:436
static void dl_tv_subtract(struct timeval *t1, const struct timeval *t2)
timeval subtract, t1 -= t2
Definition: delayer.c:186
struct local_rrset * local_alias
same as that in query_info.
Definition: mesh.h:232
static int http_parse_ttl(sldns_buffer *buf, struct sldns_file_parse_state *pstate)
process $TTL for http
Definition: authzone.c:4271
INLINE uint8_t * sldns_buffer_end(sldns_buffer *buffer)
returns a pointer to the end of the buffer (the data at the buffer's limit).
Definition: sbuffer.h:356
static void usage(char *argv[])
usage information for pktview
Definition: pktview.c:52
static void neg_lru_touch(struct val_neg_cache *neg, struct val_neg_data *data)
Touch LRU for data element, put it at the start of the LRU list.
Definition: val_neg.c:179
int rrset_insert_rr(struct regional *region, struct packed_rrset_data *pd, uint8_t *rdata, size_t rdata_len, time_t ttl, const char *rrstr)
insert RR into RRset data structure; Wastes a couple of bytes
Definition: localzone.c:358
static hashvalue_type hash_infra(struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name)
calculate infra hash for a key
Definition: infra.c:355
void forwards_delete(struct iter_forwards *fwd)
Delete forwards.
Definition: iter_fwd.c:99
void comm_timer_set(struct comm_timer *timer, struct timeval *tv)
reset timevalue for timer.
Definition: fake_event.c:1515
INLINE void sldns_buffer_write_u16(sldns_buffer *buffer, uint16_t data)
writes the given 2 byte integer at the current position in the buffer
Definition: sbuffer.h:536
int do_udp
do udp query support.
Definition: config_file.h:93
@ LDNS_RR_COMPRESS
compression is allowed
Definition: rrdef.h:74
char ** argv
array of names to query
Definition: asynclook.c:182
static void ub_ctx_error_exit(struct ub_ctx *ctx, const char *str, const char *str2)
print ub context creation error and exit
Definition: unbound-anchor.c:267
void views_print(struct views *v)
Debug helper.
Definition: view.c:244
struct waiting_tcp * pending_tcp_query(struct serviced_query *sq, sldns_buffer *packet, int timeout, comm_point_callback_type *callback, void *callback_arg)
Send TCP query.
Definition: outside_network.c:1319
int ub_signal_add(struct ub_event *ev, struct timeval *tv)
Activate a signal event.
Definition: ub_event_pluggable.c:630
rbnode_type node
rbnode in all tree
Definition: lock_verify.c:71
static void answer_notify(struct worker *w, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *pkt, struct comm_reply *repinfo)
Answer notify queries.
Definition: worker.c:989
lock_rw_type lock
lock on the view tree
Definition: view.h:58
struct edns_option * edns_opt_copy_region(struct edns_option *list, struct regional *region)
Copy edns option list allocated to the new region.
Definition: msgreply.c:1143
static void assembled_rrset_delete(struct ub_packed_rrset_key *pkey)
delete assembled rrset
Definition: val_anchor.c:99
int sldns_wire2str_eui48_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat EUI48 field to string, with user buffers.
Definition: wire2str.c:1666
static int dnsc_read_from_file(char *fname, char *buf, size_t count)
Read the content of fname into buf.
Definition: dnscrypt.c:535
void mesh_delete_all(struct mesh_area *mesh)
Delete all mesh states from the mesh.
Definition: mesh.c:304
static int massage_type(const char *t, int reverse, int *multi)
massage input type
Definition: unbound-host.c:184
void addrtree_delete(struct addrtree *tree)
Free tree and all nodes below.
Definition: addrtree.c:275
struct regional * regional_create_custom(size_t size)
Create a new region, with custom settings.
Definition: regional.c:84
uint8_t _dname_count
The number of DNAMEs in the _wireformat string, for parsing.
Definition: rrdef.h:466
struct sockaddr_storage addr
remote client address
Definition: delayer.c:123
int sldns_wire2str_int8_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat int8 field to string, with user buffers.
Definition: wire2str.c:1027
static size_t dnskey_get_keysize(struct packed_rrset_data *data, size_t idx)
Get size of key in keyset.
Definition: val_kentry.c:371
void config_delauths(struct config_auth *list)
Delete items in config auth list.
Definition: config_file.c:1339
int iter_ns_probability(struct ub_randstate *rnd, int n, int m)
Select randomly with n/m probability.
Definition: iter_utils.c:664
int acl_list_apply_cfg(struct acl_list *acl, struct config_file *cfg, struct views *v)
Process access control config.
Definition: acl_list.c:437
void wsvc_cron_cb(void *arg)
windows cron timer callback handler
Definition: win_svc.c:594
uint8_t * b32
the hash result in base32 encoding
Definition: val_nsec3.h:244
void log_packed_rrset(enum verbosity_value v, const char *str, struct ub_packed_rrset_key *rrset)
Print the string with prefix, one rr per line.
Definition: packed_rrset.c:299
int cfg_count_numbers(const char *str)
Count number of values in the string.
Definition: config_file.c:1833
static int ring_pop(struct ringbuf *r, sldns_buffer *pkt, struct timeval *tv, struct proxy **p)
get entry from ringbuffer
Definition: delayer.c:303
static int rr_is_dnskey_sep(uint16_t t, uint8_t *rdata, size_t len)
Check if KSK DNSKEY.
Definition: autotrust.c:291
void ipsecmod_deinit(struct module_env *env, int id)
Deinit the ipsecmod module.
time_t ub_packed_rrset_ttl(struct ub_packed_rrset_key *key)
Get TTL of rrset.
Definition: packed_rrset.c:318
struct rbtree_type * respip_set_get_tree(struct respip_set *set)
returns address of the IP address tree of the specified respip set; returns NULL for NULL input; exis...
Definition: respip.c:95
struct ub_event_base * ub_default_event_base(int sigs, time_t *time_secs, struct timeval *time_tv)
Return a default event base.
Definition: ub_event.c:210
struct config_parser_state * cfg_parser
global config during parsing
Definition: config_file.c:83
static BIO * do_chunked_read(SSL *ssl)
read chunked data from connection
Definition: unbound-anchor.c:989
static void do_stub_remove(RES *ssl, struct worker *worker, char *args)
do the stub_remove command
Definition: remote.c:2218
int iter_dp_cangodown(struct query_info *qinfo, struct delegpt *dp)
See if delegpt can go down a step to the qname or not.
Definition: iter_utils.c:1377
void delegpt_free_mlc(struct delegpt *dp)
free malloced delegation point.
Definition: iter_delegpt.c:547
void addr_mask(struct sockaddr_storage *addr, socklen_t len, int net)
Make sure the sockaddr ends in zeroes.
Definition: net_help.c:677
#define fptr_ok(x)
Macro to perform an assertion check for fptr wlist checks.
Definition: fptr_wlist.h:70
static void fwd_init_parents(struct iter_forwards *fwd)
initialise parent pointers in the tree
Definition: iter_fwd.c:150
enum sec_status nsec3_prove_nameerror(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey)
Determine if the set of NSEC3 records provided with a response prove NAME ERROR.
Definition: val_nsec3.c:1065
void ub_event_base_free(struct ub_event_base *base)
Free event base.
Definition: ub_event_pluggable.c:476
int index
index in the out array of the interface
Definition: outside_network.h:207
int log_servfail
log servfails with a reason
Definition: config_file.h:308
per worker statistics.
Definition: unbound.h:663
PyObject * data
Module data.
Definition: pythonmod.c:100
static void auth_free_master_addrs(struct auth_addr *list)
free master addr list
Definition: authzone.c:2051
int sldns_wire2str_loc_scan(uint8_t **d, size_t *dl, char **str, size_t *sl)
Scan wireformat LOC field to string, with user buffers.
Definition: wire2str.c:1384
void algo_needs_reason(struct module_env *env, int alg, char **reason, char *s)
Format error reason for algorithm missing.
Definition: val_sigcrypt.c:541
void(* ev_cb)(int, short, void *)
the callback, for the event, ev_cb(fd, bits, arg)
Definition: unbound-dnstap-socket.c:149
void val_reply_remove_auth(struct reply_info *rep, size_t index)
Remove rrset with index from reply, from the authority section.
Definition: val_utils.c:914
int sldns_wire2str_rdata_unknown_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat rdata to string in unknown format, with user buffers.
Definition: wire2str.c:748
struct ub_ctx * ub_ctx_create(void)
Create a resolving and validation context.
Definition: libunbound.c:165
static char * service_cfgfile
config file to open.
Definition: win_svc.c:68
static int service_findwait(struct timeval *now, struct timeval *wait, struct ringbuf *ring, struct tcp_proxy *tcplist)
find waiting time
Definition: delayer.c:839
struct val_neg_data * last
last in lru (least recently used element)
Definition: val_neg.h:76
int sldns_hexdigit_to_int(char ch)
Returns the int value of the given (hex) digit.
Definition: parseutil.c:187
time_t expiry
expiry time (from SOA), time until zone data is not considered valid any more, if no master responds ...
Definition: authzone.h:266
int fptr_whitelist_tube_listen(tube_callback_type *fptr)
Check function pointer whitelist for tube listen handler values.
Definition: fptr_wlist.c:566
void tcp_req_info_delete(struct tcp_req_info *req)
Delete tcp request structure.
Definition: listen_dnsport.c:1611
long long ans_secure
answers that were secure (AD)
Definition: unbound.h:727
fd_set rset
readset
Definition: perf.c:116
int inplace_cb_reply_cache_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply_cache linked list.
Definition: msgreply.c:1066
@ module_error
module could not finish the query
Definition: module.h:545
struct edns_option * opt_list
rdata element list, or NULL if none
Definition: msgparse.h:227
size_t key_cache_slabs
slabs in the key cache.
Definition: config_file.h:390
struct module_func_block * pythonmod_get_funcblock(void)
Get the module function block.
Definition: pythonmod.c:587
void dnsc_key_to_fingerprint(char fingerprint[80U], const uint8_t *const key)
Helper function to convert a binary key into a printable fingerprint.
Definition: dnscrypt.c:626
#define S_NUMBER_OR_ZERO(str, var)
put integer_or_zero into variable
Definition: config_file.c:397
Pending queries to network, fake replay version.
Definition: replay.h:328
sldns_rdf_type sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor, size_t field)
returns the rdf type for the given rdata field number of the rr type for the given descriptor.
Definition: rrdef.c:674
int listen_sslctx_setup(void *ctxt)
Set SSL_OP_NOxxx options on SSL context to disable bad crypto.
Definition: net_help.c:888
#define PARSE_TABLE_SIZE
number of buckets in parse rrset hash table.
Definition: msgparse.h:75
void outnet_tcptimer(void *arg)
callback for outgoing TCP timer event
Definition: outside_network.c:1286
struct timeval delay_tv
timeout for delayclose
Definition: outside_network.h:108
void wsvc_setup_worker(struct worker *worker)
Setup lead worker events.
Definition: win_svc.c:607
struct comm_timer * timer
timeout event
Definition: outside_network.h:231
struct regional * scratch
region for temporary usage.
Definition: module.h:465
static int tap_socket_list_insert(struct tap_socket_list **liststart, struct tap_socket *s)
add tap socket to list
Definition: unbound-dnstap-socket.c:370
int cfg_parse_memsize(const char *str, size_t *res)
Convert a 'nice' memory or file size into a bytecount From '100k' to 102400.
Definition: config_file.c:1868
int log_queries
log queries with one line per query
Definition: config_file.h:300
struct ub_event * ub_event_new(struct ub_event_base *base, int fd, short bits, void(*cb)(int, short, void *), void *arg)
Create a new ub_event for the event base.
Definition: ub_event.c:290
static int parse_section(sldns_buffer *pkt, struct msg_parse *msg, struct regional *region, sldns_pkt_section section, uint16_t num_rrs, size_t *num_rrsets)
Parse packet RR section, for answer, authority and additional sections.
Definition: msgparse.c:821
static void xml_charhandle(void *userData, const XML_Char *s, int len)
XML handle character data, the data inside an element.
Definition: unbound-anchor.c:1243
lock_basic_type cfglock
mutex for access to env.cfg, finalized and dothread
Definition: context.h:78
rbtree_type tree
tree of NSEC data for this zone, sorted canonical by NSEC owner name
Definition: val_neg.h:123
struct key_entry_key * key_entry_create_bad(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
Create a bad entry, in the given region.
Definition: val_kentry.c:324
void timehist_clear(struct timehist *hist)
Clear histogram.
Definition: timehist.c:110
static int comm_point_tcp_handle_write(int fd, struct comm_point *c)
Handle tcp writing callback.
Definition: netevent.c:1517
@ LDNS_RDF_TYPE_TSIGTIME
tsig time 48 bits
Definition: rrdef.h:306
static void alloc_test(void)
test alloc code
Definition: unitmain.c:75
long long mem_stream_wait
number of bytes in the stream wait buffers
Definition: unbound.h:789
long long num_queries_ip_ratelimited
number of queries that have been dropped/ratelimited by ip.
Definition: unbound.h:667
void mesh_report_reply(struct mesh_area *mesh, struct outbound_entry *e, struct comm_reply *reply, int what)
Handle new event from the wire.
Definition: mesh.c:756
struct comm_point * tcp_parent
parent communication point (for TCP sockets)
Definition: netevent.h:174
void comm_base_dispatch(struct comm_base *b)
Dispatch the comm base events.
Definition: netevent.c:243
static void verb_cert(const char *msg, X509 *x)
printout certificate in detail
Definition: unbound-anchor.c:321
struct iter_hints * hints
iterator forwarder information.
Definition: module.h:509
Trust anchor key.
Definition: val_anchor.h:79
void context_release_alloc(struct ub_ctx *ctx, struct alloc_cache *alloc, int locking)
Release an alloc.
Definition: context.c:206
long long qbit_Z
number of queries with Z bit
Definition: unbound.h:713
sldns_enum_rdf_type
The different types of RDATA fields.
Definition: rrdef.h:264
auth zone master upstream, and the config settings for it
Definition: authzone.h:432
int modstack_config(struct module_stack *stack, const char *module_conf)
Read config file module settings and set up the modfunc block.
Definition: modstack.c:99
size_t autr_get_num_anchors(struct val_anchors *anchors)
See if autotrust anchors are configured and how many.
Definition: autotrust.c:106
@ RESPONSE_TYPE_THROWAWAY
'throwaway' means that this particular response should be discarded and the next nameserver should be...
Definition: iter_resptype.h:78
int fptr_whitelist_hash_compfunc(lruhash_compfunc_type fptr)
Check function pointer whitelist for lruhash compfunc callback values.
Definition: fptr_wlist.c:269
#define O_UNS(opt, str, var)
compare and print unsigned option
Definition: config_file.c:838
struct addr_tree_node * addr_tree_find(rbtree_type *tree, struct sockaddr_storage *addr, socklen_t addrlen, int net)
Find element in addr tree.
Definition: dnstree.c:241
static void daemon_create_workers(struct daemon *daemon)
Allocate empty worker structures.
Definition: daemon.c:424
int ssl
use ssl for channel
Definition: authzone.h:447
void respip_clear(struct module_qstate *qstate, int id)
response-ip cleanup query state
Definition: respip.c:1258
struct dt_msg_queue * dt_msg_queue_create(void)
Create new (empty) worker message queue.
Definition: dtstream.c:102
void bin_overflow_remove(struct lruhash_bin *bin, struct lruhash_entry *entry)
Remove entry from bin overflow chain.
Definition: lruhash.c:167
static int processFinished(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
The Finished state.
Definition: validator.c:2141
static const char * trustanchor_state2str(autr_state_type s)
string for a trustanchor state
Definition: autotrust.c:1067
static struct delegpt * parse_delegpt(RES *ssl, char *args, uint8_t *nm, int allow_names)
parse args into delegpt
Definition: remote.c:1988
size_t edns_buffer_size
EDNS buffer size to use.
Definition: config_file.h:144
char * dlv_anchor_file
DLV anchor file.
Definition: config_file.h:335
int numq
number of queries to do
Definition: asynclook.c:184
static void run_scenario(struct replay_runtime *runtime)
run the scenario in event callbacks
Definition: fake_event.c:814
void * ssl_ctx
ssl context for the io thread, for tls connections.
Definition: dtstream.h:132
int rpz_clear(struct rpz *r)
Clear local-zones and respip data in RPZ, used after reloading file or AXFR/HTTP transfer.
Definition: rpz.c:313
static int matches_nolocation
if matching within a section should disregard the order of RRs.
Definition: unitmsgparse.c:63
int sockaddr_cmp(struct sockaddr_storage *addr1, socklen_t len1, struct sockaddr_storage *addr2, socklen_t len2)
Compare two sockaddrs.
Definition: net_help.c:596
struct ctx_query * context_new(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, ub_callback_type cb, ub_event_callback_type cb_event, void *cbarg)
Create new query in context, add to querynum list.
Definition: context.c:139
int fptr_whitelist_rbtree_cmp(int(*fptr)(const void *, const void *))
Check function pointer whitelist for rbtree cmp callback values.
Definition: fptr_wlist.c:219
int control_frame
Set to 1 if this is a control frame, 0 otherwise (ie data frame).
Definition: dtstream.h:109
static void fatal(const char *str)
fatal exit
Definition: anchor-update.c:58
size_t sldns_b64_ntop_calculate_size(size_t srcsize)
calculates the size needed to store the result of b64_ntop
Definition: parseutil.c:607
void iter_mark_pside_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
Mark targets that result in a dependency cycle as done, so they will not get selected as targets.
Definition: iter_utils.c:716
@ VAL_FINDKEY_STATE
find the proper keys for validation, follow trust chain
Definition: validator.h:135
void errinf_origin(struct module_qstate *qstate, struct sock_list *origin)
Append text to error info: from 1.2.3.4.
Definition: config_file.c:2404
struct ub_randstate * seed_rnd
random state used to seed new random state structures
Definition: context.h:118
int mesh_detect_cycle(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec)
Find cycle; see if the given mesh is in the targets sub, or sub-sub, ...
Definition: mesh.c:1784
int ce_rr
NSEC3 record that proved ce.
Definition: val_nsec3.c:86
static double perform_arith(double x, char op, double y, double *res)
perform arithmetic operator
Definition: replay.c:702
static const char * zone_example_com
auth zone for test
Definition: unitauth.c:68
void tcp_req_info_handle_writedone(struct tcp_req_info *req)
Handle write done of the last result packet.
Definition: listen_dnsport.c:1783
static void recv_one(int fd, int udp, SSL *ssl, sldns_buffer *buf)
receive DNS datagram over TCP and print it
Definition: streamtcp.c:201
@ INIT_REQUEST_3_STATE
Stub priming events reactivate here, most other events pass through this naturally as the 3rd part of...
Definition: iterator.h:187
void msg_cache_remove(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags)
Remove entry from the message cache.
Definition: dns.c:115
struct sldns_struct_lookup_table * sldns_tsig_errors
tsig errors are the rcodes with extra (higher) values
Definition: wire2str.c:197
static void print_neg_cache(struct val_neg_cache *neg)
debug printout of neg cache
Definition: unitneg.c:54
lock_quick_type lock
lock, only used for the super.
Definition: alloc.h:74
void dns64_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
dns64 operate on a query
Definition: dns64.c:670
static struct acl_addr * acl_list_insert(struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen, int net, enum acl_access control, int complain_duplicates)
insert new address into acl_list structure
Definition: acl_list.c:77
static void usage(char *argv[])
usage information for asynclook
Definition: asynclook.c:97
void lruhash_remove(struct lruhash *table, hashvalue_type hash, void *key)
Remove entry from hashtable.
Definition: lruhash.c:378
@ LDNS_RR_TYPE_RT
RFC1183.
Definition: rrdef.h:125
struct mesh_state * mesh_area_find(struct mesh_area *mesh, struct respip_client_info *cinfo, struct query_info *qinfo, uint16_t qflags, int prime, int valrec)
Find a mesh state in the mesh area.
Definition: mesh.c:1425
static int lookup_reg_int(const char *key, const char *name)
Obtain registry integer (if it exists).
Definition: win_svc.c:199
void iter_deinit(struct module_env *env, int id)
iterator deinit
Definition: iterator.c:112
static void rbtree_rotate_left(rbtree_type *rbtree, rbnode_type *node)
rotate subtree left (to preserve redblack property)
Definition: rbtree.c:108
int local_zone_enter_defaults(struct local_zones *zones, struct config_file *cfg)
enter default zones
Definition: localzone.c:782
@ module_event_pass
query passed by other module
Definition: module.h:557
char * name
name to look up
Definition: asynclook.c:84
uint8_t match_ttl
match ttls in the packet
Definition: testpkts.h:188
void addr_to_str(struct sockaddr_storage *addr, socklen_t addrlen, char *buf, size_t len)
Put address into string, works for IPv4 and IPv6.
Definition: net_help.c:733
static int parse_var_line(char *line, struct val_anchors *anchors, struct trust_anchor **anchor)
Parse variable from trustanchor header.
Definition: autotrust.c:849
static void synthesize_aaaa(const uint8_t prefix_addr[], size_t prefix_addr_len, int prefix_net, const uint8_t a[], size_t a_len, uint8_t aaaa[], size_t aaaa_len)
Synthesize an IPv6 address based on an IPv4 address and the DNS64 prefix.
Definition: dns64.c:295
int infra_host(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen, time_t timenow, int *edns_vs, uint8_t *edns_lame_known, int *to)
Find host information to send a packet.
Definition: infra.c:437
long long num_neg_cache_noerror
number of times neg cache records were used to generate NOERROR responses.
Definition: unbound.h:779
struct internal_timer * ev_timer
the internal event stuff (derived)
Definition: netevent.h:323
int nsec3_get_nextowner(struct ub_packed_rrset_key *rrset, int r, uint8_t **next, size_t *nextlen)
Return nsec3 RR next hashed owner name.
Definition: val_nsec3.c:222
int ub_event_del(struct ub_event *ev)
Deactivate the event.
Definition: ub_event.c:393
static int worker_err_ratelimit(struct worker *worker, int err)
ratelimit error replies
Definition: worker.c:308
int sldns_wire2str_opcode_print(char **str, size_t *str_len, int opcode)
Print host format opcode to string.
Definition: wire2str.c:862
size_t prev_rr_len
length of the previous domain name, in bytes.
Definition: str2wire.h:226
Data stored for an RR during parsing.
Definition: msgparse.h:181
int val_has_signed_nsecs(struct reply_info *rep, char **reason)
check if has dnssec info, and if it has signed nsecs.
Definition: val_utils.c:1111
struct sldns_buffer * http_temp
http temp buffer (shared buffer for temporary work)
Definition: netevent.h:216
int ds_get_digest_algo(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
Get DS RR digest algorithm.
Definition: val_sigcrypt.c:217
void log_ident_set_or_default(const char *identity)
Set identity to print if there is an identity, otherwise set the default.
Definition: log.c:195
struct lruhash * table
hash table
Definition: unitlruhash.c:427
static void do_keyrem(struct module_env *env, struct autr_ta *anchor, int *c)
Event: KeyRem.
Definition: autotrust.c:1762
int sldns_wire2str_tsigerror_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat tsigerror field to string, with user buffers.
Definition: wire2str.c:1723
@ respip_always_refuse
answer with 'refused' response
Definition: localzone.h:552
#define EDNS_ADVERTISED_VERSION
Advertised version of EDNS capabilities.
Definition: net_help.h:82
void addr_to_str(struct sockaddr_storage *addr, socklen_t addrlen, char *buf, size_t len)
Put address into string, works for IPv4 and IPv6.
Definition: net_help.c:733
static void process_ds_response(struct module_qstate *qstate, struct val_qstate *vq, int id, int rcode, struct dns_msg *msg, struct query_info *qinfo, struct sock_list *origin)
Process DS response.
Definition: validator.c:2878
static int parse_create_rrset(sldns_buffer *pkt, struct rrset_parse *pset, struct packed_rrset_data **data, struct regional *region)
create rrset return 0 on failure
Definition: msgreply.c:311
void pythonmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
python module
Definition: pythonmod.c:476
struct for extended thread info
Definition: asynclook.c:172
static void rbtree_rotate_right(rbtree_type *rbtree, rbnode_type *node)
rotate subtree right (to preserve redblack property)
Definition: rbtree.c:135
static int ssl_handle_read(struct comm_point *c)
continue ssl handshake
Definition: netevent.c:1186
void delegpt_mark_neg(struct delegpt_ns *ns, uint16_t qtype)
Mark negative return in delegation point for specific nameserver.
Definition: iter_delegpt.c:485
int max_ttl
the number of seconds maximal TTL used for RRsets and messages
Definition: config_file.h:272
uint8_t fetched
fresh TA was seen
Definition: autotrust.h:81
int sldns_wire2str_rr_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rr to string, with user buffers.
Definition: wire2str.c:452
struct name_tree_node node
tree sorted by name, class
Definition: iter_hints.h:70
void mesh_state_delete(struct module_qstate *qstate)
Delete mesh state, cleanup and also rbtrees and so on.
Definition: mesh.c:907
static int rr_is_selfsigned_revoked(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, size_t i, struct module_qstate *qstate)
Is rr self-signed revoked key.
Definition: autotrust.c:1298
static void run_daemon(const char *cfgfile, int cmdline_verbose, int debug_mode, int need_pidfile)
Run the daemon.
Definition: unbound.c:644
static int read_fixed(RES *ssl, sldns_buffer *buf, const char *str)
check fixed text on line
Definition: cachedump.c:313
static int az_generate_referral_answer(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *ce, struct auth_rrset *rrset)
generate answer for referral answer
Definition: authzone.c:2998
static int tempno
number of tmpfiles
Definition: unitauth.c:460
keep track of lock id in lock-verify application
Definition: unbound-dnstap-socket.c:1561
static struct trust_anchor * anchor_store_new_key(struct val_anchors *anchors, uint8_t *name, uint16_t type, uint16_t dclass, uint8_t *rdata, size_t rdata_len)
This routine adds a new RR to a trust anchor.
Definition: val_anchor.c:304
static int cmdcmp(char *p, const char *cmd, size_t len)
check for name with end-of-string, space or tab after it
Definition: remote.c:2889
static void handle_keydigest(struct xml_data *data, const XML_Char **atts)
XML handle the KeyDigest start tag, check validity periods.
Definition: unbound-anchor.c:1368
static int repinfo_copy_rrsets(struct reply_info *dest, struct reply_info *from, struct regional *region)
copy rrsets from replyinfo to dest replyinfo
Definition: msgreply.c:665
void comm_timer_delete(struct comm_timer *timer)
delete timer.
Definition: fake_event.c:1525
struct auth_probe * task_probe
task for SOA probe.
Definition: authzone.h:222
int ecs_is_whitelisted(struct ecs_whitelist *whitelist, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *qname, size_t qname_len, uint16_t qclass)
See if an address or domain is whitelisted.
void comm_point_local_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:2484
uint16_t key_class
class of the key, host byteorder
Definition: val_kentry.h:63
int ds_key_algo_is_supported(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
See if DS key algorithm is supported.
Definition: val_sigcrypt.c:366
PyObject * module
Python module.
Definition: pythonmod.c:85
int pythonmod_init(struct module_env *env, int id)
python module init
Definition: pythonmod.c:250
static void * dnstap_io(void *arg)
the IO thread function for the DNSTAP IO
Definition: dtstream.c:2029
static void setup_config(FILE *in, int *lineno, int *pass_argc, char *pass_argv[])
process config elements
Definition: testbound.c:254
static int lz_enter_zone_tags(struct local_zones *zones, struct config_file *cfg)
enter local-zone-tag info
Definition: localzone.c:1013
static size_t waiting_tcp_get_mem(struct waiting_tcp *w)
get memory used by waiting tcp entry (in use or not)
Definition: outside_network.c:2454
static fbgetfunctype * module_funcs_avail(void)
The list of module func blocks.
Definition: modstack.c:173
struct ub_ctx * ub_ctx_create_event(struct event_base *eb)
Create a resolving and validation context.
Definition: libunbound.c:211
int testcount
number of tests done
Definition: unitmain.c:70
struct timeval tv
when the timer expires
Definition: replay.h:391
char * variable
macro name, for assign.
Definition: replay.h:233
int use_response_ip
some response-ip tags or actions are configured if true
Definition: daemon.h:134
int nsec3_covers(uint8_t *zone, struct nsec3_cached_hash *hash, struct ub_packed_rrset_key *rrset, int rr, struct sldns_buffer *buf)
nsec3Covers Given a hash and a candidate NSEC3Record, determine if that NSEC3Record covers the hash.
Definition: val_nsec3.c:769
int size_mask
size bitmask - since size is a power of 2
Definition: lruhash.h:166
uint32_t limit
connection limit on this netblock
Definition: tcp_conn_limit.h:73
int iter_init(struct module_env *env, int id)
iterator init
Definition: iterator.c:78
struct autr_global_data * autr_global_create(void)
Create new global 5011 data structure.
Definition: autotrust.c:74
size_t dnscrypt_shared_secret_cache_size
memory size in bytes for dnscrypt shared secrets cache
Definition: config_file.h:572
int quiet
quiet mode?
Definition: perf.c:98
struct sldns_buffer * spool_buffer
the buffer to use to spool reply from mesh into, it can then be copied to the result list and written...
Definition: listen_dnsport.h:252
int rbtree_find_less_equal(rbtree_type *rbtree, const void *key, rbnode_type **result)
Find, but match does not have to be exact.
Definition: rbtree.c:511
int sldns_wire2str_edns_option_code_print(char **s, size_t *slen, uint16_t opcode)
Print host format EDNS0 option to string.
Definition: wire2str.c:899
Global state for the validator.
Definition: validator.h:80
static int nsec_at_apex(sldns_buffer *pkt)
See if next rrset is nsec at zone apex.
Definition: msgparse.c:110
@ respip_deny
don't answer
Definition: localzone.h:540
static sldns_rr_type get_qtype(uint8_t *pkt, size_t pktlen)
get qtype from packet
Definition: testpkts.c:702
static int processFindKey(struct module_qstate *qstate, struct val_qstate *vq, int id)
Process the FINDKEY state.
Definition: validator.c:1671
uint8_t _maximum
Maximum number of rdata fields in the RRs of this type.
Definition: rrdef.h:458
struct rrset_cache * rrset_cache_adjust(struct rrset_cache *r, struct config_file *cfg, struct alloc_cache *alloc)
Adjust settings of the cache to settings from the config file.
Definition: rrset.c:81
size_t use
current memory in use (bytes)
Definition: val_neg.h:78
void dtio_tap_callback(int fd, short bits, void *arg)
callback for unbound-dnstap-socket
int addr_is_ip6(struct sockaddr_storage *addr, socklen_t len)
Checkout address family.
Definition: net_help.c:668
int val_neg_dlvlookup(struct val_neg_cache *neg, uint8_t *qname, size_t len, uint16_t qclass, struct rrset_cache *rrset_cache, time_t now)
Perform a DLV style lookup During the lookup, we could find out that data has expired.
Definition: val_neg.c:968
struct config_strlist * trust_anchor_list
list of trustanchor keys, linked list
Definition: config_file.h:329
int prefer_ip4
prefer ip4 upstream queries.
Definition: config_file.h:89
int auth_zones_apply_cfg(struct auth_zones *az, struct config_file *cfg, int setup, int *is_rpz)
Apply configuration to auth zones.
Definition: authzone.c:2002
uint8_t * dname_get_shared_topdomain(uint8_t *d1, uint8_t *d2)
Get the shared topdomain between two names.
Definition: dname.c:872
static int str_char_print(char **s, size_t *sl, uint8_t c)
printout escaped TYPE_STR character
Definition: wire2str.c:1122
#define MAX_PTR_QNAME_IPV4
Maximum length of a domain name in a PTR query in the .in-addr.arpa tree.
Definition: dns64.c:70
static void * test_thr_main(void *arg)
main routine for threaded hash table test
Definition: unitslabhash.c:311
struct config_str2list * next
next item in list
Definition: config_file.h:733
struct key_entry_key * key_entry_copy(struct key_entry_key *kkey)
Copy a key entry, malloced.
Definition: val_kentry.c:155
static void testadd(struct lruhash *table, testdata_type *ref[])
test adding a random element
Definition: unitlruhash.c:235
void config_delviews(struct config_view *list)
Delete items in config view list.
Definition: config_file.c:1385
int dnssec_lame_query
We are expecting dnssec information, but we also know the server is DNSSEC lame.
Definition: iterator.h:360
static void anchors_delfunc(rbnode_type *elem, void *ATTR_UNUSED(arg))
destroy locks in tree and delete autotrust anchors
Definition: val_anchor.c:116
Bucket of time history information.
Definition: timehist.h:51
size_t dname_len
length of the dname
Definition: val_nsec3.h:238
rbnode_type node
rbtree node, key is name only
Definition: localzone.h:165
int replay_var_compare(const void *a, const void *b)
compare two replay_vars
Definition: replay.c:556
int sldns_str2wire_dname_buf_origin(const char *str, uint8_t *buf, size_t *len, uint8_t *origin, size_t origin_len)
Same as sldns_str2wire_dname_buf, but concatenates origin if the domain name is relative (does not en...
Definition: str2wire.c:144
static int assemble_iterate_ds(struct autr_ta **list, uint8_t **rr, size_t *rr_len, size_t *dname_len)
iterator for DSes from keylist.
Definition: autotrust.c:555
void lruhash_test(void)
unit test lruhashtable implementation
Definition: unitlruhash.c:480
void libworker_event_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with event results
Definition: libworker.c:637
int copy_clear(uint8_t *dst, size_t dstlen, uint8_t *src, size_t srclen, size_t n)
copy the first n BITS from src to dst iff both src and dst are large enough, return 0 on succes
void comm_point_http_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:2441
size_t * nsec3_keysize
NSEC3 maximum iteration count per signing key size.
Definition: validator.h:113
static size_t ipv4_to_ptr(uint32_t ipv4, char ptr[], size_t nm_len)
Builds the PTR query name corresponding to an IPv4 address.
Definition: dns64.c:225
static void addr_to_additional(struct ub_packed_rrset_key *rrset, struct regional *region, struct dns_msg *msg, time_t now)
add addr to additional section
Definition: dns.c:228
size_t(* get_mem)(struct module_env *env, int id)
How much memory is the module specific data using.
Definition: module.h:738
int ub_resolve_event(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, void *mydata, ub_event_callback_type callback, int *async_id)
Perform resolution and validation of the target name.
Definition: libunbound.c:724
struct dt_io_thread * dtio
the dtio
Definition: dtstream.c:1573
dlv_status
status of DLV lookup.
Definition: validator.h:235
@ comm_ssl_shake_hs_write
ssl_read wants to write
Definition: netevent.h:204
int rtt_notimeout(const struct rtt_info *rtt)
RTT for valid responses.
Definition: rtt.c:119
void autr_point_delete(struct trust_anchor *tp)
Delete autr anchor, deletes the autr data but does not do unlinking from trees, caller does that.
Definition: autotrust.c:390
void tube_close_write(struct tube *tube)
Close write part of the pipe.
Definition: tube.c:108
int sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity)
changes the buffer's capacity.
Definition: sbuffer.c:74
int fd_set_nonblock(int s)
Set fd nonblocking.
Definition: net_help.c:121
static void dtio_setup_cmd(struct dt_io_thread *dtio)
setup the cmd event for dnstap io
Definition: dtstream.c:1536
socklen_t prefix_addrlen
This is always sizeof(sockaddr_in6).
Definition: dns64.c:125
void * incoming_ssl_fd(void *sslctx, int fd)
accept a new fd and wrap it in a BIO in SSL
Definition: net_help.c:1205
size_t data_done
have we read the data, and how many bytes of it
Definition: unbound-dnstap-socket.c:121
void rrset_array_unlock_touch(struct rrset_cache *r, struct regional *scratch, struct rrset_ref *ref, size_t count)
Unlock array (sorted) of rrset references and at the same time touch LRU on the rrsets.
Definition: rrset.c:337
struct tcp_send_list * answerlist
list of answer items to send to client
Definition: delayer.c:134
#define INFRA_BYTES_NAME
bytes per zonename reserved in the hostcache, dnamelen(zonename.com.)
Definition: infra.h:190
void rrset_check_sec_status(struct rrset_cache *r, struct ub_packed_rrset_key *rrset, time_t now)
Looks up security status of an rrset.
Definition: rrset.c:405
void dt_io_thread_unregister_queue(struct dt_io_thread *dtio, struct dt_msg_queue *mq)
Unregister queue from io thread.
Definition: dtstream.c:384
char * version
version, package version returned if "".
Definition: config_file.h:321
int infra_host(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, time_t timenow, int *edns_vs, uint8_t *edns_lame_known, int *to)
Find host information to send a packet.
Definition: infra.c:437
static void xfr_probe_send_or_end(struct auth_xfer *xfr, struct module_env *env)
move to sending the probe packets, next if fails.
Definition: authzone.c:6316
size_t dnsc_shared_secrets_sizefunc(void *k, void *ATTR_UNUSED(d))
Definition: dnscrypt.c:1031
This structure contains module configuration information.
Definition: dns64.c:109
@ LDNS_RR_TYPE_MAILA
A request for mail agent RRs (Obsolete - see MX)
Definition: rrdef.h:222
struct compress_tree_node * parent
the parent node - not for tree, but zone parent.
Definition: msgencode.c:84
@ LDNS_RR_TYPE_NSAP_PTR
RFC1348.
Definition: rrdef.h:129
size_t msgreply_sizefunc(void *k, void *d)
calculate size of struct query_info + reply_info
Definition: msgreply.c:598
uint8_t * tag_actions
array per tagnumber of localzonetype(in one byte).
Definition: acl_list.h:98
Tree of IP addresses.
Definition: dnstree.h:77
void sldns_bskipcs(struct sldns_buffer *buffer, const char *s)
skips all of the characters in the given string in the buffer, moving the position to the first chara...
Definition: parse.c:396
int ub_fd(struct ub_ctx *ctx)
Get file descriptor.
Definition: libunbound.c:511
unsigned int err_limit_count
ratelimit for errors, packet count
Definition: worker.h:110
int tcp_keepalive
if set, tcp keepalive is enabled on this connection
Definition: netevent.h:261
@ LDNS_RR_TYPE_MX
mail exchange
Definition: rrdef.h:113
static void do_datas_remove(RES *ssl, struct local_zones *zones)
Do the local_datas_remove command.
Definition: remote.c:1364
void dname_test(void)
unit test dname handling functions
Definition: unitdname.c:861
int ratelimit
ratelimit for domains.
Definition: config_file.h:535
static int rr_comment_dnskey(char **s, size_t *slen, uint8_t *rr, size_t rrlen, size_t dname_off)
print rr comment for type DNSKEY
Definition: wire2str.c:581
@ RESPONSE_TYPE_CNAME
'cname' means that the response is a cname without the final answer, and thus must be restarted.
Definition: iter_resptype.h:72
void daemon_remote_start_accept(struct daemon_remote *rc)
Stop accept handlers for TCP (until enabled again)
Definition: remote.c:436
static int make_sock(int stype, const char *ifname, const char *port, struct addrinfo *hints, int v6only, int *noip6, size_t rcv, size_t snd, int *reuseport, int transparent, int tcp_mss, int freebind, int use_systemd, int dscp)
Create socket from getaddrinfo results.
Definition: listen_dnsport.c:1010
static void rrsig_get_signer(uint8_t *data, size_t len, uint8_t **sname, size_t *slen)
Get signer name from RRSIG.
Definition: val_utils.c:134
static int check_xfer_packet(sldns_buffer *pkt, struct auth_xfer *xfr, int *gonextonfail, int *transferdone)
check if xfer (AXFR or IXFR) packet is OK.
Definition: authzone.c:5415
int isfirst
if forward-first is set (failover to without if fails)
Definition: config_file.h:644
The remote control tool state.
Definition: remote.h:89
int(* lruhash_compfunc_type)(void *, void *)
type of function that compares two keys.
Definition: lruhash.h:130
static void * thread_start(void *arg)
Function to start one thread.
Definition: daemon.c:500
int dname_count_size_labels(uint8_t *dname, size_t *size)
Count labels and dname length both, for uncompressed dname in memory.
Definition: dname.c:446
size_t num_msg_nocache
number of messages not from cache
Definition: subnetmod.h:68
struct rtt_info rtt
round trip times for timeout calculation
Definition: infra.h:82
char * sldns_wire2str_type(uint16_t rrtype)
Convert wire RR type to a string, 'MX', 'TYPE1234'...
Definition: wire2str.c:217
static int dtio_control_stop_send(struct stop_flush_info *info)
send the stop control, return true if completed the frame.
Definition: dtstream.c:1595
int(* add_signal)(struct ub_event *, struct timeval *)
Activate a signal event (not called by libunbound).
Definition: unbound-event.h:147
uint32_t count
current connection count on this netblock
Definition: tcp_conn_limit.h:75
Data element for aggressive negative caching.
Definition: val_neg.h:142
#define RET_ERR(e, off)
return an error
Definition: str2wire.c:29
int listen_sslctx_setup(void *ctxt)
Set SSL_OP_NOxxx options on SSL context to disable bad crypto.
Definition: net_help.c:888
void views_print(struct views *v)
Debug helper.
Definition: view.c:244
int sldns_wire2str_rr_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rr to string, with user buffers.
Definition: wire2str.c:452
struct auth_zone * delete_next
deletelist pointer, unused normally except during delete
Definition: authzone.h:140
struct delegpt * dp
delegation point with hint information for this stub.
Definition: iter_hints.h:72
int cfg_parse_local_zone(struct config_file *cfg, const char *val)
Parse local-zone directive into two strings and register it in the config.
Definition: config_file.c:2192
static struct ip_list * resolve_name(const char *host, int port, const char *res_conf, const char *root_hints, const char *debugconf, const char *srcaddr, int ip4only, int ip6only)
Resolve a domain name (even though the resolver is down and there is no trust anchor).
Definition: unbound-anchor.c:634
static int forward_request(struct module_qstate *qstate, struct iter_qstate *iq)
See if the query needs forwarding.
Definition: iterator.c:1185
static void daemon_stop_others(struct daemon *daemon)
Stop the other threads.
Definition: daemon.c:551
static int load_msg(RES *ssl, sldns_buffer *buf, struct worker *worker)
load a msg entry
Definition: cachedump.c:623
struct config_strlist * urls
list of urls
Definition: config_file.h:662
struct libworker * libworker_create_event(struct ub_ctx *ctx, struct ub_event_base *eb)
create worker for event-based interface.
Definition: libworker.c:266
static void timeval_divide(struct timeval *avg, const struct timeval *sum, long long d)
divide sum of timers to get average
Definition: remote.c:129
void val_blacklist(struct sock_list **blacklist, struct regional *region, struct sock_list *origin, int cross)
Add existing list to blacklist.
Definition: val_utils.c:1088
int sldns_wire2str_type_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat rr type to string, with user buffers.
Definition: wire2str.c:921
@ UB_AFTERFINAL
cfg change after finalize()
Definition: context.h:197
static time_t soa_find_minttl(struct rr_parse *rr)
find the minimumttl in the rdata of SOA record
Definition: msgreply.c:169
static void do_infra_rtt(struct replay_runtime *runtime)
Store RTT in infra cache.
Definition: fake_event.c:684
static const char DEFAULT_DNS64_PREFIX[]
This is the default DNS64 prefix that is used whent he dns64 module is listed in module-config but wh...
Definition: dns64.c:65
static char * dup_prefix(char *str, size_t num)
dup_prefix : create string from initial part of other string, malloced
Definition: authzone.c:6805
struct addredge * parent_edge
edge between this node and parent
Definition: addrtree.h:101
static void testlookup(struct slabhash *table, testdata_type *ref[])
test adding a random element
Definition: unitslabhash.c:132
int labs
labels in name
Definition: val_neg.h:150
int len_done
have we read the length, and how many bytes of it
Definition: unbound-dnstap-socket.c:119
int ipset_init(struct module_env *env, int id)
Init the ipset module.
Definition: ipset.c:226
int insecure_lan_zones
insecure lan zones (don't validate AS112 zones)
Definition: config_file.h:411
void log_crypto_err_code(const char *str, unsigned long err)
Log libcrypto error from errcode with descriptive string, calls log_err.
Definition: net_help.c:843
struct fake_pending * next
next in pending list
Definition: replay.h:349
void packed_rrset_ptr_fixup(struct packed_rrset_data *data)
Fixup pointers in fixed data packed_rrset_data blob.
Definition: packed_rrset.c:178
#define UB_EV_WRITE
event fd writable
Definition: unbound-event.h:71
static void stats_timeval_add(long long *d_sec, long long *d_usec, long long add_sec, long long add_usec)
add timers and the values do not overflow or become negative
Definition: stats.c:75
void server_stats_add(struct ub_stats_info *total, struct ub_stats_info *a)
Addup stat blocks.
Definition: stats.c:396
size_t ip_ratelimit_slabs
number of slabs for ip_ratelimit cache
Definition: config_file.h:528
uint8_t lame
If the name is parent-side only and thus dispreferred.
Definition: iter_delegpt.h:118
struct lruhash_bin * array
lookup array of bins
Definition: lruhash.h:168
int err
error code from libunbound
Definition: asynclook.c:88
static int get_rr_nameclass(const char *str, uint8_t **nm, uint16_t *dclass, uint16_t *dtype)
return name and class of rr; parses string
Definition: localzone.c:261
static void log_rrlist_position(const char *label, struct auth_chunk *rr_chunk, uint8_t *rr_dname, uint16_t rr_type, size_t rr_counter)
print log message where we are in parsing the zone transfer
Definition: authzone.c:4515
void invalidateQueryInCache(struct module_qstate *qstate, struct query_info *qinfo)
Invalidate the message associated with query_info stored in message cache.
Definition: pythonmod_utils.c:75
void(* del_bits)(struct ub_event *, short)
Configure the event so it will not longer fire on given bits The event will be deactivated before thi...
Definition: unbound-event.h:131
static void del_empty_term(struct local_zone *z, struct local_data *d, uint8_t *name, size_t len, int labs)
delete empty terminals from tree when final data is deleted
Definition: localzone.c:1931
struct iter_prep_list * ns_prepend_last
Last element of the authority prepend list.
Definition: iterator.h:267
struct trust_anchor * anchor_find(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass)
Find a trust anchor.
Definition: val_anchor.c:197
#define S_STR(str, var)
put string into variable
Definition: config_file.c:421
const char * val_classification_to_string(enum val_classification subtype)
Get string to denote the classification result.
Definition: val_utils.c:1062
int ub_event_base_loopexit(struct ub_event_base *)
exit that loop
Definition: ub_event.c:284
struct comm_timer * comm_timer_create(struct comm_base *base, void(*cb)(void *), void *cb_arg)
create timer.
Definition: netevent.c:3289
A general purpose lookup table.
Definition: parseutil.h:27
int addr_is_ip4mapped(struct sockaddr_storage *addr, socklen_t addrlen)
See if sockaddr is an ipv6 mapped ipv4 address, "::ffff:0.0.0.0".
Definition: net_help.c:746
void worker_probe_timer_cb(void *arg)
probe timer callback handler
Definition: worker.c:1687
@ LDNS_RR_TYPE_NULL
a null RR (EXPERIMENTAL)
Definition: rrdef.h:103
static int print_root_fwds(RES *ssl, struct iter_forwards *fwds, uint8_t *root)
print root forwards
Definition: remote.c:1975
uint8_t isbad
if the key is bad: Bogus or malformed
Definition: val_kentry.h:88
size_t taglen
length of the taglist (in bytes)
Definition: acl_list.h:96
int visited
if lock has been visited (all smaller locks have been compared to this lock), only need to compare th...
Definition: lock_verify.c:86
The internal event structure for keeping ub_event info for the event.
Definition: netevent.c:104
void mesh_query_done(struct mesh_state *mstate)
Query state is done, send messages to reply entries.
Definition: mesh.c:1297
static int timeval_smaller(const struct timeval *x, const struct timeval *y)
histogram compare of time values
Definition: timehist.c:119
int all
all or only ratelimited
Definition: remote.c:2789
time_t probedelay
time in seconds (absolute) when probing re-commences, 0 disabled
Definition: infra.h:80
int sldns_wire2str_rr_comment_buf(uint8_t *rr, size_t rrlen, size_t dname_len, char *s, size_t slen)
This creates the comment to print after the RR.
Definition: wire2str.c:279
uint16_t qid
id of query, in network byteorder.
Definition: mesh.h:252
char * id
string that identifies the socket (or NULL), like IP address
Definition: unbound-dnstap-socket.c:117
static sldns_buffer * hex_buffer2wire(sldns_buffer *data_buffer)
convert hex buffer to binary buffer
Definition: testpkts.c:342
uint8_t * sldns_str2wire_dname(const char *str, size_t *len)
Convert text string into dname wireformat.
Definition: str2wire.c:170
int nsec_has_type(struct ub_packed_rrset_key *nsec, uint16_t type)
Check if type is present in the NSEC typemap.
Definition: val_nsec.c:97
long long num_query_dnscrypt_crypted_malformed
number of malformed encrypted queries
Definition: unbound.h:764
int SERVE_EXPIRED
If we serve expired entries and prefetch them.
Definition: msgreply.c:65
static void delkey(struct slabhash_testkey *k)
delete key
Definition: unitlruhash.c:53
void tube_close_read(struct tube *tube)
Close read part of the pipe.
Definition: tube.c:100
int inplace_cb_reply_cache_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply_cache linked list.
Definition: msgreply.c:1066
int auth_zone_parse_notify_serial(sldns_buffer *pkt, uint32_t *serial)
process notify packet and read serial number from SOA.
Definition: authzone.c:3410
int sig_quit
do we have to quit
Definition: unbound-dnstap-socket.c:1203
int ub_event_base_loopexit(struct ub_event_base *base)
exit that loop
Definition: ub_event.c:284
struct dns_msg * val_find_DS(struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t c, struct regional *region, uint8_t *topname)
Find DS denial message in cache.
Definition: val_utils.c:1135
void ipsecmod_clear(struct module_qstate *qstate, int id)
clear the ipsecmod query-specific contents out of qstate
int threadnum
the thread number for the dtio thread, must be first to cast thread arg to int* in checklock code.
Definition: dtstream.h:118
static int dtio_write_buf(struct dt_io_thread *dtio, uint8_t *buf, size_t len)
write buffer to output.
Definition: dtstream.c:730
static int print_uptime(RES *ssl, struct worker *worker, int reset)
print uptime stats
Definition: remote.c:870
struct mesh_area * mesh
mesh area with query state dependencies
Definition: module.h:475
static void adjustline(char *line, struct entry *e, struct reply_packet *pkt)
parse ADJUST line
Definition: testpkts.c:226
uint16_t id
dns id of packet in flight
Definition: authzone.h:339
The validation and resolution results.
Definition: unbound.h:123
int max_tcp_count
the number of TCP handlers for this tcp-accept socket
Definition: netevent.h:180
fake commpoint, stores information
Definition: fake_event.c:73
struct libworker * w
store libworker that is handling this query
Definition: context.h:172
static int read_tcl_list(struct tcl_list *tcl, struct config_file *cfg)
read tcl_list config
Definition: tcp_conn_limit.c:132
static int http_parse_add_rr(struct auth_xfer *xfr, struct auth_zone *z, sldns_buffer *buf, struct sldns_file_parse_state *pstate)
for http download, parse and add RR to zone
Definition: authzone.c:4380
void modstack_desetup(struct module_stack *stack, struct module_env *env)
Desetup the modules, deinit, delete.
Definition: modstack.c:248
int ctx_logfile_overridden
store that the logfile has a debug override
Definition: libunbound.c:83
int num
thread num, first entry.
Definition: unitlruhash.c:423
@ module_event_reply
reply inbound from server
Definition: module.h:559
uint8_t dp_type_mlc
for assertions on type of delegpt
Definition: iter_delegpt.h:83
void val_neg_zone_take_inuse(struct val_neg_zone *zone)
take a zone into use.
Definition: val_neg.c:518
int infra_ratelimit_exceeded(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow)
See if the query rate counter for a delegation point is exceeded.
Definition: infra.c:973
struct config_strlist * dnscrypt_provider_cert_rotated
dnscrypt provider certs 1.cert which have been rotated and should not be advertised through DNS's pro...
Definition: config_file.h:570
uint16_t opt_code
type of this edns option
Definition: msgparse.h:237
int max_negative_ttl
the number of seconds maximal negative TTL for SOA in auth
Definition: config_file.h:276
static struct ub_packed_rrset_key * grab_nsec(struct rrset_cache *rrset_cache, uint8_t *qname, size_t qname_len, uint16_t qtype, uint16_t qclass, uint32_t flags, struct regional *region, int checkbit, uint16_t checktype, time_t now)
See if rrset exists in rrset cache.
Definition: val_neg.c:1161
void auth_zones_delete(struct auth_zones *az)
Delete auth zones structure.
Definition: authzone.c:2124
int config_get_option_collate(struct config_file *cfg, const char *opt, char **str)
Get an option and collate results into string.
Definition: config_file.c:788
static void do_forward_add(RES *ssl, struct worker *worker, char *args)
do the forward_add command
Definition: remote.c:2132
sldns_rr_compress _compress
Specifies whether compression can be used for dnames in this RR type.
Definition: rrdef.h:464
@ rrset_trust_ans_noAA
Data from the answer section of a non-authoritative answer.
Definition: packed_rrset.h:153
int iter_stub_fwd_no_cache(struct module_qstate *qstate, struct query_info *qinf)
Lookup if no_cache is set in stub or fwd.
Definition: iter_utils.c:1393
int optind
getopt global, in case header files fail to declare it.
int control_port
port number for the control port
Definition: config_file.h:440
verbosity_value
verbosity definition for compat
Definition: testpkts.c:45
uint8_t needs[ALGO_NEEDS_MAX]
the algorithms (8-bit) with each a number.
Definition: val_sigcrypt.h:69
void * dynamic_library
dynamic library handle
Definition: dynlibmod.h:118
void rrset_markdel(void *key)
mark rrset to be deleted, set id=0
Definition: rrset.c:53
#define NUM_ID_TRIES
How many times to try to find an unused query-id-number for async.
Definition: context.c:122
static int apply_http(struct auth_xfer *xfr, struct auth_zone *z, struct sldns_buffer *scratch_buffer)
apply HTTP to zone in memory.
Definition: authzone.c:4794
static int process_one_header(char *buf, size_t *clen, int *chunked)
process header line, check rcode and keeping track of size
Definition: unbound-anchor.c:859
@ RESPONSE_TYPE_LAME
'lame' means that this particular response indicates that the nameserver knew nothing about the quest...
Definition: iter_resptype.h:84
int nsec3_get_params(struct ub_packed_rrset_key *rrset, int r, int *algo, size_t *iter, uint8_t **salt, size_t *saltlen)
Get NSEC3 parameters out of rr.
Definition: val_nsec3.c:209
int local_zones_apply_cfg(struct local_zones *zones, struct config_file *cfg)
Apply config settings; setup the local authoritative data.
Definition: localzone.c:1052
static size_t nsec3_get_iter(struct ub_packed_rrset_key *rrset, int r)
return nsec3 RR iteration count
Definition: val_nsec3.c:173
void lru_remove(struct lruhash *table, struct lruhash_entry *entry)
Remove entry from lru list.
Definition: lruhash.c:277
static char * basedir(char *fname)
get base dir of a fname
Definition: unbound-checkconf.c:441
static void respip_view_conf_actions_test(void)
Per-view respip actions test; apply raw configuration with two views and verify that actions are as e...
Definition: unitmain.c:636
static int az_generate_positive_answer(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node, struct auth_rrset *rrset)
generate answer for positive answer
Definition: authzone.c:2879
@ serviced_query_TCP_EDNS_fallback
probe to test TCP noEDNS0 (EDNS gives FORMERRorNOTIMP)
Definition: outside_network.h:371
static void check_ub_res(int r)
print error if any
Definition: unbound-host.c:410
static void do_reload(RES *ssl, struct worker *worker)
do the reload command
Definition: remote.c:687
int ub_wait(struct ub_ctx *ctx)
Wait for a context to finish with results.
Definition: libunbound.c:626
rbnode_type * rbtree_delete(rbtree_type *rbtree, const void *key)
Delete element from tree.
Definition: rbtree.c:329
func_get_mem_t func_get_mem
Module get_mem function.
Definition: dynlibmod.h:130
static uint32_t dnsc_nonce_cache_key_hash(const uint8_t nonce[crypto_box_HALF_NONCEBYTES], const uint8_t magic_query[DNSCRYPT_MAGIC_HEADER_LEN], const uint8_t pk[crypto_box_PUBLICKEYBYTES])
Generate a key hash suitable to find a nonce in slabhash.
Definition: dnscrypt.c:159
struct respip_set * respip_set
response-ip configuration data for this view
Definition: view.h:76
void * elem
Payload of node, may be NULL.
Definition: addrtree.h:93
struct delegpt * dns_cache_find_delegation(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional *region, struct dns_msg **msg, time_t now)
Find a delegation from the cache.
Definition: dns.c:462
static void print_any_answers(int fd, int udp, SSL *ssl, sldns_buffer *buf, int *num_answers, int wait_all)
see if we can receive any results
Definition: streamtcp.c:289
int sldns_wire2str_atma_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat ATMA field to string, with user buffers.
Definition: wire2str.c:1538
struct config_view * next
next in list
Definition: config_file.h:696
struct views * views_create(void)
Create views storage.
Definition: view.c:57
static int fill_res(struct ub_result *res, struct ub_packed_rrset_key *answer, uint8_t *finalcname, struct query_info *rq, struct reply_info *rep)
fill data into result
Definition: libworker.c:440
struct regional * region
regional for allocation
Definition: subnet-whitelist.h:55
sldns_lookup_table * sldns_rcodes
Response codes.
Definition: wire2str.c:101
struct tcp_send_list * querylist
list of query items to send to server
Definition: delayer.c:130
void daemon_cleanup(struct daemon *daemon)
Close off the worker thread information.
Definition: daemon.c:696
size_t dname_valid(uint8_t *dname, size_t maxlen)
Determine if dname in memory is correct.
Definition: dname.c:74
time_t next_probe
Timeout for next probe (for SOA)
Definition: authzone.h:292
struct module_func_block * respip_get_funcblock(void)
Get the response-ip function block.
Definition: respip.c:1281
struct listen_list * next
next in list
Definition: listen_dnsport.h:75
uint16_t id
id from message, network format.
Definition: msgparse.h:97
static void deldata(struct slabhash_testdata *d)
delete data
Definition: unitlruhash.c:56
size_t pkt_len
length of query packet.
Definition: outside_network.h:292
static char * do_macro_arith(char *orig, size_t remain, char **arithstart)
do macro arithmetic on two numbers and operand
Definition: replay.c:727
size_t len
length of this frame
Definition: unbound-dnstap-socket.c:129
static void skip_whites(const char **p)
skip whitespace
Definition: readhex.c:49
int sldns_wire2str_edns_option_print(char **s, size_t *sl, uint16_t option_code, uint8_t *optdata, size_t optlen)
Print an EDNS option as OPT: VALUE.
Definition: wire2str.c:1943
static void serviced_encode(struct serviced_query *sq, sldns_buffer *buff, int with_edns)
put serviced query into a buffer
Definition: outside_network.c:1583
@ VAL_CLASS_POSITIVE
A positive, direct, response.
Definition: val_utils.h:67
enum transport_type match_transport
match on UDP/TCP
Definition: testpkts.h:198
uint8_t * msg
answer message, result from resolver lookup.
Definition: context.h:166
static int nsec3_calc_hash(struct regional *region, sldns_buffer *buf, struct nsec3_cached_hash *c)
perform hash of name
Definition: val_nsec3.c:571
static void do_log_reopen(RES *ssl, struct worker *worker)
do the log_reopen command
Definition: remote.c:2502
Local data.
Definition: localzone.h:163
@ repevt_front_reply
test fails if reply to query does not match
Definition: replay.h:196
int tube_wait(struct tube *tube)
Wait for data to be ready for reading on the tube.
Definition: tube.c:418
#define MIN_PENDINGCOUNT
number of times a key must be seen before it can become valid
Definition: autotrust.c:69
char * filename
name of file being parser
Definition: config_file.h:1203
int RRSET_ROUNDROBIN
rrset order roundrobin
Definition: net_help.c:74
int auth_zones_startprobesequence(struct auth_zones *az, struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t dclass)
for the zone and if not already going, starts the probe sequence.
Definition: authzone.c:3593
int python_inplace_cb_query_generic(struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *python_callback)
Declared here for fptr_wlist access.
int dothread
do threading (instead of forking) for async resolution
Definition: context.h:94
void * regional_alloc_zero(struct regional *r, size_t size)
Allocate size bytes of memory inside regional that are initialized to 0.
Definition: regional.c:171
@ sec_status_bogus
BOGUS means that the object (RRset or message) failed to validate (according to local policy),...
Definition: packed_rrset.h:181
void rrset_array_unlock(struct rrset_ref *ref, size_t count)
Unlock array (sorted) of rrset references.
Definition: rrset.c:326
Structure that provides allocation.
Definition: alloc.h:72
struct config_strlist * private_address
strip away these private addrs from answers, no DNS Rebinding
Definition: config_file.h:266
static int rrinternal_get_quoted(sldns_buffer *strbuf, const char **delimiters, sldns_rdf_type rdftype)
see if rdata is quoted
Definition: str2wire.c:367
static void do_print(struct ub_result *result, char *file)
print result to file
Definition: anchor-update.c:86
int anchors_add_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
Add insecure point trust anchor.
Definition: val_anchor.c:1216
int worker_handle_request(struct comm_point *c, void *arg, int error, struct comm_reply *repinfo)
handles callbacks from listening event interface
Definition: worker.c:1087
struct serviced_query * sq
the corresponding serviced_query
Definition: outside_network.h:239
int auth_zone_get_serial(struct auth_zone *z, uint32_t *serial)
find serial number of zone or false if none (no SOA record)
Definition: authzone.c:1765
static int do_buf_insert(char *buf, size_t remain, char *after, char *inserted)
insert new stuff at start of buffer
Definition: replay.c:611
struct module_func_block *(* fbgetfunctype)(void)
func block get function type
Definition: modstack.c:169
void log_info(const char *format,...) ATTR_FORMAT(printf
Log informational message.
int(* cmp)(const void *, const void *)
Key compare function.
Definition: rbtree.h:87
@ LDNS_RR_TYPE_TXT
text strings
Definition: rrdef.h:115
void log_ident_set_or_default(const char *identity)
Set identity to print if there is an identity, otherwise set the default.
Definition: log.c:195
uint8_t * dname
start of (possibly compressed) dname in packet
Definition: msgparse.h:153
int ds_get_key_algo(struct ub_packed_rrset_key *k, size_t idx)
Get DS RR key algorithm.
Definition: val_sigcrypt.c:206
int libworker_bg(struct ub_ctx *ctx)
Create a background worker.
Definition: libworker.c:383
int dname_count_labels(uint8_t *dname)
Count the number of labels in an uncompressed dname in memory.
Definition: dname.c:431
static int file_name_is_safe(char *s)
check a file name for safety
Definition: petal.c:316
static const int inhibit_zero
if true, inhibits a lot of =0 lines from the stats output
Definition: remote.c:109
static int load_rrset(RES *ssl, sldns_buffer *buf, struct worker *worker)
load an rrset entry
Definition: cachedump.c:438
void log_ident_revert_to_default()
Revert identity to print, back to the recorded default value.
Definition: log.c:190
@ respip_inform_deny
log query source and don't answer query
Definition: localzone.h:546
enum response_type response_type_from_cache(struct dns_msg *msg, struct query_info *request)
Classifies a response message from cache based on the current request.
Definition: iter_resptype.c:52
@ module_event_moddone
next module is done, and its reply is awaiting you
Definition: module.h:565
int worker_handle_request(struct comm_point *c, void *arg, int error, struct comm_reply *repinfo)
handles callbacks from listening event interface
Definition: worker.c:1087
void ub_event_del_bits(struct ub_event *ev, short bits)
Configure the event so it will not longer fire on given bits.
Definition: ub_event_pluggable.c:555
int config_read(struct config_file *cfg, const char *filename, const char *chroot)
Read the config file from the specified filename.
Definition: config_file.c:1182
static int ssl_print_vmsg(RES *ssl, const char *format, va_list args)
print text over the ssl connection
Definition: remote.c:592
static void do_view_list_local_data(RES *ssl, struct worker *worker, char *arg)
do the view_list_local_data command
Definition: remote.c:2768
static void test_threaded_table(struct lruhash *table)
test hash table access by multiple threads
Definition: unitlruhash.c:462
@ LDNS_RR_TYPE_NIMLOC
draft-ietf-nimrod-dns-01.txt
Definition: rrdef.h:147
int tls_use_sni
if SNI will be used for TLS connections.
Definition: dtstream.h:134
struct auth_xfer * auth_xfer_create(struct auth_zones *az, struct auth_zone *z)
Create auth_xfer structure.
Definition: authzone.c:6771
static void setup_sigalg(struct ub_packed_rrset_key *dnskey, uint8_t *sigalg)
setup sig alg list from dnskey
Definition: unitverify.c:159
static int rr_comment_rrsig(char **s, size_t *slen, uint8_t *rr, size_t rrlen, size_t dname_off)
print rr comment for type RRSIG
Definition: wire2str.c:619
char * owner
owner name
Definition: signit.c:57
static void val_find_best_signer(struct ub_packed_rrset_key *rrset, struct query_info *qinf, uint8_t **signer_name, size_t *signer_len, int *matchcount)
Find best signer name in this set of rrsigs.
Definition: val_utils.c:186
struct sockaddr_storage addr
address of where this range is served.
Definition: replay.h:252
int inplace_cb_query_response_func_type(struct module_qstate *qstate, struct dns_msg *response, int id, void *cb_args)
Inplace callback function called after parsing query response.
Definition: module.h:306
static void do_view_data_add(RES *ssl, struct worker *worker, char *arg)
Add new RR data to view.
Definition: remote.c:1439
uint32_t notify_serial
serial number of the notify
Definition: authzone.h:241
struct key_entry_key * key_cache_obtain(struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class, struct regional *region, time_t now)
Lookup key entry in the cache.
Definition: val_kcache.c:128
char * file
file to store the trust point in.
Definition: autotrust.h:92
wire2str.h - txt presentation of RRs
int iter_msg_from_zone(struct dns_msg *msg, struct delegpt *dp, enum response_type type, uint16_t dclass)
See if a message is known to be from a certain zone.
Definition: iter_utils.c:858
struct dns_msg * mesh_serve_expired_lookup(struct module_qstate *qstate, struct query_info *lookup_qinfo)
Try to get a (expired) cached answer.
Definition: mesh.c:363
size_t dnscrypt_nonce_cache_slabs
number of slabs for dnscrypt nonces cache
Definition: config_file.h:578
#define ALGO_NEEDS_MAX
number of entries in algorithm needs array
Definition: val_sigcrypt.h:57
void log_file(FILE *f)
Set logging to go to the specified file *.
Definition: log.c:160
const char * iter_state_to_string(enum iter_state state)
Get iterator state as a string.
Definition: iterator.c:3954
struct tube * qq_pipe
the query write pipe
Definition: context.h:70
static int canonical_compare_byfield(struct packed_rrset_data *d, const sldns_rr_descriptor *desc, size_t i, size_t j)
Compare two RR for canonical order, in a field-style sweep.
Definition: val_sigcrypt.c:656
static void tcp_req_info_start_write_buf(struct tcp_req_info *req, uint8_t *buf, size_t len)
Send given buffer and setup to write.
Definition: listen_dnsport.c:1737
int do_ip4
do ip4 query support.
Definition: config_file.h:85
struct val_neg_cache * neg_cache
negative cache, configured by the validator.
Definition: module.h:494
enum @1 dtio_channel_command
DTIO command channel commands.
int namelabs
number of labels in name
Definition: authzone.h:159
void error_encode(sldns_buffer *buf, int r, struct query_info *qinfo, uint16_t qid, uint16_t qflags, struct edns_data *edns)
Encode an error.
Definition: msgencode.c:910
void hints_delete_stub(struct iter_hints *hints, uint16_t c, uint8_t *nm)
Remove stub from hints structure.
Definition: iter_hints.c:543
socklen_t addrlen
length of address
Definition: infra.h:164
static int nsec3_calc_b32(struct regional *region, sldns_buffer *buf, struct nsec3_cached_hash *c)
perform b32 encoding of hash
Definition: val_nsec3.c:610
static void delkey(struct slabhash_testkey *k)
delete key
Definition: unitslabhash.c:52
struct edns_option * edns_opt_copy_alloc(struct edns_option *list)
Copy edns option list allocated with malloc.
Definition: msgreply.c:1217
struct sockaddr_storage addr
sockaddr
Definition: module.h:580
static void do_insecure_add(RES *ssl, struct worker *worker, char *arg)
do the insecure_add command
Definition: remote.c:2236
void respip_deinit(struct module_env *env, int id)
response-ip deinit
Definition: respip.c:558
int ub_ctx_set_option(struct ub_ctx *ctx, const char *opt, const char *val)
Set an option for the context.
Definition: libunbound.c:345
static struct ta_key * anchor_find_key(struct trust_anchor *ta, uint8_t *rdata, size_t rdata_len, uint16_t type)
find trustanchor key by exact data match
Definition: val_anchor.c:260
#define O_MEM(opt, str, var)
compare and print memorysize option
Definition: config_file.c:851
void auth_xfer_transfer_timer_callback(void *arg)
callback for the task_transfer timer
Definition: authzone.c:5784
int fptr_whitelist_event(void(*fptr)(int, short, void *))
Check function pointer whitelist for event structure callback values.
Definition: fptr_wlist.c:164
static int pkt_strict_sub(sldns_buffer *pkt, uint8_t *sname, uint8_t *dr)
check if DNAME applies to a name
Definition: iter_scrub.c:309
void mesh_new_prefetch(struct mesh_area *mesh, struct query_info *qinfo, uint16_t qflags, time_t leeway)
New prefetch message.
Definition: mesh.c:750
@ LDNS_RDF_TYPE_HIP
Represents the Public Key Algorithm, HIT and Public Key fields for the HIP RR types.
Definition: rrdef.h:310
struct replay_answer * answer_list
List of answers to queries from clients.
Definition: replay.h:285
size_t origin_len
length of origin domain name, in bytes.
Definition: str2wire.h:222
int parse_edns_from_pkt(struct sldns_buffer *pkt, struct edns_data *edns, struct regional *region)
If EDNS data follows a query section, extract it and initialize edns struct.
Definition: msgparse.c:1062
implementation of buffers to ease operations
Definition: sbuffer.h:117
uint8_t timeout_A
timeouts counter for type A
Definition: infra.h:102
@ LDNS_RDF_TYPE_EUI48
6 * 8 bit hex numbers separated by dashes.
Definition: rrdef.h:337
uint16_t rrset_class
the rrset class in network format
Definition: packed_rrset.h:96
#define NSEC3_OPTOUT
Definition: val_nsec3.h:90
serviced_query_status
current status
Definition: outside_network.h:357
long long infra_cache_count
number of infra cache entries
Definition: unbound.h:753
struct ub_packed_rrset_key * reply_find_rrset_section_an(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside the answer section.
Definition: msgreply.c:771
int sldns_wire2str_long_str_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat long_str field to string, with user buffers.
Definition: wire2str.c:1710
void addr_tree_init(rbtree_type *tree)
Init addr tree to be empty.
Definition: dnstree.c:79
struct outside_network * outnet
the outside network it is part of
Definition: outside_network.h:279
uint8_t * dname
the name to convert
Definition: val_nsec3.h:236
struct ub_packed_rrset_key * packed_rrset_copy_region(struct ub_packed_rrset_key *key, struct regional *region, time_t now)
Allocate rrset in region - no more locks needed.
Definition: packed_rrset.c:326
#define RETVAL_OUTMEM
return code that means the function ran out of memory.
Definition: msgencode.c:60
void rrset_cache_remove(struct rrset_cache *r, uint8_t *nm, size_t nmlen, uint16_t type, uint16_t dclass, uint32_t flags)
Remove an rrset from the cache, by name and type and flags.
Definition: rrset.c:441
int load_cache(RES *ssl, struct worker *worker)
Load cache(s) from text.
Definition: cachedump.c:702
static void negative_del_msg(struct lruhash_entry *e, void *arg)
callback to delete negative and servfail messages
Definition: remote.c:1859
int dnstap
true to enable dnstap support
Definition: config_file.h:483
static void ub_c_error_va_list(const char *fmt, va_list args)
print error with file and line number
Definition: config_file.c:1620
void wsvc_err2str(char *str, size_t len, const char *fixed, DWORD err)
Convert windows GetLastError() value to a neat string.
Definition: w_inst.c:46
void val_fill_reply(struct reply_info *chase, struct reply_info *orig, size_t skip, uint8_t *name, size_t len, uint8_t *signer)
Fill up the chased reply with the content from the original reply; as pointers to those rrsets.
Definition: val_utils.c:853
@ respip_always_transparent
resolve normally, even when there is response-ip data
Definition: localzone.h:550
uint8_t match_noedns
match absence of EDNS OPT record in query
Definition: testpkts.h:192
BIO * cdigtype
the current anchor: DigestType
Definition: unbound-anchor.c:1214
void table_grow(struct lruhash *table)
Grow the table lookup array.
Definition: lruhash.c:231
comm_point_callback_type * cb
callback function
Definition: outside_network.h:310
static struct rrset_parse * synth_cname_rrset(uint8_t **sname, size_t *snamelen, uint8_t *alias, size_t aliaslen, struct regional *region, struct msg_parse *msg, struct rrset_parse *rrset, struct rrset_parse *prev, struct rrset_parse *nx, sldns_buffer *pkt)
synthesize a CNAME rrset
Definition: iter_scrub.c:252
void comm_point_http_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:2441
char * dnstap_tls_server_name
dnstap tls server authentication name
Definition: config_file.h:493
size_t comm_point_get_mem(struct comm_point *c)
Get size of memory used by comm point.
Definition: netevent.c:3263
int sock_list_find(struct sock_list *list, struct sockaddr_storage *addr, socklen_t len)
Find addr in list.
Definition: net_help.c:809
time_t next_probe_time
next probe time
Definition: autotrust.h:108
int querynum
query id number, key for node
Definition: context.h:152
void timehist_insert(struct timehist *hist, struct timeval *tv)
Add time value to histogram.
Definition: timehist.c:134
static int get_do_flag(uint8_t *pkt, size_t len)
return true if the DO flag is set
Definition: testpkts.c:873
int main(int argc, char **argv)
main program for streamtcp
Definition: streamtcp.c:419
int fd
the fd
Definition: unbound-dnstap-socket.c:107
int sldns_wire2str_edns_nsid_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS NSID option data to string.
Definition: wire2str.c:1797
int view_cmp(const void *v1, const void *v2)
Compare two view entries in rbtree.
Definition: view.c:48
static int need_to_update_rrset(void *nd, void *cd, time_t timenow, int equal, int ns)
see if rrset needs to be updated in the cache
Definition: rrset.c:125
static int parse_copy_decompress(sldns_buffer *pkt, struct msg_parse *msg, struct reply_info *rep, struct regional *region)
Copy and decompress rrs.
Definition: msgreply.c:413
struct regional * reg_list
linked list of regional blocks, using regional->next
Definition: alloc.h:97
int dnskey_algo_id_is_supported(int id)
return true if DNSKEY algorithm id is supported
rbtree_type queries
Tree of outstanding queries.
Definition: context.h:139
static char * load_qinfo(char *str, struct query_info *qinfo, struct regional *region)
read qinfo from next three words
Definition: cachedump.c:536
static int processInitRequest(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id)
Process the initial part of the request handling.
Definition: iterator.c:1228
int auth_zones_apply_cfg(struct auth_zones *az, struct config_file *cfg, int setup, int *is_rpz)
Apply configuration to auth zones.
Definition: authzone.c:2002
size_t infra_get_mem(struct infra_cache *infra)
Get memory used by the infra cache.
Definition: infra.c:997
size_t ns_rrsets
count of RRsets per section.
Definition: msgparse.h:111
int resolved
If the name has been resolved.
Definition: iter_delegpt.h:108
static ub_thread_key_type logkey
pthread key for thread ids in logfile
Definition: log.c:70
test structure contains test key
Definition: slabhash.h:205
void worker_stat_timer_cb(void *arg)
statistics timer callback handler
Definition: worker.c:1670
size_t num_rrset_bogus
number of times rrsets marked bogus
Definition: validator.h:125
struct cachedb_backend * backend
the backend routines
Definition: cachedb.h:55
static void rr_checks(char *wire_chk, char *txt_chk, char *txt_out, char *wire_out, char *back)
Check if results are correct.
Definition: unitldns.c:113
void delegpt_log(enum verbosity_value v, struct delegpt *dp)
Print the delegation point to the log.
Definition: iter_delegpt.c:258
uint16_t qtype
qtype, host byte order
Definition: msgreply.h:79
INLINE void sldns_buffer_write_u32_at(sldns_buffer *buffer, size_t at, uint32_t data)
writes the given 4 byte integer at the given position in the buffer
Definition: sbuffer.h:549
int sldns_str2wire_rdf_buf(const char *str, uint8_t *rd, size_t *len, sldns_rdf_type rdftype)
Convert one rdf in rdata to wireformat and parse from string.
Definition: str2wire.c:937
list of IP addresses
Definition: unbound-anchor.c:162
@ worker_cmd_quit
make the worker quit
Definition: worker.h:69
int slow_accept_enabled
true if slow_accept is enabled
Definition: netevent.c:124
const char * zone
zone to query (delegpt)
Definition: unitauth.c:58
static int label_compare_lower(uint8_t *lab1, uint8_t *lab2, size_t lablen)
compare a label lowercased
Definition: val_nsec3.c:680
void * memdup(void *data, size_t len)
Allocate memory and copy over contents.
Definition: net_help.c:177
void daemon_remote_exec(struct worker *worker)
Handle nonthreaded remote cmd execution.
Definition: remote.c:3074
static void lru_update(struct addrtree *tree, struct addrnode *node)
Move node to the end of LRU list.
Definition: addrtree.c:199
size_t msgreply_sizefunc(void *k, void *d)
calculate size of struct query_info + reply_info
Definition: msgreply.c:598
int maxfd
max fd value in io ports
Definition: perf.c:114
int sldns_str2wire_hip_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_HIP from string to wireformat.
Definition: str2wire.c:2052
static int lz_setup_implicit(struct local_zones *zones, struct config_file *cfg)
enter implicit transparent zone for local-data: without local-zone:
Definition: localzone.c:930
void log_query_in(const char *str, uint8_t *name, uint16_t type, uint16_t dclass)
Like log_nametypeclass, but logs with log_query for query logging.
Definition: net_help.c:513
@ repevt_back_query
test fails if query to the network does not match
Definition: replay.h:204
void pythonmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
python module operate on a query
static int iter_add_prepend_auth(struct module_qstate *qstate, struct iter_qstate *iq, struct ub_packed_rrset_key *rrset)
Add rrset to AUTHORITY prepend list.
Definition: iterator.c:507
static void chunkline_remove_trailcomment(sldns_buffer *buf, size_t start)
remove trailing ;...
Definition: authzone.c:4175
#define RBTREE_FOR(node, type, rbtree)
Call with node=variable of struct* with rbnode_type as first element.
Definition: rbtree.h:173
const char * ub_version(void)
Get a version string from the libunbound implementation.
Definition: libunbound.c:1380
val_state
State of the validator for a query.
Definition: validator.h:131
Replay storage of runtime information.
Definition: replay.h:266
@ listen_type_udp_dnscrypt
udp type + dnscrypt
Definition: listen_dnsport.h:93
void iter_dns_store(struct module_env *env, struct query_info *qinf, struct reply_info *rep, int is_referral, time_t leeway, int pside, struct regional *region, uint16_t flags)
Allocate a dns_msg with malloc/alloc structure and store in dns cache.
Definition: iter_utils.c:654
size_t num
number of buckets
Definition: timehist.h:65
size_t count
number of rrs.
Definition: packed_rrset.h:240
addrkey_t * str
address of connected node
Definition: addrtree.h:110
static int rr_is_duplicate(struct packed_rrset_data *pd, uint8_t *rdata, size_t rdata_len)
check for RR duplicates
Definition: localzone.c:308
uint8_t match_answer
match answer section
Definition: testpkts.h:180
char * tls_auth_name
the TLS authentication name, (if not NULL) to use.
Definition: iter_delegpt.h:158
void outside_network_delete(struct outside_network *outnet)
Delete outside_network structure.
Definition: fake_event.c:1062
struct sldns_buffer * buf
buffer for reply
Definition: mesh.h:256
int read_is_closed
read channel has closed, just write pending results
Definition: listen_dnsport.h:262
alloc_special_type * alloc_special_obtain(struct alloc_cache *alloc)
Get a new special_type element.
Definition: alloc.c:214
Range of timesteps, and canned replies to matching queries.
Definition: replay.h:246
static void printstats(rbtree_type *tree)
print memory stats
Definition: memstats.c:226
static void do_ratelimit_list(RES *ssl, struct worker *worker, char *arg)
do the ratelimit_list command
Definition: remote.c:2834
struct config_strlist * local_data
local data RRs
Definition: config_file.h:702
int sldns_wire2str_tsigerror_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat tsigerror field to string, with user buffers.
Definition: wire2str.c:1723
int(* detect_cycle)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec)
Detect if adding a dependency for qstate on name,type,class will create a dependency cycle.
Definition: module.h:460
struct val_neg_zone * neg_create_zone(struct val_neg_cache *neg, uint8_t *nm, size_t nm_len, uint16_t dclass)
Create a new zone.
Definition: val_neg.c:530
size_t unittest_wrapper_subnetmod_sizefunc(void *elemptr)
Wrappers for static functions to unit test.
static void add_server_nonce(uint8_t *nonce)
Add the server nonce part to once.
Definition: dnscrypt.c:443
void config_deldblstrlist(struct config_str2list *list)
Delete items in config double string list.
Definition: config_file.c:1296
int tube_read_fd(struct tube *tube)
Get FD that is readable when new information arrives.
Definition: tube.c:423
Iterator forward servers for a particular zone.
Definition: iter_fwd.h:66
int cfg_parse_local_zone(struct config_file *cfg, const char *val)
Parse local-zone directive into two strings and register it in the config.
Definition: config_file.c:2192
static int dump_msg(RES *ssl, struct query_info *k, struct reply_info *d, time_t now)
dump message entry
Definition: cachedump.c:167
static void buf_to_hex(uint8_t *b, size_t blen, char *s, size_t slen)
print buffer to hex into string
Definition: unitldns.c:53
struct module_env * env
the module environment master value, copied and changed by threads
Definition: daemon.h:111
void verbose(enum verbosity_value level, const char *format,...) ATTR_FORMAT(printf
log a verbose message, pass the level for this message.
struct ub_packed_rrset_key * key_entry_get_rrset(struct key_entry_key *kkey, struct regional *region)
Obtain rrset from a key entry, allocated in region.
Definition: val_kentry.c:342
rbtree_type dname
Tree of domain names for which Unbound will append an ECS option.
Definition: subnet-whitelist.h:66
char * func
the name of the function
Definition: memstats.c:58
size_t frame_len_done
Number of bytes that have been written to the frame_length field.
Definition: dtstream.h:106
IO thread list of queues list item lists a worker queue that should be looked at and sent to the log ...
Definition: dtstream.h:227
#define UB_STATS_QTYPE_NUM
number of qtype that is stored for in array
Definition: unbound.h:650
struct ecs_whitelist * ecs_whitelist_create(void)
Create ecs_whitelist structure.
void * cb
Inplace callback routine.
Definition: module.h:231
int rpz_apply_qname_trigger(struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, struct ub_server_stats *stats)
Walk over the RPZ zones to find and apply a QNAME trigger policy.
Definition: rpz.c:939
void lruhash_traverse(struct lruhash *h, int wr, void(*func)(struct lruhash_entry *, void *), void *arg)
Traverse a lruhash.
Definition: lruhash.c:524
struct module_func_block * iter_get_funcblock(void)
Get the iterator function block.
Definition: iterator.c:3948
static struct val_neg_zone * neg_setup_zone_node(uint8_t *nm, size_t nm_len, int labs, uint16_t dclass)
Create a single zone node.
Definition: val_neg.c:449
int minimise_count
Count number of QNAME minimisation iterations.
Definition: iterator.h:397
int probetree_cmp(const void *x, const void *y)
probe tree compare function
Definition: autotrust.c:92
static void negative_del_rrset(struct lruhash_entry *e, void *arg)
callback to delete negative and servfail rrsets
Definition: remote.c:1842
static void print_build_options(void)
print build options.
Definition: unbound.c:101
int dnsc_handle_curved_request(struct dnsc_env *dnscenv, struct comm_reply *repinfo)
Definition: dnscrypt.c:884
int unique_mesh_state(struct edns_option *list, struct module_env *env)
Check if an unique mesh state is required.
Definition: module.c:206
#define PTR_MAX_OFFSET
largest valid compression offset
Definition: msgparse.h:208
struct module_env * env
module env master value
Definition: context.h:112
@ local_zone_transparent
resolve normally
Definition: localzone.h:75
static void auth_data_delete(struct auth_data *n)
delete auth data domain node
Definition: authzone.c:362
void * stop_flush_event
in stop flush, this is nonNULL and references the stop_ev
Definition: dtstream.h:178
pid_t bg_pid
pid of bg worker process
Definition: context.h:89
@ LDNS_RDF_TYPE_STR
txt string
Definition: rrdef.h:280
static void tcp_proxy_delete(struct tcp_proxy *p)
delete tcp proxy
Definition: delayer.c:533
void worker_delete(struct worker *worker)
Delete worker.
Definition: worker.c:1953
static enum sec_status nsec3_do_prove_nodata(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, struct query_info *qinfo)
Do the nodata proof.
Definition: val_nsec3.c:1092
struct ub_packed_rrset_key * resp_addr_get_rrset(struct resp_addr *addr)
returns rrset portion of the specified node in the respip address tree; returns NULL for NULL input; ...
Definition: respip.c:1293
int track_max_scope
keep track of longest received scope, set after receiving CNAME for incoming QNAME.
Definition: subnetmod.h:89
void(* cleanup)(void *)
what function to call to cleanup when last id is reached
Definition: alloc.h:88
void comm_timer_disable(struct comm_timer *timer)
disable timer.
Definition: fake_event.c:1508
int context_finalize(struct ub_ctx *ctx)
finalize a context.
Definition: context.c:56
int serve_expired_ttl_reset
reset serve expired TTL after failed update attempt
Definition: config_file.h:370
Statistics to send over the control pipe when asked This struct is made to be memcopied,...
Definition: unbound.h:801
struct mesh_state * mesh_state_create(struct module_env *env, struct query_info *qinfo, struct respip_client_info *cinfo, uint16_t qflags, int prime, int valrec)
Create and initialize a new mesh state and its query state Does not put the mesh state into rbtrees a...
Definition: mesh.c:770
uint8_t edns_version
The EDNS version number.
Definition: msgparse.h:221
long long max_query_list_size
max value of query list size reached.
Definition: unbound.h:679
uint32_t sldns_str2period(const char *nptr, const char **endptr)
converts a ttl value (like 5d2h) to a long.
Definition: parseutil.c:212
struct module_env * env
environment for this query
Definition: module.h:629
static int print_id(FILE *out, char *fname, uint8_t *nm, size_t nmlen, uint16_t dclass)
print ID to file
Definition: autotrust.c:1082
struct sldns_struct_lookup_table * sldns_edns_flags
EDNS flags.
Definition: wire2str.c:160
void * fstrm_create_control_frame_finish(size_t *len)
This creates an FSTRM control frame of type FINISH.
Definition: dnstap_fstrm.c:151
static int print_longnum(RES *ssl, const char *desc, size_t x)
print long number
Definition: remote.c:778
size_t pkt_len
length of query packet.
Definition: outside_network.h:249
static struct dns_msg * msg_create(struct regional *region, struct query_info *qinfo)
create new dns_msg
Definition: authzone.c:110
uint32_t flags
the flags for the rrset, like for packedrrset
Definition: msgparse.h:161
void key_cache_insert(struct key_cache *kcache, struct key_entry_key *kkey, struct module_qstate *qstate)
Insert or update a key cache entry.
Definition: val_kcache.c:83
struct lruhash_entry * lru_prev
prev entry in lru chain.
Definition: lruhash.h:216
uint8_t copy_ednsdata_assume_clientsubnet
copy ednsdata to reply, assume it is clientsubnet and adjust scopemask to match sourcemask
Definition: testpkts.h:210
void(* sig_cb)(int, void *)
signal handler callback
Definition: replay.h:310
static int verb
verbosity for unbound-host app
Definition: unbound-host.c:79
int ipsecmod_init(struct module_env *env, int id)
Init the ipsecmod module.
static int rpz_insert_response_ip_trigger(struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len)
Insert RR into RPZ's respip_set.
Definition: rpz.c:540
@ repevt_tempfile_check
check a temp file
Definition: replay.h:208
struct sockaddr_storage dest
destination
Definition: perf.c:84
int sent_count
number of queries fired off
Definition: iterator.h:310
char * next
next chunk.
Definition: regional.h:66
@ respip_inform
log query source and answer query
Definition: localzone.h:544
void log_reply_info(enum verbosity_value v, struct query_info *qinf, struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur, int cached, struct sldns_buffer *rmsg)
Print string with neat domain name, type, class, status code from, and size of a query response.
Definition: msgreply.c:843
static void do_status(RES *ssl, struct worker *worker)
do the status command
Definition: remote.c:2288
static void usage(void)
Give petal usage, and exit (1).
Definition: petal.c:73
struct listen_port * next
next in list
Definition: listen_dnsport.h:107
static void rr_transform(char *txt_in, char *wire1, char *txt_out, char *wire2, size_t bufs)
Transform input.
Definition: unitldns.c:75
rbtree_type data
local data for this zone rbtree of struct local_data
Definition: localzone.h:155
static void zone_del_kcache(struct lruhash_entry *e, void *arg)
callback to delete keys in zone
Definition: remote.c:1720
uint8_t * sldns_str2wire_dname(const char *str, size_t *len)
Convert text string into dname wireformat.
Definition: str2wire.c:170
int sldns_wire2str_tsigtime_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat tsigtime field to string, with user buffers.
Definition: wire2str.c:1067
static int print_thread_stats(RES *ssl, int i, struct ub_stats_info *s)
print stats for one thread
Definition: remote.c:768
static int client_info_compare(const struct respip_client_info *ci_a, const struct respip_client_info *ci_b)
Compare two response-ip client info entries for the purpose of mesh state compare.
Definition: mesh.c:149
void * event
event structure that the thread uses
Definition: dtstream.h:139
void ub_event_base_free(struct ub_event_base *)
Free event base.
Definition: ub_event.c:263
int fd
file descriptor that the thread writes to
Definition: dtstream.h:137
static ldns_key_list * read_keys(int num, char *names[], struct keysets *set)
read all key files, exit on error
Definition: signit.c:125
static int reply_with_finish(int fd)
reply with FINISH control frame to bidirectional client, returns 0 on error
Definition: unbound-dnstap-socket.c:825
int sldns_wire2str_edns_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen)
Scan wireformat EDNS OPT to string, with user buffers.
Definition: wire2str.c:2021
void listen_sslctx_delete_ticket_keys(void)
Free memory used for TLS session ticket keys.
Definition: net_help.c:1541
void addr_tree_init_parents(rbtree_type *tree)
Initialize parent pointers in addr tree.
Definition: dnstree.c:134
static int rrset_equal(struct ub_packed_rrset_key *k1, struct ub_packed_rrset_key *k2)
check equality of two rrsets
Definition: iter_utils.c:912
long long tcp_accept_usage
usage of tcp accept list
Definition: unbound.h:739
int val_log_squelch
squelch val_log_level to log - this is library goes to callback
Definition: config_file.h:358
#define ALIGNMENT
what size to align on; make sure a char* fits in it.
Definition: regional.c:53
static void get_random_data(char **fromp, char **top, char *zname)
get static pointer to random data names from and to
Definition: unitneg.c:113
void local_zones_del_zone(struct local_zones *zones, struct local_zone *z)
Delete a zone.
Definition: localzone.c:1866
void alloc_set_id_cleanup(struct alloc_cache *alloc, void(*cleanup)(void *), void *arg)
Set cleanup on ID overflow callback function.
Definition: alloc.c:357
int parse_edns_from_pkt(sldns_buffer *pkt, struct edns_data *edns, struct regional *region)
If EDNS data follows a query section, extract it and initialize edns struct.
Definition: msgparse.c:1062
unsigned long magic
magic must be UB_EVENT_MAGIC (0x44d74d78)
Definition: unbound-event.h:168
Delegation Point.
Definition: iter_delegpt.h:57
size_t nsec3_get_nextowner_b32(struct ub_packed_rrset_key *rrset, int r, uint8_t *buf, size_t max)
Get next owner name, converted to base32 encoding and with the zone name (taken from the nsec3 owner ...
Definition: val_nsec3.c:268
int fallback_enabled
fallback to the internet on failure or ttl-expiry of auth zone
Definition: authzone.h:123
@ acl_refuse
disallow access, send a polite 'REFUSED' reply
Definition: acl_list.h:58
void * minfo[MAX_MODULE]
module specific data for query.
Definition: module.h:627
struct comm_point * outnet_comm_point_for_udp(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen)
Create udp commpoint suitable for sending packets to the destination.
Definition: outside_network.c:2268
static struct lruhash_entry * new_entry(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, time_t tm)
Create and init a new entry for a host.
Definition: infra.c:407
size_t listen_get_mem(struct listen_dnsport *listen)
get memory size used by the listening structs
Definition: listen_dnsport.c:1552
size_t unbound_mem_freed
global debug value to keep track of total memory frees
Definition: alloc.c:367
size_t cur_msg_done
number of bytes written for the current message
Definition: dtstream.h:164
void comm_signal_callback(int sig, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:3387
enum val_state state
State of the validator module.
Definition: validator.h:151
int local_rrset_remove_rr(struct packed_rrset_data *pd, size_t index)
Remove RR from rrset that is created using localzone's rrset_insert_rr.
Definition: localzone.c:400
static void perf_encode(struct query_info *qi, struct reply_info *rep, uint16_t id, uint16_t flags, sldns_buffer *out, time_t timenow, struct edns_data *edns)
performance test message encoding
Definition: unitmsgparse.c:166
uint8_t * data
the data from this chunk, this is what was received.
Definition: authzone.h:461
int edns_known_options_init(struct module_env *env)
Initialize the edns known options by allocating the required space.
Definition: module.c:75
int config_get_option_collate(struct config_file *cfg, const char *opt, char **str)
Get an option and collate results into string.
Definition: config_file.c:788
static void corner_cases(struct regional *r)
test regional corner cases, zero, one, end of structure
Definition: unitregional.c:48
static void libworker_do_cmd(struct libworker *w, uint8_t *msg, uint32_t len)
do control command coming into bg server
Definition: libworker.c:295
char * chrootdir
chrootdir, if not "" or chroot will be done
Definition: config_file.h:285
int exit_cleanly
time to exit cleanly
Definition: replay.h:314
Definition: addrtree.h:91
int sldns_wire2str_tag_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat TAG field to string, with user buffers.
Definition: wire2str.c:1691
struct tube_res_list * res_list
list of outstanding results to be written back
Definition: tube.h:89
An item that has to be TCP relayed.
Definition: delayer.c:100
struct local_data * local_zone_find_data(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs)
Find a data node by exact name for a local zone.
Definition: localzone.c:420
void ub_resolve_free(struct ub_result *result)
Free storage associated with a result structure.
Definition: libunbound.c:870
struct ub_randstate * rndstate
random() table for this worker.
Definition: libworker.h:88
int nsec3_get_params(struct ub_packed_rrset_key *rrset, int r, int *algo, size_t *iter, uint8_t **salt, size_t *saltlen)
Get NSEC3 parameters out of rr.
Definition: val_nsec3.c:209
void macro_print_debug(rbtree_type *store)
Print macro variables stored as debug info.
Definition: replay.c:900
struct comm_base * base
the event base this worker works with
Definition: libworker.h:84
static void nsec3_hash_test(const char *fname)
Read file to test NSEC3 hash algo.
Definition: unitverify.c:463
static uint8_t * get_tld_label(uint8_t *dname, size_t maxdnamelen)
Get the label that is just before the root label.
Definition: rpz.c:116
#define OUTBOUND_UDP_RETRY
number of retries on outgoing UDP queries
Definition: outside_network.c:80
static void infra_test(void)
test host cache
Definition: unitmain.c:458
@ respip_typetransparent
gives response data (if any), else nodata answer.
Definition: localzone.h:570
size_t iter_get_mem(struct module_env *env, int id)
iterator alloc size routine
Definition: iterator.c:3929
void ipset_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
Operate on an event on a query (in qstate).
Definition: ipset.c:288
void tcp_req_info_handle_readdone(struct tcp_req_info *req)
Handle read done of a new request from the client.
Definition: listen_dnsport.c:1803
void comm_point_stop_listening(struct comm_point *c)
Stop listening for input on the commpoint.
Definition: netevent.c:3195
int labs
number of labels in domain name, kept to help compare func.
Definition: msgencode.c:88
@ LDNS_RR_TYPE_DNAME
RFC2672.
Definition: rrdef.h:161
static int auth_zones_setup_zones(struct auth_zones *az)
Setup all zones.
Definition: authzone.c:1833
int iter_lookup_parent_NS_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
Add parent NS record if that exists in the cache.
Definition: iter_utils.c:1167
#define NETEVENT_DONE
to pass done transfer to callback function; http file is complete
Definition: netevent.h:89
void val_clear(struct module_qstate *qstate, int id)
validator cleanup query state
Definition: validator.c:3245
int sldns_wire2str_rdata_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, uint16_t rrtype, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rdata to string, with user buffers.
Definition: wire2str.c:703
static size_t calc_zone_need(uint8_t *d, size_t len)
Calculate space needed for zone and all its parents.
Definition: val_neg.c:350
struct ub_event * ub_signal_new(struct ub_event_base *base, int fd, void(*cb)(int, short, void *), void *arg)
Create a new ub_event signal for the event base.
Definition: ub_event_pluggable.c:520
size_t len
length of allocated data
Definition: authzone.h:463
static void rtt_test(void)
test RTT code
Definition: unitmain.c:411
void comm_timer_set(struct comm_timer *timer, struct timeval *tv)
reset timevalue for timer.
Definition: fake_event.c:1515
int config_add_tag(struct config_file *cfg, const char *tag)
Add a tag name to the config.
Definition: config_file.c:1923
static void set_neg_cache_stats(struct worker *worker, struct ub_server_stats *svr, int reset)
Set the neg cache stats.
Definition: stats.c:162
@ LDNS_RR_TYPE_SRV
SRV record RFC2782.
Definition: rrdef.h:149
static void set_kiddo_parents(struct local_zone *z, struct local_zone *match, struct local_zone *newp)
iterate over the kiddies of the given name and set their parent ptr
Definition: localzone.c:1811
uint32_t padding
32 bit padding to pad struct member alignment to 64 bits.
Definition: msgreply.h:144
int sldns_wire2str_type_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat rr type to string, with user buffers.
Definition: wire2str.c:921
enum sec_status nsec3_prove_wildcard(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, uint8_t *wc)
Prove that a positive wildcard match was appropriate (no direct match RRset).
Definition: val_nsec3.c:1243
void daemon_delete(struct daemon *daemon)
Delete workers, close listening ports.
Definition: daemon.c:737
size_t namelen
length of the delegation point name
Definition: iter_delegpt.h:61
static void do_service(char *addr, int port, char *key, char *cert)
provide ssl service
Definition: petal.c:572
int min_ttl
the number of seconds minimum TTL used for RRsets and messages
Definition: config_file.h:274
struct sldns_buffer * raw_ednsdata
Additional EDNS data for matching queries.
Definition: testpkts.h:157
size_t delegpt_count_targets(struct delegpt *dp)
count total number of targets in dp
Definition: iter_delegpt.c:316
struct delegpt_addr * result_list
the list of returned targets; subset of target_list
Definition: iter_delegpt.h:73
void void log_err(const char *format,...) ATTR_FORMAT(printf
Log error message.
void edns_known_options_delete(struct module_env *env)
Free the allocated space for the known edns options.
Definition: module.c:85
List of strings for config options.
Definition: config_file.h:721
static void serviced_gen_query(sldns_buffer *buff, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags)
create query for serviced queries
Definition: outside_network.c:1382
int refetch_glue
This is a flag that, if true, means that this query is for (re)fetching glue from a zone.
Definition: iterator.h:376
static size_t anchors_ds_unsupported(struct trust_anchor *ta)
Check DS algos for support, warn if not.
Definition: val_anchor.c:953
struct local_zones * local_zones_create(void)
Create local zones storage.
Definition: localzone.c:60
long long mesh_replies_sum_wait_sec
mesh stats: sum of waiting times for the replies
Definition: unbound.h:816
void anchors_init_parents_locked(struct val_anchors *anchors)
Recalculate parent pointers.
Definition: val_anchor.c:155
static int remove_rr(const char *str, sldns_buffer *pkt, struct rrset_parse *rrset, struct rr_parse *prev, struct rr_parse **rr, struct sockaddr_storage *addr, socklen_t addrlen)
remove RR from msgparse RRset, return true if rrset is entirely bad
Definition: iter_priv.c:212
#define FSTRM_CONTROL_FRAME_READY
control frame value to denote the control frame READY
Definition: dnstap_fstrm.h:106
int fptr_whitelist_print_func(void(*fptr)(char *, void *))
Check function pointer whitelist for config_get_option func values.
Definition: fptr_wlist.c:584
int rr
where are the parameters for conversion, this RR number in data
Definition: val_nsec3.h:234
size_t nsec3_hash_to_b32(uint8_t *hash, size_t hashlen, uint8_t *zone, size_t zonelen, uint8_t *buf, size_t max)
Convert hash into base32 encoding and with the zone name appended.
Definition: val_nsec3.c:250
#define S_POW2(str, var)
put pow2 number into variable
Definition: config_file.c:418
int dname_pkt_compare(sldns_buffer *pkt, uint8_t *d1, uint8_t *d2)
Compare dnames in packet (compressed).
Definition: dname.c:233
static int massage_class(const char *c)
massage input class
Definition: unbound-host.c:203
void errinf(struct module_qstate *qstate, const char *str)
Append text to the error info for validation.
Definition: config_file.c:2379
int sldns_str2wire_cert_alg_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_CERT_ALG from string to wireformat.
Definition: str2wire.c:1366
rbnode_type node
rbnode, key is an order_id ptr
Definition: lock_verify.c:92
#define RBTREE_NULL
The nullpointer, points to empty node.
Definition: rbtree.h:69
static void anchor_state_update(struct module_env *env, struct autr_ta *anchor, int *c)
Do statestable transition matrix for anchor.
Definition: autotrust.c:1793
struct ub_packed_rrset_key * key
the key with lock, and ptr to packed data.
Definition: msgreply.h:106
int val_nsec_proves_insecuredelegation(struct ub_packed_rrset_key *nsec, struct query_info *qinfo)
Determine if an nsec proves an insecure delegation towards the qname.
Definition: val_nsec.c:453
struct delegpt_addr * delegpt_find_addr(struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen)
Find address record in total list of delegation point.
Definition: iter_delegpt.c:146
int query_info_compare(void *m1, void *m2)
Compare two queryinfo structures, on query and type, class.
Definition: msgreply.c:575
static void log_errno(const char *str)
print errno
Definition: petal.c:93
long long mesh_num_states
mesh stats: current number of states
Definition: unbound.h:806
static void init_outgoing_availports(int *array, int num)
init ports possible for use
Definition: config_file.c:1521
static struct ub_packed_rrset_key * reply_find_soa(struct reply_info *rep)
find zone name of message, returns the SOA record
Definition: val_neg.c:566
int libworker_bg(struct ub_ctx *ctx)
Create a background worker.
Definition: libworker.c:383
static void pending_node_del(rbnode_type *node, void *arg)
helper pending delete
Definition: outside_network.c:877
int sldns_str2wire_int16_data_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT16_DATA from string to wireformat.
Definition: str2wire.c:2102
static void ip_rate_list(struct lruhash_entry *e, void *arg)
list items in the ip_ratelimit table
Definition: remote.c:2816
@ VAL_FINISHED_STATE
finish up
Definition: validator.h:139
static testkey_type * newkey(int id)
allocate new key, fill in hash
Definition: unitlruhash.c:61
struct local_zone * parent
parent zone, if any.
Definition: localzone.h:122
char * username
username to change to, if not "".
Definition: config_file.h:287
static void adjust_host(char *host)
adjust host
Definition: petal.c:330
int autr_permit_small_holddown
for debug allow small timeout values for fast rollovers
Definition: config_file.c:78
struct entry * read_entry(FILE *in, const char *name, struct sldns_file_parse_state *pstate, int skip_whitespace)
Read one entry from the data file.
Definition: testpkts.c:524
int have_downstream
do we have downstream enabled
Definition: authzone.h:80
int fd
file descriptor for communication point
Definition: netevent.h:160
int numports
number of ports for this worker
Definition: worker.h:100
#define BLACKLIST_PENALTY
penalty to validation failed blacklisted IPs
Definition: iter_utils.c:73
void dns64_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
This function is called when a sub-query finishes to inform the parent query.
Definition: dns64.c:935
uint8_t * cmd_msg
the current read command content, malloced, can be partially read
Definition: tube.h:81
size_t dlv_lookup_name_len
length of dlv lookup name
Definition: validator.h:228
static int xfr_probe_lookup_host(struct auth_xfer *xfr, struct module_env *env)
lookup a host name for its addresses, if needed
Definition: authzone.c:6249
int prefetch_key
if prefetching of DNSKEYs should be performed.
Definition: config_file.h:280
@ local_zone_typetransparent
do not block types at localdata names
Definition: localzone.h:77
void server_stats_reply(struct worker *worker, int reset)
Send stats over comm tube in reply to query cmd.
Definition: stats.c:386
int hide_trustanchor
do not report trustanchor (trustanchor.unbound)
Definition: config_file.h:317
static uint32_t extract_ipv4(const uint8_t ipv6[], size_t ipv6_len, const int offset)
Extract an IPv4 address embedded in the IPv6 address ipv6 at offset offset (in bits).
Definition: dns64.c:199
#define DNSCACHE_STORE_ZEROTTL
Flags to control behavior of dns_cache_store() and dns_cache_store_msg().
Definition: dns.h:56
size_t dnscrypt_shared_secret_cache_slabs
number of slabs for dnscrypt shared secrets cache
Definition: config_file.h:574
uint16_t ds_get_keytag(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
Get DS keytag, footprint value that matches the DNSKEY keytag it signs.
Definition: val_sigcrypt.c:228
const char * ub_event_get_version(void)
Returns event-base type.
Definition: ub_event.c:146
int mesh_state_attachment(struct mesh_state *super, struct mesh_state *sub)
Setup attachment super/sub relation between super and sub mesh state.
Definition: mesh.c:1069
void comm_point_raw_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
struct to keep a linked list of reply packets for a query
Definition: testpkts.h:149
static void revoke_dnskey(struct autr_ta *ta, int off)
revoke a trust anchor
Definition: autotrust.c:1331
size_t _limit
The read/write limit.
Definition: sbuffer.h:122
uint16_t fclass
class of records for the NSEC3, only this class applies
Definition: val_nsec3.c:107
void bin_init(struct lruhash_bin *array, size_t size)
init the hash bins for the table
Definition: lruhash.c:48
static int assemble_iterate_dnskey(struct autr_ta **list, uint8_t **rr, size_t *rr_len, size_t *dname_len)
iterator for DNSKEYs from keylist.
Definition: autotrust.c:574
void void void void log_hex(const char *msg, void *data, size_t length)
Log a hex-string to the log.
Definition: log.c:401
void respip_deinit(struct module_env *env, int id)
response-ip deinit
Definition: respip.c:558
void * answer_packet
The DNS answer packet.
Definition: unbound.h:158
int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_type fptr)
Check function pointer whitelist for lruhash deldata callback values.
Definition: fptr_wlist.c:303
void algo_needs_init_dnskey_add(struct algo_needs *n, struct ub_packed_rrset_key *dnskey, uint8_t *sigalg)
Initialize algo needs structure, set algos from rrset as needed.
Definition: val_sigcrypt.c:389
void ub_event_add_bits(struct ub_event *, short bits)
Add event bits for this event to fire on.
Definition: ub_event.c:362
static int isip4(const char *nm, char **res)
determine if str is ip4 and put into reverse lookup format
Definition: unbound-host.c:117
struct timeval lower
lower bound
Definition: timehist.h:53
size_t svcd_overhead
serviced_callbacks malloc overhead when processing multiple identical serviced queries to the same se...
Definition: outside_network.h:83
#define PREFETCH_TTL_CALC(ttl)
calculate the prefetch TTL as 90% of original.
Definition: msgreply.h:63
socklen_t addr_len
length of addr
Definition: delayer.c:84
#define PACKED_RRSET_SOA_NEG
this rrset is SOA and has the negative ttl (from nxdomain or nodata), this is set on SOA rrsets in th...
Definition: packed_rrset.h:59
static int pending_find_match(struct replay_runtime *runtime, struct entry **entry, struct fake_pending *pend)
Find the range that matches this pending message.
Definition: fake_event.c:234
int rrset_cache_update(struct rrset_cache *r, struct rrset_ref *ref, struct alloc_cache *alloc, time_t timenow)
Update an rrset in the rrset cache.
Definition: rrset.c:185
hashvalue_type pkt_hash_rrset(sldns_buffer *pkt, uint8_t *dname, uint16_t type, uint16_t dclass, uint32_t rrset_flags)
Calculate hash value for rrset in packet.
Definition: msgparse.c:167
static int list_is_secure(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct key_entry_key *kkey, char **reason, struct module_qstate *qstate)
test if list is all secure
Definition: val_nsec3.c:1290
rbtree_type n
Tree of the domains spans that are allowed to contain the blocked address spans.
Definition: iter_priv.h:70
const char * ub_event_get_version(void)
Returns event-base type.
Definition: ub_event_pluggable.c:150
static void parse_cmdline(char *argv[], struct keysets *s)
read expi ince keytag owner from cmdline
Definition: signit.c:114
struct lruhash_entry entry
entry into hashtable.
Definition: packed_rrset.h:113
static int iter_find_rrset_in_prepend_answer(struct iter_qstate *iq, struct ub_packed_rrset_key *rrset)
Find rrset in ANSWER prepend list.
Definition: iterator.c:459
struct tcl_addr * tcl_addr
the entry for the connection.
Definition: netevent.h:269
int sldns_wire2str_header_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat packet header to string, with user buffers.
Definition: wire2str.c:663
static int rrinternal_get_type(sldns_buffer *strbuf, char *token, size_t token_len, int *not_there, uint16_t *tp)
read type
Definition: str2wire.c:293
time_t retry_time
when to retry if failed
Definition: autotrust.h:113
struct comm_reply * reply
comm_reply contains server replies
Definition: module.h:608
uint8_t match_question
match question section
Definition: testpkts.h:178
int infra_ip_ratelimit
ratelimit value for client ip addresses, in queries per second.
Definition: infra.c:68
struct config_strlist * next
next item in list
Definition: config_file.h:723
static testdata_type * newdata(int val)
new data el
Definition: unitlruhash.c:71
size_t max_forever_states
max forever number of reply states to have
Definition: mesh.h:109
void ub_event_add_bits(struct ub_event *ev, short bits)
Add event bits for this event to fire on.
Definition: ub_event.c:362
void ub_thread_blocksigs(void)
block all signals, masks them away.
Definition: locks.c:51
unsigned int keep_missing
autotrust keep_missing time, in seconds.
Definition: config_file.h:383
void * cb_arg
argument to pass to callback.
Definition: netevent.h:315
int delegpt_add_addr(struct delegpt *dp, struct regional *region, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name, int *additions)
Add address to the delegation point.
Definition: iter_delegpt.c:184
int sldns_wire2str_dname_buf(uint8_t *d, size_t dlen, char *s, size_t slen)
Convert wire dname to a string, "example.com.".
Definition: wire2str.c:311
struct lruhash_entry * lru_start
the lru list, start and end, noncyclical double linked list.
Definition: lruhash.h:171
static int worker_check_request(sldns_buffer *pkt, struct worker *worker)
check request sanity.
Definition: worker.c:328
static enum sec_status val_nsec_proves_no_ds(struct ub_packed_rrset_key *nsec, struct query_info *qinfo)
For an NSEC that matches the DS queried for, check absence of DS type.
Definition: val_nsec.c:149
enum respip_action action
action for this address span
Definition: respip.h:43
struct module_stack mods
active module stack
Definition: mesh.h:84
#define MINIMISE_ONE_LAB
number of labels from QNAME that are always send individually when using QNAME minimisation,...
Definition: iterator.h:84
void alloc_reg_release(struct alloc_cache *alloc, struct regional *r)
Put regional for query states back into alloc cache.
Definition: alloc.c:342
struct for query and answer checks
Definition: unitauth.c:56
void mesh_run(struct mesh_area *mesh, struct mesh_state *mstate, enum module_ev ev, struct outbound_entry *e)
Run the mesh.
Definition: mesh.c:1668
Callback to party interested in serviced query results.
Definition: outside_network.h:306
struct tcp_send_list * querylast
last in query list
Definition: delayer.c:132
struct dns_msg * serve_expired_lookup_func_type(struct module_qstate *qstate, struct query_info *lookup_qinfo)
Function called when looking for (expired) cached answers during the serve expired logic.
Definition: module.h:317
int sldns_wire2str_nsap_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat NSAP field to string, with user buffers.
Definition: wire2str.c:1533
struct lruhash * slabhash_gettable(struct slabhash *table, hashvalue_type hash)
Get lruhash table for a given hash value.
Definition: slabhash.c:179
hashvalue_type query_info_hash(struct query_info *q, uint16_t flags)
calculate hash value of query_info, lowercases the qname, uses CD flag for AAAA qtype
Definition: msgreply.c:627
uint8_t * context_serialize_answer(struct ctx_query *q, int err, sldns_buffer *pkt, uint32_t *len)
Serialize a context_query result to hand back to user.
Definition: context.c:296
rbnode_type node
rbtree node, key is this structure
Definition: val_anchor.h:96
void alloc_clear_special(struct alloc_cache *alloc)
Free the special alloced items.
Definition: alloc.c:146
void delegpt_no_ipv6(struct delegpt *dp)
Register the fact that there is no ipv6 and thus AAAAs are not going to be queried for or be useful.
Definition: iter_delegpt.c:510
static int dnscrypt_server_curve(const dnsccert *cert, uint8_t client_nonce[crypto_box_HALF_NONCEBYTES], uint8_t nmkey[crypto_box_BEFORENMBYTES], struct sldns_buffer *buffer, uint8_t udp, size_t max_udp_size)
Encrypt a reply using the dnsccert that was used with the query.
Definition: dnscrypt.c:461
char * zonefile
zonefile name (or NULL for no zonefile)
Definition: authzone.h:121
struct regional * scratchpad
thread scratch regional
Definition: worker.h:121
void timehist_insert(struct timehist *hist, struct timeval *tv)
Add time value to histogram.
Definition: timehist.c:134
@ comm_ssl_shake_none
no handshake, it has been done
Definition: netevent.h:196
void libworker_alloc_cleanup(void *arg)
cleanup the cache to remove all rrset IDs from it, arg is libworker
Definition: libworker.c:846
int name_tree_compare(const void *k1, const void *k2)
compare name tree nodes
Definition: dnstree.c:47
static int nsec3_unknown_flags(struct ub_packed_rrset_key *rrset, int r)
return if nsec3 RR has unknown flags
Definition: val_nsec3.c:122
struct delegpt * hints_lookup_root(struct iter_hints *hints, uint16_t qclass)
Find root hints for the given class.
Definition: iter_hints.c:460
ub_thread_type bg_tid
tid of bg worker thread
Definition: context.h:91
int ub_ctx_add_ta(struct ub_ctx *ctx, const char *ta)
Add a trust anchor to the given context.
Definition: libunbound.c:390
void views_delete(struct views *v)
Delete views storage.
Definition: view.c:93
int sldns_str2wire_b32_ext_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_B32_EXT from string to wireformat.
Definition: str2wire.c:1222
Known edns option.
Definition: module.h:215
Autotrust metadata for one trust anchor key.
Definition: autotrust.h:67
struct ub_packed_rrset_key * rrset_cache_lookup(struct rrset_cache *r, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint32_t flags, time_t timenow, int wr)
Lookup rrset.
Definition: rrset.c:275
static void tap_socket_close(struct tap_socket *s)
close the tap socket
Definition: unbound-dnstap-socket.c:171
#define BIT_Z
Z flag.
Definition: net_help.h:61
struct config_str2list * local_zones
local zones config
Definition: config_file.h:395
void log_crypto_err(const char *str)
Log libcrypto error with descriptive string.
Definition: net_help.c:834
lock_rw_type rpz_lock
rw lock for rpz linked list, needed when iterating or editing linked list.
Definition: authzone.h:89
Host information kept for every server, per zone.
Definition: infra.h:58
int dnstap_log_client_response_messages
true to log dnstap CLIENT_RESPONSE message events
Definition: config_file.h:516
static time_t xml_convertdate(const char *str)
XML convert DateTime element to time_t.
Definition: unbound-anchor.c:1303
void daemon_remote_exec(struct worker *worker)
Handle nonthreaded remote cmd execution.
Definition: remote.c:3074
void daemon_remote_clear(struct daemon_remote *rc)
remote control state to clear up.
Definition: remote.c:231
static void http_moveover_buffer(sldns_buffer *buf)
move unread buffer to start and clear rest for putting the rest into it
Definition: netevent.c:1974
static void dstest_file(const char *fname)
verify DS matches DNSKEY from a file
Definition: unitverify.c:334
int sldns_str2wire_hip_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_HIP from string to wireformat.
Definition: str2wire.c:2052
static void dnskey_get_pubkey(struct ub_packed_rrset_key *k, size_t idx, unsigned char **pk, unsigned int *pklen)
get public key rdata field from a dnskey RR and do some checks
Definition: val_sigcrypt.c:190
void key_entry_hash(struct key_entry_key *kk)
calculate hash for key entry
Definition: val_kentry.c:102
struct ub_ctx * ub_ctx_create_ub_event(struct ub_event_base *base)
Create a resolving and validation context.
Definition: libunbound.c:197
void donotq_delete(struct iter_donotq *dq)
Delete donotqueryaddresses structure.
Definition: iter_donotq.c:67
static struct tcl_addr * tcl_list_insert(struct tcl_list *tcl, struct sockaddr_storage *addr, socklen_t addrlen, int net, uint32_t limit, int complain_duplicates)
insert new address into tcl_list structure
Definition: tcp_conn_limit.c:87
struct ub_packed_rrset_key * rrset
RRset data item.
Definition: localzone.h:184
int apply_edns_options(struct edns_data *edns_out, struct edns_data *edns_in, struct config_file *cfg, struct comm_point *c, struct regional *region)
Apply common EDNS options.
Definition: edns.c:75
int inplace_cb_edns_back_parsed_func_type(struct module_qstate *qstate, int id, void *cb_args)
Inplace callback function called after parsing edns on query reply.
Definition: module.h:294
void bin_split(struct lruhash *table, struct lruhash_bin *newa, int newmask)
Split hash bin into two new ones.
Definition: lruhash.c:117
int sldns_wire2str_edns_ul_print(char **s, size_t *sl, uint8_t *data, size_t len)
Print EDNS UL option data to string.
Definition: wire2str.c:1782
char * sldns_strip_ws(char *line)
Strip whitespace from the start and the end of line.
Definition: str2wire.c:849
struct mesh_state * mesh_state
the mesh state
Definition: listen_dnsport.h:284
void inplace_cb_delete(struct module_env *env, enum inplace_cb_list_type type, int id)
Delete callback for specified type and module id.
Definition: module.c:157
int sldns_str2wire_nsap_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_NSAP from string to wireformat.
Definition: str2wire.c:1785
int autr_read_file(struct val_anchors *anchors, const char *nm)
Read autotrust file.
Definition: autotrust.c:985
int fptr_whitelist_modenv_detect_cycle(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec))
Check function pointer whitelist for module_env detect_cycle callback values.
Definition: fptr_wlist.c:380
static char * create_tmp_file(const char *s)
create temp file, return (malloced) name string, write contents to it
Definition: unitauth.c:480
uint16_t ancount
count of RRs, host format
Definition: msgparse.h:103
#define UB_STATS_RPZ_ACTION_NUM
number of RPZ actions
Definition: unbound.h:660
struct key_cache * key_cache
shared key cache
Definition: module.h:335
struct waiting_tcp * tcp_wait_first
list of tcp queries waiting for a buffer
Definition: outside_network.h:160
void ub_event_base_free(struct ub_event_base *base)
Free event base.
Definition: ub_event.c:263
static void val_handle(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
Handle validator state.
Definition: validator.c:2447
static struct ub_ctx * create_unbound_context(const char *res_conf, const char *root_hints, const char *debugconf, const char *srcaddr, int ip4only, int ip6only)
Create a new unbound context with the commandline settings applied.
Definition: unbound-anchor.c:279
size_t qname_len
length of qname (including last 0 octet)
Definition: msgreply.h:77
void mesh_new_client(struct mesh_area *mesh, struct query_info *qinfo, struct respip_client_info *cinfo, uint16_t qflags, struct edns_data *edns, struct comm_reply *rep, uint16_t qid)
New query incoming from clients.
Definition: mesh.c:453
struct lruhash * slabhash_gettable(struct slabhash *sl, hashvalue_type hash)
Get lruhash table for a given hash value.
Definition: slabhash.c:179
int ub_ctx_data_remove(struct ub_ctx *ctx, const char *data)
Remove localdata from the library local authority info.
Definition: libunbound.c:1362
time_t err_limit_time
ratelimit for errors, time value
Definition: worker.h:108
socklen_t addrlen
length of addr field in use.
Definition: outside_network.h:349
static void service_main(DWORD argc, LPTSTR *argv)
The main function for the service.
Definition: win_svc.c:405
static void pending_list_delete(struct replay_runtime *runtime, struct fake_pending *pend)
Remove the item from the pending list.
Definition: fake_event.c:292
void lru_front(struct lruhash *table, struct lruhash_entry *entry)
Put entry at front of lru.
Definition: lruhash.c:266
int inplace_cb_reply_servfail_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply linked list.
Definition: msgreply.c:1086
@ comm_tcp_accept
TCP accept socket - only creates handlers if readable.
Definition: netevent.h:229
void local_zones_delete(struct local_zones *zones)
Delete local zones storage.
Definition: localzone.c:82
struct addrnode * parent_node
Parent node this ege is connected to.
Definition: addrtree.h:116
struct delegpt_ns * delegpt_find_ns(struct delegpt *dp, uint8_t *name, size_t namelen)
Find NS record in name list of delegation point.
Definition: iter_delegpt.c:132
static size_t count_chunks(struct regional *r)
reasonably slow, but stats and get_mem are not supposed to be fast count the number of chunks in use
Definition: regional.c:190
struct delegpt_addr * next_target
next delegation point in all targets list
Definition: iter_delegpt.h:138
static ssize_t receive_bytes(struct dt_io_thread *dtio, void *buf, size_t len)
Receive bytes from dtio->fd, store in buffer.
Definition: dtstream.c:888
int mesh_new_callback(struct mesh_area *mesh, struct query_info *qinfo, uint16_t qflags, struct edns_data *edns, sldns_buffer *buf, uint16_t qid, mesh_cb_func_type cb, void *cb_arg)
New query with callback.
Definition: mesh.c:598
void subnetmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
subnet module operate on a query
static void print_result(struct lookinfo *info)
print result from lookup nicely
Definition: asynclook.c:115
void worker_stop_accept(void *arg)
stop accept callback handler
Definition: worker.c:2043
uint8_t got4
if the ipv4 address is in the delegpt, 0=not, 1=yes 2=negative, negative means it was done,...
Definition: iter_delegpt.h:111
void comm_point_listen_for_rw(struct comm_point *c, int rd, int wr)
Stop listening and start listening again for reading or writing.
Definition: netevent.c:3249
@ worker_cmd_remote
execute remote control command
Definition: worker.h:75
enum sec_status nsec3_prove_nods(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, char **reason, struct module_qstate *qstate)
Prove that a DS response either had no DS, or wasn't a delegation point.
Definition: val_nsec3.c:1317
size_t priv_get_mem(struct iter_priv *priv)
Get memory used by priv structure.
Definition: iter_priv.c:204
size_t rr_len
length of rr
Definition: autotrust.h:73
int main(int argc, char *argv[])
main program
Definition: signit.c:273
int sldns_b32_pton_extended_hex(const char *src, size_t src_sz, uint8_t *dst, size_t dst_sz)
This function we get from ldns-compat or from base system it returns the number of data bytes stored ...
Definition: parseutil.c:601
inplace_cb_delete_wrapped_t inplace_cb_delete_wrapped
Wrapped inplace callback functions to circumvent callback whitelisting.
Definition: dynlibmod.h:132
void query_info_clear(struct query_info *m)
clear out query info structure
Definition: msgreply.c:591
char * dnstap_tls_cert_bundle
dnstap server cert bundle
Definition: config_file.h:495
static struct lruhash_entry * infra_find_ip_ratedata(struct infra_cache *infra, struct comm_reply *repinfo, int wr)
find data item in array for ip addresses
Definition: infra.c:813
@ comm_http
HTTP handler socket.
Definition: netevent.h:233
static void xfr_transfer_start_list(struct auth_xfer *xfr, struct auth_master *spec)
start the iteration of the task_transfer list of masters
Definition: authzone.c:3813
static int az_find_ce(struct auth_zone *z, struct query_info *qinfo, struct auth_data *node, int node_exact, struct auth_data **ce, struct auth_rrset **rrset)
Find the closest encloser, an name that exists and is above the qname.
Definition: authzone.c:2239
static void log_py_err(void)
log python error
Definition: pythonmod.c:122
static void fd_close(int fd)
close the fd
Definition: unbound-anchor.c:715
void * listen_sslctx
ssl context for listening to dnstcp over ssl, and connecting ssl
Definition: daemon.h:99
void delegpt_add_unused_targets(struct delegpt *dp)
Add all usable targets to the result list.
Definition: iter_delegpt.c:304
int aggressive_nsec
use cached NSEC records to synthesise (negative) answers
Definition: config_file.h:362
int sldns_str2wire_int8_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT8 from string to wireformat.
Definition: str2wire.c:1019
uint8_t * name
zone name, in uncompressed wireformat
Definition: authzone.h:207
struct ctx_query * context_lookup_new_query(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Lookup query from new_query buffer.
Definition: context.c:278
int query_info_parse(struct query_info *m, struct sldns_buffer *query)
Parse wire query into a queryinfo structure, return 0 on parse error.
Definition: msgreply.c:546
static int iter_prepend(struct iter_qstate *iq, struct dns_msg *msg, struct regional *region)
prepend the prepend list in the answer and authority section of dns_msg
Definition: iterator.c:397
enum response_type response_type_from_server(int rdset, struct dns_msg *msg, struct query_info *request, struct delegpt *dp)
Classifies a response message (from the wire) based on the current request.
Definition: iter_resptype.c:107
int fptr_whitelist_inplace_cb_edns_back_parsed(inplace_cb_edns_back_parsed_func_type *fptr)
Check function pointer whitelist for inplace_cb_edns_back_parsed func values.
Definition: fptr_wlist.c:648
int sldns_wire2str_a_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat ip4 A field to string, with user buffers.
Definition: wire2str.c:1091
void worker_start_accept(void *arg)
start accept callback handler
Definition: worker.c:2035
struct delegpt_addr * usable_list
the list of usable targets; subset of target_list the items in this list are not part of the result l...
Definition: iter_delegpt.h:71
void mesh_detach_subs(struct module_qstate *qstate)
Detach-subqueries.
Definition: mesh.c:974
struct comm_point * cp
the transfer (TCP) to the master.
Definition: authzone.h:415
struct auth_transfer * task_transfer
Task for transfer.
Definition: authzone.h:227
time_t autr_probe_timer(struct module_env *env)
Process probe timer.
Definition: autotrust.c:2426
List of two strings for config options.
Definition: config_file.h:731
static int comm_point_http_handle_write(int fd, struct comm_point *c)
Handle http writing callback.
Definition: netevent.c:2392
int ipsecmod_domain_is_whitelisted(struct ipsecmod_env *ie, uint8_t *dname, size_t dname_len, uint16_t qclass)
See if a domain is whitelisted.
void log_warn(const char *format,...)
implementation of log_warn
Definition: log.c:328
int tcp_do_close
if set, the connection is closed on error, on timeout, and after read/write completes.
Definition: netevent.h:248
Trust anchor store.
Definition: val_anchor.h:60
static void * libworker_dobg(void *arg)
the background thread func
Definition: libworker.c:335
int libworker_fg(struct ub_ctx *ctx, struct ctx_query *q)
Create a foreground worker.
Definition: libworker.c:584
data structure to keep the canned queries in.
Definition: testpkts.h:166
time_t query_interval
when to query if !failed
Definition: autotrust.h:111
int optind
getopt global, in case header files fail to declare it.
struct key_entry_key * key_entry_copy_toregion(struct key_entry_key *kkey, struct regional *region)
Copy a key entry, to be region-allocated.
Definition: val_kentry.c:111
Local zone.
Definition: localzone.h:118
void ub_resolve_free(struct ub_result *result)
Free storage associated with a result structure.
Definition: libunbound.c:870
int sldns_str2wire_hex_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_HEX from string to wireformat.
Definition: str2wire.c:1248
rbtree_type ztree
rbtree of struct local_zone
Definition: localzone.h:112
int dname_canonical_compare(uint8_t *d1, uint8_t *d2)
Canonical dname compare.
Definition: dname.c:864
#define OUTBOUND_MSG_RETRY
number of retries on outgoing queries
Definition: iterator.h:98
static int processQueryTargets(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id)
This is the request event state where the request will be sent to one of its current query targets.
Definition: iterator.c:2148
int cfg_strbytelist_insert(struct config_strbytelist **head, char *item, uint8_t *i2, size_t i2len)
Insert string into strbytelist.
Definition: config_file.c:1790
void context_release_alloc(struct ub_ctx *ctx, struct alloc_cache *alloc, int locking)
Release an alloc.
Definition: context.c:206
int is_valrec
if this is a validation recursion query that does not get validation itself
Definition: module.h:605
struct iter_forwards * forwards_create(void)
Create forwards.
Definition: iter_fwd.c:68
char * optarg
getopt global, in case header files fail to declare it.
uint8_t authoritative
This flag informs unbound the answer is authoritative and the AA flag should be preserved.
Definition: msgreply.h:133
enum module_ext_state ext_state[MAX_MODULE]
module states
Definition: module.h:625
rbtree_type * macro_store_create(void)
Create variable storage.
Definition: replay.c:564
int outnet_tcp_connect(int s, struct sockaddr_storage *addr, socklen_t addrlen)
connect tcp connection to addr, 0 on failure
Definition: outside_network.c:270
static int chunk_rrlist_get_current(struct auth_chunk *rr_chunk, int rr_num, size_t rr_pos, uint8_t **rr_dname, uint16_t *rr_type, uint16_t *rr_class, uint32_t *rr_ttl, uint16_t *rr_rdlen, uint8_t **rr_rdata, size_t *rr_nextpos)
RR iterator, get current RR information, false on parse error.
Definition: authzone.c:4473
static void do_stats(RES *ssl, struct worker *worker, int reset)
do the stats command
Definition: remote.c:1094
int parse_create_msg(struct sldns_buffer *pkt, struct msg_parse *msg, struct alloc_cache *alloc, struct query_info *qinf, struct reply_info **rep, struct regional *region)
Allocate and decompress parsed message and rrsets.
Definition: msgreply.c:441
int sldns_wire2str_rrquestion_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat question rr to string, with user buffers.
Definition: wire2str.c:523
int ub_ctx_debugout(struct ub_ctx *ctx, void *out)
Set debug output (and error output) to the specified stream.
Definition: libunbound.c:475
int delegpt_add_addr_mlc(struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name)
add an address to a malloced delegation point.
Definition: iter_delegpt.c:609
enum comm_point::@7 ssl_shake_state
handshake state for init and renegotiate
struct replay_range * next_range
next in list of time ranges.
Definition: replay.h:260
size_t sldns_b64_pton_calculate_size(size_t srcsize)
calculates the size needed to store the result of sldns_b64_pton
Definition: parseutil.c:672
void comm_point_send_reply(struct comm_reply *repinfo)
Send reply.
Definition: fake_event.c:996
@ LDNS_RDF_TYPE_INT8
8 bits
Definition: rrdef.h:270
int use_response_ip
If we need to use response ip (value passed from daemon)
Definition: mesh.h:153
int sldns_wire2str_hip_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat HIP (algo, HIT, pubkey) field to string, with user buffers.
Definition: wire2str.c:1603
static int negverbose
verbose unit test for negative cache
Definition: unitneg.c:51
static struct ub_packed_rrset_key * auth_packed_rrset_copy_region(struct auth_zone *z, struct auth_data *node, struct auth_rrset *rrset, struct regional *region, time_t adjust)
Copy rrset into region from domain-datanode and packet rrset.
Definition: authzone.c:168
int sldns_wire2str_pkt_scan(uint8_t **d, size_t *dlen, char **s, size_t *slen)
Scan wireformat packet to a string representation with user buffer It appends every RR with default c...
Definition: wire2str.c:367
size_t sldns_b64_ntop_calculate_size(size_t srcsize)
calculates the size needed to store the result of b64_ntop
Definition: parseutil.c:607
socklen_t destlen
length of dest socket addr
Definition: perf.c:86
void worker_delete(struct worker *worker)
Delete worker.
Definition: worker.c:1953
int packed_rrset_find_rr(struct packed_rrset_data *d, uint8_t *rdata, size_t len, size_t *index)
Find RR index in packed rrset Raw comparison, does not canonicalize RDATA.
Definition: packed_rrset.c:392
struct iter_prep_list * an_prepend_last
Last element of the prepend list.
Definition: iterator.h:259
struct config_str2list * local_zones
local zones
Definition: config_file.h:700
#define MSG_GENERIC_INFO
from gen_msg.h - informational message record for windows message log
Definition: win_svc.h:57
int main(int argc, const char *argv[])
main program
Definition: memstats.c:243
void worker_work(struct worker *worker)
Make worker work.
Definition: worker.c:1947
struct cachedb_backend redis_backend
the redis backend definition, contains callable functions and name string
static struct auth_master * auth_master_new(struct auth_master ***list)
create new auth_master structure
Definition: authzone.c:6788
void comm_base_timept(struct comm_base *b, time_t **tt, struct timeval **tv)
Obtain two pointers.
Definition: fake_event.c:945
static int scrub_sanitize(sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinfo, uint8_t *zonename, struct module_env *env, struct iter_env *ie)
Given a response event, remove suspect RRsets from the response.
Definition: iter_scrub.c:685
struct listen_list * accept_list
commpoints for accepting remote control connections
Definition: remote.h:93
int set_auth_name_on_ssl(void *ssl, char *auth_name, int use_sni)
set the authname on an SSL structure, SSL* ssl
Definition: net_help.c:1263
int edns_opt_list_remove(struct edns_option **list, uint16_t code)
Remove any option found on the edns option list that matches the code.
Definition: msgreply.c:1003
int sldns_wire2str_edns_n3u_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS N3U option data to string.
Definition: wire2str.c:1847
size_t infra_cache_slabs
number of slabs in the infra host cache
Definition: config_file.h:164
size_t subnetmod_get_mem(struct module_env *env, int id)
subnet module alloc size routine
static int print_remainder_hex(const char *pref, uint8_t **d, size_t *dlen, char **s, size_t *slen)
print remainder of buffer in hex format with prefixed text
Definition: wire2str.c:356
struct rrset_parse * msgparse_hashtable_lookup(struct msg_parse *msg, sldns_buffer *pkt, hashvalue_type h, uint32_t rrset_flags, uint8_t *dname, size_t dnamelen, uint16_t type, uint16_t dclass)
Lookup in msg hashtable to find a rrset.
Definition: msgparse.c:221
int worker_init(struct worker *worker, struct config_file *cfg, struct listen_port *ports, int do_sigs)
Initialize worker.
Definition: worker.c:1741
time_t serve_expired_ttl
Reply TTL extended with serve expired TTL, to limit time to serve expired message.
Definition: msgreply.h:163
int fptr_whitelist_mod_get_mem(size_t(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module get_mem call values.
Definition: fptr_wlist.c:532
@ listen_type_ssl
ssl over tcp type
Definition: listen_dnsport.h:91
int fptr_whitelist_alloc_cleanup(void(*fptr)(void *))
Check function pointer whitelist for alloc clear on id overflow call values.
Definition: fptr_wlist.c:560
#define TCP_MAX_REQ_SIMULTANEOUS
number of simultaneous requests a client can have
Definition: listen_dnsport.c:77
int log_thread_get(void)
Get the thread id from logging system.
Definition: log.c:172
int was_ratelimited
whether the query (or a subquery) was ratelimited
Definition: module.h:652
struct tcl_addr * tcl_addr_lookup(struct tcl_list *tcl, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup address to see its TCP connection limit structure.
Definition: tcp_conn_limit.c:182
void acl_list_delete(struct acl_list *acl)
Delete acl structure.
Definition: acl_list.c:67
static struct autr_ta * autr_ta_create(uint8_t *rr, size_t rr_len, size_t dname_len)
create ta
Definition: autotrust.c:317
static int parse_ip_addr(char *str, int port, struct sockaddr_storage *ret, socklen_t *l)
parse a text IP address into a sockaddr
Definition: petal.c:98
time_t * rr_ttl
ttl of every rr.
Definition: packed_rrset.h:250
struct auth_rrset * rrsets
the data rrsets, with different types, linked list.
Definition: authzone.h:165
static struct val_qstate * val_new_getmsg(struct module_qstate *qstate, struct val_qstate *vq)
fill in message structure
Definition: validator.c:214
Auth zone.
Definition: authzone.h:96
int sldns_wire2str_class_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat rr class to string, with user buffers.
Definition: wire2str.c:910
static int val_dlv_init(struct module_qstate *qstate, struct val_qstate *vq, struct val_env *ve, int id)
Init DLV check.
Definition: validator.c:2009
int unittest_wrapper_addrtree_cmpbit(const addrkey_t *key1, const addrkey_t *key2, addrlen_t n)
Wrappers for static functions to unit test.
Definition: addrtree.c:517
static int nsec3_hash_matches_owner(struct nsec3_filter *flt, struct nsec3_cached_hash *hash, struct ub_packed_rrset_key *s)
Compare a hashed name with the owner name of an NSEC3 RRset.
Definition: val_nsec3.c:703
static void dname_test_pkt_dname_len(sldns_buffer *buff)
test pkt_dname_len
Definition: unitdname.c:166
time_t ttl
TTL value for this entry.
Definition: infra.h:77
int tls_win_cert
should the system certificate store get added to the cert bundle
Definition: config_file.h:122
void pythonmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
python module
Definition: pythonmod.c:476
void outbound_list_insert(struct outbound_list *list, struct outbound_entry *e)
Insert new entry into the list.
Definition: outbound_list.c:68
size_t stream_wait_max
size (in bytes) of stream wait buffers max
Definition: config_file.c:80
void reply_info_sortref(struct reply_info *rep)
Sorts the ref array.
Definition: msgreply.c:507
static struct proxy * find_create_proxy(struct sockaddr_storage *from, socklen_t from_len, fd_set *rorig, int *max, struct proxy **proxies, int serv_ip6, struct timeval *now, struct timeval *reuse_timeout)
find or else create proxy for this remote client
Definition: delayer.c:442
int local_zones_disable_default
do not add any default local zone
Definition: config_file.h:403
void * sslctx
sslcontext for SSL wrapped DNS over TCP queries
Definition: libworker.h:90
size_t infra_cache_numhosts
max number of hosts in the infra cache
Definition: config_file.h:166
static int processFinished(struct module_qstate *qstate, struct iter_qstate *iq, int id)
This handles the final state for first-tier responses (i.e., responses to externally generated querie...
Definition: iterator.c:3517
static void processClassResponse(struct module_qstate *qstate, int id, struct module_qstate *forq)
Process response for qclass=ANY queries for a particular class.
Definition: iterator.c:3357
int fptr_whitelist_mod_inform_super(void(*fptr)(struct module_qstate *qstate, int id, struct module_qstate *super))
Check function pointer whitelist for module inform_super call values.
Definition: fptr_wlist.c:474
static int lz_exists(struct local_zones *zones, const char *name)
lookup a zone in rbtree; exact match only; SLOW due to parse
Definition: localzone.c:716
struct sldns_buffer * scratch_buffer
buffer for temporary usage.
Definition: module.h:467
size_t dnscrypt_nonce_cache_size
memory size in bytes for dnscrypt nonces cache
Definition: config_file.h:576
struct local_zones * local_zones_create(void)
Create local zones storage.
Definition: localzone.c:60
void worker_stop_accept(void *arg)
stop accept callback handler
Definition: worker.c:2043
size_t nsec3_hash_to_b32(uint8_t *hash, size_t hashlen, uint8_t *zone, size_t zonelen, uint8_t *buf, size_t max)
Convert hash into base32 encoding and with the zone name appended.
Definition: val_nsec3.c:250
struct packed_rrset_key rk
key data: dname, type and class
Definition: packed_rrset.h:124
struct regional * region
region for this query.
Definition: module.h:618
int dp_target_count
number of target lookups per delegation point.
Definition: iterator.h:319
size_t * qlist_len
list of query packets (length of a packet)
Definition: perf.c:125
static void xfr_transfer_disown(struct auth_xfer *xfr)
disown task_transfer.
Definition: authzone.c:5049
int sldns_wire2str_tag_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat TAG field to string, with user buffers.
Definition: wire2str.c:1691
struct comm_point * cmd_com
commpoint to listen to commands.
Definition: worker.h:104
int sldns_wire2str_tsigtime_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat tsigtime field to string, with user buffers.
Definition: wire2str.c:1067
void dtio_cmd_cb(int fd, short ATTR_UNUSED(bits), void *arg)
callback for the dnstap commandpipe, to stop the dnstap IO
Definition: dtstream.c:1473
int event_base_malloced
true if the event_base is a pluggable base that is malloced with a user event base inside,...
Definition: context.h:124
int query_info_compare(void *m1, void *m2)
Compare two queryinfo structures, on query and type, class.
Definition: msgreply.c:575
void key_entry_deldatafunc(void *data, void *userarg)
function for lruhash operation
static int tap_socket_setup(struct tap_socket *s, struct ub_event_base *base)
setup socket on event base
Definition: unbound-dnstap-socket.c:338
void ub_get_event_sys(struct ub_event_base *base, const char **n, const char **s, const char **m)
Return the name, system and method for the pluggable event base.
Definition: ub_event.c:167
@ local_zone_nodefault
remove default AS112 blocking contents for zone nodefault is used in config not during service.
Definition: localzone.h:82
int ds_key_algo_is_supported(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
See if DS key algorithm is supported.
Definition: val_sigcrypt.c:366
#define FSTRM_CONTROL_FRAME_ACCEPT
control frame value to denote the control frame ACCEPT
Definition: dnstap_fstrm.h:100
size_t algo_needs_num_missing(struct algo_needs *n)
See how many algorithms are missing (not bogus or secure, but not processed)
Definition: val_sigcrypt.c:466
struct auth_chunk * chunks_last
last element in chunks list (to append new data at the end)
Definition: authzone.h:367
int listening_port
port number that has ports opened.
Definition: daemon.h:84
sldns_pkt_section section
which section was it found in: one of LDNS_SECTION_ANSWER, LDNS_SECTION_AUTHORITY,...
Definition: msgparse.h:151
Authoritative local zones storage, shared.
Definition: localzone.h:108
static WSAEVENT service_stop_event
global service stop event
Definition: win_svc.c:62
@ UB_NOMEM
alloc failure
Definition: context.h:189
static void do_list_local_data(RES *ssl, struct worker *worker, struct local_zones *zones)
do the list_local_data command
Definition: remote.c:2713
struct reply_packet * next
next in list of reply packets, for TCP multiple pkts on wire
Definition: testpkts.h:151
static char * lookup_reg_str(const char *key, const char *name)
Obtain registry string (if it exists).
Definition: win_svc.c:159
static void canonicalize_rdata(sldns_buffer *buf, struct ub_packed_rrset_key *rrset, size_t len)
Canonicalize Rdata in buffer.
Definition: val_sigcrypt.c:959
@ UB_SERVFAIL
DNS service failed.
Definition: context.h:193
int sldns_str2wire_class_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_CLASS from string to wireformat.
Definition: str2wire.c:1352
void infra_update_tcp_works(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen)
Update information for the host, store that a TCP transaction works.
Definition: infra.c:544
struct name_tree_node node
key for rbtree, must be first in struct, name of domain
Definition: infra.h:133
INLINE size_t sldns_buffer_position(sldns_buffer *buffer)
returns the current position in the buffer (as a number of bytes)
Definition: sbuffer.h:233
int reply_info_encode(struct query_info *qinfo, struct reply_info *rep, uint16_t id, uint16_t flags, sldns_buffer *buffer, time_t timenow, struct regional *region, uint16_t udpsize, int dnssec, int minimise)
Regenerate the wireformat from the stored msg reply.
Definition: msgencode.c:667
static struct serviced_query * serviced_create(struct outside_network *outnet, sldns_buffer *buff, int dnssec, int want_dnssec, int nocaps, int tcp_upstream, int ssl_upstream, char *tls_auth_name, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int qtype, struct edns_option *opt_list)
Create new serviced entry.
Definition: outside_network.c:1418
#define MAX_ID_RETRY
number of times to retry making a random ID that is unique.
Definition: outside_network.c:76
int fptr_whitelist_modenv_add_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub))
Check function pointer whitelist for module_env add_sub callback values.
Definition: fptr_wlist.c:363
struct dt_env * dtenv
the dnstap environment
Definition: netevent.h:222
rbnode_type node
redblacktree entry, key is the pending struct(id, addr).
Definition: outside_network.h:219
static void setup_tcp_list(struct main_tap_data *maindata, struct config_strlist_head *tcp_list)
setup tcp accept sockets
Definition: unbound-dnstap-socket.c:1170
static void iter_handle(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id)
Handle iterator state.
Definition: iterator.c:3616
int thread_num
every worker has a unique thread_num.
Definition: libworker.h:70
void rbtree_init(rbtree_type *rbtree, int(*cmpf)(const void *, const void *))
Init a new tree (malloced by caller) with given key compare function.
Definition: rbtree.c:95
int views_apply_cfg(struct views *v, struct config_file *cfg)
Apply config settings; Takes care of locking.
Definition: view.c:144
size_t sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor)
returns the maximum number of rdata fields of the rr type this descriptor describes.
Definition: rrdef.c:660
int timeout
timeout in msec
Definition: outside_network.h:245
void local_zones_del_zone(struct local_zones *zones, struct local_zone *zone)
Delete a zone.
Definition: localzone.c:1866
enum sec_status dnskey_verify_rrset_sig(struct regional *region, sldns_buffer *buf, struct val_env *ve, time_t now, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t dnskey_idx, size_t sig_idx, struct rbtree_type **sortree, int *buf_canon, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset, with specific dnskey(from set), for a specific rrsig
Definition: val_sigcrypt.c:1376
struct key_entry_key * key_entry_create_rrset(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, struct ub_packed_rrset_key *rrset, uint8_t *sigalg, time_t now)
Create a key entry from an rrset, in the given region.
Definition: val_kentry.c:296
void rpz_remove_rr(struct rpz *r, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen)
Delete policy matching RR, used for IXFR.
Definition: rpz.c:884
static int tcl_list_str_cfg(struct tcl_list *tcl, const char *str, const char *s2, int complain_duplicates)
apply tcl_list string
Definition: tcp_conn_limit.c:106
static int write_out(FILE *out, const char *str, size_t len)
write buffer to file and check return codes
Definition: authzone.c:1629
uint16_t sldns_wirerr_get_class(uint8_t *rr, size_t len, size_t dname_len)
Get the class of the RR.
Definition: str2wire.c:805
int nsec3_has_optout(struct ub_packed_rrset_key *rrset, int r)
return if nsec3 RR has the optout flag
Definition: val_nsec3.c:133
#define NUMTHR
number of threads to make in extended test
Definition: asynclook.c:168
void rpz_delete(struct rpz *r)
Delete RPZ.
Definition: rpz.c:300
struct rrset_cache * rrset_cache_adjust(struct rrset_cache *r, struct config_file *cfg, struct alloc_cache *alloc)
Adjust settings of the cache to settings from the config file.
Definition: rrset.c:81
static void zerottls(uint8_t *pkt, size_t pktlen)
zero TTLs in packet
Definition: testpkts.c:889
int addr_is_ip6(struct sockaddr_storage *addr, socklen_t len)
Checkout address family.
Definition: net_help.c:668
static void dtio_setup_base(struct dt_io_thread *dtio, time_t *secs, struct timeval *now)
setup the event base for the dnstap io thread
Definition: dtstream.c:1524
uint8_t * zonename
zone name in wireformat
Definition: infra.h:64
static int handle_cname_response(struct module_qstate *qstate, struct iter_qstate *iq, struct dns_msg *msg, uint8_t **mname, size_t *mname_len)
Given a CNAME response (defined as a response containing a CNAME or DNAME that does not answer the re...
Definition: iterator.c:539
static void generate_ns_check(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Generate a NS check request to obtain authoritative information on an NS rrset.
Definition: iterator.c:1077
#define HASH_DEFAULT_MAXMEM
default max memory for hash arrays
Definition: lruhash.h:116
size_t(* lruhash_sizefunc_type)(void *, void *)
Type of function that calculates the size of an entry.
Definition: lruhash.h:127
int sldns_wire2str_hex_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat hex field to string, with user buffers.
Definition: wire2str.c:1248
int do_not_close
if set the connection is NOT closed on delete.
Definition: netevent.h:244
int netblockdnametoaddr(uint8_t *dname, size_t dnamelen, struct sockaddr_storage *addr, socklen_t *addrlen, int *net, int *af)
RPZ format netblock to network byte order address and netblock example RPZ netblock format dnames:
Definition: net_help.c:396
uint8_t * name
zone name, in uncompressed wireformat
Definition: localzone.h:125
int sldns_wire2str_time_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat time field to string, with user buffers.
Definition: wire2str.c:1347
struct config_strlist * local_data
local data RRs configured
Definition: config_file.h:405
uint16_t dnskey_calc_keytag(struct ub_packed_rrset_key *dnskey_rrset, size_t dnskey_idx)
Get dnskey keytag, footprint value.
Definition: val_sigcrypt.c:373
static int perf_tv_smaller(struct timeval *t1, struct timeval *t2)
timeval compare, t1 < t2
Definition: perf.c:161
static void msg_ttl(struct dns_msg *msg)
fix up msg->rep TTL and prefetch ttl
Definition: authzone.c:185
const char * fname
Dynamic library filename.
Definition: dynlibmod.h:116
void algo_needs_init_dnskey_add(struct algo_needs *n, struct ub_packed_rrset_key *dnskey, uint8_t *sigalg)
Initialize algo needs structure, set algos from rrset as needed.
Definition: val_sigcrypt.c:389
Nameservers for a delegation point.
Definition: iter_delegpt.h:95
struct auth_master * scan_target
scan tries all the upstream masters.
Definition: authzone.h:382
struct config_strbytelist * acl_tags
list of aclname, tagbitlist
Definition: config_file.h:415
static int ub_ctx_finalize(struct ub_ctx *ctx)
finalize the context, if not already finalized
Definition: libunbound.c:1262
void * cb_arg
the callback userarg, stored for usage
Definition: fake_event.c:86
static int print_stats(RES *ssl, const char *nm, struct ub_stats_info *s)
print stats from statinfo
Definition: remote.c:709
void * cleanup_arg
user arg for cleanup
Definition: alloc.h:90
static void dname_test_topdomain(void)
Test dname_get_shared_topdomain.
Definition: unitdname.c:731
#define S_STRLIST(str, var)
put string into strlist
Definition: config_file.c:424
lock_quick_type lock
Lock for exclusive access to the linked list This lock makes deletion of items safe in this overflow ...
Definition: lruhash.h:191
int num_ip4
number of outgoing IP4 interfaces
Definition: outside_network.h:113
int referral_count
the number of times this query as followed a referral.
Definition: iterator.h:307
A message buffer with dnstap messages queued up.
Definition: dtstream.h:59
int fptr_whitelist_modenv_send_query(struct outbound_entry *(*fptr)(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q))
whitelist env->send_query callbacks
Definition: fptr_wlist.c:334
Filter conditions for NSEC3 proof Used to iterate over the applicable NSEC3 RRs.
Definition: val_nsec3.c:97
int tcp_req_info_add_meshstate(struct tcp_req_info *req, struct mesh_area *mesh, struct mesh_state *m)
Add mesh state to the tcp req list of open requests.
Definition: listen_dnsport.c:1855
struct worker * worker
internal data for daemon - worker thread.
Definition: module.h:469
struct config_strlist * errinf
failure reason information if val-log-level is high
Definition: module.h:620
void autr_global_delete(struct autr_global_data *global)
Delete global 5011 data structure.
Definition: autotrust.c:84
int unblock_lan_zones
unblock lan zones (reverse lookups for AS112 zones)
Definition: config_file.h:409
int infra_ip_ratelimit
ip ratelimit, 0 is off
Definition: infra.c:68
struct delegpt_addr * next_result
next delegation point in results
Definition: iter_delegpt.h:134
static struct comm_timer * service_cron
the cron callback
Definition: win_svc.c:72
struct replay_range * range_list
List of matching answers.
Definition: replay.h:171
int use_systemd
Use systemd socket activation.
Definition: config_file.h:457
int val_dsset_isusable(struct ub_packed_rrset_key *ds_rrset)
Determine if DS rrset is usable for validator or not.
Definition: val_utils.c:724
struct edns_option * edns_opts_back_in
incoming edns options from the back end
Definition: module.h:642
#define PACKED_RRSET_NSEC_AT_APEX
this rrset is NSEC and is at zone apex (at child side of zonecut)
Definition: packed_rrset.h:53
void sldns_buffer_free(sldns_buffer *buffer)
frees the buffer.
Definition: sbuffer.c:138
struct module_qstate * qstate
the module query state that sent it
Definition: outbound_list.h:69
Definition: subnetmod.h:76
static void zone_del_rrset(struct lruhash_entry *e, void *arg)
callback to delete rrsets in a zone
Definition: remote.c:1685
#define RETVAL_OK
return code that means all is peachy keen.
Definition: msgencode.c:64
uint16_t sldns_calc_keytag_raw(uint8_t *key, size_t keysize)
Calculates keytag of DNSSEC key, operates on wireformat rdata.
Definition: keyraw.c:106
static void process_request(struct module_qstate *qstate, struct iter_qstate *iq, struct iter_env *ie, int id)
This is the primary entry point for processing request events.
Definition: iterator.c:3669
long long mesh_num_reply_states
mesh stats: current number of reply (user) states
Definition: unbound.h:808
long long qclass[UB_STATS_QCLASS_NUM]
qclass stats
Definition: unbound.h:689
static void advance_moment(struct replay_runtime *runtime)
Advance to the next moment.
Definition: fake_event.c:723
Authoritative zones, shared.
Definition: authzone.h:72
long long mesh_replies_sent
mesh stats: replies sent
Definition: unbound.h:814
int sldns_str2wire_int16_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT16 from string to wireformat.
Definition: str2wire.c:1032
struct dt_io_list_item * next
next in the list of buffers to inspect
Definition: dtstream.h:229
static void xfr_masterlist_free_addrs(struct auth_master *list)
delete the looked up auth_addrs for all the masters in the list
Definition: authzone.c:3652
void server_stats_insrcode(struct ub_server_stats *stats, sldns_buffer *buf)
Add rcode for this query.
Definition: stats.c:514
static void execute_cmd(struct daemon_remote *rc, RES *ssl, char *cmd, struct worker *worker)
execute a remote control command
Definition: remote.c:2896
int RTT_MIN_TIMEOUT
min retransmit timeout value, in milliseconds
Definition: rtt.c:47
@ DTIO_COMMAND_STOP
DTIO command channel stop.
Definition: dtstream.c:79
@ rrset_trust_sec_noglue
Data from a zone transfer, other than glue.
Definition: packed_rrset.h:162
struct addrnode * first
first node in LRU list, first candidate to go
Definition: addrtree.h:86
uint64_t free
number of bytes freed
Definition: memstats.c:62
static struct dns_msg * synth_dname_msg(struct ub_packed_rrset_key *rrset, struct regional *region, time_t now, struct query_info *q, enum sec_status *sec_status)
synthesize DNAME+CNAME response from cached DNAME item
Definition: dns.c:643
void iter_mark_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
Mark targets that result in a dependency cycle as done, so they will not get selected as targets.
Definition: iter_utils.c:694
FILE * log_out
what logfile to use instead
Definition: context.h:100
uint16_t dclass
class of the trust anchor
Definition: val_anchor.h:122
int dt_io_thread_register_queue(struct dt_io_thread *dtio, struct dt_msg_queue *mq)
Register a msg queue to the io thread.
Definition: dtstream.c:369
struct local_zone * local_zones_tags_lookup(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, uint16_t dtype, uint8_t *taglist, size_t taglen, int ignoretags)
Lookup zone that contains the given name, class and taglist.
Definition: localzone.c:1095
int nc_rr
NSEC3 record that proved nc.
Definition: val_nsec3.c:90
static SSL * setup_ssl(int s, SSL_CTX *ctx)
setup SSL connection to the client
Definition: petal.c:301
size_t namelen
length of zonename
Definition: infra.h:66
struct key_cache * kcache
key cache; these are validated keys.
Definition: validator.h:83
time_t MAX_NEG_TTL
MAX Negative TTL, for SOA records in authority section.
Definition: msgreply.c:63
#define MAX_MINIMISE_COUNT
max number of QNAME minimisation iterations.
Definition: iterator.h:76
time_t SERVE_EXPIRED_TTL
Time to serve records after expiration.
Definition: msgreply.c:67
int fptr_whitelist_mod_deinit(void(*fptr)(struct module_env *env, int id))
Check function pointer whitelist for module deinit call values.
Definition: fptr_wlist.c:417
static void timeval_divide(struct timeval *avg, const struct timeval *sum, size_t d)
divide sum of timers to get average
Definition: mesh.c:98
sldns_enum_edns_option
EDNS option codes.
Definition: rrdef.h:419
void respip_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
response-ip operate on a query
Definition: respip.c:1077
int end_step
end step of time range.
Definition: replay.h:250
uint64_t rrset_id_type
type used to uniquely identify rrsets.
Definition: packed_rrset.h:46
void lruhash_delete(struct lruhash *table)
Delete hash table.
Definition: lruhash.c:153
void pythonmod_clear(struct module_qstate *qstate, int id)
python module cleanup query state
Definition: pythonmod.c:549
int nsec3_keyiter_count
Number of entries in the NSEC3 maximum iteration count table.
Definition: validator.h:107
PyThreadState * mainthr
Python main thread.
Definition: pythonmod.c:74
struct config_strlist * dnscrypt_secret_key
dnscrypt secret keys 1.key
Definition: config_file.h:564
static int qlist_parse_line(sldns_buffer *buf, char *p)
parse a query line to a packet into buffer
Definition: perf.c:464
int delegpt_add_target(struct delegpt *dp, struct regional *regional, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, int *additions)
Add target address to the delegation point.
Definition: iter_delegpt.c:162
void(* clear)(struct module_qstate *qstate, int id)
clear module specific data
Definition: module.h:730
static int rrset_add_rr(struct auth_rrset *rrset, uint32_t rr_ttl, uint8_t *rdata, size_t rdatalen, int insert_sig)
add RR to existing RRset.
Definition: authzone.c:790
Local info for deletion functions.
Definition: remote.c:1597
size_t ans_bogus
(extended stats) bogus replies
Definition: mesh.h:126
struct respip_set * respip_set_create(void)
Create response IP set.
Definition: respip.c:57
void * modinfo[MAX_MODULE]
module specific data.
Definition: module.h:511
static int add_open(const char *ip, int nr, struct listen_port **list, int noproto_is_err, struct config_file *cfg)
Add and open a new control port.
Definition: remote.c:273
void regional_free_all(struct regional *r)
Free all memory associated with regional.
Definition: regional.c:96
addrlen_t len
length in bits of str
Definition: addrtree.h:112
size_t sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor)
returns the minimum number of rdata fields of the rr type this descriptor describes.
Definition: rrdef.c:650
#define ALIGN_UP(x, s)
increase size until it fits alignment of s bytes
Definition: regional.c:51
void slabhash_test(void)
unit test slabhashtable implementation
Definition: unitslabhash.c:359
int notify_received
a notify was received, but a zone transfer or probe was already acted on.
Definition: authzone.h:237
struct libworker * libworker_create_event(struct ub_ctx *ctx, struct ub_event_base *eb)
create worker for event-based interface.
Definition: libworker.c:266
struct pending_tcp * next_free
next in list of free tcp comm points, or NULL.
Definition: outside_network.h:257
int inuse
number of commpoints (and thus also ports) in use
Definition: outside_network.h:193
static size_t stream_wait_count
size (in bytes) of stream wait buffers
Definition: listen_dnsport.c:84
static int read_acl_list(struct acl_list *acl, struct config_file *cfg)
read acl_list config
Definition: acl_list.c:333
int worker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming serviced query replies from the network
Definition: worker.c:271
struct delegpt * delegpt_create_mlc(uint8_t *name)
create malloced delegation point, with the given name
Definition: iter_delegpt.c:530
uint8_t * qbuf
The query that needs to be answered.
Definition: outside_network.h:332
static void do_view_zone_remove(RES *ssl, struct worker *worker, char *arg)
Remove a zone from view.
Definition: remote.c:1416
static void signal_handling_playback(struct worker *wrk)
Replay old signals.
Definition: daemon.c:181
static hashvalue_type pkt_hash_rrset_rest(hashvalue_type dname_h, uint16_t type, uint16_t dclass, uint32_t rrset_flags)
create a rrset hash from a partial dname hash
Definition: msgparse.c:194
void hash_set_raninit(uint32_t v)
Set the randomisation initial value, set this before threads start, and before hashing stuff (because...
Definition: lookup3.c:76
struct module_stack mods
module stack
Definition: context.h:114
static int read_root_hints_list(struct iter_hints *hints, struct config_file *cfg)
read root hints list
Definition: iter_hints.c:412
size_t num_keys
number of key entries removed
Definition: remote.c:1613
static RETSIGTYPE record_sigh(int sig)
used when no other sighandling happens, so we don't die when multiple signals in quick succession are...
Definition: daemon.c:116
size_t offset
offset in packet that points to this dname
Definition: msgencode.c:90
void server_stats_add(struct ub_stats_info *total, struct ub_stats_info *a)
Addup stat blocks.
Definition: stats.c:396
size_t regional_get_mem(struct regional *r)
get total memory size in use by region
Definition: regional.c:230
uint8_t client_publickey[crypto_box_PUBLICKEYBYTES]
the client public key
Definition: dnscrypt.c:70
#define O_YNO(opt, str, var)
compare and print yesno option
Definition: config_file.c:842
int tcp_upstream
tcp upstream queries (no UDP upstream queries)
Definition: config_file.h:97
char * tls_auth_name
ref to the tls_auth_name from the serviced_query
Definition: outside_network.h:300
Structure to store query information that makes answers to queries different.
Definition: msgreply.h:69
static int loc_parse_cm(char *my_str, char **endstr, uint8_t *m, uint8_t *e)
read "<digits>[.<digits>][mM]" into mantissa exponent format for LOC type
Definition: str2wire.c:1491
int pfxlen
prefix length of network address (in bits), for randomisation.
Definition: outside_network.h:177
static char * read_data_chunk(SSL *ssl, size_t len)
read a data chunk
Definition: unbound-anchor.c:943
static void az_delete_deleted_zones(struct auth_zones *az)
find zones that are marked deleted and delete them.
Definition: authzone.c:1968
int http_is_chunked
chunked transfer
Definition: netevent.h:214
struct timeval * now_tv
time in microseconds.
Definition: module.h:483
int local_data_answer(struct local_zone *z, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, int labs, struct local_data **ldp, enum localzone_type lz_type, int tag, struct config_strlist **tag_datas, size_t tag_datas_size, char **tagname, int num_tags)
Get local data from local zone and encode answer.
Definition: localzone.c:1359
int local_zone_cmp(const void *z1, const void *z2)
Compare two local_zone entries in rbtree.
Definition: localzone.c:105
struct module_stack mods
stack of module callbacks
Definition: daemon.h:113
@ LDNS_SECTION_ANY_NOQUESTION
used to get all non-question rrs from a packet
Definition: pkthdr.h:124
int local_zone_str2type(const char *type, enum localzone_type *t)
Parse the string into localzone type.
Definition: localzone.c:1771
int auth_zone_response
True if the current response is from auth_zone.
Definition: iterator.h:406
uint16_t qdcount
count of RRs, host format
Definition: msgparse.h:101
size_t mod_get_mem(struct module_env *env, const char *name)
fetch memory for a module by name, returns 0 if module not there
Definition: modstack.c:272
size_t serviced_get_mem(struct serviced_query *sq)
Get memory size in use by serviced query while it is servicing callbacks.
Definition: outside_network.c:2536
#define IS_YES_OR_NO
check that the value passed is yes or no
Definition: config_file.c:394
void * connect_sslctx_create(char *key, char *pem, char *verifypem, int wincert)
create SSL connect context
Definition: net_help.c:1127
static struct ub_result * prime_root_key(struct ub_ctx *ctx)
Prime the root key and return the result.
Definition: unbound-anchor.c:2104
int sldns_str_vprint(char **str, size_t *slen, const char *format, va_list args)
Print to string, move string along for next content.
Definition: wire2str.c:317
static void simpletest(sldns_buffer *pkt, struct alloc_cache *alloc, sldns_buffer *out)
simple test of parsing
Definition: unitmsgparse.c:383
size_t an_numrrsets
Number of RRsets in each section.
Definition: msgreply.h:176
static void service_deinit(struct daemon *daemon, struct config_file *cfg)
Deinit the service.
Definition: win_svc.c:387
int nsec_has_type(struct ub_packed_rrset_key *nsec, uint16_t type)
Check if type is present in the NSEC typemap.
Definition: val_nsec.c:97
void traverse_postorder(rbtree_type *tree, void(*func)(rbnode_type *, void *), void *arg)
Call function for all elements in the redblack tree, such that leaf elements are called before parent...
Definition: rbtree.c:622
static int dump_rrset_lruhash(RES *ssl, struct lruhash *h, time_t now)
dump lruhash rrset cache
Definition: cachedump.c:102
struct addr_tree_node * addr_tree_lookup(rbtree_type *tree, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup closest encloser in addr tree.
Definition: dnstree.c:210
static void add_5011_probe_root(struct ub_ctx *ctx, const char *root_anchor_file)
add an autotrust anchor for the root to the context
Definition: unbound-anchor.c:2087
int options_remote_is_address(struct config_file *cfg)
check if config for remote control turns on IP-address interface with certificates or a named pipe wi...
Definition: config_file.c:2499
struct addrnode * next
next node in LRU list
Definition: addrtree.h:105
static size_t synth_cname_buf(uint8_t *qname, size_t qname_len, size_t dname_len, uint8_t *dtarg, size_t dtarglen, uint8_t *buf, size_t buflen)
create synth cname target name in buffer, or fail if too long
Definition: authzone.c:2395
static void add_opts(const char *args, int *pass_argc, char *pass_argv[])
Add options from string to passed argc.
Definition: testbound.c:116
time_t * now_secs
pointer to time in seconds
Definition: outside_network.h:74
time_t ttl
TTL of the entire reply (for negative caching).
Definition: msgreply.h:151
static int load_msg_cache(RES *ssl, struct worker *worker)
load msg cache
Definition: cachedump.c:689
int hints_add_stub(struct iter_hints *hints, uint16_t c, struct delegpt *dp, int noprime)
Add stub to hints structure.
Definition: iter_hints.c:527
static struct auth_data * az_nsec3_find_exact(struct auth_zone *z, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen)
Find exact match for hashed(nm, nmlen) NSEC3 record or NULL.
Definition: authzone.c:2733
int priv_apply_cfg(struct iter_priv *priv, struct config_file *cfg)
Process priv config.
Definition: iter_priv.c:147
a busy control command connection, SSL state
Definition: remote.h:65
int void sldns_buffer_free(sldns_buffer *buffer)
frees the buffer.
Definition: sbuffer.c:138
void test_slabhash_delkey(void *, void *)
test delkey for lruhash
struct module_env * env
copy of the module environment with worker local entries.
Definition: libworker.h:82
struct comm_timer * probe_timer
the 5011-probe timer (if any)
Definition: module.h:496
static void service_proxy(fd_set *rset, int retsock, struct proxy *proxies, sldns_buffer *pkt, struct timeval *now)
proxy return replies to clients
Definition: delayer.c:428
static int nsec3_find_closest_encloser(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, struct query_info *qinfo, struct ce_response *ce)
findClosestEncloser Given a name and a list of NSEC3s, find the candidate closest encloser.
Definition: val_nsec3.c:875
void * cb_arg
for async query, the callback user arg
Definition: context.h:163
struct tube * cmd
pipe, for commands for this worker
Definition: worker.h:90
struct proxy * next
next in proxylist
Definition: delayer.c:94
static void ssl_path_err(const char *s, const char *path)
exit with ssl error related to a file path
Definition: unbound-control.c:482
int dname_subdomain_c(uint8_t *d1, uint8_t *d2)
Counts labels.
Definition: dname.c:700
#define S_SIZET_OR_ZERO(str, var)
put integer_or_zero into size_t
Definition: config_file.c:406
void delete_replylist(struct reply_packet *replist)
delete the list of reply packets
Definition: testpkts.c:1698
static int update_events(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset, int *changed)
Set update events.
Definition: autotrust.c:1614
int sldns_wire2str_edns_dau_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS DAU option data to string.
Definition: wire2str.c:1817
struct ub_randstate * ub_initstate(struct ub_randstate *from)
Initialize a random generator state for use.
void config_delete(struct config_file *config)
Destroy the config file structure.
Definition: config_file.c:1421
int libworker_fg(struct ub_ctx *ctx, struct ctx_query *q)
Create a foreground worker.
Definition: libworker.c:584
size_t num_async
number of async queries outstanding
Definition: context.h:131
char * module_conf
the module configuration string
Definition: config_file.h:324
static struct dns_msg * fill_any(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional *region)
Fill TYPE_ANY response with some data from cache.
Definition: dns.c:736
static void print_stats_shm(const char *cfgfile)
print statistics from shm memory segment
Definition: unbound-control.c:431
void key_cache_remove(struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class)
Remove an entry from the key cache.
Definition: val_kcache.c:162
void name_tree_init_parents(rbtree_type *tree)
Initialize parent pointers in name tree.
Definition: dnstree.c:140
static struct key_entry_key * primeResponseToKE(struct ub_packed_rrset_key *dnskey_rrset, struct trust_anchor *ta, struct module_qstate *qstate, int id)
Evaluate the response to a priming request.
Definition: validator.c:2573
void tcp_req_info_remove_mesh_state(struct tcp_req_info *req, struct mesh_state *m)
Remove mesh state entry from list in tcp_req_info.
Definition: listen_dnsport.c:1656
int cfg_strbytelist_insert(struct config_strbytelist **head, char *item, uint8_t *i2, size_t i2len)
Insert string into strbytelist.
Definition: config_file.c:1790
static int az_nsec3_param(struct auth_zone *z, int *algo, size_t *iter, uint8_t **salt, size_t *saltlen)
Find the NSEC3PARAM rrset (if any) and if true you have the parameters.
Definition: authzone.c:2583
void auth_xfer_probe_timer_callback(void *arg)
xfer probe timeout callback, part of task_probe
Definition: authzone.c:6122
int ip_ratelimit_factor
ip_ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic
Definition: config_file.h:532
int control_use_cert
if the use-cert option is set
Definition: config_file.h:438
Autotrust metadata for a trust point.
Definition: autotrust.h:90
uint8_t * context_serialize_cancel(struct ctx_query *q, uint32_t *len)
Serialize a query cancellation.
Definition: context.c:375
size_t stop_frame_len
length of the stop frame
Definition: dtstream.c:1577
Internal base structure, so that every thread has its own events.
Definition: netevent.c:114
int auth_zone_cmp(const void *z1, const void *z2)
compare auth_zones for sorted rbtree
Definition: authzone.c:307
uint8_t timeout_AAAA
timeouts counter for type AAAA
Definition: infra.h:104
void iter_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
iterator operate on a query
Definition: iterator.c:3867
static void auth_rrset_delete(struct auth_rrset *rrset)
delete auth rrset node
Definition: authzone.c:353
@ module_wait_module
module is waiting for another module
Definition: module.h:539
enum comm_point::comm_point_type type
variable with type of socket, UDP,TCP-accept,TCP,pipe
static void outnet_send_wait_udp(struct outside_network *outnet)
try to send waiting UDP queries
Definition: outside_network.c:511
struct auth_master * scan_specific
once notified, or the timeout has been reached.
Definition: authzone.h:379
struct iter_forwards * forwards_create(void)
Create forwards.
Definition: iter_fwd.c:68
void ub_event_set_fd(struct ub_event *ev, int fd)
Change or set the file descriptor on the event.
Definition: ub_event.c:374
The next probe task.
Definition: authzone.h:283
static int tap_socket_list_addevs(struct tap_socket_list *list, struct ub_event_base *base)
setup accept events
Definition: unbound-dnstap-socket.c:398
struct rrset_cache * rrset_cache
shared rrset cache
Definition: module.h:331
void log_query_info(enum verbosity_value v, const char *str, struct query_info *qinf)
Print string with neat domain name, type, class from query info.
Definition: msgreply.c:883
@ acl_allow
allow full access for recursion (+RD) queries
Definition: acl_list.h:64
static int skip_to_special(FILE *in, sldns_buffer *buf, int *line, int spec)
skip through file to { or ;
Definition: val_anchor.c:606
static void analyze_dname(sldns_buffer *pkt)
analyze domain name in packet, possibly compressed
Definition: pktview.c:73
enum sec_status val_verify_DNSKEY_with_TA(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ta_ds, struct ub_packed_rrset_key *ta_dnskey, uint8_t *sigalg, char **reason, struct module_qstate *qstate)
Verify DNSKEYs with DS and DNSKEY rrset.
Definition: val_utils.c:585
@ LDNS_RR_CLASS_HS
Hesiod (Dyer 87)
Definition: rrdef.h:56
@ VAL_CLASS_UNKNOWN
Not a recognized subtype.
Definition: val_utils.h:65
int sldns_wire2str_cert_alg_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat cert_alg field to string, with user buffers.
Definition: wire2str.c:1320
static int dname_char_print(char **s, size_t *slen, uint8_t c)
print and escape one character for a domain dname
Definition: wire2str.c:766
struct rpz * rpz
RPZ zones.
Definition: authzone.h:136
SSL_CTX * sslctx
for a TLS socket, the tls context
Definition: unbound-dnstap-socket.c:157
time_t refresh
refresh time (from SOA), time to wait with next_probe if everything is fine
Definition: authzone.h:262
void comm_point_send_reply(struct comm_reply *repinfo)
Send reply.
Definition: netevent.c:3135
int delegpt_add_target_mlc(struct delegpt *dp, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame)
Add target address to the delegation point.
Definition: iter_delegpt.c:649
void daemon_cleanup(struct daemon *daemon)
Close off the worker thread information.
Definition: daemon.c:696
int sldns_str2wire_atma_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_ATMA from string to wireformat.
Definition: str2wire.c:1819
static int dump_rrset_line(RES *ssl, struct ub_packed_rrset_key *k, time_t now, size_t i)
dump one rrset zonefile line
Definition: cachedump.c:65
static void write_q(int fd, int udp, SSL *ssl, sldns_buffer *buf, uint16_t id, const char *strname, const char *strtype, const char *strclass)
write a query over the TCP fd
Definition: streamtcp.c:119
static char * http_header_line(sldns_buffer *buf)
return character string into buffer for header line, moves buffer past that line and puts zero termin...
Definition: netevent.c:1954
int daemon_open_shared_ports(struct daemon *daemon)
Open shared listening ports (if needed).
Definition: daemon.c:297
void listen_list_delete(struct listen_list *list)
delete listen_list of commpoints.
Definition: listen_dnsport.c:1411
static int decompress_rr_into_buffer(struct sldns_buffer *buf, uint8_t *pkt, size_t pktlen, uint8_t *dname, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rr_data, uint16_t rr_rdlen)
decompress an RR into the buffer where it'll be an uncompressed RR with uncompressed dname and uncomp...
Definition: authzone.c:1313
struct addrnode * prev
previous node in LRU list
Definition: addrtree.h:103
void config_delstrlist(struct config_strlist *p)
Delete items in config string list.
Definition: config_file.c:1284
static void testremove(struct slabhash *table, testdata_type *ref[])
test adding a random element
Definition: unitslabhash.c:121
int dns_cache_prefetch_adjust(struct module_env *env, struct query_info *qinfo, time_t adjust, uint16_t flags)
Adjust the prefetch_ttl for a cached message.
Definition: dns.c:1025
int disable_dnssec_lame_check
true to disable DNSSEC lameness check in iterator
Definition: config_file.h:523
struct waiting_tcp * query
the query being serviced, NULL if the pending_tcp is unused.
Definition: outside_network.h:263
uint8_t * context_serialize_quit(uint32_t *len)
Serialize a 'quit' command.
Definition: context.c:401
int infra_cache_min_rtt
min value for infra cache rtt
Definition: config_file.h:168
void comm_signal_delete(struct comm_signal *comsig)
Delete the signal communication point.
Definition: fake_event.c:990
uint16_t qid
id of query, in network byteorder.
Definition: mesh.h:226
#define DTIO_RECONNECT_TIMEOUT_SLOW
the msec to wait for reconnect slow, to stop busy spinning on reconnect
Definition: dtstream.c:70
static BIO * xml_parse(BIO *xml, time_t now)
Perform XML parsing of the root-anchors file Its format description can be read here https://data....
Definition: unbound-anchor.c:1599
time_t MAX_NEG_TTL
Maximum Negative TTL that is allowed.
Definition: msgreply.c:63
uint8_t dnsseclame
if the address is dnsseclame, but this cannot be cached, this option is useful to mark the address dn...
Definition: iter_delegpt.h:156
char * server_key_file
private key file for server
Definition: config_file.h:442
static void do_dump_infra(RES *ssl, struct worker *worker)
do the dump_infra command
Definition: remote.c:2490
int fptr_whitelist_comm_point(comm_point_callback_type *fptr)
Check function pointer whitelist for comm_point callback values.
Definition: fptr_wlist.c:104
struct ub_server_stats svr
the thread stats
Definition: unbound.h:803
void * regional_alloc_zero(struct regional *r, size_t size)
Allocate size bytes of memory inside regional that are initialized to 0.
Definition: regional.c:171
struct ctx_query * context_deserialize_cancel(struct ub_ctx *ctx, uint8_t *p, uint32_t len)
Deserialize a cancel buffer.
Definition: context.c:388
void neg_insert_data(struct val_neg_cache *neg, struct val_neg_zone *zone, struct ub_packed_rrset_key *nsec)
Insert data into the data tree of a zone Does not do locking.
Definition: val_neg.c:748
struct sockaddr_storage addr
remote address
Definition: delayer.c:82
int dnstap_log_forwarder_response_messages
true to log dnstap FORWARDER_RESPONSE message events
Definition: config_file.h:520
rbnode_type node
rbtree node.
Definition: replay.h:399
struct timeval * now_tv
pointer to time in microseconds
Definition: outside_network.h:76
int namelabs
number of labels in delegation point
Definition: iter_delegpt.h:63
size_t max_reg_blocks
how many regional blocks to keep back max
Definition: alloc.h:93
static void setup_and_run(struct config_strlist_head *local_list, struct config_strlist_head *tcp_list, struct config_strlist_head *tls_list, char *server_key, char *server_cert, char *verifypem)
setup and run the server to listen to DNSTAP messages
Definition: unbound-dnstap-socket.c:1215
#define LDNS_RR_BUF_SIZE
buffer to read an RR, cannot be larger than 64K because of packet size
Definition: str2wire.h:27
static int key_matches_a_ds(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, size_t key_idx, struct ub_packed_rrset_key *ds_rrset)
See if a DNSKEY is verified by one of the DSes.
Definition: autotrust.c:1570
int have_zone
do we have a zone (if 0, no zone data at all)
Definition: authzone.h:253
int sldns_wire2str_eui48_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat EUI48 field to string, with user buffers.
Definition: wire2str.c:1666
@ UB_INITFAIL
initialization failed (bad settings)
Definition: context.h:199
struct sldns_struct_lookup_table * sldns_hashes
DS record hash algorithms.
Definition: wire2str.c:68
struct lruhash_entry * overflow_list
linked list of overflow entries
Definition: lruhash.h:193
void dname_remove_labels(uint8_t **dname, size_t *len, int n)
Snip off first N labels from a dname, returning the parent zone.
Definition: dname.c:742
int worker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming serviced query replies from the network
Definition: worker.c:271
static void expon_timeout_backoff(struct replay_runtime *runtime)
perform exponential backoff on the timeout
Definition: fake_event.c:703
int mesh_state_compare(const void *ap, const void *bp)
compare two mesh_states
Definition: mesh.c:196
Definition: dnscrypt.c:64
static SSL * setup_ssl(SSL_CTX *ctx, int fd)
setup SSL on the connection
Definition: unbound-control.c:627
static FILE * logfile
the file logged to.
Definition: log.c:66
static off_t get_file_size(const char *fname)
get size of file
Definition: memstats.c:179
static const sldns_rr_descriptor * type_rdata_compressable(struct ub_packed_rrset_key *key)
return true if type needs domain name compression in rdata
Definition: msgencode.c:356
static void tcpconnlimitchecks(struct config_file *cfg)
check tcp connection limit ips
Definition: unbound-checkconf.c:384
uint8_t in_use
if this element is in use, boolean
Definition: val_neg.h:128
void local_zones_del_data(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)
Remove data from domain name in the tree.
Definition: localzone.c:1965
struct edns_known_option * edns_option_is_known(uint16_t opt_code, struct module_env *env)
Check if an edns option is known.
Definition: module.c:184
static void send_ok(RES *ssl)
send the OK to the control client
Definition: remote.c:671
static void spool_temp_file_name(int *lineno, FILE *cfg, char *id)
spool temp file name
Definition: testbound.c:157
uint16_t id
dns id of AXFR query
Definition: authzone.h:412
static void auth_xfer_del(rbnode_type *n, void *ATTR_UNUSED(arg))
helper traverse to delete xfer zones
Definition: authzone.c:2118
static int dns64_apply_cfg(struct dns64_env *dns64_env, struct config_file *cfg)
This function applies the configuration found in the parsed configuration file cfg to this instance o...
Definition: dns64.c:363
Single linked list to store shared ports that have been opened for use by all threads.
Definition: listen_dnsport.h:105
struct iter_donotq * donotq
A set of inetaddrs that should never be queried.
Definition: iterator.h:117
size_t forwards_get_mem(struct iter_forwards *fwd)
Get memory in use by forward storage.
Definition: iter_fwd.c:447
static void xml_endelem(void *userData, const XML_Char *name)
XML end of element.
Definition: unbound-anchor.c:1518
struct pending * next_waiting
next in waiting list.
Definition: outside_network.h:243
struct comm_point * tcp_free
linked list of free tcp_handlers to use for new queries.
Definition: netevent.h:188
static int listen_cp_insert(struct comm_point *c, struct listen_dnsport *front)
Add items to commpoint list in front.
Definition: listen_dnsport.c:1312
char * logfile
filename to log to.
Definition: config_file.h:291
static struct local_zone * lz_enter_zone_dname(struct local_zones *zones, uint8_t *nm, size_t len, int labs, enum localzone_type t, uint16_t c)
enter a new zone with allocated dname returns with WRlock
Definition: localzone.c:173
struct ctx_query * context_deserialize_answer(struct ub_ctx *ctx, uint8_t *p, uint32_t len, int *err)
Deserialize an answer buffer.
Definition: context.c:332
static uint16_t rrsig_rdata_get_type_covered(uint8_t *rdata, size_t rdatalen)
get rrsig type covered from rdata.
Definition: authzone.c:718
static char * do_macro_variable(rbtree_type *store, char *buf, size_t remain)
do macro variable
Definition: replay.c:657
static int create_synth_cname(uint8_t *qname, size_t qname_len, struct regional *region, struct auth_data *node, struct auth_rrset *dname, uint16_t dclass, struct ub_packed_rrset_key **cname)
create synthetic CNAME rrset for in a DNAME answer in region, false on alloc failure,...
Definition: authzone.c:2413
struct sldns_struct_lookup_table * sldns_algorithms
Taken from RFC 2535, section 7.
Definition: wire2str.c:58
void server_stats_querymiss(struct ub_server_stats *stats, struct worker *worker)
add query if it missed the cache
Definition: stats.c:93
int return_rcode
the rcode, in case of error, instead of a reply message
Definition: module.h:612
int last_rtt
rtt of last message
Definition: outside_network.h:384
enum localzone_type local_data_find_tag_action(const uint8_t *taglist, size_t taglen, const uint8_t *taglist2, size_t taglen2, const uint8_t *tagactions, size_t tagactionssize, enum localzone_type lzt, int *tag, char *const *tagname, int num_tags)
See if two sets of tag lists (in the form of bitmap) have the same tag that has an action.
Definition: localzone.c:1618
void sockaddr_store_port(struct sockaddr_storage *addr, socklen_t addrlen, int port)
store port number into sockaddr structure
Definition: net_help.c:469
Per Zone aggressive negative caching data.
Definition: val_neg.h:94
static int dtio_setup_ssl(struct dt_io_thread *dtio)
setup the SSL structure for new connection
Definition: dtstream.c:1942
size_t val_get_mem(struct module_env *env, int id)
Debug helper routine that assists worker in determining memory in use.
Definition: validator.c:3254
struct ub_event_base * comm_base_internal(struct comm_base *b)
Access internal data structure (for util/tube.c on windows)
Definition: netevent.c:268
@ repevt_time_passes
time passes
Definition: replay.h:200
int sldns_wire2str_ipseckey_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat IPSECKEY field to string, with user buffers.
Definition: wire2str.c:1586
static int compress_tree_search(struct compress_tree_node **tree, uint8_t *dname, int labs, struct compress_tree_node **match, int *matchlabels, struct compress_tree_node ***insertpt)
Find domain name in tree, returns exact and closest match.
Definition: msgencode.c:107
struct key_entry_key * val_verify_new_DNSKEYs(struct regional *region, struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ds_rrset, int downprot, char **reason, struct module_qstate *qstate)
Verify new DNSKEYs with DS rrset.
Definition: val_utils.c:559
struct auth_rrset * next
next in list
Definition: authzone.h:173
const char * name
backend name
Definition: cachedb.h:73
lock_rw_type lock
lock on the localzone tree
Definition: localzone.h:110
struct ub_event *(* winsock_register_wsaevent)(struct ub_event_base *, void *wsaevent, void(*cb)(int, short, void *), void *arg)
Create a new ub_event associated with the given wsaevent, (not called by libunbound)
Definition: unbound-event.h:105
struct auth_zones * auth_zones_create(void)
Create auth zones structure.
Definition: authzone.c:289
char * errinf_to_str_bogus(struct module_qstate *qstate)
Create error info in string.
Definition: config_file.c:2424
struct timeval upper
upper bound
Definition: timehist.h:55
struct addr_tree_node node
node in address tree
Definition: tcp_conn_limit.h:69
int fptr_whitelist_comm_signal(void(*fptr)(int, void *))
Check function pointer whitelist for comm_signal callback values.
Definition: fptr_wlist.c:145
uint8_t * pkt
The query itself, the query packet to send.
Definition: outside_network.h:247
Definition: net_help.c:79
struct ub_packed_rrset_key * reply_find_rrset_section_an(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside the answer section.
Definition: msgreply.c:771
struct ecs_data ecs_server_in
ecss data for server communication
Definition: subnetmod.h:83
size_t alloc_get_mem(struct alloc_cache *alloc)
Get memory size of alloc cache, alloc structure including special types.
Definition: alloc.c:310
void regional_destroy(struct regional *r)
Destroy regional.
Definition: regional.c:114
int cfg_str2list_insert(struct config_str2list **head, char *item, char *i2)
Insert string into str2list.
Definition: config_file.c:1750
int storeQueryInCache(struct module_qstate *qstate, struct query_info *qinfo, struct reply_info *msgrep, int is_referral)
Store the reply_info and query_info pair in message cache (qstate->msg_cache)
Definition: pythonmod_utils.c:59
Stack of modules.
Definition: modstack.h:50
@ UB_SYNTAX
syntax error
Definition: context.h:191
static void lowercase_dname(uint8_t **p, size_t *remain)
lowercase domain name - does not follow compression pointers
Definition: testpkts.c:1045
sldns_lookup_table * sldns_lookup_by_name(sldns_lookup_table table[], const char *name)
Looks up the table entry by name, returns NULL if not found.
rbnode_type node
rbtree node, key is name
Definition: view.h:68
void rrset_cache_remove(struct rrset_cache *r, uint8_t *nm, size_t nmlen, uint16_t type, uint16_t dclass, uint32_t flags)
Remove an rrset from the cache, by name and type and flags.
Definition: rrset.c:441
struct dns_msg * dns_copy_msg(struct dns_msg *from, struct regional *regional)
Copy a dns_msg to this regional.
Definition: iter_utils.c:638
int dname_is_root(uint8_t *dname)
Returns true if the uncompressed wireformat dname is the root ".".
Definition: dname.c:718
int edns_opt_list_append(struct edns_option **list, uint16_t code, size_t len, uint8_t *data, struct regional *region)
Append edns option to edns option list.
Definition: msgreply.c:974
static void next_closer(uint8_t *qname, size_t qnamelen, uint8_t *ce, uint8_t **nm, size_t *nmlen)
Given a qname and its proven closest encloser, calculate the "next closest" name.
Definition: val_nsec3.c:914
main tap callback data
Definition: unbound-dnstap-socket.c:97
int nsec3_hash_name(rbtree_type *table, struct regional *region, struct sldns_buffer *buf, struct ub_packed_rrset_key *nsec3, int rr, uint8_t *dname, size_t dname_len, struct nsec3_cached_hash **hash)
Obtain the hash of an owner name.
Definition: val_nsec3.c:630
static struct module_func_block ipset_block
The ipset function block.
Definition: ipset.c:374
void worker_stats_clear(struct worker *worker)
Init worker stats - includes server_stats_init, outside network and mesh.
Definition: worker.c:2027
struct event_base * ub_libevent_get_event_base(struct ub_event_base *base)
Return the libevent base underlying the given ub_event_base.
Definition: ub_event_pluggable.c:410
int inplace_cb_reply_call(struct module_env *env, struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct comm_reply *repinfo, struct regional *region)
Call the registered functions in the inplace_cb_reply linked list.
Definition: msgreply.c:1057
enum val_classification val_classify_response(uint16_t query_flags, struct query_info *origqinf, struct query_info *qinf, struct reply_info *rep, size_t skip)
Given a response, classify ANSWER responses into a subtype.
Definition: val_utils.c:62
struct comm_point * com
event info
Definition: listen_dnsport.h:77
RES * ssl
the SSL to print to
Definition: remote.c:2787
#define DTIO_RECONNECT_TIMEOUT_MIN
the msec to wait for reconnect (if not immediate, the first attempt)
Definition: dtstream.c:66
static void tempfile_check(struct replay_runtime *runtime, struct replay_moment *mom)
check tempfile file contents
Definition: fake_event.c:631
@ local_zone_unset
unset type, used for unset tag_action elements
Definition: localzone.h:67
int(* dispatch)(struct ub_event_base *)
Run the event loop (not called by libunbound when using ub_resolve_event)
Definition: unbound-event.h:93
const char * sec_status_to_string(enum sec_status s)
Get a printable string for a security status value.
Definition: packed_rrset.c:250
void lru_demote(struct lruhash *table, struct lruhash_entry *entry)
Demote entry, so it becomes the least recently used in the LRU list.
Definition: lruhash.c:553
struct outside_network * back
the backside outside network interface to the auth servers
Definition: libworker.h:86
void authzone_test(void)
test authzone code
Definition: unitauth.c:893
static int ixfr_start_serial(struct auth_chunk *rr_chunk, int rr_num, size_t rr_pos, uint8_t *rr_dname, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint16_t rr_rdlen, uint8_t *rr_rdata, size_t rr_nextpos, uint32_t transfer_serial, uint32_t xfr_serial)
check that start serial is OK for ixfr.
Definition: authzone.c:4538
uint8_t * dlv_insecure_at
Name at which chain of trust stopped with insecure, starting DLV DLV must result in chain going furth...
Definition: validator.h:231
sldns_lookup_table * sldns_edns_flags
EDNS flags.
Definition: wire2str.c:160
size_t donotq_get_mem(struct iter_donotq *donotq)
Get memory used by donotqueryaddresses structure.
Definition: iter_donotq.c:149
int fptr_whitelist_pending_tcp(comm_point_callback_type *fptr)
Check function pointer whitelist for pending tcp callback values.
Definition: fptr_wlist.c:202
struct regional * region
regional for allocation
Definition: iter_donotq.h:55
static int dtio_write_more_of_len(struct dt_io_thread *dtio)
write more of the length, preceding the data frame.
Definition: dtstream.c:815
static int comm_point_http_handle_read(int fd, struct comm_point *c)
Handle http reading callback.
Definition: netevent.c:2196
struct lruhash_entry entry
the entry
Definition: slabhash.h:209
@ LDNS_RR_TYPE_RRSIG
DNSSEC.
Definition: rrdef.h:175
struct delegpt * delegpt_from_message(struct dns_msg *msg, struct regional *region)
Create new delegation point from a dns message.
Definition: iter_delegpt.c:349
testcode/checklocks.h - wrapper on locks that checks access.
char * rpz_cname
Always reply with this CNAME target if the cname override action is used.
Definition: config_file.h:688
void ub_rrset_key_delete(void *key, void *userdata)
Old key to be deleted.
Definition: packed_rrset.c:128
int restart_count
The query restart count.
Definition: validator.h:161
struct replay_moment * mom_next
Next replay moment in list of replay moments.
Definition: replay.h:187
@ LDNS_RR_TYPE_WKS
a well known service description
Definition: rrdef.h:105
void algo_needs_init_ds(struct algo_needs *n, struct ub_packed_rrset_key *ds, int fav_ds_algo, uint8_t *sigalg)
Initialize algo needs structure, set algos from rrset as needed.
Definition: val_sigcrypt.c:425
uint8_t * reply_find_final_cname_target(struct query_info *qinfo, struct reply_info *rep)
Find final cname target in reply, the one matching qinfo.
Definition: msgreply.c:725
int sldns_str2wire_wks_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_WKS from string to wireformat.
Definition: str2wire.c:1704
static void tcp_callback_reader(struct comm_point *c)
do the callback when reading is done
Definition: netevent.c:1016
int on_ixfr_is_axfr
we are doing an IXFR but we detected an AXFR contents
Definition: authzone.h:406
int ub_ctx_debuglevel(struct ub_ctx *ctx, int d)
Set debug verbosity for the context Output is directed to stderr.
Definition: libunbound.c:466
int sldns_str2wire_b64_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_B64 from string to wireformat.
Definition: str2wire.c:1205
void iter_merge_retry_counts(struct delegpt *dp, struct delegpt *old)
Add retry counts from older delegpt to newer delegpt.
Definition: iter_utils.c:1299
RRset data.
Definition: packed_rrset.h:235
static void xfr_probe_start_list(struct auth_xfer *xfr, struct auth_master *spec)
start the iteration of the task_probe list of masters
Definition: authzone.c:3840
static struct comm_point * comm_point_create_tcp_handler(struct comm_base *base, struct comm_point *parent, size_t bufsize, struct sldns_buffer *spoolbuf, comm_point_callback_type *callback, void *callback_arg)
create a tcp handler with a parent
Definition: netevent.c:2633
int iter_apply_cfg(struct iter_env *iter_env, struct config_file *cfg)
Process config options and set iterator module state.
Definition: iter_utils.c:144
hashvalue_type rrset_key_hash(struct packed_rrset_key *key)
Calculate hash value for a packed rrset key.
Definition: packed_rrset.c:163
#define BIT_CD
DNS constants for uint16_t style flag manipulation.
Definition: net_help.h:57
int inplace_cb_register(void *cb, enum inplace_cb_list_type type, void *cbarg, struct module_env *env, int id)
Register an inplace callback function.
Definition: module.c:127
void iter_dns_store(struct module_env *env, struct query_info *msgqinf, struct reply_info *msgrep, int is_referral, time_t leeway, int pside, struct regional *region, uint16_t flags)
Allocate a dns_msg with malloc/alloc structure and store in dns cache.
Definition: iter_utils.c:654
size_t namelen
length of zone name
Definition: authzone.h:209
static int read_addrs(struct iter_priv *priv, struct config_file *cfg)
Read private-addr declarations from config.
Definition: iter_priv.c:78
static struct ub_packed_rrset_key * ub_packed_rrset_heap_key(int iter(struct autr_ta **, uint8_t **, size_t *, size_t *), struct autr_ta *list)
Create a ub_packed_rrset_key allocated on the heap.
Definition: autotrust.c:626
static void verb_certs(const char *msg, STACK_OF(X509) *sk)
printout certificates in detail
Definition: unbound-anchor.c:337
size_t ipsecmod_get_mem(struct module_env *env, int id)
return memory estimate for the ipsecmod module
The configuration options.
Definition: config_file.h:68
static struct ub_packed_rrset_key * filter_next(struct nsec3_filter *filter, size_t *rrsetnum, int *rrnum)
Iterate through NSEC3 list, per RR This routine gives the next RR in the list (or sets rrset null).
Definition: val_nsec3.c:327
void val_mark_indeterminate(struct reply_info *rep, struct val_anchors *anchors, struct rrset_cache *r, struct module_env *env)
Mark all unchecked rrset entries not below a trust anchor as indeterminate.
Definition: val_utils.c:1011
int fptr_whitelist_mod_operate(void(*fptr)(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound))
Check function pointer whitelist for module operate call values.
Definition: fptr_wlist.c:445
static void local_zone_out(struct local_zone *z)
print all RRsets in local zone
Definition: localzone.c:1164
const char * sldns_get_errorstr_parse(int e)
Get reference to a constant string for the (parse) error.
Definition: str2wire.c:840
size_t comm_timer_get_mem(struct comm_timer *timer)
Get size of memory used by comm timer.
struct val_neg_zone * neg_find_zone(struct val_neg_cache *neg, uint8_t *nm, size_t len, uint16_t dclass)
Find the given zone, from the SOA owner name and class Does not do locking.
Definition: val_neg.c:280
struct infra_cache * infra
the infra cache
Definition: remote.c:2433
int val_chase_cname(struct query_info *qchase, struct reply_info *rep, size_t *cname_skip)
Chase the cname to the next query name.
Definition: val_utils.c:811
static time_t check_holddown(struct module_env *env, struct autr_ta *ta, unsigned int holddown)
Check if the holddown time has already exceeded setting: add-holddown: add holddown timer setting: de...
Definition: autotrust.c:1680
int remote_accept_callback(struct comm_point *, void *, int, struct comm_reply *)
handle remote control accept callbacks
static void dtio_open_output(struct dt_io_thread *dtio)
open the output channel
Definition: dtstream.c:1957
long long num_query_authzone_down
number of queries for unbound's auth_zones, downstream answers
Definition: unbound.h:776
struct ub_event_base * ub_libevent_event_base(struct event_base *)
Return an ub_event_base constructed for the given libevent event base.
Definition: ub_event.c:241
size_t http_stored
http stored content in buffer
Definition: netevent.h:218
static int dnslook(struct ub_ctx *ctx, char *q, int t, int c, int docname)
perform a lookup and printout return if domain existed
Definition: unbound-host.c:367
#define EDNS_FRAG_SIZE_IP4
fallback size for fragmentation for EDNS in IPv4
Definition: outside_network.h:316
int daemon_remote_open_accept(struct daemon_remote *rc, struct listen_port *ports, struct worker *worker)
Setup comm points for accepting remote control connections.
Definition: remote.c:414
@ respip_static
serves response data, else, nodata answer.
Definition: localzone.h:566
#define MSG_GENERIC_ERR
from gen_msg.h - error message record for windows message log
Definition: win_svc.h:61
static struct serviced_query * lookup_serviced(struct outside_network *outnet, sldns_buffer *buff, int dnssec, struct sockaddr_storage *addr, socklen_t addrlen, struct edns_option *opt_list)
lookup serviced query in serviced query rbtree
Definition: outside_network.c:1400
uint8_t nonce[crypto_box_HALF_NONCEBYTES]
the nonce used by the client
Definition: dnscrypt.c:66
static int tcp_relay_read(int s, struct tcp_send_list **first, struct tcp_send_list **last, struct timeval *now, struct timeval *delay, sldns_buffer *pkt)
relay TCP, read a part
Definition: delayer.c:642
struct lruhash_entry * bin_find_entry(struct lruhash *table, struct lruhash_bin *bin, hashvalue_type hash, void *key)
Find entry in hash bin.
Definition: lruhash.c:218
void listening_ports_free(struct listen_port *list)
Close and delete the (list of) listening ports.
Definition: listen_dnsport.c:1535
static struct ub_packed_rrset_key * find_rrset_type(struct reply_info *rep, uint16_t type)
find RRset in reply by type
Definition: unitverify.c:233
static unsigned int parse_int(char *line, int *ret)
parse integer
Definition: autotrust.c:796
int sw
pipe end to write on
Definition: tube.h:68
static int moveover_rrsigs(sldns_buffer *pkt, struct regional *region, struct rrset_parse *sigset, struct rrset_parse *dataset, int duplicate)
move rrsigs from sigset to dataset
Definition: msgparse.c:341
static int issub(const addrkey_t *s1, addrlen_t l1, const addrkey_t *s2, addrlen_t l2, addrlen_t skip)
Tests if s1 is a substring of s2.
Definition: addrtree.c:352
int srctype
return type 0 (none), 4(IP4), 6(IP6)
Definition: netevent.h:121
@ UB_NOERROR
no error
Definition: context.h:184
time_t secs
seconds time pointer points here
Definition: netevent.c:118
static void config_del_strarray(char **array, int num)
delete string array
Definition: config_file.c:1396
size_t len
length of name
Definition: val_neg.h:100
static int http_zonefile_syntax_check(struct auth_xfer *xfr, sldns_buffer *buf)
check syntax of chunklist zonefile, parse first RR, return false on failure and return a string in th...
Definition: authzone.c:4310
lock_rw_type lock
lock on the authzone trees
Definition: authzone.h:74
int ub_timer_add(struct ub_event *, struct ub_event_base *, void(*cb)(int, short, void *), void *arg, struct timeval *)
Reconfigure and activate a timeout event.
Definition: ub_event.c:399
struct acl_list * acl_list_create(void)
Create acl structure.
Definition: acl_list.c:52
static void dname_test_sigcount(void)
test dname_signame_label_count
Definition: unitdname.c:480
static void usage(void)
Give unbound-host usage, and exit (1).
Definition: unbound-host.c:83
void addrtree_delete(struct addrtree *tree)
Free tree and all nodes below.
Definition: addrtree.c:275
static int acl_list_view_cfg(struct acl_list *acl, const char *str, const char *str2, struct views *vs)
apply acl_view string
Definition: acl_list.c:177
int serve_expired_reply_ttl
TTL for the serve expired replies.
Definition: config_file.h:372
static time_t key_ttl(struct ub_packed_rrset_key *k)
get TTL from DNSKEY rrset
Definition: autotrust.c:1461
struct regional * regional_create_custom(size_t size)
Create a new region, with custom settings.
Definition: regional.c:84
int fptr_whitelist_stop_accept(void(*fptr)(void *))
Check function pointer whitelist for stop_accept callback values.
Definition: fptr_wlist.c:157
static void ssl_err(const char *s)
exit with ssl error
Definition: unbound-control.c:474
static struct trust_anchor * find_add_tp(struct val_anchors *anchors, uint8_t *rr, size_t rr_len, size_t dname_len)
find or add a new trust point for autotrust
Definition: autotrust.c:416
int sldns_wire2str_nsec3_next_owner_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat nsec3_next_owner field to string, with user buffers.
Definition: wire2str.c:1647
int finalized
The context has been finalized This is after config when the first resolve is done.
Definition: context.h:84
static int readkeyword_bindfile(FILE *in, sldns_buffer *buf, int *line, int comments)
Read a keyword skipping bind comments; spaces, specials, restkeywords.
Definition: val_anchor.c:531
uint8_t * sldns_wirerr_get_rdata(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata pointer of the RR.
Definition: str2wire.c:826
int create_local_accept_sock(const char *path, int *noproto, int use_systemd)
Create and bind local listening socket.
Definition: listen_dnsport.c:927
int in_worker_handle
are we in worker_handle function call (for recursion callback)
Definition: listen_dnsport.h:254
int iter_ns_probability(struct ub_randstate *rnd, int n, int m)
Select randomly with n/m probability.
Definition: iter_utils.c:664
An entry into the hash table.
Definition: lruhash.h:203
int want_to_exit
the io thread wants to exit
Definition: dtstream.h:175
long long qbit_AA
number of queries with AA bit
Definition: unbound.h:705
int ixfr_fail
failed ixfr transfer, retry with axfr (to the current master), the IXFR was 'REFUSED',...
Definition: authzone.h:395
static void do_newkey(struct module_env *env, struct autr_ta *anchor, int *c)
Event: NewKey.
Definition: autotrust.c:1720
static int read_donotq(struct iter_donotq *dq, struct config_file *cfg)
read donotq config
Definition: iter_donotq.c:111
@ DNS64_INTERNAL_QUERY
Internally-generated query, no DNS64 processing.
Definition: dns64.c:76
struct timeval jostle_max
timeout for jostling.
Definition: mesh.h:150
struct delegpt * delegpt_create(struct regional *regional)
Create new delegation point.
Definition: iter_delegpt.c:54
int tcl_new_connection(struct tcl_addr *tcl)
Increment TCP connection count if found, provided the count was below the limit.
Definition: tcp_conn_limit.c:155
static void do_flush_infra(RES *ssl, struct worker *worker, char *arg)
flush infra cache
Definition: remote.c:1643
void rpz_finish_config(struct rpz *r)
Prepare RPZ after procesing feed content.
Definition: rpz.c:328
struct slabhash * slab
uses slabhash for storage, type key_entry_key, key_entry_data
Definition: val_kcache.h:56
size_t mod_get_mem(struct module_env *env, const char *name)
fetch memory for a module by name, returns 0 if module not there
Definition: modstack.c:272
struct fake_pending * pending
the pending entry for this commpoint (if any)
Definition: fake_event.c:90
int worker_init(struct worker *worker, struct config_file *cfg, struct listen_port *ports, int do_sigs)
Initialize worker.
Definition: worker.c:1741
void slabhash_remove(struct slabhash *sl, hashvalue_type hash, void *key)
Remove entry from hashtable.
Definition: slabhash.c:128
static int synth_cname(uint8_t *qname, size_t qnamelen, struct rrset_parse *dname_rrset, uint8_t *alias, size_t *aliaslen, sldns_buffer *pkt)
Synthesize CNAME from DNAME, false if too long.
Definition: iter_scrub.c:226
uint8_t * sldns_wirerr_get_rdatawl(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata pointer of the RR.
Definition: str2wire.c:833
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
Definition: rrdef.h:95
void hints_delete(struct iter_hints *hints)
Delete hints.
Definition: iter_hints.c:82
void * listen_sslctx_create(char *key, char *pem, char *verifypem)
create SSL listen context
Definition: net_help.c:979
static struct fake_timer * first_timer(struct replay_runtime *runtime)
fetch oldest timer in list that is enabled
Definition: replay.c:532
static void dtio_reconnect_clear(struct dt_io_thread *dtio)
clear the reconnect exponential backoff timer.
Definition: dtstream.c:539
static sldns_buffer * dname_to_buf(sldns_buffer *b, const char *str)
put dname into buffer
Definition: unitdname.c:50
int dns64_init(struct module_env *env, int id)
dns64 init
Definition: dns64.c:397
int infra_set_lame(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, time_t timenow, int dnsseclame, int reclame, uint16_t qtype)
Set a host to be lame for the given zone.
Definition: infra.c:506
void mesh_serve_expired_callback(void *arg)
Callback for when the serve expired client timer has run out.
Definition: mesh.c:1881
void log_dns_msg(const char *str, struct query_info *qinfo, struct reply_info *rep)
Debug send the query info and reply info to the log in readable form.
Definition: msgreply.c:820
struct tcp_req_info * tcp_req_info_create(struct sldns_buffer *spoolbuf)
Create tcp request info structure that keeps track of open requests on the TCP channel that are resol...
Definition: listen_dnsport.c:1598
#define RRSET_SCRUB_OK
RRset flag used during scrubbing.
Definition: iter_scrub.c:59
@ local_zone_deny
drop query
Definition: localzone.h:69
#define MAX_REFERRAL_COUNT
max number of referrals.
Definition: iterator.h:66
int rto
current RTO in use, in milliseconds
Definition: rtt.h:55
int mesh_state_is_unique(struct mesh_state *mstate)
Check if the mesh state is unique.
Definition: mesh.c:849
struct ub_event *(* new_signal)(struct ub_event_base *, int fd, void(*cb)(int, short, void *), void *arg)
Instantiate a new signal associated with this event base, (not called by libunbound)
Definition: unbound-event.h:101
int scrub_message(sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinfo, uint8_t *zonename, struct regional *region, struct module_env *env, struct iter_env *ie)
Cleanup the passed dns message.
Definition: iter_scrub.c:806
int dns_cache_prefetch_adjust(struct module_env *env, struct query_info *qinfo, time_t adjust, uint16_t flags)
Adjust the prefetch_ttl for a cached message.
Definition: dns.c:1025
void fake_event_init(struct replay_scenario *scen)
Initialise fake event services.
Definition: fake_event.c:123
@ LDNS_RR_TYPE_X25
RFC1183.
Definition: rrdef.h:121
int infra_rtt_update(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen, int qtype, int roundtrip, int orig_rtt, time_t timenow)
Update rtt information for the host.
Definition: infra.c:562
struct module_func_block * dynlibmod_get_funcblock(void)
Get the module function block.
Definition: dynlibmod.c:298
void log_buf(enum verbosity_value level, const char *msg, sldns_buffer *buf)
Easy alternative for log_hex, takes a sldns_buffer.
Definition: log.c:424
void outnet_tcptimer(void *arg)
callback for outgoing TCP timer event
Definition: outside_network.c:1286
static void usage(void)
Give unbound-anchor usage, and exit (1).
Definition: unbound-anchor.c:175
static void nsectest(void)
Test NSEC type bitmap routine.
Definition: unitverify.c:377
static void process_list_end_transfer(struct auth_xfer *xfr, struct module_env *env)
task transfer.
Definition: authzone.c:5733
size_t max_reply_states
max total number of reply states to have
Definition: mesh.h:107
int ignore_cd
ignore the CD flag in incoming queries and refuse them bogus data
Definition: config_file.h:364
static int http_process_chunk_header(struct comm_point *c)
a chunk header is complete, process it, return 0=fail, 1=continue next header line,...
Definition: netevent.c:2022
struct comm_signal * comm_signal_create(struct comm_base *base, void(*callback)(int, void *), void *cb_arg)
Create a signal handler.
Definition: netevent.c:3370
char * ssl_service_key
private key file for dnstcp-ssl service (enabled if not NULL)
Definition: config_file.h:112
static void test_anchors(sldns_buffer *buff, struct val_anchors *a)
test with several anchors
Definition: unitanchor.c:95
struct comm_point * outnet_comm_point_for_udp(struct outside_network *outnet, comm_point_callback_type *cb, void *cb_arg, struct sockaddr_storage *to_addr, socklen_t to_addrlen)
Create udp commpoint suitable for sending packets to the destination.
Definition: outside_network.c:2268
tube_callback_type * listen_cb
listen callback
Definition: tube.h:73
int dname_subdomain_c(uint8_t *d1, uint8_t *d2)
Counts labels.
Definition: dname.c:700
int ub_ctx_zone_remove(struct ub_ctx *ctx, const char *zone_name)
Remove zone from local authority info of the library.
Definition: libunbound.c:1326
void mesh_stats(struct mesh_area *mesh, const char *str)
Print some stats about the mesh to the log.
Definition: mesh.c:1726
@ respip_none
no respip action
Definition: localzone.h:538
int auth_zone_avoid
True if the auth_zones should not be consulted for the query.
Definition: iterator.h:408
static int compress_tree_store(uint8_t *dname, int labs, size_t offset, struct regional *region, struct compress_tree_node *closest, struct compress_tree_node **insertpt)
Store domain name and ancestors into compression tree.
Definition: msgencode.c:206
int dnstap_send_version
true to send "version" via dnstap
Definition: config_file.h:503
int delegpt_add_rrset(struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
Add any RRset to delegpt.
Definition: iter_delegpt.c:469
Per query state for the iterator module.
Definition: iterator.h:222
size_t tcp_req_info_get_stream_buffer_size(void)
get the size of currently used tcp stream wait buffers (in bytes)
Definition: listen_dnsport.c:1957
int sldns_wire2str_class_buf(uint16_t rrclass, char *s, size_t slen)
Convert wire RR class to a string, 'IN', 'CLASS12'.
Definition: wire2str.c:293
void daemon_remote_stop_accept(struct daemon_remote *rc)
Stop accept handlers for TCP (until enabled again)
Definition: remote.c:428
@ LDNS_RDF_TYPE_IPSECKEY
IPSECKEY.
Definition: rrdef.h:325
@ LDNS_RR_TYPE_AFSDB
RFC1183.
Definition: rrdef.h:119
struct pending * udp_wait_last
last pending udp query in list
Definition: outside_network.h:123
static int nsec3_iteration_count_high(struct val_env *ve, struct nsec3_filter *filter, struct key_entry_key *kkey)
Determine if any of the NSEC3 rrs iteration count is too high, from key.
Definition: val_nsec3.c:474
Structure only for signal events.
Definition: netevent.h:335
struct local_data * local_zone_find_data(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs)
Find a data node by exact name for a local zone.
Definition: localzone.c:420
void comm_point_send_reply(struct comm_reply *repinfo)
Send reply.
Definition: fake_event.c:996
static void do_auth_zone_transfer(RES *ssl, struct worker *worker, char *arg)
do the auth_zone_transfer command
Definition: remote.c:2544
void key_cache_delete(struct key_cache *kcache)
Delete the key cache.
Definition: val_kcache.c:74
struct config_str2list * respip_data
data complementing the 'redirect' response IP actions
Definition: config_file.h:715
size_t autr_get_num_anchors(struct val_anchors *anchors)
See if autotrust anchors are configured and how many.
Definition: autotrust.c:106
struct mesh_state * unique
pointer to this state for uniqueness or NULL
Definition: mesh.h:196
static lock_basic_type stream_wait_count_lock
lock on the counter of stream buffer memory
Definition: listen_dnsport.c:81
int addr_tree_compare(const void *k1, const void *k2)
compare addr tree nodes
Definition: dnstree.c:60
a lock
Definition: lock_verify.c:69
char * regional_strdup(struct regional *r, const char *string)
Duplicate string and allocate the result in regional.
Definition: regional.c:180
#define SENTINEL_NOT
Root key sentinel is not ta preamble.
Definition: validator.h:73
@ LDNS_RR_TYPE_MF
a mail forwarder (Obsolete - use MX)
Definition: rrdef.h:91
BIO * czone
the current anchor: Zone
Definition: unbound-anchor.c:1208
uint8_t * reply_pkt
the reply pkt
Definition: testpkts.h:153
int sldns_wire2str_rr_comment_print(char **str, size_t *str_len, uint8_t *rr, size_t rrlen, size_t dname_off, uint16_t rrtype)
Print to string the RR-information comment in default format, with user buffers.
Definition: wire2str.c:650
static void perfreply(struct perfinfo *info, size_t n, struct timeval *now)
got reply for io
Definition: perf.c:306
@ LDNS_RR_TYPE_KEY
2535typecode
Definition: rrdef.h:133
void dt_msg_queue_submit(struct dt_msg_queue *mq, void *buf, size_t len)
Submit a message to the queue.
Definition: dtstream.c:168
void comm_point_udp_ancil_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:583
struct query_info key
the hash table key
Definition: msgreply.h:219
static void skip_to_eol(FILE *in)
skip file to end of line
Definition: val_anchor.c:486
int rpz_clear(struct rpz *r)
Clear local-zones and respip data in RPZ, used after reloading file or AXFR/HTTP transfer.
Definition: rpz.c:313
int dnstap_bidirectional
using bidirectional frame streams if true
Definition: config_file.h:485
struct timeval wait
time when the item can be transmitted on
Definition: delayer.c:106
static void infra_del_host(struct lruhash_entry *e, void *arg)
callback to delete hosts in infra cache
Definition: remote.c:1622
int cur_tcp_count
current number of tcp handler in-use for this accept socket
Definition: netevent.h:182
void respip_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
inform response-ip super
Definition: respip.c:1223
int sldns_wire2str_type_buf(uint16_t rrtype, char *s, size_t slen)
Convert wire RR type to a string, 'MX', 'TYPE12'.
Definition: wire2str.c:287
int sldns_str2wire_dname_buf(const char *str, uint8_t *buf, size_t *len)
Convert text string into dname wireformat, mallocless, with user buffer.
Definition: str2wire.c:139
static size_t rrsig_num_that_cover(struct auth_rrset *rrsig, uint16_t rr_type, size_t *sigsz)
count number (and size) of rrsigs that cover a type
Definition: authzone.c:913
int sldns_wire2str_ttl_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat rr ttl to string, with user buffers.
Definition: wire2str.c:932
uint8_t * zone
zone name, uncompressed domain name in wireformat
Definition: outside_network.h:351
struct delegpt_ns * next
next in list
Definition: iter_delegpt.h:97
void comm_base_dispatch(struct comm_base *b)
Dispatch the comm base events.
Definition: fake_event.c:953
static int parse_query_section(sldns_buffer *pkt, struct msg_parse *msg)
Parse query section.
Definition: msgparse.c:579
@ module_wait_subquery
module is waiting for sub-query
Definition: module.h:543
uint8_t * config_parse_taglist(struct config_file *cfg, char *str, size_t *listlen)
parse taglist from string into bytestring with bitlist.
Definition: config_file.c:1956
void config_print_func(char *line, void *arg)
function to print to a file, use as func with config_get_option.
Definition: config_file.c:748
static int vsig
verbose signature test
Definition: unitverify.c:65
unsigned int shift
shift right this many bits to get index into array.
Definition: slabhash.h:63
uint8_t * taglist
tag bitlist
Definition: localzone.h:143
int slabhash_is_size(struct slabhash *sl, size_t size, size_t slabs)
See if slabhash is of given (size, slabs) configuration.
Definition: slabhash.c:156
int find_tag_id(struct config_file *cfg, const char *tag)
Find tag ID in the tag list.
Definition: config_file.c:1912
uint8_t * pkt
the answer preparsed as ldns pkt
Definition: replay.h:372
void lruhash_remove(struct lruhash *table, hashvalue_type hash, void *key)
Remove entry from hashtable.
Definition: lruhash.c:378
static time_t min_expiry(struct module_env *env, struct packed_rrset_data *dd)
Find minimum expiration interval from signatures.
Definition: autotrust.c:1281
addrlen_t max_depth
Maximum prefix length we are willing to cache.
Definition: addrtree.h:76
void timehist_import(struct timehist *hist, long long *array, size_t sz)
Import histogram from an array.
Definition: timehist.c:239
static void check_data(struct val_neg_zone *zone, struct val_neg_data *data)
check point in data tree
Definition: unitneg.c:395
int supports_ipv4
A flag to indicate whether or not we have an IPv4 route.
Definition: iterator.h:114
struct mesh_state * mesh_area_find(struct mesh_area *mesh, struct respip_client_info *cinfo, struct query_info *qinfo, uint16_t qflags, int prime, int valrec)
Find a mesh state in the mesh area.
Definition: mesh.c:1425
uint32_t hashlittle(const void *k, size_t length, uint32_t initval)
Hash key data.
Definition: lookup3.c:332
int ub_c_wrap(void)
wrap function
Definition: config_file.c:1645
@ LDNS_RDF_TYPE_B64
b64 string
Definition: rrdef.h:286
void anchors_init_parents_locked(struct val_anchors *anchors)
Recalculate parent pointers.
Definition: val_anchor.c:155
static void checkformerr(sldns_buffer *pkt)
check if unbound formerr equals ldns formerr
Definition: unitmsgparse.c:146
static int read_fwds_host(struct config_stub *s, struct delegpt *dp)
set fwd host names
Definition: iter_fwd.c:204
static struct val_qstate * val_new(struct module_qstate *qstate, int id)
allocate new validator query state
Definition: validator.c:255
size_t num_rrsets
number of rrsets removed
Definition: remote.c:1609
static void probe_anchor(struct module_env *env, struct trust_anchor *tp)
probe a trust anchor DNSKEY and unlocks tp
Definition: autotrust.c:2345
int nsec3_get_nextowner(struct ub_packed_rrset_key *rrset, int r, uint8_t **next, size_t *nextlen)
Return nsec3 RR next hashed owner name.
Definition: val_nsec3.c:222
int parse_copy_decompress_rrset(struct sldns_buffer *pkt, struct msg_parse *msg, struct rrset_parse *pset, struct regional *region, struct ub_packed_rrset_key *pk)
Copy a parsed rrset into given key, decompressing and allocating rdata.
Definition: msgreply.c:375
size_t dname_len
Length of the domain name, including last 0 root octet.
Definition: packed_rrset.h:84
INLINE int sldns_buffer_available_at(sldns_buffer *buffer, size_t at, size_t count)
checks if the buffer has at least COUNT more bytes available.
Definition: sbuffer.h:409
int val_has_signed_nsecs(struct reply_info *rep, char **reason)
check if has dnssec info, and if it has signed nsecs.
Definition: val_utils.c:1111
int delegpt_add_ns_mlc(struct delegpt *dp, uint8_t *name, uint8_t lame)
add a name to malloced delegation point.
Definition: iter_delegpt.c:579
static void libworker_delete_env(struct libworker *w)
delete libworker env
Definition: libworker.c:90
struct comm_base * base
the comm base
Definition: netevent.c:106
ub_thread_type tid
thread id
Definition: asynclook.c:176
int sldns_str2wire_int16_data_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_INT16_DATA from string to wireformat.
Definition: str2wire.c:2102
uint8_t * dname
The domain name.
Definition: packed_rrset.h:80
static int reply_has_nsec(struct reply_info *rep)
see if the reply has NSEC records worthy of caching
Definition: val_neg.c:577
int autr_permit_small_holddown
debug and enable small timeouts
Definition: config_file.c:78
int fptr_whitelist_serve_expired_lookup(serve_expired_lookup_func_type *fptr)
Check function pointer whitelist for serve_expired_lookup func values.
Definition: fptr_wlist.c:680
int harden_algo_downgrade
harden against algorithm downgrade
Definition: config_file.h:260
void alloc_stats(struct alloc_cache *alloc)
Print debug information (statistics).
Definition: alloc.c:304
static void readinput(rbtree_type *all, char *file)
read input file
Definition: lock_verify.c:259
int fptr_whitelist_comm_timer(void(*fptr)(void *))
Check function pointer whitelist for comm_timer callback values.
Definition: fptr_wlist.c:127
int next_querynum
next query number (to try) to use
Definition: context.h:129
void delegpt_mark_neg(struct delegpt_ns *ns, uint16_t qtype)
Mark negative return in delegation point for specific nameserver.
Definition: iter_delegpt.c:485
static struct replay_scenario * make_scenario(char *line)
makes scenario with title on rest of line
Definition: replay.c:417
void(* delfunc)(void *, void *)
External function to delete elem.
Definition: addrtree.h:79
static int iter_filter_unsuitable(struct iter_env *iter_env, struct module_env *env, uint8_t *name, size_t namelen, uint16_t qtype, time_t now, struct delegpt_addr *a)
filter out unsuitable targets
Definition: iter_utils.c:226
int bogus_ttl
this value sets the number of seconds before revalidating bogus
Definition: config_file.h:352
static void serviced_tcp_initiate(struct serviced_query *sq, sldns_buffer *buff)
initiate TCP transaction for serviced query
Definition: outside_network.c:1886
int secalgo_nsec3_hash(int algo, unsigned char *buf, size_t len, unsigned char *res)
Hash a single hash call of an NSEC3 hash algorithm.
SSL * ssl
the SSL for TLS streams
Definition: unbound-dnstap-socket.c:111
long long mesh_dropped
mesh stats: number of incoming queries dropped
Definition: unbound.h:812
int lim
ratelimit for exact match with this name, -1 if not set
Definition: infra.h:135
int iter_get_next_root(struct iter_hints *hints, struct iter_forwards *fwd, uint16_t *c)
Lookup next root-hint or root-forward entry.
Definition: iter_utils.c:1224
static hashvalue_type myhash(int id)
hash func, very bad to improve collisions, both high and low bits
Definition: unitslabhash.c:56
@ repevt_timeout
timeout
Definition: replay.h:198
static const char * repevt_string(enum replay_event_type t)
Returns a string describing the event type.
Definition: fake_event.c:152
int rrsetdata_equal(struct packed_rrset_data *d1, struct packed_rrset_data *d2)
compare two rrset data structures.
Definition: packed_rrset.c:146
Query service record.
Definition: outside_network.h:326
uint8_t * taglist
tag bitlist
Definition: respip.h:39
replay_event_type
what happens this moment?
Definition: replay.h:190
int name_tree_next_root(rbtree_type *tree, uint16_t *dclass)
Find next root item in name tree.
Definition: dnstree.c:255
static int auth_zone_write_chunks(struct auth_xfer *xfr, const char *fname)
write http chunks to zonefile to create downloaded file
Definition: authzone.c:4878
struct daemon_remote * daemon_remote_create(struct config_file *cfg)
Create new remote control state for the daemon.
Definition: remote.c:198
static void read_create(rbtree_type *all, FILE *in)
read creation entry
Definition: lock_verify.c:184
int mesh_make_new_space(struct mesh_area *mesh, sldns_buffer *qbuf)
Make space for another recursion state for a reply in the mesh.
Definition: mesh.c:323
static int dtio_check_close(struct dt_io_thread *dtio)
check if the output fd has been closed, it returns false if the stream is closed.
Definition: dtstream.c:976
void libworker_enter_result(struct ub_result *res, struct sldns_buffer *buf, struct regional *temp, enum sec_status msg_security)
fill result from parsed message, on error fills servfail
Definition: libworker.c:495
int caps_fallback
state for 0x20 fallback when capsfail happens, 0 not a fallback
Definition: iterator.h:286
int testcount
number of tests done
Definition: unitmain.c:70
void delegpt_add_neg_msg(struct delegpt *dp, struct msgreply_entry *msg)
Add negative message to delegation point.
Definition: iter_delegpt.c:497
void comm_base_handle_slow_accept(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
@ LDNS_RR_CLASS_CH
Chaos class.
Definition: rrdef.h:54
enum verbosity_value verbosity
The global verbosity setting.
Definition: log.c:64
static ssize_t receive_bytes(struct tap_data *data, int fd, void *buf, size_t len)
receive bytes from fd, prints errors if bad, returns 0: closed/error, -1: continue,...
Definition: unbound-dnstap-socket.c:643
static void rr_test_file(const char *input, const char *check)
read rrs to and from string, and wireformat Skips empty lines and comments.
Definition: unitldns.c:142
rbnode_type pnode
rbtree node for probe sort, key is struct trust_anchor
Definition: autotrust.h:94
struct rrset_ref ref[1]
Packed array of ids (see counts) and pointers to packed_rrset_key.
Definition: msgreply.h:211
uint8_t * rr
the RR
Definition: autotrust.h:71
size_t rrset_cache_slabs
slabs in the rrset cache
Definition: config_file.h:160
size_t addrtree_size(const struct addrtree *tree)
Size of tree in bytes.
Definition: addrtree.c:270
static void dtio_control_stop_flush(struct dt_io_thread *dtio)
flush at end, last packet and stop control
Definition: dtstream.c:1698
@ local_zone_noview
answer not from the view, but global or no-answer
Definition: localzone.h:100
int mesh_state_ref_compare(const void *ap, const void *bp)
compare two mesh references
Definition: mesh.c:234
struct auth_addr * scan_addr
if not NULL, the specific addr for the current master
Definition: authzone.h:336
void mesh_stats_clear(struct mesh_area *mesh)
Clear the stats that the mesh keeps (number of queries serviced)
Definition: mesh.c:1751
size_t num_tcp_outgoing
number of tcp communication points in use.
Definition: outside_network.h:156
size_t slabhash_get_mem(struct slabhash *sl)
Retrieve slab hash current memory use.
Definition: slabhash.c:169
int slabhash_is_size(struct slabhash *table, size_t size, size_t slabs)
See if slabhash is of given (size, slabs) configuration.
Definition: slabhash.c:156
int val_nsec_proves_positive_wildcard(struct ub_packed_rrset_key *nsec, struct query_info *qinf, uint8_t *wc)
Determine if the given NSEC proves a positive wildcard response.
Definition: val_nsec.c:490
char * errinf_to_str_bogus(struct module_qstate *qstate)
Create error info in string.
Definition: config_file.c:2424
static size_t if_get_mem(struct port_if *pif)
get memory used by port if
Definition: outside_network.c:2466
int ub_resolve_event(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, void *mydata, ub_event_callback_type callback, int *async_id)
Perform resolution and validation of the target name.
Definition: libunbound.c:724
int namelabs
number of labels in zone name
Definition: authzone.h:211
static int parse_comments(char *str, struct autr_ta *ta)
Parse comments.
Definition: autotrust.c:166
static int timeval_smaller(const struct timeval *x, const struct timeval *y)
compare of time values
Definition: replay.c:71
@ LDNS_RR_CLASS_ANY
Any class.
Definition: rrdef.h:60
void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size)
creates a buffer with the specified data.
Definition: sbuffer.c:44
static int setup_comm_ssl(struct comm_point *cp, struct outside_network *outnet, int fd, char *host)
setup SSL for comm point
Definition: outside_network.c:2289
int name_tree_insert(rbtree_type *tree, struct name_tree_node *node, uint8_t *name, size_t len, int labs, uint16_t dclass)
insert element into name tree.
Definition: dnstree.c:84
static void print_rrset(struct ub_packed_rrset_key *rrset)
print packed rrset
Definition: unitmsgparse.c:237
void outbound_list_init(struct outbound_list *list)
Init the user allocated outbound list structure.
Definition: outbound_list.c:48
static int read_fetch_policy(struct iter_env *ie, const char *str)
Read config string that represents the target fetch policy.
Definition: iter_utils.c:91
int ub_c_lex(void)
the lexer function
key for ratelimit lookups, a domain name
Definition: infra.h:143
uint16_t calc_edns_field_size(struct edns_data *edns)
Estimate size of EDNS record in packet.
Definition: msgencode.c:788
int dname_is_root(uint8_t *dname)
Returns true if the uncompressed wireformat dname is the root ".".
Definition: dname.c:718
int edns_opt_list_append(struct edns_option **list, uint16_t code, size_t len, uint8_t *data, struct regional *region)
Append edns option to edns option list.
Definition: msgreply.c:974
gid_t cfg_gid
from cfg username, after daemonize setup performed
Definition: config_file.c:76
struct listen_port * listening_ports_open(struct config_file *cfg, int *reuseport)
Create shared listening ports Getaddrinfo, create socket, bind and listen to zero or more interfaces ...
Definition: listen_dnsport.c:1443
void dt_io_thread_delete(struct dt_io_thread *dtio)
Delete the IO thread structure.
Definition: dtstream.c:234
size_t num_quar
number of items in quarantine.
Definition: alloc.h:80
int edns_present
if EDNS OPT record was present
Definition: msgparse.h:217
int nsec_proves_nodata(struct ub_packed_rrset_key *nsec, struct query_info *qinfo, uint8_t **wc)
Determine if a NSEC proves the NOERROR/NODATA conditions.
Definition: val_nsec.c:289
void delegpt_no_ipv4(struct delegpt *dp)
Register the fact that there is no ipv4 and thus As are not going to be queried for or be useful.
Definition: iter_delegpt.c:520
void libworker_bg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus, int was_ratelimited)
mesh callback with bg results
Definition: libworker.c:762
int sldns_wire2str_rdata_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len, uint16_t rrtype, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat rdata to string, with user buffers.
Definition: wire2str.c:703
time_t now_secs
the current time in seconds
Definition: replay.h:302
static int perform_data_add(RES *ssl, struct local_zones *zones, char *arg)
Add new RR data.
Definition: remote.c:1301
uint8_t copy_id
how to adjust the reply packet
Definition: testpkts.h:205
static int key_entry_setup(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, struct key_entry_key **k, struct key_entry_data **d)
setup key entry in region
Definition: val_kentry.c:256
static const char * secure_str(struct ub_result *result)
nice security status string
Definition: unbound-host.c:219
enum sec_status msg_security
validation status on security
Definition: context.h:170
size_t namelen
length of name
Definition: val_anchor.h:102
struct config_strlist * local_zones_nodefault
local zones nodefault list
Definition: config_file.h:397
char * macro_process(rbtree_type *store, struct replay_runtime *runtime, char *text)
Apply macro substitution to string.
Definition: replay.c:865
mesh_list_select
if this state is in the forever list, jostle list, or neither
Definition: mesh.h:193
int views_apply_cfg(struct views *vs, struct config_file *cfg)
Apply config settings; Takes care of locking.
Definition: view.c:144
int thread_num
the thread number (in daemon array).
Definition: worker.h:84
static int http_header_done(sldns_buffer *buf)
return true if http header has been read (one line complete)
Definition: netevent.c:1940
struct ub_event_base_vmt * vmt
Virtual Method Table for ub_event_base.
Definition: unbound-event.h:119
@ LDNS_RR_TYPE_MB
a mailbox domain name (EXPERIMENTAL)
Definition: rrdef.h:97
int sldns_wire2str_rcode_print(char **str, size_t *str_len, int rcode)
Print host format rcode to string.
Definition: wire2str.c:871
static struct ub_packed_rrset_key * neg_nsec3_getnc(struct val_neg_zone *zone, uint8_t *hashnc, size_t nclen, struct rrset_cache *rrset_cache, struct regional *region, time_t now, uint8_t *b32, size_t maxb32)
get next closer for nsec3 proof
Definition: val_neg.c:1316
static void store_rrset(sldns_buffer *pkt, struct msg_parse *msg, struct module_env *env, struct rrset_parse *rrset)
Store potential poison in the cache (only if hardening disabled).
Definition: iter_scrub.c:617
void server_stats_prefetch(struct ub_server_stats *stats, struct worker *worker)
add query if was cached and also resulted in a prefetch
Definition: stats.c:101
void macro_print_debug(rbtree_type *store)
Print macro variables stored as debug info.
Definition: replay.c:900
size_t ipsecmod_whitelist_get_mem(rbtree_type *whitelist)
Get memory used by ipsecmod whitelist.
static int dnscrypt_server_uncurve(struct dnsc_env *env, const dnsccert *cert, uint8_t client_nonce[crypto_box_HALF_NONCEBYTES], uint8_t nmkey[crypto_box_BEFORENMBYTES], struct sldns_buffer *buffer)
Decrypt a query using the dnsccert that was found using dnsc_find_cert.
Definition: dnscrypt.c:244
static void dname_test_removelabel(void)
test dname_remove_label
Definition: unitdname.c:461
unsigned int packet_sleep
seconds to sleep before giving packet
Definition: testpkts.h:161
void dname_remove_label(uint8_t **dname, size_t *len)
Snip off first label from a dname, returning the parent zone.
Definition: dname.c:728
static hashvalue_type myhash(int id)
hash func, very bad to improve collisions
Definition: unitlruhash.c:59
struct config_str2list * respip_actions
predefined actions for particular IP address responses
Definition: config_file.h:713
struct ub_event * ev
ub_event event type
Definition: netevent.c:108
void rrset_array_unlock_touch(struct rrset_cache *r, struct regional *scratch, struct rrset_ref *ref, size_t count)
Unlock array (sorted) of rrset references and at the same time touch LRU on the rrsets.
Definition: rrset.c:337
static int msg_grow_array(struct regional *region, struct dns_msg *msg)
grow rrset array by one in msg
Definition: authzone.c:138
void ub_rrset_key_delete(void *key, void *userdata)
Old key to be deleted.
Definition: packed_rrset.c:128
auth zone master zone transfer data chunk
Definition: authzone.h:455
static void replay_moment_delete(struct replay_moment *mom)
delete moment
Definition: replay.c:103
struct ub_packed_rrset_key * rrset_cache_lookup(struct rrset_cache *r, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint32_t flags, time_t timenow, int wr)
Lookup rrset.
Definition: rrset.c:275
static void dtio_close_fd(struct dt_io_thread *dtio)
close dtio socket and set it to -1
Definition: dtstream.c:588
void ipsecmod_whitelist_delete(rbtree_type *whitelist)
Delete the ipsecmod whitelist.
int extended
Extended stats below (bool)
Definition: unbound.h:682
The Virtual Method Table for and ub_event_base "object".
Definition: unbound-event.h:87
int subnetmod_init(struct module_env *env, int id)
subnet module init
int sldns_str2wire_wks_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_WKS from string to wireformat.
Definition: str2wire.c:1704
int key_entry_isnull(struct key_entry_key *kkey)
See if this is a null entry.
Definition: val_kentry.c:220
int comm_timer_is_set(struct comm_timer *timer)
see if timeout has been set to a value.
Definition: netevent.c:3358
size_t nsec3_max_iter
max nsec3 iterations allowed
Definition: val_neg.h:82
struct module_func_block * module_factory(const char **str)
Get funcblock for module name.
Definition: modstack.c:203
static int dtio_write_more(struct dt_io_thread *dtio)
write more of the current messsage.
Definition: dtstream.c:873
void * regional_alloc_init(struct regional *r, const void *init, size_t size)
Allocate size bytes of memory inside regional and copy INIT into it.
Definition: regional.c:162
void alloc_init(struct alloc_cache *alloc, struct alloc_cache *super, int thread_num)
Init alloc (zeroes the struct).
Definition: alloc.c:103
void view_delete(struct view *v)
Delete one view.
Definition: view.c:74
void rrset_cache_delete(struct rrset_cache *r)
Delete rrset cache.
Definition: rrset.c:73
enum sec_status val_verify_DNSKEY_with_DS(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ds_rrset, uint8_t *sigalg, char **reason, struct module_qstate *qstate)
Verify DNSKEYs with DS rrset.
Definition: val_utils.c:483
@ rrset_trust_add_noAA
Additional information from non-authoritative answers.
Definition: packed_rrset.h:144
size_t nsec3_get_hashed(sldns_buffer *buf, uint8_t *nm, size_t nmlen, int algo, size_t iter, uint8_t *salt, size_t saltlen, uint8_t *res, size_t max)
Get NSEC3 hashed in a buffer.
Definition: val_nsec3.c:536
static void test_short_table(struct lruhash *table)
test hashtable using short sequence
Definition: unitlruhash.c:209
void timehist_delete(struct timehist *hist)
Delete histogram.
Definition: timehist.c:102
hashvalue_type rrset_key_hash(struct packed_rrset_key *key)
Calculate hash value for a packed rrset key.
Definition: packed_rrset.c:163
int fptr_whitelist_modenv_attach_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq))
Check function pointer whitelist for module_env attach_sub callback values.
Definition: fptr_wlist.c:354
int sldns_wire2str_edns_ul_print(char **str, size_t *str_len, uint8_t *option_data, size_t option_len)
Print EDNS UL option data to string.
Definition: wire2str.c:1782
int isfirst
Fallback to global local_zones when there is no match in the view specific tree.
Definition: view.h:79
struct auth_master * master
the zone transfer in progress (or NULL if in scan).
Definition: authzone.h:388
int reconnect_is_added
if the reconnect timer is added to the event base
Definition: dtstream.h:183
static void warn_hosts(const char *typ, struct config_stub *list)
emit warnings for IP in hosts
Definition: unbound-checkconf.c:310
size_t respip_get_mem(struct module_env *env, int id)
response-ip alloc size routine
Definition: respip.c:1264
static int service_cmdline_verbose
commandline verbosity.
Definition: win_svc.c:70
struct ub_event * ev
the event for it
Definition: unbound-dnstap-socket.c:145
static size_t sumtrees_all(struct val_neg_cache *neg)
sum up the zone trees
Definition: unitneg.c:310
char * sldns_strip_ws(char *line)
Strip whitespace from the start and the end of line.
Definition: str2wire.c:849
static char * do_macro_ctime(char *arg)
do ctime macro on argument
Definition: replay.c:687
size_t outgoing_num_tcp
number of outgoing tcp buffers per (per thread)
Definition: config_file.h:137
int tcl_list_apply_cfg(struct tcl_list *tcl, struct config_file *cfg)
Process TCP connection limit config.
Definition: tcp_conn_limit.c:144
size_t dname_valid(uint8_t *dname, size_t len)
Determine if dname in memory is correct.
Definition: dname.c:74
struct config_str3list * local_zone_overrides
local zone override types per netblock
Definition: config_file.h:407
#define S_UNSIGNED_OR_ZERO(str, var)
put integer_or_zero into unsigned
Definition: config_file.c:403
void ldns_test(void)
unit test for ldns functions
Definition: unitldns.c:224
int cfg_mark_ports(const char *str, int allow, int *avail, int num)
Mark "number" or "low-high" as available or not in ports array.
Definition: config_file.c:1545
Iterator hints for a particular stub.
Definition: iter_hints.h:68
static int az_generate_dname_answer(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg *msg, struct auth_data *ce, struct auth_rrset *rrset)
generate answer for DNAME answer
Definition: authzone.c:3028
int dname_count_size_labels(uint8_t *dname, size_t *size)
Count labels and dname length both, for uncompressed dname in memory.
Definition: dname.c:446
comm_point_type
is this a UDP, TCP-accept or TCP socket.
Definition: netevent.h:225
size_t packed_rrset_sizeof(struct packed_rrset_data *data)
Memory size of rrset data.
Definition: packed_rrset.c:80
@ LDNS_RR_TYPE_SSHFP
SSH Key Fingerprint.
Definition: rrdef.h:171
@ repevt_nothing
nothing happens, as if this event is not there.
Definition: replay.h:192
static void log_pkt(const char *desc, uint8_t *pkt, size_t len)
helper function that logs a sldns_pkt packet to logfile
Definition: fake_event.c:137
struct mesh_reply * next
next in reply list
Definition: mesh.h:218
#define MAX_RESTART_COUNT
max number of query restarts.
Definition: iterator.h:64
int delegpt_add_addr(struct delegpt *dp, struct regional *regional, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name, int *additions)
Add address to the delegation point.
Definition: iter_delegpt.c:184
static int set_recvpktinfo(int s, int family)
set fd to receive source address packet info
Definition: listen_dnsport.c:1112
static int ssl_print_name_dp(RES *ssl, const char *str, uint8_t *nm, uint16_t dclass, struct delegpt *dp)
printout a delegation point info
Definition: remote.c:1941
static void waiting_list_remove(struct outside_network *outnet, struct waiting_tcp *w)
remove waiting tcp from the outnet waiting list
Definition: outside_network.c:1491
@ LDNS_RDF_TYPE_TAG
A non-zero sequence of US-ASCII letters and numbers in lower case.
Definition: rrdef.h:344
struct daemon_remote * rc
the rc this is part of
Definition: remote.h:79
int srtt
smoothed rtt estimator, in milliseconds
Definition: rtt.h:51
void attach_edns_record(sldns_buffer *pkt, struct edns_data *edns)
Attach EDNS record to buffer.
Definition: msgencode.c:802
void libworker_delete_event(struct libworker *w)
delete worker for event-based interface.
Definition: libworker.c:121
int line
line number in the file, starts at 1
Definition: config_file.h:1205
static void testfromfile(sldns_buffer *pkt, struct alloc_cache *alloc, sldns_buffer *out, const char *fname)
simple test of parsing, pcat file
Definition: unitmsgparse.c:440
static char * skipwhite(char *str)
skip whitespace, return new pointer into string
Definition: remote.c:662
char * config_collate_cat(struct config_strlist *list)
take a strlist_head list and return a malloc string.
Definition: config_file.c:802
int RRSET_ROUNDROBIN
rrset order roundrobin: default is yes
Definition: net_help.c:74
uint8_t * str2
second bytestring
Definition: config_file.h:764
size_t io_num
number of I/O ports
Definition: perf.c:110
static void process_keys(int argc, char *argv[])
process keys and signit
Definition: signit.c:218
static struct replay_scenario * saved_scenario
Global variable: the scenario.
Definition: fake_event.c:94
static int verify_dnskey(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *rrset, struct module_qstate *qstate)
Verify if dnskey works for trust point.
Definition: autotrust.c:1251
static void print_packet_rrsets(struct query_info *qinfo, struct reply_info *rep)
debug print a packet that failed
Definition: unitmsgparse.c:253
struct config_view * views
the views definitions, linked list
Definition: config_file.h:216
void dns64_clear(struct module_qstate *qstate, int id)
Clear module-specific data from query state.
Definition: dns64.c:996
struct views * views
views structure containing view tree
Definition: daemon.h:125
void auth_xfer_pickup_initial(struct auth_zones *az, struct module_env *env)
initial pick up of worker timeouts, ties events to worker event loop
Definition: authzone.c:6655
size_t * rr_len
length of every rr's rdata, rr_len[i] is size of rr_data[i].
Definition: packed_rrset.h:248
static int check_dates(struct val_env *ve, uint32_t unow, uint8_t *expi_p, uint8_t *incep_p, char **reason)
check rrsig dates
Definition: val_sigcrypt.c:1268
static void do_zone_remove(RES *ssl, struct local_zones *zones, char *arg)
Do the local_zone_remove command.
Definition: remote.c:1273
enum val_classification subtype
subtype
Definition: validator.h:211
int iter_state_is_responsestate(enum iter_state s)
See if iterator state is a response state.
Definition: iterator.c:3982
int fptr_whitelist_inplace_cb_reply_generic(inplace_cb_reply_func_type *fptr, enum inplace_cb_list_type type)
Check function pointer whitelist for inplace_cb_reply, inplace_cb_reply_cache, inplace_cb_reply_local...
Definition: fptr_wlist.c:592
enum sec_status nsec3_prove_nods(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey, char **reason, struct module_qstate *qstate)
Prove that a DS response either had no DS, or wasn't a delegation point.
Definition: val_nsec3.c:1317
int dnskey_get_algo(struct ub_packed_rrset_key *k, size_t idx)
Get DNSKEY RR signature algorithm.
Definition: val_sigcrypt.c:178
static int ring_empty(struct ringbuf *r)
see if the ringbuffer is empty
Definition: delayer.c:287
uint8_t * sldns_wirerr_get_rdata(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata pointer of the RR.
Definition: str2wire.c:826
int xfer_set_masters(struct auth_master **list, struct config_auth *c, int with_http)
Set masters in auth xfer structure from config.
Definition: authzone.c:6917
struct comm_point * listen_com
listen commpoint
Definition: tube.h:71
#define NETEVENT_CAPSFAIL
to pass fallback from capsforID to callback function; 0x20 failed
Definition: netevent.h:87
int cancel
true if cancelled
Definition: asynclook.c:74
#define LDNS_MAX_DOMAINLEN
Maximum length of a complete dname.
Definition: rrdef.h:29
static int prime_trust_anchor(struct module_qstate *qstate, struct val_qstate *vq, int id, struct trust_anchor *toprime)
Prime trust anchor for use.
Definition: validator.c:532
uint8_t pending_count
pending count
Definition: autotrust.h:79
struct module_qstate * qstate
Module qstate.
Definition: pythonmod.c:103
INLINE int sldns_buffer_status(sldns_buffer *buffer)
returns the status of the buffer
Definition: sbuffer.h:703
void(* deinit)(struct module_env *env, int id)
de-init, delete, the module.
Definition: module.h:689
TCP request info.
Definition: listen_dnsport.h:246
struct sockaddr_storage addr
the host address.
Definition: infra.h:60
static int az_parse_file(struct auth_zone *z, FILE *in, uint8_t *rr, size_t rrbuflen, struct sldns_file_parse_state *state, char *fname, int depth, struct config_file *cfg)
Parse zonefile.
Definition: authzone.c:1471
@ UB_FORKFAIL
fork() failed
Definition: context.h:195
long long rpz_action[UB_STATS_RPZ_ACTION_NUM]
RPZ action stats.
Definition: unbound.h:793
const char * val_classification_to_string(enum val_classification subtype)
Get string to denote the classification result.
Definition: val_utils.c:1062
int main(int argc, char **argv)
main program to create queries, pass the number of them.
Definition: makeqs.c:8
int harden_referral_path
harden the referral path, query for NS,A,AAAA and validate
Definition: config_file.h:258
int val_clean_additional
should validator clean additional section for secure msgs
Definition: config_file.h:354
char * data
current chunk data position.
Definition: regional.h:76
struct reply_info * construct_reply_info_base(struct regional *region, uint16_t flags, size_t qd, time_t ttl, time_t prettl, time_t expttl, size_t an, size_t ns, size_t ar, size_t total, enum sec_status sec)
Constructor for replyinfo.
Definition: msgreply.c:93
int cfg_count_numbers(const char *s)
Count number of values in the string.
Definition: config_file.c:1833
static int has_additional(uint16_t t)
return true if rr type has additional names in it
Definition: iter_scrub.c:91
static void do_data_add(RES *ssl, struct local_zones *zones, char *arg)
Do the local_data command.
Definition: remote.c:1312
static enum module_ext_state handle_event_pass(struct module_qstate *qstate, int id)
Handles the "pass" event for a query.
Definition: dns64.c:568
size_t cursize
current size of the buffer, in bytes.
Definition: dtstream.h:70
int fd_set_block(int s)
Set fd (back to) blocking.
Definition: net_help.c:145
struct config_stub * forwards
the forward zone definitions, linked list
Definition: config_file.h:212
static void swap_int8(uint8_t *x, uint8_t *y)
helpers for delete: swap node colours
Definition: rbtree.c:293
@ LDNS_RR_TYPE_NINFO
draft-reid-dnsext-zs
Definition: rrdef.h:189
static int rrinternal_spool_hex(char *token, uint8_t *rr, size_t rr_len, size_t rr_cur_len, size_t *cur_hex_data_size, size_t hex_data_size)
spool hex data into rdata
Definition: str2wire.c:391
struct serviced_query * qsent
The query that was sent out.
Definition: outbound_list.h:67
void slabhash_remove(struct slabhash *table, hashvalue_type hash, void *key)
Remove entry from hashtable.
Definition: slabhash.c:128
struct mesh_state * next
next in linked list for reply states
Definition: mesh.h:191
static void dname_test_isroot(void)
test dname_is_root
Definition: unitdname.c:448
uint8_t match_all
match all of the packet
Definition: testpkts.h:186
static int lz_enter_zones(struct local_zones *zones, struct config_file *cfg)
parse local-zone: statements
Definition: localzone.c:701
static int cron_was_quick
if cron has already done its quick check
Definition: win_svc.c:76
int cfg_strlist_append_ex(struct config_strlist **head, char *item)
Searches the end of a string list and appends the given text.
Definition: config_file.c:1725
static int nth_rtt(struct delegpt_addr *result_list, size_t num_results, size_t n)
get RTT for the Nth fastest server
Definition: iter_utils.c:326
void addr_tree_init_parents_node(struct addr_tree_node *node)
Initialize parent pointers in partial addr tree.
Definition: dnstree.c:107
The probe task.
Definition: authzone.h:309
static void acl_view_tag_checks(struct config_file *cfg, struct views *views)
checks for acl and views
Definition: unbound-checkconf.c:200
struct replay_runtime * runtime
the runtime structure this is part of
Definition: replay.h:383
struct comm_base * comm_base_create(int sigs)
Create a new comm base.
Definition: netevent.c:160
void * fstrm_create_control_frame_ready(char *contenttype, size_t *len)
This creates an FSTRM control frame of type READY.
Definition: dnstap_fstrm.c:95
static struct auth_rrset * rrset_create(struct auth_data *node, uint16_t rr_type, uint32_t rr_ttl, uint8_t *rdata, size_t rdatalen)
Create new rrset for node with packed rrset with one RR element.
Definition: authzone.c:860
void server_stats_insrcode(struct ub_server_stats *stats, struct sldns_buffer *buf)
Add rcode for this query.
Definition: stats.c:514
@ LDNS_RR_TYPE_HINFO
host information
Definition: rrdef.h:109
int edns_bypass_cache_stage(struct edns_option *list, struct module_env *env)
Check if an edns option needs to bypass the reply from cache stage.
Definition: module.c:194
size_t res_write
are we currently writing a result, 0 if not, else bytecount into the res_list first entry.
Definition: tube.h:87
struct query_info qinfo_out
The query info that is sent upstream.
Definition: iterator.h:391
int nsec3_hash_cmp(const void *c1, const void *c2)
Rbtree for hash cache comparison function.
Definition: val_nsec3.c:496
struct lruhash_entry entry
hash table entry, data of type infra_data.
Definition: infra.h:68
struct serviced_query * outnet_serviced_query(struct outside_network *outnet, struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, int tcp_upstream, int ssl_upstream, char *tls_auth_name, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct module_qstate *qstate, comm_point_callback_type *callback, void *callback_arg, struct sldns_buffer *buff, struct module_env *env)
Perform a serviced query to the authoritative servers.
Definition: outside_network.c:2104
static void dstest_entry(struct entry *e, struct alloc_cache *alloc, struct regional *region, sldns_buffer *pkt, struct module_env *env)
DS sig test an entry - get DNSKEY and DS in entry and verify.
Definition: unitverify.c:245
long long qtype[UB_STATS_QTYPE_NUM]
qtype stats
Definition: unbound.h:685
char * fname_after_chroot(const char *fname, struct config_file *cfg, int use_chdir)
Convert a filename to full pathname in original filesys.
Definition: config_file.c:2116
uint16_t dclass
the class of this zone, in host byteorder.
Definition: authzone.h:108
static void testadd_unlim(struct lruhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitlruhash.c:313
static void matchline(char *line, struct entry *e)
parse MATCH line
Definition: testpkts.c:111
int sldns_parse_char(uint8_t *ch_p, const char **str_p)
Parse one character, with escape codes,.
Definition: parseutil.c:318
static int acl_list_tags_cfg(struct acl_list *acl, const char *str, uint8_t *bitmap, size_t bitmaplen)
apply acl_tag string
Definition: acl_list.c:160
struct mesh_cb * cb_list
the list of callbacks for the results
Definition: mesh.h:178
void rrset_markdel(void *key)
mark rrset to be deleted, set id=0
Definition: rrset.c:53
struct edns_option * edns_opt_list_find(struct edns_option *list, uint16_t code)
Find edns option in edns list.
Definition: msgreply.c:1251
int local_zones_apply_cfg(struct local_zones *zones, struct config_file *cfg)
Apply config settings; setup the local authoritative data.
Definition: localzone.c:1052
int no_aggregation
whether the option needs mesh aggregation
Definition: module.h:221
void mesh_delete(struct mesh_area *mesh)
Delete mesh, and all query states and replies in it.
Definition: mesh.c:291
static void waitforubanchor(PROCESS_INFORMATION *pinfo)
wait for unbound-anchor process to finish
Definition: win_svc.c:237
static int generate_sub_request(uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct module_qstate *qstate, int id, struct iter_qstate *iq, enum iter_state initial_state, enum iter_state finalstate, struct module_qstate **subq_ret, int v, int detached)
Generate a subrequest.
Definition: iterator.c:680
int auth_zones_lookup(struct auth_zones *az, struct query_info *qinfo, struct regional *region, struct dns_msg **msg, int *fallback, uint8_t *dp_nm, size_t dp_nmlen)
Use auth zones to lookup the answer to a query.
Definition: authzone.c:3240
size_t max_udp_size
max udp size for udp packets
Definition: netevent.h:143
int sldns_wire2str_opcode_buf(int opcode, char *str, size_t len)
Convert host format opcode to a string.
Definition: wire2str.c:305
char * regional_strdup(struct regional *r, const char *string)
Duplicate string and allocate the result in regional.
Definition: regional.c:180
int ub_rrset_compare(void *k1, void *k2)
compares two rrset keys.
Definition: packed_rrset.c:95
int fptr_whitelist_mesh_cb(mesh_cb_func_type fptr)
Check function pointer whitelist for mesh state callback values.
Definition: fptr_wlist.c:573
int auth_xfer_transfer_tcp_callback(struct comm_point *c, void *arg, int err, struct comm_reply *repinfo)
callback for task_transfer tcp connections
static struct lruhash_entry * dnsc_shared_secrets_lookup(struct slabhash *cache, uint8_t key[DNSCRYPT_SHARED_SECRET_KEY_LENGTH], uint32_t hash)
Lookup a record in shared_secrets_cache.
Definition: dnscrypt.c:143
int ip_freebind
IP_FREEBIND socket option request on port 53 sockets.
Definition: config_file.h:192
void comm_point_udp_ancil_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:583
int dt_io_thread_start(struct dt_io_thread *dtio, void *event_base_nothr, int numworkers)
Start the io thread.
Definition: dtstream.c:2054
static void dtio_desetup(struct dt_io_thread *dtio)
perform desetup and free stuff when the dnstap io thread exits
Definition: dtstream.c:1789
int fd
file descriptor
Definition: remote.h:77
uint16_t sldns_wirerr_get_type(uint8_t *rr, size_t len, size_t dname_len)
Get the type of the RR.
Definition: str2wire.c:798
size_t tcl_list_get_mem(struct tcl_list *tcl)
Get memory used by TCP connection limit structure.
Definition: tcp_conn_limit.c:190
static int go(const char *cfgfile, char *svr, int quiet, int argc, char *argv[])
go ahead and read config, contact server and perform command and display
Definition: unbound-control.c:800
void listen_sslctx_delete_ticket_keys(void)
Free memory used for TLS session ticket keys.
Definition: net_help.c:1541
void respip_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
inform response-ip super
Definition: respip.c:1223
uint8_t * name
name of nameserver
Definition: iter_delegpt.h:99
static int reply_with_accept(struct tap_data *data)
reply with ACCEPT control frame to bidirectional client, returns 0 on error
Definition: unbound-dnstap-socket.c:773
void rate_deldatafunc(void *d, void *arg)
delete data
A key entry for the validator.
Definition: val_kentry.h:55
#define EDNS_DO
bits for EDNS bitfield
Definition: net_help.h:86
sldns_rr_type _type
Type of the RR that is described here.
Definition: rrdef.h:452
int local_zone_enter_rr(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs, uint16_t rrtype, uint16_t rrclass, time_t ttl, uint8_t *rdata, size_t rdata_len, const char *rrstr)
Add RR to local zone.
Definition: localzone.c:467
static int val_apply_cfg(struct module_env *env, struct val_env *val_env, struct config_file *cfg)
apply config settings to validator
Definition: validator.c:113
static void init_parents(struct local_zones *zones)
setup parent pointers, so that a lookup can be done for closest match
Definition: localzone.c:893
int zone_deleted
zone has been deleted
Definition: authzone.h:138
Inplace callback list of registered routines to be called.
Definition: module.h:227
struct addredge * edge[2]
A node can have 0-2 edges, set to NULL for unused.
Definition: addrtree.h:99
uint8_t match_subdomain
match qname as subdomain of answer qname
Definition: testpkts.h:182
struct th_buck * buckets
bucket array
Definition: timehist.h:67
int fd_set_block(int s)
Set fd (back to) blocking.
Definition: net_help.c:145
size_t delegpt_count_missing_targets(struct delegpt *dp)
Count number of missing targets.
Definition: iter_delegpt.c:326
static int chunk_rrlist_end(struct auth_chunk *rr_chunk, int rr_num)
RR list iterator, see if we are at the end of the list.
Definition: authzone.c:4426
struct sockaddr_storage addr
address that must be matched, or packet remote host address.
Definition: replay.h:228
int is_bidirectional
Perform bidirectional Frame Streams handshake before sending messages.
Definition: dtstream.h:200
size_t rr_scan_num
number of RRs scanned for AXFR/IXFR detection
Definition: authzone.h:404
static int service_stop_shutdown
if stop even means shutdown or restart
Definition: win_svc.c:66
int reply_check_cname_chain(struct query_info *qinfo, struct reply_info *rep)
Check if cname chain in cached reply is still valid.
Definition: msgreply.c:890
#define FSTRM_CONTROL_FRAME_FINISH
control frame value to denote the control frame FINISH
Definition: dnstap_fstrm.h:108
int cfg_str3list_insert(struct config_str3list **head, char *item, char *i2, char *i3)
Insert string into str3list.
Definition: config_file.c:1772
static void testlookup_unlim(struct lruhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitlruhash.c:338
static int verb
verbose?
Definition: lock_verify.c:104
static uint32_t get_serial(uint8_t *p, size_t plen)
get authority section SOA serial value
Definition: testpkts.c:766
int delegpt_set_name_mlc(struct delegpt *dp, uint8_t *name)
Set name of delegation point.
Definition: iter_delegpt.c:571
static int pending_matches_range(struct replay_runtime *runtime, struct entry **entry, struct fake_pending **pend)
See if outgoing pending query matches an entry.
Definition: fake_event.c:268
int ssl_brief_read
true if briefly the SSL wants a read event, 0 if not.
Definition: dtstream.h:153
rbnode_type node
node in rbtree for set, key is this structure
Definition: mesh.h:208
int sldns_wire2str_aaaa_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat ip6 AAAA field to string, with user buffers.
Definition: wire2str.c:1104
static BIO * https(struct ip_list *ip_list, const char *pathname, const char *urlname, struct ip_list *src, int use_sni)
Do a HTTPS, HTTP1.1 over TLS, to fetch a file.
Definition: unbound-anchor.c:1170
@ LDNS_RR_TYPE_AAAA
ipv6 address
Definition: rrdef.h:139
static void authzone_compare_serial(void)
Test authzone compare_serial.
Definition: unitauth.c:859
void worker_handle_control_cmd(struct tube *tube, uint8_t *msg, size_t len, int error, void *arg)
process control messages from the main thread.
int scrub_message(struct sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinfo, uint8_t *zonename, struct regional *regional, struct module_env *env, struct iter_env *ie)
Cleanup the passed dns message.
Definition: iter_scrub.c:806
char * sldns_wire2str_dname(uint8_t *dname, size_t dname_len)
Conver wire dname to a string.
Definition: wire2str.c:231
static void print_rd(int t, char *data, size_t len)
convert and print rdata
Definition: unbound-host.c:256
static int errors_detected
count of errors detected
Definition: lock_verify.c:102
void adjust_packet(struct entry *match, uint8_t **answer_pkt, size_t *answer_len, uint8_t *query_pkt, size_t query_len)
copy & adjust packet, mallocs a copy.
Definition: testpkts.c:1517
char * sldns_wire2str_class(uint16_t rrclass)
Convert wire RR class to a string, 'IN', 'CLASS1'.
Definition: wire2str.c:224
int sldns_wire2str_int32_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat int32 field to string, with user buffers.
Definition: wire2str.c:1047
void ipset_clear(struct module_qstate *qstate, int id)
clear the ipset query-specific contents out of qstate
Definition: ipset.c:350
long long num_query_authzone_up
number of queries for unbound's auth_zones, upstream query
Definition: unbound.h:774
sldns_lookup_table * sldns_algorithms
Taken from RFC 2535, section 7.
Definition: wire2str.c:58
@ UB_LIBCMD_ANSWER
Query result, originates from bg worker.
Definition: context.h:224
void secalgo_hash_sha256(unsigned char *buf, size_t len, unsigned char *res)
Calculate the sha256 hash for the data buffer into the result.
int create_line
creation line
Definition: lock_verify.c:77
static int az_generate_any_answer(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *node)
generate answer for type ANY answer
Definition: authzone.c:2899
int tls_use_sni
if SNI is to be used
Definition: config_file.h:132
int isfirst
Fallback to global local_zones when there is no match in the view view specific tree.
Definition: config_file.h:711
int ssl_upstream
if it uses ssl upstream
Definition: outside_network.h:298
int main(int argc, char *argv[])
Main unit test program.
Definition: unitmain.c:862
void adjust_packet(struct entry *match, uint8_t **answer_pkt, size_t *answer_pkt_len, uint8_t *query_pkt, size_t query_pkt_len)
copy & adjust packet, mallocs a copy.
Definition: testpkts.c:1517
int reply_equal(struct reply_info *p, struct reply_info *q, struct regional *region)
Check if two replies are equal For fallback procedures.
Definition: iter_utils.c:967
struct auth_chunk * chunks_first
xfer data that has been transferred, the data is applied once the transfer has completed correctly
Definition: authzone.h:365
int edns_opt_append(struct edns_data *edns, struct regional *region, uint16_t code, size_t len, uint8_t *data)
Append edns option to edns data structure.
Definition: msgreply.c:946
static int comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer *packet, struct sockaddr *addr, socklen_t addrlen, struct comm_reply *r)
send a UDP reply over specified interface
Definition: netevent.c:443
static int get_rcode(uint8_t *pkt, size_t pktlen)
returns rcode from packet
Definition: testpkts.c:758
struct ecs_whitelist * whitelist
access control, which upstream servers we send client address
Definition: subnetmod.h:61
void comm_base_delete_no_base(struct comm_base *b)
Delete comm base structure but not the underlying lib event base.
Definition: netevent.c:220
enum sec_status nsec3_prove_nodata(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey)
Determine if the NSEC3s provided in a response prove the NOERROR/NODATA status.
Definition: val_nsec3.c:1224
int sldns_wire2str_alg_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat alg field to string, with user buffers.
Definition: wire2str.c:1335
static int perform_zone_add(RES *ssl, struct local_zones *zones, char *arg)
Add a new zone.
Definition: remote.c:1184
int iter_get_next_root(struct iter_hints *hints, struct iter_forwards *fwd, uint16_t *c)
Lookup next root-hint or root-forward entry.
Definition: iter_utils.c:1224
size_t signer_len
length of signer_name
Definition: validator.h:216
void ub_event_del_bits(struct ub_event *, short bits)
Configure the event so it will not longer fire on given bits.
Definition: ub_event.c:368
uint16_t sldns_wirerr_get_class(uint8_t *rr, size_t len, size_t dname_len)
Get the class of the RR.
Definition: str2wire.c:805
struct config_str3list * acl_tag_actions
list of aclname, tagname, localzonetype
Definition: config_file.h:417
int ssl_upstream
if outgoing tcp connections use SSL
Definition: config_file.h:118
static size_t rrset_get_count(struct ub_packed_rrset_key *rrset)
return number of rrs in an rrset
Definition: val_utils.c:317
size_t num_tcp
number of tcp communication points.
Definition: outside_network.h:154
int order_lock_cmp(const void *e1, const void *e2)
Due to module breakage by fptr wlist, these test app declarations are presented here.
Definition: unbound-dnstap-socket.c:1568
static void pr_flags(sldns_buffer *buf, uint16_t flags)
print flags to string
Definition: unitauth.c:651
struct regional * region
regional for allocation
Definition: acl_list.h:76
rbnode_type * root
The root of the red-black tree.
Definition: rbtree.h:78
void slabhash_insert(struct slabhash *table, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *cb_override)
Insert a new element into the hashtable, uses lruhash_insert.
Definition: slabhash.c:116
struct daemon_remote * daemon_remote_create(struct config_file *cfg)
Create new remote control state for the daemon.
Definition: remote.c:198
static void process_dnskey_response(struct module_qstate *qstate, struct val_qstate *vq, int id, int rcode, struct dns_msg *msg, struct query_info *qinfo, struct sock_list *origin)
Process DNSKEY response.
Definition: validator.c:2951
static void timestwo(struct timeval *v)
special timestwo operation for time values in histogram setup
Definition: timehist.c:52
@ LDNS_RDF_TYPE_DNAME
domain name
Definition: rrdef.h:268
static void rbtree_insert_fixup(rbtree_type *rbtree, rbnode_type *node)
Fixup node colours when insert happened.
Definition: rbtree.c:158
struct reply_info * parse_reply_in_temp_region(struct sldns_buffer *pkt, struct regional *region, struct query_info *qi)
get msg reply struct (in temp region)
Definition: msgreply.c:927
struct lruhash_entry entry
the hash table entry, data is uint8_t pointer of size crypto_box_BEFORENMBYTES which contains the sha...
Definition: dnscrypt.c:60
int respip_rewrite_reply(const struct query_info *qinfo, const struct respip_client_info *cinfo, const struct reply_info *rep, struct reply_info **new_repp, struct respip_action_info *actinfo, struct ub_packed_rrset_key **alias_rrset, int search_only, struct regional *region, struct auth_zones *az)
See if any IP-based action should apply to any IP address of AAAA/A answer record in the reply.
Definition: respip.c:896
void mesh_new_prefetch(struct mesh_area *mesh, struct query_info *qinfo, uint16_t qflags, time_t leeway)
New prefetch message.
Definition: mesh.c:750
int typecode
typecode
Definition: fake_event.c:75
size_t max
max memory to use (bytes)
Definition: val_neg.h:80
int sldns_wire2str_b32_ext_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat b32_ext field to string, with user buffers.
Definition: wire2str.c:1198
int parse_dname(const char *str, uint8_t **res, size_t *len, int *labs)
Form wireformat from text format domain name.
Definition: localzone.c:132
size_t addrtree_size(const struct addrtree *tree)
Size of tree in bytes.
Definition: addrtree.c:270
enum sec_status dnskeyset_verify_rrset_sig(struct module_env *env, struct val_env *ve, time_t now, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t sig_idx, struct rbtree_type **sortree, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset, with dnskey rrset, for a specific rrsig in rrset
Definition: val_sigcrypt.c:594
void * fstrm_create_control_frame_accept(char *contenttype, size_t *len)
This creates an FSTRM control frame of type ACCEPT.
Definition: dnstap_fstrm.c:123
static void check_zone_invariants(struct val_neg_cache *neg, struct val_neg_zone *zone)
check if negative cache is still valid
Definition: unitneg.c:428
uint8_t * name
name; the key
Definition: val_neg.h:146
enum rrset_trust trust
the trustworthiness of the rrset data
Definition: packed_rrset.h:244
struct val_neg_data * prev
previous in LRU
Definition: val_neg.h:164
void iter_scrub_nxdomain(struct dns_msg *msg)
Prepare an NXDOMAIN message to be used for a subdomain answer by removing all RRs from the ANSWER sec...
Definition: iter_utils.c:1272
static int create_pending_tcp(struct outside_network *outnet, size_t bufsize)
create pending_tcp buffers
Definition: outside_network.c:687
Send queries to outside servers and wait for answers from servers.
Definition: outside_network.h:70
int ub_ctx_debuglevel(struct ub_ctx *ctx, int d)
Set debug verbosity for the context Output is directed to stderr.
Definition: libunbound.c:466
void comm_signal_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:3387
static struct module_func_block pythonmod_block
The module function block.
Definition: pythonmod.c:581
void sldns_fskipcs_l(FILE *fp, const char *s, int *line_nr)
skips all of the characters in the given string in the fp, moving the position to the first character...
Definition: parse.c:425
uint8_t * buf
the buffer with packet contents
Definition: listen_dnsport.h:294
void wsvc_install(FILE *out, const char *rename)
Install service in servicecontrolmanager, setup registry.
Definition: w_inst.c:189
void dns_cache_store_msg(struct module_env *env, struct query_info *qinfo, hashvalue_type hash, struct reply_info *rep, time_t leeway, int pside, struct reply_info *qrep, uint32_t flags, struct regional *region)
Store message in the cache.
Definition: dns.c:156
ratelimit settings for domains
Definition: infra.h:131
static void xml_startelem(void *userData, const XML_Char *name, const XML_Char **atts)
XML start of element.
Definition: unbound-anchor.c:1424
void addr_tree_init(rbtree_type *tree)
Init addr tree to be empty.
Definition: dnstree.c:79
const char * strmodulevent(enum module_ev e)
Debug utility: module event to string.
Definition: module.c:60
@ LDNS_RDF_TYPE_SERVICE
protocol and port bitmaps
Definition: rrdef.h:315
struct reply_info * caps_reply
state for capsfail: stored query for comparisons.
Definition: iterator.h:291
int codeline_cmp(const void *a, const void *b)
compare two codeline structs for rbtree from memstats test app
Definition: worker_cb.c:236
static int http_nonchunk_segment(struct comm_point *c)
handle nonchunked data segment
Definition: netevent.c:2073
void outbound_list_clear(struct outbound_list *list)
Clear the user owner outbound list structure.
Definition: outbound_list.c:54
@ LDNS_RDF_TYPE_WKS
well known services
Definition: rrdef.h:319
static int rpz_rrset_delete_rr(struct resp_addr *raddr, uint16_t rr_type, uint8_t *rdata, size_t rdatalen)
Remove RR from RPZ's respip set.
Definition: rpz.c:791
static int dtio_read_accept_frame(struct dt_io_thread *dtio)
Read accept frame.
Definition: dtstream.c:1004
int str_is_ip6(const char *str)
See if string is ip4 or ip6.
Definition: net_help.c:113
int fptr_whitelist_mod_clear(void(*fptr)(struct module_qstate *qstate, int id))
Check function pointer whitelist for module clear call values.
Definition: fptr_wlist.c:503
void wsvc_err2str(char *str, size_t len, const char *fixed, DWORD err)
Convert windows GetLastError() value to a neat string.
Definition: w_inst.c:46
socklen_t addrlen
length of addr.
Definition: infra.h:62
size_t so_rcvbuf
SO_RCVBUF size to set on port 53 UDP socket.
Definition: config_file.h:184
struct daemon_remote * rc
remote control connections management (for first worker)
Definition: daemon.h:97
static int ta_compare(struct autr_ta *a, uint16_t t, uint8_t *b, size_t b_len)
compare trust anchor with rdata, 0 if equal.
Definition: autotrust.c:1376
static int dtio_control_start_send(struct dt_io_thread *dtio)
setup a start control message
Definition: dtstream.c:1811
static void reply_and_prefetch(struct worker *worker, struct query_info *qinfo, uint16_t flags, struct comm_reply *repinfo, time_t leeway, int noreply)
Reply to client and perform prefetch to keep cache up to date.
Definition: worker.c:777
struct worker ** workers
the worker entries
Definition: daemon.h:103
static void usage(void)
print usage and exit
Definition: memstats.c:69
static void lookup_is_done(void *mydata, int err, struct ub_result *result)
this is a function of type ub_callback_t
Definition: asynclook.c:142
static void seen_revoked_trustanchor(struct autr_ta *ta, uint8_t revoked)
set revoked value
Definition: autotrust.c:1324
int stat_interval
statistics interval (in seconds)
Definition: config_file.h:73
int thread_num
thread num for debug
Definition: asynclook.c:174
char * file
for http, filename
Definition: authzone.h:438
static int serviced_tcp_send(struct serviced_query *sq, sldns_buffer *buff)
Send serviced query over TCP return false on initial failure.
Definition: outside_network.c:1904
static int apply_ixfr(struct auth_xfer *xfr, struct auth_zone *z, struct sldns_buffer *scratch_buffer)
apply IXFR to zone in memory.
Definition: authzone.c:4587
size_t num_ports
size of ports array
Definition: daemon.h:89
void(* set_fd)(struct ub_event *, int)
Change or set the file descriptor on the event The event will be deactivated before this function is ...
Definition: unbound-event.h:134
static int print_hist(RES *ssl, struct ub_stats_info *s)
print extended histogram
Definition: remote.c:889
The Virtual Method Table for and ub_event "object".
Definition: unbound-event.h:125
struct tcp_req_open_item * next
next in list
Definition: listen_dnsport.h:280
void dynlibmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
dynlib module operate on a query
Definition: dynlibmod.c:178
uint16_t dclass
the class of the name (host order)
Definition: dnstree.h:67
int32_t val_sig_skew_max
the maximum for signature clock skew
Definition: config_file.h:350
int optind
getopt global, in case header files fail to declare it.
size_t stats_jostled
stats, cumulative number of reply states jostled out
Definition: mesh.h:112
#define PACKED_RRSET_PARENT_SIDE
this rrset is A/AAAA and is in-zone-glue (from parent side of zonecut)
Definition: packed_rrset.h:55
static struct local_zone * lz_enter_zone(struct local_zones *zones, const char *name, const char *type, uint16_t dclass)
enter a new zone
Definition: localzone.c:208
comm_point_callback_type * cb
callback for the timeout, error or reply to the message
Definition: outside_network.h:294
#define HASH_DEFAULT_SLABS
default number of slabs
Definition: slabhash.h:49
size_t zonelen
length of zone name
Definition: outside_network.h:353
static void aclchecks(struct config_file *cfg)
check acl ips
Definition: unbound-checkconf.c:367
void tcp_req_info_send_reply(struct tcp_req_info *req)
Send reply on tcp simultaneous answer channel.
Definition: listen_dnsport.c:1917
struct comm_point * c
tcp comm point it was sent on (and reply must come back on).
Definition: outside_network.h:261
void delegpt_log(enum verbosity_value v, struct delegpt *dp)
Print the delegation point to the log.
Definition: iter_delegpt.c:258
struct module_func_block * ipset_get_funcblock(void)
Get the function block with pointers to the ipset functions.
Definition: ipset.c:380
uint32_t incep
signature inception
Definition: signit.c:53
struct module_func_block * module_factory(const char **str)
Get funcblock for module name.
Definition: modstack.c:203
int num_target_queries
number of outstanding target sub queries
Definition: iterator.h:298
int sldns_b32_ntop_extended_hex(uint8_t const *src, size_t srclength, char *target, size_t targsize)
This function we get from ldns-compat or from base system it returns the number of data bytes stored ...
Definition: parseutil.c:448
struct dns_msg * tomsg(struct module_env *env, struct query_info *q, struct reply_info *r, struct regional *region, time_t now, int allow_expired, struct regional *scratch)
generate dns_msg from cached message
Definition: dns.c:538
static struct codeline * get_codeline(rbtree_type *tree, char *key, char *func)
find or alloc codeline in tree
Definition: memstats.c:102
int dnssec_expected
expected dnssec information for this iteration step.
Definition: iterator.h:354
static struct ub_packed_rrset_key * reply_get_NS_rrset(struct reply_info *rep)
fetch NS record from reply, if any
Definition: iter_utils.c:1086
char * zonefile
zonefile (or NULL)
Definition: config_file.h:666
struct config_strlist * auto_trust_anchor_file_list
files with 5011 autotrust tracked keys
Definition: config_file.h:331
static int xfr_probe_send_probe(struct auth_xfer *xfr, struct module_env *env, int timeout)
send the UDP probe to the master, this is part of task_probe
Definition: authzone.c:6011
size_t empty_DS_len
length of empty_DS_name
Definition: validator.h:205
uint16_t EDNS_ADVERTISED_SIZE
Advertised size of EDNS capabilities.
Definition: net_help.c:68
static int lz_enter_override(struct local_zones *zones, char *zname, char *netblock, char *type, uint16_t rr_class)
enter override into zone
Definition: localzone.c:618
static int add_synth_cname(struct auth_zone *z, uint8_t *qname, size_t qname_len, struct regional *region, struct dns_msg *msg, struct auth_data *dname, struct auth_rrset *rrset)
add a synthesized CNAME to the answer section
Definition: authzone.c:2481
int caps_failed_rcode(struct reply_info *rep)
see if reply has a 'useful' rcode for capsforid comparison, so not SERVFAIL or REFUSED,...
Definition: iter_utils.c:1060
struct edns_option * edns_opts_front_out
outgoing edns options to the front end
Definition: module.h:644
struct comm_reply repinfo
sockaddr from peer, for TCP handlers
Definition: netevent.h:176
size_t sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor)
returns the minimum number of rdata fields of the rr type this descriptor describes.
Definition: rrdef.c:650
static void pretty_type(char *s, size_t len, int t)
nice string for type
Definition: unbound-host.c:229
static void qlist_read_file(struct perfinfo *info, char *fname)
setup query list in info
Definition: perf.c:551
static struct val_neg_data * neg_setup_data_node(uint8_t *nm, size_t nm_len, int labs)
Create single node of data element.
Definition: val_neg.c:602
void config_deltrplstrlist(struct config_str3list *list)
Delete items in config triple string list.
Definition: config_file.c:1309
static int count_unused(struct ip_list *p)
count unused IPs
Definition: unbound-anchor.c:681
int do_daemonize
daemonize, i.e.
Definition: config_file.h:460
struct config_strlist * trusted_keys_file_list
files with trusted DNSKEYs in named.conf format, list
Definition: config_file.h:333
int ub_event_add(struct ub_event *ev, struct timeval *tv)
Activate the event.
Definition: ub_event.c:387
size_t total_large
total large size
Definition: regional.h:70
void log_edns_opt_list(enum verbosity_value level, const char *info_str, struct edns_option *list)
Log the edns options in the edns option list.
Definition: msgparse.c:1111
autr_state_type
Autotrust anchor states.
Definition: autotrust.h:55
int match_all(uint8_t *q, size_t qlen, uint8_t *p, size_t plen, int mttl, int noloc)
match all of the packet
Definition: testpkts.c:1297
Callback to result routine.
Definition: mesh.h:246
struct timeval time_last_stat
last time of statistics printout
Definition: daemon.h:121
char * key_entry_get_reason(struct key_entry_key *kkey)
Get reason why a key is bad.
Definition: val_kentry.c:248
int qtype
qtype
Definition: outside_network.h:355
int ipseckey_done
If the IPSECKEY subquery has finished.
Definition: ipsecmod.h:73
#define MAX_PORT_RETRY
number of times to retry finding interface, port that can be opened.
Definition: outside_network.c:78
void errinf_dname(struct module_qstate *qstate, const char *str, uint8_t *dname)
Append text to error info: str dname.
Definition: config_file.c:2488
void config_delstrlist(struct config_strlist *list)
Delete items in config string list.
Definition: config_file.c:1284
void(* cb)(void *)
the callback to call
Definition: replay.h:385
static int read_stubs_host(struct config_stub *s, struct delegpt *dp)
set stub host names
Definition: iter_hints.c:217
static int read_stubs_addr(struct config_stub *s, struct delegpt *dp)
set stub server addresses
Definition: iter_hints.c:242
size_t key_cache_size
size of the key cache
Definition: config_file.h:388
static void test_bin_find_entry(struct lruhash *table)
test bin_find_entry function and bin_overflow_remove
Definition: unitlruhash.c:81
struct ub_event_base * ub_default_event_base(int, time_t *, struct timeval *)
Return a default event base.
Definition: ub_event.c:210
@ acl_deny
disallow any access whatsoever, drop it
Definition: acl_list.h:56
static int az_generate_nxdomain_answer(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_data *ce, struct auth_data *node)
generate answer for nxdomain answer
Definition: authzone.c:3111
void libworker_delete_event(struct libworker *w)
delete worker for event-based interface.
Definition: libworker.c:121
size_t size
the length of the rdata if allocated (with no dname compression)
Definition: msgparse.h:192
structure to keep track of information during stop flush
Definition: dtstream.c:1565
static void process_dlv_response(struct module_qstate *qstate, struct val_qstate *vq, int id, int rcode, struct dns_msg *msg, struct query_info *qinfo)
Process DLV response.
Definition: validator.c:3123
int * len
the length in bytes of the data items, len[i] for data[i]
Definition: unbound.h:140
int dns_cache_store(struct module_env *env, struct query_info *msgqinf, struct reply_info *msgrep, int is_referral, time_t leeway, int pside, struct regional *region, uint32_t flags)
Allocate a dns_msg with malloc/alloc structure and store in dns cache.
Definition: dns.c:967
@ LDNS_RR_TYPE_TALINK
draft-ietf-dnsop-trust-history
Definition: rrdef.h:193
static int causes_cycle(struct module_qstate *qstate, uint8_t *name, size_t namelen, uint16_t t, uint16_t c)
detect dependency cycle for query and target
Definition: iter_utils.c:677
static void filter_init(struct nsec3_filter *filter, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo)
Initialize the filter structure.
Definition: val_nsec3.c:406
static struct dns_msg * gen_dns_msg(struct regional *region, struct query_info *q, size_t num)
allocate dns_msg from query_info and reply_info
Definition: dns.c:512
int sldns_wire2str_b64_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat b64 field to string, with user buffers.
Definition: wire2str.c:1240
void testbound_selftest(void)
testbounds self test
Definition: replay.c:936
INLINE void sldns_buffer_set_position(sldns_buffer *buffer, size_t mark)
sets the buffer's position to MARK.
Definition: sbuffer.h:245
static void zone_del_msg(struct lruhash_entry *e, void *arg)
callback to delete messages in a zone
Definition: remote.c:1702
void void void log_buf(enum verbosity_value level, const char *msg, struct sldns_buffer *buf)
Easy alternative for log_hex, takes a sldns_buffer.
Definition: log.c:424
int sldns_bgetc(struct sldns_buffer *buffer)
returns the next character from a buffer.
Definition: parse.c:227
struct event_base * ub_libevent_get_event_base(struct ub_event_base *)
Return the libevent base underlying the given ub_event_base.
Definition: ub_event.c:252
void lruhash_traverse(struct lruhash *h, int wr, void(*func)(struct lruhash_entry *, void *), void *arg)
Traverse a lruhash.
Definition: lruhash.c:524
sldns_rdf_type sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor, size_t index)
returns the rdf type for the given rdata field number of the rr type for the given descriptor.
Definition: rrdef.c:674
int auth_zones_answer(struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, struct sldns_buffer *buf, struct regional *temp)
Answer query from auth zone.
Definition: authzone.c:3320
size_t _position
The current position used for reading/writing.
Definition: sbuffer.h:119
void worker_send_cmd(struct worker *worker, enum worker_commands cmd)
Send a command to a worker.
Definition: worker.c:230
static void lru_push(struct addrtree *tree, struct addrnode *node)
Add node to LRU list as most recently used.
Definition: addrtree.c:184
enum sec_status val_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *keys, uint8_t *sigalg, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify RRset with keys.
Definition: val_utils.c:336
static int isendline(char c)
return if string is empty or comment
Definition: testpkts.c:65
static void perfmain(struct perfinfo *info)
perform the performance test
Definition: perf.c:452
static void timeval_add(struct timeval *d, const struct timeval *add)
add timers and the values do not overflow or become negative
Definition: fake_event.c:98
Backend call routines.
Definition: cachedb.h:71
int unique_mesh_state(struct edns_option *list, struct module_env *env)
Check if an unique mesh state is required.
Definition: module.c:206
void reply_addr2str(struct comm_reply *reply, char *dest, int maxlen)
Convert reply->addr to string.
Definition: pythonmod_utils.c:169
void * stop_frame
the stop control frame
Definition: dtstream.c:1575
struct lruhash_entry * lru_end
lru list end item (least recently used)
Definition: lruhash.h:173
static BIO * xml_selectbio(struct xml_data *data, const char *tag)
The BIO for the tag.
Definition: unbound-anchor.c:1221
static struct auth_data * az_find_wildcard_domain(struct auth_zone *z, uint8_t *nm, size_t nmlen)
see if the domain has a wildcard child '*.domain'
Definition: authzone.c:2153
int dnskey_get_algo(struct ub_packed_rrset_key *k, size_t idx)
Get DNSKEY RR signature algorithm.
Definition: val_sigcrypt.c:178
int options_remote_is_address(struct config_file *cfg)
check if config for remote control turns on IP-address interface with certificates or a named pipe wi...
Definition: config_file.c:2499
struct slabhash * client_ip_rates
hash table with query rates per client ip: ip_rate_key, ip_rate_data
Definition: infra.h:122
struct tube_res_list * res_last
last in list
Definition: tube.h:91
socklen_t addrlen
length of addr field in use.
Definition: outside_network.h:227
struct sldns_buffer * udp_buff
buffer shared by UDP connections, since there is only one datagram at any time.
Definition: outside_network.h:80
void iter_store_parentside_NS(struct module_env *env, struct reply_info *rep)
Store parent-side NS records from a referral message.
Definition: iter_utils.c:1098
struct delegpt * delegpt_create(struct regional *region)
Create new delegation point.
Definition: iter_delegpt.c:54
static time_t wait_probe_time(struct val_anchors *anchors)
what is first probe time (anchors must be locked)
Definition: autotrust.c:2017
struct config_strbytelist * local_zone_tags
list of zonename, tagbitlist
Definition: config_file.h:413
void infra_update_tcp_works(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *name, size_t namelen)
Update information for the host, store that a TCP transaction works.
Definition: infra.c:544
void respip_sockaddr_delete(struct respip_set *set, struct resp_addr *node)
Delete resp_addr node from tree.
Definition: respip.c:127
struct tcp_send_list * next
next in list
Definition: delayer.c:110
@ INIT_REQUEST_STATE
Externally generated queries start at this state.
Definition: iterator.h:175
#define PTR_OFFSET(x, y)
Calculate destination offset of a compression pointer.
Definition: msgparse.h:201
@ sec_status_secure_sentinel_fail
SECURE_SENTINEL_FAIL means that the object (RRset or message) validated according to local policy but...
Definition: packed_rrset.h:193
void algo_needs_set_bogus(struct algo_needs *n, uint8_t algo)
Mark this algorithm a failure, sec_bogus.
Definition: val_sigcrypt.c:461
void verbose(enum verbosity_value lvl, const char *msg,...) ATTR_FORMAT(printf
logging routine, provided by caller
void pending_udp_timer_delay_cb(void *arg)
callback for udp delay for timeout
Definition: outside_network.c:649
int ssl_brief_write
we are briefly waiting to write (in the struct event)
Definition: unbound-dnstap-socket.c:115
static void perftimeout(struct perfinfo *info, size_t n, struct timeval *now)
got timeout for io
Definition: perf.c:329
struct alloc_cache superalloc
master allocation cache
Definition: daemon.h:109
static int processQueryResponse(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Process the query response.
Definition: iterator.c:2658
char ** data
a list of network order DNS rdata items, terminated with a NULL pointer, so that data[0] is the first...
Definition: unbound.h:137
int dnstap_log_forwarder_query_messages
true to log dnstap FORWARDER_QUERY message events
Definition: config_file.h:518
int tube_handle_write(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
for fptr wlist, callback function
@ sec_status_indeterminate
INDETERMINATE means that the object is insecure, but not authoritatively so.
Definition: packed_rrset.h:185
Closest encloser (ce) proof results Contains the ce and the next-closer (nc) proof.
Definition: val_nsec3.c:78
static struct module_func_block val_block
The validator function block.
Definition: validator.c:3267
int num_tags
number of items in the taglist
Definition: config_file.h:431
@ PRIME_RESP_STATE
Responses to priming queries finish at this state.
Definition: iterator.h:204
static int have_probe_targets(struct auth_master *list)
return true if there are probe (SOA UDP query) targets in the master list
Definition: authzone.c:6510
void(* stop_accept)(void *)
callback to stop listening on accept sockets, performed when accept() will not function properly
Definition: netevent.h:102
void comm_base_exit(struct comm_base *b)
Exit from dispatch loop.
Definition: netevent.c:253
socklen_t addrlen
length of addr, if 0, then any address will do
Definition: replay.h:254
int fptr_whitelist_inplace_cb_query_response(inplace_cb_query_response_func_type *fptr)
Check function pointer whitelist for inplace_cb_query_response func values.
Definition: fptr_wlist.c:664
size_t jostle_time
number of msec to wait before items can be jostled out
Definition: config_file.h:156
int active
number of active commpoints that are handling remote control
Definition: remote.h:97
void replay_scenario_delete(struct replay_scenario *scen)
Delete scenario.
Definition: replay.c:508
struct entry * match
Matching list.
Definition: replay.h:257
struct config_str2list * tcp_connection_limits
list of tcp connection limitss, linked list
Definition: config_file.h:245
uint8_t got6
if the ipv6 address is in the delegpt, 0=not, 1=yes 2=negative
Definition: iter_delegpt.h:113
int secure
True, if the result is validated securely.
Definition: unbound.h:183
void dname_print(FILE *out, struct sldns_buffer *pkt, uint8_t *dname)
Debug helper.
Definition: dname.c:389
int ip_ratelimit
ratelimit for ip addresses.
Definition: config_file.h:526
uint16_t type
RR type in host byteorder.
Definition: authzone.h:175
void ipset_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Subordinate query done, inform this super request of its conclusion.
static int remote_handshake_later(struct daemon_remote *rc, struct rc_state *s, struct comm_point *c, int r, int r2)
handle SSL_do_handshake changes to the file descriptor to wait for later
Definition: remote.c:3156
static int az_generate_cname_answer(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg *msg, struct auth_data *node, struct auth_rrset *rrset)
generate answer for cname answer
Definition: authzone.c:2965
int * target_fetch_policy
The target fetch policy for each dependency level.
Definition: iterator.h:136
struct delegpt * forwards_lookup_root(struct iter_forwards *fwd, uint16_t qclass)
Same as forwards_lookup, but for the root only.
Definition: iter_fwd.c:390
void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size)
Setup a buffer with the data pointed to.
Definition: sbuffer.c:65
rbnode_type * rbtree_first(rbtree_type *rbtree)
Returns first (smallest) node in the tree.
Definition: rbtree.c:549
int(* loopexit)(struct ub_event_base *, struct timeval *)
Exit the given event loop.
Definition: unbound-event.h:95
static RETSIGTYPE delayer_sigh(int sig)
signal handler for user quit
Definition: delayer.c:348
int modstack_setup(struct module_stack *stack, const char *module_conf, struct module_env *env)
Setup modules.
Definition: modstack.c:223
static testdata_type * newdata(int val)
new data el
Definition: unitslabhash.c:73
void comm_point_close(struct comm_point *c)
Close a comm point fd.
Definition: netevent.c:3070
struct ub_randstate * rnd
random table to generate random numbers
Definition: module.h:479
long long num_queries_prefetch
number of prefetch queries - cachehits with prefetch
Definition: unbound.h:671
static struct compress_tree_node * compress_tree_lookup(struct compress_tree_node **tree, uint8_t *dname, int labs, struct compress_tree_node ***insertpt)
Lookup a domain name in compression tree.
Definition: msgencode.c:147
static int auth_rr_to_string(uint8_t *nm, size_t nmlen, uint16_t tp, uint16_t cl, struct packed_rrset_data *data, size_t i, char *s, size_t buflen)
convert auth rr to string
Definition: authzone.c:1647
static void test_anchor_one(sldns_buffer *buff, struct val_anchors *a)
test set of one anchor
Definition: unitanchor.c:67
@ LDNS_RR_TYPE_KX
RFC2230.
Definition: rrdef.h:155
int sldns_str2wire_a_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_A from string to wireformat.
Definition: str2wire.c:1065
static enum sec_status verify_dnskeys_with_ds_rr(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *dnskey_rrset, struct ub_packed_rrset_key *ds_rrset, size_t ds_idx, char **reason, struct module_qstate *qstate)
verify that a DS RR hashes to a key and that key signs the set
Definition: val_utils.c:415
A communication point dispatcher.
Definition: netevent.h:97
lock_basic_type queries_ratelimit_lock
lock on ratelimit counter
Definition: iterator.h:139
int zone_expired
is the zone currently considered expired? after expiry also older serial numbers are allowed (not jus...
Definition: authzone.h:251
char * fname_after_chroot(const char *fname, struct config_file *cfg, int use_chdir)
Convert a filename to full pathname in original filesys.
Definition: config_file.c:2116
size_t num
number of rrsets in list
Definition: val_nsec3.c:105
static int read_ssl_line(SSL *ssl, char *buf, size_t len)
Read one line from SSL zero terminates.
Definition: petal.c:152
INLINE void sldns_buffer_write_u16_at(sldns_buffer *buffer, size_t at, uint16_t data)
writes the given 2 byte integer at the given position in the buffer
Definition: sbuffer.h:524
struct auth_zones * auth_zones_create(void)
Create auth zones structure.
Definition: authzone.c:289
int iter_ds_toolow(struct dns_msg *msg, struct delegpt *dp)
See if a DS response (type ANSWER) is too low: a nodata answer with a SOA record in the authority sec...
Definition: iter_utils.c:1330
struct sock_list * chain_blacklist
The blacklist saved for chainoftrust elements.
Definition: validator.h:163
struct comm_point ** tcp_handlers
malloced array of tcp handlers for a tcp-accept, of size max_tcp_count.
Definition: netevent.h:185
static int xfr_transfer_lookup_host(struct auth_xfer *xfr, struct module_env *env)
lookup a host name for its addresses, if needed
Definition: authzone.c:5064
int fd
file descriptor, open and ready for use
Definition: listen_dnsport.h:109
int allow_notify
this is an allow notify member, the master can send notifies to us, but we don't send SOA probes,...
Definition: authzone.h:445
int infra_ip_ratelimit_inc(struct infra_cache *infra, struct comm_reply *repinfo, time_t timenow, struct sldns_buffer *buffer)
Update query ratelimit hash and decide whether or not a query should be dropped.
Definition: infra.c:1006
size_t * nsec3_maxiter
NSEC3 maximum iteration count per signing key size.
Definition: validator.h:120
struct auth_master * lookup_target
for the hostname lookups, which master is current
Definition: authzone.h:319
size_t numwait
number of queries waiting (in total)
Definition: delayer.c:86
#define LABEL_IS_PTR(x)
Check if label length is first octet of a compression pointer, pass u8.
Definition: msgparse.h:198
static void bogus_del_msg(struct lruhash_entry *e, void *arg)
callback to delete bogus messages
Definition: remote.c:1788
time_t last_queried
last queried DNSKEY set Not all failures are captured in this entry.
Definition: autotrust.h:104
static struct module_func_block respip_block
The response-ip function block.
Definition: respip.c:1274
static int make_stub_holes(struct iter_forwards *fwd, struct config_file *cfg)
make NULL entries for stubs
Definition: iter_fwd.c:302
void timehist_print(struct timehist *hist)
Printout histogram.
Definition: timehist.c:147
@ serviced_query_TCP_EDNS
TCP with EDNS sent.
Definition: outside_network.h:365
int net
netblock size
Definition: dnstree.h:87
static void read_assign_step(char *remain, struct replay_moment *mom)
read assign step info
Definition: replay.c:240
struct mesh_area * mesh
the mesh area of the mesh_state
Definition: listen_dnsport.h:282
int ub_rrset_compare(void *k1, void *k2)
compares two rrset keys.
Definition: packed_rrset.c:95
struct sockaddr_storage addr
where to send it
Definition: outside_network.h:347
#define S_STRLIST_APPEND(str, var)
append string to strlist
Definition: config_file.c:431
int reply_all_rrsets_secure(struct reply_info *rep)
Check security status of all RRs in the message.
Definition: msgreply.c:915
static int acl_list_str_cfg(struct acl_list *acl, const char *str, const char *s2, int complain_duplicates)
apply acl_list string
Definition: acl_list.c:95
int reuseport
reuseport is enabled if true
Definition: daemon.h:91
int fptr_whitelist_comm_point_raw(comm_point_callback_type *fptr)
Check function pointer whitelist for raw comm_point callback values.
Definition: fptr_wlist.c:117
char * codeline
the name of the file:linenumber
Definition: memstats.c:56
int iter_lookup_parent_NS_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
Add parent NS record if that exists in the cache.
Definition: iter_utils.c:1167
static int get_has_edns(uint8_t *pkt, size_t len)
return true if the packet has EDNS OPT record
Definition: testpkts.c:865
uint32_t len
length to write
Definition: tube.h:121
struct ub_event_base * ub_libevent_event_base(struct event_base *base)
Return an ub_event_base constructed for the given libevent event base.
Definition: ub_event_pluggable.c:391
struct comm_point * comm_point_create_raw(struct comm_base *base, int fd, int writing, comm_point_callback_type *callback, void *callback_arg)
Create commpoint to listen to a local domain pipe descriptor.
Definition: netevent.c:3008
static int perform_zone_remove(RES *ssl, struct local_zones *zones, char *arg)
Remove a zone.
Definition: remote.c:1252
size_t nsec3_hash_algo_size_supported(int id)
Return size of nsec3 hash algorithm, 0 if not supported.
struct rr_parse * rrsig_first
linked list of RRsig RRs over this rrset.
Definition: msgparse.h:173
static void do_list_auth_zones(RES *ssl, struct auth_zones *az)
do the list_auth_zones command
Definition: remote.c:2661
int config_add_tag(struct config_file *cfg, const char *tag)
Add a tag name to the config.
Definition: config_file.c:1923
@ repevt_back_reply
reply arrives from the network
Definition: replay.h:202
struct sldns_struct_lookup_table * sldns_cert_algorithms
Taken from RFC 2538, section 2.1.
Definition: wire2str.c:84
rbtree_type ztree
rbtree of struct auth_zone
Definition: authzone.h:76
char * name
the variable name
Definition: replay.h:401
struct mesh_state * mesh_info
mesh related information for this query
Definition: module.h:631
@ LDNS_RR_TYPE_MAILB
A request for mailbox-related records (MB, MG or MR)
Definition: rrdef.h:220
struct mesh_state * jostle_last
last entry in jostle list - this is the entry that is newest
Definition: mesh.h:148
static void lzdel(rbnode_type *n, void *ATTR_UNUSED(arg))
helper traverse to delete zones
Definition: localzone.c:75
static void reportev(const char *str)
report event to system event log For use during startup and shutdown.
Definition: win_svc.c:128
static enum sec_status nsec3_do_prove_nameerror(struct module_env *env, struct nsec3_filter *flt, rbtree_type *ct, struct query_info *qinfo)
Do the name error proof.
Definition: val_nsec3.c:1022
size_t delegpt_count_targets(struct delegpt *dp)
count total number of targets in dp
Definition: iter_delegpt.c:316
static void cfg_set_bit(uint8_t *bitlist, size_t len, int id)
set a bit in a bit array
Definition: config_file.c:1948
struct packed_rrset rrset
rrset key and data
Definition: packed_rrset.h:280
void priv_delete(struct iter_priv *priv)
Delete priv structure.
Definition: iter_priv.c:70
static int read_forwards(struct iter_forwards *fwd, struct config_file *cfg)
read forwards config
Definition: iter_fwd.c:258
struct worker * worker
worker
Definition: remote.c:1599
static int rdata2sockaddr(const struct packed_rrset_data *rd, uint16_t rtype, size_t i, struct sockaddr_storage *ss, socklen_t *addrlenp)
Convert a packed AAAA or A RRset to sockaddr.
Definition: respip.c:566
void outnet_serviced_query_stop(struct serviced_query *sq, void *cb_arg)
Remove service query callback.
Definition: fake_event.c:1267
static int prime_stub(struct module_qstate *qstate, struct iter_qstate *iq, int id, uint8_t *qname, uint16_t qclass)
Generate and process a stub priming request.
Definition: iterator.c:838
time_t SERVE_EXPIRED_REPLY_TTL
TTL to use for expired records.
Definition: msgreply.c:69
static void xfr_probe_disown(struct auth_xfer *xfr)
disown task_probe.
Definition: authzone.c:5996
struct addrnode * last
last node in LRU list, last candidate to go
Definition: addrtree.h:88
struct ub_packed_rrset_key * reply_find_rrset(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside any section.
Definition: msgreply.c:803
static void mark_additional_rrset(sldns_buffer *pkt, struct msg_parse *msg, struct rrset_parse *rrset)
Place mark on rrsets in additional section they are OK.
Definition: iter_scrub.c:151
void local_zones_del_data(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)
Remove data from domain name in the tree.
Definition: localzone.c:1965
@ repevt_error
an error happens to outbound query
Definition: replay.h:210
static int xfr_transfer_init_fetch(struct auth_xfer *xfr, struct module_env *env)
initiate TCP to the target and fetch zone.
Definition: authzone.c:5130
void subnetmod_clear(struct module_qstate *qstate, int id)
subnet module cleanup query state
int fptr_whitelist_modenv_detach_subs(void(*fptr)(struct module_qstate *qstate))
Check function pointer whitelist for module_env detach_subs callback values.
Definition: fptr_wlist.c:346
int fptr_whitelist_print_func(void(*fptr)(char *, void *))
Check function pointer whitelist for config_get_option func values.
Definition: fptr_wlist.c:584
static void ip_list_free(struct ip_list *p)
free ip_list
Definition: unbound-anchor.c:498
Listening for queries structure.
Definition: listen_dnsport.h:56
void val_fill_reply(struct reply_info *chase, struct reply_info *orig, size_t cname_skip, uint8_t *name, size_t len, uint8_t *signer)
Fill up the chased reply with the content from the original reply; as pointers to those rrsets.
Definition: val_utils.c:853
time_t sldns_mktime_from_utc(const struct tm *tm)
Convert TM to seconds since epoch (midnight, January 1st, 1970).
Definition: parseutil.c:72
@ LDNS_RDF_TYPE_AAAA
AAAA record.
Definition: rrdef.h:278
static int auth_zones_cfg(struct auth_zones *az, struct config_auth *c)
set config items and create zones
Definition: authzone.c:1863
int logfile_override
if logfile is overridden
Definition: context.h:98
struct module_func_block * val_get_funcblock(void)
Get the validator function block.
Definition: validator.c:3274
uint8_t * qname
query dname (pointer to start location in packet, NULL if none
Definition: msgparse.h:118
@ LDNS_RDF_TYPE_HEX
hex string
Definition: rrdef.h:288
struct delegpt_addr * delegpt_find_addr(struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen)
Find address record in total list of delegation point.
Definition: iter_delegpt.c:146
int outgoing_tcp_mss
maximum segment size of tcp socket for outgoing queries
Definition: config_file.h:103
static int dnskey_flags(uint16_t t, uint8_t *rdata, size_t len)
Get DNSKEY flags rdata without rdatalen in front of it.
Definition: autotrust.c:276
#define RETVAL_TRUNC
return code that means the data did not fit (completely) in the packet
Definition: msgencode.c:62
static int az_insert_rr_decompress(struct auth_zone *z, uint8_t *pkt, size_t pktlen, struct sldns_buffer *scratch_buffer, uint8_t *dname, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rr_data, uint16_t rr_rdlen, int *duplicate)
insert RR into zone, from packet, decompress RR, if duplicate is nonNULL set the flag but otherwise i...
Definition: authzone.c:1413
char * sldns_wire2str_class(uint16_t rrclass)
Convert wire RR class to a string, 'IN', 'CLASS1'.
Definition: wire2str.c:224
void ub_thread_sig_unblock(int sig)
unblock one signal, so we can catch it
Definition: locks.c:76
static void test_long_table(struct lruhash *table)
test with long sequence of adds, removes and updates, and lookups
Definition: unitlruhash.c:360
int port
port on which queries are answered.
Definition: config_file.h:83
size_t slabhash_get_mem(struct slabhash *table)
Retrieve slab hash current memory use.
Definition: slabhash.c:169
int thread_num
thread number for id creation
Definition: alloc.h:82
void * log_get_lock(void)
get log lock
Definition: log.c:208
struct entry * read_entry(FILE *in, const char *name, struct sldns_file_parse_state *pstate, int skip_whitespace)
Read one entry from the data file.
Definition: testpkts.c:524
static void tcp_req_pickup_next_result(struct tcp_req_info *req)
pick up the next result and start writing it to the channel
Definition: listen_dnsport.c:1749
lock_basic_type lock
lock on the entire anchor and its keys; for autotrust changes
Definition: val_anchor.h:98
long long num_queries_missed_cache
number of queries that had a cache-miss.
Definition: unbound.h:669
int sldns_str2wire_aaaa_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_AAAA from string to wireformat.
Definition: str2wire.c:1077
static void net_test(void)
test net code
Definition: unitmain.c:114
int sldns_wire2str_rdata_buf(uint8_t *rdata, size_t rdata_len, char *str, size_t str_len, uint16_t rrtype)
Convert RDATA to string presentation format, on one line.
Definition: wire2str.c:265
Per-query module-specific state.
Definition: dns64.c:87
size_t val_get_mem(struct module_env *env, int id)
Debug helper routine that assists worker in determining memory in use.
Definition: validator.c:3254
int infra_edns_update(struct infra_cache *infra, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *nm, size_t nmlen, int edns_version, time_t timenow)
Update edns information for the host.
Definition: infra.c:641
static int az_generate_wildcard_answer(struct auth_zone *z, struct query_info *qinfo, struct regional *region, struct dns_msg *msg, struct auth_data *ce, struct auth_data *wildcard, struct auth_data *node)
generate answer for wildcard answer
Definition: authzone.c:3051
void comm_point_tcp_accept_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:918
void dtio_tap_callback(int fd, short ATTR_UNUSED(bits), void *arg)
callback for dnstap listener
Definition: unbound-dnstap-socket.c:973
void slabhash_delete(struct slabhash *sl)
Delete hash table.
Definition: slabhash.c:87
int anchor_has_keytag(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass, uint16_t keytag)
Check if there is a trust anchor for given zone with this keytag.
Definition: val_anchor.c:1314
uint8_t ext_rcode
Extended RCODE.
Definition: msgparse.h:219
struct mesh_reply * reply_list
the list of replies to clients for the results
Definition: mesh.h:176
struct config_strlist ** tag_datas
array per tagnumber, with per tag a list of rdata strings.
Definition: acl_list.h:103
void autr_write_file(struct module_env *env, struct trust_anchor *tp)
Write autotrust file.
Definition: autotrust.c:1173
enum sec_status nsec3_prove_nodata(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key **list, size_t num, struct query_info *qinfo, struct key_entry_key *kkey)
Determine if the NSEC3s provided in a response prove the NOERROR/NODATA status.
Definition: val_nsec3.c:1224
rbtree_type probe
rbtree of autotrust anchors sorted by next probe time.
Definition: autotrust.h:130
struct val_neg_cache * neg_cache
aggressive negative cache.
Definition: validator.h:86
void worker_alloc_cleanup(void *arg)
cleanup the cache to remove all rrset IDs from it, arg is worker
Definition: worker.c:2020
void ub_event_free(struct ub_event *ev)
free the event
Definition: ub_event.c:380
struct compress_tree_node * right
right node in tree, all larger than this
Definition: msgencode.c:81
struct timehist * timehist_setup(void)
Setup a histogram, default.
Definition: timehist.c:84
void server_stats_init(struct ub_server_stats *stats, struct config_file *cfg)
Initialize server stats to 0.
Definition: stats.c:87
void(* deinit)(struct module_env *, struct cachedb_env *)
Deinit - close db for program exit.
Definition: cachedb.h:79
rbnode_type node
node in mesh_area all tree, key is this struct.
Definition: mesh.h:169
int serve_expired_ttl
serve expired entries until TTL after expiration
Definition: config_file.h:368
int donotq_apply_cfg(struct iter_donotq *dq, struct config_file *cfg)
Process donotqueryaddresses config.
Definition: iter_donotq.c:123
@ LDNS_RR_TYPE_ANY
any type (wildcard)
Definition: rrdef.h:224
#define PF_INET6
define in case streamtcp is compiled on legacy systems
Definition: streamtcp.c:65
static int get_opcode(uint8_t *pkt, size_t pktlen)
returns opcode from packet
Definition: testpkts.c:750
const char * ub_strerror(int err)
Convert error value to a human readable string.
Definition: libunbound.c:888
#define SENTINEL_IS
Root key sentinel is ta preamble.
Definition: validator.h:71
char * pidfile
pidfile that is used
Definition: daemon.h:82
int errors
number of errors encountered
Definition: config_file.h:1207
int sldns_wire2str_nsec3_salt_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat nsec3_salt field to string, with user buffers.
Definition: wire2str.c:1302
@ LDNS_RDF_TYPE_EUI64
8 * 8 bit hex numbers separated by dashes.
Definition: rrdef.h:339
@ RESPONSE_TYPE_REC_LAME
Recursion lame means that the nameserver is some sort of open recursor, and not authoritative for the...
Definition: iter_resptype.h:91
int respip_rewrite_reply(const struct query_info *qinfo, const struct respip_client_info *cinfo, const struct reply_info *rep, struct reply_info **new_repp, struct respip_action_info *actinfo, struct ub_packed_rrset_key **alias_rrset, int search_only, struct regional *region, struct auth_zones *az)
See if any IP-based action should apply to any IP address of AAAA/A answer record in the reply.
Definition: respip.c:896
#define NUM_BUCKETS_HIST
Number of buckets in a histogram.
Definition: timehist.h:46
static int stream_wait_lock_inited
is the lock initialised for stream wait buffers
Definition: listen_dnsport.c:86
static int az_add_additionals_from(struct auth_zone *z, struct regional *region, struct dns_msg *msg, struct auth_rrset *rrset, size_t offset)
add additional A/AAAA from domain names in rrset rdata (+offset) offset is number of bytes in rdata w...
Definition: authzone.c:2299
enum sec_status dnskeyset_verify_rrset_sig(struct module_env *env, struct val_env *ve, time_t now, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, size_t sig_idx, struct rbtree_type **sortree, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
verify rrset, with dnskey rrset, for a specific rrsig in rrset
Definition: val_sigcrypt.c:594
struct alloc_cache * context_obtain_alloc(struct ub_ctx *ctx, int locking)
Get a new alloc.
Definition: context.c:180
size_t rrsig_count
number of rrsigs, if 0 no rrsigs
Definition: packed_rrset.h:242
int int sldns_wire2str_pkt_buf(uint8_t *data, size_t data_len, char *str, size_t str_len)
Convert wireformat packet to a string representation with user buffer It appends every RR with defaul...
Definition: wire2str.c:247
int sldns_str2wire_tag_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_TAG from string to wireformat.
Definition: str2wire.c:2015
static void dname_test_canoncmp(void)
test dname_canonical_compare
Definition: unitdname.c:511
struct autr_ta * keys
the keys
Definition: autotrust.h:97
struct lruhash_entry * lruhash_insert_or_retrieve(struct lruhash *table, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *cb_arg)
Insert a new element into the hashtable, or retrieve the corresponding element of it exits.
Definition: lruhash.c:576
void comm_point_tcp_handle_callback(int fd, short event, void *arg)
This routine is published for checks and tests, and is only used internally.
Definition: netevent.c:1768
int sldns_wire2str_unknown_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat type unknown field to string, with user buffers.
Definition: wire2str.c:1342
size_t done
how much of the item has already been transmitted
Definition: delayer.c:108
static int accept_open(struct daemon_remote *rc, int fd)
open accept commpoint
Definition: remote.c:395
void copy_state_to_super(struct module_qstate *qstate, int id, struct module_qstate *super)
Copy state that may have happened in the subquery and is always relevant to the super.
int ub_timer_add(struct ub_event *ev, struct ub_event_base *base, void(*cb)(int, short, void *), void *arg, struct timeval *tv)
Reconfigure and activate a timeout event.
Definition: ub_event.c:399
Auth config options.
Definition: config_file.h:654
char * client_key_file
client cert files: the .key file
Definition: dtstream.h:218
int cfg_scan_ports(int *avail, int num)
Scan ports available.
Definition: config_file.c:1590
int val_neg_zone_compare(const void *a, const void *b)
Comparison function for rbtree val neg zone elements.
Definition: val_neg.c:73
#define RR_COUNT_MAX
number of rrs and rrsets for integer overflow protection.
Definition: packed_rrset.h:69
void algo_needs_init_ds(struct algo_needs *n, struct ub_packed_rrset_key *ds, int fav_ds_algo, uint8_t *sigalg)
Initialize algo needs structure, set algos from rrset as needed.
Definition: val_sigcrypt.c:425
uint8_t edns_lame_known
if the EDNS lameness is already known or not.
Definition: infra.h:89
static void auth_data_del(rbnode_type *n, void *ATTR_UNUSED(arg))
helper traverse to delete zones
Definition: authzone.c:378
static struct resp_addr * respip_addr_lookup(const struct reply_info *rep, struct respip_set *rs, size_t *rrset_id)
Search the given 'iptree' for response address information that matches any of the IP addresses in an...
Definition: respip.c:604
@ LDNS_RR_TYPE_GPOS
RFC1712.
Definition: rrdef.h:137
int async_id
tracking number that can be used to cancel the query
Definition: asynclook.c:86
static int process_answer_detail(struct ub_ctx *ctx, uint8_t *msg, uint32_t len, ub_callback_type *cb, void **cbarg, int *err, struct ub_result **res)
process answer from bg worker
Definition: libunbound.c:518
rbnode_type node
rbtree node, key is this structure
Definition: val_nsec3.h:230
struct outbound_entry * next
next in list
Definition: outbound_list.h:63
void iter_merge_retry_counts(struct delegpt *dp, struct delegpt *old)
Add retry counts from older delegpt to newer delegpt.
Definition: iter_utils.c:1299
int sldns_wire2str_ipseckey_scan(uint8_t **d, size_t *dl, char **s, size_t *sl, uint8_t *pkt, size_t pktlen, int *comprloop)
Scan wireformat IPSECKEY field to string, with user buffers.
Definition: wire2str.c:1586
struct tcp_req_info * tcp_req_info
the structure to keep track of open requests on this channel
Definition: netevent.h:272
int iter_apply_cfg(struct iter_env *iter_env, struct config_file *cfg)
Process config options and set iterator module state.
Definition: iter_utils.c:144
void slabhash_setmarkdel(struct slabhash *sl, lruhash_markdelfunc_type md)
Set markdel function.
Definition: slabhash.c:218
int pending_cmp(const void *key1, const void *key2)
compare function of pending rbtree
Definition: outside_network.c:93
int comm_point_callback_type(struct comm_point *, void *, int, struct comm_reply *)
callback from communication point function type
Definition: netevent.h:77
void * outgoing_ssl_fd(void *sslctx, int fd)
connect a new fd and wrap it in a BIO in SSL
Definition: net_help.c:1227
static int processCollectClass(struct module_qstate *qstate, int id)
Collect class ANY responses and make them into one response.
Definition: iterator.c:3462
void comm_point_start_listening(struct comm_point *c, int newfd, int msec)
Start listening again for input on the comm point.
Definition: netevent.c:3204
static struct addrnode * node_create(struct addrtree *tree, void *elem, addrlen_t scope, time_t ttl)
Create a new node.
Definition: addrtree.c:90
void bin_delete(struct lruhash *table, struct lruhash_bin *bin)
delete the hash bin and entries inside it
Definition: lruhash.c:98
A query that has an answer pending for it.
Definition: outside_network.h:217
int(* add_sub)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub)
Add detached query.
Definition: module.h:433
static int http_write_more(int fd, struct comm_point *c)
write more data for http
Definition: netevent.c:2357
struct rrset_parse * msgparse_hashtable_lookup(struct msg_parse *msg, struct sldns_buffer *pkt, hashvalue_type h, uint32_t rrset_flags, uint8_t *dname, size_t dnamelen, uint16_t type, uint16_t dclass)
Lookup in msg hashtable to find a rrset.
Definition: msgparse.c:221
struct dns_msg * dns_cache_lookup(struct module_env *env, uint8_t *qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, struct regional *region, struct regional *scratch, int no_partial)
Find cached message.
Definition: dns.c:801
void libworker_alloc_cleanup(void *arg)
cleanup the cache to remove all rrset IDs from it, arg is libworker
Definition: libworker.c:846
uint16_t dclass
class of node; host order
Definition: val_neg.h:126
static RETSIGTYPE main_sigh(int sig)
signal handler for user quit
Definition: unbound-dnstap-socket.c:1205
int comm_point_perform_accept(struct comm_point *c, struct sockaddr_storage *addr, socklen_t *addrlen)
perform accept(2) with error checking.
Definition: netevent.c:789
static int auth_zone_find_less_equal(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass, struct auth_zone **z)
find an auth zone or sorted less-or-equal, return true if exact
Definition: authzone.c:471
static void waiting_tcp_delete(struct waiting_tcp *w)
delete waiting_tcp entry.
Definition: outside_network.c:138
int lookup_aaaa
are we looking up A or AAAA, first A, then AAAA (if ip6 enabled)
Definition: authzone.h:321
int fptr_whitelist_start_accept(void(*fptr)(void *))
Check function pointer whitelist for start_accept callback values.
Definition: fptr_wlist.c:151
int sldns_str2wire_b32_ext_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_B32_EXT from string to wireformat.
Definition: str2wire.c:1222
int val_permissive_mode
should validator allow bogus messages to go through
Definition: config_file.h:360
void addrtree_insert(struct addrtree *tree, const addrkey_t *addr, addrlen_t sourcemask, addrlen_t scope, void *elem, time_t ttl, time_t now)
Insert an element in the tree.
Definition: addrtree.c:359
static int soa_in_auth(struct msg_parse *msg)
Check if there are SOA records in the authority section (negative)
Definition: iter_scrub.c:339
struct dns_msg * deleg_msg
Current delegation message - returned for non-RD queries.
Definition: iterator.h:295
char * sldns_wire2str_type(uint16_t rrtype)
Convert wire RR type to a string, 'MX', 'TYPE1234'...
Definition: wire2str.c:217
int ecs_query_response(struct module_qstate *qstate, struct dns_msg *response, int id, void *cbargs)
Remove ECS record from back_out when query resulted in REFUSED response.
uint8_t rec_lame
is the host recursion lame (not AA, but RA)
Definition: infra.h:95
void remove_configfile(void)
remove config file at exit
Definition: testbound.c:336
void * pending
the UDP or TCP query that is pending, see status which
Definition: outside_network.h:394
int fptr_whitelist_pending_udp(comm_point_callback_type *fptr)
Check function pointer whitelist for pending udp callback values.
Definition: fptr_wlist.c:193
struct iter_prep_list * an_prepend_list
This is a list of RRsets that must be prepended to the ANSWER section of a response before being sent...
Definition: iterator.h:257
uint32_t frame_len
Frame length field.
Definition: dtstream.h:104
struct iter_donotq * donotq_create(void)
Create donotqueryaddresses structure.
Definition: iter_donotq.c:52
Structure to keep hash table entry for message replies.
Definition: msgreply.h:217
int sldns_str2wire_eui48_buf(const char *str, uint8_t *rd, size_t *len)
Convert rdf of type LDNS_RDF_TYPE_EUI48 from string to wireformat.
Definition: str2wire.c:1971
int ub_event_base_dispatch(struct ub_event_base *base)
Run the event base.
Definition: ub_event_pluggable.c:486
static int lz_enter_data(struct local_zones *zones, struct config_file *cfg)
enter auth data
Definition: localzone.c:1029
static size_t chunklist_sum(struct auth_chunk *list)
sum sizes of chunklist
Definition: authzone.c:4351
definition for tree struct
Definition: rbtree.h:76
int mesh_state_add_reply(struct mesh_state *s, struct edns_data *edns, struct comm_reply *rep, uint16_t qid, uint16_t qflags, const struct query_info *qinfo)
Create new reply structure and attach it to a mesh state.
Definition: mesh.c:1474
@ serviced_query_UDP
UDP without EDNS sent.
Definition: outside_network.h:363
#define ALLOC_REG_SIZE
custom size of cached regional blocks
Definition: alloc.c:49
static void respip_conf_data_test(void)
Test global respip redirect w/ data directives.
Definition: unitmain.c:772
static int az_add_negative_soa(struct auth_zone *z, struct regional *region, struct dns_msg *msg)
add negative SOA record (with negative TTL)
Definition: authzone.c:2331
static void infra_ip_create_ratedata(struct infra_cache *infra, struct comm_reply *repinfo, time_t timenow)
create rate data item for ip address
Definition: infra.c:855
static enum module_ext_state handle_event_moddone(struct module_qstate *qstate, int id)
Handles the "done" event for a query.
Definition: dns64.c:611
#define THRNUM_SHIFT
number of bits for ID part of uint64, rest for number of threads.
Definition: alloc.c:51
int auth_xfer_probe_udp_callback(struct comm_point *c, void *arg, int err, struct comm_reply *repinfo)
callback for task_probe udp packets
Definition: authzone.c:6157
int autr_read_file(struct val_anchors *anchors, const char *nm)
Read autotrust file.
Definition: autotrust.c:985
int match_all(uint8_t *q, size_t qlen, uint8_t *p, size_t plen, int mttl, int noloc)
match two packets, all must match
Definition: testpkts.c:1297
struct name_tree_node * name_tree_lookup(rbtree_type *tree, uint8_t *name, size_t len, int labs, uint16_t dclass)
Lookup closest encloser in name tree.
Definition: dnstree.c:178
char * key_entry_get_reason(struct key_entry_key *kkey)
Get reason why a key is bad.
Definition: val_kentry.c:248
void outside_network_quit_prepare(struct outside_network *outnet)
Prepare for quit.
Definition: outside_network.c:903
int sldns_wire2str_aaaa_scan(uint8_t **data, size_t *data_len, char **str, size_t *str_len)
Scan wireformat ip6 AAAA field to string, with user buffers.
Definition: wire2str.c:1104
void log_query_in(const char *str, uint8_t *name, uint16_t type, uint16_t dclass)
Like log_nametypeclass, but logs with log_query for query logging.
Definition: net_help.c:513
struct event_base * ub_libevent_get_event_base(struct ub_event_base *base)
Return the libevent base underlying the given ub_event_base.
Definition: ub_event.c:252
char * control_cert_file
certificate file for unbound-control
Definition: config_file.h:448
static struct ub_packed_rrset_key * new_rrset(struct regional *region, uint16_t rrtype, uint16_t rrclass)
allocate and initialize an rrset structure; this function is based on new_local_rrset() from the loca...
Definition: respip.c:223
int for_downstream
provide downstream answers
Definition: config_file.h:668
int donotq_apply_cfg(struct iter_donotq *donotq, struct config_file *cfg)
Process donotqueryaddresses config.
Definition: iter_donotq.c:123
void mesh_new_client(struct mesh_area *mesh, struct query_info *qinfo, struct respip_client_info *cinfo, uint16_t qflags, struct edns_data *edns, struct comm_reply *rep, uint16_t qid)
New query incoming from clients.
Definition: mesh.c:453
static char * last_space_pos(const char *str)
return last space character in string
Definition: config_file.c:2180
int shm_key
SHM data - key for the shm.
Definition: config_file.h:554
int listen_sslctx_setup_ticket_keys(void *sslctx, struct config_strlist *tls_session_ticket_keys)
setup TLS session ticket
Definition: net_help.c:1374
static void check_hints(struct config_file *cfg)
check hints
Definition: unbound-checkconf.c:841
An address span with connection limit information.
Definition: tcp_conn_limit.h:67
@ rrset_trust_auth_noAA
Data from the authority section of a non-authoritative answer.
Definition: packed_rrset.h:146
void lru_front(struct lruhash *table, struct lruhash_entry *entry)
Put entry at front of lru.
Definition: lruhash.c:266
struct lruhash_entry entry
lruhash key entry
Definition: infra.h:145
int tcl_new_connection(struct tcl_addr *tcl)
Increment TCP connection count if found, provided the count was below the limit.
Definition: tcp_conn_limit.c:155
void ub_thr_fork_create(ub_thread_type *thr, void *(*func)(void *), void *arg)
No threading available: fork a new process.
Definition: locks.c:113
rbnode_type node
rbtree node, key is this struct : proto and subnet
Definition: dnstree.h:79
void local_zones_delete(struct local_zones *zones)
Delete local zones storage.
Definition: localzone.c:82
static void send_file(SSL *ssl, int fd, FILE *in, char *buf, size_t sz)
send stdin to server
Definition: unbound-control.c:737
static struct val_neg_data * neg_find_data(struct val_neg_zone *zone, uint8_t *nm, size_t len, int labs)
Find the given data.
Definition: val_neg.c:304
struct ub_event * ub_signal_new(struct ub_event_base *base, int fd, void(*cb)(int, short, void *), void *arg)
Create a new ub_event signal for the event base.
Definition: ub_event.c:314
static int http_parse_origin(sldns_buffer *buf, struct sldns_file_parse_state *pstate)
process $ORIGIN for http
Definition: authzone.c:4254
rbtree_type a
Tree of the address spans that are blocked.
Definition: iter_priv.h:63
static void testadd(struct slabhash *table, testdata_type *ref[])
test adding a random element
Definition: unitslabhash.c:109
uint8_t * sldns_wirerr_get_rdatawl(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata pointer of the RR.
Definition: str2wire.c:833
static uint32_t rrset_get_ttl(struct ub_packed_rrset_key *k)
get ttl of rrset
Definition: val_nsec.c:54
static int neg_closest_data(struct val_neg_zone *zone, uint8_t *qname, size_t len, int labs, struct val_neg_data **data)
Lookup closest data record.
Definition: val_neg.c:948
rbnode_type run_node
node in mesh_area runnable tree, key is this struct
Definition: mesh.h:171
int s
the fd to listen for replies from server
Definition: delayer.c:78
void outbound_list_remove(struct outbound_list *list, struct outbound_entry *e)
Remove an entry from the list, and deletes it.
Definition: outbound_list.c:78
static int sanitize_nsec_is_overreach(struct rrset_parse *rrset, uint8_t *zonename)
Check if right hand name in NSEC is within zone.
Definition: iter_scrub.c:647
static void chunk_rrlist_start(struct auth_xfer *xfr, struct auth_chunk **rr_chunk, int *rr_num, size_t *rr_pos)
RR list iterator, returns RRs from answer section one by one from the dns packets in the chunklist.
Definition: authzone.c:4416
static int get_additional_name(struct rrset_parse *rrset, struct rr_parse *rr, uint8_t **nm, size_t *nmlen, sldns_buffer *pkt)
get additional name from rrset RR, return false if no name present
Definition: iter_scrub.c:111
@ respip_redirect
redirect as per provided data
Definition: localzone.h:542
#define PREFETCH_EXPIRY_ADD
seconds to add to prefetch leeway.
Definition: worker.c:110
ub_thread_type thr_id
thread id
Definition: worker.h:88
size_t cur_msg_len
length of the current message
Definition: dtstream.h:162
size_t size
the size of the lookup array
Definition: lruhash.h:164
static testkey_type * newkey(int id)
allocate new key, fill in hash
Definition: unitslabhash.c:63
uint16_t sldns_wirerr_get_rdatalen(uint8_t *rr, size_t len, size_t dname_len)
Get the rdata length of the RR.
Definition: str2wire.c:819
void lruhash_insert(struct lruhash *table, hashvalue_type hash, struct lruhash_entry *entry, void *data, void *cb_override)
Insert a new element into the hashtable.
Definition: lruhash.c:300
void infra_ratelimit_dec(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow)
Decrement the query rate counter for a delegation point.
Definition: infra.c:958
static void dns64_adjust_a(int id, struct module_qstate *super, struct module_qstate *qstate)
Synthesize an AAAA RR set from an A sub-query's answer and add it to the original empty response.
Definition: dns64.c:803
@ VAL_CLASS_REFERRAL
A referral, from cache with a nonRD query.
Definition: val_utils.h:78
respip_state
Query state regarding the response-ip module.
Definition: respip.c:38
static void domain_remove_rrset(struct auth_data *node, uint16_t rr_type)
remove rrset of this type from domain
Definition: authzone.c:662
int ub_signal_del(struct ub_event *ev)
Deactivate a signal event.
Definition: ub_event_pluggable.c:641
struct sockaddr_storage addr
the address (for UDP based communication)
Definition: netevent.h:117
void iter_store_parentside_NS(struct module_env *env, struct reply_info *rep)
Store parent-side NS records from a referral message.
Definition: iter_utils.c:1098
int taglist_intersect(uint8_t *list1, size_t list1len, const uint8_t *list2, size_t list2len)
see if two taglists intersect (have tags in common).
Definition: config_file.c:2015
@ respip_refuse
serves response data (if any), else, drops queries.
Definition: localzone.h:564
struct slabhash * table
hash table
Definition: unitslabhash.c:306
void * connect_sslctx_create(char *key, char *pem, char *verifypem, int wincert)
create SSL connect context
Definition: net_help.c:1127
int dnstap_log_client_query_messages
true to log dnstap CLIENT_QUERY message events
Definition: config_file.h:514
static void ring_add(struct ringbuf *r, sldns_buffer *pkt, struct timeval *now, struct timeval *delay, struct proxy *p)
add entry to ringbuffer
Definition: delayer.c:225
static void service(const char *bind_str, int bindport, const char *serv_str, size_t memsize, int delay_msec)
delayer main service routine
Definition: delayer.c:993
static void check_contains_revoked(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset, int *changed, struct module_qstate *qstate)
check for revoked keys without trusting any other information
Definition: autotrust.c:1523
Infra cache.
Definition: infra.h:112
static char * str_find_first_of_chars(char *s, char a, char b)
find first of two characters
Definition: authzone.c:6834
#define UB_STATS_QTYPE_NUM
number of qtype that is stored for in array
Definition: unbound.h:650
int fptr_whitelist_inplace_cb_edns_back_parsed(inplace_cb_edns_back_parsed_func_type *fptr)
Check function pointer whitelist for inplace_cb_edns_back_parsed func values.
Definition: fptr_wlist.c:648
ssize_t sldns_fget_token(FILE *f, char *token, const char *delim, size_t limit)
returns a token/char from the stream F.
Definition: parse.c:27
Pending TCP query to server.
Definition: outside_network.h:255
int is_reply
is the comm point set to send_reply (by mesh new client in worker handle), if so answer is available ...
Definition: listen_dnsport.h:260
static int parse_edns_options(uint8_t *rdata_ptr, size_t rdata_len, struct edns_data *edns, struct regional *region)
parse EDNS options from EDNS wireformat rdata
Definition: msgparse.c:943
int(* init)(struct module_env *env, int id)
init the module.
Definition: module.h:682
static void reset_worker_timer(struct module_env *env)
reset worker timer
Definition: autotrust.c:2027
#define UB_STATS_BUCKET_NUM
number of histogram buckets
Definition: unbound.h:658
unsigned _status_err
The current state of the buffer.
Definition: sbuffer.h:136
hashvalue_type dname_query_hash(uint8_t *dname, hashvalue_type h)
Hash dname, label by label, lowercasing, into hashvalue.
Definition: dname.c:287
int comm_point_send_udp_msg(struct comm_point *c, sldns_buffer *packet, struct sockaddr *addr, socklen_t addrlen)
Send an udp message over a commpoint.
Definition: fake_event.c:1734
INLINE int sldns_buffer_available(sldns_buffer *buffer, size_t count)
checks if the buffer has count bytes available at the current position
Definition: sbuffer.h:421
int ub_ctx_get_option(struct ub_ctx *ctx, const char *opt, char **str)
Get an option from the context.
Definition: libunbound.c:361
int is_whitelisted
If the qname is whitelisted or not.
Definition: ipsecmod.h:68
int ds_digest_algo_is_supported(struct ub_packed_rrset_key *ds_rrset, size_t ds_idx)
See if DS digest algorithm is supported.
Definition: val_sigcrypt.c:359
int addr_in_common(struct sockaddr_storage *addr1, int net1, struct sockaddr_storage *addr2, int net2, socklen_t addrlen)
See how many bits are shared, equal, between two addrs.
Definition: net_help.c:698
void daemon_remote_stop_accept(struct daemon_remote *rc)
Stop accept handlers for TCP (until enabled again)
Definition: remote.c:428
int serve_expired
serve expired entries and prefetch them
Definition: config_file.h:366
static void tcp_req_info_setup_listen(struct tcp_req_info *req)
setup listening for read or write
Definition: listen_dnsport.c:1682
int replay_var_compare(const void *a, const void *b)
compare two replay_vars
Definition: replay.c:556
static char * dnsc_chroot_path(struct config_file *cfg, char *path)
Given an absolute path on the original root, returns the absolute path within the chroot.
Definition: dnscrypt.c:559
size_t slabhash_get_size(struct slabhash *table)
Retrieve slab hash total size.
Definition: slabhash.c:145
size_t get_rdf_size(sldns_rdf_type rdf)
Obtain size in the packet of an rr type, that is before dname type.
Definition: msgparse.c:599
#define MAX_VALUE
Max random value.
Definition: random.c:79
int ub_ctx_config(struct ub_ctx *ctx, const char *fname)
setup configuration for the given context.
Definition: libunbound.c:374
size_t len
length of the rdata (including rdlength).
Definition: val_anchor.h:85
static void perffree(struct perfinfo *info)
cleanup perf test environment
Definition: perf.c:257
static void probe_copy_masters_for_allow_notify(struct auth_xfer *xfr)
copy the master addresses from the task_probe lookups to the allow_notify list of masters
Definition: authzone.c:3728
@ local_zone_invalid
Invalid type, cannot be used to generate answer.
Definition: localzone.h:102
size_t acl_list_get_mem(struct acl_list *acl)
Get memory used by acl structure.
Definition: acl_list.c:485
static int select_ifport(struct outside_network *outnet, struct pending *pend, int num_if, struct port_if *ifs)
Select random interface and port.
Definition: outside_network.c:1115
struct slabhash * hosts
The hash table with hosts.
Definition: infra.h:114
static int parse_rr_copy(sldns_buffer *pkt, struct rrset_parse *pset, struct packed_rrset_data *data)
copy over the data into packed rrset
Definition: msgreply.c:268
size_t nsec3_iter
nsec3 iteration count in use
Definition: val_neg.h:115
Data stored in scratch pad memory during parsing.
Definition: msgparse.h:95
void libworker_handle_control_cmd(struct tube *tube, uint8_t *msg, size_t len, int err, void *arg)
handle control command coming into server
static int addr_matches_master(struct auth_master *master, struct sockaddr_storage *addr, socklen_t addrlen, struct auth_master **fromhost)
check if an address matches a master specification (or one of its addresses in the addr list)
Definition: authzone.c:3452
struct delegpt * forwards_lookup_root(struct iter_forwards *fwd, uint16_t qclass)
Same as forwards_lookup, but for the root only.
Definition: iter_fwd.c:390
uint8_t * empty_DS_name
domain name for empty nonterminal detection
Definition: validator.h:203
#define O_LST(opt, name, lst)
compare and print list option
Definition: config_file.c:858
int libworker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
process incoming replies from the network
Definition: libworker.c:876
static void dtio_reconnect_slow(struct dt_io_thread *dtio, int msec)
reconnect slowly, because we already know we have to wait for a bit
Definition: dtstream.c:546
int on_ixfr
we are doing IXFR right now
Definition: authzone.h:399
int sldns_wire2str_edns_option_code_print(char **str, size_t *str_len, uint16_t opcode)
Print host format EDNS0 option to string.
Definition: wire2str.c:899
void wsvc_rc_stop(FILE *out)
Stop the service from servicecontrolmanager, tells OS to stop daemon.
Definition: w_inst.c:300
struct slabhash * slabhash_create(size_t numtables, size_t start_size, size_t maxmem, lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, lruhash_deldatafunc_type deldatafunc, void *arg)
Create new slabbed hash table.
Definition: slabhash.c:48
uint32_t incoming_xfr_serial
the serial number for the current AXFR/IXFR incoming reply, for IXFR, the outermost SOA records seria...
Definition: authzone.h:409
int lookup_aaaa
are we looking up A or AAAA, first A, then AAAA (if ip6 enabled)
Definition: authzone.h:375
void dt_io_thread_stop(struct dt_io_thread *dtio)
Stop the io thread.
Definition: dtstream.c:2084
void comm_signal_delete(struct comm_signal *comsig)
Delete the signal communication point.
Definition: fake_event.c:990
size_t val_neg_get_mem(struct val_neg_cache *neg)
see how much memory is in use by the negative cache.
Definition: val_neg.c:103
static int sig_is_double(sldns_buffer *pkt, struct rrset_parse *rrset, uint8_t *ttldata)
see if RRSIG is a duplicate of another
Definition: msgparse.c:707
void reply_info_delete(void *d, void *arg)
delete reply_info data structure
char * tag
the current tag; malloced; or NULL outside of tags
Definition: unbound-anchor.c:1197
int sldns_wire2str_wks_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat WKS field to string, with user buffers.
Definition: wire2str.c:1470
size_t sldns_b64_pton_calculate_size(size_t srcsize)
calculates the size needed to store the result of sldns_b64_pton
Definition: parseutil.c:672
static void auth_error_encode(struct query_info *qinfo, struct module_env *env, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, int rcode)
encode auth error answer
Definition: authzone.c:3303
Linked list of sockaddrs May be allocated such that only 'len' bytes of addr exist for the structure.
Definition: module.h:574
size_t num_queries_per_thread
number of queries every thread can service
Definition: config_file.h:154
int need_to_validate
is validation required for messages, controls client-facing validation status (AD bits) and servfails
Definition: module.h:486
void val_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
validator operate on a query
Definition: validator.c:2480
char * optarg
getopt global, in case header files fail to declare it.
char * optarg
getopt global, in case header files fail to declare it.
uint8_t match_serial
match SOA serial number, from auth section
Definition: testpkts.h:184
static void usage(void)
print usage.
Definition: unbound.c:143
void pending_udp_timer_cb(void *arg)
callback for udp timeout
Definition: outside_network.c:660
int infra_ip_ratelimit_inc(struct infra_cache *infra, struct comm_reply *repinfo, time_t timenow, struct sldns_buffer *buffer)
Update query ratelimit hash and decide whether or not a query should be dropped.
Definition: infra.c:1006
#define O_LS3(opt, name, lst)
compare and print list option
Definition: config_file.c:872
void val_deinit(struct module_env *env, int id)
validator deinit
Definition: validator.c:193
int find_tag_id(struct config_file *cfg, const char *tag)
Find tag ID in the tag list.
Definition: config_file.c:1912
enum sec_status dnskeyset_verify_rrset(struct module_env *env, struct val_env *ve, struct ub_packed_rrset_key *rrset, struct ub_packed_rrset_key *dnskey, uint8_t *sigalg, char **reason, sldns_pkt_section section, struct module_qstate *qstate)
Verify rrset against dnskey rrset.
Definition: val_sigcrypt.c:486
#define UB_STATS_QCLASS_NUM
number of qclass that is stored for in array
Definition: unbound.h:652
static void log_hex_f(enum verbosity_value v, const char *msg, void *data, size_t length)
log hex data
Definition: log.c:372
static int find_rrset(struct msg_parse *msg, sldns_buffer *pkt, uint8_t *dname, size_t dnamelen, uint16_t type, uint16_t dclass, hashvalue_type *hash, uint32_t *rrset_flags, uint8_t **prev_dname_first, uint8_t **prev_dname_last, size_t *prev_dnamelen, uint16_t *prev_type, uint16_t *prev_dclass, struct rrset_parse **rrset_prev, sldns_pkt_section section, struct regional *region)
Find rrset.
Definition: msgparse.c:461
struct comm_point * comm_point_create_udp_ancil(struct comm_base *base, int fd, struct sldns_buffer *buffer, comm_point_callback_type *callback, void *callback_arg)
Create an UDP with ancillary data comm point.
Definition: netevent.c:2574
int priv_rrset_bad(struct iter_priv *priv, sldns_buffer *pkt, struct rrset_parse *rrset)
See if rrset is bad.
Definition: iter_priv.c:232
struct mesh_area * mesh_create(struct module_stack *stack, struct module_env *env)
Allocate mesh, to empty.
Definition: mesh.c:242
volatile int exit
need to exit
Definition: perf.c:79
void auth_xfer_transfer_lookup_callback(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *why_bogus, int was_ratelimited)
mesh callback for task_transfer on lookup of host names
static void service_tcp_relay(struct tcp_proxy **tcp_proxies, struct timeval *now, struct timeval *delay, struct timeval *tcp_timeout, sldns_buffer *pkt, fd_set *rset, fd_set *rorig, fd_set *worig)
perform TCP relaying
Definition: delayer.c:743
INLINE void sldns_buffer_rewind(sldns_buffer *buffer)
make the buffer ready for re-reading the data.
Definition: sbuffer.h:220
const char * query
query name, class, type
Definition: unitauth.c:60
int only_lookup
we only want to do lookups for making config work (for notify), don't proceed with UDP SOA probe quer...
Definition: authzone.h:324
static int match_noloc(char *q, char *p, uint8_t *q_pkt, size_t q_pkt_len, uint8_t *p_pkt, size_t p_pkt_len)
match two strings for unordered equality of RRs and everything else
Definition: testpkts.c:973
int xfer_set_masters(struct auth_master **list, struct config_auth *c, int with_http)
Set masters in auth xfer structure from config.
Definition: authzone.c:6917
size_t count
number of items
Definition: timehist.h:57
static void checkerr(const char *desc, int err)
check error, if bad, exit with error message
Definition: asynclook.c:155
void tcp_req_info_clear(struct tcp_req_info *req)
Clear tcp request structure.
Definition: listen_dnsport.c:1621
Struct to hold relevant data for serve expired.
Definition: module.h:588
lock_basic_type bogus_lock
lock on bogus counter
Definition: validator.h:123
int cfg_region_strlist_insert(struct regional *region, struct config_strlist **head, char *item)
insert with region for allocation.
Definition: config_file.c:1673
struct comm_base * base
Base for select calls.
Definition: outside_network.h:72
size_t anchors_get_mem(struct val_anchors *anchors)
Get memory in use by the trust anchor storage.
Definition: val_anchor.c:1202
An address span with access control information.
Definition: acl_list.h:88
@ LDNS_RR_TYPE_PTR
a domain name pointer
Definition: rrdef.h:107
long long qbit_AD
number of queries with AD bit
Definition: unbound.h:715
void * cb_arg
user argument for callback function
Definition: outside_network.h:312
static void neg_clear_datas(rbnode_type *n, void *ATTR_UNUSED(arg))
clear datas on cache deletion
Definition: val_neg.c:114
struct config_strbytelist * next
next item in list
Definition: config_file.h:760
#define NULL_KEY_TTL
This is the TTL to use when a trust anchor fails to prime.
Definition: validator.h:59
int tcp_req_info_handle_read_close(struct tcp_req_info *req)
the read channel has closed
Definition: listen_dnsport.c:1762
void outbound_list_insert(struct outbound_list *list, struct outbound_entry *e)
Insert new entry into the list.
Definition: outbound_list.c:68
long long num_query_subnet
number of queries answered from edns-subnet specific data
Definition: unbound.h:784
void worker_work(struct worker *worker)
Make worker work.
Definition: worker.c:1947
static struct trust_anchor * anchor_insert_insecure(struct val_anchors *anchors, const char *str)
Insert insecure anchor.
Definition: val_anchor.c:381
void server_stats_obtain(struct worker *worker, struct worker *who, struct ub_stats_info *s, int reset)
Obtain the stats info for a given thread.
Definition: stats.c:361
int infra_find_ratelimit(struct infra_cache *infra, uint8_t *name, size_t namelen)
find the ratelimit in qps for a domain.
Definition: infra.c:752
static int next_state(struct iter_qstate *iq, enum iter_state nextstate)
Transition to the next state.
Definition: iterator.c:186
static struct val_neg_data * neg_closest_data_parent(struct val_neg_zone *zone, uint8_t *nm, size_t nm_len, int labs)
Find closest existing parent data for the given name.
Definition: val_neg.c:410
INLINE size_t sldns_buffer_remaining(sldns_buffer *buffer)
returns the number of bytes remaining between the buffer's position and limit.
Definition: sbuffer.h:394
struct ub_packed_rrset_key * reply_find_rrset(struct reply_info *rep, uint8_t *name, size_t namelen, uint16_t type, uint16_t dclass)
Find rrset in reply, inside any section.
Definition: msgreply.c:803
static void check_chroot_filelist_wild(const char *desc, struct config_strlist *list, const char *chrootdir, struct config_file *cfg)
check file list, with wildcard processing
Definition: unbound-checkconf.c:487
int sockaddr_cmp_addr(struct sockaddr_storage *addr1, socklen_t len1, struct sockaddr_storage *addr2, socklen_t len2)
Compare two sockaddrs.
Definition: net_help.c:638
void config_delauths(struct config_auth *p)
Delete items in config auth list.
Definition: config_file.c:1339
void tube_delete(struct tube *tube)
Delete and destroy a pipe.
Definition: tube.c:88
int havedata
If there is any data, this is true.
Definition: unbound.h:166
int ecs_whitelist_apply_cfg(struct ecs_whitelist *whitelist, struct config_file *cfg)
Process ecs_whitelist config.
int sldns_wire2str_rr_buf(uint8_t *rr, size_t rr_len, char *str, size_t str_len)
Convert RR to string presentation format, on one line.
Definition: wire2str.c:253
Key entry for the validator.
Definition: val_kentry.h:76
long long sum_query_list_size
Sum of the querylistsize of the worker for every query that missed cache.
Definition: unbound.h:677
void ub_winsock_tcp_wouldblock(struct ub_event *, int bits)
Signal the eventloop when a TCP windows socket will block on next read or write (given by the eventbi...
Definition: ub_event.c:438
void sockaddr_store_port(struct sockaddr_storage *addr, socklen_t addrlen, int port)
Store port number into sockaddr structure.
Definition: net_help.c:469
static void print_data(const char *msg, const char *data, int len)
print hex data
Definition: unbound-anchor.c:255
@ VERB_QUERY
3 - query level information
Definition: log.h:57
static size_t strip_dname_origin(uint8_t *dname, size_t dnamelen, size_t originlen, uint8_t *newdname, size_t maxnewdnamelen)
Remove RPZ zone name from dname Copy dname to newdname, without the originlen number of trailing byte...
Definition: rpz.c:453
Hash table that keeps LRU list of entries.
Definition: lruhash.h:147
static void call_root_update(void)
Perform root anchor update if so configured, by calling that process.
Definition: win_svc.c:271
struct config_str2list * respip_data
RRs configured for response-driven access controls.
Definition: config_file.h:427
int create_tcp_accept_sock(struct addrinfo *addr, int v6only, int *noproto, int *reuseport, int transparent, int mss, int freebind, int use_systemd, int dscp)
Create and bind TCP listening socket.
Definition: listen_dnsport.c:644
struct view * views_find_view(struct views *vs, const char *name, int write)
find a view by name
Definition: view.c:224
struct ub_event_base * base
the event base during stop flush
Definition: dtstream.c:1567
struct rbtree_type * override_tree
netblock addr_tree with struct local_zone_override information or NULL if there are no override eleme...
Definition: localzone.h:148
#define DNSTAP_CONTENT_TYPE
the content type for DNSTAP frame streams
Definition: dnstap_fstrm.h:113
static int read_acl_tags(struct acl_list *acl, struct config_file *cfg)
read acl tags config
Definition: acl_list.c:346
struct iter_hints * hints_create(void)
Create hints.
Definition: iter_hints.c:54
size_t stop_frame_done
how much we have done of the stop frame
Definition: dtstream.c:1579
static int dump_rrset_cache(RES *ssl, struct worker *worker)
dump rrset cache
Definition: cachedump.c:121
FILE * ub_c_out
lex out file
rbnode_type * rbtree_next(rbnode_type *node)
Returns next larger node in the tree.
Definition: rbtree.c:571
static int match_ednsdata(uint8_t *q, size_t qlen, uint8_t *p, size_t plen)
Match OPT RDATA (not the EDNS payload size or flags)
Definition: testpkts.c:1402
rbtree_type * macro_store_create(void)
Create variable storage.
Definition: replay.c:564
static void xfr_transfer_nextmaster(struct auth_xfer *xfr)
move to next master in list, task_transfer
Definition: authzone.c:3899
rbnode_type node
rbtree node, key is name only
Definition: authzone.h:153
int respip_set_is_empty(const struct respip_set *set)
respip set emptiness test
Definition: respip.c:1299
int namelabs
number of labels in name of rrset
Definition: val_anchor.h:104
#define MAX_MODULE
Maximum number of modules in operation.
Definition: module.h:185
void val_check_nonsecure(struct module_env *env, struct reply_info *rep)
Remove all unsigned or non-secure status rrsets from NS and AR sections.
Definition: val_utils.c:927
struct acl_addr * acl_addr_lookup(struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen)
Lookup address to see its acl structure.
Definition: acl_list.c:477
void outside_network_delete(struct outside_network *outnet)
Delete outside_network structure.
Definition: outside_network.c:912
size_t sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor)
returns the maximum number of rdata fields of the rr type this descriptor describes.
Definition: rrdef.c:660
static int read_multiline(char *buf, size_t len, FILE *in, int *linenr)
Read one line and put multiline RRs onto one line string.
Definition: autotrust.c:924
struct tcl_list * tcl_list_create(void)
Create TCP connection limit structure.
Definition: tcp_conn_limit.c:51
void config_delview(struct config_view *p)
Delete a view item.
Definition: config_file.c:1371
static int az_add_nsec3_proof(struct auth_zone *z, struct regional *region, struct dns_msg *msg, uint8_t *cenm, size_t cenmlen, uint8_t *qname, size_t qname_len, int nodataproof, int ceproof, int nxproof, int wcproof)
add NSEC3 records to the zone for the nsec3 proof.
Definition: authzone.c:2811
static void bin_clear(struct lruhash *table, struct lruhash_bin *bin)
clear bin, respecting locks, does not do space, LRU
Definition: lruhash.c:416
static void dtio_wakeup(struct dt_io_thread *dtio)
make the dtio wake up by sending a wakeup command
Definition: dtstream.c:140
void rpz_remove_rr(struct rpz *r, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen)
Delete policy matching RR, used for IXFR.
Definition: rpz.c:884
int sldns_wire2str_nsec_scan(uint8_t **d, size_t *dl, char **s, size_t *sl)
Scan wireformat nsec bitmap field to string, with user buffers.
Definition: wire2str.c:1256
int val_nsec_proves_positive_wildcard(struct ub_packed_rrset_key *nsec, struct query_info *qinf, uint8_t *wc)
Determine if the given NSEC proves a positive wildcard response.
Definition: val_nsec.c:490
void config_delstub(struct config_stub *p)
Delete a stub item.
Definition: config_file.c:1350
static int xfr_transfer_end_of_list(struct auth_xfer *xfr)
true if at end of list, task_transfer
Definition: authzone.c:3884
@ LDNS_RDF_TYPE_NSAP
NSAP.
Definition: rrdef.h:321
char * dnstap_tls_client_cert_file
dnstap client cert for client authentication
Definition: config_file.h:499
static struct tap_socket * tap_socket_new_local(char *socketpath, void(*ev_cb)(int, short, void *), void *data)
create new socket (unconnected, not base-added), or NULL malloc fail
Definition: unbound-dnstap-socket.c:193
This structure contains an RRset.
Definition: packed_rrset.h:107
void rpz_delete(struct rpz *r)
Delete RPZ.
Definition: rpz.c:300
int qclass
the class asked for
Definition: unbound.h:129
static void do_flush_zone(RES *ssl, struct worker *worker, char *arg)
remove all rrsets and keys from zone from cache
Definition: remote.c:1736
int UNKNOWN_SERVER_NICENESS
how nice is a server without further information, in msec Equals rtt initial timeout value.
Definition: iterator.c:73
Definition: ub_event_pluggable.c:137
static int match_question(uint8_t *q, size_t qlen, uint8_t *p, size_t plen, int mttl)
match question section of packet
Definition: testpkts.c:1165
size_t len
length of name
Definition: dnstree.h:63
static void testlookup_unlim(struct slabhash *table, testdata_type **ref)
test adding a random element (unlimited range)
Definition: unitslabhash.c:221
size_t sldns_b32_ntop_calculate_size(size_t src_data_length)
calculates the size needed to store the result of b32_ntop
Definition: parseutil.c:332
gid_t cfg_gid
from cfg username, after daemonize setup performed
Definition: config_file.c:76
static void generate_dnskey_prefetch(struct module_qstate *qstate, struct iter_qstate *iq, int id)
Generate a DNSKEY prefetch query to get the DNSKEY for the DS record we just got in a referral (where...
Definition: iterator.c:1143
struct dt_msg_entry * next
next in the list.
Definition: dtstream.h:84
int want_to_quit
outside network wants to quit.
Definition: outside_network.h:87
#define DTIO_RECV_FRAME_MAX_LEN
maximum length of received frame
Definition: dtstream.c:73
void worker_win_stop_cb(int fd, short ev, void *arg)
windows worker stop event callback handler
Definition: win_svc.c:515
int * target_count
number of target queries spawned in [1], for this query and its subqueries, the malloced-array is sha...
Definition: iterator.h:315
void mesh_state_remove_reply(struct mesh_area *mesh, struct mesh_state *m, struct comm_point *cp)
Remove mesh reply entry from the reply entry list.
Definition: mesh.c:1817
static int outnet_tcp_take_into_use(struct waiting_tcp *w, uint8_t *pkt, size_t pkt_len)
use next free buffer to service a tcp query
Definition: outside_network.c:299
struct alloc_cache * context_obtain_alloc(struct ub_ctx *ctx, int locking)
Get a new alloc.
Definition: context.c:180
struct edns_option * edns_opts_back_out
outgoing edns options to the back end
Definition: module.h:640
int infra_ratelimit_inc(struct infra_cache *infra, uint8_t *name, size_t namelen, time_t timenow, struct query_info *qinfo, struct comm_reply *replylist)
Increment the query rate counter for a delegation point.
Definition: infra.c:911
Definition: unitmain.c:566
@ comm_ssl_shake_write
ssl initial handshake wants to write
Definition: netevent.h:200
static int error_response_cache(struct module_qstate *qstate, int id, int rcode)
Return an error to the client and cache the error code in the message cache (so per qname,...
Definition: iterator.c:298
struct ub_packed_rrset_key * ce_rrset
NSEC3 record that proved ce.
Definition: val_nsec3.c:84
static int calc_size(sldns_buffer *pkt, uint16_t type, struct rr_parse *rr)
calculate the size of one rr
Definition: msgparse.c:634
void mesh_list_insert(struct mesh_state *m, struct mesh_state **fp, struct mesh_state **lp)
Insert mesh state into a double linked list.
Definition: mesh.c:1794
void config_delviews(struct config_view *p)
Delete items in config view list.
Definition: config_file.c:1385
@ DNS64_NEW_QUERY
Query for which we're the first module in line.
Definition: dns64.c:78
uint32_t flags
Flags.
Definition: packed_rrset.h:92
I/O port for perf.
Definition: perf.c:131
char * str
first string
Definition: config_file.h:735
uint16_t arcount
count of RRs, host format
Definition: msgparse.h:107
#define PACKED_RRSET_FIXEDTTL
This rrset is considered to have a fixed TTL; its TTL doesn't have to be updated on encoding in a rep...
Definition: packed_rrset.h:63
static void config_tag_test(void)
test config_file: test tag code
Definition: unitmain.c:385
int upstream_is_tls
if the log server is connected to over TLS.
Definition: dtstream.h:196
const char ** as112_zones
Array of text-format domain names of the AS112 zones.
Definition: as112.c:143
key for ip_ratelimit lookups, a source IP.
Definition: infra.h:158
uint8_t * ttl_data
Pointer to the RR.
Definition: msgparse.h:187
int val_neg_zone_compare(const void *a, const void *b)
Comparison function for rbtree val neg zone elements.
Definition: val_neg.c:73
int rttvar
smoothed mean deviation, in milliseconds
Definition: rtt.h:53
rbtree_type super_set
set of superstates (that want this state's result) contains struct mesh_state_ref*
Definition: mesh.h:181
struct auth_zone * auth_zone_find(struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass)
find an auth zone by name (exact match by name or NULL returned)
Definition: authzone.c:444
long long msg_cache_count
number of message cache entries
Definition: unbound.h:749
@ comm_tcp
TCP handler socket - handle byteperbyte readwrite.
Definition: netevent.h:231
An RRset can be represented using both key and data together.
Definition: packed_rrset.h:266
struct tcp_req_done_item * next
next in list
Definition: listen_dnsport.h:292
void log_set_time_asc(int use_asc)
Set if the time value is printed ascii or decimal in log entries.
Definition: log.c:203
The library-worker status structure Internal to the worker.
Definition: libworker.h:68
static int smart_compare(sldns_buffer *pkt, uint8_t *dnow, uint8_t *dprfirst, uint8_t *dprlast)
smart comparison of (compressed, valid) dnames from packet
Definition: msgparse.c:53
void auth_xfer_probe_lookup_callback(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *why_bogus, int was_ratelimited)
mesh callback for task_probe on lookup of host names
static void serviced_callbacks(struct serviced_query *sq, int error, struct comm_point *c, struct comm_reply *rep)
call the callbacks for a serviced query
Definition: outside_network.c:1713