1933707f3Ssthen /*
2191f22c6Ssthen * smallapp/worker_cb.c - fake callback routines to make fptr_wlist work
3933707f3Ssthen *
4933707f3Ssthen * Copyright (c) 2007, NLnet Labs. All rights reserved.
5933707f3Ssthen *
6933707f3Ssthen * This software is open source.
7933707f3Ssthen *
8933707f3Ssthen * Redistribution and use in source and binary forms, with or without
9933707f3Ssthen * modification, are permitted provided that the following conditions
10933707f3Ssthen * are met:
11933707f3Ssthen *
12933707f3Ssthen * Redistributions of source code must retain the above copyright notice,
13933707f3Ssthen * this list of conditions and the following disclaimer.
14933707f3Ssthen *
15933707f3Ssthen * Redistributions in binary form must reproduce the above copyright notice,
16933707f3Ssthen * this list of conditions and the following disclaimer in the documentation
17933707f3Ssthen * and/or other materials provided with the distribution.
18933707f3Ssthen *
19933707f3Ssthen * Neither the name of the NLNET LABS nor the names of its contributors may
20933707f3Ssthen * be used to endorse or promote products derived from this software without
21933707f3Ssthen * specific prior written permission.
22933707f3Ssthen *
23933707f3Ssthen * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
240b68ff31Ssthen * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
250b68ff31Ssthen * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
260b68ff31Ssthen * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
270b68ff31Ssthen * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
280b68ff31Ssthen * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
290b68ff31Ssthen * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
300b68ff31Ssthen * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
310b68ff31Ssthen * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
320b68ff31Ssthen * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
330b68ff31Ssthen * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34933707f3Ssthen */
35933707f3Ssthen
36933707f3Ssthen /**
37933707f3Ssthen * \file
38933707f3Ssthen *
39933707f3Ssthen * This file contains fake callback functions, so that the symbols exist
40933707f3Ssthen * and the fptr_wlist continues to work even if the daemon/worker is not
41933707f3Ssthen * linked into the resulting program.
42933707f3Ssthen */
43933707f3Ssthen #include "config.h"
44e10d3884Sbrad #include "libunbound/context.h"
45e10d3884Sbrad #include "libunbound/worker.h"
46e10d3884Sbrad #include "util/fptr_wlist.h"
47933707f3Ssthen #include "util/log.h"
48933707f3Ssthen #include "services/mesh.h"
499982a05dSsthen #ifdef USE_DNSTAP
509982a05dSsthen #include "dnstap/dtstream.h"
519982a05dSsthen #endif
52933707f3Ssthen
worker_handle_control_cmd(struct tube * ATTR_UNUSED (tube),uint8_t * ATTR_UNUSED (buffer),size_t ATTR_UNUSED (len),int ATTR_UNUSED (error),void * ATTR_UNUSED (arg))53933707f3Ssthen void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
54933707f3Ssthen uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
55933707f3Ssthen int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
56933707f3Ssthen {
57933707f3Ssthen log_assert(0);
58933707f3Ssthen }
59933707f3Ssthen
worker_handle_request(struct comm_point * ATTR_UNUSED (c),void * ATTR_UNUSED (arg),int ATTR_UNUSED (error),struct comm_reply * ATTR_UNUSED (repinfo))60933707f3Ssthen int worker_handle_request(struct comm_point* ATTR_UNUSED(c),
61933707f3Ssthen void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
62933707f3Ssthen struct comm_reply* ATTR_UNUSED(repinfo))
63933707f3Ssthen {
64933707f3Ssthen log_assert(0);
65933707f3Ssthen return 0;
66933707f3Ssthen }
67933707f3Ssthen
worker_handle_service_reply(struct comm_point * ATTR_UNUSED (c),void * ATTR_UNUSED (arg),int ATTR_UNUSED (error),struct comm_reply * ATTR_UNUSED (reply_info))68933707f3Ssthen int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
69933707f3Ssthen void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
70933707f3Ssthen struct comm_reply* ATTR_UNUSED(reply_info))
71933707f3Ssthen {
72933707f3Ssthen log_assert(0);
73933707f3Ssthen return 0;
74933707f3Ssthen }
75933707f3Ssthen
remote_accept_callback(struct comm_point * ATTR_UNUSED (c),void * ATTR_UNUSED (arg),int ATTR_UNUSED (error),struct comm_reply * ATTR_UNUSED (repinfo))76933707f3Ssthen int remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
77933707f3Ssthen void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
78933707f3Ssthen struct comm_reply* ATTR_UNUSED(repinfo))
79933707f3Ssthen {
80933707f3Ssthen log_assert(0);
81933707f3Ssthen return 0;
82933707f3Ssthen }
83933707f3Ssthen
remote_control_callback(struct comm_point * ATTR_UNUSED (c),void * ATTR_UNUSED (arg),int ATTR_UNUSED (error),struct comm_reply * ATTR_UNUSED (repinfo))84933707f3Ssthen int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
85933707f3Ssthen void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
86933707f3Ssthen struct comm_reply* ATTR_UNUSED(repinfo))
87933707f3Ssthen {
88933707f3Ssthen log_assert(0);
89933707f3Ssthen return 0;
90933707f3Ssthen }
91933707f3Ssthen
worker_sighandler(int ATTR_UNUSED (sig),void * ATTR_UNUSED (arg))92933707f3Ssthen void worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
93933707f3Ssthen {
94933707f3Ssthen log_assert(0);
95933707f3Ssthen }
96933707f3Ssthen
worker_send_query(struct query_info * ATTR_UNUSED (qinfo),uint16_t ATTR_UNUSED (flags),int ATTR_UNUSED (dnssec),int ATTR_UNUSED (want_dnssec),int ATTR_UNUSED (nocaps),int ATTR_UNUSED (check_ratelimit),struct sockaddr_storage * ATTR_UNUSED (addr),socklen_t ATTR_UNUSED (addrlen),uint8_t * ATTR_UNUSED (zone),size_t ATTR_UNUSED (zonelen),int ATTR_UNUSED (tcp_upstream),int ATTR_UNUSED (ssl_upstream),char * ATTR_UNUSED (tls_auth_name),struct module_qstate * ATTR_UNUSED (q),int * ATTR_UNUSED (was_ratelimited))9777079be7Ssthen struct outbound_entry* worker_send_query(
9877079be7Ssthen struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
99933707f3Ssthen int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
100*e21c60efSsthen int ATTR_UNUSED(nocaps), int ATTR_UNUSED(check_ratelimit),
101*e21c60efSsthen struct sockaddr_storage* ATTR_UNUSED(addr),
102e10d3884Sbrad socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
103*e21c60efSsthen size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
104*e21c60efSsthen char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q),
105*e21c60efSsthen int* ATTR_UNUSED(was_ratelimited))
106933707f3Ssthen {
107933707f3Ssthen log_assert(0);
108933707f3Ssthen return 0;
109933707f3Ssthen }
110933707f3Ssthen
111933707f3Ssthen #ifdef UB_ON_WINDOWS
112933707f3Ssthen void
worker_win_stop_cb(int ATTR_UNUSED (fd),short ATTR_UNUSED (ev),void * ATTR_UNUSED (arg))113933707f3Ssthen worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
114933707f3Ssthen ATTR_UNUSED(arg)) {
115933707f3Ssthen log_assert(0);
116933707f3Ssthen }
117933707f3Ssthen
118933707f3Ssthen void
wsvc_cron_cb(void * ATTR_UNUSED (arg))119933707f3Ssthen wsvc_cron_cb(void* ATTR_UNUSED(arg))
120933707f3Ssthen {
121933707f3Ssthen log_assert(0);
122933707f3Ssthen }
123933707f3Ssthen #endif /* UB_ON_WINDOWS */
124933707f3Ssthen
125933707f3Ssthen void
worker_alloc_cleanup(void * ATTR_UNUSED (arg))126933707f3Ssthen worker_alloc_cleanup(void* ATTR_UNUSED(arg))
127933707f3Ssthen {
128933707f3Ssthen log_assert(0);
129933707f3Ssthen }
130933707f3Ssthen
libworker_send_query(struct query_info * ATTR_UNUSED (qinfo),uint16_t ATTR_UNUSED (flags),int ATTR_UNUSED (dnssec),int ATTR_UNUSED (want_dnssec),int ATTR_UNUSED (nocaps),int ATTR_UNUSED (check_ratelimit),struct sockaddr_storage * ATTR_UNUSED (addr),socklen_t ATTR_UNUSED (addrlen),uint8_t * ATTR_UNUSED (zone),size_t ATTR_UNUSED (zonelen),int ATTR_UNUSED (tcp_upstream),int ATTR_UNUSED (ssl_upstream),char * ATTR_UNUSED (tls_auth_name),struct module_qstate * ATTR_UNUSED (q),int * ATTR_UNUSED (was_ratelimited))13177079be7Ssthen struct outbound_entry* libworker_send_query(
13277079be7Ssthen struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
133933707f3Ssthen int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
134*e21c60efSsthen int ATTR_UNUSED(nocaps), int ATTR_UNUSED(check_ratelimit),
135*e21c60efSsthen struct sockaddr_storage* ATTR_UNUSED(addr),
136e10d3884Sbrad socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
137*e21c60efSsthen size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
138*e21c60efSsthen char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q),
139*e21c60efSsthen int* ATTR_UNUSED(was_ratelimited))
140933707f3Ssthen {
141933707f3Ssthen log_assert(0);
142933707f3Ssthen return 0;
143933707f3Ssthen }
144933707f3Ssthen
libworker_handle_service_reply(struct comm_point * ATTR_UNUSED (c),void * ATTR_UNUSED (arg),int ATTR_UNUSED (error),struct comm_reply * ATTR_UNUSED (reply_info))145933707f3Ssthen int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
146933707f3Ssthen void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
147933707f3Ssthen struct comm_reply* ATTR_UNUSED(reply_info))
148933707f3Ssthen {
149933707f3Ssthen log_assert(0);
150933707f3Ssthen return 0;
151933707f3Ssthen }
152933707f3Ssthen
libworker_handle_control_cmd(struct tube * ATTR_UNUSED (tube),uint8_t * ATTR_UNUSED (buffer),size_t ATTR_UNUSED (len),int ATTR_UNUSED (error),void * ATTR_UNUSED (arg))153933707f3Ssthen void libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
154933707f3Ssthen uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
155933707f3Ssthen int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
156933707f3Ssthen {
157933707f3Ssthen log_assert(0);
158933707f3Ssthen }
159933707f3Ssthen
libworker_fg_done_cb(void * ATTR_UNUSED (arg),int ATTR_UNUSED (rcode),struct sldns_buffer * ATTR_UNUSED (buf),enum sec_status ATTR_UNUSED (s),char * ATTR_UNUSED (why_bogus),int ATTR_UNUSED (was_ratelimited))160933707f3Ssthen void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
1610b68ff31Ssthen struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
1622308e98cSsthen char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
163933707f3Ssthen {
164933707f3Ssthen log_assert(0);
165933707f3Ssthen }
166933707f3Ssthen
libworker_bg_done_cb(void * ATTR_UNUSED (arg),int ATTR_UNUSED (rcode),struct sldns_buffer * ATTR_UNUSED (buf),enum sec_status ATTR_UNUSED (s),char * ATTR_UNUSED (why_bogus),int ATTR_UNUSED (was_ratelimited))167933707f3Ssthen void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
1680b68ff31Ssthen struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
1692308e98cSsthen char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
1700b68ff31Ssthen {
1710b68ff31Ssthen log_assert(0);
1720b68ff31Ssthen }
1730b68ff31Ssthen
libworker_event_done_cb(void * ATTR_UNUSED (arg),int ATTR_UNUSED (rcode),struct sldns_buffer * ATTR_UNUSED (buf),enum sec_status ATTR_UNUSED (s),char * ATTR_UNUSED (why_bogus),int ATTR_UNUSED (was_ratelimited))1740b68ff31Ssthen void libworker_event_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
1750b68ff31Ssthen struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
1762308e98cSsthen char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
177933707f3Ssthen {
178933707f3Ssthen log_assert(0);
179933707f3Ssthen }
180933707f3Ssthen
context_query_cmp(const void * ATTR_UNUSED (a),const void * ATTR_UNUSED (b))181933707f3Ssthen int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
182933707f3Ssthen {
183933707f3Ssthen log_assert(0);
184933707f3Ssthen return 0;
185933707f3Ssthen }
186933707f3Ssthen
worker_stat_timer_cb(void * ATTR_UNUSED (arg))187933707f3Ssthen void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
188933707f3Ssthen {
189933707f3Ssthen log_assert(0);
190933707f3Ssthen }
191933707f3Ssthen
worker_probe_timer_cb(void * ATTR_UNUSED (arg))192933707f3Ssthen void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
193933707f3Ssthen {
194933707f3Ssthen log_assert(0);
195933707f3Ssthen }
196933707f3Ssthen
worker_start_accept(void * ATTR_UNUSED (arg))197af4988b1Ssthen void worker_start_accept(void* ATTR_UNUSED(arg))
198af4988b1Ssthen {
199af4988b1Ssthen log_assert(0);
200af4988b1Ssthen }
201af4988b1Ssthen
worker_stop_accept(void * ATTR_UNUSED (arg))202af4988b1Ssthen void worker_stop_accept(void* ATTR_UNUSED(arg))
203af4988b1Ssthen {
204af4988b1Ssthen log_assert(0);
205af4988b1Ssthen }
206af4988b1Ssthen
207933707f3Ssthen /** keep track of lock id in lock-verify application */
208933707f3Ssthen struct order_id {
209933707f3Ssthen /** the thread id that created it */
210933707f3Ssthen int thr;
211933707f3Ssthen /** the instance number of creation */
212933707f3Ssthen int instance;
213933707f3Ssthen };
214933707f3Ssthen
order_lock_cmp(const void * e1,const void * e2)215933707f3Ssthen int order_lock_cmp(const void* e1, const void* e2)
216933707f3Ssthen {
21777079be7Ssthen const struct order_id* o1 = e1;
21877079be7Ssthen const struct order_id* o2 = e2;
219933707f3Ssthen if(o1->thr < o2->thr) return -1;
220933707f3Ssthen if(o1->thr > o2->thr) return 1;
221933707f3Ssthen if(o1->instance < o2->instance) return -1;
222933707f3Ssthen if(o1->instance > o2->instance) return 1;
223933707f3Ssthen return 0;
224933707f3Ssthen }
225933707f3Ssthen
226933707f3Ssthen int
codeline_cmp(const void * a,const void * b)227933707f3Ssthen codeline_cmp(const void* a, const void* b)
228933707f3Ssthen {
22977079be7Ssthen return strcmp(a, b);
230933707f3Ssthen }
231933707f3Ssthen
replay_var_compare(const void * ATTR_UNUSED (a),const void * ATTR_UNUSED (b))232933707f3Ssthen int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
233933707f3Ssthen {
234933707f3Ssthen log_assert(0);
235933707f3Ssthen return 0;
236933707f3Ssthen }
237933707f3Ssthen
remote_get_opt_ssl(char * ATTR_UNUSED (str),void * ATTR_UNUSED (arg))238933707f3Ssthen void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
239933707f3Ssthen {
240933707f3Ssthen log_assert(0);
241933707f3Ssthen }
242a3167c07Ssthen
243a3167c07Ssthen #ifdef USE_DNSTAP
dtio_tap_callback(int ATTR_UNUSED (fd),short ATTR_UNUSED (ev),void * ATTR_UNUSED (arg))244a3167c07Ssthen void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
245a3167c07Ssthen void* ATTR_UNUSED(arg))
246a3167c07Ssthen {
247a3167c07Ssthen log_assert(0);
248a3167c07Ssthen }
249a3167c07Ssthen #endif
250a3167c07Ssthen
251a3167c07Ssthen #ifdef USE_DNSTAP
dtio_mainfdcallback(int ATTR_UNUSED (fd),short ATTR_UNUSED (ev),void * ATTR_UNUSED (arg))252a3167c07Ssthen void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
253a3167c07Ssthen void* ATTR_UNUSED(arg))
254a3167c07Ssthen {
255a3167c07Ssthen log_assert(0);
256a3167c07Ssthen }
257a3167c07Ssthen #endif
258