The getdns_address(3) and getdns_address_sync functions provide public entry points into the getdns API library to retrieve the address given a host name. It always returns both IPv4 and IPv6 addresses.
.HP3
.Icontext
see getdns_context (3)
.HP3
.Iname
the host name to resolve to an address (note that an IP address is considered invalid)
.HP3
.Iextensions
extensions for this request, NULL if no extensions, see libgetdns (3) for a detailed description of extensions
.HP3
.Iuserarg
returned to the callback function untouched, can be NULL
.HP3
.Itransaction_id
populated by the API and used to identify the callback (for example to getdns_cancel_callback), can be NULL, set to 0 if the function fails
.HP3
.Icallbackfn
pointer to a callback function defined by the application, typically used to process the response, may not be NULL. Only the asynchronous signature accepts a callback function, the synchronous signature does not include a callback.
.HP3
.Iresponse_length
The synchronous entry point includes this argument, the response length is placed at the address pointed to by response_length.
.HP3
.Iresponse
A getdns_dict type is returned in response and always contains at least three names: replies_full (a list containing the DNS response as binary data), replies_tree (a list containing the parsed DNS response data) and status (an int). The storage associated with this must be freed by a call to getdns_free_sync_request_memory (3).
.HP
.SH"RETURN VALUES"
Upon successful completion the functions return
.BGETDNS_RETURN_GOOD
, otherwise the following error values are returned:
.LP
.BGETDNS_RETURN_BAD_CONTEXT
if the context pointer is invalid
.LP
.BGETDNS_RETURN_BAD_DOMAIN_NAME
if the domain name passed to the function is invalid
.LP
.BGETDNS_RETURN_EXTENSION_MISFORMAT
if the data type specified in one or more of the extensions does not match the specifications
.LP
.BGETDNS_RETURN_NO_SUCH_EXTENSION
if one or more of the strings specified in the extensions are not valid