]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - libares/ares_parse_ptr_reply.3
need automake as a build-dep, even though we don't use most of it
[1ts-debian.git] / libares / ares_parse_ptr_reply.3
1 .\" $Id: ares_parse_ptr_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_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
25 int ares_parse_ptr_reply(const unsigned char *\fIabuf\fB, int \fIalen\fB,
26 .B
27         const void *\fIaddr\fP, int \fIaddrlen\fP, int \fIfamily\fP,
28 .B      struct hostent **\fIhost\fB);
29 .fi
30 .SH DESCRIPTION
31 The
32 .B ares_parse_ptr_reply
33 function parses the response to a query of type PTR into a
34 .BR "struct hostent" .
35 The parameters
36 .I abuf
37 and
38 .I alen
39 give the contents of the response.  The parameters
40 .IR addr ,
41 .IR addrlen ,
42 and
43 .I family
44 specify which address was queried for; they are not used to verify the
45 response, merely used to fill in the address of the
46 .BR "struct hostent" .
47 The resulting
48 .B struct hostent
49 is stored in allocated memory and a pointer to it stored into the
50 variable pointed to by
51 .IR host .
52 It is the caller's responsibility to free the resulting host structure
53 using
54 .BR ares_free_hostent (3)
55 when it is no longer needed.
56 .SH RETURN VALUES
57 .B ares_parse_ptr_reply
58 can return any of the following values:
59 .TP 15
60 .B ARES_SUCCESS
61 The response was successfully parsed.
62 .TP 15
63 .B ARES_EBADRESP
64 The response was malformatted.
65 .TP 15
66 .B ARES_ENODATA
67 The response did not contain an answer to the query.
68 .TP 15
69 .B ARES_ENOMEM
70 Memory was exhausted.
71 .SH SEE ALSO
72 .BR ares_gethostbyaddr (3),
73 .BR ares_free_hostent (3)
74 .SH AUTHOR
75 Greg Hudson, MIT Information Systems
76 .br
77 Copyright 1998 by the Massachusetts Institute of Technology.