Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (78 sloc) 2.341 kb
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
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_A_REPLY 3 "25 July 1998"
17 .SH NAME
2f84a750 »
2009-10-29 shorten the descriptions somewhat
18 ares_parse_a_reply \- Parse a reply to a DNS query of type A
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
19 .SH SYNOPSIS
20 .nf
21 .B #include <ares.h>
22 .PP
9665aaf2 »
2004-04-01 Dominick Meglio man page fixes
23 .B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
b4bdb6d4 » sesse
2007-11-15 Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inc…
24 .B struct hostent **\fIhost\fP,
36b26039 » yangtse
2009-11-23 - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
25 .B struct ares_addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
26 .fi
27 .SH DESCRIPTION
28 The
29 .B ares_parse_a_reply
30 function parses the response to a query of type A into a
b4bdb6d4 » sesse
2007-11-15 Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inc…
31 .BR "struct hostent"
32 and/or an array of
36b26039 » yangtse
2009-11-23 - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
33 .BR "struct ares_addrttls" .
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
34 The parameters
35 .I abuf
36 and
37 .I alen
38 give the contents of the response. The result is stored in allocated
39 memory and a pointer to it stored into the variable pointed to by
b4bdb6d4 » sesse
2007-11-15 Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inc…
40 .IR host ,
41 if host is nonnull.
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
42 It is the caller's responsibility to free the resulting host structure
43 using
44 .BR ares_free_hostent (3)
45 when it is no longer needed.
b4bdb6d4 » sesse
2007-11-15 Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inc…
46 .PP
47 If
48 .IR addrttls
49 and
50 .IR naddrttls
51 are both nonnull,
52 then up to *naddrttls
36b26039 » yangtse
2009-11-23 - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
53 .BR "struct ares_addrttl"
b4bdb6d4 » sesse
2007-11-15 Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inc…
54 records are stored in the array pointed to by addrttls,
55 and then *naddrttls is set to the number of records so stored.
56 Note that the memory for these records is supplied by the caller.
5e847a14 »
2003-10-07 ares 1.1.1 with collected applied patches
57 .SH RETURN VALUES
58 .B ares_parse_a_reply
59 can return any of the following values:
60 .TP 15
61 .B ARES_SUCCESS
62 The response was successfully parsed.
63 .TP 15
64 .B ARES_EBADRESP
65 The response was malformatted.
66 .TP 15
67 .B ARES_ENODATA
68 The response did not contain an answer to the query.
69 .TP 15
70 .B ARES_ENOMEM
71 Memory was exhausted.
72 .SH SEE ALSO
73 .BR ares_gethostbyname (3),
74 .BR ares_free_hostent (3)
75 .SH AUTHOR
76 Greg Hudson, MIT Information Systems
77 .br
78 Copyright 1998 by the Massachusetts Institute of Technology.
Something went wrong with that request. Please try again.