35 unsigned char const *src =
reinterpret_cast<unsigned char const *
>(_src);
36 _mac = ((uint64_t)src[0]) | (((uint64_t)src[1]) << 8)
37 | (((uint64_t)src[2]) << 16) | (((uint64_t)src[3]) << 24)
38 | (((uint64_t)src[4]) << 32) | (((uint64_t)src[5]) << 40);
41 explicit Mac_addr(uint64_t mac) : _mac{mac} {}
64 {
return _mac == Addr_unknown; }
66 bool operator == (
Mac_addr const &other)
const
67 {
return _mac == other._mac; }
69 bool operator != (
Mac_addr const &other)
const
70 {
return _mac != other._mac; }
72 bool operator < (
Mac_addr const &other)
const
73 {
return _mac < other._mac; }
76 { _mac = other._mac;
return *
this; }
79 { _mac = mac;
return *
this; }
82 void print(T &stream)
const
84 stream.cprintf(
"%02x:%02x:%02x:%02x:%02x:%02x",
85 (
int)(_mac & 0xff) , (
int)((_mac >> 8) & 0xff),
86 (
int)((_mac >> 16) & 0xff), (
int)((_mac >> 24) & 0xff),
87 (
int)((_mac >> 32) & 0xff), (
int)((_mac >> 40) & 0xff));