Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/event2
File: dns.h
/*
[0] Fix | Delete
* Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
[1] Fix | Delete
* Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
[2] Fix | Delete
*
[3] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[4] Fix | Delete
* modification, are permitted provided that the following conditions
[5] Fix | Delete
* are met:
[6] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[7] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[8] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[9] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[10] Fix | Delete
* documentation and/or other materials provided with the distribution.
[11] Fix | Delete
* 3. The name of the author may not be used to endorse or promote products
[12] Fix | Delete
* derived from this software without specific prior written permission.
[13] Fix | Delete
*
[14] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
[15] Fix | Delete
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
[16] Fix | Delete
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
[17] Fix | Delete
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
[18] Fix | Delete
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
[19] Fix | Delete
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
[20] Fix | Delete
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
[21] Fix | Delete
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
[22] Fix | Delete
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
[23] Fix | Delete
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[24] Fix | Delete
*/
[25] Fix | Delete
[26] Fix | Delete
/*
[27] Fix | Delete
* The original DNS code is due to Adam Langley with heavy
[28] Fix | Delete
* modifications by Nick Mathewson. Adam put his DNS software in the
[29] Fix | Delete
* public domain. You can find his original copyright below. Please,
[30] Fix | Delete
* aware that the code as part of Libevent is governed by the 3-clause
[31] Fix | Delete
* BSD license above.
[32] Fix | Delete
*
[33] Fix | Delete
* This software is Public Domain. To view a copy of the public domain dedication,
[34] Fix | Delete
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
[35] Fix | Delete
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
[36] Fix | Delete
*
[37] Fix | Delete
* I ask and expect, but do not require, that all derivative works contain an
[38] Fix | Delete
* attribution similar to:
[39] Fix | Delete
* Parts developed by Adam Langley <agl@imperialviolet.org>
[40] Fix | Delete
*
[41] Fix | Delete
* You may wish to replace the word "Parts" with something else depending on
[42] Fix | Delete
* the amount of original code.
[43] Fix | Delete
*
[44] Fix | Delete
* (Derivative works does not include programs which link against, run or include
[45] Fix | Delete
* the source verbatim in their source distributions)
[46] Fix | Delete
*/
[47] Fix | Delete
[48] Fix | Delete
/** @file event2/dns.h
[49] Fix | Delete
*
[50] Fix | Delete
* Welcome, gentle reader
[51] Fix | Delete
*
[52] Fix | Delete
* Async DNS lookups are really a whole lot harder than they should be,
[53] Fix | Delete
* mostly stemming from the fact that the libc resolver has never been
[54] Fix | Delete
* very good at them. Before you use this library you should see if libc
[55] Fix | Delete
* can do the job for you with the modern async call getaddrinfo_a
[56] Fix | Delete
* (see http://www.imperialviolet.org/page25.html#e498). Otherwise,
[57] Fix | Delete
* please continue.
[58] Fix | Delete
*
[59] Fix | Delete
* The library keeps track of the state of nameservers and will avoid
[60] Fix | Delete
* them when they go down. Otherwise it will round robin between them.
[61] Fix | Delete
*
[62] Fix | Delete
* Quick start guide:
[63] Fix | Delete
* #include "evdns.h"
[64] Fix | Delete
* void callback(int result, char type, int count, int ttl,
[65] Fix | Delete
* void *addresses, void *arg);
[66] Fix | Delete
* evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
[67] Fix | Delete
* evdns_resolve("www.hostname.com", 0, callback, NULL);
[68] Fix | Delete
*
[69] Fix | Delete
* When the lookup is complete the callback function is called. The
[70] Fix | Delete
* first argument will be one of the DNS_ERR_* defines in evdns.h.
[71] Fix | Delete
* Hopefully it will be DNS_ERR_NONE, in which case type will be
[72] Fix | Delete
* DNS_IPv4_A, count will be the number of IP addresses, ttl is the time
[73] Fix | Delete
* which the data can be cached for (in seconds), addresses will point
[74] Fix | Delete
* to an array of uint32_t's and arg will be whatever you passed to
[75] Fix | Delete
* evdns_resolve.
[76] Fix | Delete
*
[77] Fix | Delete
* Searching:
[78] Fix | Delete
*
[79] Fix | Delete
* In order for this library to be a good replacement for glibc's resolver it
[80] Fix | Delete
* supports searching. This involves setting a list of default domains, in
[81] Fix | Delete
* which names will be queried for. The number of dots in the query name
[82] Fix | Delete
* determines the order in which this list is used.
[83] Fix | Delete
*
[84] Fix | Delete
* Searching appears to be a single lookup from the point of view of the API,
[85] Fix | Delete
* although many DNS queries may be generated from a single call to
[86] Fix | Delete
* evdns_resolve. Searching can also drastically slow down the resolution
[87] Fix | Delete
* of names.
[88] Fix | Delete
*
[89] Fix | Delete
* To disable searching:
[90] Fix | Delete
* 1. Never set it up. If you never call evdns_resolv_conf_parse or
[91] Fix | Delete
* evdns_search_add then no searching will occur.
[92] Fix | Delete
*
[93] Fix | Delete
* 2. If you do call evdns_resolv_conf_parse then don't pass
[94] Fix | Delete
* DNS_OPTION_SEARCH (or DNS_OPTIONS_ALL, which implies it).
[95] Fix | Delete
*
[96] Fix | Delete
* 3. When calling evdns_resolve, pass the DNS_QUERY_NO_SEARCH flag.
[97] Fix | Delete
*
[98] Fix | Delete
* The order of searches depends on the number of dots in the name. If the
[99] Fix | Delete
* number is greater than the ndots setting then the names is first tried
[100] Fix | Delete
* globally. Otherwise each search domain is appended in turn.
[101] Fix | Delete
*
[102] Fix | Delete
* The ndots setting can either be set from a resolv.conf, or by calling
[103] Fix | Delete
* evdns_search_ndots_set.
[104] Fix | Delete
*
[105] Fix | Delete
* For example, with ndots set to 1 (the default) and a search domain list of
[106] Fix | Delete
* ["myhome.net"]:
[107] Fix | Delete
* Query: www
[108] Fix | Delete
* Order: www.myhome.net, www.
[109] Fix | Delete
*
[110] Fix | Delete
* Query: www.abc
[111] Fix | Delete
* Order: www.abc., www.abc.myhome.net
[112] Fix | Delete
*
[113] Fix | Delete
* Internals:
[114] Fix | Delete
*
[115] Fix | Delete
* Requests are kept in two queues. The first is the inflight queue. In
[116] Fix | Delete
* this queue requests have an allocated transaction id and nameserver.
[117] Fix | Delete
* They will soon be transmitted if they haven't already been.
[118] Fix | Delete
*
[119] Fix | Delete
* The second is the waiting queue. The size of the inflight ring is
[120] Fix | Delete
* limited and all other requests wait in waiting queue for space. This
[121] Fix | Delete
* bounds the number of concurrent requests so that we don't flood the
[122] Fix | Delete
* nameserver. Several algorithms require a full walk of the inflight
[123] Fix | Delete
* queue and so bounding its size keeps thing going nicely under huge
[124] Fix | Delete
* (many thousands of requests) loads.
[125] Fix | Delete
*
[126] Fix | Delete
* If a nameserver loses too many requests it is considered down and we
[127] Fix | Delete
* try not to use it. After a while we send a probe to that nameserver
[128] Fix | Delete
* (a lookup for google.com) and, if it replies, we consider it working
[129] Fix | Delete
* again. If the nameserver fails a probe we wait longer to try again
[130] Fix | Delete
* with the next probe.
[131] Fix | Delete
*/
[132] Fix | Delete
[133] Fix | Delete
#ifndef EVENT2_DNS_H_INCLUDED_
[134] Fix | Delete
#define EVENT2_DNS_H_INCLUDED_
[135] Fix | Delete
[136] Fix | Delete
#include <event2/visibility.h>
[137] Fix | Delete
[138] Fix | Delete
#ifdef __cplusplus
[139] Fix | Delete
extern "C" {
[140] Fix | Delete
#endif
[141] Fix | Delete
[142] Fix | Delete
/* For integer types. */
[143] Fix | Delete
#include <event2/util.h>
[144] Fix | Delete
[145] Fix | Delete
/** Error codes 0-5 are as described in RFC 1035. */
[146] Fix | Delete
#define DNS_ERR_NONE 0
[147] Fix | Delete
/** The name server was unable to interpret the query */
[148] Fix | Delete
#define DNS_ERR_FORMAT 1
[149] Fix | Delete
/** The name server was unable to process this query due to a problem with the
[150] Fix | Delete
* name server */
[151] Fix | Delete
#define DNS_ERR_SERVERFAILED 2
[152] Fix | Delete
/** The domain name does not exist */
[153] Fix | Delete
#define DNS_ERR_NOTEXIST 3
[154] Fix | Delete
/** The name server does not support the requested kind of query */
[155] Fix | Delete
#define DNS_ERR_NOTIMPL 4
[156] Fix | Delete
/** The name server refuses to reform the specified operation for policy
[157] Fix | Delete
* reasons */
[158] Fix | Delete
#define DNS_ERR_REFUSED 5
[159] Fix | Delete
/** The reply was truncated or ill-formatted */
[160] Fix | Delete
#define DNS_ERR_TRUNCATED 65
[161] Fix | Delete
/** An unknown error occurred */
[162] Fix | Delete
#define DNS_ERR_UNKNOWN 66
[163] Fix | Delete
/** Communication with the server timed out */
[164] Fix | Delete
#define DNS_ERR_TIMEOUT 67
[165] Fix | Delete
/** The request was canceled because the DNS subsystem was shut down. */
[166] Fix | Delete
#define DNS_ERR_SHUTDOWN 68
[167] Fix | Delete
/** The request was canceled via a call to evdns_cancel_request */
[168] Fix | Delete
#define DNS_ERR_CANCEL 69
[169] Fix | Delete
/** There were no answers and no error condition in the DNS packet.
[170] Fix | Delete
* This can happen when you ask for an address that exists, but a record
[171] Fix | Delete
* type that doesn't. */
[172] Fix | Delete
#define DNS_ERR_NODATA 70
[173] Fix | Delete
[174] Fix | Delete
#define DNS_IPv4_A 1
[175] Fix | Delete
#define DNS_PTR 2
[176] Fix | Delete
#define DNS_IPv6_AAAA 3
[177] Fix | Delete
[178] Fix | Delete
#define DNS_QUERY_NO_SEARCH 1
[179] Fix | Delete
[180] Fix | Delete
#define DNS_OPTION_SEARCH 1
[181] Fix | Delete
#define DNS_OPTION_NAMESERVERS 2
[182] Fix | Delete
#define DNS_OPTION_MISC 4
[183] Fix | Delete
#define DNS_OPTION_HOSTSFILE 8
[184] Fix | Delete
#define DNS_OPTIONS_ALL 15
[185] Fix | Delete
[186] Fix | Delete
/* Obsolete name for DNS_QUERY_NO_SEARCH */
[187] Fix | Delete
#define DNS_NO_SEARCH DNS_QUERY_NO_SEARCH
[188] Fix | Delete
[189] Fix | Delete
/**
[190] Fix | Delete
* The callback that contains the results from a lookup.
[191] Fix | Delete
* - result is one of the DNS_ERR_* values (DNS_ERR_NONE for success)
[192] Fix | Delete
* - type is either DNS_IPv4_A or DNS_PTR or DNS_IPv6_AAAA
[193] Fix | Delete
* - count contains the number of addresses of form type
[194] Fix | Delete
* - ttl is the number of seconds the resolution may be cached for.
[195] Fix | Delete
* - addresses needs to be cast according to type. It will be an array of
[196] Fix | Delete
* 4-byte sequences for ipv4, or an array of 16-byte sequences for ipv6,
[197] Fix | Delete
* or a nul-terminated string for PTR.
[198] Fix | Delete
*/
[199] Fix | Delete
typedef void (*evdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
[200] Fix | Delete
[201] Fix | Delete
struct evdns_base;
[202] Fix | Delete
struct event_base;
[203] Fix | Delete
[204] Fix | Delete
/** Flag for evdns_base_new: process resolv.conf. */
[205] Fix | Delete
#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
[206] Fix | Delete
/** Flag for evdns_base_new: Do not prevent the libevent event loop from
[207] Fix | Delete
* exiting when we have no active dns requests. */
[208] Fix | Delete
#define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
[209] Fix | Delete
[210] Fix | Delete
/**
[211] Fix | Delete
Initialize the asynchronous DNS library.
[212] Fix | Delete
[213] Fix | Delete
This function initializes support for non-blocking name resolution by
[214] Fix | Delete
calling evdns_resolv_conf_parse() on UNIX and
[215] Fix | Delete
evdns_config_windows_nameservers() on Windows.
[216] Fix | Delete
[217] Fix | Delete
@param event_base the event base to associate the dns client with
[218] Fix | Delete
@param flags any of EVDNS_BASE_INITIALIZE_NAMESERVERS|
[219] Fix | Delete
EVDNS_BASE_DISABLE_WHEN_INACTIVE
[220] Fix | Delete
@return evdns_base object if successful, or NULL if an error occurred.
[221] Fix | Delete
@see evdns_base_free()
[222] Fix | Delete
*/
[223] Fix | Delete
EVENT2_EXPORT_SYMBOL
[224] Fix | Delete
struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize_nameservers);
[225] Fix | Delete
[226] Fix | Delete
[227] Fix | Delete
/**
[228] Fix | Delete
Shut down the asynchronous DNS resolver and terminate all active requests.
[229] Fix | Delete
[230] Fix | Delete
If the 'fail_requests' option is enabled, all active requests will return
[231] Fix | Delete
an empty result with the error flag set to DNS_ERR_SHUTDOWN. Otherwise,
[232] Fix | Delete
the requests will be silently discarded.
[233] Fix | Delete
[234] Fix | Delete
@param evdns_base the evdns base to free
[235] Fix | Delete
@param fail_requests if zero, active requests will be aborted; if non-zero,
[236] Fix | Delete
active requests will return DNS_ERR_SHUTDOWN.
[237] Fix | Delete
@see evdns_base_new()
[238] Fix | Delete
*/
[239] Fix | Delete
EVENT2_EXPORT_SYMBOL
[240] Fix | Delete
void evdns_base_free(struct evdns_base *base, int fail_requests);
[241] Fix | Delete
[242] Fix | Delete
/**
[243] Fix | Delete
Remove all hosts entries that have been loaded into the event_base via
[244] Fix | Delete
evdns_base_load_hosts or via event_base_resolv_conf_parse.
[245] Fix | Delete
[246] Fix | Delete
@param evdns_base the evdns base to remove outdated host addresses from
[247] Fix | Delete
*/
[248] Fix | Delete
EVENT2_EXPORT_SYMBOL
[249] Fix | Delete
void evdns_base_clear_host_addresses(struct evdns_base *base);
[250] Fix | Delete
[251] Fix | Delete
/**
[252] Fix | Delete
Convert a DNS error code to a string.
[253] Fix | Delete
[254] Fix | Delete
@param err the DNS error code
[255] Fix | Delete
@return a string containing an explanation of the error code
[256] Fix | Delete
*/
[257] Fix | Delete
EVENT2_EXPORT_SYMBOL
[258] Fix | Delete
const char *evdns_err_to_string(int err);
[259] Fix | Delete
[260] Fix | Delete
[261] Fix | Delete
/**
[262] Fix | Delete
Add a nameserver.
[263] Fix | Delete
[264] Fix | Delete
The address should be an IPv4 address in network byte order.
[265] Fix | Delete
The type of address is chosen so that it matches in_addr.s_addr.
[266] Fix | Delete
[267] Fix | Delete
@param base the evdns_base to which to add the name server
[268] Fix | Delete
@param address an IP address in network byte order
[269] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[270] Fix | Delete
@see evdns_base_nameserver_ip_add()
[271] Fix | Delete
*/
[272] Fix | Delete
EVENT2_EXPORT_SYMBOL
[273] Fix | Delete
int evdns_base_nameserver_add(struct evdns_base *base,
[274] Fix | Delete
unsigned long int address);
[275] Fix | Delete
[276] Fix | Delete
/**
[277] Fix | Delete
Get the number of configured nameservers.
[278] Fix | Delete
[279] Fix | Delete
This returns the number of configured nameservers (not necessarily the
[280] Fix | Delete
number of running nameservers). This is useful for double-checking
[281] Fix | Delete
whether our calls to the various nameserver configuration functions
[282] Fix | Delete
have been successful.
[283] Fix | Delete
[284] Fix | Delete
@param base the evdns_base to which to apply this operation
[285] Fix | Delete
@return the number of configured nameservers
[286] Fix | Delete
@see evdns_base_nameserver_add()
[287] Fix | Delete
*/
[288] Fix | Delete
EVENT2_EXPORT_SYMBOL
[289] Fix | Delete
int evdns_base_count_nameservers(struct evdns_base *base);
[290] Fix | Delete
[291] Fix | Delete
/**
[292] Fix | Delete
Remove all configured nameservers, and suspend all pending resolves.
[293] Fix | Delete
[294] Fix | Delete
Resolves will not necessarily be re-attempted until evdns_base_resume() is called.
[295] Fix | Delete
[296] Fix | Delete
@param base the evdns_base to which to apply this operation
[297] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[298] Fix | Delete
@see evdns_base_resume()
[299] Fix | Delete
*/
[300] Fix | Delete
EVENT2_EXPORT_SYMBOL
[301] Fix | Delete
int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
[302] Fix | Delete
[303] Fix | Delete
[304] Fix | Delete
/**
[305] Fix | Delete
Resume normal operation and continue any suspended resolve requests.
[306] Fix | Delete
[307] Fix | Delete
Re-attempt resolves left in limbo after an earlier call to
[308] Fix | Delete
evdns_base_clear_nameservers_and_suspend().
[309] Fix | Delete
[310] Fix | Delete
@param base the evdns_base to which to apply this operation
[311] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[312] Fix | Delete
@see evdns_base_clear_nameservers_and_suspend()
[313] Fix | Delete
*/
[314] Fix | Delete
EVENT2_EXPORT_SYMBOL
[315] Fix | Delete
int evdns_base_resume(struct evdns_base *base);
[316] Fix | Delete
[317] Fix | Delete
/**
[318] Fix | Delete
Add a nameserver by string address.
[319] Fix | Delete
[320] Fix | Delete
This function parses a n IPv4 or IPv6 address from a string and adds it as a
[321] Fix | Delete
nameserver. It supports the following formats:
[322] Fix | Delete
- [IPv6Address]:port
[323] Fix | Delete
- [IPv6Address]
[324] Fix | Delete
- IPv6Address
[325] Fix | Delete
- IPv4Address:port
[326] Fix | Delete
- IPv4Address
[327] Fix | Delete
[328] Fix | Delete
If no port is specified, it defaults to 53.
[329] Fix | Delete
[330] Fix | Delete
@param base the evdns_base to which to apply this operation
[331] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[332] Fix | Delete
@see evdns_base_nameserver_add()
[333] Fix | Delete
*/
[334] Fix | Delete
EVENT2_EXPORT_SYMBOL
[335] Fix | Delete
int evdns_base_nameserver_ip_add(struct evdns_base *base,
[336] Fix | Delete
const char *ip_as_string);
[337] Fix | Delete
[338] Fix | Delete
/**
[339] Fix | Delete
Add a nameserver by sockaddr.
[340] Fix | Delete
**/
[341] Fix | Delete
EVENT2_EXPORT_SYMBOL
[342] Fix | Delete
int
[343] Fix | Delete
evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
[344] Fix | Delete
const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
[345] Fix | Delete
[346] Fix | Delete
struct evdns_request;
[347] Fix | Delete
[348] Fix | Delete
/**
[349] Fix | Delete
Lookup an A record for a given name.
[350] Fix | Delete
[351] Fix | Delete
@param base the evdns_base to which to apply this operation
[352] Fix | Delete
@param name a DNS hostname
[353] Fix | Delete
@param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
[354] Fix | Delete
@param callback a callback function to invoke when the request is completed
[355] Fix | Delete
@param ptr an argument to pass to the callback function
[356] Fix | Delete
@return an evdns_request object if successful, or NULL if an error occurred.
[357] Fix | Delete
@see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
[358] Fix | Delete
*/
[359] Fix | Delete
EVENT2_EXPORT_SYMBOL
[360] Fix | Delete
struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
[361] Fix | Delete
[362] Fix | Delete
/**
[363] Fix | Delete
Lookup an AAAA record for a given name.
[364] Fix | Delete
[365] Fix | Delete
@param base the evdns_base to which to apply this operation
[366] Fix | Delete
@param name a DNS hostname
[367] Fix | Delete
@param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
[368] Fix | Delete
@param callback a callback function to invoke when the request is completed
[369] Fix | Delete
@param ptr an argument to pass to the callback function
[370] Fix | Delete
@return an evdns_request object if successful, or NULL if an error occurred.
[371] Fix | Delete
@see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
[372] Fix | Delete
*/
[373] Fix | Delete
EVENT2_EXPORT_SYMBOL
[374] Fix | Delete
struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
[375] Fix | Delete
[376] Fix | Delete
struct in_addr;
[377] Fix | Delete
struct in6_addr;
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
Lookup a PTR record for a given IP address.
[381] Fix | Delete
[382] Fix | Delete
@param base the evdns_base to which to apply this operation
[383] Fix | Delete
@param in an IPv4 address
[384] Fix | Delete
@param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
[385] Fix | Delete
@param callback a callback function to invoke when the request is completed
[386] Fix | Delete
@param ptr an argument to pass to the callback function
[387] Fix | Delete
@return an evdns_request object if successful, or NULL if an error occurred.
[388] Fix | Delete
@see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
[389] Fix | Delete
*/
[390] Fix | Delete
EVENT2_EXPORT_SYMBOL
[391] Fix | Delete
struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
[392] Fix | Delete
[393] Fix | Delete
[394] Fix | Delete
/**
[395] Fix | Delete
Lookup a PTR record for a given IPv6 address.
[396] Fix | Delete
[397] Fix | Delete
@param base the evdns_base to which to apply this operation
[398] Fix | Delete
@param in an IPv6 address
[399] Fix | Delete
@param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
[400] Fix | Delete
@param callback a callback function to invoke when the request is completed
[401] Fix | Delete
@param ptr an argument to pass to the callback function
[402] Fix | Delete
@return an evdns_request object if successful, or NULL if an error occurred.
[403] Fix | Delete
@see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
[404] Fix | Delete
*/
[405] Fix | Delete
EVENT2_EXPORT_SYMBOL
[406] Fix | Delete
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);
[407] Fix | Delete
[408] Fix | Delete
/**
[409] Fix | Delete
Cancels a pending DNS resolution request.
[410] Fix | Delete
[411] Fix | Delete
@param base the evdns_base that was used to make the request
[412] Fix | Delete
@param req the evdns_request that was returned by calling a resolve function
[413] Fix | Delete
@see evdns_base_resolve_ipv4(), evdns_base_resolve_ipv6, evdns_base_resolve_reverse
[414] Fix | Delete
*/
[415] Fix | Delete
EVENT2_EXPORT_SYMBOL
[416] Fix | Delete
void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
[417] Fix | Delete
[418] Fix | Delete
/**
[419] Fix | Delete
Set the value of a configuration option.
[420] Fix | Delete
[421] Fix | Delete
The currently available configuration options are:
[422] Fix | Delete
[423] Fix | Delete
ndots, timeout, max-timeouts, max-inflight, attempts, randomize-case,
[424] Fix | Delete
bind-to, initial-probe-timeout, getaddrinfo-allow-skew.
[425] Fix | Delete
[426] Fix | Delete
In versions before Libevent 2.0.3-alpha, the option name needed to end with
[427] Fix | Delete
a colon.
[428] Fix | Delete
[429] Fix | Delete
@param base the evdns_base to which to apply this operation
[430] Fix | Delete
@param option the name of the configuration option to be modified
[431] Fix | Delete
@param val the value to be set
[432] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[433] Fix | Delete
*/
[434] Fix | Delete
EVENT2_EXPORT_SYMBOL
[435] Fix | Delete
int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
[436] Fix | Delete
[437] Fix | Delete
[438] Fix | Delete
/**
[439] Fix | Delete
Parse a resolv.conf file.
[440] Fix | Delete
[441] Fix | Delete
The 'flags' parameter determines what information is parsed from the
[442] Fix | Delete
resolv.conf file. See the man page for resolv.conf for the format of this
[443] Fix | Delete
file.
[444] Fix | Delete
[445] Fix | Delete
The following directives are not parsed from the file: sortlist, rotate,
[446] Fix | Delete
no-check-names, inet6, debug.
[447] Fix | Delete
[448] Fix | Delete
If this function encounters an error, the possible return values are: 1 =
[449] Fix | Delete
failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of
[450] Fix | Delete
memory, 5 = short read from file, 6 = no nameservers listed in the file
[451] Fix | Delete
[452] Fix | Delete
@param base the evdns_base to which to apply this operation
[453] Fix | Delete
@param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
[454] Fix | Delete
DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL
[455] Fix | Delete
@param filename the path to the resolv.conf file
[456] Fix | Delete
@return 0 if successful, or various positive error codes if an error
[457] Fix | Delete
occurred (see above)
[458] Fix | Delete
@see resolv.conf(3), evdns_config_windows_nameservers()
[459] Fix | Delete
*/
[460] Fix | Delete
EVENT2_EXPORT_SYMBOL
[461] Fix | Delete
int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
[462] Fix | Delete
[463] Fix | Delete
/**
[464] Fix | Delete
Load an /etc/hosts-style file from 'hosts_fname' into 'base'.
[465] Fix | Delete
[466] Fix | Delete
If hosts_fname is NULL, add minimal entries for localhost, and nothing
[467] Fix | Delete
else.
[468] Fix | Delete
[469] Fix | Delete
Note that only evdns_getaddrinfo uses the /etc/hosts entries.
[470] Fix | Delete
[471] Fix | Delete
This function does not replace previously loaded hosts entries; to do that,
[472] Fix | Delete
call evdns_base_clear_host_addresses first.
[473] Fix | Delete
[474] Fix | Delete
Return 0 on success, negative on failure.
[475] Fix | Delete
*/
[476] Fix | Delete
EVENT2_EXPORT_SYMBOL
[477] Fix | Delete
int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
[478] Fix | Delete
[479] Fix | Delete
/**
[480] Fix | Delete
Obtain nameserver information using the Windows API.
[481] Fix | Delete
[482] Fix | Delete
Attempt to configure a set of nameservers based on platform settings on
[483] Fix | Delete
a win32 host. Preferentially tries to use GetNetworkParams; if that fails,
[484] Fix | Delete
looks in the registry.
[485] Fix | Delete
[486] Fix | Delete
@return 0 if successful, or -1 if an error occurred
[487] Fix | Delete
@see evdns_resolv_conf_parse()
[488] Fix | Delete
*/
[489] Fix | Delete
#ifdef _WIN32
[490] Fix | Delete
EVENT2_EXPORT_SYMBOL
[491] Fix | Delete
int evdns_base_config_windows_nameservers(struct evdns_base *);
[492] Fix | Delete
#define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
[493] Fix | Delete
#endif
[494] Fix | Delete
[495] Fix | Delete
[496] Fix | Delete
/**
[497] Fix | Delete
Clear the list of search domains.
[498] Fix | Delete
*/
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function