-u8 * format_nsh_header_with_length (u8 * s, va_list * args)
-{
- nsh_header_t * h = va_arg (*args, nsh_header_t *);
- u32 max_header_bytes = va_arg (*args, u32);
- u32 tmp, header_bytes;
-
- header_bytes = sizeof (h[0]);
- if (max_header_bytes != 0 && header_bytes > max_header_bytes)
- return format (s, "gre-nsh header truncated");
-
- s = format (s, "ver %d ", h->ver_o_c>>6);
-
- if (h->ver_o_c & NSH_O_BIT)
- s = format (s, "O-set ");
-
- if (h->ver_o_c & NSH_C_BIT)
- s = format (s, "C-set ");
-
- s = format (s, "len %d (%d bytes) md_type %d next_protocol %d\n",
- h->length, h->length * 4, h->md_type, h->next_protocol);
-
- tmp = clib_net_to_host_u32 (h->spi_si);
-
- s = format (s, " spi %d si %d ",
- (tmp>>NSH_SPI_SHIFT) & NSH_SPI_MASK,
- tmp & NSH_SINDEX_MASK);
-
- s = format (s, "c1 %u c2 %u c3 %u c4 %u",
- clib_net_to_host_u32 (h->c1),
- clib_net_to_host_u32 (h->c2),
- clib_net_to_host_u32 (h->c3),
- clib_net_to_host_u32 (h->c4));
-
- return s;
-}
-
-
-u8 * format_nsh_rx_trace (u8 * s, va_list * args)