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