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_NO_CACHE 0x10
259 
261 #define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
262 
265 #define EVDNS_BASE_NAMESERVERS_NO_DEFAULT 0x10000
266 
267 /* No errors */
268 #define EVDNS_ERROR_NONE 0
269 /* Failed to open file */
270 #define EVDNS_ERROR_FAILED_TO_OPEN_FILE 1
271 /* Failed to stat file */
272 #define EVDNS_ERROR_FAILED_TO_STAT_FILE 2
273 /* File too large */
274 #define EVDNS_ERROR_FILE_TOO_LARGE 3
275 /* Out of memory */
276 #define EVDNS_ERROR_OUT_OF_MEMORY 4
277 /* Short read from file */
278 #define EVDNS_ERROR_SHORT_READ_FROM_FILE 5
279 /* No nameservers configured */
280 #define EVDNS_ERROR_NO_NAMESERVERS_CONFIGURED 6
281 
296 EVENT2_EXPORT_SYMBOL
297 struct evdns_base * evdns_base_new(struct event_base *event_base, int flags);
298 
299 
312 EVENT2_EXPORT_SYMBOL
313 void evdns_base_free(struct evdns_base *base, int fail_requests);
314 
321 EVENT2_EXPORT_SYMBOL
322 void evdns_base_clear_host_addresses(struct evdns_base *base);
323 
332 EVENT2_EXPORT_SYMBOL
333 void evdns_cache_write(struct evdns_base *dns_base, char *nodename, struct evutil_addrinfo *res, int ttl);
334 
344 EVENT2_EXPORT_SYMBOL
345 int evdns_cache_lookup(struct evdns_base *base, const char *nodename, struct evutil_addrinfo *hints, ev_uint16_t port, struct evutil_addrinfo **res);
346 
353 EVENT2_EXPORT_SYMBOL
354 const char *evdns_err_to_string(int err);
355 
356 
368 EVENT2_EXPORT_SYMBOL
369 int evdns_base_nameserver_add(struct evdns_base *base,
370  unsigned long int address);
371 
384 EVENT2_EXPORT_SYMBOL
385 int evdns_base_count_nameservers(struct evdns_base *base);
386 
396 EVENT2_EXPORT_SYMBOL
397 int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
398 
399 
410 EVENT2_EXPORT_SYMBOL
411 int evdns_base_resume(struct evdns_base *base);
412 
430 EVENT2_EXPORT_SYMBOL
431 int evdns_base_nameserver_ip_add(struct evdns_base *base,
432  const char *ip_as_string);
433 
437 EVENT2_EXPORT_SYMBOL
438 int
439 evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
440  const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
441 
442 struct evdns_request;
443 
455 EVENT2_EXPORT_SYMBOL
456 struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
457 
469 EVENT2_EXPORT_SYMBOL
470 struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
471 
472 struct in_addr;
473 struct in6_addr;
474 
486 EVENT2_EXPORT_SYMBOL
487 struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
488 
489 
501 EVENT2_EXPORT_SYMBOL
502 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);
503 
511 EVENT2_EXPORT_SYMBOL
512 void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
513 
542 EVENT2_EXPORT_SYMBOL
543 int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
544 
545 
572 EVENT2_EXPORT_SYMBOL
573 int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
574 
588 EVENT2_EXPORT_SYMBOL
589 int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
590 
591 #if defined(EVENT_IN_DOXYGEN_) || defined(_WIN32)
592 
602 EVENT2_EXPORT_SYMBOL
603 int evdns_base_config_windows_nameservers(struct evdns_base *);
604 #define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
605 #endif
606 
607 
611 EVENT2_EXPORT_SYMBOL
612 void evdns_base_search_clear(struct evdns_base *base);
613 
614 
620 EVENT2_EXPORT_SYMBOL
621 void evdns_base_search_add(struct evdns_base *base, const char *domain);
622 
623 
632 EVENT2_EXPORT_SYMBOL
633 void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots);
634 
641 typedef void (*evdns_debug_log_fn_type)(int is_warning, const char *msg);
642 
643 
651 EVENT2_EXPORT_SYMBOL
653 
654 /*
655  * Functions used to implement a DNS server.
656  */
657 
658 struct evdns_server_request;
659 struct evdns_server_question;
660 
672 typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, void *);
673 #define EVDNS_ANSWER_SECTION 0
674 #define EVDNS_AUTHORITY_SECTION 1
675 #define EVDNS_ADDITIONAL_SECTION 2
676 
677 #define EVDNS_TYPE_A 1
678 #define EVDNS_TYPE_NS 2
679 #define EVDNS_TYPE_CNAME 5
680 #define EVDNS_TYPE_SOA 6
681 #define EVDNS_TYPE_PTR 12
682 #define EVDNS_TYPE_MX 15
683 #define EVDNS_TYPE_TXT 16
684 #define EVDNS_TYPE_AAAA 28
685 
686 #define EVDNS_QTYPE_AXFR 252
687 #define EVDNS_QTYPE_ALL 255
688 
689 #define EVDNS_CLASS_INET 1
690 
691 /* flags that can be set in answers; as part of the err parameter */
692 #define EVDNS_FLAGS_AA 0x400
693 #define EVDNS_FLAGS_RD 0x080
694 
706 EVENT2_EXPORT_SYMBOL
707 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);
708 
709 struct evconnlistener;
710 
722 EVENT2_EXPORT_SYMBOL
723 struct evdns_server_port *evdns_add_server_port_with_listener(
724  struct event_base *base, struct evconnlistener *listener, int flags,
725  evdns_request_callback_fn_type callback, void *user_data);
726 
728 EVENT2_EXPORT_SYMBOL
729 void evdns_close_server_port(struct evdns_server_port *port);
730 
749 };
750 
759 EVENT2_EXPORT_SYMBOL
760 int evdns_server_port_set_option(struct evdns_server_port *port, enum evdns_server_option option, size_t value);
761 
765 EVENT2_EXPORT_SYMBOL
766 void evdns_server_request_set_flags(struct evdns_server_request *req, int flags);
767 
768 /* Functions to add an answer to an in-progress DNS reply.
769  */
770 EVENT2_EXPORT_SYMBOL
771 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);
772 EVENT2_EXPORT_SYMBOL
773 int evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
774 EVENT2_EXPORT_SYMBOL
775 int evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
776 EVENT2_EXPORT_SYMBOL
777 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);
778 EVENT2_EXPORT_SYMBOL
779 int evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl);
780 
784 EVENT2_EXPORT_SYMBOL
785 int evdns_server_request_respond(struct evdns_server_request *req, int err);
789 EVENT2_EXPORT_SYMBOL
790 int evdns_server_request_drop(struct evdns_server_request *req);
791 struct sockaddr;
795 EVENT2_EXPORT_SYMBOL
796 int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
797 
799 typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
800 
801 struct evdns_base;
802 struct evdns_getaddrinfo_request;
828 EVENT2_EXPORT_SYMBOL
829 struct evdns_getaddrinfo_request *evdns_getaddrinfo(
830  struct evdns_base *dns_base,
831  const char *nodename, const char *servname,
832  const struct evutil_addrinfo *hints_in,
833  evdns_getaddrinfo_cb cb, void *arg);
834 
835 /* Cancel an in-progress evdns_getaddrinfo. This MUST NOT be called after the
836  * getaddrinfo's callback has been invoked. The resolves will be canceled,
837  * and the callback will be invoked with the error EVUTIL_EAI_CANCEL. */
838 EVENT2_EXPORT_SYMBOL
839 void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
840 
853 EVENT2_EXPORT_SYMBOL
854 int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
855  struct sockaddr *sa, ev_socklen_t len);
856 
866 EVENT2_EXPORT_SYMBOL
867 int evdns_base_get_nameserver_fd(struct evdns_base *base, int idx);
868 
869 #ifdef __cplusplus
870 }
871 #endif
872 
873 #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:799
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:641
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:736
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_cache_write
EVENT2_EXPORT_SYMBOL void evdns_cache_write(struct evdns_base *dns_base, char *nodename, struct evutil_addrinfo *res, int ttl)
Write an entry to the evdns cache.
EVDNS_SOPT_TCP_MAX_CLIENTS
@ EVDNS_SOPT_TCP_MAX_CLIENTS
Maximum number of simultaneous tcp connections (clients) that server can hold.
Definition: dns.h:741
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_cache_lookup
EVENT2_EXPORT_SYMBOL int evdns_cache_lookup(struct evdns_base *base, const char *nodename, struct evutil_addrinfo *hints, ev_uint16_t port, struct evutil_addrinfo **res)
Lookup an entry from the evdns cache.
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:748
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:672
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:731
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:325