lwIP 2.1.0 Lightweight IP stack

Macros | Functions
dhcp.h File Reference
`#include "lwip/opt.h"`
`#include "lwip/netif.h"`
`#include "lwip/udp.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)

## 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 (struct netif *netif)
void | dhcp_arp_reply (struct netif *netif, const ip4_addr_t *addr)
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()

## Function Documentation

## ◆ dhcp_arp_reply()

void dhcp_arp_reply | ( | struct netif * | netif,
|  | const ip4_addr_t * | addr
| ) |  |

Match an ARP reply with the offered IP address: check whether the offered IP address is not in use using ARP

Parameters

  netif | the network interface on which the reply was received
  addr | The IP address we received a reply from

## ◆ 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()

void dhcp_network_changed | ( | 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

  netif | the netif to check

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