 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef PGSQL_LEASE_MGR_H
8 #define PGSQL_LEASE_MGR_H
16 #include <boost/scoped_ptr.hpp>
17 #include <boost/utility.hpp>
26 class PgSqlLease4Exchange;
27 class PgSqlLease6Exchange;
255 uint32_t iaid)
const;
271 uint32_t iaid,
SubnetID subnet_id)
const;
331 const size_t max_leases)
const;
344 const size_t max_leases)
const;
492 return (std::string(
"postgresql"));
498 virtual std::string
getName()
const;
519 virtual std::pair<uint32_t, uint32_t>
getVersion()
const;
613 template <
typename Exchange,
typename LeaseCollection>
615 Exchange& exchange, LeaseCollection& result,
616 bool single =
false)
const;
636 getLeaseCollection(stindex, bind_array, exchange4_, result);
656 getLeaseCollection(stindex, bind_array, exchange6_, result);
668 void getLease(
StatementIndex stindex, db::PsqlBindArray& bind_array,
680 void getLease(
StatementIndex stindex, db::PsqlBindArray& bind_array,
697 template<
typename LeaseCollection>
698 void getExpiredLeasesCommon(LeaseCollection& expired_leases,
699 const size_t max_leases,
717 template <
typename LeasePtr>
718 void updateLeaseCommon(
StatementIndex stindex, db::PsqlBindArray& bind_array,
736 db::PsqlBindArray& bind_array);
747 uint64_t deleteExpiredReclaimedLeasesCommon(
const uint32_t secs,
754 boost::scoped_ptr<PgSqlLease4Exchange> exchange4_;
755 boost::scoped_ptr<PgSqlLease6Exchange> exchange6_;
758 db::PgSqlConnection conn_;
764 #endif // PGSQL_LEASE_MGR_H
virtual void updateLease6(const Lease6Ptr &lease6)
Updates IPv6 lease.
PostgreSQL Lease Manager.
Wraps value holding size of the page with leases.
virtual std::pair< uint32_t, uint32_t > getVersion() const
Returns backend version.
@ DELETE_LEASE6_STATE_EXPIRED
@ DELETE_LEASE4_STATE_EXPIRED
static std::string getDBVersion()
Local version of getDBVersion() class method.
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_LEASE6_DUID_IAID_SUBID
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const
Returns existing IPv6 lease for a given IPv6 address.
virtual size_t wipeLeases4(const SubnetID &subnet_id)
Removes specified IPv4 leases.
virtual void rollback()
Rollback Transactions.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const
Returns a collection of expired DHCPv6 leases.
The IOAddress class represents an IP addresses (version agnostic)
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID &subnet_id)
Creates and runs the IPv4 lease stats query for a single subnet.
virtual LeaseStatsQueryPtr startLeaseStatsQuery6()
Creates and runs the IPv6 lease stats query.
virtual Lease4Collection getLeases4() const
Returns all IPv4 leases.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Type
Type of lease or pool.
Hardware type that represents information from DHCPv4 packet.
virtual bool deleteLease(const isc::asiolink::IOAddress &addr)
Deletes a lease.
virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID &subnet_id)
Creates and runs the IPv6 lease stats query for a single subnet.
PgSqlLeaseMgr(const db::DatabaseConnection::ParameterMap ¶meters)
Constructor.
virtual std::string getDescription() const
Returns description of the backend.
An abstract API for lease database.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const
Returns an IPv4 lease for specified IPv4 address.
virtual size_t wipeLeases6(const SubnetID &subnet_id)
Removed specified IPv6 leases.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const
Returns a collection of expired DHCPv4 leases.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Holds Client identifier or client IPv4 address.
virtual ~PgSqlLeaseMgr()
Destructor (closes database)
virtual void commit()
Commit Transactions.
boost::shared_ptr< Lease > LeasePtr
Pointer to the lease object.
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 uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs)
Deletes all expired-reclaimed DHCPv6 leases.
virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs)
Deletes all expired-reclaimed DHCPv4 leases.
virtual bool addLease(const Lease4Ptr &lease)
Adds an IPv4 lease.
virtual LeaseStatsQueryPtr startLeaseStatsQuery4()
Creates and runs the IPv4 lease stats query.
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
@ GET_LEASE4_CLIENTID_SUBID
boost::shared_ptr< LeaseStatsQuery > LeaseStatsQueryPtr
Defines a pointer to a LeaseStatsQuery.
Holds DUID (DHCPv6 Unique Identifier)
@ SUBNET_RANGE_LEASE6_STATS
virtual Lease6Collection getLeases6() const
Returns all IPv6 leases.
@ SUBNET_RANGE_LEASE4_STATS
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 std::string getName() const
Returns name of the database.
virtual void updateLease4(const Lease4Ptr &lease4)
Updates IPv4 lease.
virtual std::string getType() const
Return backend type.
@ GET_LEASE4_HWADDR_SUBID
StatementIndex
Statement Tags.