# modules/uip/apps/resolv/resolv.c File Reference

`#include "resolv.h"`
`#include "uip.h"`
`#include <string.h>`

## Data Structures
struct | dns_hdr
struct | dns_answer
struct | namemap
## Defines
#define | NULL (void *)0
#define | MAX_RETRIES 8
#define | DNS_FLAG1_RESPONSE 0x80
#define | DNS_FLAG1_OPCODE_STATUS 0x10
#define | DNS_FLAG1_OPCODE_INVERSE 0x08
#define | DNS_FLAG1_OPCODE_STANDARD 0x00
#define | DNS_FLAG1_AUTHORATIVE 0x04
#define | DNS_FLAG1_TRUNC 0x02
#define | DNS_FLAG1_RD 0x01
#define | DNS_FLAG2_RA 0x80
#define | DNS_FLAG2_ERR_MASK 0x0f
#define | DNS_FLAG2_ERR_NONE 0x00
#define | DNS_FLAG2_ERR_NAME 0x03
#define | STATE_UNUSED 0
#define | STATE_NEW 1
#define | STATE_ASKING 2
#define | STATE_DONE 3
#define | STATE_ERROR 4
#define | RESOLV_ENTRIES 4
## Functions
void | resolv_appcall (void)
void | resolv_query (char *name)
u16_t * | resolv_lookup (char *name)
u16_t * | resolv_getserver (void)
void | resolv_conf (u16_t *dnsserver)
void | resolv_init (void)

## Detailed Description

DNS host name to IP address resolver.

Author:
  Adam Dunkels <adam@dunkels.com>

This file implements a DNS host name to IP address resolver.

## Define Documentation

#define DNS_FLAG1_AUTHORATIVE 0x04

#define DNS_FLAG1_OPCODE_INVERSE 0x08

#define DNS_FLAG1_OPCODE_STANDARD 0x00

#define DNS_FLAG1_OPCODE_STATUS 0x10

#define DNS_FLAG1_RD 0x01

#define DNS_FLAG1_RESPONSE 0x80

#define DNS_FLAG1_TRUNC 0x02

#define DNS_FLAG2_ERR_MASK 0x0f

#define DNS_FLAG2_ERR_NAME 0x03

#define DNS_FLAG2_ERR_NONE 0x00

#define DNS_FLAG2_RA 0x80

#define STATE_ASKING 2

#define STATE_DONE 3

#define STATE_ERROR 4

#define STATE_NEW 1

#define STATE_UNUSED 0