Convert IPv4 subnet mask into prefix length
Resolves openbmc/openbmc#1292
Change-Id: I9b24e98589bd68cc59893b5e43b514bd0bec3f26
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/network_manager.hpp b/network_manager.hpp
index 3d745ce..f37544c 100644
--- a/network_manager.hpp
+++ b/network_manager.hpp
@@ -29,7 +29,8 @@
using IntfName = std::string;
-struct AddrInfo {
+struct AddrInfo
+{
short addrType;
std::string ipaddress;
};
@@ -78,6 +79,9 @@
*/
IntfAddrMap getInterfaceAddrs() const;
+ /** @brief converts the given subnet into prefix notation **/
+ uint8_t toCidr(const char* subnetMask) const;
+
/** @brief Persistent map of EthernetInterface dbus objects and their names */
std::map<IntfName, std::unique_ptr<EthernetInterface>> interfaces;