diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2020-03-31 05:59:41 +0000 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-04-07 12:29:09 +0000 |
commit | 59fea5a6a3fafe0a5a0d2f543db53af790013e3a (patch) | |
tree | 270cef072f0fcb11bb29c02a4119bed43a6f157e /src/plugins/ikev2/ikev2_cli.c | |
parent | 483a3d819abf13a95b5ded65c3efa360e9b4fdf0 (diff) |
ikev2: make liveness params configurable
Introduce new cli for setting liveness check period and max retries for
a peer to consider its partner dead.
ikev2 set liveness <period-in-seconds> <max-retires>
Type: improvement
Change-Id: Iadae1de245d34fe3ee85e09b570f9df8c401772b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2_cli.c')
-rw-r--r-- | src/plugins/ikev2/ikev2_cli.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c index 03f9efd696f..ec5867adf87 100644 --- a/src/plugins/ikev2/ikev2_cli.c +++ b/src/plugins/ikev2/ikev2_cli.c @@ -529,6 +529,45 @@ VLIB_CLI_COMMAND (show_ikev2_profile_command, static) = { /* *INDENT-ON* */ static clib_error_t * +set_ikev2_liveness_period_fn (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + unformat_input_t _line_input, *line_input = &_line_input; + clib_error_t *r = 0; + u32 period = 0, max_retries = 0; + + if (!unformat_user (input, unformat_line_input, line_input)) + return 0; + + while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (line_input, "%d %d", &period, &max_retries)) + { + r = ikev2_set_liveness_params (period, max_retries); + goto done; + } + else + break; + } + + r = clib_error_return (0, "parse error: '%U'", + format_unformat_error, line_input); + +done: + unformat_free (line_input); + return r; +} + +/* *INDENT-OFF* */ +VLIB_CLI_COMMAND (set_ikev2_liveness_command, static) = { + .path = "ikev2 set liveness", + .short_help = "ikev2 set liveness <period> <max-retires>", + .function = set_ikev2_liveness_period_fn, +}; +/* *INDENT-ON* */ + +static clib_error_t * set_ikev2_local_key_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) |