<< static_cast<int>(excluded_prefix_length_));
}
- // Excluded prefix must be longer than or equal to the delegated prefix.
+ // Excluded prefix must be longer than the delegated prefix length.
if (excluded_prefix_length_ <= delegated_prefix_length) {
isc_throw(BadValue, "length of the excluded prefix "
<< excluded_prefix << "/"
return (map);
}
-
Pool6::Pool6(Lease::Type type, const isc::asiolink::IOAddress& first,
const isc::asiolink::IOAddress& last)
: Pool(type, first, last), prefix_len_(128), pd_exclude_option_() {
<< static_cast<int>(prefix_len) << ")");
}
- if (((type == Lease::TYPE_NA) || (type == Lease::TYPE_TA)) && (delegated_len != 128)) {
+ if (((type == Lease::TYPE_NA) || (type == Lease::TYPE_TA)) &&
+ (delegated_len != 128)) {
isc_throw(BadValue, "For IA or TA pools, delegated prefix length must"
<< " be 128.");
}
// excluded_prefix_len == 0 means there's no excluded prefix at all.
if (excluded_prefix_len && (excluded_prefix_len <= delegated_len)) {
isc_throw(BadValue, "Excluded prefix ("
- << static_cast<int>(excluded_prefix_len)
- << ") must be longer than or equal to the delegated prefix length ("
- << static_cast<int>(delegated_len) << ")");
+ << static_cast<int>(excluded_prefix_len)
+ << ") must be longer than the delegated prefix length ("
+ << static_cast<int>(delegated_len) << ")");
}
/// @todo: We should probably implement checks against weird addresses
return (map);
}
-
std::string
Pool6::toText() const {
std::ostringstream s;
return (s.str());
}
-}; // end of isc::dhcp namespace
-}; // end of isc namespace
+} // end of isc::dhcp namespace
+} // end of isc namespace
EXPECT_THROW(Pool6 pool2(Lease::TYPE_PD, IOAddress("2001:db8:1::1"),
IOAddress("2001:db8:1::f")), BadValue);
- // Check that it's not allowed to specify bigger prefix than the pool
- // prefix len
+ // Check that it's not allowed to specify bigger prefix address than the
+ // pool prefix length
// Should not be able to compute prefix if first address is not starting
- // from prefix len 32 (2001:db8::)
+ // from prefix length 32 (2001:db8::)
EXPECT_THROW(Pool6 pool3(Lease::TYPE_PD, IOAddress("2001:db8:1::"),
32, 56), BadValue);
// Again, the excluded prefix length must be greater than main prefix
// length.
EXPECT_THROW(Pool6(IOAddress("2001:db8:1::"), 96, 112,
- IOAddress("2001:db8:1::"), 112),
+ IOAddress("2001:db8:1::"), 104),
BadValue);
// The "unspecified" excluded prefix must have both values set to 0.