blob: 1c4456f0bbe9b09bca8fcbdd9d34d5ef34ff481d [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001.\"
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_SOA_REPLY 3 "29 May 2012"
17.SH NAME
18ares_parse_soa_reply \- Parse a reply to a DNS query of type SOA
19.SH SYNOPSIS
20.nf
21.B #include <ares.h>
22.PP
23.B int ares_parse_soa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
24.B struct ares_soa_reply** \fIsoa_out\fP);
25.fi
26.SH DESCRIPTION
27The
28.B ares_parse_soa_reply
29function parses the response to a query of type SOA into a
30.IR struct\ ares_soa_reply .
31The parameters
32.I abuf
33and
34.I alen
35give the contents of the response. The result is stored in allocated
36memory and a pointer to it stored into the variable pointed to by
37.IR soa_out .
38It is the caller's responsibility to free the resulting
39.IR soa_out
40structure when it is no longer needed using the function
41.B ares_free_data
42.PP
43The structure
44.I ares_soa_reply
45contains the following fields:
46.sp
47.in +4n
48.nf
49struct ares_soa_reply {
50 char *nsname;
51 char *hostmaster;
52 unsigned int serial;
53 unsigned int refresh;
54 unsigned int retry;
55 unsigned int expire;
56 unsigned int minttl;
57};
58.fi
59.in
60.PP
61.SH RETURN VALUES
62.B ares_parse_soa_reply
63can return any of the following values:
64.TP 15
65.B ARES_SUCCESS
66The response was successfully parsed.
67.TP 15
68.B ARES_EBADRESP
69The response was malformatted.
70.TP 15
71.B ARES_ENODATA
72The response did not contain an answer to the query.
73.TP 15
74.B ARES_ENOMEM
75Memory was exhausted.
76.SH AVAILABILITY
77This function was first introduced in c-ares version 1.9.0.
78.SH SEE ALSO
79.BR ares_query (3)
80.BR ares_free_data (3)