It maintains a list of resolved hostnames that can be queried with the resolv_lookup() function. New hostnames can be resolved using the resolv_query() function.
When a hostname has been resolved (or found to be non-existant), the resolver code calls a callback function called resolv_found() that must be implemented by the module that uses the resolver.
Files | |
file | resolv.h |
DNS resolver code header file. | |
file | resolv.c |
DNS host name to IP address resolver. | |
Defines | |
#define | UIP_UDP_APPCALL resolv_appcall |
#define | NULL (void *)0 |
#define | MAX_RETRIES 8 |
#define | RESOLV_ENTRIES 4 |
Functions | |
void | resolv_appcall (void) |
void | resolv_found (char *name, u16_t *ipaddr) |
Callback function which is called when a hostname is found. | |
void | resolv_conf (u16_t *dnsserver) |
Configure which DNS server to use for queries. | |
u16_t * | resolv_getserver (void) |
Obtain the currently configured DNS server. | |
void | resolv_init (void) |
Initalize the resolver. | |
u16_t * | resolv_lookup (char *name) |
Look up a hostname in the array of known hostnames. | |
void | resolv_query (char *name) |
Queues a name so that a question for the name will be sent out. |
|
Configure which DNS server to use for queries.
Definition at line 438 of file resolv.c. References HTONS, NULL, uip_udp_new(), and uip_udp_remove. |
|
Callback function which is called when a hostname is found. This function must be implemented by the module that uses the DNS resolver. It is called when a hostname is found, or when a hostname was not found.
|
|
Obtain the currently configured DNS server.
Definition at line 422 of file resolv.c. References NULL, and uip_udp_conn::ripaddr. |
|
Look up a hostname in the array of known hostnames.
Definition at line 396 of file resolv.c. References RESOLV_ENTRIES, and STATE_DONE. Referenced by webclient_appcall(), and webclient_get(). |
|
Queues a name so that a question for the name will be sent out.
Definition at line 350 of file resolv.c. References RESOLV_ENTRIES, and STATE_UNUSED. Referenced by webclient_appcall(). |