Kea  1.5.0
isc::dhcp::Subnet Class Referenceabstract

#include <subnet.h>

+ Inheritance diagram for isc::dhcp::Subnet:

Public Member Functions

void addPool (const PoolPtr &pool)
 Adds a new pool for the subnet. More...
 
virtual isc::asiolink::IOAddress default_pool () const =0
 Returns the default address that will be used for pool selection. More...
 
void delPools (Lease::Type type)
 Deletes all pools of specified type. More...
 
std::pair< isc::asiolink::IOAddress, uint8_t > get () const
 Returns subnet parameters (prefix and prefix length) More...
 
PoolPtr getAnyPool (Lease::Type type)
 Returns a pool without any address specified. More...
 
SubnetID getID () const
 Returns unique ID for that subnet. More...
 
isc::asiolink::IOAddress getLastAllocated (Lease::Type type) const
 returns the last address that was tried from this subnet More...
 
boost::posix_time::ptime getLastAllocatedTime (const Lease::Type &lease_type) const
 Returns the timestamp when the setLastAllocated function was called. More...
 
const PoolPtr getPool (Lease::Type type, const isc::asiolink::IOAddress &addr, bool anypool=true) const
 Returns a pool that specified address belongs to. More...
 
const PoolPtr getPool (Lease::Type type, const ClientClasses &client_classes, const isc::asiolink::IOAddress &addr) const
 Returns a pool that specified address belongs to with classes. More...
 
uint64_t getPoolCapacity (Lease::Type type) const
 Returns the number of possible leases for specified lease type. More...
 
uint64_t getPoolCapacity (Lease::Type type, const ClientClasses &client_classes) const
 Returns the number of possible leases for specified lease type allowed for a client which belongs to classes. More...
 
const PoolCollectiongetPools (Lease::Type type) const
 Returns all pools (const variant) More...
 
template<typename SharedNetworkPtrType >
void getSharedNetwork (SharedNetworkPtrType &shared_network) const
 Retrieves pointer to a shared network associated with a subnet. More...
 
std::string getSharedNetworkName () const
 Returns shared network name. More...
 
bool inPool (Lease::Type type, const isc::asiolink::IOAddress &addr) const
 checks if the specified address is in pools More...
 
bool inPool (Lease::Type type, const isc::asiolink::IOAddress &addr, const ClientClasses &client_classes) const
 checks if the specified address is in allowed pools More...
 
bool inRange (const isc::asiolink::IOAddress &addr) const
 checks if specified address is in range More...
 
void setLastAllocated (Lease::Type type, const isc::asiolink::IOAddress &addr)
 sets the last address that was tried from this subnet More...
 
void setSharedNetworkName (const std::string &shared_network_name)
 Sets new shared network name. More...
 
