From: Razvan Becheriu Date: Tue, 5 Apr 2022 19:23:59 +0000 (+0300) Subject: [#1716] renamed parameters X-Git-Tag: Kea-2.1.5~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9093c34cd2d64bfc2678d332f724ec7921e5b5f;p=thirdparty%2Fkea.git [#1716] renamed parameters --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 835eaaa9f7..3f30f749da 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -1311,17 +1311,17 @@ ControlledDhcpv4Srv::dbFailedCallback(ReconnectCtlPtr db_reconnect_ctl) { } void -ControlledDhcpv4Srv::openSocketsFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl) { - if (!db_reconnect_ctl) { +ControlledDhcpv4Srv::openSocketsFailedCallback(ReconnectCtlPtr reconnect_ctl) { + if (!reconnect_ctl) { // This should never happen LOG_ERROR(dhcp4_logger, DHCP4_OPEN_SOCKETS_NO_RECONNECT_CTL); return; } LOG_INFO(dhcp4_logger, DHCP4_OPEN_SOCKETS_FAILED) - .arg(db_reconnect_ctl->maxRetries()); + .arg(reconnect_ctl->maxRetries()); - if (db_reconnect_ctl->exitOnFailure()) { + if (reconnect_ctl->exitOnFailure()) { shutdownServer(EXIT_FAILURE); } } diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.h b/src/bin/dhcp4/ctrl_dhcp4_srv.h index 771202dc83..964afc5c47 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.h +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.h @@ -413,6 +413,9 @@ private: /// connectivity. It starts the DHCP service after the connection is /// recovered. /// + /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + /// /// @return false if reconnect is not configured, true otherwise bool dbRecoveredCallback(util::ReconnectCtlPtr db_reconnect_ctl); @@ -422,6 +425,9 @@ private: /// This function is invoked by DB backends when they fail to recover the /// connectivity. It stops the server. /// + /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + /// /// @return false if reconnect is not configured, true otherwise bool dbFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl); @@ -429,7 +435,10 @@ private: /// /// This function is invoked during the configuration of the interfaces /// when they fail to bind the service sockets. It may stop the server. - void openSocketsFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl); + /// + /// @param reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + void openSocketsFailedCallback(util::ReconnectCtlPtr reconnect_ctl); /// @brief Callback invoked periodically to fetch configuration updates /// from the Config Backends. diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index e8efbb42f1..fa2bd1991d 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -1331,17 +1331,17 @@ ControlledDhcpv6Srv::dbFailedCallback(ReconnectCtlPtr db_reconnect_ctl) { } void -ControlledDhcpv6Srv::openSocketsFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl) { - if (!db_reconnect_ctl) { +ControlledDhcpv6Srv::openSocketsFailedCallback(ReconnectCtlPtr reconnect_ctl) { + if (!reconnect_ctl) { // This should never happen LOG_ERROR(dhcp6_logger, DHCP6_OPEN_SOCKETS_NO_RECONNECT_CTL); return; } LOG_INFO(dhcp6_logger, DHCP6_OPEN_SOCKETS_FAILED) - .arg(db_reconnect_ctl->maxRetries()); + .arg(reconnect_ctl->maxRetries()); - if (db_reconnect_ctl->exitOnFailure()) { + if (reconnect_ctl->exitOnFailure()) { shutdownServer(EXIT_FAILURE); } } diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.h b/src/bin/dhcp6/ctrl_dhcp6_srv.h index 980d5b2841..a9598970d4 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.h +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.h @@ -413,6 +413,9 @@ private: /// connectivity. It starts the DHCP service after the connection is /// recovered. /// + /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + /// /// @return false if reconnect is not configured, true otherwise bool dbRecoveredCallback(util::ReconnectCtlPtr db_reconnect_ctl); @@ -422,6 +425,9 @@ private: /// This function is invoked by DB backends when they fail to recover the /// connectivity. It stops the server. /// + /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + /// /// @return false if reconnect is not configured, true otherwise bool dbFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl); @@ -429,7 +435,10 @@ private: /// /// This function is invoked during the configuration of the interfaces /// when they fail to bind the service sockets. It may stop the server. - void openSocketsFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl); + /// + /// @param reconnect_ctl pointer to the ReconnectCtl containing the + /// configured reconnect parameters + void openSocketsFailedCallback(util::ReconnectCtlPtr reconnect_ctl); /// @brief Callback invoked periodically to fetch configuration updates /// from the Config Backends. diff --git a/src/lib/dhcp/tests/pkt_filter6_test_stub.h b/src/lib/dhcp/tests/pkt_filter6_test_stub.h index 7e9ea388a7..5ece794146 100644 --- a/src/lib/dhcp/tests/pkt_filter6_test_stub.h +++ b/src/lib/dhcp/tests/pkt_filter6_test_stub.h @@ -89,7 +89,7 @@ public: const std::string & mcast); /// @brief Set an open socket callback. Use it for testing - // purposes, e.g., counting the number of calls or throwing an exception. + /// purposes, e.g. counting the number of calls or throwing an exception. void setOpenSocketCallback(PktFilter6OpenSocketCallback callback) { open_socket_callback_ = callback; } diff --git a/src/lib/dhcp/tests/pkt_filter_test_stub.h b/src/lib/dhcp/tests/pkt_filter_test_stub.h index 02ad2738aa..49b0807680 100644 --- a/src/lib/dhcp/tests/pkt_filter_test_stub.h +++ b/src/lib/dhcp/tests/pkt_filter_test_stub.h @@ -95,7 +95,7 @@ public: using PktFilter::openFallbackSocket; /// @brief Set an open socket callback. Use it for testing - // purposes, e.g. counting the number of calls or throwing an exception. + /// purposes, e.g. counting the number of calls or throwing an exception. void setOpenSocketCallback(PktFilterOpenSocketCallback callback) { open_socket_callback_ = callback; } diff --git a/src/lib/dhcpsrv/cfg_iface.cc b/src/lib/dhcpsrv/cfg_iface.cc index dbd2c67ef1..b886be6fbb 100644 --- a/src/lib/dhcpsrv/cfg_iface.cc +++ b/src/lib/dhcpsrv/cfg_iface.cc @@ -208,25 +208,25 @@ ReconnectCtlPtr CfgIface::makeReconnectCtl() const { // Create unique timer name per instance. std::string timer_name = "ConfigInterfaceSocketReopenTimer"; - auto on_fail_action = util::OnFailAction::SERVE_RETRY_CONTINUE; + auto on_fail_action = OnFailAction::SERVE_RETRY_CONTINUE; if (CfgIface::getServiceSocketsRequireAll()) { - on_fail_action = util::OnFailAction::SERVE_RETRY_EXIT; + on_fail_action = OnFailAction::SERVE_RETRY_EXIT; } // Add one attempt for an initial call. - auto reconnect_ctl = boost::make_shared("Socket", timer_name, - CfgIface::getServiceSocketsMaxRetries(), - CfgIface::getServiceSocketsRetryWaitTime(), - on_fail_action); + auto reconnect_ctl = boost::make_shared("Socket", timer_name, + CfgIface::getServiceSocketsMaxRetries(), + CfgIface::getServiceSocketsRetryWaitTime(), + on_fail_action); return (reconnect_ctl); } bool -CfgIface::openSocketsWithRetry(util::ReconnectCtlPtr reconnect_ctl, +CfgIface::openSocketsWithRetry(ReconnectCtlPtr reconnect_ctl, const uint16_t family, const uint16_t port, const bool can_use_bcast) { - util::MultiThreadingCriticalSection cs; + MultiThreadingCriticalSection cs; // Skip opened sockets in the retry calls. bool is_initial_call = (reconnect_ctl->retriesLeft() == reconnect_ctl->maxRetries()); diff --git a/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc b/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc index 4207e4ada5..545fa92f0d 100644 --- a/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc @@ -22,6 +22,7 @@ using namespace isc::dhcp; using namespace isc::dhcp::test; using namespace isc::test; using namespace isc::data; +using namespace isc::util; namespace { @@ -562,7 +563,7 @@ TEST_F(CfgIfaceTest, requireOpenAllServiceSockets) { // Configure a fail callback uint16_t fail_calls = 0; CfgIface::OpenSocketsFailedCallback on_fail_callback = - [&fail_calls](util::ReconnectCtlPtr reconnect_ctl) { + [&fail_calls](ReconnectCtlPtr reconnect_ctl) { EXPECT_TRUE(reconnect_ctl != nullptr); EXPECT_TRUE(reconnect_ctl->exitOnFailure()); fail_calls++;