return getAll6(subnet_id, address, HostMgrOperationTarget::ALL_SOURCES);
}
+ConstHostCollection
+HostMgr::getAll6(const IOAddress& address, const HostMgrOperationTarget target) const {
+ ConstHostCollection hosts;
+ if (target & HostMgrOperationTarget::PRIMARY_SOURCE) {
+ hosts = getCfgHosts()->getAll6(address);
+ }
+
+ if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) {
+ for (auto source : alternate_sources_) {
+ ConstHostCollection hosts_plus = source->getAll4(address);
+ hosts.insert(hosts.end(), hosts_plus.begin(), hosts_plus.end());
+ }
+ }
+
+ return (hosts);
+}
+
void
HostMgr::add(const HostPtr& host, const HostMgrOperationTarget target) {
if (target & HostMgrOperationTarget::PRIMARY_SOURCE) {
return (true);
}
-
} // end of isc::dhcp namespace
} // end of isc namespace
getAll6(const SubnetID& subnet_id,
const asiolink::IOAddress& address) const;
+ /// @brief Returns a collection of hosts using the specified IPv6 address.
+ ///
+ /// This method may return multiple @c Host objects if they are connected to
+ /// different subnets or if there are multiple hosts with the same IPv6 address.
+ ///
+ /// If matching reservations are both in the primary and the alternate
+ /// data source, all of them are returned. The reservations from the
+ /// primary data source are placed before the reservations from the
+ /// alternate source.
+ ///
+ /// @param address IPv6 address for which the @c Host object is searched.
+ /// @param target The host data source being a target of the operation.
+ ///
+ /// @return Collection of const @c Host objects.
+ ConstHostCollection
+ getAll6(const asiolink::IOAddress& address,
+ const HostMgrOperationTarget target) const;
+
/// @brief Adds a new host to the alternate data source.
///
/// This method will throw an exception if no alternate data source is