 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef MYSQL_LEASE_MGR_H
8 #define MYSQL_LEASE_MGR_H
15 #include <boost/scoped_ptr.hpp>
16 #include <boost/utility.hpp>
26 class MySqlLease4Exchange;
27 class MySqlLease6Exchange;
280 uint32_t iaid)
const;
299 uint32_t iaid,
SubnetID subnet_id)
const;
359 const size_t max_leases)
const;
372 const size_t max_leases)
const;
521 return (std::string(
"mysql"));
529 virtual std::string
getName()
const;
550 virtual std::pair<uint32_t, uint32_t>
getVersion()
const;
622 bool addLeaseCommon(
StatementIndex stindex, std::vector<MYSQL_BIND>& bind);
644 template <
typename Exchange,
typename LeaseCollection>
646 Exchange& exchange, LeaseCollection& result,
647 bool single =
false)
const;
667 getLeaseCollection(stindex, bind, exchange4_, result);
687 getLeaseCollection(stindex, bind, exchange6_, result);
729 template<
typename LeaseCollection>
730 void getExpiredLeasesCommon(LeaseCollection& expired_leases,
731 const size_t max_leases,
750 template <
typename LeasePtr>
769 uint64_t deleteLeaseCommon(
StatementIndex stindex, MYSQL_BIND* bind);
780 uint64_t deleteExpiredReclaimedLeasesCommon(
const uint32_t secs,
794 const char* what)
const;
802 boost::scoped_ptr<MySqlLease4Exchange> exchange4_;
803 boost::scoped_ptr<MySqlLease6Exchange> exchange6_;
806 db::MySqlConnection conn_;
812 #endif // MYSQL_LEASE_MGR_H
virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs)
Deletes all expired-reclaimed DHCPv4 leases.
Wraps value holding size of the page with leases.
virtual size_t wipeLeases4(const SubnetID &subnet_id)
Removes specified IPv4 leases.
virtual Lease4Collection getLeases4() const
Returns all IPv4 leases.
virtual bool addLease(const Lease4Ptr &lease)
Adds an IPv4 lease.
virtual std::string getDescription() const
Returns description of the backend.
virtual void commit()
Commit Transactions.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
StatementIndex
Statement Tags.
The IOAddress class represents an IP addresses (version agnostic)
virtual bool deleteLease(const isc::asiolink::IOAddress &addr)
Deletes a lease.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Type
Type of lease or pool.
@ DELETE_LEASE6_STATE_EXPIRED
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.
Hardware type that represents information from DHCPv4 packet.
An abstract API for lease database.
virtual LeaseStatsQueryPtr startLeaseStatsQuery6()
Creates and runs the IPv6 lease stats query.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID &subnet_id)
Creates and runs the IPv4 lease stats query for a single subnet.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const
Returns an IPv4 lease for specified IPv4 address.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual void updateLease4(const Lease4Ptr &lease4)
Updates IPv4 lease.
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const
Returns existing IPv6 lease for a given IPv6 address.
MySqlLeaseMgr(const db::DatabaseConnection::ParameterMap ¶meters)
Constructor.
Holds Client identifier or client IPv4 address.
virtual void updateLease6(const Lease6Ptr &lease6)
Updates IPv6 lease.
virtual void rollback()
Rollback Transactions.
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const
Returns a collection of expired DHCPv6 leases.
@ GET_LEASE4_CLIENTID_SUBID
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID &subnet_id)
Creates and runs the IPv6 lease stats query for a single subnet.
virtual std::pair< uint32_t, uint32_t > getVersion() const
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.
@ GET_LEASE4_HWADDR_SUBID
boost::shared_ptr< Lease > LeasePtr
Pointer to the lease object.
virtual size_t wipeLeases6(const SubnetID &subnet_id)
Removed specified IPv6 leases.
@ DELETE_LEASE4_STATE_EXPIRED
virtual std::string getType() const
Return backend type.
virtual std::string getName() const
Returns backend name.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const
Returns a collection of expired DHCPv4 leases.
@ SUBNET_RANGE_LEASE4_STATS
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
virtual LeaseStatsQueryPtr startLeaseStatsQuery4()
Creates and runs the IPv4 lease stats query.
boost::shared_ptr< LeaseStatsQuery > LeaseStatsQueryPtr
Defines a pointer to a LeaseStatsQuery.
Holds DUID (DHCPv6 Unique Identifier)
static std::string getDBVersion()
Local version of getDBVersion() class method.
@ SUBNET_RANGE_LEASE6_STATS
virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs)
Deletes all expired-reclaimed DHCPv6 leases.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
virtual Lease6Collection getLeases6() const
Returns all IPv6 leases.
virtual ~MySqlLeaseMgr()
Destructor (closes database)
@ GET_LEASE6_DUID_IAID_SUBID