Implement network factory reset in network_manager

This commit implements a factory reset interface for the BMC
network. This factory reset is accomplished by removing any
/etc/systemd/network/*.network files, then writing new ones
configured for DHCP for each known interface.

Resolves openbmc/openbmc#1575

Change-Id: Ic006cd43fb336029479cffa783b56ab91e0339bd
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/network_config.cpp b/network_config.cpp
new file mode 100644
index 0000000..4540ad8
--- /dev/null
+++ b/network_config.cpp
@@ -0,0 +1,25 @@
+#include "network_config.hpp"
+#include <fstream>
+#include <string>
+
+namespace phosphor
+{
+namespace network
+{
+
+namespace bmc
+{
+    void writeDHCPDefault(const std::string& filename,
+            const std::string& interface)
+    {
+        std::ofstream filestream;
+
+        filestream.open(filename);
+        filestream << "[Match]\nName=" << interface <<
+                "\n[Network]\nDHCP=true\n[DHCP]\nClientIdentifier=mac\n";
+        filestream.close();
+    }
+}
+
+}//namespace network
+}//namespace phosphor