diff options
author | Neale Ranns <neale@graphiant.com> | 2021-02-25 16:01:28 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-02-26 02:12:06 +0000 |
commit | c5fe57dac12a46fa618259643909afaec1ac5aae (patch) | |
tree | 6962f3f1a8d10f2f30f0884889aaa379d0d3e509 /src/vnet/ipsec/ipsec_cli.c | |
parent | cc9a1a0d39f22f653801f5d08bfe4892325254b5 (diff) |
ipsec: move the IPSec SA pool out of ipsec_main
Type: refactor
this allows the ipsec_sa_get funtion to be moved from ipsec.h to
ipsec_sa.h where it belongs.
Also use ipsec_sa_get throughout the code base.
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I2dce726c4f7052b5507dd8dcfead0ed5604357df
Diffstat (limited to 'src/vnet/ipsec/ipsec_cli.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_cli.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/vnet/ipsec/ipsec_cli.c b/src/vnet/ipsec/ipsec_cli.c index eed910edb93..bb80b328d56 100644 --- a/src/vnet/ipsec/ipsec_cli.c +++ b/src/vnet/ipsec/ipsec_cli.c @@ -414,10 +414,11 @@ ipsec_sa_show_all (vlib_main_t * vm, ipsec_main_t * im, u8 detail) u32 sai; /* *INDENT-OFF* */ - pool_foreach_index (sai, im->sad) { - vlib_cli_output(vm, "%U", format_ipsec_sa, sai, - (detail ? IPSEC_FORMAT_DETAIL : IPSEC_FORMAT_BRIEF)); - } + 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* */ } @@ -521,7 +522,6 @@ static clib_error_t * clear_ipsec_sa_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - ipsec_main_t *im = &ipsec_main; u32 sai = ~0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -535,14 +535,15 @@ clear_ipsec_sa_command_fn (vlib_main_t * vm, if (~0 == sai) { /* *INDENT-OFF* */ - pool_foreach_index (sai, im->sad) { - ipsec_sa_clear(sai); - } + pool_foreach_index (sai, ipsec_sa_pool) + { + ipsec_sa_clear (sai); + } /* *INDENT-ON* */ } else { - if (pool_is_free_index (im->sad, sai)) + if (pool_is_free_index (ipsec_sa_pool, sai)) return clib_error_return (0, "unknown SA index: %d", sai); else ipsec_sa_clear (sai); |