virtual std::string toText () const
 Returns textual representation of the subnet (e.g. 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 void resetSubnetID ()
 Resets subnet-id counter to its initial value (1) More...
 
- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy extracting comments an Element map. More...
 

Protected Member Functions

 Subnet (const isc::asiolink::IOAddress &prefix, uint8_t len, const SubnetID id)
 Protected constructor. More...
 
virtual ~Subnet ()
 virtual destructor More...
 
virtual void checkType (Lease::Type type) const =0
 Checks if used pool type is valid. More...
 
PoolCollectiongetPoolsWritable (Lease::Type type)
 Returns all pools (non-const variant) More...
 
bool poolOverlaps (const Lease::Type &pool_type, const PoolPtr &pool) const
 Checks if the specified pool overlaps with an existing pool. More...
 
uint64_t sumPoolCapacity (const PoolCollection &pools) const
 Returns a sum of possible leases in all pools. More...
 
uint64_t sumPoolCapacity (const PoolCollection &pools, const ClientClasses &client_classes) const
 Returns a sum of possible leases in all pools allowing classes. More...
 
virtual data::ElementPtr toElement () const
 Unparse a subnet object. More...
 

Static Protected Member Functions

static SubnetID generateNextID ()
 returns the next unique Subnet-ID More...
 
static std::pair< asiolink::IOAddress, uint8_t > parsePrefixCommon (const std::string &prefix)
 Converts subnet prefix to a pair of prefix/length pair. More...
 

Protected Attributes

SubnetID id_
 subnet-id More...
 
std::string iface_
 Name of the network interface (if connected directly) More...
 
isc::asiolink::IOAddress last_allocated_ia_
 last allocated address More...
 
isc::asiolink::IOAddress last_allocated_pd_
 last allocated IPv6 prefix More...
 
isc::asiolink::IOAddress last_allocated_ta_
 last allocated temporary address More...
 
std::map< Lease::Type, boost::posix_time::ptime > last_allocated_time_
 Timestamp indicating when a lease of a specified type has been last allocated from this subnet. More...
 
PoolCollection pools_
 collection of IPv4 or non-temporary IPv6 pools in that subnet More...
 
PoolCollection pools_pd_
 collection of IPv6 prefix pools in that subnet More...
 
PoolCollection pools_ta_
 collection of IPv6 temporary address pools in that subnet More...
 
isc::asiolink::IOAddress prefix_
 a prefix of the subnet More...
 
uint8_t prefix_len_
 a prefix length of the subnet More...
 
WeakNetworkPtr shared_network_
 Pointer to a shared network that subnet belongs to. More...
 
std::string shared_network_name_
 Shared network name. More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Static Protected Attributes

static SubnetID static_id_ = 1
 keeps the subnet-id value More...
 

Friends

class AssignableNetwork
 

Detailed Description

Definition at line 35 of file subnet.h.

Constructor & Destructor Documentation

◆ Subnet()

isc::dhcp::Subnet::Subnet ( const isc::asiolink::IOAddress prefix,
uint8_t  len,
const SubnetID  id 
)
protected

Protected constructor.

By making the constructor protected, we make sure that no one will ever instantiate that class. Subnet4 and Subnet6 should be used instead.

This constructor assigns a new subnet-id (see generateNextID). This subnet-id has unique value that is strictly monotonously increasing for each subnet, until it is explicitly reset back to 1 during reconfiguration process.

Parameters
prefixsubnet prefix
lenprefix length for the subnet
idarbitrary subnet id, value of 0 triggers autogeneration of subnet id

Definition at line 54 of file subnet.cc.

References isc_throw, isc::asiolink::IOAddress::isV4(), isc::asiolink::IOAddress::isV6(), last_allocated_time_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

+ Here is the call graph for this function:

◆ ~Subnet()

virtual isc::dhcp::Subnet::~Subnet ( )
inlineprotectedvirtual

virtual destructor

A virtual destructor is needed because other classes derive from this class.

Definition at line 323 of file subnet.h.

Member Function Documentation

◆ addPool()

void isc::dhcp::Subnet::addPool ( const PoolPtr pool)

Adds a new pool for the subnet.

This method checks that the address range represented by the pool matches the subnet prefix, if the pool type is different than IA_PD. The prefixes from the IA_PD pools don't need to match the prefix from the subnet from which they are handed out to the requesting router because the requesting router may use the delegated prefixes in different networks (using different subnets).

A DHCPv4 pool being added must not overlap with any existing DHCPv4 pool. A DHCPv6 pool being added must not overlap with any existing DHCPv6 pool.

Pools held within a subnet are sorted by first pool address/prefix from the lowest to the highest.

Parameters
poolpool to be added
Exceptions
isc::BadValueif the pool type is invalid, the pool is not an IA_PD pool and the address range of this pool does not match the subnet prefix, or the pool overlaps with an existing pool within the subnet.

Definition at line 443 of file subnet.cc.

References checkType(), getPoolsWritable(), inRange(), isc_throw, poolOverlaps(), prefix_, prefix_len_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, isc::dhcp::Lease::TYPE_V4, and isc::dhcp::Lease::typeToText().

+ Here is the call graph for this function:

◆ checkType()

virtual void isc::dhcp::Subnet::checkType ( Lease::Type  type) const
protectedpure virtual

Checks if used pool type is valid.

Allowed type for Subnet4 is Pool::TYPE_V4. Allowed types for Subnet6 are Pool::TYPE_{IA,TA,PD}. This method is implemented in derived classes.

Parameters
typetype to be checked
Exceptions
BadValueif invalid value is used

Referenced by addPool(), getLastAllocated(), getPool(), getPools(), getPoolsWritable(), and setLastAllocated().

◆ default_pool()

virtual isc::asiolink::IOAddress isc::dhcp::Subnet::default_pool ( ) const
pure virtual

Returns the default address that will be used for pool selection.

It must be implemented in derived classes (should return :: for Subnet6 and 0.0.0.0 for Subnet4)

Referenced by getAnyPool().

◆ delPools()

void isc::dhcp::Subnet::delPools ( Lease::Type  type)

Deletes all pools of specified type.

This method is used for testing purposes only

Parameters
typetype of pools to be deleted

Definition at line 498 of file subnet.cc.

References getPoolsWritable().

+ Here is the call graph for this function:

◆ generateNextID()

static SubnetID isc::dhcp::Subnet::generateNextID ( )
inlinestaticprotected

returns the next unique Subnet-ID

This method generates and returns the next unique subnet-id. It is a strictly monotonously increasing value (1,2,3,...) for each new Subnet object created. It can be explicitly reset back to 1 during reconfiguration (resetSubnetID).

Returns
the next unique Subnet-ID

Definition at line 342 of file subnet.h.

References static_id_.

◆ get()

std::pair<isc::asiolink::IOAddress, uint8_t> isc::dhcp::Subnet::get ( ) const
inline

Returns subnet parameters (prefix and prefix length)

Returns
(prefix, prefix length) pair

Definition at line 119 of file subnet.h.

References prefix_, and prefix_len_.

◆ getAnyPool()

PoolPtr isc::dhcp::Subnet::getAnyPool ( Lease::Type  type)
inline

Returns a pool without any address specified.

Parameters
typepool type that the pool is looked for
Returns
returns one of the pools defined

Definition at line 189 of file subnet.h.

References default_pool(), and getPool().

+ Here is the call graph for this function:

◆ getID()

SubnetID isc::dhcp::Subnet::getID ( ) const
inline

Returns unique ID for that subnet.

Returns
unique ID for that subnet

Definition at line 114 of file subnet.h.

References id_.

Referenced by isc::dhcp::Subnet4::getNextSubnet(), isc::dhcp::Subnet6::getNextSubnet(), and toElement().

◆ getLastAllocated()

isc::asiolink::IOAddress isc::dhcp::Subnet::getLastAllocated ( Lease::Type  type) const

returns the last address that was tried from this subnet

This method returns the last address that was attempted to be allocated from this subnet. This is used as helper information for the next iteration of the allocation algorithm.

Todo:
: Define map<SubnetID, ClientClass, IOAddress> somewhere in the AllocEngine::IterativeAllocator and keep the data there
Parameters
typelease type to be returned
Returns
address/prefix that was last tried from this subnet

Definition at line 83 of file subnet.cc.

References checkType(), isc_throw, last_allocated_ia_, last_allocated_pd_, last_allocated_ta_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

+ Here is the call graph for this function:

◆ getLastAllocatedTime()

boost::posix_time::ptime isc::dhcp::Subnet::getLastAllocatedTime ( const Lease::Type lease_type) const

Returns the timestamp when the setLastAllocated function was called.

Parameters
lease_typeLease type for which last allocation timestamp should be returned.
Returns
Time when a lease of a specified type has been allocated from this subnet. The negative infinity time is returned if a lease type is not recognized (which is unlikely).

Definition at line 101 of file subnet.cc.

References last_allocated_time_.

◆ getPool() [1/2]

const PoolPtr isc::dhcp::Subnet::getPool ( Lease::Type  type,
const isc::asiolink::IOAddress addr,
bool  anypool = true 
) const

Returns a pool that specified address belongs to.

This method uses binary search to retrieve the pool. Thus, the number of comparisons performed by this method is logarithmic in the number of pools belonging to a subnet.

If there is no pool that the address belongs to (hint is invalid), other pool of specified type will be returned.

With anypool set to true, this is means give me a pool, preferably the one that addr belongs to. With anypool set to false, it means give me a pool that addr belongs to (or NULL if here is no such pool)

Parameters
typepool type that the pool is looked for
addraddress that the returned pool should cover (optional)
anypoolother pool may be returned as well, not only the one that addr belongs to
Returns
found pool (or NULL)

Definition at line 375 of file subnet.cc.

References checkType(), and getPools().

Referenced by getAnyPool().

+ Here is the call graph for this function:

◆ getPool() [2/2]

const PoolPtr isc::dhcp::Subnet::getPool ( Lease::Type  type,
const ClientClasses client_classes,
const isc::asiolink::IOAddress addr 
) const

Returns a pool that specified address belongs to with classes.

Variant using only pools allowing given classes

Parameters
typepool type that the pool is looked for
client_classesclient class list which must be allowed
addraddress that the returned pool should cover (optional)

Definition at line 414 of file subnet.cc.

References checkType(), and getPools().

+ Here is the call graph for this function:

◆ getPoolCapacity() [1/2]

uint64_t isc::dhcp::Subnet::getPoolCapacity ( Lease::Type  type) const

Returns the number of possible leases for specified lease type.

Parameters
typetype of the lease

Definition at line 146 of file subnet.cc.

References isc_throw, pools_, pools_pd_, pools_ta_, sumPoolCapacity(), isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

+ Here is the call graph for this function:

◆ getPoolCapacity() [2/2]

uint64_t isc::dhcp::Subnet::getPoolCapacity ( Lease::Type  type,
const ClientClasses client_classes 
) const

Returns the number of possible leases for specified lease type allowed for a client which belongs to classes.

Parameters
typetype of the lease
client_classesList of classes the client belongs to.

Definition at line 162 of file subnet.cc.

References isc_throw, pools_, pools_pd_, pools_ta_, sumPoolCapacity(), isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

+ Here is the call graph for this function:

◆ getPools()

const PoolCollection & isc::dhcp::Subnet::getPools ( Lease::Type  type) const

Returns all pools (const variant)

The reference is only valid as long as the object that returned it.

Parameters
typelease type to be set
Returns
a collection of all pools

Definition at line 339 of file subnet.cc.

References checkType(), isc_throw, pools_, pools_pd_, pools_ta_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

Referenced by getPool(), inPool(), poolOverlaps(), isc::dhcp::Subnet4::toElement(), and isc::dhcp::Subnet6::toElement().

+ Here is the call graph for this function:

◆ getPoolsWritable()

PoolCollection & isc::dhcp::Subnet::getPoolsWritable ( Lease::Type  type)
protected

Returns all pools (non-const variant)

The reference is only valid as long as the object that returned it.

Parameters
typelease type to be set
Returns
a collection of all pools

Definition at line 357 of file subnet.cc.

References checkType(), isc_throw, pools_, pools_pd_, pools_ta_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

Referenced by addPool(), and delPools().

+ Here is the call graph for this function:

◆ getSharedNetwork()

template<typename SharedNetworkPtrType >
void isc::dhcp::Subnet::getSharedNetwork ( SharedNetworkPtrType &  shared_network) const
inline

Retrieves pointer to a shared network associated with a subnet.

By implementing it as a template function we overcome a need to include shared_network.h header file to specify return type explicitly. The header can't be included because it would cause circular dependency between subnet.h and shared_network.h.

This method uses an argument to hold a return value to allow the compiler to infer the return type without a need to call this function with an explicit return type as template argument.

Parameters
[out]shared_networkPointer to the shared network where returned value should be assigned.
Template Parameters
Typeof the shared network, i.e. SharedNetwork4 or a SharedNetwork6.

Definition at line 252 of file subnet.h.

References shared_network_.

Referenced by isc::dhcp::Subnet4::clientSupported(), isc::dhcp::Subnet6::clientSupported(), isc::dhcp::Subnet4::getNextSubnet(), and isc::dhcp::Subnet6::getNextSubnet().

◆ getSharedNetworkName()

std::string isc::dhcp::Subnet::getSharedNetworkName ( ) const
inline

Returns shared network name.

Definition at line 273 of file subnet.h.

References shared_network_name_.

◆ inPool() [1/2]

bool isc::dhcp::Subnet::inPool ( Lease::Type  type,
const isc::asiolink::IOAddress addr 
) const

checks if the specified address is in pools

Note the difference between inRange() and inPool() for addresses (i.e. not prefixes). For a given subnet (e.g. 2001::/64) there may be one or more pools defined that may or may not cover entire subnet, e.g. pool 2001::1-2001::10). inPool() returning true implies inRange(), but the reverse implication is not always true. For the given example, 2001::1234:abcd would return true for inRange(), but false for inPool() check.

