[getdns-api] Distinguish strings from wire format in conversion functions

Goyal, Neel ngoyal at verisign.com
Wed Jan 29 14:01:03 MST 2014

In response to this (and the memory part 3)

I agree we need to change the sigs to distinguish between characters and
wire format elements.  I think we should change the functions to:

getdns_return_t getdns_convert_dns_name_to_fqdn(const uint8_t
*dns_name_wire_fmt, char** name);

getdns_return_t getdns_convert_fqdn_to_dns_name(const char
*fqdn_as_string, uint8_t** dns_name, size_t* name_len);

We should document that all char* must be null terminated (otherwise we
need to add an input length parameter as well, which is ok), and all
memory must be freed as needed.  The name we return in the first function
will be guaranteed null terminated.

On 1/21/14, 5:27 AM, "Willem Toorop" <willem at nlnetlabs.nl> wrote:

>Since the library used "Standard Integer Types" anyway, why not use it
>in the conversion function prototypes (from 4.2) to distinguish strings
>from wire format names:
>char *getdns_convert_dns_name_to_fqdn(const uint8_t *dns_name_wire_fmt);
>uint8_t *getdns_convert_fqdn_to_dns_name(const char *fqdn_as_string);
>What do you think?
>getdns-api mailing list
>getdns-api at vpnc.org

More information about the getdns-api mailing list