Technology
 

DHCP

From lwIP Wiki

Contents

[edit] DHCP from an application perspective

To enable DHCP, you must make sure to compile in DHCP. You can do this by defining the LWIP_DHCP option in lwipopts.h to 1 and be sure that the module gets initialized (see Initializing lwIP for the right way to initialize modules for your platform).

To use DHCP on an interface, simply use the following commands:

  • dhcp_start() - start DHCP configuration for an interface.
  • dhcp_renew() - enforce early lease renewal (not needed normally)
  • dhcp_release() - release the DHCP lease, usually called before dhcp_stop()
  • dhcp_stop() - stop DHCP configuration for an interface
  • dhcp_inform() - inform server of our manual IP address

Note: These functions are lwIP core functions. They are not protected against concurrent access. In multithreaded environments, they may be called from the core thread only (aka. the tcpip-thread). When calling from other threads, use the netifapi_dhcp_*() functions defined in the api-module netifapi.c.

[edit] DHCP support history in lwIP

HEADUnspecified.
1.2Unspecified.

[edit] External references

  • RFC 1531 "Dynamic Host Configuration Protocol" October 1993, obsoleted by RFC 1541
  • RFC 1541 "Dynamic Host Configuration Protocol" October 1993, obsoleted by RFC 2131
  • RFC 2131 "Dynamic Host Configuration Protocol" March 1997, updated by RFC 3396
  • RFC 3396 "Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)" November 2002

[edit] See also