DHCP
[User Protocols]

Dynamic host configuration protocol. More...

Collaboration diagram for DHCP:

Dynamic host configuration protocol.

Hosts running Nut/Net can make use of DHCP, if the local network provides this facility.

To use this feature, applications must call NutDhcpIfConfig().

 #include <pro/dhcp.h>

 ...

 if(NutDhcpIfConfig("eth0", 0, 60000)) {
     printf("IP interface not configured. Error %d\n", NutDhcpError());
 }

Application programmers often get confused by the fact, that NutDhcpIfConfig() is somewhat more general. It also checks non-volatile memory (e.g. EEPROM contents for the AVR devices). If a fixed IP address has been configured, it will use this and will not query DHCP for an IP configuration. The Ethernut Software Manual explains this in more detail.

Typical DHCP servers offer more than just the IP configuration. The following items are recognized by Nut/Net:

However, only the first three are used for the Nut/Net IP configuration. The broadcast address is internally created by the IP layer.

If provided by the DHCP server, the IP addresses of the primary and the secondary DNS are passed by the DHCP client to NutDnsConfig2().

The last two items, host and domain name, are currently discarded.

When an application wants to shut down the system, it may call NutDhcpRelease(). This lowers the burden on some busy DHCP servers with long lease times.

Applications doing their own IP configuration, e.g. using a user interface for their configuration and storing the values in non-volatile memory, may call NutDhcpInform() to inform DHCP servers about the address allocation.

The function NutDhcpStatus() is provided to enable applications to track the progress and the current status of the DHCP client.


© 2000-2010 by contributors - visit http://www.ethernut.de/