lwIP 2.2.0
Lightweight IP stack
Loading...
Searching...
No Matches
dhcp.h File Reference
#include "lwip/opt.h"
#include "lwip/netif.h"
#include "lwip/udp.h"
#include "lwip/acd.h"

Macros

#define DHCP_COARSE_TIMER_SECS   60
 
#define DHCP_COARSE_TIMER_MSECS   (DHCP_COARSE_TIMER_SECS * 1000UL)
 
#define DHCP_FINE_TIMER_MSECS   500
 
#define dhcp_remove_struct(netif)   netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)
 

Typedefs

typedef u16_t dhcp_timeout_t
 

Functions

void dhcp_set_struct (struct netif *netif, struct dhcp *dhcp)
 
void dhcp_cleanup (struct netif *netif)
 
err_t dhcp_start (struct netif *netif)
 
err_t dhcp_renew (struct netif *netif)
 
err_t dhcp_release (struct netif *netif)
 
void dhcp_stop (struct netif *netif)
 
void dhcp_release_and_stop (struct netif *netif)
 
void dhcp_inform (struct netif *netif)
 
void dhcp_network_changed_link_up (struct netif *netif)
 
u8_t dhcp_supplied_address (const struct netif *netif)
 
void dhcp_coarse_tmr (void)
 
void dhcp_fine_tmr (void)
 

Detailed Description

DHCP client API

Macro Definition Documentation

◆ DHCP_COARSE_TIMER_MSECS

#define DHCP_COARSE_TIMER_MSECS   (DHCP_COARSE_TIMER_SECS * 1000UL)

period (in milliseconds) of the application calling dhcp_coarse_tmr()

◆ DHCP_COARSE_TIMER_SECS

#define DHCP_COARSE_TIMER_SECS   60

period (in seconds) of the application calling dhcp_coarse_tmr()

◆ DHCP_FINE_TIMER_MSECS

#define DHCP_FINE_TIMER_MSECS   500

period (in milliseconds) of the application calling dhcp_fine_tmr()

◆ dhcp_remove_struct

#define dhcp_remove_struct (   netif)    netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)

Remove a struct dhcp previously set to the netif using dhcp_set_struct()

Typedef Documentation

◆ dhcp_timeout_t

typedef u16_t dhcp_timeout_t

Define DHCP_TIMEOUT_SIZE_T in opt.h if you want use a different integer than u16_t. Especially useful if DHCP_COARSE_TIMER_SECS is in smaller units, so timeouts easily reach UINT16_MAX and more

Function Documentation

◆ dhcp_coarse_tmr()

void dhcp_coarse_tmr ( void  )

The DHCP timer that checks for lease renewal/rebind timeouts. Must be called once a minute (see DHCP_COARSE_TIMER_SECS).

◆ dhcp_fine_tmr()

void dhcp_fine_tmr ( void  )

DHCP transaction timeout handling (this function must be called every 500ms, see DHCP_FINE_TIMER_MSECS).

A DHCP server is expected to respond within a short period of time. This timer checks whether an outstanding DHCP request is timed out.

◆ dhcp_network_changed_link_up()

void dhcp_network_changed_link_up ( struct netif netif)

Handle a possible change in the network configuration.

This enters the REBOOTING state to verify that the currently bound address is still valid.

◆ dhcp_supplied_address()

u8_t dhcp_supplied_address ( const struct netif netif)

check if DHCP supplied netif->ip_addr

Parameters
netifthe netif to check
Returns
1 if DHCP supplied netif->ip_addr (states BOUND or RENEWING), 0 otherwise