lwIP
2.1.0
Lightweight IP stack
|
Functions | |
void | dhcp_set_struct (struct netif *netif, struct dhcp *dhcp) |
void | dhcp_cleanup (struct netif *netif) |
err_t | dhcp_start (struct netif *netif) |
void | dhcp_inform (struct netif *netif) |
err_t | dhcp_renew (struct netif *netif) |
void | dhcp_release_and_stop (struct netif *netif) |
err_t | dhcp_release (struct netif *netif) |
void | dhcp_stop (struct netif *netif) |
DHCP (IPv4) related functions This is a DHCP client for the lwIP TCP/IP stack. It aims to conform with RFC 2131 and RFC 2132.
Options: DHCP_COARSE_TIMER_SECS (recommended 60 which is a minute) DHCP_FINE_TIMER_MSECS (recommended 500 which equals TCP coarse timer)
dhcp_start() starts a DHCP client instance which configures the interface by obtaining an IP address lease and maintaining it.
Use dhcp_release() to end the lease and use dhcp_stop() to remove the DHCP client.
void dhcp_cleanup | ( | struct netif * | netif | ) |
Removes a struct dhcp from a netif.
ATTENTION: Only use this when not using dhcp_set_struct() to allocate the struct dhcp since the memory is passed back to the heap.
netif | the netif from which to remove the struct dhcp |
void dhcp_inform | ( | struct netif * | netif | ) |
Inform a DHCP server of our manual configuration.
This informs DHCP servers of our fixed IP address configuration by sending an INFORM message. It does not involve DHCP address configuration, it is just here to be nice to the network.
netif | The lwIP network interface |
This function calls dhcp_release_and_stop() internally.
void dhcp_release_and_stop | ( | struct netif * | netif | ) |
Release a DHCP lease and stop DHCP statemachine (and AUTOIP if LWIP_DHCP_AUTOIP_COOP).
netif | network interface |
Renew an existing DHCP lease at the involved DHCP server.
netif | network interface which must renew its lease |
void dhcp_set_struct | ( | struct netif * | netif, |
struct dhcp * | dhcp | ||
) |
Set a statically allocated struct dhcp to work with. Using this prevents dhcp_start to allocate it using mem_malloc.
netif | the netif for which to set the struct dhcp |
dhcp | (uninitialised) dhcp struct allocated by the application |
Start DHCP negotiation for a network interface.
If no DHCP client instance was attached to this interface, a new client is created first. If a DHCP client instance was already present, it restarts negotiation.
netif | The lwIP network interface |
void dhcp_stop | ( | struct netif * | netif | ) |
This function calls dhcp_release_and_stop() internally.