31#include <netinet/in.h>
33#include <sys/socket.h>
48#include <sys/system_properties.h>
54#if defined(__APPLE__) || defined(__MACH__)
55#include <TargetConditionals.h>
56#define __CF_USE_FRAMEWORK_INCLUDES__
57#include <SystemConfiguration/SystemConfiguration.h>
74static const char *
try_option(
const char *p,
const char *
q,
const char *
opt);
126#if defined(WIN32) && !defined(_M_ARM)
197 if (channel->
nsort != -1)
321#elif defined(_MSC_VER)
357 int linesize, status, nservers = 0, nsort = 0;
412 channel->
nsort = nsort;
418#if defined(__APPLE__) || defined(__MACH__)
471#if defined(__ANDROID__)
477 const char *
prop_keys[2] = {
"net.dns1",
"net.dns2" };
480 for(
i = 0;
i < 2;
i++)
679 ntohs(
sa6->sin6_addr.u.Word[0]) != 0xfec0)
810#if defined(_MSC_VER) && _MSC_VER >= 1800
842 if (channel->
flags == -1)
846 if (channel->
tries == -1)
848 if (channel->
ndots == -1)
871#elif defined(__APPLE__) || defined(__MACH__)
873#elif defined(__ANDROID__)
926 if (channel->
nsort == -1)
948 while (*
q && !
isspace((
unsigned char)*
q))
967 if ((*p ==
'b' || *p ==
'f') &&
l < lookups + 2)
969 while (*p && !
isspace((
unsigned char)*p))
971 while (
isspace((
unsigned char)*p))
1012 newserv[*nservers].family = family;
1014 newserv[*nservers].addr6 = addr6;
1017 newserv[*nservers].addr = addr;
1031 while (*
str && *
str !=
';')
1034 while (*
q && *
q !=
'/' && *
q !=
';' && !
isspace((
unsigned char)*
q))
1042 while (*
q && *
q !=
';' && !
isspace((
unsigned char)*
q))
1060 while (*
q && *
q !=
';' && !
isspace((
unsigned char)*
q))
1081 while (*p && !
isspace((
unsigned char)*p))
1083 while (
isspace((
unsigned char)*p))
1099 while (*
q && !
isspace((
unsigned char)*
q))
1107 while (
isspace((
unsigned char)*p))
1118 const char *p, *
q, *
val;
1124 while (*
q && !
isspace((
unsigned char)*
q))
1136 while (
isspace((
unsigned char)*p))
1174#if defined(_MSC_VER) && _MSC_VER >= 1800
1192 addr.s_addr =
ntohl(
pat->addr.s_addr);
1221 for (;
i < nservers;
i++)
1223 if (servers[
i].addr.s_addr == addr.s_addr)
1228 return (
i < nservers ?
i : -1);
1247 for (;
i < nservers;
i++)
1249 if (
memcmp(&servers[
i].addr6, &addr,
sizeof(addr)) == 0)
1254 return (
i < nservers ?
i : -1);
1260#define NS_INADDRSZ 4
1261#define NS_IN6ADDRSZ 16
1280 static const char xdigits_l[] =
"0123456789abcdef",
1297 while ((
ch = *
src++) !=
'\0') {
1348 for (
i = 1;
i <=
n;
i++) {
1375 static const char digits[] =
"0123456789";
1382 while ((
ch = *
src++) !=
'\0') {
#define resip_assert(x)
This file needs to work for both C and C++ code.
#define ARES_FLAG_PRIMARY
#define ARES_OPT_UDP_PORT
#define ARES_OPT_TCP_PORT
int ares__read_line(FILE *fp, char **buf, int *bufsize)
static const char * try_option(const char *p, const char *q, const char *opt)
static int init_by_environment(ares_channel channel)
static int init_by_options(ares_channel channel, struct ares_options *options, int optmask)
static int config_nameserver(struct server_state **servers, int *nservers, const char *str)
int ares_capabilities(int capmask)
static int inet_pton6(const char *src, u_char *dst)
static int set_options(ares_channel channel, const char *str)
int ares_init(ares_channel *channelptr)
static int init_by_resolv_conf(ares_channel channel)
static int ip_addr(const char *s, int len, struct in_addr *addr)
static int init_by_defaults(ares_channel channel)
static int config_domain(ares_channel channel, char *str)
static int inet_pton4(const char *src, u_char *dst)
int ares_init_with_socket_function(ares_channel *channelptr, socket_function_ptr socketFunc)
static char * try_config(char *s, char *opt)
int ares_init_options_with_socket_function(ares_channel *channelptr, struct ares_options *options, int optmask, socket_function_ptr socketFunc)
static int set_search(ares_channel channel, const char *str)
static void natural_mask(struct apattern *pat)
int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask)
static int config_sortlist(struct apattern **sortlist, int *nsort, const char *str)
static int config_lookup(ares_channel channel, const char *str)
void(* socket_function_ptr)(Socket s, int transportType, const char *file, int line)
struct apattern * sortlist
ares_poll_cb_func * poll_cb_func
socket_function_ptr socket_function
struct server_state * servers
struct send_request * qhead
int default_localhost_server
struct send_request * qtail
unsigned char * tcp_buffer
unsigned char physical_addr[MAX_ADAPTER_ADDRESS_LENGTH]