xref: /freebsd/contrib/unbound/smallapp/worker_cb.c (revision 43a5ec4eb41567cc92586503212743d89686d78f)
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), struct sockaddr_storage* ATTR_UNUSED(addr),
101 	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
102 	size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
103 	char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q))
104 {
105 	log_assert(0);
106 	return 0;
107 }
108 
109 #ifdef UB_ON_WINDOWS
110 void
111 worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
112 	ATTR_UNUSED(arg)) {
113 	log_assert(0);
114 }
115 
116 void
117 wsvc_cron_cb(void* ATTR_UNUSED(arg))
118 {
119 	log_assert(0);
120 }
121 #endif /* UB_ON_WINDOWS */
122 
123 void
124 worker_alloc_cleanup(void* ATTR_UNUSED(arg))
125 {
126 	log_assert(0);
127 }
128 
129 struct outbound_entry* libworker_send_query(
130 	struct query_info* ATTR_UNUSED(qinfo), uint16_t ATTR_UNUSED(flags),
131 	int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
132 	int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
133 	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
134 	size_t ATTR_UNUSED(zonelen), int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
135 	char* ATTR_UNUSED(tls_auth_name), struct module_qstate* ATTR_UNUSED(q))
136 {
137 	log_assert(0);
138 	return 0;
139 }
140 
141 int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
142 	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
143         struct comm_reply* ATTR_UNUSED(reply_info))
144 {
145 	log_assert(0);
146 	return 0;
147 }
148 
149 void libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
150         uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
151         int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
152 {
153         log_assert(0);
154 }
155 
156 void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
157 	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
158 	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
159 {
160 	log_assert(0);
161 }
162 
163 void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
164 	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
165 	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
166 {
167 	log_assert(0);
168 }
169 
170 void libworker_event_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
171 	struct sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
172 	char* ATTR_UNUSED(why_bogus), int ATTR_UNUSED(was_ratelimited))
173 {
174 	log_assert(0);
175 }
176 
177 int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
178 {
179 	log_assert(0);
180 	return 0;
181 }
182 
183 void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
184 {
185 	log_assert(0);
186 }
187 
188 void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
189 {
190 	log_assert(0);
191 }
192 
193 void worker_start_accept(void* ATTR_UNUSED(arg))
194 {
195 	log_assert(0);
196 }
197 
198 void worker_stop_accept(void* ATTR_UNUSED(arg))
199 {
200 	log_assert(0);
201 }
202 
203 /** keep track of lock id in lock-verify application */
204 struct order_id {
205         /** the thread id that created it */
206         int thr;
207         /** the instance number of creation */
208         int instance;
209 };
210 
211 int order_lock_cmp(const void* e1, const void* e2)
212 {
213         const struct order_id* o1 = e1;
214         const struct order_id* o2 = e2;
215         if(o1->thr < o2->thr) return -1;
216         if(o1->thr > o2->thr) return 1;
217         if(o1->instance < o2->instance) return -1;
218         if(o1->instance > o2->instance) return 1;
219         return 0;
220 }
221 
222 int
223 codeline_cmp(const void* a, const void* b)
224 {
225         return strcmp(a, b);
226 }
227 
228 int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
229 {
230         log_assert(0);
231         return 0;
232 }
233 
234 void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
235 {
236         log_assert(0);
237 }
238 
239 #ifdef USE_DNSTAP
240 void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
241 	void* ATTR_UNUSED(arg))
242 {
243 	log_assert(0);
244 }
245 #endif
246 
247 #ifdef USE_DNSTAP
248 void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
249 	void* ATTR_UNUSED(arg))
250 {
251 	log_assert(0);
252 }
253 #endif
254