2 * @file initiate_ike_sa_job.c
4 * @brief Implementation of initiate_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
26 #include "initiate_ike_sa_job.h"
30 typedef struct private_initiate_ike_sa_job_t private_initiate_ike_sa_job_t
;
33 * Private data of an initiate_ike_sa_job_t Object
35 struct private_initiate_ike_sa_job_t
{
37 * public initiate_ike_sa_job_t interface
39 initiate_ike_sa_job_t
public;
42 * associated connection object to initiate
44 connection_t
*connection
;
49 * Implements initiate_ike_sa_job_t.get_type.
51 static job_type_t
get_type(private_initiate_ike_sa_job_t
*this)
53 return INITIATE_IKE_SA
;
57 * Implements initiate_ike_sa_job_t.get_configuration_name.
59 static connection_t
*get_connection(private_initiate_ike_sa_job_t
*this)
61 return this->connection
;
65 * Implements job_t.destroy.
67 static void destroy_all(private_initiate_ike_sa_job_t
*this)
69 this->connection
->destroy(this->connection
);
74 * Implements job_t.destroy.
76 static void destroy(private_initiate_ike_sa_job_t
*this)
84 initiate_ike_sa_job_t
*initiate_ike_sa_job_create(connection_t
*connection
)
86 private_initiate_ike_sa_job_t
*this = malloc_thing(private_initiate_ike_sa_job_t
);
88 /* interface functions */
89 this->public.job_interface
.get_type
= (job_type_t (*) (job_t
*)) get_type
;
90 this->public.job_interface
.destroy_all
= (void (*) (job_t
*)) destroy_all
;
91 this->public.job_interface
.destroy
= (void (*) (job_t
*)) destroy
;
93 /* public functions */
94 this->public.get_connection
= (connection_t
* (*)(initiate_ike_sa_job_t
*)) get_connection
;
95 this->public.destroy
= (void (*)(initiate_ike_sa_job_t
*)) destroy
;
97 /* private variables */
98 this->connection
= connection
;
100 return &(this->public);