ethernet: Add origin to generateId()

Currently the code uses the ip address, prefix, and gateway to generate
the ID of the DBus object.
This results in the same DBus object path for the same IPs while they
have different address origin.
E.g. if we have the DHCP address and assign the same static address, the
DBus object paths are the same and it gets
`org.freedesktop.DBus.Error.FileExists` exception while creating the new
object.

Add origin to generateId() so they generate the two different object
paths and the above issue could be fixed.

Tested: Verify in QEMU that setting static IP is OK from DHCP.

Fixes openbmc/phosphor-networkd#41

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Iafe94cedff7e39490386be7777f3d975f1cf6b3f
diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
index fef1579..c063777 100644
--- a/src/ethernet_interface.hpp
+++ b/src/ethernet_interface.hpp
@@ -276,6 +276,7 @@
      *  @param[in] ipAddress - IP address.
      *  @param[in] prefixLength - Length of prefix.
      *  @param[in] gateway - Gateway address.
+     *  @param[in] origin - The origin entry of the IP::Address
 
      *  @return path of the address object.
      */
@@ -283,7 +284,8 @@
     std::string generateObjectPath(IP::Protocol addressType,
                                    const std::string& ipAddress,
                                    uint8_t prefixLength,
-                                   const std::string& gateway) const;
+                                   const std::string& gateway,
+                                   IP::AddressOrigin origin) const;
 
     std::string
         generateStaticNeighborObjectPath(const std::string& ipAddress,
@@ -294,12 +296,14 @@
      *  @param[in] ipAddress - IP address.
      *  @param[in] prefixLength - Length of prefix.
      *  @param[in] gateway - Gateway address.
+     *  @param[in] origin - The string of the address origin
      *  @return hash string.
      */
 
     static std::string generateId(const std::string& ipAddress,
                                   uint8_t prefixLength,
-                                  const std::string& gateway);
+                                  const std::string& gateway,
+                                  const std::string& origin);
 
     /** @brief generates the id by doing hash of ipAddress
      *         and the mac address.