Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 1 | #pragma once |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 2 | |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 3 | #include <chrono> |
Vernon Mauery | 3325024 | 2019-03-12 16:49:26 -0700 | [diff] [blame] | 4 | #include <ipmid/types.hpp> |
Vernon Mauery | 5401250 | 2018-11-07 10:17:31 -0800 | [diff] [blame] | 5 | #include <optional> |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 6 | #include <sdbusplus/server.hpp> |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 7 | |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 8 | namespace ipmi |
| 9 | { |
| 10 | |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 11 | using namespace std::literals::chrono_literals; |
| 12 | |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 13 | constexpr auto MAPPER_BUS_NAME = "xyz.openbmc_project.ObjectMapper"; |
| 14 | constexpr auto MAPPER_OBJ = "/xyz/openbmc_project/object_mapper"; |
| 15 | constexpr auto MAPPER_INTF = "xyz.openbmc_project.ObjectMapper"; |
| 16 | |
| 17 | constexpr auto ROOT = "/"; |
| 18 | constexpr auto HOST_MATCH = "host0"; |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 19 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 20 | constexpr auto PROP_INTF = "org.freedesktop.DBus.Properties"; |
| 21 | constexpr auto DELETE_INTERFACE = "xyz.openbmc_project.Object.Delete"; |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 22 | |
| 23 | constexpr auto METHOD_GET = "Get"; |
| 24 | constexpr auto METHOD_GET_ALL = "GetAll"; |
| 25 | constexpr auto METHOD_SET = "Set"; |
| 26 | |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 27 | /* Use a value of 5s which aligns with BT/KCS bridged timeouts, rather |
| 28 | * than the default 25s D-Bus timeout. */ |
| 29 | constexpr std::chrono::microseconds IPMI_DBUS_TIMEOUT = 5s; |
| 30 | |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 31 | /** @class ServiceCache |
| 32 | * @brief Caches lookups of service names from the object mapper. |
| 33 | * @details Most ipmi commands need to talk to other dbus daemons to perform |
| 34 | * their intended actions on the BMC. This usually means they will |
| 35 | * first look up the service name providing the interface they |
| 36 | * require. This class reduces the number of such calls by caching |
| 37 | * the lookup for a specific service. |
| 38 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 39 | class ServiceCache |
| 40 | { |
| 41 | public: |
| 42 | /** @brief Creates a new service cache for the given interface |
| 43 | * and path. |
| 44 | * |
| 45 | * @param[in] intf - The interface used for each lookup |
| 46 | * @param[in] path - The path used for each lookup |
| 47 | */ |
| 48 | ServiceCache(const std::string& intf, const std::string& path); |
| 49 | ServiceCache(std::string&& intf, std::string&& path); |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 50 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 51 | /** @brief Gets the service name from the cache or does in a |
| 52 | * lookup when invalid. |
| 53 | * |
| 54 | * @param[in] bus - The bus associated with and used for looking |
| 55 | * up the service. |
| 56 | */ |
| 57 | const std::string& getService(sdbusplus::bus::bus& bus); |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 58 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 59 | /** @brief Invalidates the current service name */ |
| 60 | void invalidate(); |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 61 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 62 | /** @brief A wrapper around sdbusplus bus.new_method_call |
| 63 | * |
| 64 | * @param[in] bus - The bus used for calling the method |
| 65 | * @param[in] intf - The interface containing the method |
| 66 | * @param[in] method - The method name |
| 67 | * @return The message containing the method call. |
| 68 | */ |
| 69 | sdbusplus::message::message newMethodCall(sdbusplus::bus::bus& bus, |
| 70 | const char* intf, |
| 71 | const char* method); |
William A. Kennington III | 82c173a | 2018-05-11 16:10:12 -0700 | [diff] [blame] | 72 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 73 | /** @brief Check to see if the current cache is valid |
| 74 | * |
| 75 | * @param[in] bus - The bus used for the service lookup |
| 76 | * @return True if the cache is valid false otherwise. |
| 77 | */ |
| 78 | bool isValid(sdbusplus::bus::bus& bus) const; |
| 79 | |
| 80 | private: |
| 81 | /** @brief DBUS interface provided by the service */ |
| 82 | const std::string intf; |
| 83 | /** @brief DBUS path provided by the service */ |
| 84 | const std::string path; |
| 85 | /** @brief The name of the service if valid */ |
Vernon Mauery | 5401250 | 2018-11-07 10:17:31 -0800 | [diff] [blame] | 86 | std::optional<std::string> cachedService; |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 87 | /** @brief The name of the bus used in the service lookup */ |
Vernon Mauery | 5401250 | 2018-11-07 10:17:31 -0800 | [diff] [blame] | 88 | std::optional<std::string> cachedBusName; |
William A. Kennington III | e47fdfb | 2018-03-15 17:09:28 -0700 | [diff] [blame] | 89 | }; |
| 90 | |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 91 | /** |
| 92 | * @brief Get the DBUS Service name for the input dbus path |
| 93 | * |
| 94 | * @param[in] bus - DBUS Bus Object |
| 95 | * @param[in] intf - DBUS Interface |
| 96 | * @param[in] path - DBUS Object Path |
| 97 | * |
| 98 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 99 | std::string getService(sdbusplus::bus::bus& bus, const std::string& intf, |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 100 | const std::string& path); |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 101 | |
| 102 | /** @brief Gets the dbus object info implementing the given interface |
| 103 | * from the given subtree. |
Ratan Gupta | 01d4bd1 | 2017-08-07 15:53:25 +0530 | [diff] [blame] | 104 | * @param[in] bus - DBUS Bus Object. |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 105 | * @param[in] interface - Dbus interface. |
| 106 | * @param[in] subtreePath - subtree from where the search should start. |
| 107 | * @param[in] match - identifier for object. |
| 108 | * @return On success returns the object having objectpath and servicename. |
| 109 | */ |
Ratan Gupta | 01d4bd1 | 2017-08-07 15:53:25 +0530 | [diff] [blame] | 110 | DbusObjectInfo getDbusObject(sdbusplus::bus::bus& bus, |
| 111 | const std::string& interface, |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 112 | const std::string& subtreePath = ROOT, |
| 113 | const std::string& match = {}); |
| 114 | |
Ratan Gupta | dd64620 | 2017-11-21 17:46:59 +0530 | [diff] [blame] | 115 | /** @brief Get the ipObject of first dbus IP object of Non-LinkLocalIPAddress |
Gunnar Mills | 8991dd6 | 2017-10-25 17:11:29 -0500 | [diff] [blame] | 116 | * type from the given subtree, if not available gets IP object of |
Nagaraju Goruganti | 1fe5c83 | 2017-09-21 07:44:17 -0500 | [diff] [blame] | 117 | * LinkLocalIPAddress type. |
| 118 | * @param[in] bus - DBUS Bus Object. |
| 119 | * @param[in] interface - Dbus interface. |
| 120 | * @param[in] subtreePath - subtree from where the search should start. |
| 121 | * @param[in] match - identifier for object. |
Ratan Gupta | dd64620 | 2017-11-21 17:46:59 +0530 | [diff] [blame] | 122 | * @return On success returns the object having objectpath and servicename. |
Nagaraju Goruganti | 1fe5c83 | 2017-09-21 07:44:17 -0500 | [diff] [blame] | 123 | */ |
Ratan Gupta | dd64620 | 2017-11-21 17:46:59 +0530 | [diff] [blame] | 124 | DbusObjectInfo getIPObject(sdbusplus::bus::bus& bus, |
| 125 | const std::string& interface, |
| 126 | const std::string& subtreePath, |
| 127 | const std::string& match); |
Nagaraju Goruganti | 1fe5c83 | 2017-09-21 07:44:17 -0500 | [diff] [blame] | 128 | |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 129 | /** @brief Gets the value associated with the given object |
| 130 | * and the interface. |
Ratan Gupta | 01d4bd1 | 2017-08-07 15:53:25 +0530 | [diff] [blame] | 131 | * @param[in] bus - DBUS Bus Object. |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 132 | * @param[in] service - Dbus service name. |
| 133 | * @param[in] objPath - Dbus object path. |
| 134 | * @param[in] interface - Dbus interface. |
| 135 | * @param[in] property - name of the property. |
| 136 | * @return On success returns the value of the property. |
| 137 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 138 | Value getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service, |
| 139 | const std::string& objPath, const std::string& interface, |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 140 | const std::string& property, |
| 141 | std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT); |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 142 | |
| 143 | /** @brief Gets all the properties associated with the given object |
| 144 | * and the interface. |
Ratan Gupta | 01d4bd1 | 2017-08-07 15:53:25 +0530 | [diff] [blame] | 145 | * @param[in] bus - DBUS Bus Object. |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 146 | * @param[in] service - Dbus service name. |
| 147 | * @param[in] objPath - Dbus object path. |
| 148 | * @param[in] interface - Dbus interface. |
| 149 | * @return On success returns the map of name value pair. |
| 150 | */ |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 151 | PropertyMap |
| 152 | getAllDbusProperties(sdbusplus::bus::bus& bus, const std::string& service, |
| 153 | const std::string& objPath, |
| 154 | const std::string& interface, |
| 155 | std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT); |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 156 | |
Dhruvaraj Subhashchandran | 5c0beec | 2018-01-23 04:47:06 -0600 | [diff] [blame] | 157 | /** @brief Gets all managed objects associated with the given object |
| 158 | * path and service. |
| 159 | * @param[in] bus - D-Bus Bus Object. |
| 160 | * @param[in] service - D-Bus service name. |
| 161 | * @param[in] objPath - D-Bus object path. |
| 162 | * @return On success returns the map of name value pair. |
| 163 | */ |
| 164 | ObjectValueTree getManagedObjects(sdbusplus::bus::bus& bus, |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 165 | const std::string& service, |
| 166 | const std::string& objPath); |
Dhruvaraj Subhashchandran | 5c0beec | 2018-01-23 04:47:06 -0600 | [diff] [blame] | 167 | |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 168 | /** @brief Sets the property value of the given object. |
Ratan Gupta | 01d4bd1 | 2017-08-07 15:53:25 +0530 | [diff] [blame] | 169 | * @param[in] bus - DBUS Bus Object. |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 170 | * @param[in] service - Dbus service name. |
| 171 | * @param[in] objPath - Dbus object path. |
| 172 | * @param[in] interface - Dbus interface. |
| 173 | * @param[in] property - name of the property. |
| 174 | * @param[in] value - value which needs to be set. |
| 175 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 176 | void setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service, |
| 177 | const std::string& objPath, const std::string& interface, |
Kun Yi | 5dcf41e | 2019-03-05 14:02:51 -0800 | [diff] [blame] | 178 | const std::string& property, const Value& value, |
| 179 | std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT); |
Ratan Gupta | cc8feb4 | 2017-07-25 21:52:10 +0530 | [diff] [blame] | 180 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 181 | /** @brief Gets all the dbus objects from the given service root |
| 182 | * which matches the object identifier. |
| 183 | * @param[in] bus - DBUS Bus Object. |
| 184 | * @param[in] serviceRoot - Service root path. |
| 185 | * @param[in] interface - Dbus interface. |
| 186 | * @param[in] match - Identifier for a path. |
| 187 | * @returns map of object path and service info. |
| 188 | */ |
| 189 | ObjectTree getAllDbusObjects(sdbusplus::bus::bus& bus, |
| 190 | const std::string& serviceRoot, |
| 191 | const std::string& interface, |
Vernon Mauery | 6f2c8cd | 2018-07-28 06:40:39 -0700 | [diff] [blame] | 192 | const std::string& match = {}); |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 193 | |
| 194 | /** @brief Deletes all the dbus objects from the given service root |
| 195 | which matches the object identifier. |
| 196 | * @param[in] bus - DBUS Bus Object. |
| 197 | * @param[in] serviceRoot - Service root path. |
| 198 | * @param[in] interface - Dbus interface. |
| 199 | * @param[in] match - Identifier for object. |
| 200 | */ |
| 201 | void deleteAllDbusObjects(sdbusplus::bus::bus& bus, |
| 202 | const std::string& serviceRoot, |
| 203 | const std::string& interface, |
| 204 | const std::string& match = {}); |
| 205 | |
Ratan Gupta | cc6cdbf | 2017-09-01 23:06:25 +0530 | [diff] [blame] | 206 | /** @brief Gets the ancestor objects of the given object |
| 207 | which implements the given interface. |
| 208 | * @param[in] bus - Dbus bus object. |
| 209 | * @param[in] path - Child Dbus object path. |
| 210 | * @param[in] interfaces - Dbus interface list. |
| 211 | * @return map of object path and service info. |
| 212 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 213 | ObjectTree getAllAncestors(sdbusplus::bus::bus& bus, const std::string& path, |
Ratan Gupta | cc6cdbf | 2017-09-01 23:06:25 +0530 | [diff] [blame] | 214 | InterfaceList&& interfaces); |
| 215 | |
James Feist | 1e12112 | 2018-07-31 11:44:09 -0700 | [diff] [blame] | 216 | /** @struct VariantToDoubleVisitor |
| 217 | * @brief Visitor to convert variants to doubles |
| 218 | * @details Performs a static cast on the underlying type |
| 219 | */ |
| 220 | struct VariantToDoubleVisitor |
| 221 | { |
| 222 | template <typename T> |
| 223 | std::enable_if_t<std::is_arithmetic<T>::value, double> |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 224 | operator()(const T& t) const |
James Feist | 1e12112 | 2018-07-31 11:44:09 -0700 | [diff] [blame] | 225 | { |
| 226 | return static_cast<double>(t); |
| 227 | } |
| 228 | |
| 229 | template <typename T> |
| 230 | std::enable_if_t<!std::is_arithmetic<T>::value, double> |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 231 | operator()(const T& t) const |
James Feist | 1e12112 | 2018-07-31 11:44:09 -0700 | [diff] [blame] | 232 | { |
| 233 | throw std::invalid_argument("Cannot translate type to double"); |
| 234 | } |
| 235 | }; |
| 236 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 237 | namespace method_no_args |
| 238 | { |
| 239 | |
| 240 | /** @brief Calls the Dbus method which waits for response. |
| 241 | * @param[in] bus - DBUS Bus Object. |
| 242 | * @param[in] service - Dbus service name. |
| 243 | * @param[in] objPath - Dbus object path. |
| 244 | * @param[in] interface - Dbus interface. |
| 245 | * @param[in] method - Dbus method. |
| 246 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 247 | void callDbusMethod(sdbusplus::bus::bus& bus, const std::string& service, |
| 248 | const std::string& objPath, const std::string& interface, |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 249 | const std::string& method); |
| 250 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 251 | } // namespace method_no_args |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 252 | |
| 253 | namespace network |
| 254 | { |
| 255 | |
| 256 | constexpr auto ROOT = "/xyz/openbmc_project/network"; |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 257 | constexpr auto SERVICE = "xyz.openbmc_project.Network"; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 258 | constexpr auto IP_TYPE = "ipv4"; |
Nagaraju Goruganti | 1fe5c83 | 2017-09-21 07:44:17 -0500 | [diff] [blame] | 259 | constexpr auto IPV4_PREFIX = "169.254"; |
| 260 | constexpr auto IPV6_PREFIX = "fe80"; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 261 | constexpr auto IP_INTERFACE = "xyz.openbmc_project.Network.IP"; |
| 262 | constexpr auto MAC_INTERFACE = "xyz.openbmc_project.Network.MACAddress"; |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 263 | constexpr auto SYSTEMCONFIG_INTERFACE = |
| 264 | "xyz.openbmc_project.Network.SystemConfiguration"; |
| 265 | constexpr auto ETHERNET_INTERFACE = |
| 266 | "xyz.openbmc_project.Network.EthernetInterface"; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 267 | constexpr auto IP_CREATE_INTERFACE = "xyz.openbmc_project.Network.IP.Create"; |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 268 | constexpr auto VLAN_CREATE_INTERFACE = |
| 269 | "xyz.openbmc_project.Network.VLAN.Create"; |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 270 | constexpr auto VLAN_INTERFACE = "xyz.openbmc_project.Network.VLAN"; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 271 | |
| 272 | /* @brief converts the given subnet into prefix notation. |
| 273 | * @param[in] addressFamily - IP address family(AF_INET/AF_INET6). |
| 274 | * @param[in] mask - Subnet Mask. |
| 275 | * @returns prefix. |
| 276 | */ |
| 277 | uint8_t toPrefix(int addressFamily, const std::string& subnetMask); |
| 278 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 279 | /** @brief Sets the ip on the system. |
| 280 | * @param[in] bus - DBUS Bus Object. |
| 281 | * @param[in] service - Dbus service name. |
| 282 | * @param[in] objPath - Dbus object path. |
| 283 | * @param[in] protocolType - Protocol type |
| 284 | * @param[in] ipaddress - IPaddress. |
| 285 | * @param[in] prefix - Prefix length. |
| 286 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 287 | void createIP(sdbusplus::bus::bus& bus, const std::string& service, |
| 288 | const std::string& objPath, const std::string& protocolType, |
| 289 | const std::string& ipaddress, uint8_t prefix); |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 290 | |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 291 | /** @brief Creates the VLAN on the given interface. |
| 292 | * @param[in] bus - DBUS Bus Object. |
| 293 | * @param[in] service - Dbus service name. |
| 294 | * @param[in] objPath - Dbus object path. |
| 295 | * @param[in] interface - EthernetInterface. |
| 296 | * @param[in] vlanID - Vlan ID. |
| 297 | */ |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 298 | void createVLAN(sdbusplus::bus::bus& bus, const std::string& service, |
| 299 | const std::string& objPath, const std::string& interface, |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 300 | uint32_t vlanID); |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 301 | |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 302 | /** @brief Gets the vlan id from the given object path. |
| 303 | * @param[in] path - Dbus object path. |
| 304 | */ |
| 305 | uint32_t getVLAN(const std::string& path); |
| 306 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 307 | } // namespace network |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 308 | } // namespace ipmi |