ares_set_servers_csv: fixed IPv6 address parsing
[platform/upstream/c-ares.git] / ares_parse_ns_reply.3
1 .\"
2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
3 .\"
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose.  It is provided "as is"
14 .\" without express or implied warranty.
15 .\"
16 .TH ARES_PARSE_NS_REPLY 3 "10 February 2007"
17 .SH NAME
18 ares_parse_ns_reply \- Parse a reply to a DNS query of type NS into a hostent
19 .SH SYNOPSIS
20 .nf
21 .B #include <ares.h>
22 .PP
23 .B int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
24 .B      struct hostent **\fIhost\fP);
25 .fi
26 .SH DESCRIPTION
27 The
28 .B ares_parse_ns_reply
29 function parses the response to a query of type NS into a
30 .BR "struct hostent" .
31 The parameters
32 .I abuf
33 and
34 .I alen
35 give the contents of the response.  The result is stored in allocated
36 memory and a pointer to it stored into the variable pointed to by
37 .IR host . 
38 The nameservers are stored into the 
39 .BR aliases 
40 field of the 
41 .IR host 
42 structure. 
43 It is the caller's responsibility to free the resulting host structure
44 using
45 .BR ares_free_hostent (3)
46 when it is no longer needed.
47 .SH RETURN VALUES
48 .B ares_parse_ns_reply
49 can return any of the following values:
50 .TP 15
51 .B ARES_SUCCESS
52 The response was successfully parsed.
53 .TP 15
54 .B ARES_EBADRESP
55 The response was malformatted.
56 .TP 15
57 .B ARES_ENODATA
58 The response did not contain an answer to the query.
59 .TP 15
60 .B ARES_ENOMEM
61 Memory was exhausted.
62 .SH SEE ALSO
63 .BR ares_query (3),
64 .BR ares_free_hostent (3)
65 .SH AUTHOR
66 Written by Vlad Dinulescu <vlad.dinulescu@avira.com>, on behalf of AVIRA Gmbh http://www.avira.com