Show total and half-open SA count in statusall

This commit is contained in:
Martin Willi
2011-05-16 15:24:15 +02:00
parent 9a96ba4b6e
commit 4cf6f101d8
+6 -1
View File
@@ -399,6 +399,7 @@ METHOD(stroke_list_t, status, void,
ike_sa_t *ike_sa;
bool first, found = FALSE;
char *name = msg->status.name;
u_int half_open;
if (all)
{
@@ -535,7 +536,11 @@ METHOD(stroke_list_t, status, void,
}
enumerator->destroy(enumerator);
fprintf(out, "Security Associations:\n");
half_open = charon->ike_sa_manager->get_half_open_count(
charon->ike_sa_manager, NULL);
fprintf(out, "Security Associations (%u up, %u connecting):\n",
charon->ike_sa_manager->get_count(charon->ike_sa_manager) - half_open,
half_open);
enumerator = charon->controller->create_ike_sa_enumerator(
charon->controller, wait);
while (enumerator->enumerate(enumerator, &ike_sa))