}
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);
}
}
/// 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);
/// 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);
///
/// 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.
}
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);
}
}
/// 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);
/// 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);
///
/// 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.
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;
}
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;
}
// 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());
using namespace isc::dhcp::test;
using namespace isc::test;
using namespace isc::data;
+using namespace isc::util;
namespace {
// 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++;