2 * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger
4 * Copyright (C) secunet Security Networks AG
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 #include "send_dpd_job.h"
21 #include <sa/ike_sa.h>
25 typedef struct private_send_dpd_job_t private_send_dpd_job_t
;
28 * Private data of an send_dpd_job_t Object
30 struct private_send_dpd_job_t
{
32 * public send_dpd_job_t interface
34 send_dpd_job_t
public;
37 * ID of the IKE_SA which the message belongs to.
39 ike_sa_id_t
*ike_sa_id
;
42 METHOD(job_t
, destroy
, void,
43 private_send_dpd_job_t
*this)
45 this->ike_sa_id
->destroy(this->ike_sa_id
);
49 METHOD(job_t
, execute
, job_requeue_t
,
50 private_send_dpd_job_t
*this)
54 ike_sa
= charon
->ike_sa_manager
->checkout(charon
->ike_sa_manager
,
58 if (ike_sa
->send_dpd(ike_sa
) == DESTROY_ME
)
60 charon
->ike_sa_manager
->checkin_and_destroy(charon
->ike_sa_manager
, ike_sa
);
64 charon
->ike_sa_manager
->checkin(charon
->ike_sa_manager
, ike_sa
);
67 return JOB_REQUEUE_NONE
;
70 METHOD(job_t
, get_priority
, job_priority_t
,
71 private_send_dpd_job_t
*this)
79 send_dpd_job_t
*send_dpd_job_create(ike_sa_id_t
*ike_sa_id
)
81 private_send_dpd_job_t
*this;
87 .get_priority
= _get_priority
,
91 .ike_sa_id
= ike_sa_id
->clone(ike_sa_id
),