blob: d3b560f276f237f2b8950f80c95f4ace0b90f394 [file] [log] [blame]
Michael Tritz29f2fd62017-05-22 15:27:26 -05001#include "network_config.hpp"
Patrick Venture189d44e2018-07-09 12:30:59 -07002
3#include "config.h"
4
Michael Tritz29f2fd62017-05-22 15:27:26 -05005#include <fstream>
6#include <string>
7
8namespace phosphor
9{
10namespace network
11{
12
13namespace bmc
14{
15 void writeDHCPDefault(const std::string& filename,
16 const std::string& interface)
17 {
18 std::ofstream filestream;
19
20 filestream.open(filename);
21 filestream << "[Match]\nName=" << interface <<
Oskar Senftad21fc22018-07-26 16:32:23 -040022 "\n[Network]\nDHCP=true\n"
23#ifdef LINK_LOCAL_AUTOCONFIGURATION
24 "LinkLocalAddressing=yes\n"
25#else
26 "LinkLocalAddressing=no\n"
27#endif
Ratan Guptae9629412017-12-21 08:20:25 +053028 "IPv6AcceptRA=false\n"
Ratan Guptac35481d2017-08-18 06:12:26 +053029 "[DHCP]\nClientIdentifier=mac\n";
Michael Tritz29f2fd62017-05-22 15:27:26 -050030 filestream.close();
31 }
32}
33
34}//namespace network
35}//namespace phosphor