static constexpr StatementTag GET_LEASE4_PAGE = "GET_LEASE4_PAGE";
// Get lease4 by subnet ID
static constexpr StatementTag GET_LEASE4_SUBID = "GET_LEASE4_SUBID";
+ // Get lease4 by hostname
+ static constexpr StatementTag GET_LEASE4_HOSTNAME = "GET_LEASE4_HOSTNAME";
/// @}
private:
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_LIMIT;
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_PAGE;
constexpr StatementTag CqlLease4Exchange::GET_LEASE4_SUBID;
+constexpr StatementTag CqlLease4Exchange::GET_LEASE4_HOSTNAME;
StatementMap CqlLease4Exchange::tagged_statements_{
"fqdn_fwd, fqdn_rev, hostname, state, user_context "
"FROM lease4 "
"WHERE subnet_id = ? "
+ "ALLOW FILTERING "}},
+
+ // Gets an IPv4 lease(s) with specified hostname
+ {GET_LEASE4_HOSTNAME,
+ {GET_LEASE4_HOSTNAME,
+ "SELECT "
+ "address, hwaddr, client_id, valid_lifetime, expire, subnet_id, "
+ "fqdn_fwd, fqdn_rev, hostname, state, user_context "
+ "FROM lease4 "
+ "WHERE hostname = ? "
"ALLOW FILTERING "}}
};
static constexpr StatementTag GET_LEASE6_DUID_IAID_SUBID = "GET_LEASE6_DUID_IAID_SUBID";
static constexpr StatementTag GET_LEASE6_LIMIT = "GET_LEASE6_LIMIT";
static constexpr StatementTag GET_LEASE6_PAGE = "GET_LEASE6_PAGE";
+ static constexpr StatementTag GET_LEASE6_HOSTNAME = "GET_LEASE6_HOSTNAME";
// @}
private:
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_LIMIT;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_PAGE;
+constexpr StatementTag CqlLease6Exchange::GET_LEASE6_HOSTNAME;
StatementMap CqlLease6Exchange::tagged_statements_ = {
"FROM lease6 "
"WHERE TOKEN(address) > TOKEN(?) "
"LIMIT ? "
- "ALLOW FILTERING "}}
+ "ALLOW FILTERING "}},
+
+ // Gets an IPv6 lease(s) with specified hostname
+ {GET_LEASE6_HOSTNAME,
+ {GET_LEASE6_HOSTNAME,
+ "SELECT "
+ "address, valid_lifetime, expire, subnet_id, pref_lifetime, duid, iaid, "
+ "lease_type, prefix_len, fqdn_fwd, fqdn_rev, hostname, hwaddr, hwtype, "
+ "hwaddr_source, state, user_context "
+ "FROM lease6 "
+ "WHERE hostname = ? "
+ "ALLOW FILTERING "}},
+
+
};
CqlLease6Exchange::CqlLease6Exchange(const CqlConnection &connection)
return (result);
}
+Lease4Collection
+CqlLeaseMgr::getLeases4(const std::string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_GET_HOSTNAME4)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ AnyArray data;
+
+ std::string hostname_data(hostname);
+ data.add(&hostname_data);
+
+ // Get the data.
+ Lease4Collection result;
+ std::unique_ptr<CqlLease4Exchange> exchange4(new CqlLease4Exchange(dbconn_));
+ exchange4->getLeaseCollection(CqlLease4Exchange::GET_LEASE4_HOSTNAME, data, result);
+
+ return (result);
+}
+
Lease4Collection
CqlLeaseMgr::getLeases4() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_GET4);
// Set up the WHERE clause value
AnyArray data;
-
+
CassBlob duid_data(duid.getDuid());
data.add(&duid_data);
isc_throw(NotImplemented, "getLeases6(subnet_id) is not implemented");
}
+Lease6Collection
+CqlLeaseMgr::getLeases6(const std::string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_GET_HOSTNAME6)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ AnyArray data;
+
+ std::string hostname_data(hostname);
+ data.add(&hostname_data);
+
+ // Get the data.
+ Lease6Collection result;
+ std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
+ exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_HOSTNAME, data, result);
+
+ return (result);
+}
+
Lease6Collection
CqlLeaseMgr::getLeases6() const {
isc_throw(NotImplemented, "getLeases6() is not implemented");
/// this backend.
virtual Lease4Collection getLeases4(SubnetID subnet_id) const override;
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const override;
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
/// this backend.
virtual Lease6Collection getLeases6(SubnetID subnet_id) const override;
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const override;
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(const DUID& duid) const override;
-
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
-// File created from ../../../src/lib/dhcpsrv/dhcpsrv_messages.mes on Mon Sep 30 2019 13:41
+// File created from ../../../src/lib/dhcpsrv/dhcpsrv_messages.mes on Wed Oct 16 2019 17:52
#include <cstddef>
#include <log/message_types.h>
extern const isc::log::MessageID DHCPSRV_CQL_GET_CLIENTID_HWADDR_SUBID = "DHCPSRV_CQL_GET_CLIENTID_HWADDR_SUBID";
extern const isc::log::MessageID DHCPSRV_CQL_GET_EXPIRED4 = "DHCPSRV_CQL_GET_EXPIRED4";
extern const isc::log::MessageID DHCPSRV_CQL_GET_EXPIRED6 = "DHCPSRV_CQL_GET_EXPIRED6";
+extern const isc::log::MessageID DHCPSRV_CQL_GET_HOSTNAME4 = "DHCPSRV_CQL_GET_HOSTNAME4";
+extern const isc::log::MessageID DHCPSRV_CQL_GET_HOSTNAME6 = "DHCPSRV_CQL_GET_HOSTNAME6";
extern const isc::log::MessageID DHCPSRV_CQL_GET_HWADDR = "DHCPSRV_CQL_GET_HWADDR";
extern const isc::log::MessageID DHCPSRV_CQL_GET_IAID_DUID = "DHCPSRV_CQL_GET_IAID_DUID";
extern const isc::log::MessageID DHCPSRV_CQL_GET_IAID_SUBID_DUID = "DHCPSRV_CQL_GET_IAID_SUBID_DUID";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_CLIENTID_HWADDR_SUBID = "DHCPSRV_MEMFILE_GET_CLIENTID_HWADDR_SUBID";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_EXPIRED4 = "DHCPSRV_MEMFILE_GET_EXPIRED4";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_EXPIRED6 = "DHCPSRV_MEMFILE_GET_EXPIRED6";
+extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HOSTNAME4 = "DHCPSRV_MEMFILE_GET_HOSTNAME4";
+extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HOSTNAME6 = "DHCPSRV_MEMFILE_GET_HOSTNAME6";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HWADDR = "DHCPSRV_MEMFILE_GET_HWADDR";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_IAID_DUID = "DHCPSRV_MEMFILE_GET_IAID_DUID";
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID = "DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_DUID = "DHCPSRV_MYSQL_GET_DUID";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_EXPIRED4 = "DHCPSRV_MYSQL_GET_EXPIRED4";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_EXPIRED6 = "DHCPSRV_MYSQL_GET_EXPIRED6";
+extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HOSTNAME4 = "DHCPSRV_MYSQL_GET_HOSTNAME4";
+extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HOSTNAME6 = "DHCPSRV_MYSQL_GET_HOSTNAME6";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HWADDR = "DHCPSRV_MYSQL_GET_HWADDR";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_IAID_DUID = "DHCPSRV_MYSQL_GET_IAID_DUID";
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_IAID_SUBID_DUID = "DHCPSRV_MYSQL_GET_IAID_SUBID_DUID";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_DUID = "DHCPSRV_PGSQL_GET_DUID";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_EXPIRED4 = "DHCPSRV_PGSQL_GET_EXPIRED4";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_EXPIRED6 = "DHCPSRV_PGSQL_GET_EXPIRED6";
+extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HOSTNAME4 = "DHCPSRV_PGSQL_GET_HOSTNAME4";
+extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HOSTNAME6 = "DHCPSRV_PGSQL_GET_HOSTNAME6";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HWADDR = "DHCPSRV_PGSQL_GET_HWADDR";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_IAID_DUID = "DHCPSRV_PGSQL_GET_IAID_DUID";
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_IAID_SUBID_DUID = "DHCPSRV_PGSQL_GET_IAID_SUBID_DUID";
"DHCPSRV_CQL_GET_CLIENTID_HWADDR_SUBID", "obtaining IPv4 lease for client ID %1, hardware address %2 and subnet ID %3",
"DHCPSRV_CQL_GET_EXPIRED4", "obtaining maximum %1 of expired IPv4 leases",
"DHCPSRV_CQL_GET_EXPIRED6", "obtaining maximum %1 of expired IPv6 leases",
+ "DHCPSRV_CQL_GET_HOSTNAME4", "obtaining IPv4 leases for hostname %1",
+ "DHCPSRV_CQL_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %1",
"DHCPSRV_CQL_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
"DHCPSRV_CQL_GET_IAID_DUID", "obtaining IPv6 leases for IAID %1 and DUID %2 and lease type %3",
"DHCPSRV_CQL_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3 and lease type %4",
"DHCPSRV_MEMFILE_GET_CLIENTID_HWADDR_SUBID", "obtaining IPv4 lease for client ID %1, hardware address %2 and subnet ID %3",
"DHCPSRV_MEMFILE_GET_EXPIRED4", "obtaining maximum %1 of expired IPv4 leases",
"DHCPSRV_MEMFILE_GET_EXPIRED6", "obtaining maximum %1 of expired IPv6 leases",
+ "DHCPSRV_MEMFILE_GET_HOSTNAME4", "obtaining IPv4 leases for hostname %1",
+ "DHCPSRV_MEMFILE_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %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_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3 and lease type %4",
"DHCPSRV_MYSQL_GET_DUID", "obtaining IPv6 lease for duid %1,",
"DHCPSRV_MYSQL_GET_EXPIRED4", "obtaining maximum %1 of expired IPv4 leases",
"DHCPSRV_MYSQL_GET_EXPIRED6", "obtaining maximum %1 of expired IPv6 leases",
+ "DHCPSRV_MYSQL_GET_HOSTNAME4", "obtaining IPv4 leases for hostname %1",
+ "DHCPSRV_MYSQL_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %1",
"DHCPSRV_MYSQL_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
"DHCPSRV_MYSQL_GET_IAID_DUID", "obtaining IPv6 leases for IAID %1, DUID %2, lease type %3",
"DHCPSRV_MYSQL_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3, lease type %4",
"DHCPSRV_PGSQL_GET_DUID", "obtaining IPv6 leases for DUID %1,",
"DHCPSRV_PGSQL_GET_EXPIRED4", "obtaining maximum %1 of expired IPv4 leases",
"DHCPSRV_PGSQL_GET_EXPIRED6", "obtaining maximum %1 of expired IPv6 leases",
+ "DHCPSRV_PGSQL_GET_HOSTNAME4", "obtaining IPv4 leases for hostname %1",
+ "DHCPSRV_PGSQL_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %1",
"DHCPSRV_PGSQL_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
"DHCPSRV_PGSQL_GET_IAID_DUID", "obtaining IPv4 leases for IAID %1 and DUID %2, lease type %3",
"DHCPSRV_PGSQL_GET_IAID_SUBID_DUID", "obtaining IPv4 leases for IAID %1, Subnet ID %2, DUID %3, and lease type %4",
-// File created from ../../../src/lib/dhcpsrv/dhcpsrv_messages.mes on Mon Sep 30 2019 13:41
+// File created from ../../../src/lib/dhcpsrv/dhcpsrv_messages.mes on Wed Oct 16 2019 17:52
#ifndef DHCPSRV_MESSAGES_H
#define DHCPSRV_MESSAGES_H
extern const isc::log::MessageID DHCPSRV_CQL_GET_CLIENTID_HWADDR_SUBID;
extern const isc::log::MessageID DHCPSRV_CQL_GET_EXPIRED4;
extern const isc::log::MessageID DHCPSRV_CQL_GET_EXPIRED6;
+extern const isc::log::MessageID DHCPSRV_CQL_GET_HOSTNAME4;
+extern const isc::log::MessageID DHCPSRV_CQL_GET_HOSTNAME6;
extern const isc::log::MessageID DHCPSRV_CQL_GET_HWADDR;
extern const isc::log::MessageID DHCPSRV_CQL_GET_IAID_DUID;
extern const isc::log::MessageID DHCPSRV_CQL_GET_IAID_SUBID_DUID;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_CLIENTID_HWADDR_SUBID;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_EXPIRED4;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_EXPIRED6;
+extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HOSTNAME4;
+extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HOSTNAME6;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_HWADDR;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_IAID_DUID;
extern const isc::log::MessageID DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_DUID;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_EXPIRED4;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_EXPIRED6;
+extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HOSTNAME4;
+extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HOSTNAME6;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_HWADDR;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_IAID_DUID;
extern const isc::log::MessageID DHCPSRV_MYSQL_GET_IAID_SUBID_DUID;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_DUID;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_EXPIRED4;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_EXPIRED6;
+extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HOSTNAME4;
+extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HOSTNAME6;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_HWADDR;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_IAID_DUID;
extern const isc::log::MessageID DHCPSRV_PGSQL_GET_IAID_SUBID_DUID;
IPv6 leases to reclaim them. The maximum number of leases to be retrieved
is logged in the message.
+% DHCPSRV_CQL_GET_HOSTNAME4 obtaining IPv4 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set of
+IPv4 leases from the Cassandra database for a client with the specified
+hostname.
+
+% DHCPSRV_CQL_GET_HOSTNAME6 obtaining IPv6 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set of
+IPv6 leases from the Cassandra database for a client with the specified
+hostname.
+
% DHCPSRV_CQL_GET_HWADDR obtaining IPv4 leases for hardware address %1
A debug message issued when the server is attempting to obtain a set of
IPv4 leases from the Cassandra database for a client with the specified
IPv6 leases to reclaim them. The maximum number of leases to be retrieved
is logged in the message.
+% DHCPSRV_MEMFILE_GET_HOSTNAME4 obtaining IPv4 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set of
+IPv4 leases from the memory file database for a client with the specified
+hostname.
+
+% DHCPSRV_MEMFILE_GET_HOSTNAME6 obtaining IPv6 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set of
+IPv6 leases from the memory file database for a client with the specified
+hostname.
+
% DHCPSRV_MEMFILE_GET_HWADDR obtaining IPv4 leases for hardware address %1
A debug message issued when the server is attempting to obtain a set of
IPv4 leases from the memory file database for a client with the specified
IPv6 leases to reclaim them. The maximum number of leases to be retrieved
is logged in the message.
+% DHCPSRV_MYSQL_GET_HOSTNAME4 obtaining IPv4 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set
+of IPv4 leases from the MySQL database for a client with the specified
+hostname.
+
+% DHCPSRV_MYSQL_GET_HOSTNAME6 obtaining IPv6 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set
+of IPv6 leases from the MySQL database for a client with the specified
+hostname.
+
% DHCPSRV_MYSQL_GET_HWADDR obtaining IPv4 leases for hardware address %1
A debug message issued when the server is attempting to obtain a set
of IPv4 leases from the MySQL database for a client with the specified
IPv6 leases to reclaim them. The maximum number of leases to be retrieved
is logged in the message.
+% DHCPSRV_PGSQL_GET_HOSTNAME4 obtaining IPv4 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set
+of IPv4 leases from the PostgreSQL database for a client with the specified
+hostname.
+
+% DHCPSRV_PGSQL_GET_HOSTNAME6 obtaining IPv6 leases for hostname %1
+A debug message issued when the server is attempting to obtain a set
+of IPv6 leases from the PostgreSQL database for a client with the specified
+hostname.
+
% DHCPSRV_PGSQL_GET_HWADDR obtaining IPv4 leases for hardware address %1
A debug message issued when the server is attempting to obtain a set
of IPv4 leases from the PostgreSQL database for a client with the specified
-// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const = 0;
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const = 0;
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(SubnetID subnet_id) const = 0;
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const = 0;
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
/// @brief Returns collection of leases for matching DUID
///
- /// @return Lease collection
+ /// @return Lease collection
/// (may be empty if no IPv6 lease found for the DUID).
- virtual Lease6Collection getLeases6(const DUID& duid) const = 0;
+ virtual Lease6Collection getLeases6(const DUID& duid) const = 0;
/// @brief Returns range of IPv6 leases using paging.
///
return (collection);
}
+Lease4Collection
+Memfile_LeaseMgr::getLeases4(const std::string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET_HOSTNAME4)
+ .arg(hostname);
+
+ Lease4Collection collection;
+ const Lease4StorageHostnameIndex& idx = storage4_.get<HostnameIndexTag>();
+ std::pair<Lease4StorageHostnameIndex::const_iterator,
+ Lease4StorageHostnameIndex::const_iterator> l =
+ idx.equal_range(hostname);
+
+ for (auto lease = l.first; lease != l.second; ++lease) {
+ collection.push_back(Lease4Ptr(new Lease4(**lease)));
+ }
+
+ return (collection);
+}
+
Lease4Collection
Memfile_LeaseMgr::getLeases4() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET4);
return (collection);
}
+Lease6Collection
+Memfile_LeaseMgr::getLeases6(const std::string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET_HOSTNAME6)
+ .arg(hostname);
+
+ Lease6Collection collection;
+ const Lease6StorageHostnameIndex& idx = storage6_.get<HostnameIndexTag>();
+ std::pair<Lease6StorageHostnameIndex::const_iterator,
+ Lease6StorageHostnameIndex::const_iterator> l =
+ idx.equal_range(hostname);
+
+ for (auto lease = l.first; lease != l.second; ++lease) {
+ collection.push_back(Lease6Ptr(new Lease6(**lease)));
+ }
+
+ return (collection);
+}
+
Lease6Collection
Memfile_LeaseMgr::getLeases6() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET6);
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const;
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(SubnetID subnet_id) const;
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const;
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
/// @brief Returns IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
- /// @return Lease collection (may be empty if no IPv6 lease found)
+ /// @return Lease collection (may be empty if no IPv6 lease found)
/// for the DUID.
virtual Lease6Collection getLeases6(const DUID& duid) const;
-
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
-// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
struct SubnetIdIndexTag { };
/// @brief Tag for index using DUID.
-struct DuidIndexTag { };
+struct DuidIndexTag { };
+
+/// @brief Tag for index using hostname.
+struct HostnameIndexTag { };
+
/// @name Multi index containers holding DHCPv4 and DHCPv6 leases.
///
//@{
boost::multi_index::const_mem_fun<Lease6,
const std::vector<uint8_t>&,
&Lease6::getDuidVector>
+ >,
+
+ // Specification of the sixth index starts here
+ // This index is used to retrieve leases for matching hostname.
+ boost::multi_index::ordered_non_unique<
+ boost::multi_index::tag<HostnameIndexTag>,
+ boost::multi_index::member<Lease, std::string, &Lease::hostname_>
>
>
> Lease6Storage; // Specify the type name of this container.
boost::multi_index::ordered_non_unique<
boost::multi_index::tag<SubnetIdIndexTag>,
boost::multi_index::member<Lease, isc::dhcp::SubnetID, &Lease::subnet_id_>
- >
+ >,
+
+ // Specification of the seventh index starts here
+ // This index is used to retrieve leases for matching hostname.
+ boost::multi_index::ordered_non_unique<
+ boost::multi_index::tag<HostnameIndexTag>,
+ boost::multi_index::member<Lease, std::string, &Lease::hostname_>
+ >
>
> Lease4Storage; // Specify the type name for this container.
/// @brief DHCPv6 lease storage index by Subnet-id.
typedef Lease6Storage::index<DuidIndexTag>::type Lease6StorageDuidIndex;
+/// @brief DHCPv6 lease storage index by hostname.
+typedef Lease6Storage::index<HostnameIndexTag>::type Lease6StorageHostnameIndex;
+
/// @brief DHCPv4 lease storage index by address.
typedef Lease4Storage::index<AddressIndexTag>::type Lease4StorageAddressIndex;
/// @brief DHCPv4 lease storage index by client id, HW address and subnet id.
typedef Lease4Storage::index<SubnetIdIndexTag>::type Lease4StorageSubnetIdIndex;
+/// @brief DHCPv4 lease storage index by hostname.
+typedef Lease4Storage::index<HostnameIndexTag>::type Lease4StorageHostnameIndex;
+
//@}
} // end of isc::dhcp namespace
} // end of isc namespace
"state, user_context "
"FROM lease4 "
"WHERE subnet_id = ?"},
+ {MySqlLeaseMgr::GET_LEASE4_HOSTNAME,
+ "SELECT address, hwaddr, client_id, "
+ "valid_lifetime, expire, subnet_id, "
+ "fqdn_fwd, fqdn_rev, hostname, "
+ "state, user_context "
+ "FROM lease4 "
+ "WHERE hostname = ?"},
{MySqlLeaseMgr::GET_LEASE4_EXPIRE,
"SELECT address, hwaddr, client_id, "
"valid_lifetime, expire, subnet_id, "
"state, user_context "
"FROM lease6 "
"WHERE duid = ?"},
+ {MySqlLeaseMgr::GET_LEASE6_HOSTNAME,
+ "SELECT address, duid, valid_lifetime, "
+ "expire, subnet_id, pref_lifetime, "
+ "lease_type, iaid, prefix_len, "
+ "fqdn_fwd, fqdn_rev, hostname, "
+ "hwaddr, hwtype, hwaddr_source, "
+ "state, user_context "
+ "FROM lease6 "
+ "WHERE hostname = ?"},
{MySqlLeaseMgr::GET_LEASE6_EXPIRE,
"SELECT address, duid, valid_lifetime, "
"expire, subnet_id, pref_lifetime, "
return (result);
}
+Lease4Collection
+MySqlLeaseMgr::getLeases4(const string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET_HOSTNAME4)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ MYSQL_BIND inbind[1];
+ memset(inbind, 0, sizeof(inbind));
+
+ // Hostname
+ inbind[0].buffer_type = MYSQL_TYPE_STRING;
+ inbind[0].buffer = const_cast<char*>(hostname.c_str());
+ inbind[0].buffer_length = hostname.length();
+
+ // ... and get the data
+ Lease4Collection result;
+ getLeaseCollection(GET_LEASE4_HOSTNAME, inbind, result);
+
+ return (result);
+}
+
Lease4Collection
MySqlLeaseMgr::getLeases4() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET4);
MySqlLeaseMgr::getLeases6(const DUID& duid) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET_DUID)
.arg(duid.toText());
-
+
// Set up the WHERE clause value
MYSQL_BIND inbind[1];
memset(inbind, 0, sizeof(inbind));
const_cast<uint8_t*>(&duid_vector[0]));
inbind[0].buffer_length = duid_length;
inbind[0].length = &duid_length;
-
+
Lease6Collection result;
-
+
getLeaseCollection(GET_LEASE6_DUID, inbind, result);
return result;
}
+Lease6Collection
+MySqlLeaseMgr::getLeases6(const string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET_HOSTNAME6)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ MYSQL_BIND inbind[1];
+ memset(inbind, 0, sizeof(inbind));
+
+ // Hostname
+ inbind[0].buffer_type = MYSQL_TYPE_STRING;
+ inbind[0].buffer = const_cast<char*>(hostname.c_str());
+ inbind[0].buffer_length = hostname.length();
+
+ // ... and get the data
+ Lease6Collection result;
+ getLeaseCollection(GET_LEASE6_HOSTNAME, inbind, result);
+
+ return (result);
+}
+
Lease6Collection
MySqlLeaseMgr::getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const {
-// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const;
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(SubnetID subnet_id) const;
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const;
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found)
/// for the DUID.
virtual Lease6Collection getLeases6(const DUID& duid) const;
-
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
GET_LEASE4_HWADDR_SUBID, // Get lease4 by HW address & subnet ID
GET_LEASE4_PAGE, // Get page of leases beginning with an address
GET_LEASE4_SUBID, // Get IPv4 leases by subnet ID
+ GET_LEASE4_HOSTNAME, // Get IPv4 leases by hostname
GET_LEASE4_EXPIRE, // Get lease4 by expiration.
GET_LEASE6, // Get all IPv6 leases
GET_LEASE6_ADDR, // Get lease6 by address
GET_LEASE6_PAGE, // Get page of leases beginning with an address
GET_LEASE6_SUBID, // Get IPv6 leases by subnet ID
GET_LEASE6_DUID, // Get IPv6 leases by DUID
+ GET_LEASE6_HOSTNAME, // Get IPv6 leases by hostname
GET_LEASE6_EXPIRE, // Get lease6 by expiration.
INSERT_LEASE4, // Add entry to lease4 table
INSERT_LEASE6, // Add entry to lease6 table
"FROM lease4 "
"WHERE subnet_id = $1"},
+ // GET_LEASE4_HOSTNAME
+ { 1, { OID_VARCHAR },
+ "get_lease4_hostname",
+ "SELECT address, hwaddr, client_id, "
+ "valid_lifetime, extract(epoch from expire)::bigint, subnet_id, "
+ "fqdn_fwd, fqdn_rev, hostname, "
+ "state, user_context "
+ "FROM lease4 "
+ "WHERE hostname = $1"},
+
// GET_LEASE4_EXPIRE
{ 3, { OID_INT8, OID_TIMESTAMP, OID_INT8 },
"get_lease4_expire",
"FROM lease6 "
"WHERE duid = $1"},
+ // GET_LEASE6_HOSTNAME
+ { 1, { OID_VARCHAR },
+ "get_lease6_hostname",
+ "SELECT address, duid, valid_lifetime, "
+ "extract(epoch from expire)::bigint, subnet_id, pref_lifetime, "
+ "lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, "
+ "hwaddr, hwtype, hwaddr_source, "
+ "state, user_context "
+ "FROM lease6 "
+ "WHERE hostname = $1"},
+
// GET_LEASE6_EXPIRE
{ 3, { OID_INT8, OID_TIMESTAMP, OID_INT8 },
"get_lease6_expire",
return (result);
}
+Lease4Collection
+PgSqlLeaseMgr::getLeases4(const string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET_HOSTNAME4)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ PsqlBindArray bind_array;
+
+ // Hostname
+ bind_array.add(hostname);
+
+ // ... and get the data
+ Lease4Collection result;
+ getLeaseCollection(GET_LEASE4_HOSTNAME, bind_array, result);
+
+ return (result);
+}
+
Lease4Collection
PgSqlLeaseMgr::getLeases4() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET4);
return (result);
}
+Lease6Collection
+PgSqlLeaseMgr::getLeases6(const string& hostname) const {
+ LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET_HOSTNAME6)
+ .arg(hostname);
+
+ // Set up the WHERE clause value
+ PsqlBindArray bind_array;
+
+ // Hostname
+ bind_array.add(hostname);
+
+ // ... and get the data
+ Lease6Collection result;
+ getLeaseCollection(GET_LEASE6_HOSTNAME, bind_array, result);
+
+ return (result);
+}
+
Lease6Collection
PgSqlLeaseMgr::getLeases6() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET6);
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const;
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(SubnetID subnet_id) const;
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const;
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
/// @return Lease collection (may be empty if no IPv6 lease found)
/// for the DUID
virtual Lease6Collection getLeases6(const DUID& duid) const;
-
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
GET_LEASE4_HWADDR_SUBID, // Get lease4 by HW address & subnet ID
GET_LEASE4_PAGE, // Get page of leases beginning with an address
GET_LEASE4_SUBID, // Get IPv4 leases by subnet ID
+ GET_LEASE4_HOSTNAME, // Get IPv4 leases by hostname
GET_LEASE4_EXPIRE, // Get expired lease4
GET_LEASE6, // Get all IPv6 leases
GET_LEASE6_ADDR, // Get lease6 by address
GET_LEASE6_PAGE, // Get page of IPv6 leases beginning with an address
GET_LEASE6_SUBID, // Get IPv6 leases by subnet ID
GET_LEASE6_DUID, // Get IPv6 leases by DUID
+ GET_LEASE6_HOSTNAME, // Get IPv6 leases by hostname
GET_LEASE6_EXPIRE, // Get expired lease6
INSERT_LEASE4, // Add entry to lease4 table
INSERT_LEASE6, // Add entry to lease6 table
testGetLeases4SubnetId();
}
+// This test checks that all IPv4 leases with a specified hostname are returned.
+TEST_F(CqlLeaseMgrTest, getLeases4Hostname) {
+ testGetLeases4Hostname();
+}
+
// This test checks that all IPv4 leases are returned.
TEST_F(CqlLeaseMgrTest, getLeases4) {
testGetLeases4();
testGetLease6DuidIaidSubnetIdSize();
}
+// This test checks that all IPv6 leases with a specified hostname are returned.
+TEST_F(CqlLeaseMgrTest, getLeases6Hostname) {
+ testGetLeases6Hostname();
+}
+
// Test that a range of IPv6 leases is returned with paging.
TEST_F(CqlLeaseMgrTest, getLeases6Paged) {
testGetLeases6Paged();
ASSERT_EQ(2, returned.size());
}
+void
+GenericLeaseMgrTest::testGetLeases4Hostname() {
+ // Get the leases to be used for the test and add to the database.
+ vector<Lease4Ptr> leases = createLeases4();
+ for (size_t i = 0; i < leases.size(); ++i) {
+ EXPECT_TRUE(lmptr_->addLease(leases[i]));
+ }
+
+ // There should be no lease for hostname foobar.
+ Lease4Collection returned = lmptr_->getLeases4(string("foobar"));
+ EXPECT_TRUE(returned.empty());
+
+ // There should be exactly 4 leases for the hostname of the second lease.
+ ASSERT_FALSE(leases[1]->hostname_.empty());
+ returned = lmptr_->getLeases4(leases[1]->hostname_);
+ EXPECT_EQ(4, returned.size());
+
+ // And 3 for the forth lease.
+ ASSERT_FALSE(leases[3]->hostname_.empty());
+ returned = lmptr_->getLeases4(leases[3]->hostname_);
+ EXPECT_EQ(3, returned.size());
+}
+
void
GenericLeaseMgrTest::testGetLeases4() {
// Get the leases to be used for the test and add to the database
EXPECT_EQ(2, returned.size());
}
+void
+GenericLeaseMgrTest::testGetLeases6Hostname() {
+ // Get the leases to be used for the test and add to the database.
+ vector<Lease6Ptr> leases = createLeases6();
+ for (size_t i = 0; i < leases.size(); ++i) {
+ EXPECT_TRUE(lmptr_->addLease(leases[i]));
+ }
+
+ // There should be no lease for hostname foobar.
+ Lease6Collection returned = lmptr_->getLeases6(string("foobar"));
+ EXPECT_TRUE(returned.empty());
+
+ // There should be exactly 4 leases for the hostname of the second lease.
+ ASSERT_FALSE(leases[1]->hostname_.empty());
+ returned = lmptr_->getLeases6(leases[1]->hostname_);
+ EXPECT_EQ(4, returned.size());
+
+ // One for the fifth lease.
+ ASSERT_FALSE(leases[4]->hostname_.empty());
+ returned = lmptr_->getLeases6(leases[4]->hostname_);
+ EXPECT_EQ(1, returned.size());
+
+ // And 3 for the sixth lease.
+ ASSERT_FALSE(leases[5]->hostname_.empty());
+ returned = lmptr_->getLeases6(leases[5]->hostname_);
+ EXPECT_EQ(3, returned.size());
+}
+
void
GenericLeaseMgrTest::testGetLeases6() {
// Get the leases to be used for the test and add to the database
/// @brief Test method which returns all IPv4 leases for Subnet ID.
void testGetLeases4SubnetId();
+ /// @brief Test method which returns all IPv4 leases for Hostname.
+ void testGetLeases4Hostname();
+
/// @brief Test method which returns all IPv4 leases.
void testGetLeases4();
/// @brief Test method which returns all IPv6 leases for Subnet ID.
void testGetLeases6SubnetId();
+ /// @brief Test method which returns all IPv6 leases for Hostname.
+ void testGetLeases6Hostname();
+
/// @brief Test making/fetching leases with IAIDs > signed 32-bit max.
void testLease6LargeIaidCheck();
-// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
return (Lease4Collection());
}
+ /// @brief Returns all IPv4 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv4 lease found).
+ virtual Lease4Collection getLeases4(const std::string& hostname) const {
+ return (Lease4Collection());
+ }
+
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
return (Lease6Collection());
}
+ /// @brief Returns all IPv6 leases for the particular hostname.
+ ///
+ /// @param hostname hostname in lower case.
+ ///
+ /// @return Lease collection (may be empty if no IPv6 lease found).
+ virtual Lease6Collection getLeases6(const std::string& hostname) const {
+ return (Lease6Collection());
+ }
+
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
testGetLeases4SubnetId();
}
+// This test checks that all IPv4 leases with a specified hostname are returned.
+TEST_F(MemfileLeaseMgrTest, getLeases4Hostname) {
+ startBackend(V4);
+ testGetLeases4Hostname();
+}
+
// This test checks that all IPv4 leases are returned.
TEST_F(MemfileLeaseMgrTest, getLeases4) {
startBackend(V4);
testGetLeases6SubnetId();
}
+// This test checks that all IPv6 leases with a specified hostname are returned.
+TEST_F(MemfileLeaseMgrTest, getLeases6Hostname) {
+ startBackend(V6);
+ testGetLeases6Hostname();
+}
+
// This test adds 3 leases and verifies fetch by DUID.
// Verifies retrival of non existant DUID fails
TEST_F(MemfileLeaseMgrTest, getLeases6Duid) {
testGetLeases4SubnetId();
}
+// This test checks that all IPv4 leases with a specified hostname are returned.
+TEST_F(MySqlLeaseMgrTest, getLeases4Hostname) {
+ testGetLeases4Hostname();
+}
+
// This test checks that all IPv4 leases are returned.
TEST_F(MySqlLeaseMgrTest, getLeases4) {
testGetLeases4();
testGetLeases6SubnetId();
}
+// This test checks that all IPv6 leases with a specified hostname are returned.
+TEST_F(MySqlLeaseMgrTest, getLeases6Hostname) {
+ testGetLeases6Hostname();
+}
+
// This test checks that all IPv6 leases are returned.
TEST_F(MySqlLeaseMgrTest, getLeases6) {
testGetLeases6();
testGetLeases4SubnetId();
}
+// This test checks that all IPv4 leases with a specified hostname are returned.
+TEST_F(PgSqlLeaseMgrTest, getLeases4Hostname) {
+ testGetLeases4Hostname();
+}
+
// This test checks that all IPv4 leases are returned.
TEST_F(PgSqlLeaseMgrTest, getLeases4) {
testGetLeases4();
testGetLeases6SubnetId();
}
+// This test checks that all IPv6 leases with a specified hostname are returned.
+TEST_F(PgSqlLeaseMgrTest, getLeases6Hostname) {
+ testGetLeases6Hostname();
+}
+
// This test checks that all IPv6 leases are returned.
TEST_F(PgSqlLeaseMgrTest, getLeases6) {
testGetLeases6();