cfg.add(subnet2);
cfg.add(subnet3);
+ EXPECT_EQ(0, allocator0->callcount_);
+ EXPECT_EQ(0, allocator2->callcount_);
+
cfg.initAllocatorsAfterConfigure();
EXPECT_EQ(1, allocator0->callcount_);
cfg.add(subnet2);
cfg.add(subnet3);
+ EXPECT_EQ(0, allocator0->callcount_);
+ EXPECT_EQ(0, allocator2->callcount_);
+
cfg.initAllocatorsAfterConfigure();
EXPECT_EQ(1, allocator0->callcount_);
void
GenericLeaseMgrTest::testTrackAddLease4(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease. It should trigger the callback.
}
void
-GenericLeaseMgrTest::testTrackAddLease6(bool expect_locked, bool expect_mt_safe) {
+GenericLeaseMgrTest::testTrackAddLeaseNA(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease. It should trigger the callback.
EXPECT_FALSE(lmptr_->isLocked(lease));
}
+void
+GenericLeaseMgrTest::testTrackAddLeasePD(bool expect_locked, bool expect_mt_safe) {
+ // Register a callback for all subnets.
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_PD,
+ std::bind(&GenericLeaseMgrTest::logCallback,
+ this,
+ TrackingLeaseMgr::TRACK_ADD_LEASE,
+ SUBNET_ID_GLOBAL,
+ ph::_1,
+ ph::_2));
+ // Add a lease. It should trigger the callback.
+ Lease6Ptr lease = initializeLease6(straddress6_[2]);
+ EXPECT_TRUE(lmptr_->addLease(lease));
+
+ // Make sure that the callback has been invoked.
+ ASSERT_EQ(1, logs_.size());
+
+ // This flag should be false for the Memfile backend and true
+ // for the SQL backends.
+ if (expect_locked) {
+ EXPECT_TRUE(logs_[0].locked);
+ } else {
+ EXPECT_FALSE(logs_[0].locked);
+ }
+ // This flag should be set to true for the Memfile backends.
+ // It should be false for other backends. If the backends do
+ // not provide the MT-safe context, the callbacks must protect
+ // against the concurrent access on their own.
+ if (expect_mt_safe) {
+ EXPECT_TRUE(logs_[0].mt_safe);
+ } else {
+ EXPECT_FALSE(logs_[0].mt_safe);
+ }
+
+ // The lease locks should have been released.
+ EXPECT_FALSE(lmptr_->isLocked(lease));
+}
+
void
GenericLeaseMgrTest::testTrackUpdateLease4(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL,
Lease::TYPE_V4,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease.
}
void
-GenericLeaseMgrTest::testTrackUpdateLease6(bool expect_locked, bool expect_mt_safe) {
+GenericLeaseMgrTest::testTrackUpdateLeaseNA(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease.
EXPECT_FALSE(lmptr_->isLocked(lease));
}
+void
+GenericLeaseMgrTest::testTrackUpdateLeasePD(bool expect_locked, bool expect_mt_safe) {
+ // Register a callback for all subnets.
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_PD,
+ std::bind(&GenericLeaseMgrTest::logCallback,
+ this,
+ TrackingLeaseMgr::TRACK_UPDATE_LEASE,
+ SUBNET_ID_GLOBAL,
+ ph::_1,
+ ph::_2));
+ // Add a lease.
+ Lease6Ptr lease = initializeLease6(straddress6_[2]);
+ EXPECT_TRUE(lmptr_->addLease(lease));
+ EXPECT_TRUE(logs_.empty());
+
+ lmptr_->updateLease6(lease);
+
+ // Make sure that the callback has been invoked.
+ ASSERT_EQ(1, logs_.size());
+
+ // This flag should be false for the Memfile backend and true
+ // for the SQL backends.
+ if (expect_locked) {
+ EXPECT_TRUE(logs_[0].locked);
+ } else {
+ EXPECT_FALSE(logs_[0].locked);
+ }
+ // This flag should be set to true for the Memfile backends.
+ // It should be false for other backends. If the backends do
+ // not provide the MT-safe context, the callbacks must protect
+ // against the concurrent access on their own.
+ if (expect_mt_safe) {
+ EXPECT_TRUE(logs_[0].mt_safe);
+ } else {
+ EXPECT_FALSE(logs_[0].mt_safe);
+ }
+
+ // The lease locks should have been released.
+ EXPECT_FALSE(lmptr_->isLocked(lease));
+}
+
void
GenericLeaseMgrTest::testTrackDeleteLease4(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_DELETE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease.
}
void
-GenericLeaseMgrTest::testTrackDeleteLease6(bool expect_locked, bool expect_mt_safe) {
+GenericLeaseMgrTest::testTrackDeleteLeaseNA(bool expect_locked, bool expect_mt_safe) {
// Register a callback for all subnets.
- lmptr_->registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&GenericLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_DELETE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1,
ph::_2));
// Add a lease.
EXPECT_FALSE(lmptr_->isLocked(lease));
}
+void
+GenericLeaseMgrTest::testTrackDeleteLeasePD(bool expect_locked, bool expect_mt_safe) {
+ // Register a callback for all subnets.
+ lmptr_->registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_PD,
+ std::bind(&GenericLeaseMgrTest::logCallback,
+ this,
+ TrackingLeaseMgr::TRACK_DELETE_LEASE,
+ SUBNET_ID_GLOBAL,
+ ph::_1,
+ ph::_2));
+ // Add a lease.
+ Lease6Ptr lease = initializeLease6(straddress6_[2]);
+ EXPECT_TRUE(lmptr_->addLease(lease));
+ EXPECT_TRUE(logs_.empty());
+
+ lmptr_->deleteLease(lease);
+
+ // Make sure that the callback has been invoked.
+ ASSERT_EQ(1, logs_.size());
+
+ // This flag should be false for the Memfile backend and true
+ // for the SQL backends.
+ if (expect_locked) {
+ EXPECT_TRUE(logs_[0].locked);
+ } else {
+ EXPECT_FALSE(logs_[0].locked);
+ }
+ // This flag should be set to true for the Memfile backends.
+ // It should be false for other backends. If the backends do
+ // not provide the MT-safe context, the callbacks must protect
+ // against the concurrent access on their own.
+ if (expect_mt_safe) {
+ EXPECT_TRUE(logs_[0].mt_safe);
+ } else {
+ EXPECT_FALSE(logs_[0].mt_safe);
+ }
+
+ // The lease locks should have been released.
+ EXPECT_FALSE(lmptr_->isLocked(lease));
+}
+
void
GenericLeaseMgrTest::testRecreateWithCallbacks(const std::string& access) {
// Register a callback.
void testTrackAddLease4(bool expect_locked, bool expect_mt_safe);
/// @brief Checks if the backends call the callbacks when an
- /// IPv6 lease is added.
+ /// IPv6 address lease is added.
///
/// @param expect_locked a boolean flag indicating if the test should
/// expect that the lease is locked before the callback.
/// @param expect_mt_safe a boolean flag indicating if the test should
/// expect that the callbacks are called in the MT-safe context.
- void testTrackAddLease6(bool expect_locked, bool expect_mt_safe);
+ void testTrackAddLeaseNA(bool expect_locked, bool expect_mt_safe);
+
+ /// @brief Checks if the backends call the callbacks when an
+ /// IPv6 prefix lease is added.
+ ///
+ /// @param expect_locked a boolean flag indicating if the test should
+ /// expect that the lease is locked before the callback.
+ /// @param expect_mt_safe a boolean flag indicating if the test should
+ /// expect that the callbacks are called in the MT-safe context.
+ void testTrackAddLeasePD(bool expect_locked, bool expect_mt_safe);
/// @brief Checks if the backends call the callbacks when an
/// IPv4 lease is updated.
void testTrackUpdateLease4(bool expect_locked, bool expect_mt_safe);
/// @brief Checks if the backends call the callbacks when an
- /// IPv6 lease is updated.
+ /// IPv6 address lease is updated.
///
/// @param expect_locked a boolean flag indicating if the test should
/// expect that the lease is locked before the callback.
/// @param expect_mt_safe a boolean flag indicating if the test should
/// expect that the callbacks are called in the MT-safe context.
- void testTrackUpdateLease6(bool expect_locked, bool expect_mt_safe);
+ void testTrackUpdateLeaseNA(bool expect_locked, bool expect_mt_safe);
+
+ /// @brief Checks if the backends call the callbacks when an
+ /// IPv6 prefix lease is updated.
+ ///
+ /// @param expect_locked a boolean flag indicating if the test should
+ /// expect that the lease is locked before the callback.
+ /// @param expect_mt_safe a boolean flag indicating if the test should
+ /// expect that the callbacks are called in the MT-safe context.
+ void testTrackUpdateLeasePD(bool expect_locked, bool expect_mt_safe);
/// @brief Checks if the backends call the callbacks when an
/// IPv4 lease is deleted.
void testTrackDeleteLease4(bool expect_locked, bool expect_mt_safe);
/// @brief Checks if the backends call the callbacks when an
- /// IPv6 lease is deleted.
+ /// IPv6 address lease is deleted.
+ ///
+ /// @param expect_locked a boolean flag indicating if the test should
+ /// expect that the lease is locked before the callback.
+ /// @param expect_mt_safe a boolean flag indicating if the test should
+ /// expect that the callbacks are called in the MT-safe context.
+ void testTrackDeleteLeaseNA(bool expect_locked, bool expect_mt_safe);
+
+ /// @brief Checks if the backends call the callbacks when an
+ /// IPv6 prefix lease is deleted.
///
/// @param expect_locked a boolean flag indicating if the test should
/// expect that the lease is locked before the callback.
/// @param expect_mt_safe a boolean flag indicating if the test should
/// expect that the callbacks are called in the MT-safe context.
- void testTrackDeleteLease6(bool expect_locked, bool expect_mt_safe);
+ void testTrackDeleteLeasePD(bool expect_locked, bool expect_mt_safe);
/// @brief Checks that the lease manager can be recreated and its
/// registered callbacks preserved, if desired.
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackAddLease6) {
+/// IPv6 address lease is added.
+TEST_F(MemfileLeaseMgrTest, trackAddLeaseNA) {
startBackend(V6);
// Expect that lease is not locked and the MT-safe context.
- testTrackAddLease6(false, true);
+ testTrackAddLeaseNA(false, true);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackAddLease6MultiThreading) {
+/// IPv6 address lease is added.
+TEST_F(MemfileLeaseMgrTest, trackAddLeaseNAMultiThreading) {
startBackend(V6);
MultiThreadingMgr::instance().setMode(true);
// Expect that lease is not locked and the MT-safe context.
- testTrackAddLease6(false, true);
+ testTrackAddLeaseNA(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(MemfileLeaseMgrTest, trackAddLeasePD) {
+ startBackend(V6);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackAddLeasePD(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(MemfileLeaseMgrTest, trackAddLeasePDMultiThreading) {
+ startBackend(V6);
+ MultiThreadingMgr::instance().setMode(true);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackAddLeasePD(false, true);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackUpdateLease6) {
+/// IPv6 address lease is updated.
+TEST_F(MemfileLeaseMgrTest, trackUpdateLeaseNA) {
startBackend(V6);
// Expect that lease is not locked and the MT-safe context.
- testTrackUpdateLease6(false, true);
+ testTrackUpdateLeaseNA(false, true);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackUpdateLease6MultiThreading) {
+/// IPv6 address lease is updated.
+TEST_F(MemfileLeaseMgrTest, trackUpdateLeaseNAMultiThreading) {
startBackend(V6);
MultiThreadingMgr::instance().setMode(true);
// Expect that lease is not locked and the MT-safe context.
- testTrackUpdateLease6(false, true);
+ testTrackUpdateLeaseNA(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(MemfileLeaseMgrTest, trackUpdateLeasePD) {
+ startBackend(V6);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackUpdateLeasePD(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(MemfileLeaseMgrTest, trackUpdateLeasePDMultiThreading) {
+ startBackend(V6);
+ MultiThreadingMgr::instance().setMode(true);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackUpdateLeasePD(false, true);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackDeleteLease6) {
+/// IPv6 address lease is deleted.
+TEST_F(MemfileLeaseMgrTest, trackDeleteLeaseNA) {
+ startBackend(V6);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackDeleteLeaseNA(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 addres lease is deleted.
+TEST_F(MemfileLeaseMgrTest, trackDeleteLeaseNAMultiThreading) {
+ startBackend(V6);
+ MultiThreadingMgr::instance().setMode(true);
+ // Expect that lease is not locked and the MT-safe context.
+ testTrackDeleteLeaseNA(false, true);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is deleted.
+TEST_F(MemfileLeaseMgrTest, trackDeleteLeasePD) {
startBackend(V6);
// Expect that lease is not locked and the MT-safe context.
- testTrackDeleteLease6(false, true);
+ testTrackDeleteLeasePD(false, true);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MemfileLeaseMgrTest, trackDeleteLease6MultiThreading) {
+/// IPv6 prefix lease is deleted.
+TEST_F(MemfileLeaseMgrTest, trackDeleteLeasePDMultiThreading) {
startBackend(V6);
MultiThreadingMgr::instance().setMode(true);
// Expect that lease is not locked and the MT-safe context.
- testTrackDeleteLease6(false, true);
+ testTrackDeleteLeasePD(false, true);
}
/// @brief Checks that the lease manager can be recreated and its
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MySqlLeaseMgrTest, trackAddLease6) {
+/// IPv6 address lease is added.
+TEST_F(MySqlLeaseMgrTest, trackAddLeaseNA) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackAddLease6(false, false);
+ testTrackAddLeaseNA(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(MySqlLeaseMgrTest, trackAddLease6MultiThreading) {
+/// IPv6 address lease is added.
+TEST_F(MySqlLeaseMgrTest, trackAddLeaseNAMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackAddLease6(true, false);
+ testTrackAddLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(MySqlLeaseMgrTest, trackAddLeasePD) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackAddLeasePD(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(MySqlLeaseMgrTest, trackAddLeasePDMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackAddLeasePD(true, false);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is updated.
-TEST_F(MySqlLeaseMgrTest, trackUpdateLease6) {
+/// IPv6 address lease is updated.
+TEST_F(MySqlLeaseMgrTest, trackUpdateLeaseNA) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackUpdateLease6(false, false);
+ testTrackUpdateLeaseNA(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is updated.
-TEST_F(MySqlLeaseMgrTest, trackUpdateLease6MultiThreading) {
+/// IPv6 address lease is updated.
+TEST_F(MySqlLeaseMgrTest, trackUpdateLeaseNAMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackUpdateLease6(true, false);
+ testTrackUpdateLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(MySqlLeaseMgrTest, trackUpdateLeasePD) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackUpdateLeasePD(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(MySqlLeaseMgrTest, trackUpdateLeasePDMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackUpdateLeasePD(true, false);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is deleted.
-TEST_F(MySqlLeaseMgrTest, trackDeleteLease6) {
+/// IPv6 address lease is deleted.
+TEST_F(MySqlLeaseMgrTest, trackDeleteLeaseNA) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackDeleteLeaseNA(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 address lease is deleted.
+TEST_F(MySqlLeaseMgrTest, trackDeleteLeaseNAMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackDeleteLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is deleted.
+TEST_F(MySqlLeaseMgrTest, trackDeleteLeasePD) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackDeleteLease6(false, false);
+ testTrackDeleteLeasePD(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is deleted.
-TEST_F(MySqlLeaseMgrTest, trackDeleteLease6MultiThreading) {
+/// IPv6 prefix lease is deleted.
+TEST_F(MySqlLeaseMgrTest, trackDeleteLeasePDMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackDeleteLease6(true, false);
+ testTrackDeleteLeasePD(true, false);
}
/// @brief Checks that the lease manager can be recreated and its
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(PgSqlLeaseMgrTest, trackAddLease6) {
+/// IPv6 address lease is added.
+TEST_F(PgSqlLeaseMgrTest, trackAddLeaseNA) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackAddLease6(false, false);
+ testTrackAddLeaseNA(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is added.
-TEST_F(PgSqlLeaseMgrTest, trackAddLease6MultiThreading) {
+/// IPv6 address lease is added.
+TEST_F(PgSqlLeaseMgrTest, trackAddLeaseNAMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackAddLease6(true, false);
+ testTrackAddLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(PgSqlLeaseMgrTest, trackAddLeasePD) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackAddLeasePD(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is added.
+TEST_F(PgSqlLeaseMgrTest, trackAddLeasePDMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackAddLeasePD(true, false);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is updated.
-TEST_F(PgSqlLeaseMgrTest, trackUpdateLease6) {
+/// IPv6 address lease is updated.
+TEST_F(PgSqlLeaseMgrTest, trackUpdateLeaseNA) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackUpdateLease6(false, false);
+ testTrackUpdateLeaseNA(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is updated.
-TEST_F(PgSqlLeaseMgrTest, trackUpdateLease6MultiThreading) {
+/// IPv6 address lease is updated.
+TEST_F(PgSqlLeaseMgrTest, trackUpdateLeaseNAMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackUpdateLease6(true, false);
+ testTrackUpdateLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(PgSqlLeaseMgrTest, trackUpdateLeasePD) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackUpdateLeasePD(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is updated.
+TEST_F(PgSqlLeaseMgrTest, trackUpdateLeasePDMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackUpdateLeasePD(true, false);
}
/// @brief Checks if the backends call the callbacks when an
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is deleted.
-TEST_F(PgSqlLeaseMgrTest, trackDeleteLease6) {
+/// IPv6 address lease is deleted.
+TEST_F(PgSqlLeaseMgrTest, trackDeleteLeaseNA) {
+ // It is unnecessary to lock the lease in ST. The backend does not
+ // provide the MT-safe context for the callbacks.
+ testTrackDeleteLeaseNA(false, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 address lease is deleted.
+TEST_F(PgSqlLeaseMgrTest, trackDeleteLeaseNAMultiThreading) {
+ MultiThreadingMgr::instance().setMode(true);
+ // The lease should be locked in the MT mode. The backend does not
+ // provide an MT-safe context.
+ testTrackDeleteLeaseNA(true, false);
+}
+
+/// @brief Checks if the backends call the callbacks when an
+/// IPv6 prefix lease is deleted.
+TEST_F(PgSqlLeaseMgrTest, trackDeleteLeasePD) {
// It is unnecessary to lock the lease in ST. The backend does not
// provide the MT-safe context for the callbacks.
- testTrackDeleteLease6(false, false);
+ testTrackDeleteLeasePD(false, false);
}
/// @brief Checks if the backends call the callbacks when an
-/// IPv6 lease is deleted.
-TEST_F(PgSqlLeaseMgrTest, trackDeleteLease6MultiThreading) {
+/// IPv6 prefix lease is deleted.
+TEST_F(PgSqlLeaseMgrTest, trackDeleteLeasePDMultiThreading) {
MultiThreadingMgr::instance().setMode(true);
// The lease should be locked in the MT mode. The backend does not
// provide an MT-safe context.
- testTrackDeleteLease6(true, false);
+ testTrackDeleteLeasePD(true, false);
}
/// @brief Checks that the lease manager can be recreated and its
DatabaseConnection::ParameterMap pmap;
ConcreteLeaseMgr mgr(pmap);
- // Callback for lease add and subnet id 0.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ // Callback for lease add and global subnet id.
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
// Callback for lease add and subnet id 1.
EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 1,
TrackingLeaseMgr::TRACK_ADD_LEASE,
1,
ph::_1, ph::_2)));
- // Callback for lease update and subnet id 0.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ // Callback for lease update and global subnet id.
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- // Callback for lease delete and subnet id 0.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ // Callback for lease delete and global subnet id.
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_DELETE_LEASE,
- 1,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
// This call should trigger the lease add callbacks for subnet id 0 and 1.
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_EQ(2, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_V4));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_V4));
EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 1, Lease::TYPE_V4));
// This call should trigger the lease add callback for subnet id 0 only. That's
// because we have no callback for the subnet id 3.
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(3, "192.0.2.1"), false));
EXPECT_EQ(3, logs_.size());
- EXPECT_EQ(2, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_V4));
+ EXPECT_EQ(2, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_V4));
}
/// Test that registering the callbacks of the same type, for the same subnet id by the
ConcreteLeaseMgr mgr(pmap);
// Add the callback for lease add and subnet id 0.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
// Another attempt should fail.
- EXPECT_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ EXPECT_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)),
InvalidOperation);
// It should succeed for a different owner.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "qlf", 0,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "qlf",
+ SUBNET_ID_GLOBAL,
Lease::TYPE_NA,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
// It should also succeed for a different subnet id.
DatabaseConnection::ParameterMap pmap;
ConcreteLeaseMgr mgr(pmap);
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_NA,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_NA,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_PD,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_PD,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_EQ(1, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_V4));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_V4));
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(1, Lease::TYPE_NA, "2001:db8:1::1"), false));
EXPECT_EQ(2, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_NA));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_NA));
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(1, Lease::TYPE_PD, "3000::"), false));
EXPECT_EQ(3, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_PD));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_PD));
}
/// Test invoking the registered lease update callbacks.
DatabaseConnection::ParameterMap pmap;
ConcreteLeaseMgr mgr(pmap);
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL,
Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_DELETE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
EXPECT_NO_THROW(mgr.trackUpdateLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_EQ(1, logs_.size());
DatabaseConnection::ParameterMap pmap;
ConcreteLeaseMgr mgr(pmap);
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_DELETE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_DELETE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
EXPECT_NO_THROW(mgr.trackDeleteLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_EQ(1, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_DELETE_LEASE, 0, Lease::TYPE_V4));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_DELETE_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_V4));
}
// Test unregistering the callbacks by subnet id.
ConcreteLeaseMgr mgr(pmap);
// Register different callback types for different subnet identifiers.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 1,
Lease::TYPE_V4,
EXPECT_NO_THROW(mgr.trackUpdateLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_NO_THROW(mgr.trackDeleteLease(initializeLease(1, "192.0.2.1"), false));
- // It should only run the callback for the subnet id 0 that is still
+ // It should only run the callback for the global subnet id that is still
// registered.
EXPECT_EQ(1, logs_.size());
- EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, 0, Lease::TYPE_V4));
+ EXPECT_EQ(1, countLogs(TrackingLeaseMgr::TRACK_ADD_LEASE, SUBNET_ID_GLOBAL, Lease::TYPE_V4));
// Unregister this callback.
- EXPECT_NO_THROW(mgr.unregisterCallbacks(SubnetID(0), Lease::TYPE_V4));
+ EXPECT_NO_THROW(mgr.unregisterCallbacks(SUBNET_ID_GLOBAL, Lease::TYPE_V4));
// Make sure it is no longer invoked.
EXPECT_NO_THROW(mgr.trackAddLease(initializeLease(1, "192.0.2.1"), false));
EXPECT_EQ(1, logs_.size());
// Unregistering it again should be no-op.
- EXPECT_NO_THROW(mgr.unregisterCallbacks(SubnetID(0), Lease::TYPE_V4));
+ EXPECT_NO_THROW(mgr.unregisterCallbacks(SUBNET_ID_GLOBAL, Lease::TYPE_V4));
}
/// Test unregistering all callbacks.
ConcreteLeaseMgr mgr(pmap);
// Register some callbacks.
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_UPDATE_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_UPDATE_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
// Make sure they have been registered.
EXPECT_TRUE(mgr.hasCallbacks());
ConcreteLeaseMgr mgr(pmap);
EXPECT_FALSE(mgr.hasCallbacks());
- EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq", 0,
- Lease::TYPE_V4,
+ EXPECT_NO_THROW(mgr.registerCallback(TrackingLeaseMgr::TRACK_ADD_LEASE, "flq",
+ SUBNET_ID_GLOBAL, Lease::TYPE_V4,
std::bind(&TrackingLeaseMgrTest::logCallback,
this,
TrackingLeaseMgr::TRACK_ADD_LEASE,
- 0,
+ SUBNET_ID_GLOBAL,
ph::_1, ph::_2)));
EXPECT_TRUE(mgr.hasCallbacks());
}
std::string owner,
Lease::Type lease_type,
TrackingLeaseMgr::CallbackFn callback_fn) {
- registerCallback(type, owner, 0, lease_type, callback_fn);
+ registerCallback(type, owner, SUBNET_ID_GLOBAL, lease_type, callback_fn);
}
void
void
TrackingLeaseMgr::runCallbacks(TrackingLeaseMgr::CallbackType type, const LeasePtr& lease,
bool mt_safe) {
- runCallbacksForSubnetID(type, 0, lease, mt_safe);
+ runCallbacksForSubnetID(type, SUBNET_ID_GLOBAL, lease, mt_safe);
runCallbacksForSubnetID(type, lease->subnet_id_, lease, mt_safe);
}
/// @param type callback type.
/// @param owner callback owner identifier.
/// @param subnet_id subnet identifier; it can be set to 0 if the callback should be
- /// called for subnets.
+ /// called for all subnets.
/// @param lease_type a lease type.
/// @param callback_fn callback function instance.
/// @throw InvalidOperation when the callback has been already registered for the given owner and