summaryrefslogtreecommitdiff
path: root/ares.h
diff options
context:
space:
mode:
authorYu Jiung <jiung.yu@samsung.com>2016-11-10 07:24:08 (GMT)
committerYu Jiung <jiung.yu@samsung.com>2016-11-10 07:25:02 (GMT)
commit8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8 (patch)
tree81f0750d91aa467df3ee81cf30d22a65db2e6685 /ares.h
parentccccebb78520ec3a26a18370936516b12ae5d53a (diff)
parent45e88a8337839e5fd88519bc55467053d521c9f6 (diff)
downloadc-ares-8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8.zip
c-ares-8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8.tar.gz
c-ares-8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8.tar.bz2
Conflicts: packaging/c-ares.spec Change-Id: I1ec10e394aed3ef19ee21fefbe3aba7d7a615c74
Diffstat (limited to 'ares.h')
-rw-r--r--ares.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/ares.h b/ares.h
index 9b3f376..cbd30f6 100644
--- a/ares.h
+++ b/ares.h
@@ -158,6 +158,7 @@ extern "C" {
#define ARES_OPT_TIMEOUTMS (1 << 13)
#define ARES_OPT_ROTATE (1 << 14)
#define ARES_OPT_EDNSPSZ (1 << 15)
+#define ARES_OPT_NOROTATE (1 << 16)
/* Nameinfo flag values */
#define ARES_NI_NOFQDN (1 << 0)
@@ -294,8 +295,19 @@ typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
int type,
void *data);
+typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
+ int type,
+ void *data);
+
CARES_EXTERN int ares_library_init(int flags);
+CARES_EXTERN int ares_library_init_mem(int flags,
+ void *(*amalloc)(size_t size),
+ void (*afree)(void *ptr),
+ void *(*arealloc)(void *ptr, size_t size));
+
+CARES_EXTERN int ares_library_initialized(void);
+
CARES_EXTERN void ares_library_cleanup(void);
CARES_EXTERN const char *ares_version(int *version);
@@ -337,6 +349,13 @@ CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
ares_sock_create_callback callback,
void *user_data);
+CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel,
+ ares_sock_config_callback callback,
+ void *user_data);
+
+CARES_EXTERN int ares_set_sortlist(ares_channel channel,
+ const char *sortstr);
+
CARES_EXTERN void ares_send(ares_channel channel,
const unsigned char *qbuf,
int qlen,
@@ -474,6 +493,17 @@ struct ares_txt_reply {
size_t length; /* length excludes null termination */
};
+/* NOTE: This structure is a superset of ares_txt_reply
+ */
+struct ares_txt_ext {
+ struct ares_txt_ext *next;
+ unsigned char *txt;
+ size_t length;
+ /* 1 - if start of new record
+ * 0 - if a chunk in the same record */
+ unsigned char record_start;
+};
+
struct ares_naptr_reply {
struct ares_naptr_reply *next;
unsigned char *flags;
@@ -537,6 +567,10 @@ CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
int alen,
struct ares_txt_reply** txt_out);
+CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf,
+ int alen,
+ struct ares_txt_ext** txt_out);
+
CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf,
int alen,
struct ares_naptr_reply** naptr_out);
@@ -553,7 +587,6 @@ CARES_EXTERN void ares_free_data(void *dataptr);
CARES_EXTERN const char *ares_strerror(int code);
-/* TODO: Hold port here as well. */
struct ares_addr_node {
struct ares_addr_node *next;
int family;
@@ -563,15 +596,32 @@ struct ares_addr_node {
} addr;
};
+struct ares_addr_port_node {
+ struct ares_addr_port_node *next;
+ int family;
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+ int udp_port;
+ int tcp_port;
+};
+
CARES_EXTERN int ares_set_servers(ares_channel channel,
struct ares_addr_node *servers);
+CARES_EXTERN int ares_set_servers_ports(ares_channel channel,
+ struct ares_addr_port_node *servers);
/* Incomming string format: host[:port][,host[:port]]... */
CARES_EXTERN int ares_set_servers_csv(ares_channel channel,
const char* servers);
+CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel,
+ const char* servers);
CARES_EXTERN int ares_get_servers(ares_channel channel,
struct ares_addr_node **servers);
+CARES_EXTERN int ares_get_servers_ports(ares_channel channel,
+ struct ares_addr_port_node **servers);
CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
ares_socklen_t size);