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_test.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_test.c')
-rw-r--r-- | src/plugins/ikev2/ikev2_test.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_test.c b/src/plugins/ikev2/ikev2_test.c index 8be42fef427..298125d23b0 100644 --- a/src/plugins/ikev2/ikev2_test.c +++ b/src/plugins/ikev2/ikev2_test.c @@ -106,6 +106,34 @@ api_ikev2_profile_set_ipsec_udp_port (vat_main_t * vam) } static int +api_ikev2_profile_set_liveness (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_ikev2_profile_set_liveness_t *mp; + u32 period = 0, max_retries = 0; + int ret; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (!unformat (i, "period %d max-retries %d", &period, &max_retries)) + { + errmsg ("parse error '%U'", format_unformat_error, i); + return -99; + } + } + + M (IKEV2_PROFILE_SET_LIVENESS, mp); + + mp->period = clib_host_to_net_u32 (period); + mp->max_retries = clib_host_to_net_u32 (max_retries); + + S (mp); + W (ret); + + return ret; +} + +static int api_ikev2_profile_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; |