|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __MAC_ADDRESS_H__
17 #define __MAC_ADDRESS_H__
35 "MAC address must represent the on wire format");
42 return (((
u64)
a[0] << (
u64) (5 * 8))
54 for (ii = 5; ii >= 0; ii--)
64 return (
a & (1ULL << (5 * 8))) != 0;
70 return ((*((
u32 *)
mac) == 0) && (*((
u16 *) (
mac + 4)) == 0));
79 memcpy (
mac + 2, &rnd,
sizeof (rnd));
87 return ((*((
u32 *)
a) == (*((
u32 *)
b))) &&
88 (*((
u16 *) (
a + 4)) == (*((
u16 *) (
b + 4)))));
108 return (0 ==
mac->u.first_4 && 0 ==
mac->u.last_2);
136 return (memcmp (
a->bytes,
b->bytes, 6));
142 return (
a->u.last_2 ==
b->u.last_2 &&
a->u.first_4 ==
b->u.first_4);
#define clib_memcpy(d, s, n)
uword unformat_mac_address_t(unformat_input_t *input, va_list *args)
static_always_inline u64 mac_address_as_u64(const mac_address_t *mac)
struct mac_address_t_ mac_address_t
static int ethernet_mac_address_is_zero(const u8 *mac)
static_always_inline int mac_address_cmp(const mac_address_t *a, const mac_address_t *b)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static u32 random_u32(u32 *seed)
32-bit random number generator
static int ethernet_mac_address_equal(const u8 *a, const u8 *b)
static_always_inline void mac_address_copy(mac_address_t *dst, const mac_address_t *src)
static u64 ethernet_mac_address_u64(const u8 *a)
static_always_inline int mac_address_n_bits_set(const mac_address_t *a)
#define static_always_inline
STATIC_ASSERT((sizeof(mac_address_t)==6), "MAC address must represent the on wire format")
static_always_inline int mac_address_is_zero(const mac_address_t *mac)
static_always_inline void mac_address_to_bytes(const mac_address_t *mac, u8 *bytes)
u8 * format_mac_address_t(u8 *s, va_list *args)
static_always_inline void mac_address_set_zero(mac_address_t *mac)
static uword count_set_bits(uword x)
static void ethernet_mac_address_generate(u8 *mac)
static_always_inline void mac_address_from_u64(mac_address_t *mac, u64 u)
static int ethernet_mac_address_is_multicast_u64(u64 a)
static void ethernet_mac_address_from_u64(u64 u, u8 *a)
void mac_address_increment(mac_address_t *mac)
struct mac_address_t_::@289::@291 u
const mac_address_t ZERO_MAC_ADDRESS
static u64 clib_cpu_time_now(void)
static_always_inline int mac_address_equal(const mac_address_t *a, const mac_address_t *b)
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)