Parameters
typetype of pools to iterate over
addrthis address will be checked if it belongs to any pools in that subnet
Returns
true if the address is in any of the pools

Definition at line 503 of file subnet.cc.

References getPools(), inRange(), and isc::dhcp::Lease::TYPE_PD.

+ Here is the call graph for this function:

◆ inPool() [2/2]

bool isc::dhcp::Subnet::inPool ( Lease::Type  type,
const isc::asiolink::IOAddress addr,
const ClientClasses client_classes 
) const

checks if the specified address is in allowed pools

This takes also into account client classes

Parameters
typetype of pools to iterate over
addrthis address will be checked if it belongs to any pools in that subnet
client_classesclient class list which must be allowed
Returns
true if the address is in any of the allowed pools

Definition at line 523 of file subnet.cc.

References getPools(), inRange(), and isc::dhcp::Lease::TYPE_PD.

+ Here is the call graph for this function:

◆ inRange()

bool isc::dhcp::Subnet::inRange ( const isc::asiolink::IOAddress addr) const

checks if specified address is in range

Definition at line 76 of file subnet.cc.

References isc::dhcp::firstAddrInPrefix(), isc::dhcp::lastAddrInPrefix(), prefix_, and prefix_len_.

Referenced by addPool(), and inPool().

+ Here is the call graph for this function:

