summaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2/ikev2_cli.c
diff options
context:
space:
mode:
authorDenys Haryachyy <garyachy@gmail.com>2024-02-20 09:59:55 +0200
committerBeno�t Ganne <bganne@cisco.com>2024-04-23 08:52:23 +0000
commit07b227407329e9a1ad5d8c949278a747be93b7ee (patch)
tree8f256bf349c06fd980b5fa1b2b26fea90463af66 /src/plugins/ikev2/ikev2_cli.c
parentbbee45c80b7b633a7c4f923317ec6d5c26edfcbb (diff)
ikev2: uptime
Introduced SA and child SA uptime. Type: improvement Change-Id: I28cf9f90d35ebe035a31ed0a985a5e462c8536a8 Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2_cli.c')
-rw-r--r--src/plugins/ikev2/ikev2_cli.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c
index 733ae478b83..975774c48d5 100644
--- a/src/plugins/ikev2/ikev2_cli.c
+++ b/src/plugins/ikev2/ikev2_cli.c
@@ -74,12 +74,16 @@ format_ikev2_child_sa (u8 * s, va_list * va)
ikev2_ts_t *ts;
ikev2_sa_transform_t *tr;
u8 *c = 0;
+ vlib_main_t *vm = vlib_get_main ();
u32 indent = format_get_indent (s);
indent += 1;
s = format (s, "child sa %u:", index);
+ s = format (s, "\n uptime: %f (s)\n ",
+ vlib_time_now (vm) - child->timestamp);
+
tr = ikev2_sa_get_td_for_type (child->r_proposals,
IKEV2_TRANSFORM_TYPE_ENCR);
c = format (c, "%U ", format_ikev2_sa_transform, tr);
@@ -135,6 +139,7 @@ format_ikev2_sa (u8 * s, va_list * va)
ikev2_sa_transform_t *tr;
ikev2_child_sa_t *child;
u32 indent = 1;
+ vlib_main_t *vm = vlib_get_main ();
ikev2_main_t *km = &ikev2_main;
ikev2_profile_t *p;
@@ -168,6 +173,9 @@ format_ikev2_sa (u8 * s, va_list * va)
s = format (s, "\n state: %s", stateNames[sa->state]);
}
+ s =
+ format (s, "\n uptime: %f (s)\n", vlib_time_now (vm) - sa->auth_timestamp);
+
s = format (s, "\n%U", format_white_space, indent);
s = format (s, "nonce i:%U\n%Ur:%U\n",