2 * libunbound/worker.c - worker thread or process that resolves
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
6 * This software is open source.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
39 * This file contains the worker process or thread that performs
40 * the DNS resolving and validation. The worker is called by a procedure
41 * and if in the background continues until exit, if in the foreground
42 * returns from the procedure when done.
45 #include <ldns/dname.h>
46 #include <ldns/wire2host.h>
48 #include <openssl/ssl.h>
50 #include "libunbound/libworker.h"
51 #include "libunbound/context.h"
52 #include "libunbound/unbound.h"
53 #include "services/outside_network.h"
54 #include "services/mesh.h"
55 #include "services/localzone.h"
56 #include "services/cache/rrset.h"
57 #include "services/outbound_list.h"
58 #include "util/module.h"
59 #include "util/regional.h"
60 #include "util/random.h"
61 #include "util/config_file.h"
62 #include "util/netevent.h"
63 #include "util/storage/lookup3.h"
64 #include "util/storage/slabhash.h"
65 #include "util/net_help.h"
66 #include "util/data/dname.h"
67 #include "util/data/msgreply.h"
68 #include "util/data/msgencode.h"
69 #include "util/tube.h"
70 #include "iterator/iter_fwd.h"
71 #include "iterator/iter_hints.h"
73 /** handle new query command for bg worker */
74 static void handle_newq(struct libworker* w, uint8_t* buf, uint32_t len);
76 /** delete libworker struct */
78 libworker_delete(struct libworker* w)
82 outside_network_quit_prepare(w->back);
83 mesh_delete(w->env->mesh);
84 context_release_alloc(w->ctx, w->env->alloc,
85 !w->is_bg || w->is_bg_thread);
86 ldns_buffer_free(w->env->scratch_buffer);
87 regional_destroy(w->env->scratch);
88 forwards_delete(w->env->fwds);
89 hints_delete(w->env->hints);
90 ub_randfree(w->env->rnd);
94 SSL_CTX_free(w->sslctx);
96 outside_network_delete(w->back);
97 comm_base_delete(w->base);
101 /** setup fresh libworker struct */
102 static struct libworker*
103 libworker_setup(struct ub_ctx* ctx, int is_bg)
106 struct libworker* w = (struct libworker*)calloc(1, sizeof(*w));
107 struct config_file* cfg = ctx->env->cfg;
113 w->env = (struct module_env*)malloc(sizeof(*w->env));
119 w->env->alloc = context_obtain_alloc(ctx, !w->is_bg || w->is_bg_thread);
124 w->thread_num = w->env->alloc->thread_num;
125 alloc_set_id_cleanup(w->env->alloc, &libworker_alloc_cleanup, w);
126 if(!w->is_bg || w->is_bg_thread) {
127 lock_basic_lock(&ctx->cfglock);
129 w->env->scratch = regional_create_custom(cfg->msg_buffer_size);
130 w->env->scratch_buffer = ldns_buffer_new(cfg->msg_buffer_size);
131 w->env->fwds = forwards_create();
132 if(w->env->fwds && !forwards_apply_cfg(w->env->fwds, cfg)) {
133 forwards_delete(w->env->fwds);
136 w->env->hints = hints_create();
137 if(w->env->hints && !hints_apply_cfg(w->env->hints, cfg)) {
138 hints_delete(w->env->hints);
139 w->env->hints = NULL;
141 if(cfg->ssl_upstream) {
142 w->sslctx = connect_sslctx_create(NULL, NULL, NULL);
144 /* to make the setup fail after unlock */
145 hints_delete(w->env->hints);
146 w->env->hints = NULL;
149 if(!w->is_bg || w->is_bg_thread) {
150 lock_basic_unlock(&ctx->cfglock);
152 if(!w->env->scratch || !w->env->scratch_buffer || !w->env->fwds ||
157 w->env->worker = (struct worker*)w;
158 w->env->probe_timer = NULL;
159 seed = (unsigned int)time(NULL) ^ (unsigned int)getpid() ^
160 (((unsigned int)w->thread_num)<<17);
161 seed ^= (unsigned int)w->env->alloc->next_id;
162 if(!w->is_bg || w->is_bg_thread) {
163 lock_basic_lock(&ctx->cfglock);
165 if(!(w->env->rnd = ub_initstate(seed, ctx->seed_rnd))) {
166 if(!w->is_bg || w->is_bg_thread) {
167 lock_basic_unlock(&ctx->cfglock);
173 if(!w->is_bg || w->is_bg_thread) {
174 lock_basic_unlock(&ctx->cfglock);
177 /* primitive lockout for threading: if it overwrites another
178 * thread it is like wiping the cache (which is likely empty
180 /* note we are holding the ctx lock in normal threaded
181 * cases so that is solved properly, it is only for many ctx
182 * in different threads that this may clash */
183 static int done_raninit = 0;
186 hash_set_raninit((uint32_t)ub_random(w->env->rnd));
191 w->base = comm_base_create(0);
196 if(!w->is_bg || w->is_bg_thread) {
197 lock_basic_lock(&ctx->cfglock);
199 numports = cfg_condense_ports(cfg, &ports);
204 w->back = outside_network_create(w->base, cfg->msg_buffer_size,
205 (size_t)cfg->outgoing_num_ports, cfg->out_ifs,
206 cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6,
207 cfg->do_tcp?cfg->outgoing_num_tcp:0,
208 w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
209 ports, numports, cfg->unwanted_threshold,
210 &libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx);
211 if(!w->is_bg || w->is_bg_thread) {
212 lock_basic_unlock(&ctx->cfglock);
219 w->env->mesh = mesh_create(&ctx->mods, w->env);
224 w->env->send_query = &libworker_send_query;
225 w->env->detach_subs = &mesh_detach_subs;
226 w->env->attach_sub = &mesh_attach_sub;
227 w->env->kill_sub = &mesh_state_delete;
228 w->env->detect_cycle = &mesh_detect_cycle;
229 comm_base_timept(w->base, &w->env->now, &w->env->now_tv);
233 /** handle cancel command for bg worker */
235 handle_cancel(struct libworker* w, uint8_t* buf, uint32_t len)
238 if(w->is_bg_thread) {
239 lock_basic_lock(&w->ctx->cfglock);
240 q = context_deserialize_cancel(w->ctx, buf, len);
241 lock_basic_unlock(&w->ctx->cfglock);
243 q = context_deserialize_cancel(w->ctx, buf, len);
246 /* probably simply lookup failed, i.e. the message had been
247 * processed and answered before the cancel arrived */
254 /** do control command coming into bg server */
256 libworker_do_cmd(struct libworker* w, uint8_t* msg, uint32_t len)
258 switch(context_serial_getcmd(msg, len)) {
260 case UB_LIBCMD_ANSWER:
261 log_err("unknown command for bg worker %d",
262 (int)context_serial_getcmd(msg, len));
263 /* and fall through to quit */
266 comm_base_exit(w->base);
268 case UB_LIBCMD_NEWQUERY:
269 handle_newq(w, msg, len);
271 case UB_LIBCMD_CANCEL:
272 handle_cancel(w, msg, len);
277 /** handle control command coming into server */
279 libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
280 uint8_t* msg, size_t len, int err, void* arg)
282 struct libworker* w = (struct libworker*)arg;
286 /* it is of no use to go on, exit */
287 comm_base_exit(w->base);
290 libworker_do_cmd(w, msg, len); /* also frees the buf */
293 /** the background thread func */
295 libworker_dobg(void* arg)
299 struct libworker* w = (struct libworker*)arg;
302 log_err("libunbound bg worker init failed, nomem");
306 log_thread_set(&w->thread_num);
307 #ifdef THREADS_DISABLED
310 /* close non-used parts of the pipes */
311 tube_close_write(ctx->qq_pipe);
312 tube_close_read(ctx->rr_pipe);
314 if(!tube_setup_bg_listen(ctx->qq_pipe, w->base,
315 libworker_handle_control_cmd, w)) {
316 log_err("libunbound bg worker init failed, no bglisten");
319 if(!tube_setup_bg_write(ctx->rr_pipe, w->base)) {
320 log_err("libunbound bg worker init failed, no bgwrite");
325 comm_base_dispatch(w->base);
329 tube_remove_bg_listen(w->ctx->qq_pipe);
330 tube_remove_bg_write(w->ctx->rr_pipe);
332 (void)tube_write_msg(ctx->rr_pipe, (uint8_t*)&m,
333 (uint32_t)sizeof(m), 0);
334 #ifdef THREADS_DISABLED
335 /* close pipes from forked process before exit */
336 tube_close_read(ctx->qq_pipe);
337 tube_close_write(ctx->rr_pipe);
342 int libworker_bg(struct ub_ctx* ctx)
345 /* fork or threadcreate */
346 lock_basic_lock(&ctx->cfglock);
348 lock_basic_unlock(&ctx->cfglock);
349 w = libworker_setup(ctx, 1);
350 if(!w) return UB_NOMEM;
352 #ifdef ENABLE_LOCK_CHECKS
353 w->thread_num = 1; /* for nicer DEBUG checklocks */
355 ub_thread_create(&ctx->bg_tid, libworker_dobg, w);
357 lock_basic_unlock(&ctx->cfglock);
359 /* no fork on windows */
361 #else /* HAVE_FORK */
362 switch((ctx->bg_pid=fork())) {
364 w = libworker_setup(ctx, 1);
365 if(!w) fatal_exit("out of memory");
366 /* close non-used parts of the pipes */
367 tube_close_write(ctx->qq_pipe);
368 tube_close_read(ctx->rr_pipe);
369 (void)libworker_dobg(w);
377 #endif /* HAVE_FORK */
382 /** get msg reply struct (in temp region) */
383 static struct reply_info*
384 parse_reply(ldns_buffer* pkt, struct regional* region, struct query_info* qi)
386 struct reply_info* rep;
387 struct msg_parse* msg;
388 if(!(msg = regional_alloc(region, sizeof(*msg)))) {
391 memset(msg, 0, sizeof(*msg));
392 ldns_buffer_set_position(pkt, 0);
393 if(parse_packet(pkt, msg, region) != 0)
395 if(!parse_create_msg(pkt, msg, NULL, qi, &rep, region)) {
401 /** insert canonname */
403 fill_canon(struct ub_result* res, uint8_t* s)
407 res->canonname = strdup(buf);
408 return res->canonname != 0;
411 /** fill data into result */
413 fill_res(struct ub_result* res, struct ub_packed_rrset_key* answer,
414 uint8_t* finalcname, struct query_info* rq, struct reply_info* rep)
417 struct packed_rrset_data* data;
421 if(!fill_canon(res, finalcname))
422 return 0; /* out of memory */
424 if(rep->rrset_count != 0)
425 res->ttl = (int)rep->ttl;
426 res->data = (char**)calloc(1, sizeof(char*));
427 res->len = (int*)calloc(1, sizeof(int));
428 return (res->data && res->len);
430 data = (struct packed_rrset_data*)answer->entry.data;
431 if(query_dname_compare(rq->qname, answer->rk.dname) != 0) {
432 if(!fill_canon(res, answer->rk.dname))
433 return 0; /* out of memory */
434 } else res->canonname = NULL;
435 res->data = (char**)calloc(data->count+1, sizeof(char*));
436 res->len = (int*)calloc(data->count+1, sizeof(int));
437 if(!res->data || !res->len)
438 return 0; /* out of memory */
439 for(i=0; i<data->count; i++) {
440 /* remove rdlength from rdata */
441 res->len[i] = (int)(data->rr_len[i] - 2);
442 res->data[i] = memdup(data->rr_data[i]+2, (size_t)res->len[i]);
444 return 0; /* out of memory */
446 /* ttl for positive answers, from CNAME and answer RRs */
447 if(data->count != 0) {
449 res->ttl = (int)data->ttl;
450 for(j=0; j<rep->an_numrrsets; j++) {
451 struct packed_rrset_data* d =
452 (struct packed_rrset_data*)rep->rrsets[j]->
454 if((int)d->ttl < res->ttl)
455 res->ttl = (int)d->ttl;
458 /* ttl for negative answers */
459 if(data->count == 0 && rep->rrset_count != 0)
460 res->ttl = (int)rep->ttl;
461 res->data[data->count] = NULL;
462 res->len[data->count] = 0;
466 /** fill result from parsed message, on error fills servfail */
468 libworker_enter_result(struct ub_result* res, ldns_buffer* buf,
469 struct regional* temp, enum sec_status msg_security)
471 struct query_info rq;
472 struct reply_info* rep;
473 res->rcode = LDNS_RCODE_SERVFAIL;
474 rep = parse_reply(buf, temp, &rq);
476 log_err("cannot parse buf");
477 return; /* error parsing buf, or out of memory */
479 if(!fill_res(res, reply_find_answer_rrset(&rq, rep),
480 reply_find_final_cname_target(&rq, rep), &rq, rep))
481 return; /* out of memory */
482 /* rcode, havedata, nxdomain, secure, bogus */
483 res->rcode = (int)FLAGS_GET_RCODE(rep->flags);
484 if(res->data && res->data[0])
486 if(res->rcode == LDNS_RCODE_NXDOMAIN)
488 if(msg_security == sec_status_secure)
490 if(msg_security == sec_status_bogus)
494 /** fillup fg results */
496 libworker_fillup_fg(struct ctx_query* q, int rcode, ldns_buffer* buf,
497 enum sec_status s, char* why_bogus)
500 q->res->why_bogus = strdup(why_bogus);
502 q->res->rcode = rcode;
507 q->res->rcode = LDNS_RCODE_SERVFAIL;
509 q->msg = memdup(ldns_buffer_begin(buf), ldns_buffer_limit(buf));
510 q->msg_len = ldns_buffer_limit(buf);
512 return; /* the error is in the rcode */
515 /* canonname and results */
517 libworker_enter_result(q->res, buf, q->w->env->scratch, s);
521 libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s,
524 struct ctx_query* q = (struct ctx_query*)arg;
525 /* fg query is done; exit comm base */
526 comm_base_exit(q->w->base);
528 libworker_fillup_fg(q, rcode, buf, s, why_bogus);
531 /** setup qinfo and edns */
533 setup_qinfo_edns(struct libworker* w, struct ctx_query* q,
534 struct query_info* qinfo, struct edns_data* edns)
537 qinfo->qtype = (uint16_t)q->res->qtype;
538 qinfo->qclass = (uint16_t)q->res->qclass;
539 rdf = ldns_dname_new_frm_str(q->res->qname);
543 #ifdef UNBOUND_ALLOC_LITE
544 qinfo->qname = memdup(ldns_rdf_data(rdf), ldns_rdf_size(rdf));
545 qinfo->qname_len = ldns_rdf_size(rdf);
546 ldns_rdf_deep_free(rdf);
549 qinfo->qname = ldns_rdf_data(rdf);
550 qinfo->qname_len = ldns_rdf_size(rdf);
552 edns->edns_present = 1;
554 edns->edns_version = 0;
555 edns->bits = EDNS_DO;
556 if(ldns_buffer_capacity(w->back->udp_buff) < 65535)
557 edns->udp_size = (uint16_t)ldns_buffer_capacity(
559 else edns->udp_size = 65535;
564 int libworker_fg(struct ub_ctx* ctx, struct ctx_query* q)
566 struct libworker* w = libworker_setup(ctx, 0);
567 uint16_t qflags, qid;
568 struct query_info qinfo;
569 struct edns_data edns;
572 if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
579 /* see if there is a fixed answer */
580 ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
581 ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
582 if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
583 w->back->udp_buff, w->env->scratch)) {
584 regional_free_all(w->env->scratch);
585 libworker_fillup_fg(q, LDNS_RCODE_NOERROR,
586 w->back->udp_buff, sec_status_insecure, NULL);
591 /* process new query */
592 if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
593 w->back->udp_buff, qid, libworker_fg_done_cb, q)) {
600 comm_base_dispatch(w->base);
606 /** add result to the bg worker result queue */
608 add_bg_result(struct libworker* w, struct ctx_query* q, ldns_buffer* pkt,
609 int err, char* reason)
614 /* serialize and delete unneeded q */
615 if(w->is_bg_thread) {
616 lock_basic_lock(&w->ctx->cfglock);
618 q->res->why_bogus = strdup(reason);
620 q->msg_len = ldns_buffer_remaining(pkt);
621 q->msg = memdup(ldns_buffer_begin(pkt), q->msg_len);
623 msg = context_serialize_answer(q, UB_NOMEM,
625 else msg = context_serialize_answer(q, err,
627 } else msg = context_serialize_answer(q, err, NULL, &len);
628 lock_basic_unlock(&w->ctx->cfglock);
631 q->res->why_bogus = strdup(reason);
632 msg = context_serialize_answer(q, err, pkt, &len);
633 (void)rbtree_delete(&w->ctx->queries, q->node.key);
635 context_query_delete(q);
639 log_err("out of memory for async answer");
642 if(!tube_queue_item(w->ctx->rr_pipe, msg, len)) {
643 log_err("out of memory for async answer");
649 libworker_bg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s,
652 struct ctx_query* q = (struct ctx_query*)arg;
655 if(q->w->is_bg_thread) {
657 struct ub_ctx* ctx = q->w->ctx;
658 lock_basic_lock(&ctx->cfglock);
659 (void)rbtree_delete(&ctx->queries, q->node.key);
661 context_query_delete(q);
662 lock_basic_unlock(&ctx->cfglock);
664 /* cancelled, do not give answer */
669 buf = q->w->env->scratch_buffer;
671 error_encode(buf, rcode, NULL, 0, BIT_RD, NULL);
673 add_bg_result(q->w, q, buf, UB_NOERROR, why_bogus);
677 /** handle new query command for bg worker */
679 handle_newq(struct libworker* w, uint8_t* buf, uint32_t len)
681 uint16_t qflags, qid;
682 struct query_info qinfo;
683 struct edns_data edns;
685 if(w->is_bg_thread) {
686 lock_basic_lock(&w->ctx->cfglock);
687 q = context_lookup_new_query(w->ctx, buf, len);
688 lock_basic_unlock(&w->ctx->cfglock);
690 q = context_deserialize_new_query(w->ctx, buf, len);
694 log_err("failed to deserialize newq");
697 if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
698 add_bg_result(w, q, NULL, UB_SYNTAX, NULL);
703 /* see if there is a fixed answer */
704 ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
705 ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
706 if(local_zones_answer(w->ctx->local_zones, &qinfo, &edns,
707 w->back->udp_buff, w->env->scratch)) {
708 regional_free_all(w->env->scratch);
709 q->msg_security = sec_status_insecure;
710 add_bg_result(w, q, w->back->udp_buff, UB_NOERROR, NULL);
715 /* process new query */
716 if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
717 w->back->udp_buff, qid, libworker_bg_done_cb, q)) {
718 add_bg_result(w, q, NULL, UB_NOMEM, NULL);
723 void libworker_alloc_cleanup(void* arg)
725 struct libworker* w = (struct libworker*)arg;
726 slabhash_clear(&w->env->rrset_cache->table);
727 slabhash_clear(w->env->msg_cache);
730 struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
731 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
732 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
733 uint8_t* zone, size_t zonelen, struct module_qstate* q)
735 struct libworker* w = (struct libworker*)q->env->worker;
736 struct outbound_entry* e = (struct outbound_entry*)regional_alloc(
737 q->region, sizeof(*e));
741 e->qsent = outnet_serviced_query(w->back, qname,
742 qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
743 q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
744 addrlen, zone, zonelen, libworker_handle_service_reply, e,
753 libworker_handle_reply(struct comm_point* c, void* arg, int error,
754 struct comm_reply* reply_info)
756 struct module_qstate* q = (struct module_qstate*)arg;
757 struct libworker* lw = (struct libworker*)q->env->worker;
758 struct outbound_entry e;
763 mesh_report_reply(lw->env->mesh, &e, reply_info, error);
767 if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
768 || LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
770 || LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
771 /* error becomes timeout for the module as if this reply
773 mesh_report_reply(lw->env->mesh, &e, reply_info,
777 mesh_report_reply(lw->env->mesh, &e, reply_info, NETEVENT_NOERROR);
782 libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
783 struct comm_reply* reply_info)
785 struct outbound_entry* e = (struct outbound_entry*)arg;
786 struct libworker* lw = (struct libworker*)e->qstate->env->worker;
789 mesh_report_reply(lw->env->mesh, e, reply_info, error);
793 if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
794 || LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
796 || LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
797 /* error becomes timeout for the module as if this reply
799 mesh_report_reply(lw->env->mesh, e, reply_info,
803 mesh_report_reply(lw->env->mesh, e, reply_info, NETEVENT_NOERROR);
807 /* --- fake callbacks for fptr_wlist to work --- */
808 void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
809 uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
810 int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
815 int worker_handle_request(struct comm_point* ATTR_UNUSED(c),
816 void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
817 struct comm_reply* ATTR_UNUSED(repinfo))
823 int worker_handle_reply(struct comm_point* ATTR_UNUSED(c),
824 void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
825 struct comm_reply* ATTR_UNUSED(reply_info))
831 int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
832 void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
833 struct comm_reply* ATTR_UNUSED(reply_info))
839 int remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
840 void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
841 struct comm_reply* ATTR_UNUSED(repinfo))
847 int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
848 void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
849 struct comm_reply* ATTR_UNUSED(repinfo))
855 void worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
860 struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
861 size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
862 uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
863 int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
864 struct sockaddr_storage* ATTR_UNUSED(addr),
865 socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
872 worker_alloc_cleanup(void* ATTR_UNUSED(arg))
877 void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
882 void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
887 void worker_start_accept(void* ATTR_UNUSED(arg))
892 void worker_stop_accept(void* ATTR_UNUSED(arg))
897 int order_lock_cmp(const void* ATTR_UNUSED(e1), const void* ATTR_UNUSED(e2))
904 codeline_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
910 int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
916 void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
923 worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
929 wsvc_cron_cb(void* ATTR_UNUSED(arg))
933 #endif /* UB_ON_WINDOWS */