list assigned leases using "ipsec leases"

This commit is contained in:
Martin Willi
2008-12-10 13:00:02 +00:00
parent ed2bcd0315
commit 6b83549d1a
10 changed files with 245 additions and 8 deletions
+15
View File
@@ -337,6 +337,18 @@ static void stroke_purge(private_stroke_socket_t *this,
CERT_X509_OCSP_RESPONSE);
}
/**
* list pool leases
*/
static void stroke_leases(private_stroke_socket_t *this,
stroke_msg_t *msg, FILE *out)
{
pop_string(msg, &msg->leases.pool);
pop_string(msg, &msg->leases.address);
this->list->leases(this->list, msg, out);
}
debug_t get_group_from_name(char *type)
{
if (strcasecmp(type, "any") == 0) return DBG_ANY;
@@ -498,6 +510,9 @@ static job_requeue_t process(stroke_job_context_t *ctx)
case STR_PURGE:
stroke_purge(this, msg, out);
break;
case STR_LEASES:
stroke_leases(this, msg, out);
break;
default:
DBG1(DBG_CFG, "received unknown stroke");
break;