Electroneum
fptr_wlist.h
Go to the documentation of this file.
1 /*
2  * util/fptr_wlist.h - function pointer whitelists.
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 
55 #ifndef UTIL_FPTR_WLIST_H
56 #define UTIL_FPTR_WLIST_H
57 #include "util/netevent.h"
58 #include "util/storage/lruhash.h"
59 #include "util/module.h"
60 #include "util/tube.h"
61 #include "services/mesh.h"
62 
67 #if defined(EXPORT_ALL_SYMBOLS)
68 #define fptr_ok(x) /* nothing, dll-exe memory layout on win disables it */
69 #else
70 #define fptr_ok(x) \
71  do { if(!(x)) \
72  fatal_exit("%s:%d: %s: pointer whitelist %s failed", \
73  __FILE__, __LINE__, __func__, #x); \
74  } while(0);
75 #endif
76 
84 
92 
99 int fptr_whitelist_comm_timer(void (*fptr)(void*));
100 
107 int fptr_whitelist_comm_signal(void (*fptr)(int, void*));
108 
115 int fptr_whitelist_start_accept(void (*fptr)(void*));
116 
123 int fptr_whitelist_stop_accept(void (*fptr)(void*));
124 
132 int fptr_whitelist_event(void (*fptr)(int, short, void *));
133 
141 
149 
157 
164 int fptr_whitelist_rbtree_cmp(int (*fptr) (const void *, const void *));
165 
173 
181 
189 
197 
205 
213  struct query_info* qinfo, uint16_t flags, int dnssec, int want_dnssec,
214  int nocaps, struct sockaddr_storage* addr, socklen_t addrlen,
215  uint8_t* zone, size_t zonelen, int ssl_upstream, char* tls_auth_name,
216  struct module_qstate* q));
217 
224 int fptr_whitelist_modenv_detach_subs(void (*fptr)(
225  struct module_qstate* qstate));
226 
233 int fptr_whitelist_modenv_attach_sub(int (*fptr)(
234  struct module_qstate* qstate, struct query_info* qinfo,
235  uint16_t qflags, int prime, int valrec, struct module_qstate** newq));
236 
243 int fptr_whitelist_modenv_add_sub(int (*fptr)(struct module_qstate* qstate,
244  struct query_info* qinfo, uint16_t qflags, int prime, int valrec,
245  struct module_qstate** newq, struct mesh_state** sub));
252 int fptr_whitelist_modenv_kill_sub(void (*fptr)(struct module_qstate* newq));
253 
260 int fptr_whitelist_modenv_detect_cycle(int (*fptr)(
261  struct module_qstate* qstate, struct query_info* qinfo,
262  uint16_t flags, int prime, int valrec));
263 
270 int fptr_whitelist_mod_init(int (*fptr)(struct module_env* env, int id));
271 
278 int fptr_whitelist_mod_deinit(void (*fptr)(struct module_env* env, int id));
279 
286 int fptr_whitelist_mod_operate(void (*fptr)(struct module_qstate* qstate,
287  enum module_ev event, int id, struct outbound_entry* outbound));
288 
295 int fptr_whitelist_mod_inform_super(void (*fptr)(
296  struct module_qstate* qstate, int id, struct module_qstate* super));
297 
304 int fptr_whitelist_mod_clear(void (*fptr)(struct module_qstate* qstate,
305  int id));
306 
313 int fptr_whitelist_mod_get_mem(size_t (*fptr)(struct module_env* env, int id));
314 
321 int fptr_whitelist_alloc_cleanup(void (*fptr)(void*));
322 
330 
338 
344 int fptr_whitelist_print_func(void (*fptr)(char*,void*));
345 
355  enum inplace_cb_list_type type);
356 
363 
371 
379 
388 int order_lock_cmp(const void* e1, const void* e2);
389 
396 int codeline_cmp(const void* a, const void* b);
397 
399 int replay_var_compare(const void* a, const void* b);
400 
401 #endif /* UTIL_FPTR_WLIST_H */
int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_type fptr)
int fptr_whitelist_modenv_detect_cycle(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec))
int fptr_whitelist_inplace_cb_edns_back_parsed(inplace_cb_edns_back_parsed_func_type *fptr)
void tube_callback_type(struct tube *, uint8_t *, size_t, int, void *)
Definition: tube.h:58
void(* lruhash_deldatafunc_type)(void *, void *)
Definition: lruhash.h:138
Definition: outbound_list.h:61
int fptr_whitelist_mod_operate(void(*fptr)(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound))
int fptr_whitelist_mod_init(int(*fptr)(struct module_env *env, int id))
int fptr_whitelist_comm_signal(void(*fptr)(int, void *))
int codeline_cmp(const void *a, const void *b)
int inplace_cb_reply_func_type(struct query_info *qinfo, struct module_qstate *qstate, struct reply_info *rep, int rcode, struct edns_data *edns, struct edns_option **opt_list_out, struct regional *region, int id, void *callback)
Definition: module.h:253
unsigned short uint16_t
Definition: stdint.h:125
void(* lruhash_markdelfunc_type)(void *)
Definition: lruhash.h:142
int fptr_whitelist_start_accept(void(*fptr)(void *))
int fptr_whitelist_mod_clear(void(*fptr)(struct module_qstate *qstate, int id))
int comm_point_callback_type(struct comm_point *, void *, int, struct comm_reply *)
Definition: netevent.h:76
unsigned char uint8_t
Definition: stdint.h:124
int fptr_whitelist_stop_accept(void(*fptr)(void *))
int fptr_whitelist_event(void(*fptr)(int, short, void *))
int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_type fptr)
int fptr_whitelist_modenv_kill_sub(void(*fptr)(struct module_qstate *newq))
int fptr_whitelist_comm_timer(void(*fptr)(void *))
int fptr_whitelist_comm_point_raw(comm_point_callback_type *fptr)
int fptr_whitelist_print_func(void(*fptr)(char *, void *))
int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_type fptr)
void(* lruhash_delkeyfunc_type)(void *, void *)
Definition: lruhash.h:135
int inplace_cb_edns_back_parsed_func_type(struct module_qstate *qstate, int id, void *cb_args)
Definition: module.h:288
int fptr_whitelist_mesh_cb(mesh_cb_func_type fptr)
int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_type fptr)
int fptr_whitelist_serviced_query(comm_point_callback_type *fptr)
int fptr_whitelist_modenv_add_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub))
int fptr_whitelist_modenv_send_query(struct outbound_entry *(*fptr)(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q))
int fptr_whitelist_mod_deinit(void(*fptr)(struct module_env *env, int id))
inplace_cb_list_type
Definition: module.h:190
int(* lruhash_compfunc_type)(void *, void *)
Definition: lruhash.h:130
module_ev
Definition: module.h:536
int fptr_whitelist_modenv_attach_sub(int(*fptr)(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq))
int fptr_whitelist_modenv_detach_subs(void(*fptr)(struct module_qstate *qstate))
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
int fptr_whitelist_pending_tcp(comm_point_callback_type *fptr)
int fptr_whitelist_alloc_cleanup(void(*fptr)(void *))
void(* mesh_cb_func_type)(void *, int, struct sldns_buffer *, enum sec_status, char *)
Definition: mesh.h:228
int fptr_whitelist_comm_point(comm_point_callback_type *fptr)
int fptr_whitelist_tube_listen(tube_callback_type *fptr)
int order_lock_cmp(const void *e1, const void *e2)
int fptr_whitelist_inplace_cb_reply_generic(inplace_cb_reply_func_type *fptr, enum inplace_cb_list_type type)
int fptr_whitelist_inplace_cb_query(inplace_cb_query_func_type *fptr)
size_t(* lruhash_sizefunc_type)(void *, void *)
Definition: lruhash.h:127
int fptr_whitelist_inplace_cb_query_response(inplace_cb_query_response_func_type *fptr)
int fptr_whitelist_pending_udp(comm_point_callback_type *fptr)
int inplace_cb_query_func_type(struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *callback)
Definition: module.h:275
int replay_var_compare(const void *a, const void *b)
int fptr_whitelist_mod_get_mem(size_t(*fptr)(struct module_env *env, int id))
int fptr_whitelist_mod_inform_super(void(*fptr)(struct module_qstate *qstate, int id, struct module_qstate *super))
int inplace_cb_query_response_func_type(struct module_qstate *qstate, struct dns_msg *response, int id, void *cb_args)
Definition: module.h:300
int fptr_whitelist_rbtree_cmp(int(*fptr)(const void *, const void *))
int fptr_whitelist_hash_compfunc(lruhash_compfunc_type fptr)