Added a non-blocking, skipping variant of IKE_SA enumerator

This commit is contained in:
Martin Willi
2011-05-16 15:24:13 +02:00
parent 3f06403705
commit 69c3eca0e9
13 changed files with 65 additions and 28 deletions
+4 -3
View File
@@ -206,9 +206,10 @@ static void recheckin(interface_job_t *job)
/**
* Implementation of controller_t.create_ike_sa_iterator.
*/
static enumerator_t* create_ike_sa_enumerator(controller_t *this)
static enumerator_t* create_ike_sa_enumerator(controller_t *this, bool wait)
{
return charon->ike_sa_manager->create_enumerator(charon->ike_sa_manager);
return charon->ike_sa_manager->create_enumerator(charon->ike_sa_manager,
wait);
}
/**
@@ -448,7 +449,7 @@ controller_t *controller_create(void)
{
private_controller_t *this = malloc_thing(private_controller_t);
this->public.create_ike_sa_enumerator = (enumerator_t*(*)(controller_t*))create_ike_sa_enumerator;
this->public.create_ike_sa_enumerator = (enumerator_t*(*)(controller_t*, bool))create_ike_sa_enumerator;
this->public.initiate = (status_t(*)(controller_t*,peer_cfg_t*,child_cfg_t*,controller_cb_t,void*))initiate;
this->public.terminate_ike = (status_t(*)(controller_t*,u_int32_t,controller_cb_t, void*))terminate_ike;
this->public.terminate_child = (status_t(*)(controller_t*,u_int32_t,controller_cb_t, void *param))terminate_child;
+2 -1
View File
@@ -67,9 +67,10 @@ struct controller_t {
* The enumerator blocks the IKE_SA manager until it gets destroyed. Do
* not call another interface/manager method while the iterator is alive.
*
* @param wait TRUE to wait for checked out SAs, FALSE to skip
* @return enumerator, locks IKE_SA manager until destroyed
*/
enumerator_t* (*create_ike_sa_enumerator)(controller_t *this);
enumerator_t* (*create_ike_sa_enumerator)(controller_t *this, bool wait);
/**
* Initiate a CHILD_SA, and if required, an IKE_SA.