blob: 9e88e7c1248d2d46fdec7aaddbb9b5063e9aa4c3 [file] [log] [blame]
#include "config.h"
#include "dhcp_configuration.hpp"
#include "network_manager.hpp"
namespace phosphor
{
namespace network
{
namespace dhcp
{
bool Configuration::hostNameEnabled(bool value)
{
if (value == hostNameEnabled())
{
return value;
}
auto name = ConfigIntf::hostNameEnabled(value);
manager.writeToConfigurationFile();
restartSystemdUnit(phosphor::network::networkdService);
return name;
}
bool Configuration::nTPEnabled(bool value)
{
if (value == nTPEnabled())
{
return value;
}
auto ntp = ConfigIntf::nTPEnabled(value);
manager.writeToConfigurationFile();
restartSystemdUnit(phosphor::network::networkdService);
restartSystemdUnit(phosphor::network::timeSynchdService);
return ntp;
}
bool Configuration::dNSEnabled(bool value)
{
if (value == dNSEnabled())
{
return value;
}
auto dns = ConfigIntf::dNSEnabled(value);
manager.writeToConfigurationFile();
restartSystemdUnit(phosphor::network::networkdService);
return dns;
}
}// namespace dhcp
}// namespace network
}// namespace phosphor