2 * @file delete_half_open_ike_sa_job.c
4 * @brief Implementation of delete_half_open_ike_sa_job_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #include "delete_half_open_ike_sa_job.h"
27 typedef struct private_delete_half_open_ike_sa_job_t private_delete_half_open_ike_sa_job_t
;
30 * Private data of an delete_half_open_ike_sa_job_t Object
32 struct private_delete_half_open_ike_sa_job_t
{
34 * public delete_half_open_ike_sa_job_t interface
36 delete_half_open_ike_sa_job_t
public;
39 * ID of the ike_sa to delete
41 ike_sa_id_t
*ike_sa_id
;
45 * Implements job_t.get_type.
47 static job_type_t
get_type(private_delete_half_open_ike_sa_job_t
*this)
49 return DELETE_HALF_OPEN_IKE_SA
;
53 * Implements elete_ike_sa_job_t.get_ike_sa_id
55 static ike_sa_id_t
*get_ike_sa_id(private_delete_half_open_ike_sa_job_t
*this)
57 return this->ike_sa_id
;
61 * Implements job_t.destroy.
63 static void destroy(private_delete_half_open_ike_sa_job_t
*this)
65 this->ike_sa_id
->destroy(this->ike_sa_id
);
72 delete_half_open_ike_sa_job_t
*delete_half_open_ike_sa_job_create(ike_sa_id_t
*ike_sa_id
)
74 private_delete_half_open_ike_sa_job_t
*this = malloc_thing(private_delete_half_open_ike_sa_job_t
);
76 /* interface functions */
77 this->public.job_interface
.get_type
= (job_type_t (*) (job_t
*)) get_type
;
79 this->public.job_interface
.destroy_all
= (void (*) (job_t
*)) destroy
;
80 this->public.job_interface
.destroy
= (void (*)(job_t
*)) destroy
;;
82 /* public functions */
83 this->public.get_ike_sa_id
= (ike_sa_id_t
* (*)(delete_half_open_ike_sa_job_t
*)) get_ike_sa_id
;
84 this->public.destroy
= (void (*)(delete_half_open_ike_sa_job_t
*)) destroy
;
86 /* private variables */
87 this->ike_sa_id
= ike_sa_id
->clone(ike_sa_id
);
89 return &(this->public);