summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_format.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-05-24 16:17:50 +0000
committerNeale Ranns <nranns@cisco.com>2020-10-05 09:06:36 +0000
commit7b4e52f88fdfd7b785a2741d3b61050040d8561d (patch)
treef80271d2f297c99b15fb1a25141cd4be4357e07f /src/vnet/ipsec/ipsec_format.c
parent149fd3fbd069a5f7be86e68472578ee7af229cb6 (diff)
ipsec: Use bihash for tunnel lookup
Type: improvement Change-Id: I0c82722dfce990345fe6eeecdb335678543367e0 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.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index e3c6f22bf00..8fdc844aec3 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -396,27 +396,33 @@ format_ipsec_tun_protect (u8 * s, va_list * args)
}
u8 *
-format_ipsec4_tunnel_key (u8 * s, va_list * args)
+format_ipsec4_tunnel_kv (u8 * s, va_list * args)
{
- ipsec4_tunnel_key_t *key = va_arg (*args, ipsec4_tunnel_key_t *);
+ ipsec4_tunnel_kv_t *kv = va_arg (*args, ipsec4_tunnel_kv_t *);
+ ip4_address_t ip;
+ u32 spi;
- 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));
+ ipsec4_tunnel_extract_key (kv, &ip, &spi);
+
+ s = format (s, "remote:%U spi:%u (0x%08x) sa:%d tun:%d",
+ format_ip4_address, &ip,
+ clib_net_to_host_u32 (spi),
+ clib_net_to_host_u32 (spi),
+ kv->value.sa_index, kv->value.tun_index);
return (s);
}
u8 *
-format_ipsec6_tunnel_key (u8 * s, va_list * args)
+format_ipsec6_tunnel_kv (u8 * s, va_list * args)
{
- ipsec6_tunnel_key_t *key = va_arg (*args, ipsec6_tunnel_key_t *);
+ ipsec6_tunnel_kv_t *kv = va_arg (*args, ipsec6_tunnel_kv_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));
+ s = format (s, "remote:%U spi:%u (0x%08x) sa:%d tun:%d",
+ format_ip6_address, &kv->key.remote_ip,
+ clib_net_to_host_u32 (kv->key.spi),
+ clib_net_to_host_u32 (kv->key.spi),
+ kv->value.sa_index, kv->value.tun_index);
return (s);
}