xref: /freebsd/contrib/unbound/smallapp/worker_cb.c (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
1 /*
2  * smallapp/worker_cb.c - fake callback routines to make fptr_wlist work
3  *
4  * Copyright (c) 2007, NLnet Labs. All rights reserved.
5  *
6  * This software is open source.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
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.
18  *
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.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 /**
37  * \file
38  *
39  * This file contains fake callback functions, so that the symbols exist
40  * and the fptr_wlist continues to work even if the daemon/worker is not
41  * linked into the resulting program.
42  */
43 #include "config.h"
44 #include "libunbound/context.h"
45 #include "libunbound/worker.h"
46 #include "util/fptr_wlist.h"
47 #include "util/log.h"
48 #include "services/mesh.h"
49 #ifdef USE_DNSTAP
50 #include "dnstap/dtstream.h"
51 #endif
52 
53 void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
54 	uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
55 	int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
56 {
57 	log_assert(0);
58 }
59 
60 int worker_handle_request(struct comm_point* ATTR_UNUSED(c),
61 	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
62         struct comm_reply* ATTR_UNUSED(repinfo))
63 {
64 	log_assert(0);
65 	return 0;
66 }
67 
68 int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
69 	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
70         struct comm_reply* ATTR_UNUSED(reply_info))
71 {
72 	log_assert(0);
73 	return 0;
74 }
75 
76 int remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
77 	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
78         struct comm_reply* ATTR_UNUSED(repinfo))
79 {
80 	log_assert(0);
81 	return 0;
82 }
83 
84 int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
85 	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
86         struct comm_reply* ATTR_UNUSED(repinfo))
87 {
88 	log_assert(0);
89 	return 0;
90 }
91 
92 void worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
93 {
94 	log_assert(0);
95 }
96 
97 struct outbound_entry* worker_send_query(
98 	struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
99 	int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
100 	int ATTR_UNUSED(nocaps), int ATTR_UNUSED(check_ratelimit),
101 	struct sockaddr_storage* ATTR_UNUSED(addr),
102 	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
103 	size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
104 	char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q),
105 	int* ATTR_UNUSED(was_ratelimited))
106 {
107 	log_assert(0);
108 	return 0;
109 }
110 
111 #ifdef UB_ON_WINDOWS
112 void
113 worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
114 	ATTR_UNUSED(arg)) {
115 	log_assert(0);
116 }
117 
118 void
119 wsvc_cron_cb(void* ATTR_UNUSED(arg))
120 {
121 	log_assert(0);
122 }
123 #endif /* UB_ON_WINDOWS */
124 
125 void
126 worker_alloc_cleanup(void* ATTR_UNUSED(arg))
127 {
128 	log_assert(0);
129 }
130 
131 struct 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 
145 int 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 
153 void 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 
160 void 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 
167 void 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 
174 void 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 
181 int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
182 {
183 	log_assert(0);
184 	return 0;
185 }
186 
187 void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
188 {
189 	log_assert(0);
190 }
191 
192 void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
193 {
194 	log_assert(0);
195 }
196 
197 void worker_start_accept(void* ATTR_UNUSED(arg))
198 {
199 	log_assert(0);
200 }
201 
202 void worker_stop_accept(void* ATTR_UNUSED(arg))
203 {
204 	log_assert(0);
205 }
206 
207 /** keep track of lock id in lock-verify application */
208 struct order_id {
209         /** the thread id that created it */
210         int thr;
211         /** the instance number of creation */
212         int instance;
213 };
214 
215 int 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 
226 int
227 codeline_cmp(const void* a, const void* b)
228 {
229         return strcmp(a, b);
230 }
231 
232 int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
233 {
234         log_assert(0);
235         return 0;
236 }
237 
238 void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
239 {
240         log_assert(0);
241 }
242 
243 #ifdef USE_DNSTAP
244 void 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
252 void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
253 	void* ATTR_UNUSED(arg))
254 {
255 	log_assert(0);
256 }
257 #endif
258