Commit Graph

14 Commits

Author SHA1 Message Date
Fedor Indutny 53c2186e18 txt: introduce `ares_parse_txt_reply_ext`
Introduce `ares_txt_ext` structure with an extra `record_start`
field, which indicates a start of a new TXT record, thus allowing to
differentiate the chunks in the same record, from a chunks in a
different record.

Introduce a new API method: `ares_parse_txt_reply_ext` that works with
this kind of struct.
2016-02-04 10:00:59 +00:00
David Drysdale 7972adc5d7 api: Add entrypoints to allow use of per-server ports
Add user-visible entrypoints ares_{get,set}_servers_ports(3), which
take struct ares_addr_port_node rather than struct ares_addr_node.
This structure includes a UDP and TCP port number; if this is set
to zero, the channel-wide port values are used as before.

Similarly, add a new ares_set_servers_ports_csv(3) entrypoint, which
is analogous to ares_set_servers(3) except it doesn't ignore any
specified port information; instead, any per-server specified port
is used as both the UDP and TCP port for that server.

The internal struct ares_addr is extended to hold the UDP/TCP ports,
stored in network order, with the convention that a value of zero
indicates that the channel-wide UDP/TCP port should be used.

For the internal implementation of ares_dup(3), shift to use the
_ports() version of the get/set functions, so port information is
transferred correctly to the new channel.

Update manpages, and add missing ares_set_servers_csv to the lists
while we're at it
2016-02-02 10:13:46 +00:00
David Drysdale f1bcfa1122 api: Allow injection of user-specified malloc/free functions
Add a new ares_library_init_mem() initialization function for the
library which allows the library user to specify their own malloc,
realloc & free equivalents for use library-wide.

Store these function pointers in library-wide global variables,
defaulting to libc's malloc(), realloc() and free().

Change all calls to malloc, realloc and free to use the function pointer
instead.  Also ensure that ares_strdup() is always available
(even if the local environment includes strdup(3)), and change the
library code to always use it.

Convert calls to calloc() to use ares_malloc() + memset
2016-02-02 10:05:07 +00:00
Daniel Stenberg 050663271e ares_get_datatype: removed unused function
it was also wrongly named as internal functions require two underscores
2013-02-13 14:58:04 +01:00
Marko Kreen 979bf951d3 SOA parser added
I need to do SOA queries, so here is a parser for them.

- ares_soa_reply: new struct
- ares_malloc_data/ares_free_soa: ARES_DATATYPE_SOA_REPLY
- ares_parse_soa_reply: actual function
2012-06-15 13:32:48 +02:00
Yang Tse 41f8ff5070 ares_data.c: some NAPTR related fixes 2012-03-17 02:45:03 +01:00
saghul 6bab0393c4 Added support for parsing NAPTR records 2012-02-23 23:15:07 +01:00
Ben Greear 293cd31700 Add missing break that caused get_ares_servers to fail.
Reported-by: Ning Dong <flintning@163.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-08-24 16:52:29 -07:00
Jérémy Lal 63918fca76 added ares_parse_mx_reply 2010-04-18 00:29:26 +02:00
Daniel Stenberg 63627fa5ab remove all $Id$ lines 2010-03-27 19:42:02 +01:00
Yang Tse 8fe746fcf2 Added IPv6 name servers support 2010-03-05 20:01:47 +00:00
Yang Tse 157d68729f fix compiler warning 2010-02-21 19:59:09 +00:00
Yang Tse 5d62fe703f Jakub Hrozek modified ares_parse_srv_reply() and ares_parse_txt_reply() API
to return a linked lists of results. These were also modified to internally
use the ares_data memory struct and as such its result must be free'ed with
ares_free_data().
2009-11-20 09:06:33 +00:00
Yang Tse 2a916ce6e5 Initial support for the generic ares_free_data() function that will allow
applications to free memory allocated and returned by some c-ares funtions.
2009-11-20 08:50:03 +00:00