diff options
Diffstat (limited to 'src/lib/dhcpsrv/memfile_lease_mgr.cc')
-rw-r--r-- | src/lib/dhcpsrv/memfile_lease_mgr.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc index 5cb8a4267b..b94c1593d8 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc @@ -637,7 +637,7 @@ const int Memfile_LeaseMgr::MAJOR_VERSION_V6; const int Memfile_LeaseMgr::MINOR_VERSION_V6; Memfile_LeaseMgr::Memfile_LeaseMgr(const DatabaseConnection::ParameterMap& parameters) - : LeaseMgr(), lfc_setup_(), conn_(parameters), mutex_(new std::mutex) { + : TrackingLeaseMgr(), lfc_setup_(), conn_(parameters), mutex_(new std::mutex) { bool conversion_needed = false; // Check if the extended info tables are enabled. @@ -727,6 +727,11 @@ Memfile_LeaseMgr::addLeaseInternal(const Lease4Ptr& lease) { // Increment class lease counters. class_lease_counter_.addLease(lease); + // Run installed callbacks. + if (hasCallbacks()) { + trackAddLease(lease, true); + } + return (true); } @@ -771,6 +776,11 @@ Memfile_LeaseMgr::addLeaseInternal(const Lease6Ptr& lease) { static_cast<void>(addExtendedInfo6(lease)); } + // Run installed callbacks. + if (hasCallbacks()) { + trackAddLease(lease, true); + } + return (true); } @@ -1451,6 +1461,11 @@ Memfile_LeaseMgr::updateLease4Internal(const Lease4Ptr& lease) { // Adjust class lease counters. class_lease_counter_.updateLease(lease, old_lease); + + // Run installed callbacks. + if (hasCallbacks()) { + trackUpdateLease(lease, true); + } } void @@ -1526,6 +1541,11 @@ Memfile_LeaseMgr::updateLease6Internal(const Lease6Ptr& lease) { break; } } + + // Run installed callbacks. + if (hasCallbacks()) { + trackUpdateLease(lease, true); + } } void @@ -1571,6 +1591,11 @@ Memfile_LeaseMgr::deleteLeaseInternal(const Lease4Ptr& lease) { // Decrement class lease counters. class_lease_counter_.removeLease(lease); + // Run installed callbacks. + if (hasCallbacks()) { + trackDeleteLease(lease, true); + } + return (true); } } @@ -1625,6 +1650,11 @@ Memfile_LeaseMgr::deleteLeaseInternal(const Lease6Ptr& lease) { deleteExtendedInfo6(lease->addr_); } + // Run installed callbacks. + if (hasCallbacks()) { + trackDeleteLease(lease, true); + } + return (true); } } |