◆ parsePrefixCommon()

std::pair< IOAddress, uint8_t > isc::dhcp::Subnet::parsePrefixCommon ( const std::string &  prefix)
staticprotected

Converts subnet prefix to a pair of prefix/length pair.

IPv4 and IPv6 specific conversion functions should apply extra checks on the returned values, i.e. whether length is in range and the IP address has a valid type.

Parameters
prefixPrefix to be parsed.
Exceptions
BadValueif provided prefix is not valid.

Definition at line 219 of file subnet.cc.

References isc_throw.

Referenced by isc::dhcp::Subnet4::parsePrefix(), and isc::dhcp::Subnet6::parsePrefix().

◆ poolOverlaps()

bool isc::dhcp::Subnet::poolOverlaps ( const Lease::Type pool_type,
const PoolPtr pool 
) const
protected

Checks if the specified pool overlaps with an existing pool.

Parameters
pool_typePool type.
poolPointer to a pool for which the method should check if it overlaps with any existing pool within this subnet.
Returns
true if pool overlaps with an existing pool of a specified type.

Definition at line 548 of file subnet.cc.

References getPools().

Referenced by addPool().

+ Here is the call graph for this function:

◆ resetSubnetID()

static void isc::dhcp::Subnet::resetSubnetID ( )
inlinestatic

