diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2021-01-25 10:09:27 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2021-01-27 11:35:35 +0000 |
commit | 68d2753569592e424e7584e2f921f68d1b3d2088 (patch) | |
tree | 49926c81a0ef25cecce425e7badfcaa014eee2d9 /src/plugins/ikev2/ikev2_api.c | |
parent | 1b9d2c2c9d21b5a29527a738601055f67165c7ca (diff) |
ikev2: add per SA stats
Type: feature
Change-Id: Ic502d806410ea3c8f3f1eac70b694114ccb053bf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2_api.c')
-rw-r--r-- | src/plugins/ikev2/ikev2_api.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_api.c b/src/plugins/ikev2/ikev2_api.c index 00d71143a5d..01a7373a6ae 100644 --- a/src/plugins/ikev2/ikev2_api.c +++ b/src/plugins/ikev2/ikev2_api.c @@ -195,6 +195,17 @@ vl_api_ikev2_profile_dump_t_handler (vl_api_ikev2_profile_dump_t * mp) } static void +ikev2_copy_stats (vl_api_ikev2_sa_stats_t *dst, const ikev2_stats_t *src) +{ + dst->n_rekey_req = src->n_rekey_req; + dst->n_keepalives = src->n_keepalives; + dst->n_retransmit = src->n_retransmit; + dst->n_init_sa_retransmit = src->n_init_retransmit; + dst->n_sa_init_req = src->n_sa_init_req; + dst->n_sa_auth_req = src->n_sa_auth_req; +} + +static void send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index) { vl_api_ikev2_sa_details_t *rmp = 0; @@ -253,6 +264,8 @@ send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index) k->sk_pr_len = vec_len (sa->sk_pr); clib_memcpy (&k->sk_pr, sa->sk_pr, k->sk_pr_len); + ikev2_copy_stats (&rsa->stats, &sa->stats); + vl_api_ikev2_sa_t_endian(rsa); }); /* *INDENT-ON* */ |