|
1 | | -// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC") |
| 1 | +// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC") |
2 | 2 | // |
3 | 3 | // This Source Code Form is subject to the terms of the Mozilla Public |
4 | 4 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
|
8 | 8 | #define POOL_H |
9 | 9 |
|
10 | 10 | #include <asiolink/io_address.h> |
11 | | -#include <dhcp/classify.h> |
12 | | -#include <dhcp/option6_pdexclude.h> |
13 | | -#include <boost/shared_ptr.hpp> |
14 | 11 | #include <cc/data.h> |
15 | 12 | #include <cc/user_context.h> |
| 13 | +#include <dhcp/classify.h> |
| 14 | +#include <dhcp/option6_pdexclude.h> |
| 15 | +#include <dhcpsrv/address_range_permutation.h> |
16 | 16 | #include <dhcpsrv/cfg_option.h> |
17 | 17 | #include <dhcpsrv/lease.h> |
| 18 | + |
18 | 19 | #include <boost/shared_ptr.hpp> |
19 | 20 |
|
20 | 21 | #include <vector> |
@@ -166,6 +167,13 @@ class Pool : public isc::data::UserContext, public isc::data::CfgToElement { |
166 | 167 | /// @return A pointer to unparsed pool configuration. |
167 | 168 | virtual data::ElementPtr toElement() const; |
168 | 169 |
|
| 170 | + /// @brief Returns pointer to the permutation associated with the pool. |
| 171 | + /// |
| 172 | + /// @return Pointer to the address range permutation. |
| 173 | + AddressRangePermutationPtr getPermutation() const { |
| 174 | + return (permutation_); |
| 175 | + } |
| 176 | + |
169 | 177 | protected: |
170 | 178 |
|
171 | 179 | /// @brief protected constructor |
@@ -234,6 +242,12 @@ class Pool : public isc::data::UserContext, public isc::data::CfgToElement { |
234 | 242 |
|
235 | 243 | /// @brief Status of last allocated address |
236 | 244 | bool last_allocated_valid_; |
| 245 | + |
| 246 | + /// @brief Pointer to the permutation object. |
| 247 | + /// |
| 248 | + /// It may be initialized for certain pools and poo types to provide |
| 249 | + /// address randomization capabilities. |
| 250 | + AddressRangePermutationPtr permutation_; |
237 | 251 | }; |
238 | 252 |
|
239 | 253 | class Pool4; |
|
0 commit comments