]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[github88] getLeases6(DUID) removed.
authorTomek Mrugalski <tomasz@isc.org>
Mon, 23 Jul 2018 12:36:10 +0000 (14:36 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 23 Jul 2018 12:36:10 +0000 (14:36 +0200)
src/lib/dhcpsrv/cql_lease_mgr.cc
src/lib/dhcpsrv/cql_lease_mgr.h
src/lib/dhcpsrv/lease_mgr.h
src/lib/dhcpsrv/memfile_lease_mgr.cc
src/lib/dhcpsrv/memfile_lease_mgr.h
src/lib/dhcpsrv/mysql_lease_mgr.h
src/lib/dhcpsrv/pgsql_lease_mgr.cc
src/lib/dhcpsrv/pgsql_lease_mgr.h

index 7ae9dc02d8e830ab9e68ab601e008fd8cda01352..7085ff436c8efd7d0e7410ffd0fae6c6c636b8ee 100644 (file)
@@ -901,7 +901,6 @@ public:
     static constexpr StatementTag DELETE_LEASE6 = "DELETE_LEASE6";
     static constexpr StatementTag GET_LEASE6_EXPIRE = "GET_LEASE6_EXPIRE";
     static constexpr StatementTag GET_LEASE6_ADDR = "GET_LEASE6_ADDR";
-    static constexpr StatementTag GET_LEASE6_DUID = "GET_LEASE6_DUID";
     static constexpr StatementTag GET_LEASE6_DUID_IAID = "GET_LEASE6_DUID_IAID";
     static constexpr StatementTag GET_LEASE6_DUID_IAID_SUBID = "GET_LEASE6_DUID_IAID_SUBID";
     static constexpr StatementTag GET_LEASE6_LIMIT = "GET_LEASE6_LIMIT";
@@ -942,7 +941,6 @@ constexpr StatementTag CqlLease6Exchange::UPDATE_LEASE6;
 constexpr StatementTag CqlLease6Exchange::DELETE_LEASE6;
 constexpr StatementTag CqlLease6Exchange::GET_LEASE6_EXPIRE;
 constexpr StatementTag CqlLease6Exchange::GET_LEASE6_ADDR;
-constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID;
 constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID_IAID;
 constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID;
 constexpr StatementTag CqlLease6Exchange::GET_LEASE6_LIMIT;
@@ -1017,17 +1015,6 @@ StatementMap CqlLease6Exchange::tagged_statements_ = {
       "AND lease_type = ? "
       "ALLOW FILTERING "}},
 
-    // Gets an IPv6 lease with specified duid
-    {GET_LEASE6_DUID,
-     {GET_LEASE6_DUID,
-      "SELECT "
-      "address, valid_lifetime, expire, subnet_id, pref_lifetime, duid, iaid, "
-      "lease_type, prefix_len, fqdn_fwd, fqdn_rev, hostname, hwaddr, hwtype, "
-      "hwaddr_source, state "
-      "FROM lease6 "
-      "WHERE duid = ? "
-      "ALLOW FILTERING "}},
-
     // Gets an IPv6 lease(s) with specified duid and iaid
     {GET_LEASE6_DUID_IAID,
      {GET_LEASE6_DUID_IAID,
@@ -2293,25 +2280,6 @@ CqlLeaseMgr::getLease6(Lease::Type lease_type, const IOAddress &addr) const {
     return (result);
 }
 
-Lease6Collection
-CqlLeaseMgr::getLeases6(const DUID& duid) const {
-
-    // Set up the WHERE clause value
-    AnyArray data;
-    
-    CassBlob duid_data(duid.getDuid());
-
-    data.add(&duid_data);
-
-    // Get the data.
-    Lease6Collection result;
-    std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
-    exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID, data, result);
-
-    return (result);
-    
-}
-
 Lease6Collection
 CqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID &duid, uint32_t iaid) const {
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_GET_IAID_DUID)
index f67add57a3d6519d736f5cb654d67dc92e8a86d9..39382b2f4efaaced27a8ada18270916d4413b55b 100644 (file)
@@ -353,11 +353,6 @@ public:
     getLeases6(const asiolink::IOAddress& lower_bound_address,
                const LeasePageSize& page_size) const override;
 
-    /// @brief Returns all IPv6 leases.
-    ///
-    /// @return Lease collection (may be empty if no IPv6 lease found).
-    virtual Lease6Collection getLeases6(const DUID& duid) const;
-
     /// @brief Returns a collection of expired DHCPv4 leases.
     ///
     /// This method returns at most @c max_leases expired leases. The leases
index 152039dd257e2b6f306d02690fc61a38539a7ca6..dbdab2704815ee1c9e1ac4ddd9d9e53802e036ce 100644 (file)
@@ -499,11 +499,6 @@ public:
     virtual Lease6Collection
     getLeases6(const asiolink::IOAddress& lower_bound_address,
                const LeasePageSize& page_size) const = 0;
