diff options
author | Nagaraju Goruganti <ngorugan@in.ibm.com> | 2017-09-21 07:44:17 -0500 |
---|---|---|
committer | Nagaraju Goruganti <ngorugan@in.ibm.com> | 2017-10-11 23:25:21 -0500 |
commit | 1fe5c834b9ae4f09726dea8a1c7b3a05d87f1344 (patch) | |
tree | 4fbf65c1fe805165a86cf32c678bf0c0ffc252f9 /utils.hpp | |
parent | e245e4e932279a112325dae06d7c12cf9e8ed833 (diff) | |
download | phosphor-host-ipmid-1fe5c834b9ae4f09726dea8a1c7b3a05d87f1344.tar.gz phosphor-host-ipmid-1fe5c834b9ae4f09726dea8a1c7b3a05d87f1344.zip |
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>
Diffstat (limited to 'utils.hpp')
-rw-r--r-- | utils.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -45,6 +45,20 @@ DbusObjectInfo getDbusObject(sdbusplus::bus::bus& bus, 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 ROOT = "/xyz/openbmc_project/network"; 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"; |