]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3814] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Fri, 13 Jun 2025 12:01:44 +0000 (15:01 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 13 Jun 2025 12:27:27 +0000 (12:27 +0000)
ChangeLog
src/hooks/dhcp/mysql/mysql_lb_messages.cc
src/hooks/dhcp/mysql/mysql_lb_messages.h
src/hooks/dhcp/mysql/mysql_lb_messages.mes
src/hooks/dhcp/mysql/mysql_lease_mgr.cc
src/hooks/dhcp/mysql/mysql_lease_mgr.h
src/hooks/dhcp/pgsql/pgsql_lb_messages.cc
src/hooks/dhcp/pgsql/pgsql_lb_messages.h
src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc
src/hooks/dhcp/pgsql/pgsql_lease_mgr.h

index 2ddf1fe460f62f17af0e694cdd596573b3573e3c..a10605948667440c230295b8accf3214bf287b6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2355.  [func]          razvan
+       Implemented lease4-wipe and lease6-wipe for database backends.
+       The commands are no longer deprecated.
+       (Gitlab #3814)
+
 2354.  [doc]           razvan
        The DHCPv4-over-DHCPv6 implementation, perfmon hook library and
        sysrepo features are no longer considered experimental.
index 34037eb3621725161f3acec28d8791231580c8c6..6b2390f03d0ac38d53d15d85a8a52d0f6a84f5fc 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../src/hooks/dhcp/mysql/mysql_lb_messages.mes
+// File created from src/hooks/dhcp/mysql/mysql_lb_messages.mes
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -77,8 +77,8 @@ const char* values[] = {
     "MYSQL_LB_DB_RECONNECT_ATTEMPT_SCHEDULE", "scheduling attempt %1 of %2 in %3 milliseconds",
     "MYSQL_LB_DB_RECONNECT_FAILED", "maximum number of database reconnect attempts: %1, has been exhausted without success",
     "MYSQL_LB_DELETED_EXPIRED_RECLAIMED", "deleted %1 reclaimed leases from the database",
-    "MYSQL_LB_DELETED_SUBNET4_ID", "deleted %1 leases that match Subnet ID %2.",
-    "MYSQL_LB_DELETED_SUBNET6_ID", "deleted %1 leases that match Subnet ID %2.",
+    "MYSQL_LB_DELETED_SUBNET4_ID", "deleted %1 leases that match subnet ID %2.",
+    "MYSQL_LB_DELETED_SUBNET6_ID", "deleted %1 leases that match subnet ID %2.",
     "MYSQL_LB_DELETE_ADDR4", "deleting lease for address %1",
     "MYSQL_LB_DELETE_ADDR6", "deleting lease for address %1",
     "MYSQL_LB_DELETE_EXPIRED_RECLAIMED4", "deleting reclaimed IPv4 leases that expired more than %1 seconds ago",
@@ -95,7 +95,7 @@ const char* values[] = {
     "MYSQL_LB_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %1",
     "MYSQL_LB_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
     "MYSQL_LB_GET_IAID_DUID", "obtaining IPv6 leases for IAID %1, DUID %2, lease type %3",
-    "MYSQL_LB_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3, lease type %4",
+    "MYSQL_LB_GET_IAID_SUBID_DUID", "obtaining IPv6 leases for IAID %1, subnet ID %2, DUID %3, lease type %4",
     "MYSQL_LB_GET_PAGE4", "obtaining at most %1 IPv4 leases starting from address %2",
     "MYSQL_LB_GET_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2",
     "MYSQL_LB_GET_RELAYID4", "obtaining at most %1 IPv4 leases starting from address %2 with relay id %3 and cltt between %4 and %5",
index 2b3e9f86ffdf60f7e9164cf5acfb9206b4dd3ca2..c775de55a438f72c3eacb54a530213f1bf3914cd 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../src/hooks/dhcp/mysql/mysql_lb_messages.mes
+// File created from src/hooks/dhcp/mysql/mysql_lb_messages.mes
 
 #ifndef MYSQL_LB_MESSAGES_H
 #define MYSQL_LB_MESSAGES_H
index 41b8afc13e3f739d31ef0bed281f4e725461e905..fd0395970b1ea8c90d3de2bc2e788c084ef3b280 100644 (file)
@@ -78,15 +78,15 @@ leases which have expired longer than a specified period of time.
 The argument is the amount of time Kea waits after a reclaimed
 lease expires before considering its removal.
 
-% MYSQL_LB_DELETED_SUBNET4_ID deleted %1 leases that match Subnet ID %2.
+% MYSQL_LB_DELETED_SUBNET4_ID deleted %1 leases that match subnet ID %2.
 Logged at debug log level 50.
 A debug message issued when the server is removing leases which match
-respective Subnet ID.
+respective subnet ID.
 
-% MYSQL_LB_DELETED_SUBNET6_ID deleted %1 leases that match Subnet ID %2.
+% MYSQL_LB_DELETED_SUBNET6_ID deleted %1 leases that match subnet ID %2.
 Logged at debug log level 50.
 A debug message issued when the server is removing leases which match
-respective Subnet ID.
+respective subnet ID.
 
 % MYSQL_LB_GET4 obtaining all IPv4 leases
 Logged at debug log level 50.
@@ -155,11 +155,11 @@ A debug message issued when the server is attempting to obtain a set of IPv6
 leases from the MySQL database for a client with the specified IAID (Identity
 Association ID) and DUID (DHCP Unique Identifier).
 
-% MYSQL_LB_GET_IAID_SUBID_DUID obtaining IPv6 leases for IAID %1, Subnet ID %2, DUID %3, lease type %4
+% MYSQL_LB_GET_IAID_SUBID_DUID obtaining IPv6 leases for IAID %1, subnet ID %2, DUID %3, lease type %4
 Logged at debug log level 50.
 A debug message issued when the server is attempting to obtain an IPv6
 lease from the MySQL database for a client with the specified IAID
-(Identity Association ID), Subnet ID and DUID (DHCP Unique Identifier).
+(Identity Association ID), subnet ID and DUID (DHCP Unique Identifier).
 
 % MYSQL_LB_GET_PAGE4 obtaining at most %1 IPv4 leases starting from address %2
 Logged at debug log level 50.
index 98e5fb4c11d4991ac71a07155e035b3f02635d94..4a51976a1d4e83be93303e8270eb7c1d822e12cc 100644 (file)
@@ -3847,7 +3847,7 @@ MySqlLeaseMgr::wipeLeasesCommon(const SubnetID& subnet_id, StatementIndex statem
     MySqlLeaseContextAlloc get_context(*this);
     MySqlLeaseContextPtr ctx = get_context.ctx_;
 
-    // Get the number of deleted leases and log it.
+    // Delete leases and return the number of deleted leases.
     return (deleteLeaseCommon(ctx, statement_index, inbind));
 }
 
index 103767987dc3343d9157f6a8f5d8e2bc4b2e464c..0939b449c69f1c2d26350898c58905a0dcab01c9 100644 (file)
@@ -662,8 +662,6 @@ public:
     /// This rather dangerous method is able to remove all leases from specified
     /// subnet.
     ///
-    /// @todo: Not implemented yet.
-    ///
     /// @param subnet_id identifier of the subnet
     /// @return number of leases removed.
     virtual size_t wipeLeases4(const SubnetID& subnet_id) override;
@@ -673,8 +671,6 @@ public:
     /// This rather dangerous method is able to remove all leases from specified
     /// subnet.
     ///
-    /// @todo: Not implemented yet.
-    ///
     /// @param subnet_id identifier of the subnet
     /// @return number of leases removed.
     virtual size_t wipeLeases6(const SubnetID& subnet_id) override;
index 55252d25e251a7760aa5baa18d87ee505b09cc6b..26722812a099b5c63f1cf01c239a10043d3023ec 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
+// File created from src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -73,8 +73,8 @@ const char* values[] = {
     "PGSQL_LB_DB_RECONNECT_ATTEMPT_FAILED", "database reconnect failed: %1",
     "PGSQL_LB_DB_RECONNECT_ATTEMPT_SCHEDULE", "scheduling attempt %1 of %2 in %3 milliseconds",
     "PGSQL_LB_DB_RECONNECT_FAILED", "maximum number of database reconnect attempts: %1, has been exhausted without success",
-    "PGSQL_LB_DELETED_SUBNET4_ID", "deleted %1 leases that match Subnet ID %2.",
-    "PGSQL_LB_DELETED_SUBNET6_ID", "deleted %1 leases that match Subnet ID %2.",
+    "PGSQL_LB_DELETED_SUBNET4_ID", "deleted %1 leases that match subnet ID %2.",
+    "PGSQL_LB_DELETED_SUBNET6_ID", "deleted %1 leases that match subnet ID %2.",
     "PGSQL_LB_DELETE_ADDR4", "deleting lease for address %1",
     "PGSQL_LB_DELETE_ADDR6", "deleting lease for address %1",
     "PGSQL_LB_DELETE_EXPIRED_RECLAIMED4", "deleting reclaimed IPv4 leases that expired more than %1 seconds ago",
@@ -91,7 +91,7 @@ const char* values[] = {
     "PGSQL_LB_GET_HOSTNAME6", "obtaining IPv6 leases for hostname %1",
     "PGSQL_LB_GET_HWADDR", "obtaining IPv4 leases for hardware address %1",
     "PGSQL_LB_GET_IAID_DUID", "obtaining IPv4 leases for IAID %1 and DUID %2, lease type %3",
-    "PGSQL_LB_GET_IAID_SUBID_DUID", "obtaining IPv4 leases for IAID %1, Subnet ID %2, DUID %3, and lease type %4",
+    "PGSQL_LB_GET_IAID_SUBID_DUID", "obtaining IPv4 leases for IAID %1, subnet ID %2, DUID %3, and lease type %4",
     "PGSQL_LB_GET_PAGE4", "obtaining at most %1 IPv4 leases starting from address %2",
     "PGSQL_LB_GET_PAGE6", "obtaining at most %1 IPv6 leases starting from address %2",
     "PGSQL_LB_GET_RELAYID4", "obtaining at most %1 IPv4 leases starting from address %2 with relay id %3 and cltt between %4 and %5",
index bf476af3e51da532f0382bf5cb6179822fc1a429..e67286859be3ad9868988f4065266dde00994f0e 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
+// File created from src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
 
 #ifndef PGSQL_LB_MESSAGES_H
 #define PGSQL_LB_MESSAGES_H
index 3d798d449018d7d6608c68f39cc2e3665761c9fe..1b5d604afa6aa85d119daccfab96588209af1540 100644 (file)
@@ -72,15 +72,15 @@ leases which have expired longer than a specified period of time.
 The argument is the amount of time Kea waits after a reclaimed
 lease expires before considering its removal.
 
-% PGSQL_LB_DELETED_SUBNET4_ID deleted %1 leases that match Subnet ID %2.
+% PGSQL_LB_DELETED_SUBNET4_ID deleted %1 leases that match subnet ID %2.
 Logged at debug log level 50.
 A debug message issued when the server is removing leases which match
-respective Subnet ID.
+respective subnet ID.
 
-% PGSQL_LB_DELETED_SUBNET6_ID deleted %1 leases that match Subnet ID %2.
+% PGSQL_LB_DELETED_SUBNET6_ID deleted %1 leases that match subnet ID %2.
 Logged at debug log level 50.
 A debug message issued when the server is removing leases which match
-respective Subnet ID.
+respective subnet ID.
 
 % PGSQL_LB_GET4 obtaining all IPv4 leases
 Logged at debug log level 50.
@@ -149,11 +149,11 @@ A debug message issued when the server is attempting to obtain a set of IPv6
 leases from the PostgreSQL database for a client with the specified IAID
 (Identity Association ID) and DUID (DHCP Unique Identifier).
 
-% PGSQL_LB_GET_IAID_SUBID_DUID obtaining IPv4 leases for IAID %1, Subnet ID %2, DUID %3, and lease type %4
+% PGSQL_LB_GET_IAID_SUBID_DUID obtaining IPv4 leases for IAID %1, subnet ID %2, DUID %3, and lease type %4
 Logged at debug log level 50.
 A debug message issued when the server is attempting to obtain an IPv6
 lease from the PostgreSQL database for a client with the specified IAID
-(Identity Association ID), Subnet ID and DUID (DHCP Unique Identifier).
+(Identity Association ID), subnet ID and DUID (DHCP Unique Identifier).
 
 % PGSQL_LB_GET_PAGE4 obtaining at most %1 IPv4 leases starting from address %2
 Logged at debug log level 50.
index 03f616aa963a3d22b337ddc0adf142350a4f0007..2567e5849b526e98c007dfd8038bc881b1936235 100644 (file)
@@ -2998,7 +2998,7 @@ PgSqlLeaseMgr::wipeLeasesCommon(const SubnetID& subnet_id, StatementIndex statem
     PgSqlLeaseContextAlloc get_context(*this);
     PgSqlLeaseContextPtr ctx = get_context.ctx_;
 
-    // Delete leases.
+    // Delete leases and return the number of deleted leases.
     return (deleteLeaseCommon(ctx, statement_index, bind_array));
 }
 
index e17beaca1565780add7d9ad960e5705c2de0f1e3..8b77a68ab775c0a5394b4af414fc7fd00392a679 100644 (file)
@@ -637,8 +637,6 @@ public:
     /// This rather dangerous method is able to remove all leases from specified
     /// subnet.
     ///
-    /// @todo: Not implemented yet.
-    ///
     /// @param subnet_id identifier of the subnet
     /// @return number of leases removed.
     virtual size_t wipeLeases4(const SubnetID& subnet_id) override;
@@ -648,8 +646,6 @@ public:
     /// This rather dangerous method is able to remove all leases from specified
     /// subnet.
     ///
-    /// @todo: Not implemented yet.
-    ///
     /// @param subnet_id identifier of the subnet
     /// @return number of leases removed.
     virtual size_t wipeLeases6(const SubnetID& subnet_id) override;