31 return format (s,
"%02x:%02x:%02x:%02x:%02x:%02x",
42 if (
unformat (input,
"%_%X:%X:%X:%X:%X:%X%_",
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;
void mac_address_increment(mac_address_t *mac)
static_always_inline void mac_address_from_u64(mac_address_t *mac, u64 u)
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)
u8 * format_mac_address_t(u8 *s, va_list *args)