blob: 9eeea1e6751e4d55e1db210a001ae0ee362b3cf4 [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
Nagaraju Gorugantie8fca1d2018-02-05 20:32:45 -060012bool Configuration::sendHostNameEnabled(bool value)
13{
14 if (value == sendHostNameEnabled())
15 {
16 return value;
17 }
18
19 auto name = ConfigIntf::sendHostNameEnabled(value);
20 manager.writeToConfigurationFile();
21
22 return name;
23}
24
Ratan Gupta935bc332017-07-11 17:47:14 +053025bool Configuration::hostNameEnabled(bool value)
26{
27 if (value == hostNameEnabled())
28 {
29 return value;
30 }
31
32 auto name = ConfigIntf::hostNameEnabled(value);
33 manager.writeToConfigurationFile();
34 restartSystemdUnit(phosphor::network::networkdService);
35
36 return name;
37}
38
39bool Configuration::nTPEnabled(bool value)
40{
41 if (value == nTPEnabled())
42 {
43 return value;
44 }
45
46 auto ntp = ConfigIntf::nTPEnabled(value);
47 manager.writeToConfigurationFile();
48 restartSystemdUnit(phosphor::network::networkdService);
49 restartSystemdUnit(phosphor::network::timeSynchdService);
50
51 return ntp;
52}
53
54
55bool Configuration::dNSEnabled(bool value)
56{
57 if (value == dNSEnabled())
58 {
59 return value;
60 }
61
62 auto dns = ConfigIntf::dNSEnabled(value);
63 manager.writeToConfigurationFile();
64 restartSystemdUnit(phosphor::network::networkdService);
65
66 return dns;
67}
68
69}// namespace dhcp
70}// namespace network
71}// namespace phosphor