summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_format.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-02-07 07:26:12 -0800
committerDamjan Marion <dmarion@me.com>2019-06-18 13:54:35 +0000
commitc87b66c86201458c0475d50c6e93f1497f9eec2e (patch)
tree57bf69c2adb85a93b26a86b5a1110e4290e7f391 /src/vnet/ipsec/ipsec_format.c
parent097fa66b986f06281f603767d321ab13ab6c88c3 (diff)
ipsec: ipsec-tun protect
please consult the new tunnel proposal at: https://wiki.fd.io/view/VPP/IPSec Type: feature Change-Id: I52857fc92ae068b85f59be08bdbea1bd5932e291 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.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index d0d073bd2bb..1e6e2d5cb01 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -22,6 +22,7 @@
#include <vnet/fib/fib_table.h>
#include <vnet/ipsec/ipsec.h>
+#include <vnet/ipsec/ipsec_tun.h>
u8 *
format_ipsec_policy_action (u8 * s, va_list * args)
@@ -368,6 +369,40 @@ done:
return (s);
}
+u8 *
+format_ipsec_tun_protect (u8 * s, va_list * args)
+{
+ u32 itpi = va_arg (*args, u32);
+ ipsec_tun_protect_t *itp;
+ u32 sai;
+
+ if (pool_is_free_index (ipsec_protect_pool, itpi))
+ {
+ s = format (s, "No such tunnel index: %d", itpi);
+ goto done;
+ }
+
+ itp = pool_elt_at_index (ipsec_protect_pool, itpi);
+
+ s = format (s, "%U", format_vnet_sw_if_index_name,
+ vnet_get_main (), itp->itp_sw_if_index);
+ s = format (s, "\n output-sa:");
+ s =
+ format (s, "\n %U", format_ipsec_sa, itp->itp_out_sa,
+ IPSEC_FORMAT_BRIEF);
+
+ s = format (s, "\n input-sa:");
+ /* *INDENT-OFF* */
+ FOR_EACH_IPSEC_PROTECT_INPUT_SAI(itp, sai,
+ ({
+ s = format (s, "\n %U", format_ipsec_sa, sai, IPSEC_FORMAT_BRIEF);
+ }));
+ /* *INDENT-ON* */
+
+done:
+ return (s);
+}
+
/*
* fd.io coding-style-patch-verification: ON
*