]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - libares/ares_parse_a_reply.3
need automake as a build-dep, even though we don't use most of it
[1ts-debian.git] / libares / ares_parse_a_reply.3
1 .\" $Id: ares_parse_a_reply.3,v 1.1 1998/08/13 18:07:33 ghudson Exp $
2 .\"
3 .\" Copyright 1998 by the Massachusetts Institute of Technology.
4 .\"
5 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose.  It is provided "as is"
15 .\" without express or implied warranty.
16 .\"
17 .TH ARES_PARSE_A_REPLY 3 "25 July 1998"
18 .SH NAME
19 ares_parse_a_reply \- Parse a reply to a DNS query of type A into a hostent
20 .SH SYNOPSIS
21 .nf
22 .B #include <ares.h>
23 .PP
24 .B
25 int ares_parse_a_reply(const unsigned char *\fIabuf\fB, int \fIalen\fB,
26 .B      struct hostent **\fIhost\fB);
27 .fi
28 .SH DESCRIPTION
29 The
30 .B ares_parse_a_reply
31 function parses the response to a query of type A into a
32 .BR "struct hostent" .
33 The parameters
34 .I abuf
35 and
36 .I alen
37 give the contents of the response.  The result is stored in allocated
38 memory and a pointer to it stored into the variable pointed to by
39 .IR host .
40 It is the caller's responsibility to free the resulting host structure
41 using
42 .BR ares_free_hostent (3)
43 when it is no longer needed.
44 .SH RETURN VALUES
45 .B ares_parse_a_reply
46 can return any of the following values:
47 .TP 15
48 .B ARES_SUCCESS
49 The response was successfully parsed.
50 .TP 15
51 .B ARES_EBADRESP
52 The response was malformatted.
53 .TP 15
54 .B ARES_ENODATA
55 The response did not contain an answer to the query.
56 .TP 15
57 .B ARES_ENOMEM
58 Memory was exhausted.
59 .SH SEE ALSO
60 .BR ares_gethostbyname (3),
61 .BR ares_free_hostent (3)
62 .SH AUTHOR
63 Greg Hudson, MIT Information Systems
64 .br
65 Copyright 1998 by the Massachusetts Institute of Technology.