Kea 3.1.5
isc::lease_query::PoolSet Class Reference

Manages a unique set of Pools of a given protocol family. More...

#include <lease_query_impl.h>

Public Member Functions

 PoolSet (uint16_t family)
 Constructor.
 
bool contains (const isc::asiolink::IOAddress &address) const
 Checks if an address is present in the set.
 
uint16_t getFamily () const
 Returns the protocol family of the address set.
 
void insert (const isc::asiolink::IOAddress &prefix, uint8_t prefix_len)
 Inserts an pool into the set.
 
size_t size () const
 Returns the number of pools in the set.
 

Detailed Description

Manages a unique set of Pools of a given protocol family.

The pools are hashed by their address range.

Definition at line 112 of file lease_query_impl.h.

Constructor & Destructor Documentation

◆ PoolSet()

isc::lease_query::PoolSet::PoolSet ( uint16_t family)
inline

Constructor.

Parameters
familyprotocol family of the set (AF_INET or AF_INET6)

Definition at line 117 of file lease_query_impl.h.

Member Function Documentation

◆ contains()

bool PoolSet::contains ( const isc::asiolink::IOAddress & address) const

Checks if an address is present in the set.

Parameters
addressaddress to look for.
Returns
true if the address is within a pool in the pool set
Exceptions
BadValueif the address's family does not match the set's family.

Definition at line 57 of file lease_query_impl.cc.

References isc::asiolink::IOAddress::getFamily(), and isc_throw.

+ Here is the call graph for this function:

◆ getFamily()

uint16_t isc::lease_query::PoolSet::getFamily ( ) const
inline

Returns the protocol family of the address set.

Definition at line 146 of file lease_query_impl.h.

Referenced by insert().

◆ insert()

void PoolSet::insert ( const isc::asiolink::IOAddress & prefix,
uint8_t prefix_len )

Inserts an pool into the set.

Creates a pool and adds it to the set, assuming it is not already in the set.

Parameters
prefixprefix of the pool
prefix_lenlength of the pool prefix
Exceptions
BadValueif the prefix family does not match the set's family, prefix length is invalid, or the pool is already in the set.

Definition at line 41 of file lease_query_impl.cc.

References isc::dhcp::Pool4::create(), isc::dhcp::Pool6::create(), getFamily(), isc_throw, and isc::dhcp::Lease::TYPE_NA.

+ Here is the call graph for this function:

◆ size()

size_t isc::lease_query::PoolSet::size ( ) const
inline

Returns the number of pools in the set.

Definition at line 141 of file lease_query_impl.h.


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