mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
[3146] getLease6() renamed to getLeases6()
This commit is contained in:
@@ -552,8 +552,8 @@ public:
|
||||
/// @param iaid IA identifier
|
||||
///
|
||||
/// @return Lease collection (may be empty if no lease is found)
|
||||
virtual Lease6Collection getLease6(Lease6::LeaseType type, const DUID& duid,
|
||||
uint32_t iaid) const = 0;
|
||||
virtual Lease6Collection getLeases6(Lease6::LeaseType type, const DUID& duid,
|
||||
uint32_t iaid) const = 0;
|
||||
|
||||
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
|
||||
///
|
||||
|
@@ -200,11 +200,13 @@ Memfile_LeaseMgr::getLease6(Lease6::LeaseType /* not used yet */,
|
||||
}
|
||||
|
||||
Lease6Collection
|
||||
Memfile_LeaseMgr::getLease6(Lease6::LeaseType /* not used yet */,
|
||||
Memfile_LeaseMgr::getLeases6(Lease6::LeaseType /* not used yet */,
|
||||
const DUID& duid, uint32_t iaid) const {
|
||||
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
|
||||
DHCPSRV_MEMFILE_GET_IAID_DUID).arg(iaid).arg(duid.toText());
|
||||
|
||||
/// @todo Not implemented.
|
||||
|
||||
return (Lease6Collection());
|
||||
}
|
||||
|
||||
|
@@ -156,8 +156,8 @@ public:
|
||||
/// @param iaid IA identifier
|
||||
///
|
||||
/// @return collection of IPv6 leases
|
||||
virtual Lease6Collection getLease6(Lease6::LeaseType type,
|
||||
const DUID& duid, uint32_t iaid) const;
|
||||
virtual Lease6Collection getLeases6(Lease6::LeaseType type,
|
||||
const DUID& duid, uint32_t iaid) const;
|
||||
|
||||
/// @brief Returns existing IPv6 lease for a given DUID/IA/subnet-id tuple
|
||||
///
|
||||
|
@@ -1678,8 +1678,8 @@ MySqlLeaseMgr::getLease6(Lease6::LeaseType /* type - not used yet */,
|
||||
|
||||
|
||||
Lease6Collection
|
||||
MySqlLeaseMgr::getLease6(Lease6::LeaseType /* type - not used yet */,
|
||||
const DUID& duid, uint32_t iaid) const {
|
||||
MySqlLeaseMgr::getLeases6(Lease6::LeaseType /* type - not used yet */,
|
||||
const DUID& duid, uint32_t iaid) const {
|
||||
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
|
||||
DHCPSRV_MYSQL_GET_IAID_DUID).arg(iaid).arg(duid.toText());
|
||||
|
||||
|
@@ -279,8 +279,8 @@ public:
|
||||
/// programming error.
|
||||
/// @throw isc::dhcp::DbOperationError An operation on the open database has
|
||||
/// failed.
|
||||
virtual Lease6Collection getLease6(Lease6::LeaseType type, const DUID& duid,
|
||||
uint32_t iaid) const;
|
||||
virtual Lease6Collection getLeases6(Lease6::LeaseType type, const DUID& duid,
|
||||
uint32_t iaid) const;
|
||||
|
||||
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
|
||||
///
|
||||
|
@@ -142,8 +142,8 @@ public:
|
||||
/// @param iaid ignored
|
||||
///
|
||||
/// @return whatever is set in leases6_ field
|
||||
virtual Lease6Collection getLease6(Lease6::LeaseType /* not used yet */,
|
||||
const DUID&, uint32_t) const {
|
||||
virtual Lease6Collection getLeases6(Lease6::LeaseType /* not used yet */,
|
||||
const DUID&, uint32_t) const {
|
||||
return (leases6_);
|
||||
}
|
||||
|
||||
|
@@ -835,9 +835,9 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
|
||||
}
|
||||
|
||||
// Get the leases matching the DUID and IAID of lease[1].
|
||||
Lease6Collection returned = lmptr_->getLease6(leasetype6_[1],
|
||||
*leases[1]->duid_,
|
||||
leases[1]->iaid_);
|
||||
Lease6Collection returned = lmptr_->getLeases6(leasetype6_[1],
|
||||
*leases[1]->duid_,
|
||||
leases[1]->iaid_);
|
||||
|
||||
// Should be three leases, matching leases[1], [4] and [5].
|
||||
ASSERT_EQ(3, returned.size());
|
||||
@@ -855,15 +855,15 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
|
||||
|
||||
// Check that nothing is returned when either the IAID or DUID match
|
||||
// nothing.
|
||||
returned = lmptr_->getLease6(leasetype6_[1], *leases[1]->duid_,
|
||||
leases[1]->iaid_ + 1);
|
||||
returned = lmptr_->getLeases6(leasetype6_[1], *leases[1]->duid_,
|
||||
leases[1]->iaid_ + 1);
|
||||
EXPECT_EQ(0, returned.size());
|
||||
|
||||
// Alter the leases[1] DUID to match nothing in the database.
|
||||
vector<uint8_t> duid_vector = leases[1]->duid_->getDuid();
|
||||
++duid_vector[0];
|
||||
DUID new_duid(duid_vector);
|
||||
returned = lmptr_->getLease6(leasetype6_[1], new_duid, leases[1]->iaid_);
|
||||
returned = lmptr_->getLeases6(leasetype6_[1], new_duid, leases[1]->iaid_);
|
||||
EXPECT_EQ(0, returned.size());
|
||||
}
|
||||
|
||||
@@ -887,9 +887,9 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaidSize) {
|
||||
vector<uint8_t> duid_vec(i, i);
|
||||
leases[1]->duid_.reset(new DUID(duid_vec));
|
||||
EXPECT_TRUE(lmptr_->addLease(leases[1]));
|
||||
Lease6Collection returned = lmptr_->getLease6(leasetype6_[1],
|
||||
*leases[1]->duid_,
|
||||
leases[1]->iaid_);
|
||||
Lease6Collection returned = lmptr_->getLeases6(leasetype6_[1],
|
||||
*leases[1]->duid_,
|
||||
leases[1]->iaid_);
|
||||
ASSERT_EQ(1, returned.size());
|
||||
detailCompareLease(leases[1], *returned.begin());
|
||||
(void) lmptr_->deleteLease(leases[1]->addr_);
|
||||
|
Reference in New Issue
Block a user