]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2780] Removed unused code from FLQ state
authorMarcin Siodelski <msiodelski@gmail.com>
Wed, 22 Mar 2023 08:36:19 +0000 (09:36 +0100)
committerMarcin Siodelski <msiodelski@gmail.com>
Wed, 29 Mar 2023 12:44:07 +0000 (14:44 +0200)
src/lib/dhcpsrv/flq_allocation_state.cc
src/lib/dhcpsrv/flq_allocation_state.h
src/lib/dhcpsrv/flq_allocator.cc
src/lib/dhcpsrv/flq_allocator.h

index 7f9fa585839b0113fdfe46b876402d65d03b2c2a..1783d4378063e16773c89b56fc6182d1fc1e64e5 100644 (file)
@@ -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::SubnetFreeLeaseQueueAllocationState()
-    : SubnetAllocationState() {
-}
-
 PoolFreeLeaseQueueAllocationStatePtr
 PoolFreeLeaseQueueAllocationState::create(const PoolPtr& pool) {
     return (boost::make_shared<PoolFreeLeaseQueueAllocationState>(pool->getType()));
index 22713b6a7206c26a1849f172940fa05469abddf6..be5728ad78e63a3987a0eb3d1515da9a30759faf 100644 (file)
 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<SubnetFreeLeaseQueueAllocationState> 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;
 
index 5bf07e7090f716c82aee360690c7f60ffcb214f3..2429bfd65f1b641f4e2d0d797b548f86cc3acf53 100644 (file)
@@ -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<SubnetFreeLeaseQueueAllocationState>(subnet->getAllocationState(pool_type_)));
-}
-
 PoolFreeLeaseQueueAllocationStatePtr
 FreeLeaseQueueAllocator::getPoolState(const PoolPtr& pool) const {
     if (!pool->getAllocationState()) {
index 794af2854b98c345ab624cb9115236d723af2e33..b95b4d82600c4113476f647b1ca0baa026c4f13f 100644 (file)
@@ -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