aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/vici/vici_query.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2016-05-03 17:33:43 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2016-05-04 18:13:52 +0200
commitb1df63121211f6c9e1c491f37fffe782ccf5b750 (patch)
tree92caf1b6bd29e481cb5040e6f5e755f3bc09fa45 /src/libcharon/plugins/vici/vici_query.c
parente88f21cf65347bff19eda562e8f0bae89b0a5f7b (diff)
downloadstrongswan-b1df63121211f6c9e1c491f37fffe782ccf5b750.tar.bz2
strongswan-b1df63121211f6c9e1c491f37fffe782ccf5b750.tar.xz
vici list-conns sends reauthentication and rekeying time information
Diffstat (limited to 'src/libcharon/plugins/vici/vici_query.c')
-rw-r--r--src/libcharon/plugins/vici/vici_query.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libcharon/plugins/vici/vici_query.c b/src/libcharon/plugins/vici/vici_query.c
index 4bad88984..04cea004e 100644
--- a/src/libcharon/plugins/vici/vici_query.c
+++ b/src/libcharon/plugins/vici/vici_query.c
@@ -686,6 +686,7 @@ CALLBACK(list_conns, vici_message_t*,
uint32_t manual_prio;
linked_list_t *list;
traffic_selector_t *ts;
+ lifetime_cfg_t *lft;
vici_builder_t *b;
ike = request->get_str(request, NULL, "ike");
@@ -726,6 +727,10 @@ CALLBACK(list_conns, vici_message_t*,
b->add_kv(b, "version", "%N", ike_version_names,
peer_cfg->get_ike_version(peer_cfg));
+ b->add_kv(b, "reauth_time", "%u",
+ peer_cfg->get_reauth_time(peer_cfg, FALSE));
+ b->add_kv(b, "rekey_time", "%u",
+ peer_cfg->get_rekey_time(peer_cfg, FALSE));
build_auth_cfgs(peer_cfg, TRUE, b);
build_auth_cfgs(peer_cfg, FALSE, b);
@@ -740,6 +745,12 @@ CALLBACK(list_conns, vici_message_t*,
b->add_kv(b, "mode", "%N", ipsec_mode_names,
child_cfg->get_mode(child_cfg));
+ lft = child_cfg->get_lifetime(child_cfg, FALSE);
+ b->add_kv(b, "rekey_time", "%"PRIu64, lft->time.rekey);
+ b->add_kv(b, "rekey_bytes", "%"PRIu64, lft->bytes.rekey);
+ b->add_kv(b, "rekey_packets", "%"PRIu64, lft->packets.rekey);
+ free(lft);
+
b->begin_list(b, "local-ts");
list = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
selectors = list->create_enumerator(list);