ON Semiconductor / mbed-os

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Embed: (wiki syntax)

« Back to documentation index

DHCPv4

DHCPv4
[IPv4]

DHCP (IPv4) related functions. More...

Functions

void dhcp_set_struct (struct netif *netif, struct dhcp *dhcp)
 Set a statically allocated struct dhcp to work with.
void dhcp_cleanup (struct netif *netif)
 Removes a struct dhcp from a netif.
err_t dhcp_start (struct netif *netif)
 Start DHCP negotiation for a network interface.
void dhcp_inform (struct netif *netif)
 Inform a DHCP server of our manual configuration.
err_t dhcp_renew (struct netif *netif)
 Renew an existing DHCP lease at the involved DHCP server.
err_t dhcp_release (struct netif *netif)
 Release a DHCP lease.
void dhcp_stop (struct netif *netif)
 Remove the DHCP client from the interface.

Detailed Description

DHCP (IPv4) related functions.

See also:
DHCPv4

Function Documentation

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.

Parameters:
netifthe netif from which to remove the struct dhcp

Definition at line 683 of file lwip_dhcp.c.

void dhcp_inform ( struct netif netif )

Inform a DHCP server of our manual configuration.

inform server of our manual IP address

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.

Parameters:
netifThe lwIP network interface

Definition at line 788 of file lwip_dhcp.c.

err_t dhcp_release ( struct netif netif )

Release a DHCP lease.

release the DHCP lease, usually called before dhcp_stop()

Parameters:
netifnetwork interface which must release its lease

Definition at line 1261 of file lwip_dhcp.c.

err_t dhcp_renew ( struct netif netif )

Renew an existing DHCP lease at the involved DHCP server.

enforce early lease renewal (not needed normally)

Parameters:
netifnetwork interface which must renew its lease

Definition at line 1108 of file lwip_dhcp.c.

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.

Parameters:
netifthe netif for which to set the struct dhcp
dhcp(uninitialised) dhcp struct allocated by the application

Definition at line 662 of file lwip_dhcp.c.

err_t dhcp_start ( struct netif netif )

Start DHCP negotiation for a network interface.

start DHCP configuration

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.

Parameters:
netifThe lwIP network interface
Returns:
lwIP error code
  • ERR_OK - No error
  • ERR_MEM - Out of memory

Definition at line 707 of file lwip_dhcp.c.

void dhcp_stop ( struct netif netif )

Remove the DHCP client from the interface.

stop DHCP configuration

Parameters:
netifThe network interface to stop DHCP on

Definition at line 1324 of file lwip_dhcp.c.