diff options
Diffstat (limited to 'ares_private.h')
-rw-r--r-- | ares_private.h | 35 |
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); |