Resets subnet-id counter to its initial value (1)

This should be called during reconfiguration, before any new subnet objects are created. It will ensure that the subnet_id will be consistent between reconfigures.

Definition at line 231 of file subnet.h.

References static_id_.

◆ setLastAllocated()

void isc::dhcp::Subnet::setLastAllocated ( Lease::Type  type,
const isc::asiolink::IOAddress addr 
)

sets the last address that was tried from this subnet

This method sets the last address that was attempted to be allocated from this subnet. This is used as helper information for the next iteration of the allocation algorithm.

Todo:
: Define map<SubnetID, ClientClass, IOAddress> somewhere in the AllocEngine::IterativeAllocator and keep the data there
Parameters
addraddress/prefix to that was tried last
typelease type to be set

Definition at line 113 of file subnet.cc.

References checkType(), isc_throw, last_allocated_ia_, last_allocated_pd_, last_allocated_ta_, last_allocated_time_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.

+ Here is the call graph for this function:

◆ setSharedNetworkName()

void isc::dhcp::Subnet::setSharedNetworkName ( const std::string &  shared_network_name)
inline

Sets new shared network name.

In certain cases the subnet must be associated with the shared network but the shared network object is not available. In particular, subnets are returned from the configuration database with only names of the shared networks. The actual shared networks must be fetched from the database using a separate query. In order to not loose associations of subnets with shared networks, the configuration backends will use this method to store the shared network names. The servers will later use those names to associate subnets with shared network instances.

