libevent  2.2.1
Event notification library
dns.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
3  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 /*
29  * The original DNS code is due to Adam Langley with heavy
30  * modifications by Nick Mathewson. Adam put his DNS software in the
31  * public domain. You can find his original copyright below. Please,
32  * aware that the code as part of Libevent is governed by the 3-clause
33  * BSD license above.
34  *
35  * This software is Public Domain. To view a copy of the public domain dedication,
36  * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
37  * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
38  *
39  * I ask and expect, but do not require, that all derivative works contain an
40  * attribution similar to:
41  * Parts developed by Adam Langley <agl@imperialviolet.org>
42  *
43  * You may wish to replace the word "Parts" with something else depending on
44  * the amount of original code.
45  *
46  * (Derivative works does not include programs which link against, run or include
47  * the source verbatim in their source distributions)
48  */
49 
141 #ifndef EVENT2_DNS_H_INCLUDED_
142 #define EVENT2_DNS_H_INCLUDED_
143 
144 #include <event2/visibility.h>
145 
146 #ifdef __cplusplus
147 extern "C" {
148 #endif
149 
150 /* For integer types. */
151 #include <event2/util.h>
152 
154 #define DNS_ERR_NONE 0
155 
156 #define DNS_ERR_FORMAT 1
157 
159 #define DNS_ERR_SERVERFAILED 2
160 
161 #define DNS_ERR_NOTEXIST 3
162 
163 #define DNS_ERR_NOTIMPL 4
164 
166 #define DNS_ERR_REFUSED 5
167 
168 #define DNS_ERR_TRUNCATED 65
169 
170 #define DNS_ERR_UNKNOWN 66
171 
172 #define DNS_ERR_TIMEOUT 67
173 
174 #define DNS_ERR_SHUTDOWN 68
175 
176 #define DNS_ERR_CANCEL 69
177 
180 #define DNS_ERR_NODATA 70
181 
182 #define DNS_IPv4_A 1
183 #define DNS_PTR 2
184 #define DNS_IPv6_AAAA 3
185 #define DNS_CNAME 4
186 
188 #define DNS_QUERY_NO_SEARCH 0x01
189 
190 #define DNS_QUERY_USEVC 0x02
191 
192 #define DNS_QUERY_IGNTC 0x04
193 
194 #define DNS_CNAME_CALLBACK 0x80
195 
196 /* Allow searching */
197 #define DNS_OPTION_SEARCH 1
198 /* Parse "nameserver" and add default if no such section */
199 #define DNS_OPTION_NAMESERVERS 2
200 /* Parse additional options like:
201  * - timeout:
202  * - getaddrinfo-allow-skew:
203  * - max-timeouts:
204  * - max-inflight:
205  * - attempts:
206  * - randomize-case:
207  * - initial-probe-timeout:
208  * - max-probe-timeout:
209  * - probe-backoff-factor:
210  * - tcp-idle-timeout:
211  * - edns-udp-size:
212  * - use-vc
213  * - ignore-tc
214  */
215 #define DNS_OPTION_MISC 4
216 /* Load hosts file (i.e. "/etc/hosts") */
217 #define DNS_OPTION_HOSTSFILE 8
218 
225 #define DNS_OPTIONS_ALL ( \
226  DNS_OPTION_SEARCH | \
227  DNS_OPTION_NAMESERVERS | \
228  DNS_OPTION_MISC | \
229  DNS_OPTION_HOSTSFILE | \
230  0 \
231 )
232 /* Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers
233  * in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set) */
234 #define DNS_OPTION_NAMESERVERS_NO_DEFAULT 16
235 
236 /* Obsolete name for DNS_QUERY_NO_SEARCH */
237 #define DNS_NO_SEARCH DNS_QUERY_NO_SEARCH
238 
249 typedef void (*evdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
250 
251 struct evdns_base;
252 struct event_base;
253 
255 #define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
256 
258 #define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
259 
262 #define EVDNS_BASE_NAMESERVERS_NO_DEFAULT 0x10000
263 
264 /* No errors */
265 #define EVDNS_ERROR_NONE 0
266 /* Failed to open file */
267 #define EVDNS_ERROR_FAILED_TO_OPEN_FILE 1
268 /* Failed to stat file */
269 #define EVDNS_ERROR_FAILED_TO_STAT_FILE 2
270 /* File too large */
271 #define EVDNS_ERROR_FILE_TOO_LARGE 3
272 /* Out of memory */
273 #define EVDNS_ERROR_OUT_OF_MEMORY 4
274 /* Short read from file */
275 #define EVDNS_ERROR_SHORT_READ_FROM_FILE 5
276 /* No nameservers configured */
277 #define EVDNS_ERROR_NO_NAMESERVERS_CONFIGURED 6
278 
292 EVENT2_EXPORT_SYMBOL
293 struct evdns_base * evdns_base_new(struct event_base *event_base, int flags);
294 
295 
308 EVENT2_EXPORT_SYMBOL
309 void evdns_base_free(struct evdns_base *base, int fail_requests);
310 
317 EVENT2_EXPORT_SYMBOL
318 void evdns_base_clear_host_addresses(struct evdns_base *base);
319 
326 EVENT2_EXPORT_SYMBOL
327 const char *evdns_err_to_string(int err);
328 
329 
341 EVENT2_EXPORT_SYMBOL
342 int evdns_base_nameserver_add(struct evdns_base *base,
343  unsigned long int address);
344 
357 EVENT2_EXPORT_SYMBOL
358 int evdns_base_count_nameservers(struct evdns_base *base);
359 
369 EVENT2_EXPORT_SYMBOL
370 int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
371 
372 
383 EVENT2_EXPORT_SYMBOL
384 int evdns_base_resume(struct evdns_base *base);
385 
403 EVENT2_EXPORT_SYMBOL
404 int evdns_base_nameserver_ip_add(struct evdns_base *base,
405  const char *ip_as_string);
406 
410 EVENT2_EXPORT_SYMBOL
411 int
412 evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
413  const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
414 
415 struct evdns_request;
416 
428 EVENT2_EXPORT_SYMBOL
429 struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
430 
442 EVENT2_EXPORT_SYMBOL
443 struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
444 
445 struct in_addr;
446 struct in6_addr;
447 
459 EVENT2_EXPORT_SYMBOL
460 struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
461 
462 
474 EVENT2_EXPORT_SYMBOL
475 struct evdns_request *evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
476 
484 EVENT2_EXPORT_SYMBOL
485 void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
486 
515 EVENT2_EXPORT_SYMBOL
516 int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
517 
518 
545 EVENT2_EXPORT_SYMBOL
546 int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
547 
561 EVENT2_EXPORT_SYMBOL
562 int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
563 
564 #if defined(EVENT_IN_DOXYGEN_) || defined(_WIN32)
565 
575 EVENT2_EXPORT_SYMBOL
576 int evdns_base_config_windows_nameservers(struct evdns_base *);
577 #define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
578 #endif
579 
580 
584 EVENT2_EXPORT_SYMBOL
585 void evdns_base_search_clear(struct evdns_base *base);
586 
587 
593 EVENT2_EXPORT_SYMBOL
594 void evdns_base_search_add(struct evdns_base *base, const char *domain);
595 
596 
605 EVENT2_EXPORT_SYMBOL
606 void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots);
607 
614 typedef void (*evdns_debug_log_fn_type)(int is_warning, const char *msg);
615 
616 
624 EVENT2_EXPORT_SYMBOL
626 
627 /*
628  * Functions used to implement a DNS server.
629  */
630 
631 struct evdns_server_request;
632 struct evdns_server_question;
633 
645 typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, void *);
646 #define EVDNS_ANSWER_SECTION 0
647 #define EVDNS_AUTHORITY_SECTION 1
648 #define EVDNS_ADDITIONAL_SECTION 2
649 
650 #define EVDNS_TYPE_A 1
651 #define EVDNS_TYPE_NS 2
652 #define EVDNS_TYPE_CNAME 5
653 #define EVDNS_TYPE_SOA 6
654 #define EVDNS_TYPE_PTR 12
655 #define EVDNS_TYPE_MX 15
656 #define EVDNS_TYPE_TXT 16
657 #define EVDNS_TYPE_AAAA 28
658 
659 #define EVDNS_QTYPE_AXFR 252
660 #define EVDNS_QTYPE_ALL 255
661 
662 #define EVDNS_CLASS_INET 1
663 
664 /* flags that can be set in answers; as part of the err parameter */
665 #define EVDNS_FLAGS_AA 0x400
666 #define EVDNS_FLAGS_RD 0x080
667 
679 EVENT2_EXPORT_SYMBOL
680 struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
681 
682 struct evconnlistener;
683 
695 EVENT2_EXPORT_SYMBOL
696 struct evdns_server_port *evdns_add_server_port_with_listener(
697  struct event_base *base, struct evconnlistener *listener, int flags,
698  evdns_request_callback_fn_type callback, void *user_data);
699 
701 EVENT2_EXPORT_SYMBOL
702 void evdns_close_server_port(struct evdns_server_port *port);
703 
722 };
723 
732 EVENT2_EXPORT_SYMBOL
733 int evdns_server_port_set_option(struct evdns_server_port *port, enum evdns_server_option option, size_t value);
734 
738 EVENT2_EXPORT_SYMBOL
739 void evdns_server_request_set_flags(struct evdns_server_request *req, int flags);
740 
741 /* Functions to add an answer to an in-progress DNS reply.
742  */
743 EVENT2_EXPORT_SYMBOL
744 int evdns_server_request_add_reply(struct evdns_server_request *req, int section, const char *name, int type, int dns_class, int ttl, int datalen, int is_name, const char *data);
745 EVENT2_EXPORT_SYMBOL
746 int evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
747 EVENT2_EXPORT_SYMBOL
748 int evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
749 EVENT2_EXPORT_SYMBOL
750 int evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl);
751 EVENT2_EXPORT_SYMBOL
752 int evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl);
753 
757 EVENT2_EXPORT_SYMBOL
758 int evdns_server_request_respond(struct evdns_server_request *req, int err);
762 EVENT2_EXPORT_SYMBOL
763 int evdns_server_request_drop(struct evdns_server_request *req);
764 struct sockaddr;
768 EVENT2_EXPORT_SYMBOL
769 int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
770 
772 typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
773 
774 struct evdns_base;
775 struct evdns_getaddrinfo_request;
793 EVENT2_EXPORT_SYMBOL
794 struct evdns_getaddrinfo_request *evdns_getaddrinfo(
795  struct evdns_base *dns_base,
796  const char *nodename, const char *servname,
797  const struct evutil_addrinfo *hints_in,
798  evdns_getaddrinfo_cb cb, void *arg);
799 
800 /* Cancel an in-progress evdns_getaddrinfo. This MUST NOT be called after the
801  * getaddrinfo's callback has been invoked. The resolves will be canceled,
802  * and the callback will be invoked with the error EVUTIL_EAI_CANCEL. */
803 EVENT2_EXPORT_SYMBOL
804 void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
805 
818 EVENT2_EXPORT_SYMBOL
819 int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
820  struct sockaddr *sa, ev_socklen_t len);
821 
831 EVENT2_EXPORT_SYMBOL
832 int evdns_base_get_nameserver_fd(struct evdns_base *base, int idx);
833 
834 #ifdef __cplusplus
835 }
836 #endif
837 
838 #endif /* !EVENT2_DNS_H_INCLUDED_ */
evdns_base_nameserver_sockaddr_add
EVENT2_EXPORT_SYMBOL int evdns_base_nameserver_sockaddr_add(struct evdns_base *base, const struct sockaddr *sa, ev_socklen_t len, unsigned flags)
Add a nameserver by sockaddr.
evdns_server_request_get_requesting_addr
EVENT2_EXPORT_SYMBOL int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len)
Get the address that made a DNS request.
evdns_getaddrinfo_cb
void(* evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg)
Callback for evdns_getaddrinfo.
Definition: dns.h:772
evdns_base_resume
EVENT2_EXPORT_SYMBOL int evdns_base_resume(struct evdns_base *base)
Resume normal operation and continue any suspended resolve requests.
evdns_close_server_port
EVENT2_EXPORT_SYMBOL void evdns_close_server_port(struct evdns_server_port *port)
Close down a DNS server port, and free associated structures.
evdns_debug_log_fn_type
void(* evdns_debug_log_fn_type)(int is_warning, const char *msg)
A callback that is invoked when a log message is generated.
Definition: dns.h:614
evdns_base_get_nameserver_addr
EVENT2_EXPORT_SYMBOL int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx, struct sockaddr *sa, ev_socklen_t len)
Retrieve the address of the 'idx'th configured nameserver.
evdns_server_request_respond
EVENT2_EXPORT_SYMBOL int evdns_server_request_respond(struct evdns_server_request *req, int err)
Send back a response to a DNS request, and free the request structure.
evdns_server_option
evdns_server_option
List of configurable evdns_server_port options.
Definition: dns.h:709
evdns_base_clear_host_addresses
EVENT2_EXPORT_SYMBOL void evdns_base_clear_host_addresses(struct evdns_base *base)
Remove all hosts entries that have been loaded into the event_base via evdns_base_load_hosts or via e...
evdns_base_resolve_ipv4
EVENT2_EXPORT_SYMBOL struct evdns_request * evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr)
Lookup an A record for a given name.
evdns_server_request_drop
EVENT2_EXPORT_SYMBOL int evdns_server_request_drop(struct evdns_server_request *req)
Free a DNS request without sending back a reply.
event_base
Structure to hold information and state for a Libevent dispatch loop.
Definition: event.h:219
EVDNS_SOPT_TCP_MAX_CLIENTS
@ EVDNS_SOPT_TCP_MAX_CLIENTS
Maximum number of simultaneous tcp connections (clients) that server can hold.
Definition: dns.h:714
evdns_base_resolve_ipv6
EVENT2_EXPORT_SYMBOL struct evdns_request * evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr)
Lookup an AAAA record for a given name.
evdns_base_load_hosts
EVENT2_EXPORT_SYMBOL int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname)
Load an /etc/hosts-style file from 'hosts_fname' into 'base'.
evdns_base_get_nameserver_fd
EVENT2_EXPORT_SYMBOL int evdns_base_get_nameserver_fd(struct evdns_base *base, int idx)
Retrieve the fd of the 'idx'th configured nameserver.
evdns_base_search_ndots_set
EVENT2_EXPORT_SYMBOL void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots)
Set the 'ndots' parameter for searches.
evdns_cancel_request
EVENT2_EXPORT_SYMBOL void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req)
Cancels a pending DNS resolution request.
evdns_base_search_clear
EVENT2_EXPORT_SYMBOL void evdns_base_search_clear(struct evdns_base *base)
Clear the list of search domains.
evdns_base_resolve_reverse
EVENT2_EXPORT_SYMBOL struct evdns_request * evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr)
Lookup a PTR record for a given IP address.
evdns_base_resolv_conf_parse
EVENT2_EXPORT_SYMBOL int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename)
Parse a resolv.conf file.
evdns_base_free
EVENT2_EXPORT_SYMBOL void evdns_base_free(struct evdns_base *base, int fail_requests)
Shut down the asynchronous DNS resolver and terminate all active requests.
EVDNS_SOPT_TCP_IDLE_TIMEOUT
@ EVDNS_SOPT_TCP_IDLE_TIMEOUT
Idle timeout (in seconds) of incoming TCP connections.
Definition: dns.h:721
evdns_add_server_port_with_base
EVENT2_EXPORT_SYMBOL struct evdns_server_port * evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data)
Create a new UDP DNS server port.
evdns_request_callback_fn_type
void(* evdns_request_callback_fn_type)(struct evdns_server_request *, void *)
A callback to implement a DNS server.
Definition: dns.h:645
evdns_base_resolve_reverse_ipv6
EVENT2_EXPORT_SYMBOL struct evdns_request * evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr)
Lookup a PTR record for a given IPv6 address.
evdns_set_log_fn
EVENT2_EXPORT_SYMBOL void evdns_set_log_fn(evdns_debug_log_fn_type fn)
Set the callback function to handle DNS log messages.
evdns_callback_type
void(* evdns_callback_type)(int result, char type, int count, int ttl, void *addresses, void *arg)
The callback that contains the results from a lookup.
Definition: dns.h:249
evdns_add_server_port_with_listener
EVENT2_EXPORT_SYMBOL struct evdns_server_port * evdns_add_server_port_with_listener(struct event_base *base, struct evconnlistener *listener, int flags, evdns_request_callback_fn_type callback, void *user_data)
Create a new TCP DNS server port.
evdns_base_config_windows_nameservers
EVENT2_EXPORT_SYMBOL int evdns_base_config_windows_nameservers(struct evdns_base *)
Obtain nameserver information using the Windows API.
evdns_base_nameserver_ip_add
EVENT2_EXPORT_SYMBOL int evdns_base_nameserver_ip_add(struct evdns_base *base, const char *ip_as_string)
Add a nameserver by string address.
evdns_getaddrinfo
EVENT2_EXPORT_SYMBOL struct evdns_getaddrinfo_request * evdns_getaddrinfo(struct evdns_base *dns_base, const char *nodename, const char *servname, const struct evutil_addrinfo *hints_in, evdns_getaddrinfo_cb cb, void *arg)
Make a non-blocking getaddrinfo request using the dns_base in 'dns_base'.
evdns_base_new
EVENT2_EXPORT_SYMBOL struct evdns_base * evdns_base_new(struct event_base *event_base, int flags)
Initialize the asynchronous DNS library.
evdns_base_search_add
EVENT2_EXPORT_SYMBOL void evdns_base_search_add(struct evdns_base *base, const char *domain)
Add a domain to the list of search domains.
evdns_base_set_option
EVENT2_EXPORT_SYMBOL int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val)
Set the value of a configuration option.
util.h
Common convenience functions for cross-platform portability and related socket manipulations.
evdns_err_to_string
const EVENT2_EXPORT_SYMBOL char * evdns_err_to_string(int err)
Convert a DNS error code to a string.
evdns_base_nameserver_add
EVENT2_EXPORT_SYMBOL int evdns_base_nameserver_add(struct evdns_base *base, unsigned long int address)
Add a nameserver.
evutil_addrinfo
A definition of struct addrinfo for systems that lack it.
Definition: util.h:712
evdns_base_count_nameservers
EVENT2_EXPORT_SYMBOL int evdns_base_count_nameservers(struct evdns_base *base)
Get the number of configured nameservers.
evdns_server_request_set_flags
EVENT2_EXPORT_SYMBOL void evdns_server_request_set_flags(struct evdns_server_request *req, int flags)
Sets some flags in a reply we're building.
evdns_base_clear_nameservers_and_suspend
EVENT2_EXPORT_SYMBOL int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
Remove all configured nameservers, and suspend all pending resolves.
evdns_server_port_set_option
EVENT2_EXPORT_SYMBOL int evdns_server_port_set_option(struct evdns_server_port *port, enum evdns_server_option option, size_t value)
Configure DNS server.
evutil_socket_t
#define evutil_socket_t
A type wide enough to hold the output of "socket()" or "accept()".
Definition: util.h:310