blob: 32f510af8592dbc7532a8ae619c9a840648830f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-ab,v 1.1 2006/07/18 22:38:18 adrianp Exp $
--- ares_init.c.orig 2005-08-22 07:40:07.000000000 +0100
+++ ares_init.c
@@ -1060,3 +1060,24 @@ static void natural_mask(struct apattern
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
}
#endif
+
+int ares_get_config(struct ares_config_info *d, ares_channel c)
+{
+int i;
+char *p;
+
+ memset(d, 0, sizeof(struct ares_config_info));
+
+ d->timeout = c->timeout;
+ d->tries = c->tries;
+ d->numservers = c->nservers;
+ d->servers = calloc(sizeof(char *), c->nservers);
+ for (i = 0; i < c->nservers; i++)
+ {
+ p = inet_ntoa(c->servers[i].addr);
+ d->servers[i] = p ? strdup(p) : NULL;
+ }
+
+ return ARES_SUCCESS;
+}
+
|