17 #ifndef HH_SENF_Socket_Protocols_Raw_MACAddress_ 18 #define HH_SENF_Socket_Protocols_Raw_MACAddress_ 1 23 #include <boost/array.hpp> 26 #include <senf/autoconf.hh> 73 :
public boost::array<std::uint8_t,6>
93 template <
class InputIterator>
110 explicit operator bool()
const;
118 void local(
bool flag);
121 std::uint32_t
oui()
const;
122 std::uint32_t
nic()
const;
124 void oui(std::uint32_t
oui);
125 void nic(std::uint32_t
oui);
127 std::uint64_t
eui64()
const;
128 std::uint64_t
uint64()
const;
130 std::uint32_t
const &
hash32()
const;
131 void hash(std::uint64_t *
hash, std::uint16_t
const & otherKey = 0)
const;
148 # if __SIZEOF_SIZE_T__ == 8 150 #elif __SIZEOF_SIZE_T__ == 4 157 #ifdef SENF_CXX11_ENABLED 161 # if __SIZEOF_SIZE_T__ == 8 165 #elif __SIZEOF_SIZE_T__ == 4 166 std::size_t
const & operator()(
senf::MACAddress const & mac)
const noexcept {
bool broadcast() const
true, if address is the broadcast address
static MACAddress const None
The empty (0) address.
std::istream & operator>>(std::istream &is, MACAddress &mac)
Try to initialize MACAddress instance from a string representation sets std::ios::failbit on the stre...
std::uint32_t const & hash32() const
MACAddress()
Construct zero-initialized address.
static MACAddress from_string(std::string const &s)
Construct address from string representation.
std::uint64_t eui64() const
Build EUI-64 from the MAC address.
static MACAddress from_eui64(senf::EUI64 const &eui)
Construct address from EUI-64.
void hash(std::uint64_t *hash, std::uint16_t const &otherKey=0) const
computes a fast uint64 hash mixing in another 16bit value
std::uint32_t nic() const
Return last 3 bytes of the address.
std::ostream & operator<<(std::ostream &os, MACAddress const &mac)
Output MAC instance as it's string representation.
std::uint64_t uint64() const
Return MAC address as uint64 value.
bool operator<(MACAddress const &other) const
bool local() const
true, if address is locally administered
std::size_t hash_value(MACAddress const &mac) noexcept
std::uint32_t oui() const
Return first 3 bytes of the address.
bool multicast() const
true, if address is a group/multicast address
bool operator==(EUI64 const &eui64) const
static MACAddress from_data(InputIterator i)
Construct address from raw data.
static MACAddress const Broadcast
The broadcast address.