diff options
author | Renato Botelho <renato@netgate.com> | 2016-06-06 08:05:51 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-06-06 08:05:51 -0300 |
commit | 47dfb8d658406ebf07225c0104ebe4be06ae405f (patch) | |
tree | 83174cbd9592560c48ad2cd11afe42c5c12b6c1b /sys/ofed/include/linux/etherdevice.h | |
parent | 131cd15b13bbd3e141e911a65cf7a1895ec6ab05 (diff) | |
parent | 13d657a35d96e65f1be391830f36e1adff33534f (diff) | |
download | FreeBSD-src-47dfb8d658406ebf07225c0104ebe4be06ae405f.zip FreeBSD-src-47dfb8d658406ebf07225c0104ebe4be06ae405f.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/ofed/include/linux/etherdevice.h')
-rw-r--r-- | sys/ofed/include/linux/etherdevice.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/ofed/include/linux/etherdevice.h b/sys/ofed/include/linux/etherdevice.h index c50dc5d..a975bd0 100644 --- a/sys/ofed/include/linux/etherdevice.h +++ b/sys/ofed/include/linux/etherdevice.h @@ -37,6 +37,9 @@ #include <linux/types.h> +#include <sys/random.h> +#include <sys/libkern.h> + #define ETH_MODULE_SFF_8079 1 #define ETH_MODULE_SFF_8079_LEN 256 #define ETH_MODULE_SFF_8472 2 @@ -113,4 +116,31 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src) memcpy(dst, src, 6); } +static inline bool +ether_addr_equal(const u8 *pa, const u8 *pb) +{ + return (memcmp(pa, pb, 6) == 0); +} + +static inline bool +ether_addr_equal_64bits(const u8 *pa, const u8 *pb) +{ + return (memcmp(pa, pb, 6) == 0); +} + +static inline void +eth_broadcast_addr(u8 *pa) +{ + memset(pa, 0xff, 6); +} + +static inline void +random_ether_addr(u8 * dst) +{ + read_random(dst, 6); + + dst[0] &= 0xfe; + dst[0] |= 0x02; +} + #endif /* _LINUX_ETHERDEVICE */ |