SatCat5
ip_dhcp.h File Reference

Detailed Description

Dynamic Host Configuration Protocol (DHCP) client and server.

Dynamic Host Configuration Protocol is used to automatically assign or request IP addresses for hosts on an IPv4 subnet. DHCP servers maintain a pool of free and assigned addresses; DHCP clients contact the server to request an address.

To use the DHCP client:

  • Initialize the UDP-dispatch or IP-stack object with ip::ADDR_NONE.
  • Create an ip::DhcpClient object linked to the UDP-dispatch object.
  • Client will automatically issue a DHCP request after a short delay.

To use the DHCP server:

  • Initialize the UDP-dispatch or IP-stack object. The assigned IP-address should be outside the DHCP range.
  • Allocate an ip::DhcpPool object (usually DhcpPoolStatic).
  • Create an ip::DhcpServer object, providing pointers to the UDP-dispatch object and the DHCP-pool object.

See also: IETF RFC2131: https://www.rfc-editor.org/rfc/rfc2131

Definition in file ip_dhcp.h.

#include <satcat5/eth_arp.h>
#include <satcat5/net_core.h>
#include <satcat5/ip_core.h>
#include <satcat5/polling.h>
#include <satcat5/udp_core.h>
Include dependency graph for ip_dhcp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  satcat5::ip::DhcpId
 A unique client-identifier. More...
 
class  satcat5::ip::DhcpClient
 DHCP Client for leasing an IP address from a server. More...
 
struct  satcat5::ip::DhcpAddress
 One address in the pool allocated to a DhcpServer. More...
 
class  satcat5::ip::DhcpPool
 Generic container for a group of DhcpAddress objects. More...
 
class  satcat5::ip::DhcpPoolStatic< SIZE >
 The simplest possible implementation of DhcpPool, supporting a contiguous range of IP-addresses from BASE to BASE+SIZE-1. More...
 
class  satcat5::ip::DhcpServer
 DHCP Server for managing leases to other clients. More...
 

Macros

#define SATCAT5_DHCP_MAX_ID_LEN   62
 

Enumerations

enum class  satcat5::ip::DhcpState {
  INIT , SELECTING , TESTING , REQUESTING ,
  BOUND , RENEWING , REBINDING , INFORMING ,
  STOPPED
}
 DHCP protocol state. More...
 

Enumeration Type Documentation

◆ DhcpState

DHCP protocol state.

See also
DhcpClient Client states match the ones in RFC2131 Figure 5, except that we've added a few new internal wait states (e.g., ARP queries).

Definition at line 57 of file ip_dhcp.h.