" for a host, specified address was " << address);
}
// Search for the Host using the reserved IPv6 address as a key.
- const HostContainerIndex1& idx = hosts_.get<1>();
- HostContainerIndex1Range r = idx.equal_range(address);
+ const HostContainer6Index4& idx = hosts6_.get<4>();
+ HostContainer6Index4Range r = idx.equal_range(address);
// Append each Host object to the storage.
- for (HostContainerIndex1::iterator host = r.first; host != r.second;
- ++host) {
+ for (HostContainer6Index4::iterator reservation = r.first; reservation != r.second;
+ ++reservation) {
LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE_DETAIL_DATA,
HOSTS_CFG_GET_ALL_ADDRESS6_HOST)
.arg(address.toText())
- .arg((*host)->toText());
- storage.push_back(*host);
+ .arg(reservation->host_->toText());
+ storage.push_back(reservation->host_);
}
LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS, HOSTS_CFG_GET_ALL_ADDRESS6_COUNT)
// Index using values returned by the @c Host::getHostId
boost::multi_index::const_mem_fun<HostResrv6Tuple, uint64_t,
&HostResrv6Tuple::getHostId>
+ >,
+
+ // Fifth index is used to search by the reserved address.
+ boost::multi_index::ordered_non_unique<
+ boost::multi_index::const_mem_fun<
+ HostResrv6Tuple, const asiolink::IOAddress&,
+ &HostResrv6Tuple::getPrefix
+ >
>
>
> HostContainer6;
typedef std::pair<HostContainer6Index3::iterator,
HostContainer6Index3::iterator> HostContainer6Index3Range;
+/// @brief Fifth index type in the @c HostContainer6.
+///
+/// This index allows for searching for @c Host objects using an IP address.
+typedef HostContainer6::nth_index<4>::type HostContainer6Index4;
+
+/// @brief Results range returned using the @c HostContainer6Index4.
+typedef std::pair<HostContainer6Index4::iterator,
+ HostContainer6Index4::iterator> HostContainer6Index4Range;
+
}; // end of isc::dhcp namespace
}; // end of isc namespace
// Add 25 hosts identified by DUID in the same subnet.
for (unsigned i = 0; i < 25; ++i) {
HostPtr host = HostPtr(new Host(duids_[i]->toText(), "duid",
- SUBNET_ID_UNUSED, SubnetID(1),
+ SUBNET_ID_UNUSED, SubnetID(i+1),
IOAddress("0.0.0.0")));
host->addReservation(IPv6Resrv(IPv6Resrv::TYPE_NA,
increase(IOAddress("2001:db8:1::1"),