"options");
}
- if (host->getIPv4SubnetID() == 0) {
- // This is IPv6-only host. No need to add it to v4 tables.
- return;
- }
-
// Check for duplicates for the specified IPv4 subnet.
if ((host->getIPv4SubnetID() > 0) &&
get4(host->getIPv4SubnetID(), hwaddr, duid)) {
// Get all reservations for this host.
IPv6ResrvRange reservations = host->getIPv6Reservations();
- // Check if the (identifier type, identifier) tuple is already used.
- const std::vector<uint8_t>& id = host->getIdentifier();
- if ((host->getIPv6SubnetID() > 0) && !id.empty()) {
- if (get6(host->getIPv6SubnetID(), host->getIdentifierType(), &id[0],
- id.size())) {
- isc_throw(DuplicateHost, "failed to add duplicate IPv6 host using identifier: "
- << Host::getIdentifierAsText(host->getIdentifierType(),
- &id[0], id.size()));
- }
- }
-
// Check if there are any IPv6 reservations.
if (std::distance(reservations.first, reservations.second) == 0) {
// If there aren't, we don't need to add this to hosts6_, which is used
ReturnType getHostInternal6(const asiolink::IOAddress& prefix,
const uint8_t prefix_len) const;
- /// @brief Adds a new host to the v4 collection.
+ /// @brief Adds a new host to the collection.
///
- /// This is an internal method called by public @ref add.
+ /// This is an internal method called by public @ref add. Contrary to its
+ /// name, this is useful for both IPv4 and IPv6 hosts, as this adds the
+ /// host to hosts_ storage that is shared by both families. Notes that
+ /// for IPv6 host additional steps may be required (see @ref add6).
///
/// @param host Pointer to the new @c Host object being added.
///
/// has already been added to the IPv4 subnet.
virtual void add4(const HostPtr& host);
- /// @brief Adds a new host to the v6 collection.
+ /// @brief Adds IPv6-specific reservation to hosts collection.
///
- /// This is an internal method called by public @ref add.
+ /// This is an internal method called by public @ref add. This method adds
+ /// IPv6 reservations (IPv6 addresses or prefixes reserved) to the hosts6_
+ /// storage. Note the host has been added to the hosts_ already (in @ref add4).
///
/// @param host Pointer to the new @c Host object being added.
///