SatCat5
satcat5::ip::DhcpPool Class Referenceabstract

Detailed Description

Generic container for a group of DhcpAddress objects.

Most users should use DhcpPoolStatic, but more complex use cases such as non-contiguous ranges may need a custom implementation.

See also
DhcpPoolStatic, DhcpServer

Definition at line 144 of file ip_dhcp.h.

#include <ip_dhcp.h>

Inheritance diagram for satcat5::ip::DhcpPool:
[legend]

Public Member Functions

virtual unsigned addr2idx (const satcat5::ip::Addr &addr) const =0
 Find index associated with the given IP address. More...
 
virtual satcat5::ip::Addr idx2addr (unsigned idx) const =0
 Fetch IP-address for Nth object in the pool. More...
 
virtual satcat5::ip::DhcpAddressidx2meta (unsigned idx)=0
 Fetch metadata for Nth object in the pool.or Returns NULL if the index is out of bounds. More...
 
bool contains (const satcat5::ip::Addr &addr)
 Does this pool contain the designated address?
 
satcat5::ip::DhcpAddressaddr2meta (const satcat5::ip::Addr &addr)
 Two-step lookup of metadata from address.
 

Member Function Documentation

◆ addr2idx()

virtual unsigned satcat5::ip::DhcpPool::addr2idx ( const satcat5::ip::Addr addr) const
pure virtual

Find index associated with the given IP address.

If none is found, return any out-of-bounds index. Child classes MUST override this method.

Implemented in satcat5::ip::DhcpPoolStatic< SIZE >.

◆ idx2addr()

virtual satcat5::ip::Addr satcat5::ip::DhcpPool::idx2addr ( unsigned  idx) const
pure virtual

Fetch IP-address for Nth object in the pool.

Returns ip::ADDR_NONE if the index is out of bounds. Child classes MUST override this method.

Implemented in satcat5::ip::DhcpPoolStatic< SIZE >.

◆ idx2meta()

virtual satcat5::ip::DhcpAddress* satcat5::ip::DhcpPool::idx2meta ( unsigned  idx)
pure virtual

Fetch metadata for Nth object in the pool.or Returns NULL if the index is out of bounds.

Child classes MUST override this method.

Implemented in satcat5::ip::DhcpPoolStatic< SIZE >.


The documentation for this class was generated from the following file: