+static void
+ipsec_sa_show_all (vlib_main_t * vm, ipsec_main_t * im, u8 detail)
+{
+ u32 sai;
+
+ /* *INDENT-OFF* */
+ pool_foreach_index (sai, ipsec_sa_pool)
+ {
+ vlib_cli_output (vm, "%U", format_ipsec_sa, sai,
+ (detail ? IPSEC_FORMAT_DETAIL : IPSEC_FORMAT_BRIEF));
+ }
+ /* *INDENT-ON* */
+}
+
+static void
+ipsec_spd_show_all (vlib_main_t * vm, ipsec_main_t * im)
+{
+ u32 spdi;
+
+ /* *INDENT-OFF* */
+ pool_foreach_index (spdi, im->spds) {
+ vlib_cli_output(vm, "%U", format_ipsec_spd, spdi);
+ }
+ /* *INDENT-ON* */
+}
+
+static void
+ipsec_spd_bindings_show_all (vlib_main_t * vm, ipsec_main_t * im)
+{
+ u32 spd_id, sw_if_index;
+ ipsec_spd_t *spd;
+
+ vlib_cli_output (vm, "SPD Bindings:");
+
+ /* *INDENT-OFF* */
+ hash_foreach(sw_if_index, spd_id, im->spd_index_by_sw_if_index, ({
+ spd = pool_elt_at_index (im->spds, spd_id);
+ vlib_cli_output (vm, " %d -> %U", spd->id,
+ format_vnet_sw_if_index_name, im->vnet_main,
+ sw_if_index);
+ }));
+ /* *INDENT-ON* */
+}
+
+static walk_rc_t
+ipsec_tun_protect_show_one (index_t itpi, void *ctx)
+{
+ vlib_cli_output (ctx, "%U", format_ipsec_tun_protect_index, itpi);
+
+ return (WALK_CONTINUE);
+}
+
+static void
+ipsec_tunnel_show_all (vlib_main_t * vm)
+{
+ ipsec_tun_protect_walk (ipsec_tun_protect_show_one, vm);
+}
+