Don't set/get zeroconfig address if other IP address is present

Resolves openbmc/openbmc#2265

Change-Id: I65b54358f13231c78b3c6488a59b94bc9323484c
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/utils.hpp b/utils.hpp
index b50fde7..265a555 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -45,6 +45,20 @@
                              const std::string& subtreePath = ROOT,
                              const std::string& match = {});
 
+/** @brief Gets the ipAddres of first dbus IP object of Non-LinkLocalIPAddress
+ *         type from the given subtree, if not avalable gets IP object of
+ *         LinkLocalIPAddress type.
+ *  @param[in] bus - DBUS Bus Object.
+ *  @param[in] interface - Dbus interface.
+ *  @param[in] subtreePath - subtree from where the search should start.
+ *  @param[in] match - identifier for object.
+ *  @return On success returns the ipAddress.
+ */
+std::string getIPAddress(sdbusplus::bus::bus& bus,
+                         const std::string& interface,
+                         const std::string& subtreePath,
+                         const std::string& match);
+
 /** @brief Gets the value associated with the given object
  *         and the interface.
  *  @param[in] bus - DBUS Bus Object.
@@ -149,6 +163,8 @@
 constexpr auto SERVICE = "xyz.openbmc_project.Network";
 constexpr auto INTERFACE = "eth0";
 constexpr auto IP_TYPE = "ipv4";
+constexpr auto IPV4_PREFIX = "169.254";
+constexpr auto IPV6_PREFIX = "fe80";
 constexpr auto IP_INTERFACE = "xyz.openbmc_project.Network.IP";
 constexpr auto MAC_INTERFACE = "xyz.openbmc_project.Network.MACAddress";
 constexpr auto SYSTEMCONFIG_INTERFACE = "xyz.openbmc_project.Network.SystemConfiguration";