1ARES_PARSE_TXT_REPLY(3) Library Functions Manual ARES_PARSE_TXT_REPLY(3)
2
3
4
6 ares_parse_txt_reply - Parse a reply to a DNS query of type TXT
7
9 #include <ares.h>
10
11 int ares_parse_txt_reply(const unsigned char* abuf, int alen,
12 struct ares_txt_reply **txt_out);
13
15 The ares_parse_txt_reply function parses the response to a query of
16 type TXT into a linked list (one element per sub-string) of struct
17 ares_txt_reply The parameters abuf and alen give the contents of the
18 response. The result is stored in allocated memory and a pointer to it
19 stored into the variable pointed to by txt_out. It is the caller's
20 responsibility to free the resulting txt_out structure when it is no
21 longer needed using the function ares_free_data
22
23 The structure ares_txt_reply contains the following fields:
24
25 struct ares_txt_reply {
26 struct ares_txt_reply *next;
27 unsigned int length;
28 unsigned char *txt;
29 };
30
32 ares_parse_txt_reply can return any of the following values:
33
34 ARES_SUCCESS The response was successfully parsed.
35
36 ARES_EBADRESP The response was malformatted.
37
38 ARES_ENODATA The response did not contain an answer to the query.
39
40 ARES_ENOMEM Memory was exhausted.
41
43 This function was first introduced in c-ares version 1.7.0.
44
46 ares_query(3) ares_free_data(3)
47
49 Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc
50 http://www.redhat.com
51
52
53
54
55 27 October 2009 ARES_PARSE_TXT_REPLY(3)