Electroneum
worker.h
Go to the documentation of this file.
1 /*
2  * libunbound/worker.h - prototypes for worker methods.
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 LIMITED
25  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
42 #ifndef LIBUNBOUND_WORKER_H
43 #define LIBUNBOUND_WORKER_H
44 
45 #include "sldns/sbuffer.h"
46 #include "util/data/packed_rrset.h" /* for enum sec_status */
47 struct comm_reply;
48 struct comm_point;
49 struct module_qstate;
50 struct tube;
51 struct edns_option;
52 struct query_info;
53 
72 struct outbound_entry* libworker_send_query(struct query_info* qinfo,
73  uint16_t flags, int dnssec, int want_dnssec, int nocaps,
74  struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
75  size_t zonelen, int ssl_upstream, char* tls_auth_name,
76  struct module_qstate* q);
77 
79 int libworker_handle_reply(struct comm_point* c, void* arg, int error,
80  struct comm_reply* reply_info);
81 
83 int libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
84  struct comm_reply* reply_info);
85 
87 void libworker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
88  int err, void* arg);
89 
91 void libworker_fg_done_cb(void* arg, int rcode, sldns_buffer* buf,
92  enum sec_status s, char* why_bogus);
93 
95 void libworker_bg_done_cb(void* arg, int rcode, sldns_buffer* buf,
96  enum sec_status s, char* why_bogus);
97 
99 void libworker_event_done_cb(void* arg, int rcode, struct sldns_buffer* buf,
100  enum sec_status s, char* why_bogus);
101 
107 void worker_sighandler(int sig, void* arg);
108 
127 struct outbound_entry* worker_send_query(struct query_info* qinfo,
128  uint16_t flags, int dnssec, int want_dnssec, int nocaps,
129  struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
130  size_t zonelen, int ssl_upstream, char* tls_auth_name,
131  struct module_qstate* q);
132 
142 void worker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
143  int error, void* arg);
144 
146 int worker_handle_request(struct comm_point* c, void* arg, int error,
147  struct comm_reply* repinfo);
148 
150 int worker_handle_reply(struct comm_point* c, void* arg, int error,
151  struct comm_reply* reply_info);
152 
154 int worker_handle_service_reply(struct comm_point* c, void* arg, int error,
155  struct comm_reply* reply_info);
156 
158 void worker_alloc_cleanup(void* arg);
159 
161 void worker_stat_timer_cb(void* arg);
162 
164 void worker_probe_timer_cb(void* arg);
165 
167 void worker_start_accept(void* arg);
168 
170 void worker_stop_accept(void* arg);
171 
173 int remote_accept_callback(struct comm_point*, void*, int, struct comm_reply*);
174 
176 int remote_control_callback(struct comm_point*, void*, int, struct comm_reply*);
177 
179 void remote_get_opt_ssl(char* line, void* arg);
180 
181 #endif /* LIBUNBOUND_WORKER_H */
void worker_sighandler(int sig, void *arg)
Definition: outbound_list.h:61
void worker_stop_accept(void *arg)
struct outbound_entry * worker_send_query(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)
void worker_handle_control_cmd(struct tube *tube, uint8_t *msg, size_t len, int error, void *arg)
unsigned short uint16_t
Definition: stdint.h:125
unsigned char uint8_t
Definition: stdint.h:124
int libworker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
int worker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
void libworker_fg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus)
int libworker_handle_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
sec_status
Definition: packed_rrset.h:176
int worker_handle_request(struct comm_point *c, void *arg, int error, struct comm_reply *repinfo)
void worker_start_accept(void *arg)
void worker_stat_timer_cb(void *arg)
void libworker_bg_done_cb(void *arg, int rcode, sldns_buffer *buf, enum sec_status s, char *why_bogus)
void worker_alloc_cleanup(void *arg)
void libworker_handle_control_cmd(struct tube *tube, uint8_t *msg, size_t len, int err, void *arg)
const char * buf
Definition: slow_memmem.cpp:74
int remote_control_callback(struct comm_point *, void *, int, struct comm_reply *)
struct outbound_entry * libworker_send_query(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)
void libworker_event_done_cb(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status s, char *why_bogus)
void worker_probe_timer_cb(void *arg)
int remote_accept_callback(struct comm_point *, void *, int, struct comm_reply *)
void remote_get_opt_ssl(char *line, void *arg)
Definition: tube.h:63
int worker_handle_service_reply(struct comm_point *c, void *arg, int error, struct comm_reply *reply_info)
error
Tracks LMDB error codes.
Definition: error.h:44