ares_parse_ns_reply.3 (1306B)
1 .\" 2 .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 .\" SPDX-License-Identifier: MIT 4 .\" 5 .TH ARES_PARSE_NS_REPLY 3 "10 February 2007" 6 .SH NAME 7 ares_parse_ns_reply \- Parse a reply to a DNS query of type NS into a hostent 8 .SH SYNOPSIS 9 .nf 10 #include <ares.h> 11 12 int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, 13 struct hostent **\fIhost\fP); 14 .fi 15 .SH DESCRIPTION 16 The 17 .B ares_parse_ns_reply 18 function parses the response to a query of type NS into a 19 .BR "struct hostent" . 20 The parameters 21 .I abuf 22 and 23 .I alen 24 give the contents of the response. The result is stored in allocated 25 memory and a pointer to it stored into the variable pointed to by 26 .IR host . 27 The nameservers are stored into the 28 .BR aliases 29 field of the 30 .IR host 31 structure. 32 It is the caller's responsibility to free the resulting host structure 33 using 34 .BR ares_free_hostent (3) 35 when it is no longer needed. 36 .SH RETURN VALUES 37 .B ares_parse_ns_reply 38 can return any of the following values: 39 .TP 15 40 .B ARES_SUCCESS 41 The response was successfully parsed. 42 .TP 15 43 .B ARES_EBADRESP 44 The response was malformatted. 45 .TP 15 46 .B ARES_ENODATA 47 The response did not contain an answer to the query. 48 .TP 15 49 .B ARES_ENOMEM 50 Memory was exhausted. 51 .SH SEE ALSO 52 .BR ares_query (3), 53 .BR ares_free_hostent (3)