From af77790ea4fbb7b950c0cd588f1c499155d71069 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Wed, 22 Mar 2023 09:36:19 +0100 Subject: [PATCH] [#2780] Removed unused code from FLQ state --- src/lib/dhcpsrv/flq_allocation_state.cc | 10 ---------- src/lib/dhcpsrv/flq_allocation_state.h | 21 --------------------- src/lib/dhcpsrv/flq_allocator.cc | 9 --------- src/lib/dhcpsrv/flq_allocator.h | 8 -------- 4 files changed, 48 deletions(-) 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 -- 2.47.2