Kea 2.7.5
lease_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2012-2024 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 LEASE_MGR_H
8#define LEASE_MGR_H
9
10#include <asiolink/io_address.h>
11#include <asiolink/io_service.h>
12#include <cc/data.h>
15#include <dhcp/duid.h>
16#include <dhcp/option.h>
17#include <dhcp/hwaddr.h>
19#include <dhcpsrv/lease.h>
20#include <dhcpsrv/subnet.h>
21
22#include <boost/noncopyable.hpp>
23#include <boost/shared_ptr.hpp>
24
25#include <fstream>
26#include <iostream>
27#include <map>
28#include <string>
29#include <utility>
30#include <vector>
31
39namespace isc {
40namespace dhcp {
41
43typedef std::pair<uint32_t, uint32_t> VersionPair;
44
47public:
48
54 explicit LeasePageSize(const size_t page_size);
55
56 const size_t page_size_;
57};
58
67 subnet_id_(0), pool_id_(0), lease_type_(Lease::TYPE_NA),
68 lease_state_(Lease::STATE_DEFAULT), state_count_(0) {
69 }
70
80 LeaseStatsRow(const SubnetID& subnet_id, const uint32_t lease_state,
81 const int64_t state_count, uint32_t pool_id = 0)
82 : subnet_id_(subnet_id), pool_id_(pool_id), lease_type_(Lease::TYPE_NA),
83 lease_state_(lease_state), state_count_(state_count) {
84 }
85
94 LeaseStatsRow(const SubnetID& subnet_id, const Lease::Type& lease_type,
95 const uint32_t lease_state, const int64_t state_count,
96 uint32_t pool_id = 0)
97 : subnet_id_(subnet_id), pool_id_(pool_id), lease_type_(lease_type),
98 lease_state_(lease_state), state_count_(state_count) {
99 }
100
102 bool operator<(const LeaseStatsRow &rhs) const {
103 if (subnet_id_ < rhs.subnet_id_) {
104 return (true);
105 }
106
107 if (subnet_id_ == rhs.subnet_id_ &&
108 pool_id_ < rhs.pool_id_) {
109 return (true);
110 }
111
112 if (subnet_id_ == rhs.subnet_id_ &&
113 pool_id_ == rhs.pool_id_ &&
114 lease_type_ < rhs.lease_type_) {
115 return (true);
116 }
117
118 if (subnet_id_ == rhs.subnet_id_ &&
119 pool_id_ == rhs.pool_id_ &&
120 lease_type_ == rhs.lease_type_ &&
121 lease_state_ < rhs.lease_state_) {
122 return (true);
123 }
124
125 return (false);
126 }
127
130
132 uint32_t pool_id_;
133
136
138 uint32_t lease_state_;
139
142};
143
150public:
158
165 LeaseStatsQuery(const SelectMode& select_mode = ALL_SUBNETS);
166
173 LeaseStatsQuery(const SubnetID& subnet_id);
174
183 LeaseStatsQuery(const SubnetID& first_subnet_id, const SubnetID& last_subnet_id);
184
186 virtual ~LeaseStatsQuery() {}
187
193 virtual void start() {}
194
201 virtual bool getNextRow(LeaseStatsRow& row);
202
205 return (first_subnet_id_);
206 }
207
210 return (last_subnet_id_);
211 }
212
217 return (select_mode_);
218 }
219
220protected:
223
226
227private:
229 SelectMode select_mode_;
230};
231
233typedef boost::shared_ptr<LeaseStatsQuery> LeaseStatsQueryPtr;
234
236typedef boost::shared_ptr<LeaseStatsRow> LeaseStatsRowPtr;
237
248class LeaseMgr {
249public:
252 LeaseMgr() : extended_info_tables_enabled_(false)
253 {}
254
256 virtual ~LeaseMgr()
257 {}
258
261 static std::string getDBVersion();
262
274 virtual bool addLease(const Lease4Ptr& lease) = 0;
275
287 virtual bool addLease(const Lease6Ptr& lease) = 0;
288
301 virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress& addr) const = 0;
302
313 virtual Lease4Collection getLease4(const isc::dhcp::HWAddr& hwaddr) const = 0;
314
325 virtual Lease4Ptr getLease4(const isc::dhcp::HWAddr& hwaddr,
326 SubnetID subnet_id) const = 0;
327
338 virtual Lease4Collection getLease4(const ClientId& clientid) const = 0;
339
349 virtual Lease4Ptr getLease4(const ClientId& clientid,
350 SubnetID subnet_id) const = 0;
351
357 virtual Lease4Collection getLeases4(SubnetID subnet_id) const = 0;
358
364 virtual Lease4Collection getLeases4(const std::string& hostname) const = 0;
365
369 virtual Lease4Collection getLeases4() const = 0;
370
395 virtual Lease4Collection
396 getLeases4(const asiolink::IOAddress& lower_bound_address,
397 const LeasePageSize& page_size) const = 0;
398
410 const isc::asiolink::IOAddress& addr) const = 0;
411
424 virtual Lease6Collection getLeases6(Lease::Type type, const DUID& duid,
425 uint32_t iaid) const = 0;
426
438 virtual Lease6Collection getLeases6(Lease::Type type, const DUID& duid,
439 uint32_t iaid, SubnetID subnet_id) const = 0;
440
464 Lease6Ptr getLease6(Lease::Type type, const DUID& duid,
465 uint32_t iaid, SubnetID subnet_id) const;
466
472 virtual Lease6Collection getLeases6(SubnetID subnet_id) const = 0;
473
479 virtual Lease6Collection getLeases6(const std::string& hostname) const = 0;
480
484 virtual Lease6Collection getLeases6() const = 0;
485
490 virtual Lease6Collection getLeases6(const DUID& duid) const = 0;
491
516 virtual Lease6Collection
517 getLeases6(const asiolink::IOAddress& lower_bound_address,
518 const LeasePageSize& page_size) const = 0;
519
528 virtual Lease6Collection
530 const asiolink::IOAddress& lower_bound_address,
531 const LeasePageSize& page_size) const = 0;
532
543 virtual void getExpiredLeases4(Lease4Collection& expired_leases,
544 const size_t max_leases) const = 0;
545
556 virtual void getExpiredLeases6(Lease6Collection& expired_leases,
557 const size_t max_leases) const = 0;
558
564 virtual void updateLease4(const Lease4Ptr& lease4) = 0;
565
569 virtual void updateLease6(const Lease6Ptr& lease6) = 0;
570
579 virtual bool deleteLease(const Lease4Ptr& lease) = 0;
580
589 virtual bool deleteLease(const Lease6Ptr& lease) = 0;
590
598 virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs) = 0;
599
607 virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs) = 0;
608
626 void recountLeaseStats4();
627
638
651
662
674 virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery4(const SubnetID& first_subnet_id,
675 const SubnetID& last_subnet_id);
676
696 void recountLeaseStats6();
697
708
721
732
744 virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery6(const SubnetID& first_subnet_id,
745 const SubnetID& last_subnet_id);
746
754 virtual size_t wipeLeases4(const SubnetID& subnet_id) = 0;
755
763 virtual size_t wipeLeases6(const SubnetID& subnet_id) = 0;
764
776 virtual std::string checkLimits4(isc::data::ConstElementPtr const& user_context) const = 0;
777
789 virtual std::string checkLimits6(isc::data::ConstElementPtr const& user_context) const = 0;
790
795 virtual bool isJsonSupported() const = 0;
796
802 virtual std::string getType() const = 0;
803
810 virtual std::string getName() const = 0;
811
817 virtual std::string getDescription() const = 0;
818
834 virtual VersionPair getVersion(const std::string& timer_name = std::string()) const = 0;
835
840 virtual void commit() = 0;
841
846 virtual void rollback() = 0;
847
848 // -- The following are memfile only, but defined in the base LeaseMgr for convenience. --
849
857 virtual size_t getClassLeaseCount(const ClientClass& client_class,
858 const Lease::Type& ltype = Lease::TYPE_V4) const = 0;
859
861 virtual void recountClassLeases4() = 0;
862
864 virtual void recountClassLeases6() = 0;
865
867 virtual void clearClassLeaseCounts() = 0;
868
872
887 static bool
891
904 static bool
908
914 static void extractLease4ExtendedInfo(const Lease4Ptr& lease,
915 bool ignore_errors = true);
916
929 virtual Lease4Collection
931 const asiolink::IOAddress& lower_bound_address,
932 const LeasePageSize& page_size,
933 const time_t& qry_start_time = 0,
934 const time_t& qry_end_time = 0) = 0;
935
948 virtual Lease4Collection
950 const asiolink::IOAddress& lower_bound_address,
951 const LeasePageSize& page_size,
952 const time_t& qry_start_time = 0,
953 const time_t& qry_end_time = 0) = 0;
954
963 virtual Lease6Collection
964 getLeases6ByRelayId(const DUID& relay_id,
965 const asiolink::IOAddress& lower_bound_address,
966 const LeasePageSize& page_size) = 0;
967
976 virtual Lease6Collection
978 const asiolink::IOAddress& lower_bound_address,
979 const LeasePageSize& page_size) = 0;
980
984 virtual void writeLeases4(const std::string& filename) = 0;
985
989 virtual void writeLeases6(const std::string& filename) = 0;
990
1003 virtual size_t upgradeExtendedInfo4(const LeasePageSize& page_size) = 0;
1004
1011 return (extended_info_tables_enabled_);
1012 }
1013
1018 void setExtendedInfoTablesEnabled(const bool enabled) {
1019 extended_info_tables_enabled_ = enabled;
1020 }
1021
1034 virtual size_t upgradeExtendedInfo6(const LeasePageSize& page_size) = 0;
1035
1037 virtual void wipeExtendedInfoTables6() = 0;
1038
1044 virtual size_t byRelayId6size() const;
1045
1051 virtual size_t byRemoteId6size() const;
1052
1053protected:
1054
1056
1064
1069 virtual bool addExtendedInfo6(const Lease6Ptr& lease);
1070
1074 virtual void deleteExtendedInfo6(const isc::asiolink::IOAddress& addr) = 0;
1075
1080 virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
1081 const std::vector<uint8_t>& relay_id) = 0;
1082
1087 virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
1088 const std::vector<uint8_t>& remote_id) = 0;
1089
1090private:
1091
1094 bool extended_info_tables_enabled_;
1095};
1096
1097} // namespace dhcp
1098} // namespace isc
1099
1100#endif // LEASE_MGR_H
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
ExtendedInfoSanity
Values for extended info sanity checks done for leases.
Holds Client identifier or client IPv4 address.
Definition duid.h:222
Holds DUID (DHCPv6 Unique Identifier)
Definition duid.h:142
Abstract Lease Manager.
Definition lease_mgr.h:248
virtual Lease6Collection getLeases6(SubnetID subnet_id) const =0
Returns all IPv6 leases for the particular subnet identifier.
virtual Lease4Collection getLeases4(const std::string &hostname) const =0
Returns all IPv4 leases for the particular hostname.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID &subnet_id)
Creates and runs the IPv6 lease stats query for a single subnet.
Definition lease_mgr.cc:505
virtual void rollback()=0
Rollback Transactions.
virtual LeaseStatsQueryPtr startPoolLeaseStatsQuery6()
Creates and runs the IPv6 lease stats query for all subnets and pools.
Definition lease_mgr.cc:500
virtual Lease4Collection getLease4(const ClientId &clientid) const =0
Returns existing IPv4 lease for specified client-id.
virtual void wipeExtendedInfoTables6()=0
Wipe extended info table (v6).
virtual Lease6Collection getLeases6() const =0
Returns all IPv6 leases.
virtual Lease6Collection getLeases6(Lease::Type type, const DUID &duid, uint32_t iaid) const =0
Returns existing IPv6 leases for a given DUID+IA combination.
void recountLeaseStats6()
Recalculates per-subnet and global stats for IPv6 leases.
Definition lease_mgr.cc:282
virtual size_t upgradeExtendedInfo6(const LeasePageSize &page_size)=0
Upgrade extended info (v6).
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv6 leases.
virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs)=0
Deletes all expired and reclaimed DHCPv6 leases.
void setExtendedInfoTablesEnabled(const bool enabled)
Modifies the setting whether the lease6 extended info tables are enabled.
Definition lease_mgr.h:1018
virtual size_t byRelayId6size() const
Return the by-relay-id table size.
static bool upgradeLease6ExtendedInfo(const Lease6Ptr &lease, CfgConsistency::ExtendedInfoSanity check=CfgConsistency::EXTENDED_INFO_CHECK_FIX)
Upgrade a V6 lease user context to the new extended info entry.
Definition lease_mgr.cc:756
virtual size_t wipeLeases6(const SubnetID &subnet_id)=0
Virtual method which removes specified leases.
virtual size_t upgradeExtendedInfo4(const LeasePageSize &page_size)=0
Upgrade extended info (v4).
virtual Lease6Collection getLeases6ByRelayId(const DUID &relay_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size)=0
Returns existing IPv6 leases with a given relay-id.
virtual void recountClassLeases4()=0
Recount the leases per class for V4 leases.
virtual Lease4Collection getLeases4ByRemoteId(const OptionBuffer &remote_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size, const time_t &qry_start_time=0, const time_t &qry_end_time=0)=0
Returns existing IPv4 leases with a given remote-id.
virtual Lease4Collection getLeases4(SubnetID subnet_id) const =0
Returns all IPv4 leases for the particular subnet identifier.
virtual Lease4Collection getLeases4ByRelayId(const OptionBuffer &relay_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size, const time_t &qry_start_time=0, const time_t &qry_end_time=0)=0
Returns existing IPv4 leases with a given relay-id.
LeaseMgr()
Constructor.
Definition lease_mgr.h:252
virtual ~LeaseMgr()
Destructor.
Definition lease_mgr.h:256
virtual void writeLeases6(const std::string &filename)=0
Write V6 leases to a file.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const =0
Returns an IPv4 lease for specified IPv4 address.
virtual size_t byRemoteId6size() const
Return the by-remote-id table size.
bool getExtendedInfoTablesEnabled() const
Returns the setting indicating if lease6 extended info tables are enabled.
Definition lease_mgr.h:1010
virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs)=0
Deletes all expired and reclaimed DHCPv4 leases.
virtual Lease6Collection getLeases6(const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const =0
Returns range of IPv6 leases using paging.
virtual Lease4Ptr getLease4(const isc::dhcp::HWAddr &hwaddr, SubnetID subnet_id) const =0
Returns existing IPv4 leases for specified hardware address and a subnet.
virtual bool addLease(const Lease6Ptr &lease)=0
Adds an IPv6 lease.
virtual Lease6Collection getLeases6(Lease::Type type, const DUID &duid, uint32_t iaid, SubnetID subnet_id) const =0
Returns existing IPv6 lease for a given DUID+IA combination.
virtual void commit()=0
Commit Transactions.
virtual void addRelayId6(const isc::asiolink::IOAddress &lease_addr, const std::vector< uint8_t > &relay_id)=0
Add lease6 extended info into by-relay-id table.
virtual Lease6Collection getLeases6(const DUID &duid) const =0
Returns collection of leases for matching DUID.
virtual bool addLease(const Lease4Ptr &lease)=0
Adds an IPv4 lease.
virtual Lease6Collection getLeases6ByRemoteId(const OptionBuffer &remote_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size)=0
Returns existing IPv6 leases with a given remote-id.
virtual std::string getType() const =0
Return backend type.
virtual Lease4Ptr getLease4(const ClientId &clientid, SubnetID subnet_id) const =0
Returns existing IPv4 lease for specified client-id.
virtual size_t wipeLeases4(const SubnetID &subnet_id)=0
Virtual method which removes specified leases.
virtual bool deleteLease(const Lease4Ptr &lease)=0
Deletes an IPv4 lease.
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery4(const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
Creates and runs the IPv4 lease stats query for a single subnet.
Definition lease_mgr.cc:271
virtual std::string getName() const =0
Returns backend name.
void recountLeaseStats4()
Recalculates per-subnet and global stats for IPv4 leases.
Definition lease_mgr.cc:72
virtual bool isJsonSupported() const =0
Checks if JSON support is enabled in the database.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv4 leases.
static std::string getDBVersion()
Class method to return extended version info This class method must be redeclared and redefined in de...
Definition lease_mgr.cc:516
virtual void updateLease4(const Lease4Ptr &lease4)=0
Updates IPv4 lease.
virtual Lease4Collection getLeases4() const =0
Returns all IPv4 leases.
virtual std::string checkLimits6(isc::data::ConstElementPtr const &user_context) const =0
Checks if the IPv6 lease limits set in the given user context are exceeded.
virtual void writeLeases4(const std::string &filename)=0
Write V4 leases to a file.
virtual VersionPair getVersion(const std::string &timer_name=std::string()) const =0
Returns backend version.
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery6(const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
Creates and runs the IPv6 lease stats query for a single subnet.
Definition lease_mgr.cc:510
virtual void clearClassLeaseCounts()=0
Clears the class-lease count map.
virtual bool deleteLease(const Lease6Ptr &lease)=0
Deletes an IPv6 lease.
virtual Lease4Collection getLeases4(const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const =0
Returns range of IPv4 leases using paging.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID &subnet_id)
Creates and runs the IPv4 lease stats query for a single subnet.
Definition lease_mgr.cc:266
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const =0
Returns existing IPv6 lease for a given IPv6 address.
virtual Lease4Collection getLease4(const isc::dhcp::HWAddr &hwaddr) const =0
Returns existing IPv4 leases for specified hardware address.
virtual std::string getDescription() const =0
Returns description of the backend.
virtual void recountClassLeases6()=0
Recount the leases per class for V6 leases.
virtual LeaseStatsQueryPtr startLeaseStatsQuery4()
Creates and runs the IPv4 lease stats query for all subnets.
Definition lease_mgr.cc:256
static void extractLease4ExtendedInfo(const Lease4Ptr &lease, bool ignore_errors=true)
Extract relay and remote identifiers from the extended info.
virtual Lease6Collection getLeases6(SubnetID subnet_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const =0
Returns a page of IPv6 leases for a subnet identifier.
virtual void deleteExtendedInfo6(const isc::asiolink::IOAddress &addr)=0
Delete lease6 extended info from tables.
virtual size_t getClassLeaseCount(const ClientClass &client_class, const Lease::Type &ltype=Lease::TYPE_V4) const =0
Returns the class lease count for a given class and lease type.
static bool upgradeLease4ExtendedInfo(const Lease4Ptr &lease, CfgConsistency::ExtendedInfoSanity check=CfgConsistency::EXTENDED_INFO_CHECK_FIX)
The following queries are used to fulfill Bulk Lease Query queries.
Definition lease_mgr.cc:535
virtual void addRemoteId6(const isc::asiolink::IOAddress &lease_addr, const std::vector< uint8_t > &remote_id)=0
Add lease6 extended info into by-remote-id table.
virtual LeaseStatsQueryPtr startPoolLeaseStatsQuery4()
Creates and runs the IPv4 lease stats query for all subnets and pools.
Definition lease_mgr.cc:261
virtual bool addExtendedInfo6(const Lease6Ptr &lease)
Extract extended info from a lease6 and add it into tables.
virtual Lease6Collection getLeases6(const std::string &hostname) const =0
Returns all IPv6 leases for the particular hostname.
virtual std::string checkLimits4(isc::data::ConstElementPtr const &user_context) const =0
Checks if the IPv4 lease limits set in the given user context are exceeded.
virtual LeaseStatsQueryPtr startLeaseStatsQuery6()
Creates and runs the IPv6 lease stats query for all subnets.
Definition lease_mgr.cc:495
virtual void updateLease6(const Lease6Ptr &lease6)=0
Updates IPv6 lease.
Wraps value holding size of the page with leases.
Definition lease_mgr.h:46
const size_t page_size_
Holds page size.
Definition lease_mgr.h:56
LeasePageSize(const size_t page_size)
Constructor.
Definition lease_mgr.cc:41
Base class for fulfilling a statistical lease data query.
Definition lease_mgr.h:149
virtual ~LeaseStatsQuery()
virtual destructor
Definition lease_mgr.h:186
LeaseStatsQuery(const SelectMode &select_mode=ALL_SUBNETS)
Constructor to query statistics for all subnets.
Definition lease_mgr.cc:220
SubnetID getLastSubnetID() const
Returns the value of last subnet ID specified (or zero)
Definition lease_mgr.h:209
SubnetID first_subnet_id_
First (or only) subnet_id in the selection criteria.
Definition lease_mgr.h:222
virtual void start()
Executes the query.
Definition lease_mgr.h:193
SubnetID getFirstSubnetID() const
Returns the value of first subnet ID specified (or zero)
Definition lease_mgr.h:204
SelectMode getSelectMode() const
Returns the selection criteria mode The value returned is based upon the constructor variant used and...
Definition lease_mgr.h:216
SubnetID last_subnet_id_
Last subnet_id in the selection criteria when a range is given.
Definition lease_mgr.h:225
virtual bool getNextRow(LeaseStatsRow &row)
Fetches the next row of data.
Definition lease_mgr.cc:277
SelectMode
Defines the types of selection criteria supported.
Definition lease_mgr.h:152
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
std::string ClientClass
Defines a single class name.
Definition classify.h:42
std::pair< uint32_t, uint32_t > VersionPair
Pair containing major and minor versions.
Definition lease_mgr.h:43
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition lease.h:508
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
Definition lease.h:673
boost::shared_ptr< LeaseStatsQuery > LeaseStatsQueryPtr
Defines a pointer to a LeaseStatsQuery.
Definition lease_mgr.h:233
boost::shared_ptr< LeaseStatsRow > LeaseStatsRowPtr
Defines a pointer to a LeaseStatsRow.
Definition lease_mgr.h:236
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition option.h:24
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
Definition lease.h:500
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition lease.h:295
Defines the logger used by the top-level component of kea-lfc.
Hardware type that represents information from DHCPv4 packet.
Definition hwaddr.h:20
Contains a single row of lease statistical data.
Definition lease_mgr.h:64
LeaseStatsRow(const SubnetID &subnet_id, const uint32_t lease_state, const int64_t state_count, uint32_t pool_id=0)
Constructor.
Definition lease_mgr.h:80
uint32_t pool_id_
The pool ID to which this data applies.
Definition lease_mgr.h:132
int64_t state_count_
state_count The count of leases in the lease state
Definition lease_mgr.h:141
LeaseStatsRow(const SubnetID &subnet_id, const Lease::Type &lease_type, const uint32_t lease_state, const int64_t state_count, uint32_t pool_id=0)
Constructor.
Definition lease_mgr.h:94
LeaseStatsRow()
Default constructor.
Definition lease_mgr.h:66
uint32_t lease_state_
The lease_state to which the count applies.
Definition lease_mgr.h:138
SubnetID subnet_id_
The subnet ID to which this data applies.
Definition lease_mgr.h:129
bool operator<(const LeaseStatsRow &rhs) const
Less-than operator.
Definition lease_mgr.h:102
Lease::Type lease_type_
The lease_type to which the count applies.
Definition lease_mgr.h:135
a common structure for IPv4 and IPv6 leases
Definition lease.h:31
Type
Type of lease or pool.
Definition lease.h:46
@ TYPE_V4
IPv4 lease.
Definition lease.h:50