aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/processing
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2011-02-10 08:25:41 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-02-10 08:25:41 +0100
commitbcf071d9d5ef1e9b82e558d9edc35a34cc138530 (patch)
tree774090cafe50c44d2bef860d543a1caf3c7ffebe /src/libcharon/processing
parente76d12bb9ebc00a100ef9d38319eee12be56f452 (diff)
downloadstrongswan-bcf071d9d5ef1e9b82e558d9edc35a34cc138530.tar.bz2
strongswan-bcf071d9d5ef1e9b82e558d9edc35a34cc138530.tar.xz
Migrated send_dpd_job_t to INIT/METHOD macros
Diffstat (limited to 'src/libcharon/processing')
-rw-r--r--src/libcharon/processing/jobs/send_dpd_job.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/libcharon/processing/jobs/send_dpd_job.c b/src/libcharon/processing/jobs/send_dpd_job.c
index 1c2da52b8..47b525363 100644
--- a/src/libcharon/processing/jobs/send_dpd_job.c
+++ b/src/libcharon/processing/jobs/send_dpd_job.c
@@ -38,19 +38,15 @@ struct private_send_dpd_job_t {
ike_sa_id_t *ike_sa_id;
};
-/**
- * Implements job_t.destroy.
- */
-static void destroy(private_send_dpd_job_t *this)
+METHOD(job_t, destroy, void,
+ private_send_dpd_job_t *this)
{
this->ike_sa_id->destroy(this->ike_sa_id);
free(this);
}
-/**
- * Implementation of job_t.execute.
- */
-static void execute(private_send_dpd_job_t *this)
+METHOD(job_t, execute, void,
+ private_send_dpd_job_t *this)
{
ike_sa_t *ike_sa;
@@ -75,14 +71,17 @@ static void execute(private_send_dpd_job_t *this)
*/
send_dpd_job_t *send_dpd_job_create(ike_sa_id_t *ike_sa_id)
{
- private_send_dpd_job_t *this = malloc_thing(private_send_dpd_job_t);
-
- /* interface functions */
- this->public.job_interface.execute = (void (*) (job_t *)) execute;
- this->public.job_interface.destroy = (void (*) (job_t *)) destroy;
+ private_send_dpd_job_t *this;
- /* private variables */
- this->ike_sa_id = ike_sa_id->clone(ike_sa_id);
+ INIT(this,
+ .public = {
+ .job_interface = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
+ },
+ .ike_sa_id = ike_sa_id->clone(ike_sa_id),
+ );
return &this->public;
}