Main Page | Modules | Data Structures | File List | Data Fields | Globals | Examples

uIP hostname resolver functions
[The uIP TCP/IP stack]


Detailed Description

The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address. 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.

The event resolv_event_found is posted when a hostname has been resolved. It is up to the receiving process to determine if the correct hostname has been found by calling the resolv_lookup() function with the hostname.


Files

file  resolv.c
 DNS host name to IP address resolver.


Defines

#define MAX_RETRIES   8

Functions

 PROCESS_THREAD (resolv_process, ev, data)
void resolv_query (char *name)
 Queues a name so that a question for the name will be sent out.

u16_t * resolv_lookup (char *name)
 Look up a hostname in the array of known hostnames.

u16_t * resolv_getserver (void)
 Obtain the currently configured DNS server.

void resolv_conf (u16_t *dnsserver)
 Configure a DNS server.

void resolv_found (char *name, u16_t *ipaddr)

Variables

process_event_t resolv_event_found
 Event that is broadcasted when a DNS name has been resolved.


Define Documentation

#define MAX_RETRIES   8
 

For internal use only.

The maximum number of retries when asking for a name.


Function Documentation

PROCESS_THREAD resolv_process  ,
ev  ,
data 
 

For internal use only.

The main UDP function.

void resolv_conf u16_t *  dnsserver  ) 
 

Configure a DNS server.

Parameters:
dnsserver A pointer to a 4-byte representation of the IP address of the DNS server to be configured.

void resolv_found char *  name,
u16_t *  ipaddr
 

For internal use only.

Callback function which is called when a hostname is found.

u16_t* resolv_getserver void   ) 
 

Obtain the currently configured DNS server.

Returns:
A pointer to a 4-byte representation of the IP address of the currently configured DNS server or NULL if no DNS server has been configured.

u16_t* resolv_lookup char *  name  ) 
 

Look up a hostname in the array of known hostnames.

Note:
This function only looks in the internal array of known hostnames, it does not send out a query for the hostname if none was found. The function resolv_query() can be used to send a query for a hostname.
Returns:
A pointer to a 4-byte representation of the hostname's IP address, or NULL if the hostname was not found in the array of hostnames.

void resolv_query char *  name  ) 
 

Queues a name so that a question for the name will be sent out.

Parameters:
name The hostname that is to be queried.


Generated on Wed Jul 6 01:19:06 2005 for Contiki/ESB by doxygen 1.3.6