Electroneum
libworker.h
Go to the documentation of this file.
1 /*
2  * libunbound/libworker.h - worker thread or process that resolves
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 
44 #ifndef LIBUNBOUND_LIBWORKER_H
45 #define LIBUNBOUND_LIBWORKER_H
46 #include "util/data/packed_rrset.h"
47 struct ub_ctx;
48 struct ub_result;
49 struct module_env;
50 struct comm_base;
51 struct outside_network;
52 struct ub_randstate;
53 struct ctx_query;
54 struct outbound_entry;
55 struct module_qstate;
56 struct comm_point;
57 struct comm_reply;
58 struct regional;
59 struct tube;
60 struct sldns_buffer;
61 struct ub_event_base;
62 struct query_info;
63 
68 struct libworker {
72  struct ub_ctx* ctx;
73 
75  int is_bg;
79  int want_quit;
80 
82  struct module_env* env;
84  struct comm_base* base;
88  struct ub_randstate* rndstate;
90  void* sslctx;
91 };
92 
101 int libworker_bg(struct ub_ctx* ctx);
102 
112 int libworker_fg(struct ub_ctx* ctx, struct ctx_query* q);
113 
121  struct ub_event_base* eb);
122 
130 int libworker_attach_mesh(struct ub_ctx* ctx, struct ctx_query* q,
131  int* async_id);
132 
137 void libworker_delete_event(struct libworker* w);
138 
140 void libworker_alloc_cleanup(void* arg);
141 
151 void libworker_enter_result(struct ub_result* res, struct sldns_buffer* buf,
152  struct regional* temp, enum sec_status msg_security);
153 
154 #endif /* LIBUNBOUND_LIBWORKER_H */
const char * res
Definition: hmac_keccak.cpp:41
int want_quit
Definition: libworker.h:79
Definition: outbound_list.h:61
struct ub_ctx * ctx
Definition: libworker.h:72
void libworker_delete_event(struct libworker *w)
int is_bg
Definition: libworker.h:75
void libworker_enter_result(struct ub_result *res, struct sldns_buffer *buf, struct regional *temp, enum sec_status msg_security)
struct libworker * libworker_create_event(struct ub_ctx *ctx, struct ub_event_base *eb)
struct ub_randstate * rndstate
Definition: libworker.h:88
sec_status
Definition: packed_rrset.h:176
struct comm_base * base
Definition: libworker.h:84
int libworker_fg(struct ub_ctx *ctx, struct ctx_query *q)
void libworker_alloc_cleanup(void *arg)
const char * buf
Definition: slow_memmem.cpp:74
struct outside_network * back
Definition: libworker.h:86
struct module_env * env
Definition: libworker.h:82
int libworker_attach_mesh(struct ub_ctx *ctx, struct ctx_query *q, int *async_id)
int is_bg_thread
Definition: libworker.h:77
int libworker_bg(struct ub_ctx *ctx)
int thread_num
Definition: libworker.h:70
Definition: tube.h:63
void * sslctx
Definition: libworker.h:90
Definition: context.h:62