Parameters
shared_network_nameNew shared network name.

Definition at line 289 of file subnet.h.

References shared_network_name_.

◆ sumPoolCapacity() [1/2]

uint64_t isc::dhcp::Subnet::sumPoolCapacity ( const PoolCollection pools) const
protected

Returns a sum of possible leases in all pools.

Parameters
poolslist of pools
Returns
sum of possible leases

Definition at line 179 of file subnet.cc.

Referenced by getPoolCapacity().

◆ sumPoolCapacity() [2/2]

uint64_t isc::dhcp::Subnet::sumPoolCapacity ( const PoolCollection pools,
const ClientClasses client_classes 
) const
protected

Returns a sum of possible leases in all pools allowing classes.

Parameters
poolslist of pools
client_classeslist of classes
Returns
sum of possible/allowed leases

Definition at line 197 of file subnet.cc.

◆ toElement()

data::ElementPtr isc::dhcp::Subnet::toElement ( ) const
protectedvirtual

Unparse a subnet object.

Returns
A pointer to unparsed subnet configuration.

Implements isc::data::CfgToElement.

Reimplemented in isc::dhcp::Subnet6, and isc::dhcp::Subnet4.

Definition at line 691 of file subnet.cc.

References isc::data::UserContext::contextToElement(), getID(), and toText().

Referenced by isc::dhcp::Subnet4::toElement(), and isc::dhcp::Subnet6::toElement().

+ Here is the call graph for this function:

◆ toText()

std::string isc::dhcp::Subnet::toText ( ) const
virtual

Returns textual representation of the subnet (e.g.

"2001:db8::/64")

Returns
textual representation

Definition at line 139 of file subnet.cc.

References prefix_, and prefix_len_.

Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet(), toElement(), and isc::dhcp::Subnet4::toElement().

Friends And Related Function Documentation

◆ AssignableNetwork

friend class AssignableNetwork
friend

Definition at line 39 of file subnet.h.

Member Data Documentation

◆ id_

SubnetID isc::dhcp::Subnet::id_
protected

subnet-id

Subnet-id is a unique value that can be used to find or identify a Subnet4 or Subnet6.

