summaryrefslogtreecommitdiff
path: root/ares_private.h
diff options
context:
space:
mode:
authorYu Jiung <jiung.yu@samsung.com>2016-11-10 16:24:08 +0900
committerYu Jiung <jiung.yu@samsung.com>2016-11-10 16:25:02 +0900
commit8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8 (patch)
tree81f0750d91aa467df3ee81cf30d22a65db2e6685 /ares_private.h
parentccccebb78520ec3a26a18370936516b12ae5d53a (diff)
parent45e88a8337839e5fd88519bc55467053d521c9f6 (diff)
downloadc-ares-accepted/tizen/4.0/base/20170828.221324.tar.gz
c-ares-accepted/tizen/4.0/base/20170828.221324.tar.bz2
c-ares-accepted/tizen/4.0/base/20170828.221324.zip
Conflicts: packaging/c-ares.spec Change-Id: I1ec10e394aed3ef19ee21fefbe3aba7d7a615c74
Diffstat (limited to 'ares_private.h')
-rw-r--r--ares_private.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/ares_private.h b/ares_private.h
index ab5be5a..33a23e7 100644
--- a/ares_private.h
+++ b/ares_private.h
@@ -43,6 +43,13 @@
#define INADDR_NONE 0xffffffff
#endif
+#ifdef CARES_EXPOSE_STATICS
+/* Make some internal functions visible for testing */
+#define STATIC_TESTABLE
+#else
+#define STATIC_TESTABLE static
+#endif
+
#if defined(WIN32) && !defined(WATT32)
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
@@ -86,10 +93,7 @@
# define getenv(ptr) ares_getenv(ptr)
#endif
-#ifndef HAVE_STRDUP
-# include "ares_strdup.h"
-# define strdup(ptr) ares_strdup(ptr)
-#endif
+#include "ares_strdup.h"
#ifndef HAVE_STRCASECMP
# include "ares_strcasecmp.h"
@@ -119,6 +123,8 @@ struct ares_addr {
struct in_addr addr4;
struct ares_in6_addr addr6;
} addr;
+ int udp_port; /* stored in network order */
+ int tcp_port; /* stored in network order */
};
#define addrV4 addr.addr4
#define addrV6 addr.addr6
@@ -251,8 +257,8 @@ struct ares_channeldata {
int tries;
int ndots;
int rotate; /* if true, all servers specified are used */
- int udp_port;
- int tcp_port;
+ int udp_port; /* stored in network order */
+ int tcp_port; /* stored in network order */
int socket_send_buffer_size;
int socket_receive_buffer_size;
char **domains;
@@ -305,19 +311,20 @@ struct ares_channeldata {
ares_sock_create_callback sock_create_cb;
void *sock_create_cb_data;
+
+ ares_sock_config_callback sock_config_cb;
+ void *sock_config_cb_data;
};
+/* Memory management functions */
+extern void *(*ares_malloc)(size_t size);
+extern void *(*ares_realloc)(void *ptr, size_t size);
+extern void (*ares_free)(void *ptr);
+
/* return true if now is exactly check time or later */
int ares__timedout(struct timeval *now,
struct timeval *check);
-/* add the specific number of milliseconds to the time in the first argument */
-int ares__timeadd(struct timeval *now,
- int millisecs);
-/* return time offset between now and (future) check, in milliseconds */
-long ares__timeoffset(struct timeval *now,
- struct timeval *check);
-/* returns ARES_SUCCESS if library has been initialized */
-int ares_library_initialized(void);
+
void ares__send_query(ares_channel channel, struct query *query,
struct timeval *now);
void ares__close_sockets(ares_channel channel, struct server_state *server);