diff options
Diffstat (limited to 'network_manager.hpp')
-rw-r--r-- | network_manager.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/network_manager.hpp b/network_manager.hpp index a4d066c..e2dfea9 100644 --- a/network_manager.hpp +++ b/network_manager.hpp @@ -118,6 +118,25 @@ class Manager : public details::VLANCreateIface */ virtual void restartSystemdUnit(const std::string& unit); + /** @brief Returns the number of interfaces under this manager. + * + * @return the number of interfaces managed by this manager. + */ + int getInterfaceCount() + { + return interfaces.size(); + } + + /** @brief Does the requested interface exist under this manager? + * + * @param[in] intf - the interface name to check. + * @return true if found, false otherwise. + */ + bool hasInterface(const std::string& intf) + { + return (interfaces.find(intf) != interfaces.end()); + } + protected: /** @brief Persistent sdbusplus DBus bus connection. */ sdbusplus::bus::bus& bus; |