Add more DHCP attributes while writing the configuration file

Added the attribute "SendHostname", when it is true machine's hostname
    will be included in DHCP packet.

Change-Id: I9bf5f76980f152d48f7f3acf7448c8bc199905bb
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/dhcp_configuration.cpp b/dhcp_configuration.cpp
index 9e88e7c..9eeea1e 100644
--- a/dhcp_configuration.cpp
+++ b/dhcp_configuration.cpp
@@ -9,6 +9,19 @@
 namespace dhcp
 {
 
+bool Configuration::sendHostNameEnabled(bool value)
+{
+    if (value == sendHostNameEnabled())
+    {
+        return value;
+    }
+
+    auto name = ConfigIntf::sendHostNameEnabled(value);
+    manager.writeToConfigurationFile();
+
+    return name;
+}
+
 bool Configuration::hostNameEnabled(bool value)
 {
     if (value == hostNameEnabled())
diff --git a/dhcp_configuration.hpp b/dhcp_configuration.hpp
index e952073..a550077 100644
--- a/dhcp_configuration.hpp
+++ b/dhcp_configuration.hpp
@@ -56,6 +56,7 @@
             ConfigIntf::dNSEnabled(true);
             ConfigIntf::nTPEnabled(true);
             ConfigIntf::hostNameEnabled(true);
+            ConfigIntf::sendHostNameEnabled(true);
             emit_object_added();
         }
 
@@ -82,13 +83,22 @@
          */
         bool hostNameEnabled(bool value) override;
 
+        /** @brief if true then it will cause an Option 12 field, i.e machine's
+         *         hostname, will be included in the DHCP packet.
+         *  @param[in] value - true if machine's host name needs to be included
+         *         in the DHCP packet.
+         */
+        bool sendHostNameEnabled(bool value) override;
+
         /* @brief Network Manager needed the below function to know the
-         *        value of the properties (ntpEnabled,dnsEnabled,hostnameEnabled).
+         *        value of the properties (ntpEnabled,dnsEnabled,hostnameEnabled
+                  sendHostNameEnabled).
          *
          */
         using ConfigIntf::dNSEnabled;
         using ConfigIntf::nTPEnabled;
         using ConfigIntf::hostNameEnabled;
+        using ConfigIntf::sendHostNameEnabled;
 
     private:
 
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 1e873c2..6b6948a 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -649,6 +649,10 @@
 
         value = manager.getDHCPConf()->hostNameEnabled() ? "true"s : "false"s;
         stream << "UseHostname="s + value + "\n";
+
+        value =
+            manager.getDHCPConf()->sendHostNameEnabled() ? "true"s : "false"s;
+        stream << "SendHostname="s + value + "\n";
     }
 }