Kea 2.7.5
subnet.h
Go to the documentation of this file.
1// Copyright (C) 2012-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef SUBNET_H
8#define SUBNET_H
9
10#include <asiolink/io_address.h>
11#include <cc/data.h>
12#include <cc/user_context.h>
14#include <dhcpsrv/allocator.h>
16#include <dhcpsrv/lease.h>
17#include <dhcpsrv/network.h>
18#include <dhcpsrv/pool.h>
19#include <dhcpsrv/subnet_id.h>
20#include <util/bigints.h>
21#include <util/dhcp_space.h>
22#include <util/triplet.h>
23
24#include <boost/enable_shared_from_this.hpp>
25#include <boost/multi_index/mem_fun.hpp>
26#include <boost/multi_index/indexed_by.hpp>
27#include <boost/multi_index/ordered_index.hpp>
28#include <boost/multi_index/random_access_index.hpp>
29#include <boost/multi_index_container.hpp>
30#include <boost/date_time/posix_time/posix_time.hpp>
31#include <boost/pointer_cast.hpp>
32#include <boost/shared_ptr.hpp>
33
34#include <cstdint>
35#include <map>
36#include <utility>
37
38namespace isc {
39namespace dhcp {
40
41class Subnet : public virtual Network {
42public:
43
49 bool inRange(const isc::asiolink::IOAddress& addr) const;
50
65 bool inPool(Lease::Type type, const isc::asiolink::IOAddress& addr) const;
66
76 bool inPool(Lease::Type type,
77 const isc::asiolink::IOAddress& addr,
78 const ClientClasses& client_classes) const;
79
83 SubnetID getID() const {
84 return (id_);
85 }
86
90 std::pair<isc::asiolink::IOAddress, uint8_t> get() const {
91 return (std::make_pair(prefix_, prefix_len_));
92 }
93
115 void addPool(const PoolPtr& pool);
116
122 void delPools(Lease::Type type);
123
142 const PoolPtr getPool(Lease::Type type, const isc::asiolink::IOAddress& addr,
143 bool anypool = true) const;
144
152 const PoolPtr getPool(Lease::Type type,
153 const ClientClasses& client_classes,
154 const isc::asiolink::IOAddress& addr) const;
155
161 return (getPool(type, default_pool()));
162 }
163
169
176 const PoolCollection& getPools(Lease::Type type) const;
177
182
190 const ClientClasses& client_classes) const;
191
204 const ClientClasses& client_classes,
205 Allocator::PrefixLenMatchType prefix_length_match,
206 uint8_t hint_prefix_length) const;
207
212 virtual std::string toText() const;
213
230 template<typename SharedNetworkPtrType>
231 void getSharedNetwork(SharedNetworkPtrType& shared_network) const {
232 shared_network = boost::dynamic_pointer_cast<
233 typename SharedNetworkPtrType::element_type>(parent_network_.lock());
234 }
235
243 void setSharedNetwork(const NetworkPtr& shared_network) {
244 parent_network_ = shared_network;
245 }
246
250 std::string getSharedNetworkName() const {
251 return (shared_network_name_);
252 }
253
266 void setSharedNetworkName(const std::string& shared_network_name) {
267 shared_network_name_ = shared_network_name;
268 }
269
277
289
297 void setAllocator(Lease::Type type, const AllocatorPtr& allocator);
298
306
311 void setAllocationState(Lease::Type type, const SubnetAllocationStatePtr& allocation_state);
312
320 virtual void createAllocators() = 0;
321
324
325protected:
326
328 //
335 Subnet(const isc::asiolink::IOAddress& prefix, uint8_t len,
336 const SubnetID id);
337
342 virtual ~Subnet() { }
343
352 virtual void checkType(Lease::Type type) const = 0;
353
359
366 const ClientClasses& client_classes) const;
367
381 const ClientClasses& client_classes,
382 Allocator::PrefixLenMatchType prefix_length_match,
383 uint8_t hint_prefix_length) const;
384
393 bool poolOverlaps(const Lease::Type& pool_type, const PoolPtr& pool) const;
394
398 virtual data::ElementPtr toElement() const;
399
400 virtual std::string getLabel() const {
401 std::stringstream ss;
402 ss << "subnet-id " << id_;
403 return (ss.str());
404 }
405
414 static std::pair<asiolink::IOAddress, uint8_t>
415 parsePrefixCommon(const std::string& prefix);
416
422
425
428
431
434
436 uint8_t prefix_len_;
437
440
442 std::map<Lease::Type, AllocatorPtr> allocators_;
443
445 std::map<Lease::Type, SubnetAllocationStatePtr> allocation_states_;
446};
447
449typedef boost::shared_ptr<Subnet> SubnetPtr;
450
452typedef boost::shared_ptr<const Subnet> ConstSubnetPtr;
453
454
455class Subnet4;
456
458typedef boost::shared_ptr<const Subnet4> ConstSubnet4Ptr;
459
461typedef boost::shared_ptr<Subnet4> Subnet4Ptr;
462
468class Subnet4 : public Subnet, public Network4, public boost::enable_shared_from_this<Subnet4> {
469public:
470
481 Subnet4(const isc::asiolink::IOAddress& prefix, uint8_t length,
482 const util::Triplet<uint32_t>& t1,
483 const util::Triplet<uint32_t>& t2,
484 const util::Triplet<uint32_t>& valid_lifetime,
485 const SubnetID id);
486
506 static Subnet4Ptr
507 create(const isc::asiolink::IOAddress& prefix, uint8_t length,
508 const util::Triplet<uint32_t>& t1,
509 const util::Triplet<uint32_t>& t2,
510 const util::Triplet<uint32_t>& valid_lifetime,
511 const SubnetID id);
512
525 ConstSubnet4Ptr getNextSubnet(const ConstSubnet4Ptr& first_subnet) const;
526
540 const ClientClasses& client_classes) const;
541
553 virtual bool
554 clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
555
561 return (dhcp4o6_);
562 }
563
568 const Cfg4o6& get4o6() const {
569 return (dhcp4o6_);
570 }
571
575 virtual data::ElementPtr toElement() const;
576
584 virtual void createAllocators();
585
590 static std::pair<asiolink::IOAddress, uint8_t>
591 parsePrefix(const std::string& prefix);
592
593private:
594
596 Subnet4(const Subnet4&) = delete;
597
599 Subnet4& operator=(const Subnet4&) = delete;
600
604 virtual isc::asiolink::IOAddress default_pool() const {
605 return (isc::asiolink::IOAddress("0.0.0.0"));
606 }
607
614 virtual void checkType(Lease::Type type) const;
615
617 Cfg4o6 dhcp4o6_;
618};
619
620class Subnet6;
621
623typedef boost::shared_ptr<const Subnet6> ConstSubnet6Ptr;
624
626typedef boost::shared_ptr<Subnet6> Subnet6Ptr;
627
633class Subnet6 : public Subnet, public Network6, public boost::enable_shared_from_this<Subnet6> {
634public:
635
648 Subnet6(const isc::asiolink::IOAddress& prefix, uint8_t length,
649 const util::Triplet<uint32_t>& t1,
650 const util::Triplet<uint32_t>& t2,
651 const util::Triplet<uint32_t>& preferred_lifetime,
652 const util::Triplet<uint32_t>& valid_lifetime,
653 const SubnetID id);
654
675 static Subnet6Ptr
676 create(const isc::asiolink::IOAddress& prefix, uint8_t length,
677 const util::Triplet<uint32_t>& t1,
678 const util::Triplet<uint32_t>& t2,
679 const util::Triplet<uint32_t>& preferred_lifetime,
680 const util::Triplet<uint32_t>& valid_lifetime,
681 const SubnetID id);
682
695 ConstSubnet6Ptr getNextSubnet(const ConstSubnet6Ptr& first_subnet) const;
696
710 const ClientClasses& client_classes) const;
711
723 virtual bool
724 clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
725
733 virtual void createAllocators();
734
738 virtual data::ElementPtr toElement() const;
739
744 static std::pair<asiolink::IOAddress, uint8_t>
745 parsePrefix(const std::string& prefix);
746
747private:
748
750 Subnet6(const Subnet6&) = delete;
751
753 Subnet6& operator=(const Subnet6&) = delete;
754
758 virtual isc::asiolink::IOAddress default_pool() const {
759 return (isc::asiolink::IOAddress("::"));
760 }
761
768 virtual void checkType(Lease::Type type) const;
769
770};
771
774
775
778
781
784
787
794typedef boost::multi_index_container<
795 // Multi index container holds pointers to the subnets.
797 // The following holds all indexes.
798 boost::multi_index::indexed_by<
799 // First index allows for searching using subnet identifier.
800 boost::multi_index::ordered_unique<
801 boost::multi_index::tag<SubnetSubnetIdIndexTag>,
802 boost::multi_index::const_mem_fun<Subnet, SubnetID, &Subnet::getID>
803 >,
804 // Second index allows for searching using an output from toText function.
805 boost::multi_index::ordered_unique<
806 boost::multi_index::tag<SubnetPrefixIndexTag>,
807 boost::multi_index::const_mem_fun<Subnet, std::string, &Subnet::toText>
808 >
809 >
811
835typedef boost::multi_index_container<
836 // Multi index container holds pointers to the subnets.
838 // The following holds all indexes.
839 boost::multi_index::indexed_by<
840 // First index allows for searching using subnet identifier.
841 boost::multi_index::ordered_unique<
842 boost::multi_index::tag<SubnetSubnetIdIndexTag>,
843 boost::multi_index::const_mem_fun<Subnet, SubnetID, &Subnet::getID>
844 >,
845 // Second index allows for searching using an output from toText function.
846 boost::multi_index::ordered_unique<
847 boost::multi_index::tag<SubnetPrefixIndexTag>,
848 boost::multi_index::const_mem_fun<Subnet, std::string, &Subnet::toText>
849 >,
850
851 // Third index allows for searching using an output from getServerId.
852 boost::multi_index::ordered_non_unique<
853 boost::multi_index::tag<SubnetServerIdIndexTag>,
854 boost::multi_index::const_mem_fun<Network4, asiolink::IOAddress,
856 >,
857
858 // Forth index allows for searching using subnet modification time.
859 boost::multi_index::ordered_non_unique<
860 boost::multi_index::tag<SubnetModificationTimeIndexTag>,
861 boost::multi_index::const_mem_fun<data::BaseStampedElement,
862 boost::posix_time::ptime,
864 >
865 >
867
874typedef boost::multi_index_container<
875 // Multi index container holds pointers to the subnets.
877 // The following holds all indexes.
878 boost::multi_index::indexed_by<
879 // First index allows for searching using subnet identifier.
880 boost::multi_index::ordered_unique<
881 boost::multi_index::tag<SubnetSubnetIdIndexTag>,
882 boost::multi_index::const_mem_fun<Subnet, SubnetID, &Subnet::getID>
883 >,
884 // Second index allows for searching using an output from toText function.
885 boost::multi_index::ordered_unique<
886 boost::multi_index::tag<SubnetPrefixIndexTag>,
887 boost::multi_index::const_mem_fun<Subnet, std::string, &Subnet::toText>
888 >
889 >
891
914typedef boost::multi_index_container<
915 // Multi index container holds pointers to the subnets.
917 // The following holds all indexes.
918 boost::multi_index::indexed_by<
919 // First index allows for searching using subnet identifier.
920 boost::multi_index::ordered_unique<
921 boost::multi_index::tag<SubnetSubnetIdIndexTag>,
922 boost::multi_index::const_mem_fun<Subnet, SubnetID, &Subnet::getID>
923 >,
924 // Second index allows for searching using an output from toText function.
925 boost::multi_index::ordered_unique<
926 boost::multi_index::tag<SubnetPrefixIndexTag>,
927 boost::multi_index::const_mem_fun<Subnet, std::string, &Subnet::toText>
928 >,
929 // Third index allows for searching using subnet modification time.
930 boost::multi_index::ordered_non_unique<
931 boost::multi_index::tag<SubnetModificationTimeIndexTag>,
932 boost::multi_index::const_mem_fun<data::BaseStampedElement,
933 boost::posix_time::ptime,
935 >
936 >
938
946template<typename ReturnPtrType, typename CollectionType>
948public:
949
957 static ReturnPtrType get(const CollectionType& collection,
958 const SubnetID& subnet_id) {
959 auto& index = collection.template get<SubnetSubnetIdIndexTag>();
960 auto s = index.find(subnet_id);
961 if (s != index.end()) {
962 return (*s);
963 }
964 // No subnet found. Return null pointer.
965 return (ReturnPtrType());
966 }
967};
968
970using SubnetFetcher4 = SubnetFetcher<Subnet4Ptr, Subnet4Collection>;
971
973using SubnetFetcher6 = SubnetFetcher<Subnet6Ptr, Subnet6Collection>;
975
978namespace {
979
980template <isc::util::DhcpSpace D>
981struct AdapterSubnet {};
982
983template <>
984struct AdapterSubnet<isc::util::DHCPv4> {
985 using type = Subnet4;
986};
987
988template <>
989struct AdapterSubnet<isc::util::DHCPv6> {
990 using type = Subnet6;
991};
992
993} // namespace
994
995template <isc::util::DhcpSpace D>
996using SubnetT = typename AdapterSubnet<D>::type;
997
998template <isc::util::DhcpSpace D>
999using SubnetTPtr = boost::shared_ptr<SubnetT<D>>;
1000
1001template <isc::util::DhcpSpace D>
1002using ConstSubnetTPtr = boost::shared_ptr<const SubnetT<D>>;
1004
1005} // end of isc::dhcp namespace
1006} // end of isc namespace
1007
1008#endif // SUBNET_H
This class represents configuration element which is associated with database identifier and the modi...
boost::posix_time::ptime getModificationTime() const
Returns timestamp.
PrefixLenMatchType
Type of preferred PD-pool prefix length selection criteria.
Definition allocator.h:61
Container for storing client class names.
Definition classify.h:108
Specialization of the Network object for DHCPv4 case.
Definition network.h:1266
virtual asiolink::IOAddress getServerId() const
Returns binary representation of the dhcp-server-identifier option (54).
Definition network.cc:335
Specialization of the Network object for DHCPv6 case.
Definition network.h:1427
Common interface representing a network to which the DHCP clients are connected.
Definition network.h:154
WeakNetworkPtr parent_network_
Pointer to another network that this network belongs to.
Definition network.h:1258
A configuration holder for IPv4 subnet.
Definition subnet.h:468
virtual bool clientSupported(const isc::dhcp::ClientClasses &client_classes) const
Checks whether this subnet and parent shared network supports the client that belongs to specified cl...
Definition subnet.cc:319
Cfg4o6 & get4o6()
Returns DHCP4o6 configuration parameters.
Definition subnet.h:560
ConstSubnet4Ptr getNextSubnet(const ConstSubnet4Ptr &first_subnet) const
Returns next subnet within shared network.
Definition subnet.cc:280
virtual void createAllocators()
Instantiates the allocator and its state.
Definition subnet.cc:755
virtual data::ElementPtr toElement() const
Unparse a subnet object.
Definition subnet.cc:794
static Subnet4Ptr create(const isc::asiolink::IOAddress &prefix, uint8_t length, const util::Triplet< uint32_t > &t1, const util::Triplet< uint32_t > &t2, const util::Triplet< uint32_t > &valid_lifetime, const SubnetID id)
Factory function creating an instance of the Subnet4.
Definition subnet.cc:263
Subnet4(const isc::asiolink::IOAddress &prefix, uint8_t length, const util::Triplet< uint32_t > &t1, const util::Triplet< uint32_t > &t2, const util::Triplet< uint32_t > &valid_lifetime, const SubnetID id)
Constructor with all parameters.
Definition subnet.cc:246
const Cfg4o6 & get4o6() const
Returns const DHCP4o6 configuration parameters.
Definition subnet.h:568
static std::pair< asiolink::IOAddress, uint8_t > parsePrefix(const std::string &prefix)
Converts subnet prefix to a pair of prefix/length pair.
Definition subnet.cc:818
A configuration holder for IPv6 subnet.
Definition subnet.h:633
virtual bool clientSupported(const isc::dhcp::ClientClasses &client_classes) const
Checks whether this subnet and parent shared network supports the client that belongs to specified cl...
Definition subnet.cc:727
static Subnet6Ptr create(const isc::asiolink::IOAddress &prefix, uint8_t length, const util::Triplet< uint32_t > &t1, const util::Triplet< uint32_t > &t2, const util::Triplet< uint32_t > &preferred_lifetime, const util::Triplet< uint32_t > &valid_lifetime, const SubnetID id)
Factory function creating an instance of the Subnet4.
Definition subnet.cc:651
static std::pair< asiolink::IOAddress, uint8_t > parsePrefix(const std::string &prefix)
Converts subnet prefix to a pair of prefix/length pair.
Definition subnet.cc:935
virtual void createAllocators()
Instantiates the allocators and their states.
Definition subnet.cc:828
virtual data::ElementPtr toElement() const
Unparse a subnet object.
Definition subnet.cc:906
ConstSubnet6Ptr getNextSubnet(const ConstSubnet6Ptr &first_subnet) const
Returns next subnet within shared network.
Definition subnet.cc:689
Subnet6(const isc::asiolink::IOAddress &prefix, uint8_t length, const util::Triplet< uint32_t > &t1, const util::Triplet< uint32_t > &t2, const util::Triplet< uint32_t > &preferred_lifetime, const util::Triplet< uint32_t > &valid_lifetime, const SubnetID id)
Constructor with all parameters.
Definition subnet.cc:631
A class containing static convenience methods to fetch the subnets from the containers.
Definition subnet.h:947
static ReturnPtrType get(const CollectionType &collection, const SubnetID &subnet_id)
Fetches subnets by id.
Definition subnet.h:957
isc::util::uint128_t getPoolCapacity(Lease::Type type) const
Returns the number of possible leases for specified lease type.
Definition subnet.cc:97
void setSharedNetworkName(const std::string &shared_network_name)
Sets new shared network name.
Definition subnet.h:266
isc::asiolink::IOAddress prefix_
a prefix of the subnet.
Definition subnet.h:433
SubnetID getID() const
Returns unique ID for that subnet.
Definition subnet.h:83
uint8_t prefix_len_
a prefix length of the subnet.
Definition subnet.h:436
isc::util::uint128_t sumPoolCapacity(const PoolCollection &pools) const
Returns a sum of possible leases in all pools.
Definition subnet.cc:150
virtual data::ElementPtr toElement() const
Unparse a subnet object.
Definition subnet.cc:738
AllocatorPtr getAllocator(Lease::Type type) const
Returns lease allocator instance.
Definition subnet.cc:366
PoolCollection pools_ta_
collection of IPv6 temporary address pools in that subnet.
Definition subnet.h:427
void getSharedNetwork(SharedNetworkPtrType &shared_network) const
Retrieves pointer to a shared network associated with a subnet.
Definition subnet.h:231
void initAllocatorsAfterConfigure()
Calls initAfterConfigure for each allocator.
Definition subnet.cc:437
SubnetID id_
subnet-id
Definition subnet.h:421
SubnetAllocationStatePtr getAllocationState(Lease::Type type) const
Returns subnet-specific allocation state.
Definition subnet.cc:382
PoolPtr getAnyPool(Lease::Type type)
Returns a pool without any address specified.
Definition subnet.h:160
void addPool(const PoolPtr &pool)
Adds a new pool for the subnet.
Definition subnet.cc:472
virtual ~Subnet()
virtual destructor.
Definition subnet.h:342
bool inRange(const isc::asiolink::IOAddress &addr) const
checks if specified address is in range.
Definition subnet.cc:82
std::map< Lease::Type, AllocatorPtr > allocators_
Lease allocators used by the subnet.
Definition subnet.h:442
virtual std::string toText() const
Returns textual representation of the subnet (e.g.
Definition subnet.cc:90
void delPools(Lease::Type type)
Deletes all pools of specified type.
Definition subnet.cc:527
std::pair< isc::asiolink::IOAddress, uint8_t > get() const
Returns subnet parameters (prefix and prefix length).
Definition subnet.h:90
virtual std::string getLabel() const
Generates an identifying label for logging.
Definition subnet.h:400
static std::pair< asiolink::IOAddress, uint8_t > parsePrefixCommon(const std::string &prefix)
Converts subnet prefix to a pair of prefix/length pair.
Definition subnet.cc:221
void setAllocator(Lease::Type type, const AllocatorPtr &allocator)
Sets new allocator instance.
Definition subnet.cc:377
std::string getSharedNetworkName() const
Returns shared network name.
Definition subnet.h:250
PoolCollection pools_
collection of IPv4 or non-temporary IPv6 pools in that subnet.
Definition subnet.h:424
PoolCollection & getPoolsWritable(Lease::Type type)
Returns all pools (non-const variant).
Definition subnet.cc:347
const PoolPtr getPool(Lease::Type type, const isc::asiolink::IOAddress &addr, bool anypool=true) const
Returns a pool that specified address belongs to.
Definition subnet.cc:397
Subnet(const isc::asiolink::IOAddress &prefix, uint8_t len, const SubnetID id)
Protected constructor.
Definition subnet.cc:68
std::string shared_network_name_
Shared network name.
Definition subnet.h:439
bool poolOverlaps(const Lease::Type &pool_type, const PoolPtr &pool) const
Checks if the specified pool overlaps with an existing pool.
Definition subnet.cc:573
virtual isc::asiolink::IOAddress default_pool() const =0
Returns the default address that will be used for pool selection.
PoolCollection pools_pd_
collection of IPv6 prefix pools in that subnet.
Definition subnet.h:430
const PoolCollection & getPools(Lease::Type type) const
Returns all pools (const variant).
Definition subnet.cc:329
virtual void checkType(Lease::Type type) const =0
Checks if used pool type is valid.
std::map< Lease::Type, SubnetAllocationStatePtr > allocation_states_
Holds subnet-specific allocation state.
Definition subnet.h:445
virtual void createAllocators()=0
Instantiates the allocators and their states.
bool inPool(Lease::Type type, const isc::asiolink::IOAddress &addr) const
checks if the specified address is in pools.
Definition subnet.cc:532
void setSharedNetwork(const NetworkPtr &shared_network)
Assigns shared network to a subnet.
Definition subnet.h:243
void setAllocationState(Lease::Type type, const SubnetAllocationStatePtr &allocation_state)
Sets subnet-specific allocation state.
Definition subnet.cc:393
This template specifies a parameter value.
Definition triplet.h:37
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
Definition subnet.h:449
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition subnet.h:461
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
Definition subnet.h:623
SubnetFetcher< Subnet6Ptr, Subnet6Collection > SubnetFetcher6
Type of the SubnetFetcher used for IPv6.
Definition subnet.h:973
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
Definition subnet.h:458
boost::shared_ptr< SubnetT< D > > SubnetTPtr
Definition subnet.h:999
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Definition subnet.h:626
boost::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > Subnet6Collection
A collection of Subnet6 objects.
Definition subnet.h:937
boost::shared_ptr< const SubnetT< D > > ConstSubnetTPtr
Definition subnet.h:1002
std::vector< PoolPtr > PoolCollection
a container for either IPv4 or IPv6 Pools
Definition pool.h:491
boost::multi_index_container< Subnet4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > > > > Subnet4SimpleCollection
A simple collection of Subnet4 objects.
Definition subnet.h:810
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition pool.h:488
boost::multi_index_container< Subnet4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetServerIdIndexTag >, boost::multi_index::const_mem_fun< Network4, asiolink::IOAddress, &Network4::getServerId > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > Subnet4Collection
A collection of Subnet4 objects.
Definition subnet.h:866
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
boost::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > > > > Subnet6SimpleCollection
A simple collection of Subnet6 objects.
Definition subnet.h:890
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
Definition subnet.h:452
boost::shared_ptr< Network > NetworkPtr
Pointer to the Network object.
Definition network.h:73
boost::shared_ptr< Allocator > AllocatorPtr
Defines a pointer to an allocator.
Definition allocator.h:239
boost::shared_ptr< SubnetAllocationState > SubnetAllocationStatePtr
SubnetFetcher< Subnet4Ptr, Subnet4Collection > SubnetFetcher4
Type of the SubnetFetcher used for IPv4.
Definition subnet.h:970
typename AdapterSubnet< D >::type SubnetT
Definition subnet.h:996
boost::multiprecision::checked_uint128_t uint128_t
Definition bigints.h:21
Defines the logger used by the top-level component of kea-lfc.
This structure contains information about DHCP4o6 (RFC7341)
Definition cfg_4o6.h:22
Type
Type of lease or pool.
Definition lease.h:46
Tag for the index for searching by subnet modification time.
Definition subnet.h:786
Tag for the index for searching by subnet prefix.
Definition subnet.h:780
Tag for the index for searching by server identifier.
Definition subnet.h:783
Tag for the index for searching by subnet identifier.
Definition subnet.h:777