/[resiprocate]/main/contrib/ares/ares_parse_ptr_reply.3
ViewVC logotype

Contents of /main/contrib/ares/ares_parse_ptr_reply.3

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5295 - (show annotations) (download)
Mon Aug 22 00:30:05 2005 UTC (14 years, 3 months ago) by jason
File size: 2233 byte(s)
merged 5270:HEAD from b-directory-reorg
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_PTR_REPLY 3 "25 July 1998"
17 .SH NAME
18 ares_parse_ptr_reply \- Parse a reply to a DNS query of type PTR into a hostent
19 .SH SYNOPSIS
20 .nf
21 .B #include <ares.h>
22 .PP
23 .B
24 int ares_parse_ptr_reply(const unsigned char *\fIabuf\fB, int \fIalen\fB,
25 .B
26 const void *\fIaddr\fP, int \fIaddrlen\fP, int \fIfamily\fP,
27 .B struct hostent **\fIhost\fB);
28 .fi
29 .SH DESCRIPTION
30 The
31 .B ares_parse_ptr_reply
32 function parses the response to a query of type PTR into a
33 .BR "struct hostent" .
34 The parameters
35 .I abuf
36 and
37 .I alen
38 give the contents of the response. The parameters
39 .IR addr ,
40 .IR addrlen ,
41 and
42 .I family
43 specify which address was queried for; they are not used to verify the
44 response, merely used to fill in the address of the
45 .BR "struct hostent" .
46 The resulting
47 .B struct hostent
48 is stored in allocated memory and a pointer to it stored into the
49 variable pointed to by
50 .IR host .
51 It is the caller's responsibility to free the resulting host structure
52 using
53 .BR ares_free_hostent (3)
54 when it is no longer needed.
55 .SH RETURN VALUES
56 .B ares_parse_ptr_reply
57 can return any of the following values:
58 .TP 15
59 .B ARES_SUCCESS
60 The response was successfully parsed.
61 .TP 15
62 .B ARES_EBADRESP
63 The response was malformatted.
64 .TP 15
65 .B ARES_ENODATA
66 The response did not contain an answer to the query.
67 .TP 15
68 .B ARES_ENOMEM
69 Memory was exhausted.
70 .SH SEE ALSO
71 .BR ares_gethostbyaddr (3),
72 .BR ares_free_hostent (3)
73 .SH AUTHOR
74 Greg Hudson, MIT Information Systems
75 .br
76 Copyright 1998 by the Massachusetts Institute of Technology.

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27