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
18 #include "acquire_job.h"
23 typedef struct private_acquire_job_t private_acquire_job_t
;
26 * Private data of an acquire_job_t object.
28 struct private_acquire_job_t
{
30 * Public acquire_job_t interface.
35 * reqid of the child to rekey
41 * Implementation of job_t.destroy.
43 static void destroy(private_acquire_job_t
*this)
49 * Implementation of job_t.execute.
51 static void execute(private_acquire_job_t
*this)
55 ike_sa
= charon
->ike_sa_manager
->checkout_by_id(charon
->ike_sa_manager
,
59 DBG2(DBG_JOB
, "CHILD_SA with reqid %d not found for acquiring",
64 ike_sa
->acquire(ike_sa
, this->reqid
);
66 charon
->ike_sa_manager
->checkin(charon
->ike_sa_manager
, ike_sa
);
74 acquire_job_t
*acquire_job_create(u_int32_t reqid
)
76 private_acquire_job_t
*this = malloc_thing(private_acquire_job_t
);
78 /* interface functions */
79 this->public.job_interface
.execute
= (void (*) (job_t
*)) execute
;
80 this->public.job_interface
.destroy
= (void (*)(job_t
*)) destroy
;
82 /* private variables */