Generate the ip address object path with the use of hash

ipaddress object path have the id for unique identification
of ipaddres and the id would be hash of ipaddress,prefix
and gateway.

This was needed to make sure that there is no duplication
of address object path.

Change-Id: If6830d6e186e3271467ce0084c1dbf3c4995f1dd
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp
index ab69a78..f9bd895 100644
--- a/ethernet_interface.hpp
+++ b/ethernet_interface.hpp
@@ -90,18 +90,29 @@
 
         /** @brief construct the ip address dbus object path.
          *  @param[in] addressType - Type of ip address.
+         *  @param[in] ipaddress - IP address.
+         *  @param[in] prefixLength - Length of prefix.
+         *  @param[in] gateway - Gateway addess.
+
          *  @return path of the address object.
          */
 
-        std::string getAddressObjectPath(IP::Protocol addressType) const;
+        std::string generateObjectPath(IP::Protocol addressType,
+                                       const std::string& ipaddress,
+                                       uint8_t prefixLength,
+                                       const std::string& gateway) const;
 
-        /** @brief get the ipadress count for a specific type on this interface.
-         *  @param[in] addressType - Type of ip address.
-         *  @return count of ipaddreses for the incoming type.
+        /** @brief generates the id by doing hash of ipaddress,
+         *         prefixlength and the gateway.
+         *  @param[in] ipaddress - IP address.
+         *  @param[in] prefixLength - Length of prefix.
+         *  @param[in] gateway - Gateway addess.
+         *  @return hash string.
          */
 
-        size_t getAddressCount(IP::Protocol addressType) const;
-
+        static std::string generateId(const std::string& ipaddress,
+                                      uint8_t prefixLength,
+                                      const std::string& gateway);
 
         /** @brief Persistent sdbusplus DBus bus connection. */
         sdbusplus::bus::bus& bus;