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