diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-09 10:00:13 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-07-29 08:03:46 (GMT) |
commit | 690cb7e85ff9dadbfca3e3bc91826161011712f1 (patch) | |
tree | 0692da9133e4a62642ab0a77040e7555cdc5565d /3rdParty/Unbound/src/android/dns/dns_android.h | |
parent | 8767caf20b83f5b6e4c52c3818c92a6238e208c4 (diff) | |
download | swift-690cb7e85ff9dadbfca3e3bc91826161011712f1.zip swift-690cb7e85ff9dadbfca3e3bc91826161011712f1.tar.bz2 |
Fix DNS resolution on Android.
Test-Information:
Try accessing local hosts on a local network and make sure that the local DNS server is queried.
Change-Id: Ie594b3eed5772c58d46ec1a4435b2df24d6d8212
Diffstat (limited to '3rdParty/Unbound/src/android/dns/dns_android.h')
-rw-r--r-- | 3rdParty/Unbound/src/android/dns/dns_android.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/3rdParty/Unbound/src/android/dns/dns_android.h b/3rdParty/Unbound/src/android/dns/dns_android.h new file mode 100644 index 0000000..6d38a6f --- /dev/null +++ b/3rdParty/Unbound/src/android/dns/dns_android.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#ifndef __DNS_ANDROID_H__ +#define __DNS_ANDROID_H__ + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/*! Result codes for dns_android_server_get */ +typedef enum { + DNS_ANDROID_SUCCESS = 0, + DNS_ANDROID_FAILURE +} dns_android_result; + +/*! + \brief Retrieve the number of dns servers available. + \return Zero in case of error. +*/ +size_t dns_android_server_count(); + +/*! + \brief Retrieve the address of a dns server + \param index The server index between zero and the number returned by the count function + \param buffer Output buffer into which the null terminated dns server string is written + \param length Size in bytes available in the output buffer + \return Error code. The buffer contents are invalid if an error occurs. +*/ +dns_android_result dns_android_server_get(size_t index, char* buffer, size_t length); + +#ifdef __cplusplus +} +#endif + +#endif // __DNS_ANDROID_H__ |