mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 13:07:50 +00:00
[#2630] Removed link-addr from relay
This commit is contained in:
parent
eb58fd1efa
commit
4db17a95e5
@ -339,13 +339,13 @@ const char* values[] = {
|
|||||||
"DHCPSRV_MEMFILE_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
|
"DHCPSRV_MEMFILE_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
|
||||||
"DHCPSRV_MEMFILE_GET_IAID_DUID", "obtaining IPv6 leases for IAID %1 and DUID %2 and lease type %3",
|
"DHCPSRV_MEMFILE_GET_IAID_DUID", "obtaining IPv6 leases for IAID %1 and DUID %2 and lease type %3",
|
||||||
"DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3 and lease type %4",
|
"DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3 and lease type %4",
|
||||||
"DHCPSRV_MEMFILE_GET_LINKADDR6", "obtaining at most %1 IPv6 leases starting from address %2 with link address %3",
|
"DHCPSRV_MEMFILE_GET_LINKADDR6", "obtaining at most %1 IPv6 leases starting from address %2 with link %3/%4",
|
||||||
"DHCPSRV_MEMFILE_GET_PAGE4", "obtaining at most %1 IPv4 leases starting from address %2",
|
"DHCPSRV_MEMFILE_GET_PAGE4", "obtaining at most %1 IPv4 leases starting from address %2",
|
||||||
"DHCPSRV_MEMFILE_GET_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2",
|
"DHCPSRV_MEMFILE_GET_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2",
|
||||||
"DHCPSRV_MEMFILE_GET_RELAYID4", "obtaining at most %1 IPv4 leases starting from address %2 with relay id %3 and cltt between %4 and %5",
|
"DHCPSRV_MEMFILE_GET_RELAYID4", "obtaining at most %1 IPv4 leases starting from address %2 with relay id %3 and cltt between %4 and %5",
|
||||||
"DHCPSRV_MEMFILE_GET_RELAYID6", "obtaining at most %1 IPv6 leases starting from address %2 with relay id %3 and link address %4",
|
"DHCPSRV_MEMFILE_GET_RELAYID6", "obtaining at most %1 IPv6 leases starting from address %2 with relay id %3 and link %4/%5",
|
||||||
"DHCPSRV_MEMFILE_GET_REMOTEID4", "obtaining at most %1 IPv4 leases starting from address %2 with remote id %3 and cltt between %4 and %5",
|
"DHCPSRV_MEMFILE_GET_REMOTEID4", "obtaining at most %1 IPv4 leases starting from address %2 with remote id %3 and cltt between %4 and %5",
|
||||||
"DHCPSRV_MEMFILE_GET_REMOTEID6", "obtaining at most %1 IPv6 leases starting from address %2 with remote id %3 and link address %4",
|
"DHCPSRV_MEMFILE_GET_REMOTEID6", "obtaining at most %1 IPv6 leases starting from address %2 with remote id %3 and link %4/%5",
|
||||||
"DHCPSRV_MEMFILE_GET_SUBID4", "obtaining IPv4 leases for subnet ID %1",
|
"DHCPSRV_MEMFILE_GET_SUBID4", "obtaining IPv4 leases for subnet ID %1",
|
||||||
"DHCPSRV_MEMFILE_GET_SUBID6", "obtaining IPv6 leases for subnet ID %1",
|
"DHCPSRV_MEMFILE_GET_SUBID6", "obtaining IPv6 leases for subnet ID %1",
|
||||||
"DHCPSRV_MEMFILE_GET_SUBID_CLIENTID", "obtaining IPv4 lease for subnet ID %1 and client ID %2",
|
"DHCPSRV_MEMFILE_GET_SUBID_CLIENTID", "obtaining IPv4 lease for subnet ID %1 and client ID %2",
|
||||||
|
@ -489,9 +489,9 @@ A debug message issued when the server is attempting to obtain an IPv6
|
|||||||
lease from the memory file database for a client with the specified IAID
|
lease from the memory file database for a client with the specified IAID
|
||||||
(Identity Association ID), Subnet ID and DUID (DHCP Unique Identifier).
|
(Identity Association ID), Subnet ID and DUID (DHCP Unique Identifier).
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_LINKADDR6 obtaining at most %1 IPv6 leases starting from address %2 with link address %3
|
% DHCPSRV_MEMFILE_GET_LINKADDR6 obtaining at most %1 IPv6 leases starting from address %2 with link %3/%4
|
||||||
A debug message issued when the server is attempting to obtain a page of
|
A debug message issued when the server is attempting to obtain a page of
|
||||||
IPv6 leases beginning with the specified address with a link address.
|
IPv6 leases beginning with the specified address within a link.
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_PAGE4 obtaining at most %1 IPv4 leases starting from address %2
|
% DHCPSRV_MEMFILE_GET_PAGE4 obtaining at most %1 IPv4 leases starting from address %2
|
||||||
A debug message issued when the server is attempting to obtain a page
|
A debug message issued when the server is attempting to obtain a page
|
||||||
@ -506,20 +506,18 @@ A debug message issued when the server is attempting to obtain a page of
|
|||||||
IPv4 leases beginning with the specified address with a relay id and client
|
IPv4 leases beginning with the specified address with a relay id and client
|
||||||
transaction time between start and end dates.
|
transaction time between start and end dates.
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_RELAYID6 obtaining at most %1 IPv6 leases starting from address %2 with relay id %3 and link address %4
|
% DHCPSRV_MEMFILE_GET_RELAYID6 obtaining at most %1 IPv6 leases starting from address %2 with relay id %3 and link %4/%5
|
||||||
A debug message issued when the server is attempting to obtain a page of
|
A debug message issued when the server is attempting to obtain a page of
|
||||||
IPv6 leases beginning with the specified address with a relay id and
|
IPv6 leases beginning with the specified address with a relay id and a link.
|
||||||
a link address.
|
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_REMOTEID4 obtaining at most %1 IPv4 leases starting from address %2 with remote id %3 and cltt between %4 and %5
|
% DHCPSRV_MEMFILE_GET_REMOTEID4 obtaining at most %1 IPv4 leases starting from address %2 with remote id %3 and cltt between %4 and %5
|
||||||
A debug message issued when the server is attempting to obtain a page of
|
A debug message issued when the server is attempting to obtain a page of
|
||||||
IPv4 leases beginning with the specified address with a remote id and
|
IPv4 leases beginning with the specified address with a remote id and
|
||||||
client transaction time between start and end dates.
|
client transaction time between start and end dates.
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_REMOTEID6 obtaining at most %1 IPv6 leases starting from address %2 with remote id %3 and link address %4
|
% DHCPSRV_MEMFILE_GET_REMOTEID6 obtaining at most %1 IPv6 leases starting from address %2 with remote id %3 and link %4/%5
|
||||||
A debug message issued when the server is attempting to obtain a page of
|
A debug message issued when the server is attempting to obtain a page of
|
||||||
IPv6 leases beginning with the specified address with a remote id and
|
IPv6 leases beginning with the specified address with a remote id and a link.
|
||||||
a link address.
|
|
||||||
|
|
||||||
% DHCPSRV_MEMFILE_GET_SUBID4 obtaining IPv4 leases for subnet ID %1
|
% DHCPSRV_MEMFILE_GET_SUBID4 obtaining IPv4 leases for subnet ID %1
|
||||||
A debug message issued when the server is attempting to obtain all IPv4
|
A debug message issued when the server is attempting to obtain all IPv4
|
||||||
|
@ -895,8 +895,9 @@ public:
|
|||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given relay-id.
|
/// @brief Returns existing IPv6 leases with a given relay-id.
|
||||||
///
|
///
|
||||||
/// @param relay_id DUID for relay_id of interest
|
/// @param relay_id DUID for relay_id of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -905,13 +906,15 @@ public:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRelayId(const DUID& relay_id,
|
getLeases6ByRelayId(const DUID& relay_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) = 0;
|
const LeasePageSize& page_size) = 0;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given remote-id.
|
/// @brief Returns existing IPv6 leases with a given remote-id.
|
||||||
///
|
///
|
||||||
/// @param remote_id remote-id option data of interest
|
/// @param remote_id remote-id option data of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -920,12 +923,14 @@ public:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) = 0;
|
const LeasePageSize& page_size) = 0;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with on a given link.
|
/// @brief Returns existing IPv6 leases with on a given link.
|
||||||
///
|
///
|
||||||
/// @param link_addr limit results to leases on this link.
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -933,6 +938,7 @@ public:
|
|||||||
/// @return collection of IPv6 leases
|
/// @return collection of IPv6 leases
|
||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) = 0;
|
const LeasePageSize& page_size) = 0;
|
||||||
|
|
||||||
@ -986,28 +992,17 @@ protected:
|
|||||||
/// @brief Add lease6 extended info into by-relay-id table.
|
/// @brief Add lease6 extended info into by-relay-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the relay header.
|
|
||||||
/// @param relay_id The relay id from the relay header options.
|
/// @param relay_id The relay id from the relay header options.
|
||||||
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& relay_id) = 0;
|
const std::vector<uint8_t>& relay_id) = 0;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-remote-id table.
|
/// @brief Add lease6 extended info into by-remote-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
/// @param remote_id The remote id from the relay header options.
|
/// @param remote_id The remote id from the relay header options.
|
||||||
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& remote_id) = 0;
|
const std::vector<uint8_t>& remote_id) = 0;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-link-addr table.
|
|
||||||
///
|
|
||||||
/// @param lease_addr The address of the lease.
|
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
virtual void addLinkAddr6(const isc::asiolink::IOAddress& lease_addr,
|
|
||||||
const isc::asiolink::IOAddress& link_addr) = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// The IOService object, used for all ASIO operations.
|
/// The IOService object, used for all ASIO operations.
|
||||||
static isc::asiolink::IOServicePtr io_service_;
|
static isc::asiolink::IOServicePtr io_service_;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <asiolink/addr_utilities.h>
|
||||||
#include <database/database_connection.h>
|
#include <database/database_connection.h>
|
||||||
#include <dhcpsrv/cfgmgr.h>
|
#include <dhcpsrv/cfgmgr.h>
|
||||||
#include <dhcpsrv/dhcpsrv_exceptions.h>
|
#include <dhcpsrv/dhcpsrv_exceptions.h>
|
||||||
@ -2510,14 +2511,19 @@ Memfile_LeaseMgr::getLeases4ByRemoteIdInternal(const OptionBuffer&,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByRelayId(const DUID& relay_id,
|
Memfile_LeaseMgr::getLeases6ByRelayId(const DUID& relay_id,
|
||||||
const IOAddress& link_addr,
|
const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
// Expecting IPv6 addresses.
|
// Expecting IPv6 valid prefix and address.
|
||||||
if (!link_addr.isV6()) {
|
if (!link_addr.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
<< link_addr);
|
<< link_addr);
|
||||||
}
|
}
|
||||||
|
if (link_len > 128) {
|
||||||
|
isc_throw(OutOfRange, "invalid IPv6 prefix length "
|
||||||
|
<< static_cast<unsigned>(link_len));
|
||||||
|
}
|
||||||
if (!lower_bound_address.isV6()) {
|
if (!lower_bound_address.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
@ -2529,17 +2535,20 @@ Memfile_LeaseMgr::getLeases6ByRelayId(const DUID& relay_id,
|
|||||||
.arg(page_size.page_size_)
|
.arg(page_size.page_size_)
|
||||||
.arg(lower_bound_address.toText())
|
.arg(lower_bound_address.toText())
|
||||||
.arg(relay_id.toText())
|
.arg(relay_id.toText())
|
||||||
.arg(link_addr.toText());
|
.arg(link_addr.toText())
|
||||||
|
.arg(static_cast<unsigned>(link_len));
|
||||||
|
|
||||||
if (MultiThreadingMgr::instance().getMode()) {
|
if (MultiThreadingMgr::instance().getMode()) {
|
||||||
std::lock_guard<std::mutex> lock(*mutex_);
|
std::lock_guard<std::mutex> lock(*mutex_);
|
||||||
return (getLeases6ByRelayIdInternal(relay_id,
|
return (getLeases6ByRelayIdInternal(relay_id,
|
||||||
link_addr,
|
link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
} else {
|
} else {
|
||||||
return (getLeases6ByRelayIdInternal(relay_id,
|
return (getLeases6ByRelayIdInternal(relay_id,
|
||||||
link_addr,
|
link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
}
|
}
|
||||||
@ -2548,12 +2557,13 @@ Memfile_LeaseMgr::getLeases6ByRelayId(const DUID& relay_id,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByRelayIdInternal(const DUID& relay_id,
|
Memfile_LeaseMgr::getLeases6ByRelayIdInternal(const DUID& relay_id,
|
||||||
const IOAddress& link_addr,
|
const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
const std::vector<uint8_t>& relay_id_data = relay_id.getDuid();
|
const std::vector<uint8_t>& relay_id_data = relay_id.getDuid();
|
||||||
Lease6Collection collection;
|
Lease6Collection collection;
|
||||||
if (link_addr.isV6Zero()) {
|
const RelayIdIndex& idx = relay_id6_.get<RelayIdIndexTag>();
|
||||||
const RelayIdIndex& idx = relay_id6_.get<RelayIdIndexTag>();
|
if (!link_len) {
|
||||||
RelayIdIndex::const_iterator lb =
|
RelayIdIndex::const_iterator lb =
|
||||||
idx.lower_bound(boost::make_tuple(relay_id_data,
|
idx.lower_bound(boost::make_tuple(relay_id_data,
|
||||||
lower_bound_address));
|
lower_bound_address));
|
||||||
@ -2579,30 +2589,24 @@ Memfile_LeaseMgr::getLeases6ByRelayIdInternal(const DUID& relay_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const RelayIdLinkAddressIndex& idx =
|
const IOAddress& first_addr = firstAddrInPrefix(link_addr, link_len);
|
||||||
relay_id6_.get<RelayIdLinkAddressIndexTag>();
|
const IOAddress& last_addr = lastAddrInPrefix(link_addr, link_len);
|
||||||
RelayIdLinkAddressIndex::const_iterator lb =
|
const IOAddress& start_addr =
|
||||||
idx.lower_bound(boost::make_tuple(relay_id_data,
|
(lower_bound_address < first_addr ? first_addr : lower_bound_address);
|
||||||
link_addr,
|
RelayIdIndex::const_iterator lb =
|
||||||
lower_bound_address));
|
idx.lower_bound(boost::make_tuple(relay_id_data, start_addr));
|
||||||
|
RelayIdIndex::const_iterator ub =
|
||||||
|
idx.upper_bound(boost::make_tuple(relay_id_data, last_addr));
|
||||||
|
|
||||||
// Return all leases being within the page size.
|
// Return all leases being within the page size.
|
||||||
IOAddress last_addr = lower_bound_address;
|
IOAddress last_seen_addr = lower_bound_address;
|
||||||
for (; lb != idx.end(); ++lb) {
|
for (auto it = lb; it != ub; ++it) {
|
||||||
if ((*lb)->lease_addr_ == last_addr) {
|
if ((*it)->lease_addr_ == last_seen_addr) {
|
||||||
// Already seen: skip it.
|
// Already seen: skip it.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((*lb)->link_addr_ != link_addr) {
|
last_seen_addr = (*it)->lease_addr_;
|
||||||
// Gone after the link address.
|
Lease6Ptr lease = getLease6Internal(Lease::TYPE_NA, last_seen_addr);
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ((*lb)->id_ != relay_id_data) {
|
|
||||||
// Gone after the relay id index.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
last_addr = (*lb)->lease_addr_;
|
|
||||||
Lease6Ptr lease = getLease6Internal(Lease::TYPE_NA, last_addr);
|
|
||||||
if (lease) {
|
if (lease) {
|
||||||
collection.push_back(lease);
|
collection.push_back(lease);
|
||||||
if (collection.size() >= page_size.page_size_) {
|
if (collection.size() >= page_size.page_size_) {
|
||||||
@ -2617,14 +2621,19 @@ Memfile_LeaseMgr::getLeases6ByRelayIdInternal(const DUID& relay_id,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
Memfile_LeaseMgr::getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
||||||
const IOAddress& link_addr,
|
const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
// Expecting IPv6 addresses.
|
// Expecting IPv6 valid prefix and address.
|
||||||
if (!link_addr.isV6()) {
|
if (!link_addr.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
<< link_addr);
|
<< link_addr);
|
||||||
}
|
}
|
||||||
|
if (link_len > 128) {
|
||||||
|
isc_throw(OutOfRange, "invalid IPv6 prefix length "
|
||||||
|
<< static_cast<unsigned>(link_len));
|
||||||
|
}
|
||||||
if (!lower_bound_address.isV6()) {
|
if (!lower_bound_address.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
@ -2636,17 +2645,20 @@ Memfile_LeaseMgr::getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
|||||||
.arg(page_size.page_size_)
|
.arg(page_size.page_size_)
|
||||||
.arg(lower_bound_address.toText())
|
.arg(lower_bound_address.toText())
|
||||||
.arg(idtoText(remote_id))
|
.arg(idtoText(remote_id))
|
||||||
.arg(link_addr.toText());
|
.arg(link_addr.toText())
|
||||||
|
.arg(static_cast<unsigned>(link_len));
|
||||||
|
|
||||||
if (MultiThreadingMgr::instance().getMode()) {
|
if (MultiThreadingMgr::instance().getMode()) {
|
||||||
std::lock_guard<std::mutex> lock(*mutex_);
|
std::lock_guard<std::mutex> lock(*mutex_);
|
||||||
return (getLeases6ByRemoteIdInternal(remote_id,
|
return (getLeases6ByRemoteIdInternal(remote_id,
|
||||||
link_addr,
|
link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
} else {
|
} else {
|
||||||
return (getLeases6ByRemoteIdInternal(remote_id,
|
return (getLeases6ByRemoteIdInternal(remote_id,
|
||||||
link_addr,
|
link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
}
|
}
|
||||||
@ -2655,14 +2667,14 @@ Memfile_LeaseMgr::getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
Memfile_LeaseMgr::getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
||||||
const IOAddress& link_addr,
|
const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
Lease6Collection collection;
|
Lease6Collection collection;
|
||||||
std::set<IOAddress> sorted;
|
std::set<IOAddress> sorted;
|
||||||
if (link_addr.isV6Zero()) {
|
const RemoteIdIndex& idx = remote_id6_.get<RemoteIdIndexTag>();
|
||||||
const RemoteIdIndex& idx = remote_id6_.get<RemoteIdIndexTag>();
|
RemoteIdIndexRange er = idx.equal_range(remote_id);
|
||||||
RemoteIdIndexRange er = idx.equal_range(remote_id);
|
if (!link_len) {
|
||||||
|
|
||||||
// Store all addresses greater than lower_bound_address.
|
// Store all addresses greater than lower_bound_address.
|
||||||
for (auto it = er.first; it != er.second; ++it) {
|
for (auto it = er.first; it != er.second; ++it) {
|
||||||
const IOAddress& addr = (*it)->lease_addr_;
|
const IOAddress& addr = (*it)->lease_addr_;
|
||||||
@ -2683,17 +2695,18 @@ Memfile_LeaseMgr::getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const RemoteIdLinkAddressIndex& idx =
|
const IOAddress& first_addr = firstAddrInPrefix(link_addr, link_len);
|
||||||
remote_id6_.get<RemoteIdLinkAddressIndexTag>();
|
const IOAddress& last_addr = lastAddrInPrefix(link_addr, link_len);
|
||||||
RemoteIdLinkAddressRange er =
|
|
||||||
idx.equal_range(boost::make_tuple(remote_id, link_addr));
|
|
||||||
|
|
||||||
// Store all addresses greater than lower_bound_address.
|
// Store all addresses greater than lower_bound_address in the link.
|
||||||
for (auto it = er.first; it != er.second; ++it) {
|
for (auto it = er.first; it != er.second; ++it) {
|
||||||
const IOAddress& addr = (*it)->lease_addr_;
|
const IOAddress& addr = (*it)->lease_addr_;
|
||||||
if (addr <= lower_bound_address) {
|
if (addr <= lower_bound_address) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((addr < first_addr) || (last_addr < addr)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
static_cast<void>(sorted.insert(addr));
|
static_cast<void>(sorted.insert(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2713,14 +2726,19 @@ Memfile_LeaseMgr::getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
|||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByLink(const IOAddress& link_addr,
|
Memfile_LeaseMgr::getLeases6ByLink(const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
// Expecting IPv6 addresses.
|
// Expecting IPv6 valid prefix and address.
|
||||||
if (!link_addr.isV6()) {
|
if (!link_addr.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
<< link_addr);
|
<< link_addr);
|
||||||
}
|
}
|
||||||
|
if ((link_len == 0) || (link_len > 128)) {
|
||||||
|
isc_throw(OutOfRange, "invalid IPv6 prefix length "
|
||||||
|
<< static_cast<unsigned>(link_len));
|
||||||
|
}
|
||||||
if (!lower_bound_address.isV6()) {
|
if (!lower_bound_address.isV6()) {
|
||||||
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
isc_throw(InvalidAddressFamily, "expected IPv6 address while "
|
||||||
"retrieving leases from the lease database, got "
|
"retrieving leases from the lease database, got "
|
||||||
@ -2731,15 +2749,18 @@ Memfile_LeaseMgr::getLeases6ByLink(const IOAddress& link_addr,
|
|||||||
DHCPSRV_MEMFILE_GET_LINKADDR6)
|
DHCPSRV_MEMFILE_GET_LINKADDR6)
|
||||||
.arg(page_size.page_size_)
|
.arg(page_size.page_size_)
|
||||||
.arg(lower_bound_address.toText())
|
.arg(lower_bound_address.toText())
|
||||||
.arg(link_addr.toText());
|
.arg(link_addr.toText())
|
||||||
|
.arg(static_cast<unsigned>(link_len));
|
||||||
|
|
||||||
if (MultiThreadingMgr::instance().getMode()) {
|
if (MultiThreadingMgr::instance().getMode()) {
|
||||||
std::lock_guard<std::mutex> lock(*mutex_);
|
std::lock_guard<std::mutex> lock(*mutex_);
|
||||||
return (getLeases6ByLinkInternal(link_addr,
|
return (getLeases6ByLinkInternal(link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
} else {
|
} else {
|
||||||
return (getLeases6ByLinkInternal(link_addr,
|
return (getLeases6ByLinkInternal(link_addr,
|
||||||
|
link_len,
|
||||||
lower_bound_address,
|
lower_bound_address,
|
||||||
page_size));
|
page_size));
|
||||||
}
|
}
|
||||||
@ -2747,26 +2768,27 @@ Memfile_LeaseMgr::getLeases6ByLink(const IOAddress& link_addr,
|
|||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
Memfile_LeaseMgr::getLeases6ByLinkInternal(const IOAddress& link_addr,
|
Memfile_LeaseMgr::getLeases6ByLinkInternal(const IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const IOAddress& lower_bound_address,
|
const IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) {
|
const LeasePageSize& page_size) {
|
||||||
|
const IOAddress& first_addr = firstAddrInPrefix(link_addr, link_len);
|
||||||
|
const IOAddress& last_addr = lastAddrInPrefix(link_addr, link_len);
|
||||||
|
const IOAddress& start_addr =
|
||||||
|
(lower_bound_address < first_addr ? first_addr : lower_bound_address);
|
||||||
Lease6Collection collection;
|
Lease6Collection collection;
|
||||||
const LinkAddressIndex& idx = link_addr6_.get<LinkAddressIndexTag>();
|
const Lease6StorageAddressIndex& idx = storage6_.get<AddressIndexTag>();
|
||||||
LinkAddressIndex::const_iterator lb =
|
Lease6StorageAddressIndex::const_iterator lb = idx.lower_bound(start_addr);
|
||||||
idx.lower_bound(boost::make_tuple(link_addr, lower_bound_address));
|
Lease6StorageAddressIndex::const_iterator eb = idx.upper_bound(last_addr);
|
||||||
|
|
||||||
// Return all leases being within the page size.
|
// Return all leases being within the page size.
|
||||||
IOAddress last_addr = lower_bound_address;
|
IOAddress last_seen_addr = lower_bound_address;
|
||||||
for (; lb != idx.end(); ++lb) {
|
for (auto it = lb; it != eb; ++it) {
|
||||||
if ((*lb)->lease_addr_ == last_addr) {
|
if ((*it)->addr_ == last_seen_addr) {
|
||||||
// Already seen: skip it.
|
// Already seen: skip it.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((*lb)->link_addr_ != link_addr) {
|
last_seen_addr = (*it)->addr_;
|
||||||
// Gone after the link address.
|
Lease6Ptr lease = getLease6Internal(Lease::TYPE_NA, last_seen_addr);
|
||||||
break;
|
|
||||||
}
|
|
||||||
last_addr = (*lb)->lease_addr_;
|
|
||||||
Lease6Ptr lease = getLease6Internal(Lease::TYPE_NA, last_addr);
|
|
||||||
if (lease) {
|
if (lease) {
|
||||||
collection.push_back(lease);
|
collection.push_back(lease);
|
||||||
if (collection.size() >= page_size.page_size_) {
|
if (collection.size() >= page_size.page_size_) {
|
||||||
@ -2785,37 +2807,24 @@ Memfile_LeaseMgr::deleteExtendedInfo6(const IOAddress& addr) {
|
|||||||
LeaseAddressRemoteIdIndex& remote_id_idx =
|
LeaseAddressRemoteIdIndex& remote_id_idx =
|
||||||
remote_id6_.get<LeaseAddressIndexTag>();
|
remote_id6_.get<LeaseAddressIndexTag>();
|
||||||
static_cast<void>(remote_id_idx.erase(addr));
|
static_cast<void>(remote_id_idx.erase(addr));
|
||||||
LeaseAddressLinkAddressIndex& link_addr_idx =
|
|
||||||
link_addr6_.get<LeaseAddressIndexTag>();
|
|
||||||
static_cast<void>(link_addr_idx.erase(addr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Memfile_LeaseMgr::addRelayId6(const IOAddress& lease_addr,
|
Memfile_LeaseMgr::addRelayId6(const IOAddress& lease_addr,
|
||||||
const IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& relay_id) {
|
const std::vector<uint8_t>& relay_id) {
|
||||||
Lease6ExtendedInfoPtr ex_info;
|
Lease6ExtendedInfoPtr ex_info;
|
||||||
ex_info.reset(new Lease6ExtendedInfo(lease_addr, link_addr, relay_id));
|
ex_info.reset(new Lease6ExtendedInfo(lease_addr, relay_id));
|
||||||
relay_id6_.insert(ex_info);
|
relay_id6_.insert(ex_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Memfile_LeaseMgr::addRemoteId6(const IOAddress& lease_addr,
|
Memfile_LeaseMgr::addRemoteId6(const IOAddress& lease_addr,
|
||||||
const IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& remote_id) {
|
const std::vector<uint8_t>& remote_id) {
|
||||||
Lease6ExtendedInfoPtr ex_info;
|
Lease6ExtendedInfoPtr ex_info;
|
||||||
ex_info.reset(new Lease6ExtendedInfo(lease_addr, link_addr, remote_id));
|
ex_info.reset(new Lease6ExtendedInfo(lease_addr, remote_id));
|
||||||
remote_id6_.insert(ex_info);
|
remote_id6_.insert(ex_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Memfile_LeaseMgr::addLinkAddr6(const IOAddress& lease_addr,
|
|
||||||
const IOAddress& link_addr) {
|
|
||||||
Lease6SimpleExtendedInfoPtr ex_info;
|
|
||||||
ex_info.reset(new Lease6SimpleExtendedInfo(lease_addr, link_addr));
|
|
||||||
link_addr6_.insert(ex_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Memfile_LeaseMgr::writeLeases4(const std::string& filename) {
|
Memfile_LeaseMgr::writeLeases4(const std::string& filename) {
|
||||||
if (MultiThreadingMgr::instance().getMode()) {
|
if (MultiThreadingMgr::instance().getMode()) {
|
||||||
|
@ -1073,9 +1073,6 @@ protected:
|
|||||||
/// @brief stores IPv6 by-remote-id cross-reference table
|
/// @brief stores IPv6 by-remote-id cross-reference table
|
||||||
Lease6ExtendedInfoRemoteIdTable remote_id6_;
|
Lease6ExtendedInfoRemoteIdTable remote_id6_;
|
||||||
|
|
||||||
/// @brief stores IPv6 by-link-addr cross-reference table
|
|
||||||
Lease6SimpleExtendedInfoLinkAddrTable link_addr6_;
|
|
||||||
|
|
||||||
/// @brief Holds the pointer to the DHCPv4 lease file IO.
|
/// @brief Holds the pointer to the DHCPv4 lease file IO.
|
||||||
boost::shared_ptr<CSVLeaseFile4> lease_file4_;
|
boost::shared_ptr<CSVLeaseFile4> lease_file4_;
|
||||||
|
|
||||||
@ -1326,8 +1323,9 @@ public:
|
|||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given relay-id.
|
/// @brief Returns existing IPv6 leases with a given relay-id.
|
||||||
///
|
///
|
||||||
/// @param relay_id DUID for relay_id of interest
|
/// @param relay_id DUID for relay_id of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1336,13 +1334,15 @@ public:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRelayId(const DUID& relay_id,
|
getLeases6ByRelayId(const DUID& relay_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given remote-id.
|
/// @brief Returns existing IPv6 leases with a given remote-id.
|
||||||
///
|
///
|
||||||
/// @param remote_id remote-id option data of interest
|
/// @param remote_id remote-id option data of interest
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1351,12 +1351,14 @@ public:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with on a given link.
|
/// @brief Returns existing IPv6 leases with on a given link.
|
||||||
///
|
///
|
||||||
/// @param link_addr limit results to leases on this link.
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1364,6 +1366,7 @@ public:
|
|||||||
/// @return collection of IPv6 leases
|
/// @return collection of IPv6 leases
|
||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
@ -1409,8 +1412,9 @@ private:
|
|||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given relay-id.
|
/// @brief Returns existing IPv6 leases with a given relay-id.
|
||||||
///
|
///
|
||||||
/// @param relay_id DUID for relay_id of interest
|
/// @param relay_id DUID for relay_id of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1419,13 +1423,15 @@ private:
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByRelayIdInternal(const DUID& relay_id,
|
getLeases6ByRelayIdInternal(const DUID& relay_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size);
|
const LeasePageSize& page_size);
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given remote-id.
|
/// @brief Returns existing IPv6 leases with a given remote-id.
|
||||||
///
|
///
|
||||||
/// @param remote_id remote-id option data of interest
|
/// @param remote_id remote-id option data of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1434,12 +1440,14 @@ private:
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size);
|
const LeasePageSize& page_size);
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with on a given link.
|
/// @brief Returns existing IPv6 leases with on a given link.
|
||||||
///
|
///
|
||||||
/// @param link_addr limit results to leases on this link.
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1447,6 +1455,7 @@ private:
|
|||||||
/// @return collection of IPv6 leases
|
/// @return collection of IPv6 leases
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByLinkInternal(const asiolink::IOAddress& link_addr,
|
getLeases6ByLinkInternal(const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size);
|
const LeasePageSize& page_size);
|
||||||
|
|
||||||
@ -1474,28 +1483,17 @@ protected:
|
|||||||
/// @brief Add lease6 extended info into by-relay-id table.
|
/// @brief Add lease6 extended info into by-relay-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the relay header.
|
|
||||||
/// @param relay_id The relay id from the relay header options.
|
/// @param relay_id The relay id from the relay header options.
|
||||||
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& relay_id) override;
|
const std::vector<uint8_t>& relay_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-remote-id table.
|
/// @brief Add lease6 extended info into by-remote-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
/// @param remote_id The remote id from the relay header options.
|
/// @param remote_id The remote id from the relay header options.
|
||||||
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& remote_id) override;
|
const std::vector<uint8_t>& remote_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-link-addr table.
|
|
||||||
///
|
|
||||||
/// @param lease_addr The address of the lease.
|
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
virtual void addLinkAddr6(const isc::asiolink::IOAddress& lease_addr,
|
|
||||||
const isc::asiolink::IOAddress& link_addr) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// @brief Write V4 leases to a file.
|
/// @brief Write V4 leases to a file.
|
||||||
///
|
///
|
||||||
|
@ -292,20 +292,15 @@ public:
|
|||||||
/// @brief Constructor.
|
/// @brief Constructor.
|
||||||
///
|
///
|
||||||
/// @param lease_addr Lease address.
|
/// @param lease_addr Lease address.
|
||||||
/// @param link_addr Link address.
|
|
||||||
/// @param id Identifier.
|
/// @param id Identifier.
|
||||||
Lease6ExtendedInfo(const isc::asiolink::IOAddress& lease_addr,
|
Lease6ExtendedInfo(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& id)
|
const std::vector<uint8_t>& id)
|
||||||
: lease_addr_(lease_addr), link_addr_(link_addr), id_(id) {
|
: lease_addr_(lease_addr), id_(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Lease address.
|
/// @brief Lease address.
|
||||||
isc::asiolink::IOAddress lease_addr_;
|
isc::asiolink::IOAddress lease_addr_;
|
||||||
|
|
||||||
/// @brief Link address.
|
|
||||||
isc::asiolink::IOAddress link_addr_;
|
|
||||||
|
|
||||||
/// @brief Remote or relay opaque identifier.
|
/// @brief Remote or relay opaque identifier.
|
||||||
std::vector<uint8_t> id_;
|
std::vector<uint8_t> id_;
|
||||||
};
|
};
|
||||||
@ -316,23 +311,15 @@ typedef boost::shared_ptr<Lease6ExtendedInfo> Lease6ExtendedInfoPtr;
|
|||||||
/// @brief Tag for indexes by lease address.
|
/// @brief Tag for indexes by lease address.
|
||||||
struct LeaseAddressIndexTag { };
|
struct LeaseAddressIndexTag { };
|
||||||
|
|
||||||
/// @brief Tag for indexes by relay id and link address.
|
|
||||||
struct RelayIdLinkAddressIndexTag { };
|
|
||||||
|
|
||||||
/// @brief Tag for index using relay id.
|
/// @brief Tag for index using relay id.
|
||||||
struct RelayIdIndexTag { };
|
struct RelayIdIndexTag { };
|
||||||
|
|
||||||
/// @brief Tag for indexes by remote id and link address.
|
|
||||||
struct RemoteIdLinkAddressIndexTag { };
|
|
||||||
|
|
||||||
/// @brief Tag for index using remote id.
|
/// @brief Tag for index using remote id.
|
||||||
struct RemoteIdIndexTag { };
|
struct RemoteIdIndexTag { };
|
||||||
|
|
||||||
/// @brief A multi index container holding lease6 extended info for by relay id.
|
/// @brief A multi index container holding lease6 extended info for by relay id.
|
||||||
///
|
///
|
||||||
/// The lease6 extended info may be accessed using different indexes:
|
/// The lease6 extended info may be accessed using different indexes:
|
||||||
/// - using a composite index: relay id and link address, and lease address
|
|
||||||
/// for getting lower bounds.
|
|
||||||
/// - using relay id, and lease address for getting lower bounds.
|
/// - using relay id, and lease address for getting lower bounds.
|
||||||
/// - using lease address for deletes.
|
/// - using lease address for deletes.
|
||||||
///
|
///
|
||||||
@ -346,24 +333,7 @@ typedef boost::multi_index_container<
|
|||||||
// It holds pointers to lease6 extended info.
|
// It holds pointers to lease6 extended info.
|
||||||
Lease6ExtendedInfoPtr,
|
Lease6ExtendedInfoPtr,
|
||||||
boost::multi_index::indexed_by<
|
boost::multi_index::indexed_by<
|
||||||
// First index is by relay id, link and lease addresses.
|
// First index is by relay id and lease address.
|
||||||
boost::multi_index::ordered_non_unique<
|
|
||||||
boost::multi_index::tag<RelayIdLinkAddressIndexTag>,
|
|
||||||
boost::multi_index::composite_key<
|
|
||||||
Lease6ExtendedInfo,
|
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
|
||||||
std::vector<uint8_t>,
|
|
||||||
&Lease6ExtendedInfo::id_>,
|
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6ExtendedInfo::link_addr_>,
|
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6ExtendedInfo::lease_addr_>
|
|
||||||
>
|
|
||||||
>,
|
|
||||||
|
|
||||||
// Second index is by relay id and lease address.
|
|
||||||
boost::multi_index::ordered_non_unique<
|
boost::multi_index::ordered_non_unique<
|
||||||
boost::multi_index::tag<RelayIdIndexTag>,
|
boost::multi_index::tag<RelayIdIndexTag>,
|
||||||
boost::multi_index::composite_key<
|
boost::multi_index::composite_key<
|
||||||
@ -390,7 +360,6 @@ typedef boost::multi_index_container<
|
|||||||
/// @brief A multi index container holding lease6 extended info for by remote id.
|
/// @brief A multi index container holding lease6 extended info for by remote id.
|
||||||
///
|
///
|
||||||
/// The lease6 extended info may be accessed using different indexes:
|
/// The lease6 extended info may be accessed using different indexes:
|
||||||
/// - using a composite index: remote id and link address.
|
|
||||||
/// - using remote id.
|
/// - using remote id.
|
||||||
/// - using lease address for deletes.
|
/// - using lease address for deletes.
|
||||||
///
|
///
|
||||||
@ -405,21 +374,7 @@ typedef boost::multi_index_container<
|
|||||||
// It holds pointers to lease6 extended info.
|
// It holds pointers to lease6 extended info.
|
||||||
Lease6ExtendedInfoPtr,
|
Lease6ExtendedInfoPtr,
|
||||||
boost::multi_index::indexed_by<
|
boost::multi_index::indexed_by<
|
||||||
// First index is by remote id and link address.
|
// First index is by remote id.
|
||||||
boost::multi_index::hashed_non_unique<
|
|
||||||
boost::multi_index::tag<RemoteIdLinkAddressIndexTag>,
|
|
||||||
boost::multi_index::composite_key<
|
|
||||||
Lease6ExtendedInfo,
|
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
|
||||||
std::vector<uint8_t>,
|
|
||||||
&Lease6ExtendedInfo::id_>,
|
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6ExtendedInfo::link_addr_>
|
|
||||||
>
|
|
||||||
>,
|
|
||||||
|
|
||||||
// Second index is by remote id.
|
|
||||||
boost::multi_index::hashed_non_unique<
|
boost::multi_index::hashed_non_unique<
|
||||||
boost::multi_index::tag<RemoteIdIndexTag>,
|
boost::multi_index::tag<RemoteIdIndexTag>,
|
||||||
boost::multi_index::member<Lease6ExtendedInfo,
|
boost::multi_index::member<Lease6ExtendedInfo,
|
||||||
@ -437,10 +392,6 @@ typedef boost::multi_index_container<
|
|||||||
>
|
>
|
||||||
> Lease6ExtendedInfoRemoteIdTable;
|
> Lease6ExtendedInfoRemoteIdTable;
|
||||||
|
|
||||||
/// @brief Lease6 extended information by relay id and link address index.
|
|
||||||
typedef Lease6ExtendedInfoRelayIdTable::index<RelayIdLinkAddressIndexTag>::type
|
|
||||||
RelayIdLinkAddressIndex;
|
|
||||||
|
|
||||||
/// @brief Lease6 extended information by relay id index.
|
/// @brief Lease6 extended information by relay id index.
|
||||||
typedef Lease6ExtendedInfoRelayIdTable::index<RelayIdIndexTag>::type
|
typedef Lease6ExtendedInfoRelayIdTable::index<RelayIdIndexTag>::type
|
||||||
RelayIdIndex;
|
RelayIdIndex;
|
||||||
@ -449,19 +400,10 @@ typedef Lease6ExtendedInfoRelayIdTable::index<RelayIdIndexTag>::type
|
|||||||
typedef Lease6ExtendedInfoRelayIdTable::index<LeaseAddressIndexTag>::type
|
typedef Lease6ExtendedInfoRelayIdTable::index<LeaseAddressIndexTag>::type
|
||||||
LeaseAddressRelayIdIndex;
|
LeaseAddressRelayIdIndex;
|
||||||
|
|
||||||
/// @brief Lease6 extended information by remote id and link address index.
|
|
||||||
typedef Lease6ExtendedInfoRemoteIdTable::index<RemoteIdLinkAddressIndexTag>::type
|
|
||||||
RemoteIdLinkAddressIndex;
|
|
||||||
|
|
||||||
/// @brief Lease6 extended information by remote id index.
|
/// @brief Lease6 extended information by remote id index.
|
||||||
typedef Lease6ExtendedInfoRemoteIdTable::index<RemoteIdIndexTag>::type
|
typedef Lease6ExtendedInfoRemoteIdTable::index<RemoteIdIndexTag>::type
|
||||||
RemoteIdIndex;
|
RemoteIdIndex;
|
||||||
|
|
||||||
/// @brief Lease6 extended information by remote id and link address range.
|
|
||||||
typedef std::pair<RemoteIdLinkAddressIndex::const_iterator,
|
|
||||||
RemoteIdLinkAddressIndex::const_iterator>
|
|
||||||
RemoteIdLinkAddressRange;
|
|
||||||
|
|
||||||
/// @brief Lease6 extended information by remote id range.
|
/// @brief Lease6 extended information by remote id range.
|
||||||
typedef std::pair<RemoteIdIndex::const_iterator, RemoteIdIndex::const_iterator>
|
typedef std::pair<RemoteIdIndex::const_iterator, RemoteIdIndex::const_iterator>
|
||||||
RemoteIdIndexRange;
|
RemoteIdIndexRange;
|
||||||
@ -470,82 +412,6 @@ typedef std::pair<RemoteIdIndex::const_iterator, RemoteIdIndex::const_iterator>
|
|||||||
typedef Lease6ExtendedInfoRemoteIdTable::index<LeaseAddressIndexTag>::type
|
typedef Lease6ExtendedInfoRemoteIdTable::index<LeaseAddressIndexTag>::type
|
||||||
LeaseAddressRemoteIdIndex;
|
LeaseAddressRemoteIdIndex;
|
||||||
|
|
||||||
/// @brief Lease6 extended informations for Bulk Lease Query,
|
|
||||||
/// simpler version (2 fields vs 3) for by link address table.
|
|
||||||
class Lease6SimpleExtendedInfo {
|
|
||||||
public:
|
|
||||||
/// @brief Constructor.
|
|
||||||
///
|
|
||||||
/// @param lease_addr Lease address.
|
|
||||||
/// @param link_addr Link address.
|
|
||||||
Lease6SimpleExtendedInfo(const isc::asiolink::IOAddress& lease_addr,
|
|
||||||
const isc::asiolink::IOAddress& link_addr)
|
|
||||||
: lease_addr_(lease_addr), link_addr_(link_addr) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Lease address.
|
|
||||||
isc::asiolink::IOAddress lease_addr_;
|
|
||||||
|
|
||||||
/// @brief Link address.
|
|
||||||
isc::asiolink::IOAddress link_addr_;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// @brief Pointer to a Lease6SimpleExtendedInfo object.
|
|
||||||
typedef boost::shared_ptr<Lease6SimpleExtendedInfo> Lease6SimpleExtendedInfoPtr;
|
|
||||||
|
|
||||||
/// @brief Tag for indexes by link address.
|
|
||||||
struct LinkAddressIndexTag { };
|
|
||||||
|
|
||||||
/// @brief A multi index container holding lease6 extended info
|
|
||||||
/// for by link address.
|
|
||||||
///
|
|
||||||
/// The lease6 extended info may be accessed using different indexes:
|
|
||||||
/// - using a composite index: link and lease addresses, the second for
|
|
||||||
/// getting lower bounds.
|
|
||||||
/// - using lease address for deletes.
|
|
||||||
///
|
|
||||||
/// The choice of a binary tree was governed by the fact no hypothesis can
|
|
||||||
/// be done on the number of clients.
|
|
||||||
///
|
|
||||||
/// Indexes can be accessed using the index number (from 0 to 5) or a
|
|
||||||
/// name tag. It is recommended to use the tags to access indexes as
|
|
||||||
/// they do not depend on the order of indexes in the container.
|
|
||||||
typedef boost::multi_index_container<
|
|
||||||
// It holds pointers to lease6 extended info.
|
|
||||||
Lease6SimpleExtendedInfoPtr,
|
|
||||||
boost::multi_index::indexed_by<
|
|
||||||
// First index is by link and lease addresses.
|
|
||||||
boost::multi_index::ordered_non_unique<
|
|
||||||
boost::multi_index::tag<LinkAddressIndexTag>,
|
|
||||||
boost::multi_index::composite_key<
|
|
||||||
Lease6SimpleExtendedInfo,
|
|
||||||
boost::multi_index::member<Lease6SimpleExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6SimpleExtendedInfo::link_addr_>,
|
|
||||||
boost::multi_index::member<Lease6SimpleExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6SimpleExtendedInfo::lease_addr_>
|
|
||||||
>
|
|
||||||
>,
|
|
||||||
|
|
||||||
// Last index is by lease address.
|
|
||||||
boost::multi_index::hashed_non_unique<
|
|
||||||
boost::multi_index::tag<LeaseAddressIndexTag>,
|
|
||||||
boost::multi_index::member<Lease6SimpleExtendedInfo,
|
|
||||||
isc::asiolink::IOAddress,
|
|
||||||
&Lease6SimpleExtendedInfo::lease_addr_>
|
|
||||||
>
|
|
||||||
>
|
|
||||||
> Lease6SimpleExtendedInfoLinkAddrTable;
|
|
||||||
|
|
||||||
/// @brief Lease6 extended information by link address.
|
|
||||||
typedef Lease6SimpleExtendedInfoLinkAddrTable::index<LinkAddressIndexTag>::type
|
|
||||||
LinkAddressIndex;
|
|
||||||
|
|
||||||
/// @brief Lease6 extended information by lease address index of by link address table.
|
|
||||||
typedef Lease6SimpleExtendedInfoLinkAddrTable::index<LeaseAddressIndexTag>::type
|
|
||||||
LeaseAddressLinkAddressIndex;
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
} // end of isc::dhcp namespace
|
} // end of isc::dhcp namespace
|
||||||
|
@ -3377,24 +3377,16 @@ MySqlLeaseMgr::deleteExtendedInfo6(const IOAddress& /* addr */) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
MySqlLeaseMgr::addRelayId6(const IOAddress& /* lease_addr */,
|
MySqlLeaseMgr::addRelayId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* relay_id */) {
|
const vector<uint8_t>& /* relay_id */) {
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::addRelayId6 not implemented");
|
isc_throw(NotImplemented, "MySqlLeaseMgr::addRelayId6 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MySqlLeaseMgr::addRemoteId6(const IOAddress& /* lease_addr */,
|
MySqlLeaseMgr::addRemoteId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* remote_id */) {
|
const vector<uint8_t>& /* remote_id */) {
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::addRemoteId6 not implemented");
|
isc_throw(NotImplemented, "MySqlLeaseMgr::addRemoteId6 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MySqlLeaseMgr::addLinkAddr6(const IOAddress& /* lease_addr */,
|
|
||||||
const IOAddress& /* link_addr */) {
|
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::addLinkAddr6 not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
MySqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
MySqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
@ -3416,6 +3408,7 @@ MySqlLeaseMgr::getLeases4ByRemoteId(const OptionBuffer& /* remote_id */,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
MySqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
MySqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) {
|
const LeasePageSize& /* page_size */) {
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByRelayId not implemented");
|
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByRelayId not implemented");
|
||||||
@ -3424,6 +3417,7 @@ MySqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
MySqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
MySqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size*/) {
|
const LeasePageSize& /* page_size*/) {
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByRemoteId not implemented");
|
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByRemoteId not implemented");
|
||||||
@ -3431,6 +3425,7 @@ MySqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
|||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
MySqlLeaseMgr::getLeases6ByLink(const IOAddress& /* link_addr */,
|
MySqlLeaseMgr::getLeases6ByLink(const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) {
|
const LeasePageSize& /* page_size */) {
|
||||||
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByLink not implemented");
|
isc_throw(NotImplemented, "MySqlLeaseMgr::getLeases6ByLink not implemented");
|
||||||
|
@ -1062,8 +1062,9 @@ private:
|
|||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given relay-id.
|
/// @brief Returns existing IPv6 leases with a given relay-id.
|
||||||
///
|
///
|
||||||
/// @param relay_id DUID for relay_id of interest
|
/// @param relay_id DUID for relay_id of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1072,13 +1073,15 @@ private:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRelayId(const DUID& relay_id,
|
getLeases6ByRelayId(const DUID& relay_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given remote-id.
|
/// @brief Returns existing IPv6 leases with a given remote-id.
|
||||||
///
|
///
|
||||||
/// @param remote_id remote-id option data of interest
|
/// @param remote_id remote-id option data of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1087,12 +1090,14 @@ private:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with on a given link.
|
/// @brief Returns existing IPv6 leases with on a given link.
|
||||||
///
|
///
|
||||||
/// @param link_addr limit results to leases on this link.
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1100,6 +1105,7 @@ private:
|
|||||||
/// @return collection of IPv6 leases
|
/// @return collection of IPv6 leases
|
||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
@ -1161,28 +1167,17 @@ protected:
|
|||||||
/// @brief Add lease6 extended info into by-relay-id table.
|
/// @brief Add lease6 extended info into by-relay-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the relay header.
|
|
||||||
/// @param relay_id The relay id from the relay header options.
|
/// @param relay_id The relay id from the relay header options.
|
||||||
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& relay_id) override;
|
const std::vector<uint8_t>& relay_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-remote-id table.
|
/// @brief Add lease6 extended info into by-remote-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
/// @param remote_id The remote id from the relay header options.
|
/// @param remote_id The remote id from the relay header options.
|
||||||
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& remote_id) override;
|
const std::vector<uint8_t>& remote_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-link-addr table.
|
|
||||||
///
|
|
||||||
/// @param lease_addr The address of the lease.
|
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
virtual void addLinkAddr6(const isc::asiolink::IOAddress& lease_addr,
|
|
||||||
const isc::asiolink::IOAddress& link_addr) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
|
@ -2571,24 +2571,16 @@ PgSqlLeaseMgr::deleteExtendedInfo6(const IOAddress& /* addr */) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
PgSqlLeaseMgr::addRelayId6(const IOAddress& /* lease_addr */,
|
PgSqlLeaseMgr::addRelayId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* relay_id */) {
|
const vector<uint8_t>& /* relay_id */) {
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::addRelayId6 not implemented");
|
isc_throw(NotImplemented, "PgSqlLeaseMgr::addRelayId6 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PgSqlLeaseMgr::addRemoteId6(const IOAddress& /* lease_addr */,
|
PgSqlLeaseMgr::addRemoteId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* remote_id */) {
|
const vector<uint8_t>& /* remote_id */) {
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::addRemoteId6 not implemented");
|
isc_throw(NotImplemented, "PgSqlLeaseMgr::addRemoteId6 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
PgSqlLeaseMgr::addLinkAddr6(const IOAddress& /* lease_addr */,
|
|
||||||
const IOAddress& /* link_addr */) {
|
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::addLinkAddr6 not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
PgSqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
PgSqlLeaseMgr::getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
@ -2610,6 +2602,7 @@ PgSqlLeaseMgr::getLeases4ByRemoteId(const OptionBuffer& /* remote_id */,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
PgSqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
PgSqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) {
|
const LeasePageSize& /* page_size */) {
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByRelayId not implemented");
|
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByRelayId not implemented");
|
||||||
@ -2618,6 +2611,7 @@ PgSqlLeaseMgr::getLeases6ByRelayId(const DUID& /* relay_id */,
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
PgSqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
PgSqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size*/) {
|
const LeasePageSize& /* page_size*/) {
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByRemoteId not implemented");
|
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByRemoteId not implemented");
|
||||||
@ -2625,6 +2619,7 @@ PgSqlLeaseMgr::getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
|||||||
|
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
PgSqlLeaseMgr::getLeases6ByLink(const IOAddress& /* link_addr */,
|
PgSqlLeaseMgr::getLeases6ByLink(const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) {
|
const LeasePageSize& /* page_size */) {
|
||||||
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByLink not implemented");
|
isc_throw(NotImplemented, "PgSqlLeaseMgr::getLeases6ByLink not implemented");
|
||||||
|
@ -1015,8 +1015,9 @@ private:
|
|||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given relay-id.
|
/// @brief Returns existing IPv6 leases with a given relay-id.
|
||||||
///
|
///
|
||||||
/// @param relay_id DUID for relay_id of interest
|
/// @param relay_id DUID for relay_id of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1025,13 +1026,15 @@ private:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRelayId(const DUID& relay_id,
|
getLeases6ByRelayId(const DUID& relay_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with a given remote-id.
|
/// @brief Returns existing IPv6 leases with a given remote-id.
|
||||||
///
|
///
|
||||||
/// @param remote_id remote-id option data of interest
|
/// @param remote_id remote-id option data of interest.
|
||||||
/// @param link_addr limit results to leases on this link when not ::
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1040,12 +1043,14 @@ private:
|
|||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
getLeases6ByRemoteId(const OptionBuffer& remote_id,
|
||||||
const asiolink::IOAddress& link_addr,
|
const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
/// @brief Returns existing IPv6 leases with on a given link.
|
/// @brief Returns existing IPv6 leases with on a given link.
|
||||||
///
|
///
|
||||||
/// @param link_addr limit results to leases on this link.
|
/// @param link_addr limit results to leases on this link (prefix).
|
||||||
|
/// @param link_len limit results to leases on this link (length).
|
||||||
/// @param lower_bound_address IPv4 address used as lower bound for the
|
/// @param lower_bound_address IPv4 address used as lower bound for the
|
||||||
/// returned range.
|
/// returned range.
|
||||||
/// @param page_size maximum size of the page returned.
|
/// @param page_size maximum size of the page returned.
|
||||||
@ -1053,6 +1058,7 @@ private:
|
|||||||
/// @return collection of IPv6 leases
|
/// @return collection of IPv6 leases
|
||||||
virtual Lease6Collection
|
virtual Lease6Collection
|
||||||
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
getLeases6ByLink(const asiolink::IOAddress& link_addr,
|
||||||
|
uint8_t link_len,
|
||||||
const asiolink::IOAddress& lower_bound_address,
|
const asiolink::IOAddress& lower_bound_address,
|
||||||
const LeasePageSize& page_size) override;
|
const LeasePageSize& page_size) override;
|
||||||
|
|
||||||
@ -1120,28 +1126,17 @@ protected:
|
|||||||
/// @brief Add lease6 extended info into by-relay-id table.
|
/// @brief Add lease6 extended info into by-relay-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the relay header.
|
|
||||||
/// @param relay_id The relay id from the relay header options.
|
/// @param relay_id The relay id from the relay header options.
|
||||||
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& relay_id) override;
|
const std::vector<uint8_t>& relay_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-remote-id table.
|
/// @brief Add lease6 extended info into by-remote-id table.
|
||||||
///
|
///
|
||||||
/// @param lease_addr The address of the lease.
|
/// @param lease_addr The address of the lease.
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
/// @param remote_id The remote id from the relay header options.
|
/// @param remote_id The remote id from the relay header options.
|
||||||
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
|
||||||
const isc::asiolink::IOAddress& link_addr,
|
|
||||||
const std::vector<uint8_t>& remote_id) override;
|
const std::vector<uint8_t>& remote_id) override;
|
||||||
|
|
||||||
/// @brief Add lease6 extended info into by-link-addr table.
|
|
||||||
///
|
|
||||||
/// @param lease_addr The address of the lease.
|
|
||||||
/// @param link_addr The link address from the remote header.
|
|
||||||
virtual void addLinkAddr6(const isc::asiolink::IOAddress& lease_addr,
|
|
||||||
const isc::asiolink::IOAddress& link_addr) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
|
@ -406,7 +406,6 @@ public:
|
|||||||
/// @brief Stub implementation.
|
/// @brief Stub implementation.
|
||||||
void
|
void
|
||||||
addRelayId6(const IOAddress& /* lease_addr */,
|
addRelayId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* relay_id */) override {
|
const vector<uint8_t>& /* relay_id */) override {
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::addRelayId6 not implemented");
|
isc_throw(NotImplemented, "ConcreteLeaseMgr::addRelayId6 not implemented");
|
||||||
}
|
}
|
||||||
@ -414,18 +413,10 @@ public:
|
|||||||
/// @brief Stub implementation.
|
/// @brief Stub implementation.
|
||||||
void
|
void
|
||||||
addRemoteId6(const IOAddress& /* lease_addr */,
|
addRemoteId6(const IOAddress& /* lease_addr */,
|
||||||
const IOAddress& /* link_addr */,
|
|
||||||
const vector<uint8_t>& /* remote_id */) override {
|
const vector<uint8_t>& /* remote_id */) override {
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::addRemoteId6 not implemented");
|
isc_throw(NotImplemented, "ConcreteLeaseMgr::addRemoteId6 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Stub implementation.
|
|
||||||
void
|
|
||||||
addLinkAddr6(const IOAddress& /* lease_addr */,
|
|
||||||
const IOAddress& /* link_addr */) override {
|
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::addLinkAddr6 not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Stub implementation.
|
/// @brief Stub implementation.
|
||||||
Lease4Collection
|
Lease4Collection
|
||||||
getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
getLeases4ByRelayId(const OptionBuffer& /* relay_id */,
|
||||||
@ -450,6 +441,7 @@ public:
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByRelayId(const DUID& /* relay_id */,
|
getLeases6ByRelayId(const DUID& /* relay_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) override {
|
const LeasePageSize& /* page_size */) override {
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByRelayId not implemented");
|
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByRelayId not implemented");
|
||||||
@ -459,6 +451,7 @@ public:
|
|||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
getLeases6ByRemoteId(const OptionBuffer& /* remote_id */,
|
||||||
const IOAddress& /* link_addr */,
|
const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size*/) override {
|
const LeasePageSize& /* page_size*/) override {
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByRemoteId not implemented");
|
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByRemoteId not implemented");
|
||||||
@ -467,6 +460,7 @@ public:
|
|||||||
/// @brief Stub implementation.
|
/// @brief Stub implementation.
|
||||||
Lease6Collection
|
Lease6Collection
|
||||||
getLeases6ByLink(const IOAddress& /* link_addr */,
|
getLeases6ByLink(const IOAddress& /* link_addr */,
|
||||||
|
uint8_t /* link_len */,
|
||||||
const IOAddress& /* lower_bound_address */,
|
const IOAddress& /* lower_bound_address */,
|
||||||
const LeasePageSize& /* page_size */) override {
|
const LeasePageSize& /* page_size */) override {
|
||||||
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByLink not implemented");
|
isc_throw(NotImplemented, "ConcreteLeaseMgr::getLeases6ByLink not implemented");
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user