a[0], a[1], a[2], a[3], a[4], a[5]);
}
+u8 *
+format_mac_address (u8 * s, va_list * args)
+{
+ return (format_ethernet_address (s, args));
+}
+
u8 *
format_ethernet_type (u8 * s, va_list * args)
{
return s;
}
-u8 *
-format_ethernet_pbb (u8 * s, va_list * va)
-{
- u32 b_tag = va_arg (*va, u32);
- u32 i_tag = va_arg (*va, u32);
- u32 vid = (b_tag & 0xfff);
- u32 bdei = (b_tag >> 12) & 1;
- u32 bpcp = (b_tag >> 13);
- u32 sid = (i_tag & 0xffffff);
- u8 ires = (i_tag >> 24) & 3;
- u8 iuca = (i_tag >> 27) & 1;
- u8 idei = (i_tag >> 28) & 1;
- u8 ipcp = (i_tag >> 29);
-
- s =
- format (s, "B_tag %04X (vid %d, dei %d, pcp %d), ", b_tag, vid, bdei,
- bpcp);
- s =
- format (s, "I_tag %08X (sid %d, res %d, dei %d, pcp %d)", i_tag, sid,
- ires, iuca, idei, ipcp);
-
- return s;
-}
-
u8 *
format_ethernet_header_with_length (u8 * s, va_list * args)
{
ethernet_type_t type = clib_net_to_host_u16 (e->type);
ethernet_type_t vlan_type[ARRAY_LEN (m->vlan)];
u32 n_vlan = 0, i, header_bytes;
- uword indent;
+ u32 indent;
while ((type == ETHERNET_TYPE_VLAN || type == ETHERNET_TYPE_DOT1AD
|| type == ETHERNET_TYPE_DOT1AH) && n_vlan < ARRAY_LEN (m->vlan))
}
else
{
- s = format (s, "\n%UPBB header : %U", format_white_space, indent,
- format_ethernet_pbb,
- clib_net_to_host_u16 (ph->priority_dei_id),
- clib_net_to_host_u32 (ph->priority_dei_uca_res_sid));
+ s =
+ format (s, " %s b-tag %04X",
+ (clib_net_to_host_u16 (ph->b_type) ==
+ ETHERNET_TYPE_DOT1AD) ? "802.1ad" : "",
+ clib_net_to_host_u16 (ph->priority_dei_id));
+ s =
+ format (s, " %s i-tag %08X",
+ (clib_net_to_host_u16 (ph->i_type) ==
+ ETHERNET_TYPE_DOT1AH) ? "802.1ah" : "",
+ clib_net_to_host_u32 (ph->priority_dei_uca_res_sid));
}
return s;
|| unformat_user (input, unformat_ethernet_address_cisco, result));
}
+uword
+unformat_mac_address (unformat_input_t * input, va_list * args)
+{
+ return (unformat_ethernet_address (input, args));
+}
+
+
/* Returns ethernet type as an int in host byte order. */
uword
unformat_ethernet_type_host_byte_order (unformat_input_t * input,