Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 1 | #include "network_config.hpp" |
| 2 | #include <fstream> |
| 3 | #include <string> |
| 4 | |
| 5 | namespace phosphor |
| 6 | { |
| 7 | namespace network |
| 8 | { |
| 9 | |
| 10 | namespace bmc |
| 11 | { |
| 12 | void writeDHCPDefault(const std::string& filename, |
| 13 | const std::string& interface) |
| 14 | { |
| 15 | std::ofstream filestream; |
| 16 | |
| 17 | filestream.open(filename); |
| 18 | filestream << "[Match]\nName=" << interface << |
Nagaraju Goruganti | 24afe36 | 2017-09-21 07:40:26 -0500 | [diff] [blame] | 19 | "\n[Network]\nDHCP=true\nLinkLocalAddressing=yes\n" |
Ratan Gupta | c35481d | 2017-08-18 06:12:26 +0530 | [diff] [blame] | 20 | "[DHCP]\nClientIdentifier=mac\n"; |
Michael Tritz | 29f2fd6 | 2017-05-22 15:27:26 -0500 | [diff] [blame] | 21 | filestream.close(); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | }//namespace network |
| 26 | }//namespace phosphor |