DNS
[User Protocols]

Domain name service protocol. More...

Collaboration diagram for DNS:

Functions

void DumpDnsHeader (FILE *stream, DNSHEADER *doh)
void DumpDnsQuestion (FILE *stream, DNSQUESTION *doq)
void DumpDnsResource (FILE *stream, DNSRESOURCE *dor)
void NutDnsConfig2 (uint8_t *hostname, uint8_t *domain, uint32_t pdnsip, uint32_t sdnsip)
 Set DNS configuration.
void NutDnsConfig (uint8_t *hostname, uint8_t *domain, uint32_t dnsip)
 Sets DNS configuration.
void NutDnsGetConfig2 (char **hostname, char **domain, uint32_t *pdnsip, uint32_t *sdnsip)
uint32_t NutDnsGetResource (CONST uint8_t *hostname, CONST uint16_t type)
 Retrieves IP-address corresponding to a host name.
uint32_t NutDnsGetHostByName (CONST uint8_t *hostname)
uint32_t NutDnsGetMxByDomain (CONST uint8_t *hostname)

Detailed Description

Domain name service protocol.


Function Documentation

void DumpDnsHeader ( FILE stream,
DNSHEADER *  doh 
)

Definition at line 156 of file resolv.c.

References fprintf().

void DumpDnsQuestion ( FILE stream,
DNSQUESTION *  doq 
)

Definition at line 163 of file resolv.c.

References fprintf().

void DumpDnsResource ( FILE stream,
DNSRESOURCE *  dor 
)

Definition at line 168 of file resolv.c.

References fprintf(), and fputc().

void NutDnsConfig2 ( uint8_t hostname,
uint8_t domain,
uint32_t  pdnsip,
uint32_t  sdnsip 
)

Set DNS configuration.

Parameters:
hostname DNS name of the local host.
domain Name of the domain of the local host.
pdnsip IP address of the primary DNS server.
sdnsip IP address of the secondary DNS server.

Definition at line 400 of file resolv.c.

References free, and strdup().

Referenced by main(), NutDhcpIfConfig(), and NutDnsConfig().

void NutDnsConfig ( uint8_t hostname,
uint8_t domain,
uint32_t  dnsip 
)

Sets DNS configuration.

Deprecated:
New applications should use NutDnsConfig2().
Parameters:
hostname DNS name of the local host.
domain Name of the domain of the local host.
dnsip IP address of the DNS server.

Definition at line 429 of file resolv.c.

References NutDnsConfig2().

void NutDnsGetConfig2 ( char **  hostname,
char **  domain,
uint32_t pdnsip,
uint32_t sdnsip 
)

Definition at line 434 of file resolv.c.

uint32_t NutDnsGetResource ( CONST uint8_t hostname,
CONST uint16_t  type 
)

Retrieves IP-address corresponding to a host name.

This is a very simple implementation, which will not return any other resource information than the IP address.

Parameters:
hostname Fully qualified domain name of the host.
type Request type.
Returns:
IP address, which is zero, if the name could not be resolved.

Definition at line 474 of file resolv.c.

References free, malloc, NutUdpCreateSocket(), NutUdpDestroySocket(), NutUdpReceiveFrom(), and NutUdpSendTo().

Referenced by NutDnsGetHostByName(), and NutDnsGetMxByDomain().

uint32_t NutDnsGetHostByName ( CONST uint8_t hostname  ) 

Definition at line 464 of file resolv.c.

References NutDnsGetResource().

Referenced by main().

uint32_t NutDnsGetMxByDomain ( CONST uint8_t hostname  ) 

Definition at line 469 of file resolv.c.

References NutDnsGetResource().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/