Add function to write DNS entries

Added function to write DNS entries to specified file
Also, added test case

Change-Id: I64250c7ee3cf7db3e7f8b5cf1669c7b4a7738637
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/dns_updater.hpp b/dns_updater.hpp
new file mode 100644
index 0000000..44c0e32
--- /dev/null
+++ b/dns_updater.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <experimental/filesystem>
+
+namespace phosphor
+{
+namespace network
+{
+namespace dns
+{
+namespace updater
+{
+
+namespace fs = std::experimental::filesystem;
+
+constexpr auto RESOLV_CONF = "/etc/resolv.conf";
+
+/** @brief Reads DNS entries supplied by DHCP and updates specified file
+ *
+ *  @param[in] inFile  - File having DNS entries supplied by DHCP
+ *  @param[in] outFile - File to write the nameserver entries to
+ */
+void processDNSEntries(const fs::path& inFile,
+                       const fs::path& outFile);
+
+/** @brief User callback handler invoked by inotify watcher
+ *
+ *  Needed to enable production and test code so that the right
+ *  callback functions could be implemented
+ *
+ *  @param[in] inFile - File having DNS entries supplied by DHCP
+ */
+inline void processDNSEntries(const fs::path& inFile)
+{
+    return processDNSEntries(inFile, RESOLV_CONF);
+}
+
+} // namepsace updater
+} // namepsace dns
+} // namespace network
+} // namespace phosphor