/src/kea/src/lib/dhcpsrv/allocation_state.cc
Line | Count | Source |
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 | | #include <config.h> |
8 | | #include <dhcpsrv/allocation_state.h> |
9 | | #include <util/multi_threading_mgr.h> |
10 | | #include <boost/date_time/posix_time/posix_time.hpp> |
11 | | |
12 | | using namespace isc::util; |
13 | | |
14 | | namespace isc { |
15 | | namespace dhcp { |
16 | | |
17 | | SubnetAllocationState::SubnetAllocationState() |
18 | 28.9k | : AllocationState(), mutex_(new std::mutex) { |
19 | 28.9k | last_allocated_time_ = boost::posix_time::neg_infin; |
20 | 28.9k | } |
21 | | |
22 | | boost::posix_time::ptime |
23 | 0 | SubnetAllocationState::getLastAllocatedTime() const { |
24 | 0 | MultiThreadingLock lock(*mutex_); |
25 | 0 | return (last_allocated_time_); |
26 | 0 | } |
27 | | |
28 | | void |
29 | 0 | SubnetAllocationState::setCurrentAllocatedTimeInternal() { |
30 | 0 | last_allocated_time_ = boost::posix_time::microsec_clock::universal_time(); |
31 | 0 | } |
32 | | |
33 | | } |
34 | | } |