uIP 1.0: apps/resolv/resolv.h File Reference

- Main Page
- Modules
- Data Structures
- Files
- Examples

- File List
- Globals

# apps/resolv/resolv.h File Reference

## Detailed Description

DNS resolver code header file.

Author:
  Adam Dunkels <adam@dunkels.com>

Definition in file resolv.h.

`#include "uipopt.h"`

Go to the source code of this file.

## Appication specific configurations

An uIP application is implemented using a single application function that is called by uIP whenever a TCP/IP event occurs. The name of this function must be registered with uIP at compile time using the UIP_APPCALL definition.

uIP applications can store the application state within the uip_conn structure by specifying the type of the application structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.

The file containing the definitions must be included in the uipopt.h file.

The following example illustrates how this can look.

    void httpd_appcall(void);
    #define UIP_APPCALL     httpd_appcall

    struct httpd_state {
      u8_t state;
      u16_t count;
      char *dataptr;
      char *script;
    };
    typedef struct httpd_state uip_tcp_appstate_t

typedef int | uip_udp_appstate_t
| The type of the application state that is to be stored in the uip_conn structure.

## Defines

#define | UIP_UDP_APPCALL resolv_appcall

## 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.