|
@@ -91,6 +91,13 @@ public:
|
|
|
return (std::make_pair(prefix_, prefix_len_));
|
|
|
}
|
|
|
|
|
|
+ /// @brief Returns the prefix length advertised to clients
|
|
|
+ ///
|
|
|
+ /// @return client prefix length
|
|
|
+ uint8_t getClientPrefixLength() const {
|
|
|
+ return (client_prefix_len_);
|
|
|
+ }
|
|
|
+
|
|
|
/// @brief Adds a new pool for the subnet.
|
|
|
///
|
|
|
/// This method checks that the address range represented by the pool
|
|
@@ -255,8 +262,9 @@ protected:
|
|
|
/// @param len prefix length for the subnet
|
|
|
/// @param id arbitrary subnet id, value of 0 triggers autogeneration
|
|
|
/// of subnet id
|
|
|
+ /// @param client_prefix_len prefix length advertised to clients
|
|
|
Subnet(const isc::asiolink::IOAddress& prefix, uint8_t len,
|
|
|
- const SubnetID id);
|
|
|
+ const SubnetID id, uint8_t client_prefix_len);
|
|
|
|
|
|
/// @brief virtual destructor
|
|
|
///
|
|
@@ -336,6 +344,15 @@ protected:
|
|
|
/// @brief a prefix length of the subnet
|
|
|
uint8_t prefix_len_;
|
|
|
|
|
|
+ /// @brief the prefix length advertised to clients
|
|
|
+ ///
|
|
|
+ /// In some cases, it may be useful to have clients with a prefix
|
|
|
+ /// length that is either smaller or larger than the actual prefix
|
|
|
+ /// configured in the server subnet. For instance, a server may be
|
|
|
+ /// configured with a /24 subnet but hand out addresses as /32
|
|
|
+ /// prefixes, using option 121.
|
|
|
+ uint8_t client_prefix_len_;
|
|
|
+
|
|
|
/// @brief last allocated address
|
|
|
///
|
|
|
/// This is the last allocated address that was previously allocated from
|
|
@@ -391,12 +408,14 @@ public:
|
|
|
///
|
|
|
/// @param prefix Subnet4 prefix
|
|
|
/// @param length prefix length
|
|
|
+ /// @param client_prefix_len prefix length advertised to clients
|
|
|
/// @param t1 renewal timer (in seconds)
|
|
|
/// @param t2 rebind timer (in seconds)
|
|
|
/// @param valid_lifetime preferred lifetime of leases (in seconds)
|
|
|
/// @param id arbitrary subnet id, default value of 0 triggers
|
|
|
/// autogeneration of subnet id
|
|
|
Subnet4(const isc::asiolink::IOAddress& prefix, uint8_t length,
|
|
|
+ uint8_t client_prefix_len,
|
|
|
const Triplet<uint32_t>& t1,
|
|
|
const Triplet<uint32_t>& t2,
|
|
|
const Triplet<uint32_t>& valid_lifetime,
|