Support Watt-32 under Win32.
[platform/upstream/c-ares.git] / ares_parse_ptr_reply.3
1 .\" $Id$
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_PTR_REPLY 3 "25 July 1998"
18 .SH NAME
19 ares_parse_ptr_reply \- Parse a reply to a DNS query of type PTR into a hostent
20 .SH SYNOPSIS
21 .nf
22 .B #include <ares.h>
23 .PP
24 .B int ares_parse_ptr_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
25 .B      const void *\fIaddr\fP, int \fIaddrlen\fP, int \fIfamily\fP,
26 .B      struct hostent **\fIhost\fP);
27 .fi
28 .SH DESCRIPTION
29 The
30 .B ares_parse_ptr_reply
31 function parses the response to a query of type PTR 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 parameters
38 .IR addr ,
39 .IR addrlen ,
40 and
41 .I family
42 specify which address was queried for; they are not used to verify the
43 response, merely used to fill in the address of the
44 .BR "struct hostent" .
45 The resulting
46 .B struct hostent
47 is stored in allocated memory and a pointer to it stored into the
48 variable pointed to by
49 .IR host .
50 It is the caller's responsibility to free the resulting host structure
51 using
52 .BR ares_free_hostent (3)
53 when it is no longer needed.
54 .SH RETURN VALUES
55 .B ares_parse_ptr_reply
56 can return any of the following values:
57 .TP 15
58 .B ARES_SUCCESS
59 The response was successfully parsed.
60 .TP 15
61 .B ARES_EBADRESP
62 The response was malformatted.
63 .TP 15
64 .B ARES_ENODATA
65 The response did not contain an answer to the query.
66 .TP 15
67 .B ARES_ENOMEM
68 Memory was exhausted.
69 .SH SEE ALSO
70 .BR ares_gethostbyaddr (3),
71 .BR ares_free_hostent (3)
72 .SH AUTHOR
73 Greg Hudson, MIT Information Systems
74 .br
75 Copyright 1998 by the Massachusetts Institute of Technology.