1ARES_PARSE_NS_REPLY(3) Library Functions Manual ARES_PARSE_NS_REPLY(3)
2
3
4
6 ares_parse_ns_reply - Parse a reply to a DNS query of type NS into a
7 hostent
8
10 #include <ares.h>
11
12 int ares_parse_ns_reply(const unsigned char *abuf, int alen,
13 struct hostent **host);
14
16 The ares_parse_ns_reply function parses the response to a query of type
17 NS into a struct hostent. The parameters abuf and alen give the con‐
18 tents of the response. The result is stored in allocated memory and a
19 pointer to it stored into the variable pointed to by host. The name‐
20 servers are stored into the aliases field of the host structure. It is
21 the caller's responsibility to free the resulting host structure using
22 ares_free_hostent(3) when it is no longer needed.
23
25 ares_parse_ns_reply can return any of the following values:
26
27 ARES_SUCCESS The response was successfully parsed.
28
29 ARES_EBADRESP The response was malformatted.
30
31 ARES_ENODATA The response did not contain an answer to the query.
32
33 ARES_ENOMEM Memory was exhausted.
34
36 ares_query(3), ares_free_hostent(3)
37
39 Written by Vlad Dinulescu <vlad.dinulescu@avira.com>, on behalf of
40 AVIRA Gmbh http://www.avira.com
41
42
43
44 10 February 2007 ARES_PARSE_NS_REPLY(3)