diff options
author | Martin Willi <martin@strongswan.org> | 2008-12-10 09:59:35 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-12-10 09:59:35 +0000 |
commit | ed2bcd0315af5e01e8b387930e792a21d8851a94 (patch) | |
tree | c836145ed781e7592dc26250772cdc4ab6f210e8 | |
parent | d5d5bc0f16e060abdcbd3e8ecba31dbd9de6cba0 (diff) | |
download | strongswan-ed2bcd0315af5e01e8b387930e792a21d8851a94.tar.bz2 strongswan-ed2bcd0315af5e01e8b387930e792a21d8851a94.tar.xz |
added IKE_SA established timer to "ipsec statusall"
-rw-r--r-- | src/charon/plugins/stroke/stroke_list.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/charon/plugins/stroke/stroke_list.c b/src/charon/plugins/stroke/stroke_list.c index 61ed7dd6c..b0791ce1a 100644 --- a/src/charon/plugins/stroke/stroke_list.c +++ b/src/charon/plugins/stroke/stroke_list.c @@ -77,10 +77,23 @@ auth_class_t get_auth_class(peer_cfg_t *config) static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all) { ike_sa_id_t *id = ike_sa->get_id(ike_sa); - - fprintf(out, "%12s[%d]: %N, %H[%D]...%H[%D]\n", + u_int32_t now; + + now = time(NULL); + + fprintf(out, "%12s[%d]: %N", ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa), - ike_sa_state_names, ike_sa->get_state(ike_sa), + ike_sa_state_names, ike_sa->get_state(ike_sa)); + + if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED) + { + u_int32_t established; + + established = now - ike_sa->get_statistic(ike_sa, STAT_ESTABLISHED); + fprintf(out, " %V", &established); + } + + fprintf(out, ", %H[%D]...%H[%D]\n", ike_sa->get_my_host(ike_sa), ike_sa->get_my_id(ike_sa), ike_sa->get_other_host(ike_sa), ike_sa->get_other_id(ike_sa)); @@ -98,9 +111,8 @@ static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all) if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED) { - u_int32_t rekey, reauth, now; + u_int32_t rekey, reauth; - now = time(NULL); rekey = ike_sa->get_statistic(ike_sa, STAT_REKEY); reauth = ike_sa->get_statistic(ike_sa, STAT_REAUTH); |