Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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_namePointer to a string that contains the host name.
p_addrsPointer to arrays that will receive the IP address from this function.
flags

DNS client flag:

DNSc_FLAG_NONE By default this function is blocking.
DNSc_FLAG_NO_BLOCK Don't block (only possible if DNSc's task is enabled).
DNSc_FLAG_FORCE_CACHE Take host from the cache, don't send new DNS request.
DNSc_FLAG_FORCE_RENEW Force DNS request, remove existing entry in the cache.
DNSc_FLAG_IPv4_ONLY Return only IPv4 address(es).
DNSc_FLAG_IPv6_ONLY Return only IPv6 address(es).

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_errPointer 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

None.

Example Usage

See Sample Application.

  • No labels