TCPIP_DNS_GetIPv4Addresses Function

C

int TCPIP_DNS_GetIPv4Addresses(
    const char* hostName, 
    int startIndex, 
    IPV4_ADDR* pIPv4Addr, 
    int nIPv4Addresses
);

Description

This function will return IPv4 addresses for a host name if the DNS resolution has been completed.

Preconditions

TCPIP_DNS_Resolve() has been called.

Parameters

ParametersDescription
hostNameA pointer to the null terminated string specifying the host name.
startIndexStarting index of the IP address to be returned when multiple addresses are available. The max number of addresses that can be stored for a host name is given by TCPIP_DNS_CLIENT_MODULE_CONFIG::n4Entries. The current number of valid entries for an address is given by TCPIP_DNS_GetIPAddressesNumber(). A valid index is [0, TCPIP_DNS_GetIPAddressesNumber(IP_ADDRESS_TYPE_4)).
pIPv4AddrPointer to array of IPv4 addresses to store the host 4 addresses.
nIPv4AddressesNumber of IPv46 addresses in the p4Addr array.

Returns

  • > 0 - The number of addresses copied to the p4Addr array.

  • 0 - If the host name was not found, invalid index, bad parameter, etc.

Remarks

None.