]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1716] renamed parameters
authorRazvan Becheriu <razvan@isc.org>
Tue, 5 Apr 2022 19:23:59 +0000 (22:23 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 5 Apr 2022 19:44:06 +0000 (22:44 +0300)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/ctrl_dhcp4_srv.h
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/lib/dhcp/tests/pkt_filter6_test_stub.h
src/lib/dhcp/tests/pkt_filter_test_stub.h
src/lib/dhcpsrv/cfg_iface.cc
src/lib/dhcpsrv/tests/cfg_iface_unittest.cc

index 835eaaa9f7f938836f6c1cdf99b4079a73d9a263..3f30f749da5e908667598508d2d350cb5c762d7f 100644 (file)
@@ -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);
     }
 }
index 771202dc830df6cc326c86c47cc0176ba90cc86d..964afc5c470acdc161813590913219db482b9306 100644 (file)
@@ -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.
index e8efbb42f1c6908ff21c5b4326c8109dafb1be51..fa2bd1991d3721e90132b78b3bfce192fcd3c721 100644 (file)
@@ -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);
     }
 }
index 980d5b28413703d27debd66b72783fef823b43f9..a9598970d4ece018c5e88b65bfb40835f5952c17 100644 (file)
@@ -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.
index 7e9ea388a79a0987b015cc2aa543beb478090383..5ece79414645fb16ec1a3ae522d7ccec0bd302c4 100644 (file)
@@ -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;
     }
index 02ad2738aa5e70bac01ebd9158809242829c64fa..49b080768011a5f81b8dae46e632e695569f40cd 100644 (file)
@@ -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;
     }
index dbd2c67ef14f534f32d3287052883a102d46ab87..b886be6fbb7cea7287a573ea9a3645da19f0d809 100644 (file)
@@ -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<util::ReconnectCtl>("Socket", timer_name,
-                                                                CfgIface::getServiceSocketsMaxRetries(),
-                                                                CfgIface::getServiceSocketsRetryWaitTime(),
-                                                                on_fail_action);
+    auto reconnect_ctl = boost::make_shared<ReconnectCtl>("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());
index 4207e4ada5077b7eb032afb987922cbfbd911920..545fa92f0da7736dad28639961964e1a86ea28d3 100644 (file)
@@ -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++;