Moved CHILD_SA delete task creation to protocol specific task manager
This commit is contained in:
@@ -1272,17 +1272,7 @@ METHOD(ike_sa_t, rekey_child_sa, status_t,
|
||||
METHOD(ike_sa_t, delete_child_sa, status_t,
|
||||
private_ike_sa_t *this, protocol_id_t protocol, u_int32_t spi)
|
||||
{
|
||||
task_t *task;
|
||||
|
||||
if (this->version == IKEV1)
|
||||
{
|
||||
task = (task_t*)quick_delete_create(&this->public, protocol, spi, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
task = (task_t*)child_delete_create(&this->public, protocol, spi);
|
||||
}
|
||||
this->task_manager->queue_task(this->task_manager, task);
|
||||
this->task_manager->queue_child_delete(this->task_manager, protocol, spi);
|
||||
return this->task_manager->initiate(this->task_manager);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <daemon.h>
|
||||
#include <sa/ikev1/tasks/main_mode.h>
|
||||
#include <sa/ikev1/tasks/quick_mode.h>
|
||||
#include <sa/ikev1/tasks/quick_delete.h>
|
||||
#include <sa/ikev1/tasks/xauth.h>
|
||||
#include <sa/ikev1/tasks/mode_config.h>
|
||||
#include <sa/ikev1/tasks/informational.h>
|
||||
@@ -1034,6 +1035,13 @@ METHOD(task_manager_t, queue_child_rekey, void,
|
||||
/* TODO-IKEv1: CHILD rekeying */
|
||||
}
|
||||
|
||||
METHOD(task_manager_t, queue_child_delete, void,
|
||||
private_task_manager_t *this, protocol_id_t protocol, u_int32_t spi)
|
||||
{
|
||||
queue_task(this, (task_t*)quick_delete_create(this->ike_sa, protocol,
|
||||
spi, FALSE));
|
||||
}
|
||||
|
||||
METHOD(task_manager_t, queue_dpd, void,
|
||||
private_task_manager_t *this)
|
||||
{
|
||||
@@ -1119,6 +1127,7 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
|
||||
.queue_ike = _queue_ike,
|
||||
.queue_child = _queue_child,
|
||||
.queue_child_rekey = _queue_child_rekey,
|
||||
.queue_child_delete = _queue_child_delete,
|
||||
.queue_dpd = _queue_dpd,
|
||||
.initiate = _initiate,
|
||||
.retransmit = _retransmit,
|
||||
|
||||
@@ -1220,6 +1220,12 @@ METHOD(task_manager_t, queue_child_rekey, void,
|
||||
queue_task(this, (task_t*)child_rekey_create(this->ike_sa, protocol, spi));
|
||||
}
|
||||
|
||||
METHOD(task_manager_t, queue_child_delete, void,
|
||||
private_task_manager_t *this, protocol_id_t protocol, u_int32_t spi)
|
||||
{
|
||||
queue_task(this, (task_t*)child_delete_create(this->ike_sa, protocol, spi));
|
||||
}
|
||||
|
||||
METHOD(task_manager_t, queue_dpd, void,
|
||||
private_task_manager_t *this)
|
||||
{
|
||||
@@ -1347,6 +1353,7 @@ task_manager_v2_t *task_manager_v2_create(ike_sa_t *ike_sa)
|
||||
.queue_ike = _queue_ike,
|
||||
.queue_child = _queue_child,
|
||||
.queue_child_rekey = _queue_child_rekey,
|
||||
.queue_child_delete = _queue_child_delete,
|
||||
.queue_dpd = _queue_dpd,
|
||||
.initiate = _initiate,
|
||||
.retransmit = _retransmit,
|
||||
|
||||
@@ -149,6 +149,15 @@ struct task_manager_t {
|
||||
void (*queue_child_rekey)(task_manager_t *this, protocol_id_t protocol,
|
||||
u_int32_t spi);
|
||||
|
||||
/**
|
||||
* Queue CHILD_SA delete tasks.
|
||||
*
|
||||
* @param protocol CHILD_SA protocol, AH|ESP
|
||||
* @param spi CHILD_SA SPI to rekey
|
||||
*/
|
||||
void (*queue_child_delete)(task_manager_t *this, protocol_id_t protocol,
|
||||
u_int32_t spi);
|
||||
|
||||
/**
|
||||
* Queue liveness checking tasks.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user