#include <dolphin/ip.h>
#define DNS_NAME_MAX 255 // names are 255 octets or less
typedef void (* DNSCallback )(DNSInfo* info, s32 result);
s32 DNSGetName ( DNSInfo* info, const u8* addr, char* name ); s32 DNSGetNameAsync( DNSInfo* info, const u8* addr, char* name, DNSCallback callback, s32* result);
DNSGetNameAsync() retrieves the host name for the
given IP address.
info |
Pointer to DNSInfo to perform query. |
addr |
IP address to query the name. |
name |
String buffer to receive the host name. The buffer size must be DNS_NAME_MAX(255)
bytes. |
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. |
| zero or greater | Succeeded. The number of retrieved name bytes excluding the terminating zero. |
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. |
Mockapetris, P., 1987 "Domain Names - Implementation and Specification", RFC 1035 (Nov.).