diff options
Diffstat (limited to 'ethernet_interface.hpp')
-rw-r--r-- | ethernet_interface.hpp | 23 |
1 files changed, 17 insertions, 6 deletions
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 @@ class EthernetInterface : public Ifaces /** @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; |