Support for NameServers & StaticNameServers

 - As per the proposal made in the mentioned mailing list thread
https://lists.ozlabs.org/pipermail/openbmc/2019-September/018399.html

As mentioined in the proposal, it is agreed that configuring the
Nameservers by the DHCP server is an optional step, and therefore
the Static and Dynamic Configurations can co-exist.

The commit supports :

1. NameServers - A readonly property which contains all the nameservers
                 (Static & Dynamic) configured on an interface.

2. StaticNameServers - A writable property which can be used by a redfish
                       client to set a NameServer(Static) on the interface.

TestedBy:
1. Redfish Validator - PASS
2. Pass the DNS via DHCP Server and make sure we populate NameServers with
   the DNS supplied by DHCP.
3. With the DNS supplied via DHCP intact, set another Namserver by PATCH on
   the StaticNameServers property, and Made sure StaticNameServers and
   NameServers populates the respective information.
4. PATCH opteration on NameServers should throw an Error Saying it is a
   Readonly property.

Signed-off-by: manojkiran.eda@gmail.com <manojeda@in.ibm.com>
Change-Id: I43b75091cce6938ea2fa094692f2c3f434e5a774
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 56e1a15..bf5daed 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -107,7 +107,8 @@
     std::string ipv6_default_gateway;
     std::string mac_address;
     std::vector<std::uint32_t> vlan_id;
-    std::vector<std::string> nameservers;
+    std::vector<std::string> nameServers;
+    std::vector<std::string> staticNameServers;
     std::vector<std::string> domainnames;
 };
 
@@ -294,7 +295,19 @@
                                     &propertyPair.second);
                             if (nameservers != nullptr)
                             {
-                                ethData.nameservers = std::move(*nameservers);
+                                ethData.nameServers = std::move(*nameservers);
+                            }
+                        }
+                        else if (propertyPair.first == "StaticNameServers")
+                        {
+                            const std::vector<std::string> *staticNameServers =
+                                sdbusplus::message::variant_ns::get_if<
+                                    std::vector<std::string>>(
+                                    &propertyPair.second);
+                            if (staticNameServers != nullptr)
+                            {
+                                ethData.staticNameServers =
+                                    std::move(*staticNameServers);
                             }
                         }
                         else if (propertyPair.first == "DHCPEnabled")
@@ -1606,7 +1619,8 @@
             "xyz.openbmc_project.Network",
             "/xyz/openbmc_project/network/" + ifaceId,
             "org.freedesktop.DBus.Properties", "Set",
-            "xyz.openbmc_project.Network.EthernetInterface", "Nameservers",
+            "xyz.openbmc_project.Network.EthernetInterface",
+            "StaticNameServers",
             std::variant<std::vector<std::string>>{updatedStaticNameServers});
     }
 
@@ -1806,15 +1820,8 @@
             {"@odata.id", "/redfish/v1/Managers/bmc/EthernetInterfaces/" +
                               iface_id + "/VLANs"}};
 
-        if (translateDHCPEnabledToBool(ethData.DHCPEnabled, true) &&
-            ethData.DNSEnabled)
-        {
-            json_response["StaticNameServers"] = nlohmann::json::array();
-        }
-        else
-        {
-            json_response["StaticNameServers"] = ethData.nameservers;
-        }
+        json_response["NameServers"] = ethData.nameServers;
+        json_response["StaticNameServers"] = ethData.staticNameServers;
 
         nlohmann::json &ipv4_array = json_response["IPv4Addresses"];
         nlohmann::json &ipv4_static_array =