2006-06-03 21:49:42 +02:00
|
|
|
/* This software is Public Domain. To view a copy of the public domain dedication,
|
|
|
|
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
|
|
|
|
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
|
|
|
|
*
|
|
|
|
* I ask and expect, but do not require, that all derivative works contain an
|
|
|
|
* attribution similar to:
|
|
|
|
* Parts developed by Adam Langley <agl@imperialviolet.org>
|
|
|
|
*
|
|
|
|
* You may wish to replace the word "Parts" with something else depending on
|
|
|
|
* the amount of original code.
|
|
|
|
*
|
|
|
|
* (Derivative works does not include programs which link against, run or include
|
|
|
|
* the source verbatim in their source distributions)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EVENTDNS_H
|
|
|
|
#define EVENTDNS_H
|
|
|
|
|
2006-06-13 23:49:56 +02:00
|
|
|
/* Error codes 0-5 are as described in RFC 1035. */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_NONE 0
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The name server was unable to interpret the query */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_FORMAT 1
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The name server was unable to process this query due to a problem with the
|
|
|
|
* name server */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_SERVERFAILED 2
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The domain name does not exist */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_NOTEXIST 3
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The name server does not support the requested kind of query */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_NOTIMPL 4
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The name server refuses to reform the specified operation for policy
|
|
|
|
* reasons */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_REFUSED 5
|
2006-06-13 23:49:56 +02:00
|
|
|
/* The reply was truncated or ill-formated */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_TRUNCATED 65
|
2006-06-13 23:49:56 +02:00
|
|
|
/* An unknown error occurred */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_UNKNOWN 66
|
2006-06-13 23:49:56 +02:00
|
|
|
/* Communication with the server timed out */
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_ERR_TIMEOUT 67
|
|
|
|
|
|
|
|
#define DNS_IPv4_A 1
|
|
|
|
|
|
|
|
#define DNS_QUERY_NO_SEARCH 1
|
|
|
|
|
|
|
|
#define DNS_OPTION_SEARCH 1
|
|
|
|
#define DNS_OPTION_NAMESERVERS 2
|
|
|
|
#define DNS_OPTION_MISC 4
|
|
|
|
#define DNS_OPTIONS_ALL 7
|
|
|
|
|
|
|
|
typedef void (*eventdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
|
|
|
|
|
|
|
|
int eventdns_nameserver_add(unsigned long int address);
|
2006-08-04 20:26:13 +02:00
|
|
|
int eventdns_count_nameservers(void);
|
|
|
|
int eventdns_clear_nameservers_and_suspend(void);
|
|
|
|
int eventdns_resume(void);
|
2006-06-03 21:49:42 +02:00
|
|
|
int eventdns_nameserver_ip_add(const char *ip_as_string);
|
|
|
|
int eventdns_resolve(const char *name, int flags, eventdns_callback_type callback, void *ptr);
|
|
|
|
int eventdns_resolv_conf_parse(int flags, const char *);
|
2006-08-04 20:24:25 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
int eventdns_config_windows_nameservers(void);
|
|
|
|
#endif
|
2006-06-04 00:05:23 +02:00
|
|
|
void eventdns_search_clear(void);
|
2006-06-03 21:49:42 +02:00
|
|
|
void eventdns_search_add(const char *domain);
|
2006-06-04 00:05:23 +02:00
|
|
|
void eventdns_search_ndots_set(const int ndots);
|
2006-06-03 21:49:42 +02:00
|
|
|
|
2006-07-05 23:28:37 +02:00
|
|
|
typedef void (*eventdns_debug_log_fn_type)(const char *msg);
|
2006-07-05 23:33:46 +02:00
|
|
|
void eventdns_set_log_fn(eventdns_debug_log_fn_type fn);
|
2006-07-05 23:28:37 +02:00
|
|
|
|
2006-06-03 21:49:42 +02:00
|
|
|
#define DNS_NO_SEARCH 1
|
|
|
|
|
|
|
|
#endif // !EVENTDNS_H
|