Refresh the interface objects if DHCP mode changes

Create the ipaddress objects for the ethernet interface
whose DHCP is enabled.

Resolves openbmc/openbmc#1295

Change-Id: Id5ad35f1d51f2bf80c4e2b573e7bd38489370411
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp
index 313a0b9..805c2ac 100644
--- a/ethernet_interface.hpp
+++ b/ethernet_interface.hpp
@@ -23,6 +23,10 @@
         sdbusplus::xyz::openbmc_project::Network::IP::server::Create>;
 
 using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
+
+using EthernetInterfaceIntf =
+    sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
+
 class Manager; // forward declaration of network manager.
 
 class TestEthernetInterface;
@@ -76,17 +80,22 @@
          */
         void deleteObject(const std::string& ipaddress);
 
-        /* @brief creates the dbus object given in the address list.
+        /* @brief creates the dbus object(IPaddres) given in the address list.
          * @param[in] addrs - address list for which dbus objects needs
          *                    to create.
          */
-        void setAddressList(const AddrList& addrs);
+        void createIPAddressObjects();
 
         /* @brief Gets all the ip addresses.
          * @returns the list of ipaddress.
          */
         const AddressMap& getAddresses() const { return addrs; }
 
+        /** Set value of DHCPEnabled */
+        bool dHCPEnabled(bool value) override;
+
+        using EthernetInterfaceIntf::dHCPEnabled;
+
     private:
 
         /** @brief get the info of the ethernet interface.