blob: 9e88e7c1248d2d46fdec7aaddbb9b5063e9aa4c3 [file] [log] [blame]
Ratan Gupta935bc332017-07-11 17:47:14 +05301#include "config.h"
2#include "dhcp_configuration.hpp"
3#include "network_manager.hpp"
4
5namespace phosphor
6{
7namespace network
8{
9namespace dhcp
10{
11
12bool Configuration::hostNameEnabled(bool value)
13{
14 if (value == hostNameEnabled())
15 {
16 return value;
17 }
18
19 auto name = ConfigIntf::hostNameEnabled(value);
20 manager.writeToConfigurationFile();
21 restartSystemdUnit(phosphor::network::networkdService);
22
23 return name;
24}
25
26bool Configuration::nTPEnabled(bool value)
27{
28 if (value == nTPEnabled())
29 {
30 return value;
31 }
32
33 auto ntp = ConfigIntf::nTPEnabled(value);
34 manager.writeToConfigurationFile();
35 restartSystemdUnit(phosphor::network::networkdService);
36 restartSystemdUnit(phosphor::network::timeSynchdService);
37
38 return ntp;
39}
40
41
42bool Configuration::dNSEnabled(bool value)
43{
44 if (value == dNSEnabled())
45 {
46 return value;
47 }
48
49 auto dns = ConfigIntf::dNSEnabled(value);
50 manager.writeToConfigurationFile();
51 restartSystemdUnit(phosphor::network::networkdService);
52
53 return dns;
54}
55
56}// namespace dhcp
57}// namespace network
58}// namespace phosphor