Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
0b0bb4a2
Commit
0b0bb4a2
authored
Sep 06, 2013
by
Tomek Mrugalski
🛰
Browse files
[3146] getLease6() renamed to getLeases6()
parent
abd29c04
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/lease_mgr.h
View file @
0b0bb4a2
...
...
@@ -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
getLease
s
6
(
Lease6
::
LeaseType
type
,
const
DUID
&
duid
,
uint32_t
iaid
)
const
=
0
;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
///
...
...
src/lib/dhcpsrv/memfile_lease_mgr.cc
View file @
0b0bb4a2
...
...
@@ -200,11 +200,13 @@ Memfile_LeaseMgr::getLease6(Lease6::LeaseType /* not used yet */,
}
Lease6Collection
Memfile_LeaseMgr
::
getLease6
(
Lease6
::
LeaseType
/* not used yet */
,
Memfile_LeaseMgr
::
getLease
s
6
(
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
());
}
...
...
src/lib/dhcpsrv/memfile_lease_mgr.h
View file @
0b0bb4a2
...
...
@@ -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
getLease
s
6
(
Lease6
::
LeaseType
type
,
const
DUID
&
duid
,
uint32_t
iaid
)
const
;
/// @brief Returns existing IPv6 lease for a given DUID/IA/subnet-id tuple
///
...
...
src/lib/dhcpsrv/mysql_lease_mgr.cc
View file @
0b0bb4a2
...
...
@@ -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
::
getLease
s
6
(
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
());
...
...
src/lib/dhcpsrv/mysql_lease_mgr.h
View file @
0b0bb4a2
...
...
@@ -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
getLease
s
6
(
Lease6
::
LeaseType
type
,
const
DUID
&
duid
,
uint32_t
iaid
)
const
;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
///
...
...
src/lib/dhcpsrv/tests/lease_mgr_unittest.cc
View file @
0b0bb4a2
...
...
@@ -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
getLease
s
6
(
Lease6
::
LeaseType
/* not used yet */
,
const
DUID
&
,
uint32_t
)
const
{
return
(
leases6_
);
}
...
...
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
View file @
0b0bb4a2
...
...
@@ -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_
->
getLease
s
6
(
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_
->
getLease
s
6
(
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_
->
getLease
s
6
(
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_
->
getLease
s
6
(
leasetype6_
[
1
],
*
leases
[
1
]
->
duid_
,
leases
[
1
]
->
iaid_
);
ASSERT_EQ
(
1
,
returned
.
size
());
detailCompareLease
(
leases
[
1
],
*
returned
.
begin
());
(
void
)
lmptr_
->
deleteLease
(
leases
[
1
]
->
addr_
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment