summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_format.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-10-10 17:03:57 +0000
committerOle Trøan <otroan@employees.org>2019-10-11 11:38:40 +0000
commit8563cb389a7e8d6d4e042e146c0d94b8af98ca7a (patch)
tree0cd1e4da6816a452c7eaed44e7f913a3ecefc255 /src/vnet/ip/ip6_format.c
parent68bae5b293d6066afc1e74677d716d79fb7e6995 (diff)
ip: reassembly: trace ip headers over worker handoffs
This change adds tracing of IP headers when doing a handoff between worker threads. This eases debugging. Type: feature Change-Id: I2195b070a364cba13a658ec1cee5154fc4c3a8b0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6_format.c')
-rw-r--r--src/vnet/ip/ip6_format.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vnet/ip/ip6_format.c b/src/vnet/ip/ip6_format.c
index 4d1793970df..5b8df239bf2 100644
--- a/src/vnet/ip/ip6_format.c
+++ b/src/vnet/ip/ip6_format.c
@@ -417,6 +417,25 @@ format_ip46_address (u8 * s, va_list * args)
format (s, "%U", format_ip6_address, &ip46->ip6);
}
+u8 *
+format_ip6_frag_hdr (u8 * s, va_list * args)
+{
+ ip6_frag_hdr_t *h = va_arg (*args, ip6_frag_hdr_t *);
+ u32 max_header_bytes = va_arg (*args, u32);
+ u32 header_bytes;
+
+ header_bytes = sizeof (h[0]);
+ if (max_header_bytes != 0 && header_bytes > max_header_bytes)
+ return format (s, "ipv6 frag header truncated");
+
+ s =
+ format (s,
+ "IPV6_FRAG_HDR: next_hdr: %u, rsv: %u, frag_offset_and_more: %u, id: %u",
+ h->next_hdr, h->rsv, h->fragment_offset_and_more,
+ clib_net_to_host_u32 (h->identification));
+ return s;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*