ares_parse_uri_reply.3 (1575B)
1 .\" 2 .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 .\" SPDX-License-Identifier: MIT 4 .\" 5 .TH ARES_PARSE_URI_REPLY 3 "14 August 2020" 6 .SH NAME 7 ares_parse_uri_reply \- Parse a reply to a DNS query of type URI 8 .SH SYNOPSIS 9 .nf 10 #include <ares.h> 11 12 int ares_parse_uri_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, 13 struct ares_uri_reply** \fIuri_out\fP); 14 .fi 15 .SH DESCRIPTION 16 The \fIares_parse_uri_reply(3)\fP function parses the response to a query of 17 type URI into a linked list of 18 .I struct ares_uri_reply 19 The parameters 20 .I abuf 21 and 22 .I alen 23 give the contents of the response. The result is stored in allocated 24 memory and a pointer to it stored into the variable pointed to by 25 .IR uri_out . 26 It is the caller's responsibility to free the resulting 27 .IR uri_out 28 structure when it is no longer needed using the function 29 \fBares_free_data(3)\fP. 30 31 The structure 32 .I ares_uri_reply 33 contains the following fields: 34 .nf 35 struct ares_uri_reply { 36 struct ares_uri_reply *next; 37 unsigned short weight; 38 unsigned short priority; 39 char *uri; 40 int ttl; 41 }; 42 .fi 43 .SH RETURN VALUES 44 .B ares_parse_uri_reply 45 can return any of the following values: 46 .TP 15 47 .B ARES_SUCCESS 48 The response was successfully parsed. 49 .TP 15 50 .B ARES_EBADRESP 51 The response was malformatted. 52 .TP 15 53 .B ARES_ENODATA 54 The response did not contain an answer to the query. 55 .TP 15 56 .B ARES_ENOMEM 57 Memory was exhausted. 58 .SH AVAILABILITY 59 60 .SH SEE ALSO 61 .BR ares_query (3) 62 .BR ares_free_data (3)