Kea 2.7.5
random_allocation_state.h
Go to the documentation of this file.
1// Copyright (C) 2022-2023 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef RANDOM_ALLOCATION_STATE_H
8#define RANDOM_ALLOCATION_STATE_H
9
12#include <dhcpsrv/pool.h>
13#include <boost/shared_ptr.hpp>
14#include <cstdint>
15
16namespace isc {
17namespace dhcp {
18
20class PoolRandomAllocationState;
21
23typedef boost::shared_ptr<PoolRandomAllocationState> PoolRandomAllocationStatePtr;
24
31public:
32
39
45 const asiolink::IOAddress& last);
46
53 const asiolink::IOAddress& last,
54 const uint8_t delegated);
55
61 return (permutation_);
62 }
63
64private:
65
67 IPRangePermutationPtr permutation_;
68};
69
70
71} // end of isc::dhcp namespace
72} // end of isc namespace
73
74#endif // RANDOM_ALLOCATION_STATE_H
Base class for representing allocation state in pools and subnets.
Pool allocation state used by the random allocator.
PoolRandomAllocationState(const asiolink::IOAddress &first, const asiolink::IOAddress &last)
Constructor from an IP address pool.
IPRangePermutationPtr getPermutation() const
Returns a pointer to the permutation of addresses or delegated prefixes.
static PoolRandomAllocationStatePtr create(const PoolPtr &pool)
Factory function creating the state instance from pool.
boost::shared_ptr< PoolRandomAllocationState > PoolRandomAllocationStatePtr
Type of the pointer to the PoolRandomAllocationState.
boost::shared_ptr< IPRangePermutation > IPRangePermutationPtr
Pointer to the IPRangePermutation.
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition pool.h:488
Defines the logger used by the top-level component of kea-lfc.