diff options
author | Thomas Markwalder <tmark@isc.org> | 2022-09-22 17:38:19 +0200 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2022-09-23 11:52:43 +0200 |
commit | 9477ed85c0049fbfa31026d15da4ce671e67f5a6 (patch) | |
tree | e1c7247ce58a035e618189fbfac54162bfe0ab0e /src/lib/dhcpsrv/pgsql_lease_mgr.h | |
parent | [#2571] Cosmetics nits (diff) | |
download | kea-9477ed85c0049fbfa31026d15da4ce671e67f5a6.tar.xz kea-9477ed85c0049fbfa31026d15da4ce671e67f5a6.zip |
[#2571] Added BLQ query stubs to lease mgrs
src/lib/dhcpsrv/lease_mgr.*
Removed BQL query implemenetations
src/lib/dhcpsrv/memfile_lease_mgr.*
src/lib/dhcpsrv/mysql_lease_mgr.*
src/lib/dhcpsrv/pgsql_lease_mgr.*
Added BQL query implemenetations
Diffstat (limited to 'src/lib/dhcpsrv/pgsql_lease_mgr.h')
-rw-r--r-- | src/lib/dhcpsrv/pgsql_lease_mgr.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.h b/src/lib/dhcpsrv/pgsql_lease_mgr.h index 7ef28e65fa..039c5a97ab 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.h +++ b/src/lib/dhcpsrv/pgsql_lease_mgr.h @@ -971,6 +971,86 @@ private: /// @brief Clears the class-lease count map. virtual void clearClassLeaseCounts() override; + /// The following queries are used to fulfill Bulk LeaseQuery queries. They rely + /// on relay data contained in lease's user-context when the extended-store-info flag + /// is enabled. + + /// @brief Returns existing IPv4 leases with a given relay-id. + /// + /// @param relay_id RAI Relay-ID sub-option value for relay_id of interest + /// @param lower_bound_address IPv4 address used as lower bound for the + /// returned range. + /// @param page_size maximum size of the page returned. + /// @param qry_start_time when not zero, only leases whose CLTT is greater than + /// or equal to this value will be included + /// @param qry_end_time when not zero, only leases whose CLTT is less than + /// or equal to this value will be included + /// + /// @return collection of IPv4 leases + 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); + + /// @brief Returns existing IPv4 leases with a given remote-id. + /// + /// @param remote_id RAI Remote-ID sub-option value for remote-id of interest + /// @param lower_bound_address IPv4 address used as lower bound for the + /// returned range. + /// @param page_size maximum size of the page returned. + /// @param qry_start_time when not zero, only leases whose CLTT is greater than + /// or equal to this value will be included. Defaults to zero. + /// @param qry_end_time when not zero, only leases whose CLTT is less than + /// or equal to this value will be included. Defaults to zero. + /// + /// @return collection of IPv4 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); + + /// @brief Returns existing IPv6 leases with a given relay-id. + /// + /// @param relay_id DUID for relay_id of interest + /// @param link_addr limit results to leases on this link when not :: + /// @param lower_bound_address IPv4 address used as lower bound for the + /// returned range. + /// @param page_size maximum size of the page returned. + /// + /// @return collection of IPv6 leases + virtual Lease6Collection getLeases6ByRelayId(const DUID& relay_id, + const asiolink::IOAddress& link_addr, + const asiolink::IOAddress& lower_bound_address, + const LeasePageSize& page_size); + + /// @brief Returns existing IPv6 leases with a given remote-id. + /// + /// @param remote_id remote-id option data of interest + /// @param link_addr limit results to leases on this link when not :: + /// @param lower_bound_address IPv4 address used as lower bound for the + /// returned range. + /// @param page_size maximum size of the page returned. + /// + /// @return collection of IPv6 leases + virtual Lease6Collection getLeases6ByRemoteId(const OptionBuffer& remote_id, + const asiolink::IOAddress& link_addr, + const asiolink::IOAddress& lower_bound_address, + const LeasePageSize& page_size); + + /// @brief Returns existing IPv6 leases with on a given link. + /// + /// @param link_addr limit results to leases on this link when not :: + /// @param lower_bound_address IPv4 address used as lower bound for the + /// returned range. + /// @param page_size maximum size of the page returned. + /// + /// @return collection of IPv6 leases + virtual Lease6Collection getLeases6ByLink(const asiolink::IOAddress& link_addr, + const asiolink::IOAddress& lower_bound_address, + const LeasePageSize& page_size); + /// @brief Context RAII Allocator. class PgSqlLeaseContextAlloc { public: |