Kea  2.1.7-git
isc::dhcp::Pool4 Class Reference

Pool information for IPv4 addresses. More...

#include <pool.h>

+ Inheritance diagram for isc::dhcp::Pool4:

Public Member Functions

 Pool4 (const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last)
 the constructor for Pool4 "min-max" style definition More...
 
 Pool4 (const isc::asiolink::IOAddress &prefix, uint8_t prefix_len)
 the constructor for Pool4 "prefix/len" style definition More...
 
virtual data::ElementPtr toElement () const
 Unparse a Pool4 object. More...
 
- Public Member Functions inherited from isc::dhcp::Pool
virtual ~Pool ()
 virtual destructor More...
 
void allowClientClass (const ClientClass &class_name)
 Sets the supported class to class class_name. More...
 
bool clientSupported (const ClientClasses &client_classes) const
 Checks whether this pool supports client that belongs to specified classes. More...
 
uint64_t getCapacity () const
 Returns the number of all leases in this pool. More...
 
CfgOptionPtr getCfgOption ()
 Returns pointer to the option data configuration for this pool. More...
 
ConstCfgOptionPtr getCfgOption () const
 Returns const pointer to the option data configuration for this pool. More...
 
const ClientClassgetClientClass () const
 returns the client class More...
 
const isc::asiolink::IOAddressgetFirstAddress () const
 Returns the first address in a pool. More...
 
uint32_t getId () const
 returns Pool-id More...
 
const isc::asiolink::IOAddressgetLastAddress () const
 Returns the last address in a pool. More...
 
isc::asiolink::IOAddress getLastAllocated () const
 returns the last address that was tried from this pool More...
 
IPRangePermutationPtr getPermutation () const
 Returns pointer to the permutation associated with the pool. More...
 
const ClientClassesgetRequiredClasses () const
 Returns classes which are required to be evaluated. More...
 
Lease::Type getType () const
 Returns pool type (v4, v6 non-temporary, v6 temp, v6 prefix) More...
 
bool inRange (const isc::asiolink::IOAddress &addr) const
 Checks if a given address is in the range. More...
 
bool isLastAllocatedValid () const
 checks if the last address is valid More...
 
void requireClientClass (const ClientClass &class_name)
 Adds class class_name to classes required to be evaluated. More...
 
void resetLastAllocated ()
 resets the last address to invalid More...
 
void setLastAllocated (const isc::asiolink::IOAddress &addr)
 sets the last address that was tried from this pool More...
 
virtual std::string toText () const
 returns textual representation of the pool More...
 
- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object. More...
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context. More...
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Static Public Member Functions

static Pool4Ptr create (const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last)
 Factory function for creating an instance of the Pool4. More...
 
static Pool4Ptr create (const isc::asiolink::IOAddress &prefix, uint8_t prefix_len)
 Factory function for creating an instance of the Pool4. More...
 
- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy an Element map. More...
 

Additional Inherited Members

- Protected Member Functions inherited from isc::dhcp::Pool
 Pool (Lease::Type type, const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last)
 protected constructor More...
 
- Static Protected Member Functions inherited from isc::dhcp::Pool
static uint32_t getNextID ()
 returns the next unique Pool-ID More...
 
- Protected Attributes inherited from isc::dhcp::Pool
uint64_t capacity_
 Stores number of possible leases. More...
 
CfgOptionPtr cfg_option_
 Pointer to the option data configuration for this pool. More...
 
ClientClass client_class_
 Optional definition of a client class. More...
 
isc::asiolink::IOAddress first_
 The first address in a pool. More...
 
uint32_t id_
 pool-id More...
 
isc::asiolink::IOAddress last_
 The last address in a pool. More...
 
isc::asiolink::IOAddress last_allocated_
 Last allocated address See isc::dhcp::Subnet::last_allocated_ia_ Initialized and reset to first. More...
 
bool last_allocated_valid_
 Status of last allocated address. More...
 
IPRangePermutationPtr permutation_
 Pointer to the permutation object. More...
 
ClientClasses required_classes_
 Required classes. More...
 
Lease::Type type_
 defines a lease type that will be served from this pool More...
 
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Detailed Description

Pool information for IPv4 addresses.

It holds information about pool4, i.e. a range of IPv4 address space that is configured for DHCP allocation.

Definition at line 262 of file pool.h.

Constructor & Destructor Documentation

◆ Pool4() [1/2]

isc::dhcp::Pool4::Pool4 ( const isc::asiolink::IOAddress first,
const isc::asiolink::IOAddress last 
)

the constructor for Pool4 "min-max" style definition

Parameters
firstthe first address in a pool
lastthe last address in a pool

Definition at line 49 of file pool.cc.

References isc::asiolink::addrsInRange(), isc::dhcp::Pool::capacity_, isc_throw, and isc::asiolink::IOAddress::isV4().

+ Here is the call graph for this function:

◆ Pool4() [2/2]

isc::dhcp::Pool4::Pool4 ( const isc::asiolink::IOAddress prefix,
uint8_t  prefix_len 
)

the constructor for Pool4 "prefix/len" style definition

Parameters
prefixspecifies prefix of the pool
prefix_lenspecifies length of the prefix of the pool

Definition at line 68 of file pool.cc.

References isc::asiolink::addrsInRange(), isc::dhcp::Pool::capacity_, isc_throw, isc::asiolink::IOAddress::isV4(), isc::dhcp::Pool::last_, and isc::asiolink::lastAddrInPrefix().

+ Here is the call graph for this function:

Member Function Documentation

◆ create() [1/2]

Pool4Ptr isc::dhcp::Pool4::create ( const isc::asiolink::IOAddress first,
const isc::asiolink::IOAddress last 
)
static

Factory function for creating an instance of the Pool4.

This function should be used to create an instance of the pool within a hooks library in cases when the library may be unloaded before the object is destroyed. This ensures that the ownership of the object by the Kea process is retained.

Parameters
firstthe first address in a pool
lastthe last address in a pool
Returns
Pointer to the Pool4 instance.

Definition at line 92 of file pool.cc.

◆ create() [2/2]

Pool4Ptr isc::dhcp::Pool4::create ( const isc::asiolink::IOAddress prefix,
uint8_t  prefix_len 
)
static

Factory function for creating an instance of the Pool4.

This function should be used to create an instance of the pool within a hooks library in cases when the library may be unloaded before the object is destroyed. This ensures that the ownership of the object by the Kea process is retained.

Parameters
prefixspecifies prefix of the pool.
prefix_lenspecifies length of the prefix of the pool.
Returns
Pointer to the Pool4 instance.

Definition at line 97 of file pool.cc.

◆ toElement()

data::ElementPtr isc::dhcp::Pool4::toElement ( ) const
virtual

Unparse a Pool4 object.

Returns
A pointer to unparsed Pool4 configuration.

Reimplemented from isc::dhcp::Pool.

Definition at line 134 of file pool.cc.

References isc::dhcp::Pool::getFirstAddress(), isc::dhcp::Pool::getLastAddress(), isc::asiolink::prefixLengthFromRange(), isc::dhcp::Pool::toElement(), and isc::asiolink::IOAddress::toText().

+ Here is the call graph for this function:

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