Converts the string representation of a host name to its corresponding IP address using DNS service.
Files
dns-c.h/dns-c.c
Prototype
Arguments
p_host_name | Pointer to a string that contains the host name. |
p_rev_host_name | Pointer to a string that will receive the host name resulting from a reverse lookup. This argument should be left DEF_NULL if a forward DNS request is desired. |
rev_hostname_len | String length of p_rev_host_name. This argument should evaluate to 0 if a forward DNS request is desired. |
p_addrs | Pointer to arrays that will receive the IP address from this function. |
flags | DNS client flag: DNSc_FLAG_NONE By default this function is blocking. |
p_cfg | Must be set to DEF_NULL to use default configuration. Pointer to a request configuration. Should be set to overwrite default DNS configuration (such as DNS server, request timeout, etc.). |
p_err | Pointer to variable that will receive the return error code from this function. |
Returned Values
Resolution status:
DNSc_STATUS_PENDING Host resolution is pending, call again to see the status. (Processed by DNSc's task)
DNSc_STATUS_RESOLVED Host is resolved.
DNSc_STATUS_FAILED Host resolution has failed.
Required Configuration
None.
Notes / Warnings
The DNSc_FLAG_REVERSE_LOOKUP flag must be used in conjunction with the DNSc_FLAG_FORCE_RESOLUTION flag.
Example Usage
See Sample Application.