]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3913] Addressed review comments.
authorMarcin Siodelski <marcin@isc.org>
Fri, 26 Jun 2015 16:33:29 +0000 (18:33 +0200)
committerMarcin Siodelski <marcin@isc.org>
Fri, 26 Jun 2015 16:33:29 +0000 (18:33 +0200)
Moved the function from the anon namespace to the AllocEngine class.

src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h

index 34633aa62299383c177155b622a1ddf6a6838e7a..1bbf0ca699356a1ff9d86fc425d7333451f584a8 100644 (file)
@@ -289,45 +289,10 @@ AllocEngine::AllocatorPtr AllocEngine::getAllocator(Lease::Type type) {
     return (alloc->second);
 }
 
-} // end of isc::dhcp namespace
-} // end of isc namespace
-
-namespace {
-
-/// @brief Extends the lease lifetime.
-///
-/// This function is called to conditionally extend the lifetime of
-/// the DHCPv4 or DHCPv6 lease. It is envisaged that this function will
-/// make a decision if the lease lifetime should be extended, using
-/// a preconfigured threshold, which would indicate how many percent
-/// of the valid lifetime should have passed for the lease lifetime
-/// to be extended. The lease lifetime would not be extended if
-/// the threshold hasn't been reached.
-///
-/// @todo Currently this function always extends the lease lifetime.
-/// In the future, it will take the threshold value into account,
-/// once the threshold is configurable.
-///
-/// @param [out] lease A lease for which the lifetime should be
-/// extended.
-///
-/// @return true if the lease lifetime has been extended, false
-/// otherwise.
-bool
-conditionalExtendLifetime(Lease& lease) {
-    lease.cltt_ = time(NULL);
-    return (true);
-}
-
-} // end of anonymous namespace
-
 // ##########################################################################
 // #    DHCPv6 lease allocation code starts here.
 // ##########################################################################
 
-namespace isc {
-namespace dhcp {
-
 AllocEngine::ClientContext6::ClientContext6()
     : subnet_(), duid_(), iaid_(0), type_(Lease::TYPE_NA), hwaddr_(),
       hints_(), fwd_dns_update_(false), rev_dns_update_(false), hostname_(""),
@@ -2077,5 +2042,11 @@ AllocEngine::updateLease4Information(const Lease4Ptr& lease,
     lease->hostname_ = ctx.hostname_;
 }
 
+bool
+AllocEngine::conditionalExtendLifetime(Lease& lease) const {
+    lease.cltt_ = time(NULL);
+    return (true);
+}
+
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
index 2c2335dbe39b7f87ea42da8f5cdcb3a1b81c23b8..408e4dc91e00f39ee532e032c5ec844f9c5d68aa 100644 (file)
@@ -1091,6 +1091,28 @@ private:
     /// client and its message.
     void updateLease4Information(const Lease4Ptr& lease,
                                  ClientContext4& ctx) const;
+
+    /// @brief Extends the lease lifetime.
+    ///
+    /// This function is called to conditionally extend the lifetime of
+    /// the DHCPv4 or DHCPv6 lease. It is envisaged that this function will
+    /// make a decision if the lease lifetime should be extended, using
+    /// a preconfigured threshold, which would indicate how many percent
+    /// of the valid lifetime should have passed for the lease lifetime
+    /// to be extended. The lease lifetime would not be extended if
+    /// the threshold hasn't been reached.
+    ///
+    /// @todo Currently this function always extends the lease lifetime.
+    /// In the future, it will take the threshold value into account,
+    /// once the threshold is configurable.
+    ///
+    /// @param [in,out] lease A lease for which the lifetime should be
+    /// extended.
+    ///
+    /// @return true if the lease lifetime has been extended, false
+    /// otherwise.
+    bool conditionalExtendLifetime(Lease& lease) const;
+
 };
 
 /// @brief A pointer to the @c AllocEngine object.