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