core: add free function to enumerate network interfaces.
Change-Id: Icd89662afe9e1295cd18a615970c5b4299529b38
Refs: #1306
diff --git a/daemon/face/ethernet.hpp b/daemon/face/ethernet.hpp
index 66ee715..f12b3fb 100644
--- a/daemon/face/ethernet.hpp
+++ b/daemon/face/ethernet.hpp
@@ -52,6 +52,10 @@
bool
isMulticast() const;
+ /// True if this is a null address (00-00-00-00-00-00)
+ bool
+ isNull() const;
+
std::string
toString(char sep = '-') const;
};
@@ -114,6 +118,13 @@
return (elems[0] & 1) != 0;
}
+inline bool
+Address::isNull() const
+{
+ return elems[0] == 0x0 && elems[1] == 0x0 && elems[2] == 0x0 &&
+ elems[3] == 0x0 && elems[4] == 0x0 && elems[5] == 0x0;
+}
+
inline std::string
Address::toString(char sep) const
{