1ARES_PARSE_URI_REPLY(3) Library Functions Manual ARES_PARSE_URI_REPLY(3)
2
3
4
6 ares_parse_uri_reply - Parse a reply to a DNS query of type URI
7
9 #include <ares.h>
10
11 int ares_parse_uri_reply(const unsigned char* abuf, int alen,
12 struct ares_uri_reply** uri_out);
13
15 The ares_parse_uri_reply(3) function parses the response to a query of
16 type URI into a linked list of struct ares_uri_reply The parameters
17 abuf and alen give the contents of the response. The result is stored
18 in allocated memory and a pointer to it stored into the variable
19 pointed to by uri_out. It is the caller's responsibility to free the
20 resulting uri_out structure when it is no longer needed using the func‐
21 tion ares_free_data(3).
22
23 The structure ares_uri_reply contains the following fields:
24 struct ares_uri_reply {
25 struct ares_uri_reply *next;
26 unsigned short weight;
27 unsigned short priority;
28 char *uri;
29 int ttl;
30 };
31
33 ares_parse_uri_reply can return any of the following values:
34
35 ARES_SUCCESS The response was successfully parsed.
36
37 ARES_EBADRESP The response was malformatted.
38
39 ARES_ENODATA The response did not contain an answer to the query.
40
41 ARES_ENOMEM Memory was exhausted.
42
45 ares_query(3) ares_free_data(3)
46
48 Written by Jan Petrasek <petrasek@tes.eu>
49
50
51
52 14 August 2020 ARES_PARSE_URI_REPLY(3)