diff --git a/ChangeLog b/ChangeLog index 2ddf1fe460..a106059486 100644 --- 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. diff --git a/src/hooks/dhcp/mysql/mysql_lb_messages.cc b/src/hooks/dhcp/mysql/mysql_lb_messages.cc index 34037eb362..6b2390f03d 100644 --- a/src/hooks/dhcp/mysql/mysql_lb_messages.cc +++ b/src/hooks/dhcp/mysql/mysql_lb_messages.cc @@ -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 #include @@ -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", diff --git a/src/hooks/dhcp/mysql/mysql_lb_messages.h b/src/hooks/dhcp/mysql/mysql_lb_messages.h index 2b3e9f86ff..c775de55a4 100644 --- a/src/hooks/dhcp/mysql/mysql_lb_messages.h +++ b/src/hooks/dhcp/mysql/mysql_lb_messages.h @@ -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 diff --git a/src/hooks/dhcp/mysql/mysql_lb_messages.mes b/src/hooks/dhcp/mysql/mysql_lb_messages.mes index 41b8afc13e..fd0395970b 100644 --- a/src/hooks/dhcp/mysql/mysql_lb_messages.mes +++ b/src/hooks/dhcp/mysql/mysql_lb_messages.mes @@ -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. diff --git a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc index 98e5fb4c11..4a51976a1d 100644 --- a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc +++ b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc @@ -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)); } diff --git a/src/hooks/dhcp/mysql/mysql_lease_mgr.h b/src/hooks/dhcp/mysql/mysql_lease_mgr.h index 103767987d..0939b449c6 100644 --- a/src/hooks/dhcp/mysql/mysql_lease_mgr.h +++ b/src/hooks/dhcp/mysql/mysql_lease_mgr.h @@ -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; diff --git a/src/hooks/dhcp/pgsql/pgsql_lb_messages.cc b/src/hooks/dhcp/pgsql/pgsql_lb_messages.cc index 55252d25e2..26722812a0 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lb_messages.cc +++ b/src/hooks/dhcp/pgsql/pgsql_lb_messages.cc @@ -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 #include @@ -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", diff --git a/src/hooks/dhcp/pgsql/pgsql_lb_messages.h b/src/hooks/dhcp/pgsql/pgsql_lb_messages.h index bf476af3e5..e67286859b 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lb_messages.h +++ b/src/hooks/dhcp/pgsql/pgsql_lb_messages.h @@ -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 diff --git a/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes b/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes index 3d798d4490..1b5d604afa 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes +++ b/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes @@ -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. diff --git a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc index 03f616aa96..2567e5849b 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc +++ b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc @@ -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)); } diff --git a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.h b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.h index e17beaca15..8b77a68ab7 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.h +++ b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.h @@ -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;