summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_format.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-16 06:19:35 -0700
committerNeale Ranns <nranns@cisco.com>2019-07-16 15:05:10 +0000
commit41afb33efe81a93ddf5879138802bf23602ccc81 (patch)
treec0a8f8b7866d58379e35fd5b57057b86b780115a /src/vnet/ipsec/ipsec_format.c
parent37dab437be1331e40f6f3e63f52235655431f65f (diff)
ipsec: handle UDP keepalives
Type: feature Change-Id: I87cc1168466f267e8c4bbec318401982f4bdf03a Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_format.c')
-rw-r--r--src/vnet/ipsec/ipsec_format.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index 0d596c0c973..7a5e2584719 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -259,9 +259,7 @@ format_ipsec_sa_flags (u8 * s, va_list * args)
{
ipsec_sa_flags_t flags = va_arg (*args, int);
- if (0)
- ;
-#define _(v, f, str) else if (flags & IPSEC_SA_FLAG_##f) s = format(s, "%s ", str);
+#define _(v, f, str) if (flags & IPSEC_SA_FLAG_##f) s = format(s, "%s ", str);
foreach_ipsec_sa_flags
#undef _
return (s);
@@ -285,10 +283,8 @@ format_ipsec_sa (u8 * s, va_list * args)
sa = pool_elt_at_index (im->sad, sai);
- s = format (s, "[%d] sa %d (0x%x) spi %u (0x%08x) mode %s%s protocol %s %U",
+ s = format (s, "[%d] sa %u (0x%x) spi %u (0x%08x) protocol:%s flags:[%U]",
sai, sa->id, sa->id, sa->spi, sa->spi,
- ipsec_sa_is_set_IS_TUNNEL (sa) ? "tunnel" : "transport",
- ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ? "-ip6" : "",
sa->protocol ? "esp" : "ah", format_ipsec_sa_flags, sa->flags);
if (!(flags & IPSEC_FORMAT_DETAIL))
@@ -402,6 +398,32 @@ done:
return (s);
}
+u8 *
+format_ipsec4_tunnel_key (u8 * s, va_list * args)
+{
+ ipsec4_tunnel_key_t *key = va_arg (*args, ipsec4_tunnel_key_t *);
+
+ s = format (s, "remote:%U spi:%u (0x%08x)",
+ format_ip4_address, &key->remote_ip,
+ clib_net_to_host_u32 (key->spi),
+ clib_net_to_host_u32 (key->spi));
+
+ return (s);
+}
+
+u8 *
+format_ipsec6_tunnel_key (u8 * s, va_list * args)
+{
+ ipsec6_tunnel_key_t *key = va_arg (*args, ipsec6_tunnel_key_t *);
+
+ s = format (s, "remote:%U spi:%u (0x%08x)",
+ format_ip6_address, &key->remote_ip,
+ clib_net_to_host_u32 (key->spi),
+ clib_net_to_host_u32 (key->spi));
+
+ return (s);
+}
+
/*
* fd.io coding-style-patch-verification: ON
*