From: Marcin Siodelski Date: Wed, 22 Mar 2023 08:36:19 +0000 (+0100) Subject: [#2780] Removed unused code from FLQ state X-Git-Tag: Kea-2.3.7~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af77790ea4fbb7b950c0cd588f1c499155d71069;p=thirdparty%2Fkea.git [#2780] Removed unused code from FLQ state --- diff --git a/src/lib/dhcpsrv/flq_allocation_state.cc b/src/lib/dhcpsrv/flq_allocation_state.cc index 7f9fa58583..1783d43780 100644 --- a/src/lib/dhcpsrv/flq_allocation_state.cc +++ b/src/lib/dhcpsrv/flq_allocation_state.cc @@ -13,16 +13,6 @@ using namespace isc::asiolink; namespace isc { namespace dhcp { -SubnetFreeLeaseQueueAllocationStatePtr -SubnetFreeLeaseQueueAllocationState::create(const SubnetPtr& subnet) { - auto subnet_prefix = subnet->get(); - return (boost::make_shared()); -} - -SubnetFreeLeaseQueueAllocationState::SubnetFreeLeaseQueueAllocationState() - : SubnetAllocationState() { -} - PoolFreeLeaseQueueAllocationStatePtr PoolFreeLeaseQueueAllocationState::create(const PoolPtr& pool) { return (boost::make_shared(pool->getType())); diff --git a/src/lib/dhcpsrv/flq_allocation_state.h b/src/lib/dhcpsrv/flq_allocation_state.h index 22713b6a72..be5728ad78 100644 --- a/src/lib/dhcpsrv/flq_allocation_state.h +++ b/src/lib/dhcpsrv/flq_allocation_state.h @@ -16,27 +16,6 @@ namespace isc { namespace dhcp { -/// @brief Forward declaration of the @c SubnetFreeLeaseQueueAllocationState. -class SubnetFreeLeaseQueueAllocationState; - -/// @brief Type of the pointer to the @c SubnetFreeLeaseQueueAllocationState. -typedef boost::shared_ptr SubnetFreeLeaseQueueAllocationStatePtr; - -/// @brief Subnet allocation state used by the FLQ allocator. -class SubnetFreeLeaseQueueAllocationState : public SubnetAllocationState { -public: - - /// @brief Factory function creating the state instance from subnet. - /// - /// @param subnet instance of the subnet for which the allocation - /// state should be instantiated. - /// @return new allocation state instance. - static SubnetFreeLeaseQueueAllocationStatePtr create(const SubnetPtr& subnet); - - /// @brief Constructor. - SubnetFreeLeaseQueueAllocationState(); -}; - /// @brief Forward declaration of the @c PoolFreeLeaseQueueAllocationState. class PoolFreeLeaseQueueAllocationState; diff --git a/src/lib/dhcpsrv/flq_allocator.cc b/src/lib/dhcpsrv/flq_allocator.cc index 5bf07e7090..2429bfd65f 100644 --- a/src/lib/dhcpsrv/flq_allocator.cc +++ b/src/lib/dhcpsrv/flq_allocator.cc @@ -269,15 +269,6 @@ FreeLeaseQueueAllocator::populateFreePrefixDelegationLeases(const Lease6Collecti .arg(stopwatch.logFormatLastDuration()); } -SubnetFreeLeaseQueueAllocationStatePtr -FreeLeaseQueueAllocator::getSubnetState() const { - auto subnet = subnet_.lock(); - if (!subnet->getAllocationState(pool_type_)) { - subnet->setAllocationState(pool_type_, SubnetFreeLeaseQueueAllocationState::create(subnet)); - } - return (boost::dynamic_pointer_cast(subnet->getAllocationState(pool_type_))); -} - PoolFreeLeaseQueueAllocationStatePtr FreeLeaseQueueAllocator::getPoolState(const PoolPtr& pool) const { if (!pool->getAllocationState()) { diff --git a/src/lib/dhcpsrv/flq_allocator.h b/src/lib/dhcpsrv/flq_allocator.h index 794af2854b..b95b4d8260 100644 --- a/src/lib/dhcpsrv/flq_allocator.h +++ b/src/lib/dhcpsrv/flq_allocator.h @@ -111,14 +111,6 @@ private: const isc::asiolink::IOAddress& hint, uint8_t hint_prefix_length); - /// @brief Convenience function returning subnet allocation state instance. - /// - /// It creates a new subnet state instance and assigns it to the subnet - /// if it hasn't been initialized. - /// - /// @return allocation state instance for the subnet. - SubnetFreeLeaseQueueAllocationStatePtr getSubnetState() const; - /// @brief Convenience function returning pool allocation state instance. /// /// It creates a new pool state instance and assigns it to the pool