1280364Sandrew/*
2280364Sandrew * smallapp/worker_cb.c - fake callback routines to make fptr_wlist work
3280364Sandrew *
4280364Sandrew * Copyright (c) 2007, NLnet Labs. All rights reserved.
5280364Sandrew *
6280364Sandrew * This software is open source.
7280364Sandrew *
8280364Sandrew * Redistribution and use in source and binary forms, with or without
9280364Sandrew * modification, are permitted provided that the following conditions
10280364Sandrew * are met:
11280364Sandrew *
12280364Sandrew * Redistributions of source code must retain the above copyright notice,
13280364Sandrew * this list of conditions and the following disclaimer.
14280364Sandrew *
15280364Sandrew * Redistributions in binary form must reproduce the above copyright notice,
16280364Sandrew * this list of conditions and the following disclaimer in the documentation
17280364Sandrew * and/or other materials provided with the distribution.
18280364Sandrew *
19280364Sandrew * Neither the name of the NLNET LABS nor the names of its contributors may
20280364Sandrew * be used to endorse or promote products derived from this software without
21280364Sandrew * specific prior written permission.
22280364Sandrew *
23280364Sandrew * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24280364Sandrew * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25280364Sandrew * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26280364Sandrew * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27280364Sandrew * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28280364Sandrew * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29280364Sandrew * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30280364Sandrew * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31280364Sandrew * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32280364Sandrew * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33280364Sandrew * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34280364Sandrew */
35280364Sandrew
36280364Sandrew/**
37280364Sandrew * \file
38280364Sandrew *
39280364Sandrew * This file contains fake callback functions, so that the symbols exist
40280364Sandrew * and the fptr_wlist continues to work even if the daemon/worker is not
41280364Sandrew * linked into the resulting program.
42280364Sandrew */
43280364Sandrew#include "config.h"
44280364Sandrew#include "libunbound/context.h"
45280364Sandrew#include "libunbound/worker.h"
46280364Sandrew#include "util/fptr_wlist.h"
47280364Sandrew#include "util/log.h"
48280364Sandrew#include "services/mesh.h"
49280364Sandrew#ifdef USE_DNSTAP
50280364Sandrew#include "dnstap/dtstream.h"
51280364Sandrew#endif
52280364Sandrew
53280364Sandrewvoid worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
54280364Sandrew	uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
55280364Sandrew	int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
56280364Sandrew{
57280364Sandrew	log_assert(0);
58280364Sandrew}
59280364Sandrew
60280364Sandrewint worker_handle_request(struct comm_point* ATTR_UNUSED(c),
61280364Sandrew	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
62280364Sandrew        struct comm_reply* ATTR_UNUSED(repinfo))
63280364Sandrew{
64280364Sandrew	log_assert(0);
65280364Sandrew	return 0;
66280364Sandrew}
67280364Sandrew
68280364Sandrewint worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
69280364Sandrew	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
70280364Sandrew        struct comm_reply* ATTR_UNUSED(reply_info))
71280364Sandrew{
72280364Sandrew	log_assert(0);
73280364Sandrew	return 0;
74280364Sandrew}
75280364Sandrew
76280364Sandrewint remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
77280364Sandrew	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
78280364Sandrew        struct comm_reply* ATTR_UNUSED(repinfo))
79280364Sandrew{
80280364Sandrew	log_assert(0);
81280364Sandrew	return 0;
82280364Sandrew}
83280364Sandrew
84280364Sandrewint remote_control_callback(struct comm_point* ATTR_UNUSED(c),
85280364Sandrew	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
86280364Sandrew        struct comm_reply* ATTR_UNUSED(repinfo))
87280364Sandrew{
88280364Sandrew	log_assert(0);
89280364Sandrew	return 0;
90280364Sandrew}
91280364Sandrew
92280364Sandrewvoid worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
93280364Sandrew{
94280364Sandrew	log_assert(0);
95280364Sandrew}
96280364Sandrew
97280364Sandrewstruct outbound_entry* worker_send_query(
98280364Sandrew	struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
99280364Sandrew	int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
100280364Sandrew	int ATTR_UNUSED(nocaps), int ATTR_UNUSED(check_ratelimit),
101280364Sandrew	struct sockaddr_storage* ATTR_UNUSED(addr),
102280364Sandrew	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
103280364Sandrew	size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
104280364Sandrew	char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q),
105280364Sandrew	int* ATTR_UNUSED(was_ratelimited))
106280364Sandrew{
107280364Sandrew	log_assert(0);
108280364Sandrew	return 0;
109280364Sandrew}
110280364Sandrew
111280364Sandrew#ifdef UB_ON_WINDOWS
112280364Sandrewvoid
113280364Sandrewworker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
114280364Sandrew	ATTR_UNUSED(arg)) {
115280364Sandrew	log_assert(0);
116280364Sandrew}
117280364Sandrew
118280364Sandrewvoid
119280364Sandrewwsvc_cron_cb(void* ATTR_UNUSED(arg))
120280364Sandrew{
121280364Sandrew	log_assert(0);
122280364Sandrew}
123#endif /* UB_ON_WINDOWS */
124
125void
126worker_alloc_cleanup(void* ATTR_UNUSED(arg))
127{
128	log_assert(0);
129}
130
131struct outbound_entry* libworker_send_query(
132	struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
133	int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
134	int ATTR_UNUSED(nocaps), int ATTR_UNUSED(check_ratelimit),
135	struct sockaddr_storage* ATTR_UNUSED(addr),
136	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
137	size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
138	char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q),
139	int* ATTR_UNUSED(was_ratelimited))
140{
141	log_assert(0);
142	return 0;
143}
144
145int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
146	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
147        struct comm_reply* ATTR_UNUSED(reply_info))
148{
149	log_assert(0);
150	return 0;
151}
152
153void libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
154        uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
155        int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
156{
157        log_assert(0);
158}
159
160void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
161	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
162	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
163{
164	log_assert(0);
165}
166
167void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
168	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
169	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
170{
171	log_assert(0);
172}
173
174void libworker_event_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
175	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
176	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
177{
178	log_assert(0);
179}
180
181int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
182{
183	log_assert(0);
184	return 0;
185}
186
187void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
188{
189	log_assert(0);
190}
191
192void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
193{
194	log_assert(0);
195}
196
197void worker_start_accept(void* ATTR_UNUSED(arg))
198{
199	log_assert(0);
200}
201
202void worker_stop_accept(void* ATTR_UNUSED(arg))
203{
204	log_assert(0);
205}
206
207/** keep track of lock id in lock-verify application */
208struct order_id {
209        /** the thread id that created it */
210        int thr;
211        /** the instance number of creation */
212        int instance;
213};
214
215int order_lock_cmp(const void* e1, const void* e2)
216{
217        const struct order_id* o1 = e1;
218        const struct order_id* o2 = e2;
219        if(o1->thr < o2->thr) return -1;
220        if(o1->thr > o2->thr) return 1;
221        if(o1->instance < o2->instance) return -1;
222        if(o1->instance > o2->instance) return 1;
223        return 0;
224}
225
226int
227codeline_cmp(const void* a, const void* b)
228{
229        return strcmp(a, b);
230}
231
232int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
233{
234        log_assert(0);
235        return 0;
236}
237
238void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
239{
240        log_assert(0);
241}
242
243#ifdef USE_DNSTAP
244void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
245	void* ATTR_UNUSED(arg))
246{
247	log_assert(0);
248}
249#endif
250
251#ifdef USE_DNSTAP
252void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
253	void* ATTR_UNUSED(arg))
254{
255	log_assert(0);
256}
257#endif
258