Definition at line 402 of file subnet.h.

Referenced by getID().

◆ iface_

std::string isc::dhcp::Subnet::iface_
protected

Name of the network interface (if connected directly)

Definition at line 445 of file subnet.h.

◆ last_allocated_ia_

isc::asiolink::IOAddress isc::dhcp::Subnet::last_allocated_ia_
protected

last allocated address

This is the last allocated address that was previously allocated from this particular subnet. Some allocation algorithms (e.g. iterative) use that value, others do not. It should be noted that although the value is usually correct, there are cases when it is invalid, e.g. after removing a pool, restarting or changing allocation algorithms. For that purpose it should be only considered a help that should not be fully trusted.

Definition at line 428 of file subnet.h.

Referenced by getLastAllocated(), and setLastAllocated().

◆ last_allocated_pd_

isc::asiolink::IOAddress isc::dhcp::Subnet::last_allocated_pd_
protected

last allocated IPv6 prefix

See last_allocated_ia_ for details.

Definition at line 438 of file subnet.h.

Referenced by getLastAllocated(), and setLastAllocated().

◆ last_allocated_ta_

isc::asiolink::IOAddress isc::dhcp::Subnet::last_allocated_ta_
protected

last allocated temporary address

See last_allocated_ia_ for details.

Definition at line 433 of file subnet.h.

Referenced by getLastAllocated(), and setLastAllocated().

◆ last_allocated_time_

std::map<Lease::Type, boost::posix_time::ptime> isc::dhcp::Subnet::last_allocated_time_
protected

Timestamp indicating when a lease of a specified type has been last allocated from this subnet.

Definition at line 442 of file subnet.h.

Referenced by getLastAllocatedTime(), setLastAllocated(), and Subnet().

◆ pools_

PoolCollection isc::dhcp::Subnet::pools_
protected

collection of IPv4 or non-temporary IPv6 pools in that subnet

Definition at line 405 of file subnet.h.

Referenced by getPoolCapacity(), getPools(), and getPoolsWritable().

◆ pools_pd_

PoolCollection isc::dhcp::Subnet::pools_pd_
protected

collection of IPv6 prefix pools in that subnet

Definition at line 411 of file subnet.h.

Referenced by getPoolCapacity(), getPools(), and getPoolsWritable().

◆ pools_ta_

PoolCollection isc::dhcp::Subnet::pools_ta_
protected

collection of IPv6 temporary address pools in that subnet

Definition at line 408 of file subnet.h.

Referenced by getPoolCapacity(), getPools(), and getPoolsWritable().

◆ prefix_

isc::asiolink::IOAddress isc::dhcp::Subnet::prefix_
protected

a prefix of the subnet

Definition at line 414 of file subnet.h.

Referenced by addPool(), get(), inRange(), and toText().

◆ prefix_len_

uint8_t isc::dhcp::Subnet::prefix_len_
protected

a prefix length of the subnet

Definition at line 417 of file subnet.h.

Referenced by addPool(), get(), inRange(), and toText().

◆ shared_network_

WeakNetworkPtr isc::dhcp::Subnet::shared_network_
protected

Pointer to a shared network that subnet belongs to.

Definition at line 448 of file subnet.h.

Referenced by getSharedNetwork().

◆ shared_network_name_

std::string isc::dhcp::Subnet::shared_network_name_
protected

Shared network name.

Definition at line 451 of file subnet.h.

Referenced by getSharedNetworkName(), and setSharedNetworkName().

◆ static_id_

SubnetID isc::dhcp::Subnet::static_id_ = 1
staticprotected

keeps the subnet-id value

It is incremented every time a new Subnet object is created. It is reset (resetSubnetID) every time reconfiguration occurs.

Static value initialized in subnet.cc.

Definition at line 323 of file subnet.h.

Referenced by generateNextID(), and resetSubnetID().


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