Kea  2.3.5-git
subnet.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2023 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/dhcp_space.h>
21 #include <util/triplet.h>
22 
23 #include <boost/multi_index/mem_fun.hpp>
24 #include <boost/multi_index/indexed_by.hpp>
25 #include <boost/multi_index/ordered_index.hpp>
26 #include <boost/multi_index/random_access_index.hpp>
27 #include <boost/multi_index_container.hpp>
28 #include <boost/date_time/posix_time/posix_time.hpp>
29 #include <boost/pointer_cast.hpp>
30 #include <boost/scoped_ptr.hpp>
31 #include <boost/shared_ptr.hpp>
32 
33 #include <cstdint>
34 #include <map>
35 #include <utility>
36 
37 namespace isc {
38 namespace dhcp {
39 
40 class Subnet : public virtual Network {
41 public:
42 
48  bool inRange(const isc::asiolink::IOAddress& addr) const;
49 
64  bool inPool(Lease::Type type, const isc::asiolink::IOAddress& addr) const;
65 
75  bool inPool(Lease::Type type,
76  const isc::asiolink::IOAddress& addr,
77  const ClientClasses& client_classes) const;
78 
82  SubnetID getID() const { return (id_); }
83 
87  std::pair<isc::asiolink::IOAddress, uint8_t> get() const {
88  return (std::make_pair(prefix_, prefix_len_));
89  }
90 
112  void addPool(const PoolPtr& pool);
113 
119  void delPools(Lease::Type type);
120 
139  const PoolPtr getPool(Lease::Type type, const isc::asiolink::IOAddress& addr,
140  bool anypool = true) const;
141 
149  const PoolPtr getPool(Lease::Type type,
150  const ClientClasses& client_classes,
151  const isc::asiolink::IOAddress& addr) const;
152 
158  return (getPool(type, default_pool()));
159  }
160 
165  virtual isc::asiolink::IOAddress default_pool() const = 0;
166 
173  const PoolCollection& getPools(Lease::Type type) const;
174 
178  uint64_t getPoolCapacity(Lease::Type type) const;
179 
186  uint64_t getPoolCapacity(Lease::Type type,
187  const ClientClasses& client_classes) const;
188 
200  uint64_t getPoolCapacity(Lease::Type type,
201  const ClientClasses& client_classes,
202  Allocator::PrefixLenMatchType prefix_length_match,
203  uint8_t hint_prefix_length) const;
204 
209  virtual std::string toText() const;
210 
216  static void resetSubnetID() {
217  static_id_ = 1;
218  }
219 
236  template<typename SharedNetworkPtrType>
237  void getSharedNetwork(SharedNetworkPtrType& shared_network) const {
238  shared_network = boost::dynamic_pointer_cast<
239  typename SharedNetworkPtrType::element_type>(parent_network_.lock());
240  }
241 
249  void setSharedNetwork(const NetworkPtr& shared_network) {
250  parent_network_ = shared_network;
251  }
252 
256  std::string getSharedNetworkName() const {
257  return (shared_network_name_);
258  }
259 
272  void setSharedNetworkName(const std::string& shared_network_name) {
273  shared_network_name_ = shared_network_name;
274  }
275 
283 
295 
303  void setAllocator(Lease::Type type, const AllocatorPtr& allocator);
304 
312 
317  void setAllocationState(Lease::Type type, const SubnetAllocationStatePtr& allocation_state);
318 
319 protected:
320 
322  //
335  Subnet(const isc::asiolink::IOAddress& prefix, uint8_t len,
336  const SubnetID id);
337 
342  virtual ~Subnet() { };
343 
351  static SubnetID static_id_;
352 
362  if (static_id_ == SUBNET_ID_MAX) {
363  resetSubnetID();
364  }
365 
366  return (static_id_++);
367  }
368 
377  virtual void checkType(Lease::Type type) const = 0;
378 
383  uint64_t sumPoolCapacity(const PoolCollection& pools) const;
384 
390  uint64_t sumPoolCapacity(const PoolCollection& pools,
391  const ClientClasses& client_classes) const;
392 
405  uint64_t sumPoolCapacity(const PoolCollection& pools,
406  const ClientClasses& client_classes,
407  Allocator::PrefixLenMatchType prefix_length_match,
408  uint8_t hint_prefix_length) const;
409 
418  bool poolOverlaps(const Lease::Type& pool_type, const PoolPtr& pool) const;
419 
423  virtual data::ElementPtr toElement() const;
424 
433  static std::pair<asiolink::IOAddress, uint8_t>
434  parsePrefixCommon(const std::string& prefix);
435 
441 
444 
447 
450 
453 
455  uint8_t prefix_len_;
456 
458  std::string shared_network_name_;
459 
461  std::map<Lease::Type, AllocatorPtr> allocators_;
462 
464  std::map<Lease::Type, SubnetAllocationStatePtr> allocation_states_;
465 };
466 
468 typedef boost::shared_ptr<Subnet> SubnetPtr;
469 
470 
471 class Subnet4;
472 
474 typedef boost::shared_ptr<const Subnet4> ConstSubnet4Ptr;
475 
477 typedef boost::shared_ptr<Subnet4> Subnet4Ptr;
478 
484 class Subnet4 : public Subnet, public Network4 {
485 public:
486 
498  Subnet4(const isc::asiolink::IOAddress& prefix, uint8_t length,
499  const util::Triplet<uint32_t>& t1,
500  const util::Triplet<uint32_t>& t2,
501  const util::Triplet<uint32_t>& valid_lifetime,
502  const SubnetID id = 0);
503 
524  static Subnet4Ptr
525  create(const isc::asiolink::IOAddress& prefix, uint8_t length,
526  const util::Triplet<uint32_t>& t1,
527  const util::Triplet<uint32_t>& t2,
528  const util::Triplet<uint32_t>& valid_lifetime,
529  const SubnetID id = 0);
530 
543  Subnet4Ptr getNextSubnet(const Subnet4Ptr& first_subnet) const;
544 
557  Subnet4Ptr getNextSubnet(const Subnet4Ptr& first_subnet,
558  const ClientClasses& client_classes) const;
559 
571  virtual bool
572  clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
573 
579  return (dhcp4o6_);
580  }
581 
586  const Cfg4o6& get4o6() const {
587  return (dhcp4o6_);
588  }
589 
593  virtual data::ElementPtr toElement() const;
594 
599  static std::pair<asiolink::IOAddress, uint8_t>
600  parsePrefix(const std::string& prefix);
601 
602 private:
603 
605  Subnet4(const Subnet4&) = delete;
606 
608  Subnet4& operator=(const Subnet4&) = delete;
609 
613  virtual isc::asiolink::IOAddress default_pool() const {
614  return (isc::asiolink::IOAddress("0.0.0.0"));
615  }
616 
623  virtual void checkType(Lease::Type type) const;
624 
626  Cfg4o6 dhcp4o6_;
627 };
628 
629 class Subnet6;
630 
632 typedef boost::shared_ptr<const Subnet6> ConstSubnet6Ptr;
633 
635 typedef boost::shared_ptr<Subnet6> Subnet6Ptr;
636 
642 class Subnet6 : public Subnet, public Network6 {
643 public:
644 
657  Subnet6(const isc::asiolink::IOAddress& prefix, uint8_t length,
658  const util::Triplet<uint32_t>& t1,
659  const util::Triplet<uint32_t>& t2,
660  const util::Triplet<uint32_t>& preferred_lifetime,
661  const util::Triplet<uint32_t>& valid_lifetime,
662  const SubnetID id = 0);
663 
685  static Subnet6Ptr
686  create(const isc::asiolink::IOAddress& prefix, uint8_t length,
687  const util::Triplet<uint32_t>& t1,
688  const util::Triplet<uint32_t>& t2,
689  const util::Triplet<uint32_t>& preferred_lifetime,
690  const util::Triplet<uint32_t>& valid_lifetime,
691  const SubnetID id = 0);
692 
705  Subnet6Ptr getNextSubnet(const Subnet6Ptr& first_subnet) const;
706 
719  Subnet6Ptr getNextSubnet(const Subnet6Ptr& first_subnet,
720  const ClientClasses& client_classes) const;
721 
733  virtual bool
734  clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
735 
739  virtual data::ElementPtr toElement() const;
740 
745  static std::pair<asiolink::IOAddress, uint8_t>
746  parsePrefix(const std::string& prefix);
747 
748 private:
749 
751  Subnet6(const Subnet6&) = delete;
752 
754  Subnet6& operator=(const Subnet6&) = delete;
755 
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 
794 typedef boost::multi_index_container<
795  // Multi index container holds pointers to the subnets.
796  Subnet4Ptr,
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 
835 typedef boost::multi_index_container<
836  // Multi index container holds pointers to the subnets.
837  Subnet4Ptr,
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 
874 typedef boost::multi_index_container<
875  // Multi index container holds pointers to the subnets.
876  Subnet6Ptr,
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 
914 typedef boost::multi_index_container<
915  // Multi index container holds pointers to the subnets.
916  Subnet6Ptr,
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 
946 template<typename ReturnPtrType, typename CollectionType>
948 public:
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 
971 
975 
978 namespace {
979 
980 template <isc::util::DhcpSpace D>
981 struct AdapterSubnet {};
982 
983 template <>
984 struct AdapterSubnet<isc::util::DHCPv4> {
985  using type = Subnet4;
986 };
987 
988 template <>
989 struct AdapterSubnet<isc::util::DHCPv6> {
990  using type = Subnet6;
991 };
992 
993 } // namespace
994 
995 template <isc::util::DhcpSpace D>
996 using SubnetT = typename AdapterSubnet<D>::type;
997 
998 template <isc::util::DhcpSpace D>
999 using SubnetTPtr = boost::shared_ptr<SubnetT<D>>;
1001 
1002 } // end of isc::dhcp namespace
1003 } // end of isc namespace
1004 
1005 #endif // SUBNET_H
WeakNetworkPtr parent_network_
Pointer to another network that this network belongs to.
Definition: network.h:1197
SubnetAllocationStatePtr getAllocationState(Lease::Type type) const
Returns subnet-specific allocation state.
Definition: subnet.cc:372
boost::shared_ptr< Network > NetworkPtr
Pointer to the Network object.
Definition: network.h:70
Tag for the index for searching by subnet identifier.
Definition: subnet.h:777
Cfg4o6 & get4o6()
Returns DHCP4o6 configuration parameters.
Definition: subnet.h:578
typename AdapterSubnet< D >::type SubnetT
Definition: subnet.h:996
bool inRange(const isc::asiolink::IOAddress &addr) const
checks if specified address is in range.
Definition: subnet.cc:73
void setAllocator(Lease::Type type, const AllocatorPtr &allocator)
Sets new allocator instance.
Definition: subnet.cc:367
SubnetID id_
subnet-id
Definition: subnet.h:440
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition: subnet.h:477
void addPool(const PoolPtr &pool)
Adds a new pool for the subnet.
Definition: subnet.cc:455
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
std::vector< PoolPtr > PoolCollection
a container for either IPv4 or IPv6 Pools
Definition: pool.h:494
Tag for the index for searching by subnet prefix.
Definition: subnet.h:780
std::map< Lease::Type, AllocatorPtr > allocators_
Lease allocators used by the subnet.
Definition: subnet.h:461
A configuration holder for IPv4 subnet.
Definition: subnet.h:484
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition: pool.h:491
bool inPool(Lease::Type type, const isc::asiolink::IOAddress &addr) const
checks if the specified address is in pools.
Definition: subnet.cc:515
void setAllocationState(Lease::Type type, const SubnetAllocationStatePtr &allocation_state)
Sets subnet-specific allocation state.
Definition: subnet.cc:383
uint8_t prefix_len_
a prefix length of the subnet.
Definition: subnet.h:455
A class containing static convenience methods to fetch the subnets from the containers.
Definition: subnet.h:947
Specialization of the Network object for DHCPv6 case.
Definition: network.h:1342
boost::shared_ptr< SubnetT< D > > SubnetTPtr
Definition: subnet.h:999
SubnetID getID() const
Returns unique ID for that subnet.
Definition: subnet.h:82
Tag for the index for searching by server identifier.
Definition: subnet.h:783
AllocatorPtr getAllocator(Lease::Type type) const
Returns lease allocator instance.
Definition: subnet.cc:356
PrefixLenMatchType
Type of preferred PD-pool prefix length selection criteria.
Definition: allocator.h:60
std::string shared_network_name_
Shared network name.
Definition: subnet.h:458
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
This structure contains information about DHCP4o6 (RFC7341)
Definition: cfg_4o6.h:22
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
void getSharedNetwork(SharedNetworkPtrType &shared_network) const
Retrieves pointer to a shared network associated with a subnet.
Definition: subnet.h:237
boost::posix_time::ptime getModificationTime() const
Returns timestamp.
Common interface representing a network to which the DHCP clients are connected.
Definition: network.h:152
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
Definition: subnet.h:629
const PoolCollection & getPools(Lease::Type type) const
Returns all pools (const variant).
Definition: subnet.cc:319
boost::shared_ptr< SubnetAllocationState > SubnetAllocationStatePtr
static SubnetID static_id_
keeps the subnet-id value.
Definition: subnet.h:342
void setSharedNetworkName(const std::string &shared_network_name)
Sets new shared network name.
Definition: subnet.h:272
static void resetSubnetID()
Resets subnet-id counter to its initial value (1).
Definition: subnet.h:216
const Cfg4o6 & get4o6() const
Returns const DHCP4o6 configuration parameters.
Definition: subnet.h:586
std::string getSharedNetworkName() const
Returns shared network name.
Definition: subnet.h:256
uint64_t sumPoolCapacity(const PoolCollection &pools) const
Returns a sum of possible leases in all pools.
Definition: subnet.cc:141
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:211
uint64_t getPoolCapacity(Lease::Type type) const
Returns the number of possible leases for specified lease type.
Definition: subnet.cc:88
isc::asiolink::IOAddress prefix_
a prefix of the subnet.
Definition: subnet.h:452
PoolCollection pools_
collection of IPv4 or non-temporary IPv6 pools in that subnet.
Definition: subnet.h:443
virtual bool clientSupported(const isc::dhcp::ClientClasses &client_classes) const
Checks whether this network supports client that belongs to specified classes.
Definition: network.cc:69
bool poolOverlaps(const Lease::Type &pool_type, const PoolPtr &pool) const
Checks if the specified pool overlaps with an existing pool.
Definition: subnet.cc:558
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
virtual data::ElementPtr toElement() const
Unparse a subnet object.
Definition: subnet.cc:723
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
Defines the logger used by the top-level component of kea-lfc.
PoolPtr getAnyPool(Lease::Type type)
Returns a pool without any address specified.
Definition: subnet.h:157
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
Definition: subnet.h:471
void setSharedNetwork(const NetworkPtr &shared_network)
Assigns shared network to a subnet.
Definition: subnet.h:249
A configuration holder for IPv6 subnet.
Definition: subnet.h:642
PoolCollection & getPoolsWritable(Lease::Type type)
Returns all pools (non-const variant).
Definition: subnet.cc:337
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:387
Type
Type of lease or pool.
Definition: lease.h:46
This class represents configuration element which is associated with database identifier and the modi...
virtual asiolink::IOAddress getServerId() const
Returns binary representation of the dhcp-server-identifier option (54).
Definition: network.cc:327
virtual void checkType(Lease::Type type) const =0
Checks if used pool type is valid.
Specialization of the Network object for DHCPv4 case.
Definition: network.h:1205
void delPools(Lease::Type type)
Deletes all pools of specified type.
Definition: subnet.cc:510
Subnet(const isc::asiolink::IOAddress &prefix, uint8_t len, const SubnetID id)
Protected constructor.
Definition: subnet.cc:60
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Definition: subnet.h:635
PoolCollection pools_ta_
collection of IPv6 temporary address pools in that subnet.
Definition: subnet.h:446
boost::shared_ptr< Allocator > AllocatorPtr
Defines a pointer to an allocator.
Definition: allocator.h:209
Tag for the index for searching by subnet modification time.
Definition: subnet.h:786
PoolCollection pools_pd_
collection of IPv6 prefix pools in that subnet.
Definition: subnet.h:449
virtual isc::asiolink::IOAddress default_pool() const =0
Returns the default address that will be used for pool selection.
Container for storing client class names.
Definition: classify.h:108
virtual std::string toText() const
Returns textual representation of the subnet (e.g.
Definition: subnet.cc:81
static SubnetID generateNextID()
returns the next unique Subnet-ID.
Definition: subnet.h:361
std::map< Lease::Type, SubnetAllocationStatePtr > allocation_states_
Holds subnet-specific allocation state.
Definition: subnet.h:464
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
Definition: subnet.h:468
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
virtual ~Subnet()
virtual destructor.
Definition: subnet.h:342