JamminJimP (talk | contribs) No edit summary |
JamminJimP (talk | contribs) No edit summary |
||
Line 37: | Line 37: | ||
Future enhancements planned: |
Future enhancements planned: |
||
− | + | * return multiple ip addresses |
|
− | + | * return other RR types (MX, SRV...) |
|
− | + | * implement a "dynamic dns update" message |
|
[Category:lwIP Application Developers Guide] |
[Category:lwIP Application Developers Guide] |
Revision as of 19:34, 13 November 2008
The lwIP stack provides a basic DNS client (introduced in 1.3.0) to allow other applications to resolve host names to addresses using the DNS (Dynamic Name Service) protocol. LWIP_DNS must be #defined in lwipopts.h to a nonzero value to enable DNS support in your lwIP platform.
Raw API applications can use the dns_gethostbyname() function to request a lookup, and specify a callback function to notify the application when the lookup is complete. For socket based apps, a gethostbyname() wrapper function is provided that blocks during the lookup if necessary.
* 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: * - ERR_OK if hostname is a valid IP address string or the host * name is already in the local names table. * - ERR_INPROGRESS enqueue a request to be sent to the DNS server * for resolution if no errors are present. * * @param hostname the hostname that is to be queried * @param 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!) * @param found a callback function to be called on success, failure or timeout (only if * ERR_INPROGRESS is returned!) * @param callback_arg argument to pass to the callback function * callback function and argument defined as follows: * A function of this type must be implemented by the application using the DNS resolver. * @param name pointer to the name that was looked up. * @param ipaddr pointer to a struct ip_addr containing the IP address of the hostname, * or NULL if the name could not be found (or on any other error). * @param callback_arg a user-specified callback argument passed to dns_gethostbyname:
* typedef void (*dns_found_callback)(const char *name, struct ip_addr *ipaddr, void *callback_arg);
Future enhancements planned:
- return multiple ip addresses
- return other RR types (MX, SRV...)
- implement a "dynamic dns update" message
[Category:lwIP Application Developers Guide]