2 * Copyright (C) 2006 Martin Willi
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #include "delete_child_sa_job.h"
21 typedef struct private_delete_child_sa_job_t private_delete_child_sa_job_t
;
24 * Private data of an delete_child_sa_job_t object.
26 struct private_delete_child_sa_job_t
{
29 * Public delete_child_sa_job_t interface.
31 delete_child_sa_job_t
public;
34 * reqid of the CHILD_SA
39 * protocol of the CHILD_SA (ESP/AH)
41 protocol_id_t protocol
;
44 * inbound SPI of the CHILD_SA
49 METHOD(job_t
, destroy
, void,
50 private_delete_child_sa_job_t
*this)
55 METHOD(job_t
, execute
, void,
56 private_delete_child_sa_job_t
*this)
60 ike_sa
= charon
->ike_sa_manager
->checkout_by_id(charon
->ike_sa_manager
,
64 DBG1(DBG_JOB
, "CHILD_SA with reqid %d not found for delete",
69 ike_sa
->delete_child_sa(ike_sa
, this->protocol
, this->spi
);
71 charon
->ike_sa_manager
->checkin(charon
->ike_sa_manager
, ike_sa
);
76 METHOD(job_t
, get_priority
, job_priority_t
,
77 private_delete_child_sa_job_t
*this)
79 return JOB_PRIO_MEDIUM
;
85 delete_child_sa_job_t
*delete_child_sa_job_create(u_int32_t reqid
,
86 protocol_id_t protocol
,
89 private_delete_child_sa_job_t
*this;
95 .get_priority
= _get_priority
,
100 .protocol
= protocol
,
104 return &this->public;