|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
31 return format (s,
"%02x:%02x:%02x:%02x:%02x:%02x",
32 mac->bytes[0],
mac->bytes[1],
mac->bytes[2],
33 mac->bytes[3],
mac->bytes[4],
mac->bytes[5]);
42 if (
unformat (input,
"%_%X:%X:%X:%X:%X:%X%_",
43 1, &
mac->bytes[0], 1, &
mac->bytes[1], 1, &
mac->bytes[2],
44 1, &
mac->bytes[3], 1, &
mac->bytes[4], 1, &
mac->bytes[5]))
46 else if (
unformat (input,
"%_%x.%x.%x%_", &
a[0], &
a[1], &
a[2]))
49 if (
a[
i] >= (1 << 16))
52 mac->bytes[0] = (
a[0] >> 8) & 0xff;
53 mac->bytes[1] = (
a[0] >> 0) & 0xff;
54 mac->bytes[2] = (
a[1] >> 8) & 0xff;
55 mac->bytes[3] = (
a[1] >> 0) & 0xff;
56 mac->bytes[4] = (
a[2] >> 8) & 0xff;
57 mac->bytes[5] = (
a[2] >> 0) & 0xff;
static_always_inline u64 mac_address_as_u64(const mac_address_t *mac)
const mac_address_t ZERO_MAC_ADDRESS
u8 * format_mac_address_t(u8 *s, va_list *args)
sll srl srl sll sra u16x4 i
void mac_address_increment(mac_address_t *mac)
static_always_inline void mac_address_from_u64(mac_address_t *mac, u64 u)
description fragment has unexpected format
uword unformat_mac_address_t(unformat_input_t *input, va_list *args)