19 #include <boost/noncopyable.hpp>
20 #include <boost/shared_ptr.hpp>
76 const int64_t state_count)
88 const uint32_t lease_state,
const int64_t state_count)
191 return (select_mode_);
399 uint32_t iaid)
const = 0;
413 uint32_t iaid,
SubnetID subnet_id)
const = 0;
439 uint32_t iaid,
SubnetID subnet_id)
const;
505 const size_t max_leases)
const = 0;
518 const size_t max_leases)
const = 0;
705 virtual std::string
getType()
const = 0;
713 virtual std::string
getName()
const = 0;
742 virtual void commit() = 0;
754 io_service_ = io_service;
759 return (io_service_);
770 #endif // LEASE_MGR_H
virtual std::string getType() const =0
Return backend type.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID &subnet_id)
Creates and runs the IPv6 lease stats query for a single subnet.
virtual void updateLease4(const Lease4Ptr &lease4)=0
Updates IPv4 lease.
std::pair< uint32_t, uint32_t > VersionPair
Pair containing major and minor versions.
boost::shared_ptr< LeaseStatsQuery > LeaseStatsQueryPtr
Defines a pointer to a LeaseStatsQuery.
SelectMode getSelectMode() const
Returns the selection criteria mode The value returned is based upon the constructor variant used and...
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.
LeasePageSize(const size_t page_size)
Constructor.
virtual size_t wipeLeases4(const SubnetID &subnet_id)=0
Virtual method which removes specified leases.
virtual LeaseStatsQueryPtr startLeaseStatsQuery4()
Creates and runs the IPv4 lease stats query for all subnets.
LeaseStatsQuery()
Default constructor The query created will return statistics for all subnets.
virtual Lease4Collection getLeases4() const =0
Returns all IPv4 leases.
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
LeaseStatsRow()
Default constructor.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs)=0
Deletes all expired and reclaimed DHCPv4 leases.
Base class for fulfilling a statistical lease data query.
virtual std::string getName() const =0
Returns backend name.
Holds DUID (DHCPv6 Unique Identifier)
virtual void rollback()=0
Rollback Transactions.
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv6 leases.
virtual std::string getDescription() const =0
Returns description of the backend.
static isc::asiolink::IOServicePtr & getIOService()
Returns pointer to the IO service.
static std::string getDBVersion()
Class method to return extended version info This class method must be redeclared and redefined in de...
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID &subnet_id)
Creates and runs the IPv4 lease stats query for a single subnet.
virtual Lease6Collection getLeases6() const =0
Returns all IPv6 leases.
virtual ~LeaseStatsQuery()
virtual destructor
const size_t page_size_
Holds page size.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
SubnetID last_subnet_id_
Last subnet_id in the selection criteria when a range is given.
LeaseStatsRow(const SubnetID &subnet_id, const uint32_t lease_state, const int64_t state_count)
Constructor.
SelectMode
Defines the types of selection criteria supported.
SubnetID subnet_id_
The subnet ID to which this data applies.
void recountLeaseStats4()
Recalculates per-subnet and global stats for IPv4 leases.
virtual void commit()=0
Commit Transactions.
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const =0
Returns existing IPv6 lease for a given IPv6 address.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv4 leases.
virtual ~LeaseMgr()
Destructor.
boost::shared_ptr< LeaseStatsRow > LeaseStatsRowPtr
Defines a pointer to a LeaseStatsRow.
virtual VersionPair getVersion() const =0
Returns backend version.
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.
Defines the logger used by the top-level component of kea-dhcp-ddns.
LeaseStatsRow(const SubnetID &subnet_id, const Lease::Type &lease_type, const uint32_t lease_state, const int64_t state_count)
Constructor.
virtual LeaseStatsQueryPtr startLeaseStatsQuery6()
Creates and runs the IPv6 lease stats query for all subnets.
bool operator<(const LeaseStatsRow &rhs) const
Less-than operator.
virtual void start()
Executes the query.
a common structure for IPv4 and IPv6 leases
uint32_t lease_state_
The lease_state to which the count applies.
Type
Type of lease or pool.
Holds Client identifier or client IPv4 address.
Hardware type that represents information from DHCPv4 packet.
virtual bool addLease(const Lease4Ptr &lease)=0
Adds an IPv4 lease.
SubnetID first_subnet_id_
First (or only) subnet_id in the selection criteria.
int64_t state_count_
state_count The count of leases in the lease state
virtual size_t wipeLeases6(const SubnetID &subnet_id)=0
Virtual method which removes specified leases.
static void setIOService(const isc::asiolink::IOServicePtr &io_service)
Sets IO service to be used by the Lease Manager.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const =0
Returns an IPv4 lease for specified IPv4 address.
void recountLeaseStats6()
Recalculates per-subnet and global stats for IPv6 leases.
SubnetID getFirstSubnetID() const
Returns the value of first subnet ID specified (or zero)
virtual bool deleteLease(const Lease4Ptr &lease)=0
Deletes an IPv4 lease.
Contains a single row of lease statistical data.
Wraps value holding size of the page with leases.
Lease::Type lease_type_
The lease_type to which the count applies.
SubnetID getLastSubnetID() const
Returns the value of last subnet ID specified (or zero)
The IOAddress class represents an IP addresses (version agnostic)
virtual bool getNextRow(LeaseStatsRow &row)
Fetches the next row of data.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs)=0
Deletes all expired and reclaimed DHCPv6 leases.
virtual void updateLease6(const Lease6Ptr &lease6)=0
Updates IPv6 lease.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)