50 explicit MAC(
const std::string& mac);
58 explicit MAC(uint8_t mac[6]);
83 explicit MAC(uint64_t mac);
121#if __cplusplus > 199711L
128template<>
struct hash<opflex::modb::MAC> {
A MAC address is used to identify devices on an ethernet network.
Definition MAC.h:37
friend size_t hash_value(MAC const &mac)
Compute a hash value for the MAC, making MAC suitable as a key in a boost::unordered_map.
size_t hash_value(MAC const &mac)
Compute a hash value for the MAC, making MAC suitable as a key in a boost::unordered_map.
friend bool operator!=(const MAC &lhs, const MAC &rhs)
Check for MAC inequality.
std::ostream & operator<<(std::ostream &os, const MAC &mac)
Stream insertion operator.
bool operator!=(const MAC &lhs, const MAC &rhs)
Check for MAC inequality.
void toUIntArray(uint8_t mac[6]) const
Get the MAC represented as an array of 6 bytes in network byte order.
MAC(uint8_t mac[6])
Construct a MAC using an array of 6 bytes, in network byte order.
std::string toString() const
Get the MAC represented as a string.
friend bool operator==(const MAC &lhs, const MAC &rhs)
Check for MAC equality.
bool operator==(const MAC &lhs, const MAC &rhs)
Check for MAC equality.
MAC(const std::string &mac)
Construct a MAC using the given string representation.
MAC()
Construct a MAC consisting of all zeroes.