#include <math.h>
#include <daemon.h>
-#include <sa/tasks/child_delete.h>
#include <sa/tasks/main_mode.h>
#include <sa/tasks/quick_mode.h>
#include <sa/tasks/xauth.h>
#include <sa/tasks/ike_vendor_v1.h>
#include <sa/tasks/ike_cert_pre_v1.h>
#include <sa/tasks/ike_cert_post_v1.h>
-#include <encoding/payloads/delete_payload.h>
#include <processing/jobs/retransmit_job.h>
#include <processing/jobs/delete_ike_sa_job.h>
#include "informational.h"
#include <daemon.h>
+#include <sa/tasks/ike_delete.h>
+#include <sa/tasks/child_delete.h>
+#include <encoding/payloads/delete_payload.h>
typedef struct private_informational_t private_informational_t;
* Notify payload to send
*/
notify_payload_t *notify;
+
+ /**
+ * Delete subtask
+ */
+ task_t *del;
};
METHOD(task_t, build_i, status_t,
private_informational_t *this, message_t *message)
{
enumerator_t *enumerator;
+ delete_payload_t *delete;
notify_payload_t *notify;
notify_type_t type;
payload_t *payload;
}
continue;
case DELETE_V1:
- /* TODO-IKEv1: handle delete */
+ delete = (delete_payload_t*)payload;
+ if (delete->get_protocol_id(delete) == PROTO_IKE)
+ {
+ this->del = (task_t*)ike_delete_create(this->ike_sa, FALSE);
+ }
+ else
+ {
+ this->del = (task_t*)child_delete_create(this->ike_sa,
+ PROTO_NONE, 0);
+ }
+ break;
default:
continue;
}
}
enumerator->destroy(enumerator);
+ if (status == SUCCESS)
+ {
+ return this->del->process(this->del, message);
+ }
return status;
}
METHOD(task_t, build_r, status_t,
private_informational_t *this, message_t *message)
{
+ if (this->del)
+ {
+ return this->del->build(this->del, message);
+ }
return FAILED;
}
private_informational_t *this)
{
DESTROY_IF(this->notify);
+ DESTROY_IF(this->del);
free(this);
}