Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
unbound-event.h
Go to the documentation of this file.
1
/*
2
* unbound-event.h - unbound validating resolver public API with events
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 _UB_UNBOUND_EVENT_H
56
#define _UB_UNBOUND_EVENT_H
57
58
#ifdef __cplusplus
59
extern
"C"
{
60
#endif
61
62
struct
ub_ctx
;
63
struct
ub_result
;
64
struct
event_base;
65
67
#define UB_EV_TIMEOUT 0x01
69
#define UB_EV_READ 0x02
71
#define UB_EV_WRITE 0x04
73
#define UB_EV_SIGNAL 0x08
75
#define UB_EV_PERSIST 0x10
76
78
#define UB_EVENT_MAGIC 0x44d74d78
79
80
struct
ub_event
;
81
struct
ub_event_base
;
82
struct
timeval;
83
87
struct
ub_event_base_vmt
{
90
void (*
free
)(
struct
ub_event_base
*);
93
int (*
dispatch
)(
struct
ub_event_base
*);
95
int (*
loopexit
)(
struct
ub_event_base
*,
struct
timeval*);
97
struct
ub_event
* (*new_event)(
struct
ub_event_base
*,
98
int
fd,
short
bits, void (*cb)(int, short,
void
*),
void
* arg);
101
struct
ub_event
* (*new_signal)(
struct
ub_event_base
*,
int
fd,
102
void (*cb)(int, short,
void
*),
void
* arg);
105
struct
ub_event
* (*winsock_register_wsaevent)(
struct
ub_event_base
*,
106
void
* wsaevent, void (*cb)(int, short,
void
*),
void
* arg);
107
};
108
115
struct
ub_event_base
{
117
unsigned
long
magic
;
119
struct
ub_event_base_vmt
*
vmt
;
120
};
121
125
struct
ub_event_vmt
{
128
void (*
add_bits
)(
struct
ub_event
*, short);
131
void (*
del_bits
)(
struct
ub_event
*, short);
134
void (*
set_fd
)(
struct
ub_event
*, int);
136
void (*
free
)(
struct
ub_event
*);
138
int (*
add
)(
struct
ub_event
*,
struct
timeval*);
140
int (*
del
)(
struct
ub_event
*);
142
int (*
add_timer
)(
struct
ub_event
*,
struct
ub_event_base
*,
143
void (*cb)(int, short,
void
*),
void
* arg,
struct
timeval*);
145
int (*
del_timer
)(
struct
ub_event
*);
147
int (*
add_signal
)(
struct
ub_event
*,
struct
timeval*);
149
int (*
del_signal
)(
struct
ub_event
*);
153
void (*
winsock_unregister_wsaevent
)(
struct
ub_event
* ev);
158
void (*
winsock_tcp_wouldblock
)(
struct
ub_event
*,
int
eventbit);
159
};
160
166
struct
ub_event
{
168
unsigned
long
magic
;
170
struct
ub_event_vmt
*
vmt
;
171
};
172
173
typedef
void (*
ub_event_callback_type
)(
void
*, int,
void
*, int, int,
char
*);
174
187
struct
ub_ctx
*
ub_ctx_create_ub_event
(
struct
ub_event_base
* base);
188
204
struct
ub_ctx
*
ub_ctx_create_event
(
struct
event_base
* base);
205
216
int
ub_ctx_set_event
(
struct
ub_ctx
* ctx,
struct
event_base
* base);
217
256
int
ub_resolve_event
(
struct
ub_ctx
* ctx,
const
char
* name,
int
rrtype,
257
int
rrclass,
void
* mydata,
ub_event_callback_type
callback,
258
int
* async_id);
259
260
#ifdef __cplusplus
261
}
262
#endif
263
264
#endif
/* _UB_UNBOUND_H */
ub_ctx
Definition
context.h:62
ub_ctx::event_base
struct ub_event_base * event_base
Definition
context.h:118
ub_event_base_vmt
Definition
unbound-event.h:87
ub_event_base_vmt::loopexit
int(* loopexit)(struct ub_event_base *, struct timeval *)
Definition
unbound-event.h:95
ub_event_base_vmt::free
void(* free)(struct ub_event_base *)
Definition
unbound-event.h:90
ub_event_base_vmt::dispatch
int(* dispatch)(struct ub_event_base *)
Definition
unbound-event.h:93
ub_event_base
Definition
unbound-event.h:115
ub_event_base::vmt
struct ub_event_base_vmt * vmt
Definition
unbound-event.h:119
ub_event_base::magic
unsigned long magic
Definition
unbound-event.h:117
ub_event_vmt
Definition
unbound-event.h:125
ub_event_vmt::winsock_tcp_wouldblock
void(* winsock_tcp_wouldblock)(struct ub_event *, int eventbit)
Definition
unbound-event.h:158
ub_event_vmt::del_timer
int(* del_timer)(struct ub_event *)
Definition
unbound-event.h:145
ub_event_vmt::set_fd
void(* set_fd)(struct ub_event *, int)
Definition
unbound-event.h:134
ub_event_vmt::del_bits
void(* del_bits)(struct ub_event *, short)
Definition
unbound-event.h:131
ub_event_vmt::add
int(* add)(struct ub_event *, struct timeval *)
Definition
unbound-event.h:138
ub_event_vmt::del
int(* del)(struct ub_event *)
Definition
unbound-event.h:140
ub_event_vmt::add_signal
int(* add_signal)(struct ub_event *, struct timeval *)
Definition
unbound-event.h:147
ub_event_vmt::free
void(* free)(struct ub_event *)
Definition
unbound-event.h:136
ub_event_vmt::add_timer
int(* add_timer)(struct ub_event *, struct ub_event_base *, void(*cb)(int, short, void *), void *arg, struct timeval *)
Definition
unbound-event.h:142
ub_event_vmt::winsock_unregister_wsaevent
void(* winsock_unregister_wsaevent)(struct ub_event *ev)
Definition
unbound-event.h:153
ub_event_vmt::add_bits
void(* add_bits)(struct ub_event *, short)
Definition
unbound-event.h:128
ub_event_vmt::del_signal
int(* del_signal)(struct ub_event *)
Definition
unbound-event.h:149
ub_event
Definition
unbound-event.h:166
ub_event::vmt
struct ub_event_vmt * vmt
Definition
unbound-event.h:170
ub_event::magic
unsigned long magic
Definition
unbound-event.h:168
ub_result
Definition
unbound.h:123
ub_ctx_set_event
int ub_ctx_set_event(struct ub_ctx *ctx, struct event_base *base)
ub_event_callback_type
void(* ub_event_callback_type)(void *, int, void *, int, int, char *)
Definition
unbound-event.h:173
ub_ctx_create_ub_event
struct ub_ctx * ub_ctx_create_ub_event(struct ub_event_base *base)
ub_resolve_event
int ub_resolve_event(struct ub_ctx *ctx, const char *name, int rrtype, int rrclass, void *mydata, ub_event_callback_type callback, int *async_id)
ub_ctx_create_event
struct ub_ctx * ub_ctx_create_event(struct event_base *base)
external
unbound
libunbound
unbound-event.h
Generated on
for Electroneum by
1.17.0