Kea 3.3.3
memfile_lease_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2012-2026 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 MEMFILE_LEASE_MGR_H
8#define MEMFILE_LEASE_MGR_H
9
13#include <dhcp/hwaddr.h>
20
21#include <cstdint>
22#include <mutex>
23
24#include <boost/scoped_ptr.hpp>
25#include <boost/shared_ptr.hpp>
26
27namespace isc {
28namespace dhcp {
29
30class LFCSetup;
31
83public:
84
95 static const int MAJOR_VERSION_V4 = 3;
96
98 static const int MINOR_VERSION_V4 = 0;
100
113 static const int MAJOR_VERSION_V6 = 5;
114
116 static const int MINOR_VERSION_V6 = 0;
118
125 enum Universe : uint16_t {
128 };
129
133
134
156
158 virtual ~Memfile_LeaseMgr();
159
161 static std::string getDBVersion();
162
164 static std::string getDBVersionInternal(Universe const& u);
165
171 virtual bool addLease(const Lease4Ptr& lease) override;
172
178 virtual bool addLease(const Lease6Ptr& lease) override;
179
188 virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress& addr) const override;
189
200 virtual Lease4Collection getLease4(const isc::dhcp::HWAddr& hwaddr) const override;
201
215 virtual Lease4Ptr getLease4(const HWAddr& hwaddr,
216 SubnetID subnet_id) const override;
217
223 virtual Lease4Collection getLease4(const ClientId& client_id) const override;
224
237 virtual Lease4Ptr getLease4(const ClientId& clientid,
238 SubnetID subnet_id) const override;
239
245 virtual Lease4Collection getLeases4(SubnetID subnet_id) const override;
246
252 virtual Lease4Collection getLeases4(const std::string& hostname) const override;
253
257 virtual Lease4Collection getLeases4() const override;
258
283 virtual Lease4Collection
284 getLeases4(const asiolink::IOAddress& lower_bound_address,
285 const LeasePageSize& page_size) const override;
286
293 virtual Lease4Collection getLeases4(uint32_t state,
294 SubnetID subnet_id) const override;
295
305 virtual Lease6Ptr getLease6(Lease::Type type,
306 const isc::asiolink::IOAddress& addr) const override;
307
318 virtual Lease6Collection getLease6(const isc::dhcp::HWAddr& hwaddr) const override;
319
329 const DUID& duid,
330 uint32_t iaid) const override;
331
345 const DUID& duid,
346 uint32_t iaid,
347 SubnetID subnet_id) const override;
348
354 virtual Lease6Collection getLeases6(SubnetID subnet_id) const override;
355
361 virtual Lease6Collection getLeases6(const std::string& hostname) const override;
362
366 virtual Lease6Collection getLeases6() const override;
367
371 virtual Lease6Collection getLeases6(const DUID& duid) const override;
372
397 virtual Lease6Collection
398 getLeases6(const asiolink::IOAddress& lower_bound_address,
399 const LeasePageSize& page_size) const override;
400
409 virtual Lease6Collection
410 getLeases6(SubnetID subnet_id,
411 const asiolink::IOAddress& lower_bound_address,
412 const LeasePageSize& page_size) const override;
413
420 virtual Lease6Collection getLeases6(uint32_t state,
421 SubnetID subnet_id) const override;
422
433 virtual void getExpiredLeases4(Lease4Collection& expired_leases,
434 const size_t max_leases) const override;
435
446 virtual void getExpiredLeases6(Lease6Collection& expired_leases,
447 const size_t max_leases) const override;
448
466 virtual void updateLease4(const Lease4Ptr& lease4) override;
467
485 virtual void updateLease6(const Lease6Ptr& lease6) override;
486
501 virtual bool deleteLease(const Lease4Ptr& lease) override;
502
517 virtual bool deleteLease(const Lease6Ptr& lease) override;
518
526 virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs) override;
527
535 virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs) override;
536
545 virtual size_t wipeLeases4(const SubnetID& subnet_id) override;
546
555 virtual size_t wipeLeases6(const SubnetID& subnet_id) override;
556
568 virtual std::string
569 checkLimits4(isc::data::ConstElementPtr const& user_context) const override;
570
582 virtual std::string
583 checkLimits6(isc::data::ConstElementPtr const& user_context) const override;
584
585private:
586
590
596 bool addLeaseInternal(const Lease4Ptr& lease);
597
603 bool addLeaseInternal(const Lease6Ptr& lease);
604
610 Lease4Ptr getLease4Internal(const isc::asiolink::IOAddress& addr) const;
611
616 void getLease4Internal(const isc::dhcp::HWAddr& hwaddr,
617 Lease4Collection& collection) const;
618
626 Lease4Ptr getLease4Internal(const HWAddr& hwaddr,
627 SubnetID subnet_id) const;
628
633 void getLease4Internal(const ClientId& client_id,
634 Lease4Collection& collection) const;
635
643 Lease4Ptr getLease4Internal(const ClientId& clientid,
644 const HWAddr& hwaddr,
645 SubnetID subnet_id) const;
646
653 Lease4Ptr getLease4Internal(const ClientId& clientid,
654 SubnetID subnet_id) const;
655
660 void getLeases4Internal(SubnetID subnet_id,
661 Lease4Collection& collection) const;
662
667 void getLeases4Internal(const std::string& hostname,
668 Lease4Collection& collection) const;
669
673 void getLeases4Internal(Lease4Collection& collection) const;
674
681 void getLeases4Internal(const asiolink::IOAddress& lower_bound_address,
682 const LeasePageSize& page_size,
683 Lease4Collection& collection) const;
684
690 void getLeases4ByStateInternal(uint32_t state,
691 SubnetID subnet_id,
692 Lease4Collection& collection) const;
693
698 void getLeases4ByStateInternal(uint32_t state,
699 Lease4Collection& collection) const;
700
707 Lease6Ptr getLease6Internal(Lease::Type type,
708 const isc::asiolink::IOAddress& addr) const;
709
714 void getLease6Internal(const isc::dhcp::HWAddr& hwaddr,
715 Lease6Collection& collection) const;
716
722 Lease6Ptr getAnyLease6Internal(const isc::asiolink::IOAddress& addr) const;
723
731 void getLeases6Internal(Lease::Type type,
732 const DUID& duid,
733 uint32_t iaid,
734 Lease6Collection& collection) const;
735
744 void getLeases6Internal(Lease::Type type,
745 const DUID& duid,
746 uint32_t iaid,
747 SubnetID subnet_id,
748 Lease6Collection& collection) const;
749
754 void getLeases6Internal(SubnetID subnet_id,
755 Lease6Collection& collection) const;
756
761 void getLeases6Internal(const std::string& hostname,
762 Lease6Collection& collection) const;
763
767 void getLeases6Internal(Lease6Collection& collection) const;
768
773 void getLeases6Internal(const DUID& duid,
774 Lease6Collection& collection) const;
775
782 void getLeases6Internal(const asiolink::IOAddress& lower_bound_address,
783 const LeasePageSize& page_size,
784 Lease6Collection& collection) const;
785
794 virtual Lease6Collection
795 getLeases6Internal(SubnetID subnet_id,
796 const asiolink::IOAddress& lower_bound_address,
797 const LeasePageSize& page_size) const;
798
804 void getLeases6ByStateInternal(uint32_t state,
805 SubnetID subnet_id,
806 Lease6Collection& collection) const;
807
812 void getLeases6ByStateInternal(uint32_t state,
813 Lease6Collection& collection) const;
814
821 void getExpiredLeases4Internal(Lease4Collection& expired_leases,
822 const size_t max_leases) const;
823
830 void getExpiredLeases6Internal(Lease6Collection& expired_leases,
831 const size_t max_leases) const;
832
847 void updateLease4Internal(const Lease4Ptr& lease4);
848
863 void updateLease6Internal(const Lease6Ptr& lease6);
864
879 bool deleteLeaseInternal(const Lease4Ptr& addr);
880
895 bool deleteLeaseInternal(const Lease6Ptr& addr);
896
902 size_t wipeLeases4Internal(const SubnetID& subnet_id);
903
909 size_t wipeLeases6Internal(const SubnetID& subnet_id);
911
938 template<typename IndexType, typename LeaseType, typename StorageType,
939 typename LeaseFileType>
940 uint64_t deleteExpiredReclaimedLeases(const uint32_t secs,
941 const Universe& universe,
942 StorageType& storage,
943 LeaseFileType& lease_file);
944
951 int64_t getSubnetStat(const SubnetID& subnet_id, const std::string& stat_label) const;
952
963 bool getLeaseLimit(data::ConstElementPtr parent, Lease::Type ltype, size_t& limit) const;
964
965public:
966
972 virtual std::string getType() const override {
973 return (std::string("memfile"));
974 }
975
981 virtual std::string getName() const override {
982 return ("memory");
983 }
984
990 virtual std::string getDescription() const override;
991
997 virtual std::pair<uint32_t, uint32_t> getVersion(const std::string& timer_name = std::string()) const override;
998
1003 virtual void commit() override;
1004
1009 virtual void rollback() override;
1010
1014 static bool isLFCProcessRunning(const std::string file_name, Universe u);
1015
1022 virtual data::ElementPtr getStatus() const override;
1023
1025
1027
1028
1041
1060 static std::string appendSuffix(const std::string& file_name,
1061 const LFCFileType& file_type);
1063
1067
1068
1073 static std::string getDefaultLeaseFilePath(Universe u,
1074 const std::string filename = "");
1075
1082 std::string getLeaseFilePath(Universe u) const;
1083
1095 bool persistLeases(Universe u) const;
1096
1098
1099private:
1100
1116 std::string initLeaseFilePath(Universe u);
1117
1174 template<typename LeaseObjectType, typename LeaseFileType,
1175 typename StorageType>
1176 bool loadLeasesFromFiles(Universe u, const std::string& filename,
1177 boost::shared_ptr<LeaseFileType>& lease_file,
1178 StorageType& storage);
1179
1181 Lease4Storage storage4_;
1182
1184 Lease6Storage storage6_;
1185
1186protected:
1187
1190
1193
1195 boost::shared_ptr<CSVLeaseFile4> lease_file4_;
1196
1198 boost::shared_ptr<CSVLeaseFile6> lease_file6_;
1199
1200public:
1201
1206
1207
1211 bool isLFCRunning() const;
1212
1215 int getLFCExitStatus() const;
1216
1218 int getLFCLastPid() const;
1220
1228 virtual LeaseStatsQueryPtr startLeaseStatsQuery4() override;
1229
1242
1251 virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID& subnet_id) override;
1252
1262 virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery4(const SubnetID& first_subnet_id,
1263 const SubnetID& last_subnet_id) override;
1264
1272 virtual LeaseStatsQueryPtr startLeaseStatsQuery6() override;
1273
1286
1295 virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID& subnet_id) override;
1296
1306 virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery6(const SubnetID& first_subnet_id,
1307 const SubnetID& last_subnet_id) override;
1308
1312
1313
1314protected:
1315
1327 virtual void lfcCallback();
1329
1331
1332
1333private:
1334
1351 void lfcSetup(bool conversion_needed = false);
1352
1375 template<typename LeaseFileType>
1376 void lfcExecute(boost::shared_ptr<LeaseFileType>& lease_file);
1377
1379 boost::scoped_ptr<LFCSetup> lfc_setup_;
1380
1386
1388
1390 boost::scoped_ptr<std::mutex> mutex_;
1391
1393 ClassLeaseCounter class_lease_counter_;
1394
1395public:
1403 virtual size_t getClassLeaseCount(const ClientClass& client_class,
1404 const Lease::Type& ltype = Lease::TYPE_V4) const override;
1405
1413 virtual void recountClassLeases4() override;
1414
1422 virtual void recountClassLeases6() override;
1423
1427 virtual void clearClassLeaseCounts() override;
1428
1432
1445 virtual Lease4Collection
1446 getLeases4ByRelayId(const OptionBuffer& relay_id,
1447 const asiolink::IOAddress& lower_bound_address,
1448 const LeasePageSize& page_size,
1449 const time_t& qry_start_time = 0,
1450 const time_t& qry_end_time = 0) override;
1451
1464 virtual Lease4Collection
1465 getLeases4ByRemoteId(const OptionBuffer& remote_id,
1466 const asiolink::IOAddress& lower_bound_address,
1467 const LeasePageSize& page_size,
1468 const time_t& qry_start_time = 0,
1469 const time_t& qry_end_time = 0) override;
1470
1479 virtual Lease6Collection
1480 getLeases6ByRelayId(const DUID& relay_id,
1481 const asiolink::IOAddress& lower_bound_address,
1482 const LeasePageSize& page_size) override;
1483
1492 virtual Lease6Collection
1493 getLeases6ByRemoteId(const OptionBuffer& remote_id,
1494 const asiolink::IOAddress& lower_bound_address,
1495 const LeasePageSize& page_size) override;
1496
1506 size_t extractExtendedInfo4(bool update, bool current);
1507
1512 virtual size_t upgradeExtendedInfo6(const LeasePageSize& page_size) override;
1513
1515 virtual void wipeExtendedInfoTables6() override;
1516
1520 virtual size_t byRelayId6size() const override;
1521
1525 virtual size_t byRemoteId6size() const override;
1526
1527private:
1528
1542 getLeases4ByRelayIdInternal(const OptionBuffer& relay_id,
1543 const asiolink::IOAddress& lower_bound_address,
1544 const LeasePageSize& page_size,
1545 const time_t& qry_start_time,
1546 const time_t& qry_end_time);
1547
1561 getLeases4ByRemoteIdInternal(const OptionBuffer& remote_id,
1562 const asiolink::IOAddress& lower_bound_address,
1563 const LeasePageSize& page_size,
1564 const time_t& qry_start_time,
1565 const time_t& qry_end_time);
1566
1576 getLeases6ByRelayIdInternal(const DUID& relay_id,
1577 const asiolink::IOAddress& lower_bound_address,
1578 const LeasePageSize& page_size);
1579
1589 getLeases6ByRemoteIdInternal(const OptionBuffer& remote_id,
1590 const asiolink::IOAddress& lower_bound_address,
1591 const LeasePageSize& page_size);
1592
1593public:
1594
1598 virtual void writeLeases4(const std::string& filename) override;
1599
1603 virtual void writeLeases6(const std::string& filename) override;
1604
1609 virtual size_t upgradeExtendedInfo4(const LeasePageSize& page_size) override;
1610
1615
1616protected:
1617
1619
1622
1626 virtual void deleteExtendedInfo6(const isc::asiolink::IOAddress& addr) override;
1627
1632 virtual void addRelayId6(const isc::asiolink::IOAddress& lease_addr,
1633 const std::vector<uint8_t>& relay_id) override;
1634
1639 virtual void addRemoteId6(const isc::asiolink::IOAddress& lease_addr,
1640 const std::vector<uint8_t>& remote_id) override;
1641
1642private:
1647 virtual void writeLeases4Internal(const std::string& filename);
1648
1653 virtual void writeLeases6Internal(const std::string& filename);
1654
1659 void handleDbLost();
1660
1661public:
1668 static TrackingLeaseMgrPtr
1670
1674 return (conn_.reconnectCtl());
1675 }
1676};
1677
1680 // Constructor registers
1687
1688 // Destructor deregisters
1692};
1693
1694} // namespace dhcp
1695} // namespace isc
1696
1697#endif // MEMFILE_LEASE_MGR_H
Common database connection class.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
Container that maintains counts of leases per class and lease type.
Holds Client identifier or client IPv4 address.
Definition duid.h:222
Holds DUID (DHCPv6 Unique Identifier).
Definition duid.h:142
Represents a configuration for Lease File Cleanup.
static bool registerFactory(const std::string &db_type, const Factory &factory, bool no_log=false, DBVersion db_version=DBVersion())
Register a lease mgr factory.
static bool deregisterFactory(const std::string &db_type, bool no_log=false)
Deregister a lease mgr factory.
Wraps value holding size of the page with leases.
Definition lease_mgr.h:47
Lease6ExtendedInfoRemoteIdTable remote_id6_
stores IPv6 by-remote-id cross-reference table
virtual void rollback() override
Rollback Transactions.
size_t extractExtendedInfo4(bool update, bool current)
Extract extended info for v4 leases.
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery6(const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) override
Creates and runs the IPv6 lease stats query for a single subnet.
virtual void clearClassLeaseCounts() override
Clears the class-lease count map.
virtual size_t byRelayId6size() const override
Return the by-relay-id table size.
virtual data::ElementPtr getStatus() const override
Return status information.
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) override
The following queries are used to fulfill Bulk Lease Query queries.
Memfile_LeaseMgr(const db::DatabaseConnection::ParameterMap &parameters)
The sole lease manager constructor.
bool isLFCRunning() const
Checks if the process performing lease file cleanup is running.
virtual void writeLeases4(const std::string &filename) override
Write V4 leases to a file.
virtual void updateLease4(const Lease4Ptr &lease4) override
Updates IPv4 lease.
virtual size_t wipeLeases4(const SubnetID &subnet_id) override
Removes specified IPv4 leases.
virtual void deleteExtendedInfo6(const isc::asiolink::IOAddress &addr) override
Delete lease6 extended info from tables.
static bool isLFCProcessRunning(const std::string file_name, Universe u)
Check if LFC is running.
LFCFileType
Types of the lease files used by the Lease File Cleanup.
@ FILE_PREVIOUS
Previous Lease File.
static std::string getDefaultLeaseFilePath(Universe u, const std::string filename="")
Returns default path to the lease file.
virtual std::string getType() const override
Return backend type.
static TrackingLeaseMgrPtr factory(const isc::db::DatabaseConnection::ParameterMap &parameters)
Factory class method.
Universe
Specifies universe (V4, V6).
virtual bool deleteLease(const Lease4Ptr &lease) override
Deletes an IPv4 lease.
virtual void commit() override
Commit Transactions.
virtual size_t wipeLeases6(const SubnetID &subnet_id) override
Removed specified IPv6 leases.
virtual std::pair< uint32_t, uint32_t > getVersion(const std::string &timer_name=std::string()) const override
Returns backend version.
int getLFCExitStatus() const
Returns the status code returned by the last executed LFC process.
virtual LeaseStatsQueryPtr startPoolLeaseStatsQuery6() override
Creates and runs the IPv6 lease stats query for all subnets and pools.
bool persistLeases(Universe u) const
Specifies whether or not leases are written to disk.
virtual std::string getName() const override
Returns backend name.
virtual void addRemoteId6(const isc::asiolink::IOAddress &lease_addr, const std::vector< uint8_t > &remote_id) override
Add lease6 extended info into by-remote-id table.
static std::string getDBVersion()
Return extended version info.
virtual Lease4Collection getLeases4() const override
Returns all IPv4 leases.
virtual size_t getClassLeaseCount(const ClientClass &client_class, const Lease::Type &ltype=Lease::TYPE_V4) const override
Returns the class lease count for a given class and lease type.
virtual isc::data::ConstElementPtr lfcStartHandler() override
Handler for kea-lfc-start command.
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const override
Returns a collection of expired DHCPv6 leases.
void buildExtendedInfoTables6()
Extended information / Bulk Lease Query shared interface.
virtual bool addLease(const Lease4Ptr &lease) override
Adds an IPv4 lease.
virtual size_t byRemoteId6size() const override
Return the by-remote-id table size.
virtual void writeLeases6(const std::string &filename) override
Write V6 leases to a file.
Lease6ExtendedInfoRelayIdTable relay_id6_
stores IPv6 by-relay-id cross-reference table
virtual void recountClassLeases6() override
Recount the leases per class for V6 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) override
Returns existing IPv4 leases with a given remote-id.
virtual void wipeExtendedInfoTables6() override
Wipe extended info table (v6).
boost::shared_ptr< CSVLeaseFile4 > lease_file4_
Holds the pointer to the DHCPv4 lease file IO.
std::string getLeaseFilePath(Universe u) const
Returns an absolute path to the lease file.
virtual Lease6Collection getLeases6ByRemoteId(const OptionBuffer &remote_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) override
Returns existing IPv6 leases with a given remote-id.
virtual Lease6Collection getLeases6() const override
Returns all IPv6 leases.
util::ReconnectCtlPtr reconnectCtl()
Returns the connection's ReconnectCtl object.
virtual void lfcCallback()
A callback function triggering Lease File Cleanup (LFC).
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID &subnet_id) override
Creates and runs the IPv4 lease stats query for a single subnet.
int getLFCLastPid() const
Returns the last lfc process id.
virtual Lease6Collection getLeases6ByRelayId(const DUID &relay_id, const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) override
Returns existing IPv6 leases with a given relay-id.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID &subnet_id) override
Creates and runs the IPv6 lease stats query for a single subnet.
virtual std::string getDescription() const override
Returns description of the backend.
static std::string appendSuffix(const std::string &file_name, const LFCFileType &file_type)
Appends appropriate suffix to the file name.
virtual void addRelayId6(const isc::asiolink::IOAddress &lease_addr, const std::vector< uint8_t > &relay_id) override
Add lease6 extended info into by-relay-id table.
virtual size_t upgradeExtendedInfo6(const LeasePageSize &page_size) override
Upgrade extended info (v6).
virtual LeaseStatsQueryPtr startLeaseStatsQuery4() override
Creates and runs the IPv4 lease stats query.
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const override
Returns existing IPv6 lease for a given IPv6 address.
virtual void recountClassLeases4() override
Recount the leases per class for V4 leases.
virtual void updateLease6(const Lease6Ptr &lease6) override
Updates IPv6 lease.
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery4(const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) override
Creates and runs the IPv4 lease stats query for a single subnet.
virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs) override
Deletes all expired-reclaimed DHCPv4 leases.
static std::string getDBVersionInternal(Universe const &u)
Local version of getDBVersion() class method.
virtual LeaseStatsQueryPtr startPoolLeaseStatsQuery4() override
Creates and runs the IPv4 lease stats query for all subnets and pools.
virtual std::string checkLimits6(isc::data::ConstElementPtr const &user_context) const override
Checks if the IPv6 lease limits set in the given user context are exceeded.
virtual LeaseStatsQueryPtr startLeaseStatsQuery6() override
Creates and runs the IPv6 lease stats query.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const override
Returns existing IPv4 lease for specified IPv4 address.
virtual ~Memfile_LeaseMgr()
Destructor (closes file).
virtual std::string checkLimits4(isc::data::ConstElementPtr const &user_context) const override
Checks if the IPv4 lease limits set in the given user context are exceeded.
boost::shared_ptr< CSVLeaseFile6 > lease_file6_
Holds the pointer to the DHCPv6 lease file IO.
virtual size_t upgradeExtendedInfo4(const LeasePageSize &page_size) override
Upgrade extended info (v4).
virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs) override
Deletes all expired-reclaimed DHCPv6 leases.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const override
Returns a collection of expired DHCPv4 leases.
static const int MINOR_VERSION_V4
the minor version of the v4 memfile backend
static const int MINOR_VERSION_V6
the minor version of the v6 memfile backend
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
std::string ClientClass
Defines a single class name.
Definition classify.h:45
boost::multi_index_container< Lease6ExtendedInfoPtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< RemoteIdIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, std::vector< uint8_t >, &Lease6ExtendedInfo::id_ > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< LeaseAddressIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > > > Lease6ExtendedInfoRemoteIdTable
A multi index container holding lease6 extended info for by remote id.
boost::multi_index_container< Lease6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< AddressIndexTag >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< DuidIaidTypeIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::const_mem_fun< Lease6, const std::vector< uint8_t > &, &Lease6::getDuidVector >, boost::multi_index::member< Lease6, uint32_t, &Lease6::iaid_ >, boost::multi_index::member< Lease6, Lease::Type, &Lease6::type_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ExpirationIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::const_mem_fun< Lease, bool, &Lease::stateExpiredReclaimed >, boost::multi_index::const_mem_fun< Lease, int64_t, &Lease::getExpirationTime > > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetIdIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::member< Lease, isc::dhcp::SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< DuidIndexTag >, boost::multi_index::const_mem_fun< Lease6, const std::vector< uint8_t > &, &Lease6::getDuidVector > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostnameIndexTag >, boost::multi_index::member< Lease, std::string, &Lease::hostname_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdPoolIdIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, uint32_t, &Lease::pool_id_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< HWAddressIndexTag >, boost::multi_index::const_mem_fun< Lease, const std::vector< uint8_t > &, &Lease::getHWAddrVector > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< StateIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::member< Lease, uint32_t, &Lease::state_ >, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ > > > > > Lease6Storage
A multi index container holding DHCPv6 leases.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition lease.h:556
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
Definition lease.h:721
boost::shared_ptr< LeaseStatsQuery > LeaseStatsQueryPtr
Defines a pointer to a LeaseStatsQuery.
Definition lease_mgr.h:234
boost::multi_index_container< Lease4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< AddressIndexTag >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HWAddressSubnetIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease, const std::vector< uint8_t > &, &Lease::getHWAddrVector >, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ClientIdSubnetIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease4, const std::vector< uint8_t > &, &Lease4::getClientIdVector >, boost::multi_index::member< Lease, uint32_t, &Lease::subnet_id_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ExpirationIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease, bool, &Lease::stateExpiredReclaimed >, boost::multi_index::const_mem_fun< Lease, int64_t, &Lease::getExpirationTime > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdIndexTag >, boost::multi_index::member< Lease, isc::dhcp::SubnetID, &Lease::subnet_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostnameIndexTag >, boost::multi_index::member< Lease, std::string, &Lease::hostname_ > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< RemoteIdIndexTag >, boost::multi_index::member< Lease4, std::vector< uint8_t >, &Lease4::remote_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< RelayIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::member< Lease4, std::vector< uint8_t >, &Lease4::relay_id_ >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdPoolIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, uint32_t, &Lease::pool_id_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< StateIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::member< Lease, uint32_t, &Lease::state_ >, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ > > > > > Lease4Storage
A multi index container holding DHCPv4 leases.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
std::unique_ptr< TrackingLeaseMgr > TrackingLeaseMgrPtr
TrackingLeaseMgr pointer.
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition option.h:25
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
Definition lease.h:548
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition lease.h:343
boost::multi_index_container< Lease6ExtendedInfoPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< RelayIdIndexTag >, boost::multi_index::composite_key< Lease6ExtendedInfo, boost::multi_index::member< Lease6ExtendedInfo, std::vector< uint8_t >, &Lease6ExtendedInfo::id_ >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< LeaseAddressIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > > > Lease6ExtendedInfoRelayIdTable
A multi index container holding lease6 extended info for by relay id.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.
Hardware type that represents information from DHCPv4 packet.
Definition hwaddr.h:20
Type
Type of lease or pool.
Definition lease.h:48
@ TYPE_V4
IPv4 lease.
Definition lease.h:52