Data Structures | |
struct | dns_hdr |
struct | dns_query |
struct | dns_answer |
struct | dns_table_entry |
Functions | |
void | dns_init () |
void | dns_setserver (u8_t numdns, struct ip_addr *dnsserver) |
struct ip_addr | dns_getserver (u8_t numdns) |
void | dns_tmr (void) |
err_t | dns_gethostbyname (const char *hostname, struct ip_addr *addr, dns_found_callback found, void *callback_arg) |
err_t dns_gethostbyname | ( | const char * | hostname, | |
struct ip_addr * | addr, | |||
dns_found_callback | found, | |||
void * | callback_arg | |||
) |
Resolve a hostname (string) into an IP address. NON-BLOCKING callback version for use with raw API!!!
Returns immediately with one of err_t return codes:
hostname | the hostname that is to be queried | |
addr | pointer to a struct ip_addr where to store the address if it is already cached in the dns_table (only valid if ERR_OK is returned!) | |
found | a callback function to be called on success, failure or timeout (only if ERR_INPROGRESS is returned!) | |
callback_arg | argument to pass to the callback function |
struct ip_addr dns_getserver | ( | u8_t | numdns | ) | [read] |
Obtain one of the currently configured DNS server.
numdns | the index of the DNS server |
void dns_init | ( | void | ) |
Initialize the resolver: set up the UDP pcb and configure the default server (DNS_SERVER_ADDRESS).
void dns_setserver | ( | u8_t | numdns, | |
struct ip_addr * | dnsserver | |||
) |
Initialize one of the DNS servers.
numdns | the index of the DNS server to set must be < DNS_MAX_SERVERS | |
dnsserver | IP address of the DNS server to set |
void dns_tmr | ( | void | ) |
The DNS resolver client timer - handle retries and timeouts and should be called every DNS_TMR_INTERVAL milliseconds (every second by default).