-
-    /// @brief Returns collection of lease for matching DUID
-    ///
-    /// @return Lease collection (may be empty if no IPv6 lease found for the DUID).
-    virtual Lease6Collection getLeases6(const DUID& duid) const = 0; 
     
     /// @brief Returns a collection of expired DHCPv4 leases.
     ///
index dd04ef3dac2f9246392a427705ac6dc6ad26e472..c1c84b8aeae5a53db4e734215574d59991b28938 100644 (file)
@@ -1015,20 +1015,6 @@ Memfile_LeaseMgr::getLeases6() const {
    return (collection);
 }
 
-Lease6Collection
-Memfile_LeaseMgr::getLeases6(const DUID& duid) const {
-   LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET6_DUID)
-       .arg(duid.toText());
-
-   Lease6Collection collection;
-   for (auto lease = storage6_.begin(); lease != storage6_.end(); ++lease ) {
-       if ( (**lease).duid_->getDuid() == duid.getDuid() )
-            collection.push_back(Lease6Ptr(new Lease6(**lease)));
-   }
-
-   return (collection);
-}
-
 Lease6Collection
 Memfile_LeaseMgr::getLeases6(const asiolink::IOAddress& lower_bound_address,
                              const LeasePageSize& page_size) const {
index 23a12d299f17f0cf78309aa4a307f24391649adb..10f7d558294e6318db0dd1bf5dd2a4a560e4ba8a 100644 (file)
@@ -311,12 +311,6 @@ public:
     ///
     /// @return Lease collection (may be empty if no IPv6 lease found).
     virtual Lease6Collection getLeases6() const;
-
-    /// @brief Returns IPv6 leases for the DUID.
-    ///
-    /// @todo: implement an optimised of the query using index.
-    /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
-    virtual Lease6Collection getLeases6(const DUID& duid) const;
     
     /// @brief Returns range of IPv6 leases using paging.
     ///
index 2a0b71f7e75d4bdacb604d2b469c4ac75803e05b..bfafa55e2df204d479abb7d39fcc7ffa55282995 100644 (file)
@@ -308,12 +308,6 @@ public:
     ///
     /// @return Lease collection (may be empty if no IPv6 lease found).
     virtual Lease6Collection getLeases6() const;
-
-    /// @brief Returns all IPv6 leases for the DUID.
-    ///
-    /// @todo: implement an optimised of the query using index.
-    /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
-    virtual Lease6Collection getLeases6(const DUID& duid) const;
     
     /// @brief Returns range of IPv6 leases using paging.
     ///
index a2ac2b746564e13698314e1356a63d1bc2936edb..fc3bc0dfd0c4dc108faeeecd7acc3c621995165f 100644 (file)
@@ -1506,25 +1506,6 @@ PgSqlLeaseMgr::getLeases6(SubnetID subnet_id) const {
     return (result);
 }
 
-Lease6Collection
-PgSqlLeaseMgr::getLeases6( const DUID& duid ) const {
-    LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
-              DHCPSRV_PGSQL_GET_DUID)
-              .arg(duid.toText());
-
-    Lease6Collection result = getLeases6();
-
-    //erase the ones not containing the matching DUID
-    for (auto iter = result.begin(); iter != result.end();
-            iter++) {
-        if ((*iter)->duid_->getDuid() != duid.getDuid()) {
-            result.erase(iter);
-        }
-    }
-
-    return (result);
-}
-
 Lease6Collection
 PgSqlLeaseMgr::getLeases6() const {
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET6);
index d67cac1b7be713a80bfa8816b5fa771192502312..8b69c46b97dea9c5d6a3170330ec3294ec6ad9b9 100644 (file)
@@ -280,12 +280,6 @@ public:
     ///
     /// @return Lease collection (may be empty if no IPv6 lease found).
     virtual Lease6Collection getLeases6() const;
-
-    /// @brief Returns IPv6 leases for the DUID.
-    ///
-    /// @todo: implement an optimised of the query using index.
-    /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID
-    virtual Lease6Collection getLeases6(const DUID& duid) const;
     
     /// @brief Returns range of IPv6 leases using paging.
     ///
@@ -315,11 +309,6 @@ public:
     getLeases6(const asiolink::IOAddress& lower_bound_address,
                const LeasePageSize& page_size) const;
 
-    /// @brief Returns all IPv6 leases.
-    ///
-    /// @return Lease collection (may be empty if no IPv6 lease found).
-    virtual Lease6Collection getLeases6(const DUID& duid) const;
-
     /// @brief Returns a collection of expired DHCPv4 leases.
     ///
     /// This method returns at most @c max_leases expired leases. The leases