DNSGetAddr[Async]


C Specification

#include <dolphin/ip.h>

typedef void (* DNSCallback )(DNSInfo* info, s32 result);
s32 DNSGetAddr     ( DNSInfo* info, const char* name, u8* addr, s32 addrlen );
s32 DNSGetAddrAsync( DNSInfo* info, const char* name, u8* addr, s32 addrlen,
                     DNSCallback callback, s32* result );

Description

DNSGetAddrAsync() retrieves the host IP addresses for the given host name.

Arguments

info Pointer to DNSInfo to perform query.
name Host name to query.
addr Buffer for IP addresses to receive.
addrlen Size of buffer in bytes. It must be multiple of four.
callback Notified when the name is resolved.
result Optional pointer to s32 that receives the function result. While the operation is in progress, the value *result  is set to IP_ERR_BUSY.

Return Values

zero or greater Succeeded. The number of retrieved address bytes.
IP_ERR_INVALID Specified parameters are invalid.
IP_ERR_BUSY Specified info is busy.
IP_ERR_UNREACHABLE Specified DNS server is unreachable from this machine.
IP_ERR_DATASIZE The data size exceeds the transfer limit.
IP_ERR_INS_RESOURCES Failed to allocate an ephemeral source port number.
IP_ERR_TIMEOUT Timeout error.
IP_ERR_DNS_FORMAT Format error - The name server was unable to interpret the query.
IP_ERR_DNS_SERVER Server failure - The name server was unable to process the query due to a problem with the name server.
IP_ERR_DNS_NAME Name Error - The domain name referenced in the query does not exist.
IP_ERR_DNS_NOTIMP Not Implemented - The name server does not support the requested kind of query.
IP_ERR_DNS_REFUSED Refused - The name server refuses to perform the specified operation for policy reasons.
IP_ERR_NETDOWN Local network interface is down.

See Also

Mockapetris, P., 1987 "Domain Names - Implementation and Specification", RFC 1035 (Nov.).