2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 22:45:18 +00:00

[3146] getLease6() renamed to getLeases6()

This commit is contained in:
Tomek Mrugalski
2013-09-06 19:30:35 +02:00
parent abd29c04e2
commit 0b0bb4a278
7 changed files with 22 additions and 20 deletions

View File

@@ -552,7 +552,7 @@ public:
/// @param iaid IA identifier /// @param iaid IA identifier
/// ///
/// @return Lease collection (may be empty if no lease is found) /// @return Lease collection (may be empty if no lease is found)
virtual Lease6Collection getLease6(Lease6::LeaseType type, const DUID& duid, virtual Lease6Collection getLeases6(Lease6::LeaseType type, const DUID& duid,
uint32_t iaid) const = 0; uint32_t iaid) const = 0;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination /// @brief Returns existing IPv6 lease for a given DUID+IA combination

View File

@@ -200,11 +200,13 @@ Memfile_LeaseMgr::getLease6(Lease6::LeaseType /* not used yet */,
} }
Lease6Collection Lease6Collection
Memfile_LeaseMgr::getLease6(Lease6::LeaseType /* not used yet */, Memfile_LeaseMgr::getLeases6(Lease6::LeaseType /* not used yet */,
const DUID& duid, uint32_t iaid) const { const DUID& duid, uint32_t iaid) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_MEMFILE_GET_IAID_DUID).arg(iaid).arg(duid.toText()); DHCPSRV_MEMFILE_GET_IAID_DUID).arg(iaid).arg(duid.toText());
/// @todo Not implemented.
return (Lease6Collection()); return (Lease6Collection());
} }

View File

@@ -156,7 +156,7 @@ public:
/// @param iaid IA identifier /// @param iaid IA identifier
/// ///
/// @return collection of IPv6 leases /// @return collection of IPv6 leases
virtual Lease6Collection getLease6(Lease6::LeaseType type, virtual Lease6Collection getLeases6(Lease6::LeaseType type,
const DUID& duid, uint32_t iaid) const; const DUID& duid, uint32_t iaid) const;
/// @brief Returns existing IPv6 lease for a given DUID/IA/subnet-id tuple /// @brief Returns existing IPv6 lease for a given DUID/IA/subnet-id tuple

View File

@@ -1678,7 +1678,7 @@ MySqlLeaseMgr::getLease6(Lease6::LeaseType /* type - not used yet */,
Lease6Collection Lease6Collection
MySqlLeaseMgr::getLease6(Lease6::LeaseType /* type - not used yet */, MySqlLeaseMgr::getLeases6(Lease6::LeaseType /* type - not used yet */,
const DUID& duid, uint32_t iaid) const { const DUID& duid, uint32_t iaid) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_MYSQL_GET_IAID_DUID).arg(iaid).arg(duid.toText()); DHCPSRV_MYSQL_GET_IAID_DUID).arg(iaid).arg(duid.toText());

View File

@@ -279,7 +279,7 @@ public:
/// programming error. /// programming error.
/// @throw isc::dhcp::DbOperationError An operation on the open database has /// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed. /// failed.
virtual Lease6Collection getLease6(Lease6::LeaseType type, const DUID& duid, virtual Lease6Collection getLeases6(Lease6::LeaseType type, const DUID& duid,
uint32_t iaid) const; uint32_t iaid) const;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination /// @brief Returns existing IPv6 lease for a given DUID+IA combination

View File

@@ -142,7 +142,7 @@ public:
/// @param iaid ignored /// @param iaid ignored
/// ///
/// @return whatever is set in leases6_ field /// @return whatever is set in leases6_ field
virtual Lease6Collection getLease6(Lease6::LeaseType /* not used yet */, virtual Lease6Collection getLeases6(Lease6::LeaseType /* not used yet */,
const DUID&, uint32_t) const { const DUID&, uint32_t) const {
return (leases6_); return (leases6_);
} }

View File

@@ -835,7 +835,7 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
} }
// Get the leases matching the DUID and IAID of lease[1]. // Get the leases matching the DUID and IAID of lease[1].
Lease6Collection returned = lmptr_->getLease6(leasetype6_[1], Lease6Collection returned = lmptr_->getLeases6(leasetype6_[1],
*leases[1]->duid_, *leases[1]->duid_,
leases[1]->iaid_); leases[1]->iaid_);
@@ -855,7 +855,7 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
// Check that nothing is returned when either the IAID or DUID match // Check that nothing is returned when either the IAID or DUID match
// nothing. // nothing.
returned = lmptr_->getLease6(leasetype6_[1], *leases[1]->duid_, returned = lmptr_->getLeases6(leasetype6_[1], *leases[1]->duid_,
leases[1]->iaid_ + 1); leases[1]->iaid_ + 1);
EXPECT_EQ(0, returned.size()); EXPECT_EQ(0, returned.size());
@@ -863,7 +863,7 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
vector<uint8_t> duid_vector = leases[1]->duid_->getDuid(); vector<uint8_t> duid_vector = leases[1]->duid_->getDuid();
++duid_vector[0]; ++duid_vector[0];
DUID new_duid(duid_vector); 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()); EXPECT_EQ(0, returned.size());
} }
@@ -887,7 +887,7 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaidSize) {
vector<uint8_t> duid_vec(i, i); vector<uint8_t> duid_vec(i, i);
leases[1]->duid_.reset(new DUID(duid_vec)); leases[1]->duid_.reset(new DUID(duid_vec));
EXPECT_TRUE(lmptr_->addLease(leases[1])); EXPECT_TRUE(lmptr_->addLease(leases[1]));
Lease6Collection returned = lmptr_->getLease6(leasetype6_[1], Lease6Collection returned = lmptr_->getLeases6(leasetype6_[1],
*leases[1]->duid_, *leases[1]->duid_,
leases[1]->iaid_); leases[1]->iaid_);
ASSERT_EQ(1, returned.size()); ASSERT_EQ(1, returned.size());