2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[5468] Implemented getting leases by subnet id and all leases.

This change affects Memfile, MySQL and Postgres backend. These functions
aren't implemented for CQL at this time.
This commit is contained in:
Marcin Siodelski
2018-01-09 14:49:14 +01:00
parent 126e683fc7
commit 2732257202
16 changed files with 340 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -193,6 +193,18 @@ public:
virtual Lease4Ptr getLease4(const ClientId& clientid,
SubnetID subnet_id) const;
/// @brief Returns all IPv4 leases for the particular subnet identifier.
///
/// @param subnet_id subnet identifier.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4() const;
/// @brief Returns existing IPv6 lease for a given IPv6 address.
///
/// For a given address, we assume that there will be only one lease.
@@ -416,11 +428,13 @@ public:
DELETE_LEASE4_STATE_EXPIRED, // Delete expired lease4 in a given state
DELETE_LEASE6, // Delete from lease6 by address
DELETE_LEASE6_STATE_EXPIRED, // Delete expired lease6 in a given state
GET_LEASE4, // Get all IPv4 leases
GET_LEASE4_ADDR, // Get lease4 by address
GET_LEASE4_CLIENTID, // Get lease4 by client ID
GET_LEASE4_CLIENTID_SUBID, // Get lease4 by client ID & subnet ID
GET_LEASE4_HWADDR, // Get lease4 by HW address
GET_LEASE4_HWADDR_SUBID, // Get lease4 by HW address & subnet ID
GET_LEASE4_SUBID, // Get IPv4 leases by subnet ID
GET_LEASE4_EXPIRE, // Get lease4 by expiration.
GET_LEASE6_ADDR, // Get lease6 by address
GET_LEASE6_DUID_IAID, // Get lease6 by DUID and IAID