diff options
author | Neale Ranns <nranns@cisco.com> | 2019-12-16 00:53:11 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-02-21 09:54:19 +0000 |
commit | 282872127bbeee6ae59ab3f885c09bad601ee0cc (patch) | |
tree | 4f1ef8243b194ca8bf6f1acd62ba4a7d688d371e /src/vnet/ipsec/ipsec_format.c | |
parent | d057625d499525625d60d2207665eaeb755e380e (diff) |
ipsec: IPSec protection for multi-point tunnel interfaces
Type: feature
Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Iaba2ab11bfaa1c8db4023434e3043ac39500f938
Diffstat (limited to 'src/vnet/ipsec/ipsec_format.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_format.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c index 8b9d8c40be1..bf398cb2105 100644 --- a/src/vnet/ipsec/ipsec_format.c +++ b/src/vnet/ipsec/ipsec_format.c @@ -337,26 +337,33 @@ done: } u8 * -format_ipsec_tun_protect (u8 * s, va_list * args) +format_ipsec_tun_protect_index (u8 * s, va_list * args) { - u32 itpi = va_arg (*args, u32); + u32 itpi = va_arg (*args, index_t); 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; - } + if (pool_is_free_index (ipsec_tun_protect_pool, itpi)) + return (format (s, "No such tunnel index: %d", itpi)); + + itp = pool_elt_at_index (ipsec_tun_protect_pool, itpi); + + return (format (s, "%U", format_ipsec_tun_protect, itp)); +} - itp = pool_elt_at_index (ipsec_protect_pool, itpi); + +u8 * +format_ipsec_tun_protect (u8 * s, va_list * args) +{ + ipsec_tun_protect_t *itp = va_arg (*args, ipsec_tun_protect_t *); + u32 sai; s = format (s, "%U", format_vnet_sw_if_index_name, vnet_get_main (), itp->itp_sw_if_index); + if (!ip_address_is_zero (itp->itp_key)) + s = format (s, ": %U", format_ip_address, itp->itp_key); 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 %U", format_ipsec_sa, itp->itp_out_sa, + IPSEC_FORMAT_BRIEF); s = format (s, "\n input-sa:"); /* *INDENT-OFF* */ @@ -366,7 +373,6 @@ format_ipsec_tun_protect (u8 * s, va_list * args) })); /* *INDENT-ON* */ -done: return (s); } |