aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/processing
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2011-02-10 08:13:01 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-02-10 08:13:01 +0100
commit44836c50ff2e729cce348bb1a6d060ce1082c433 (patch)
tree457db2fc4841a71e219d419e2e450178caa07ff2 /src/libcharon/processing
parent76331a6493712754c757554f080a2e1be39a5ad4 (diff)
downloadstrongswan-44836c50ff2e729cce348bb1a6d060ce1082c433.tar.bz2
strongswan-44836c50ff2e729cce348bb1a6d060ce1082c433.tar.xz
Migrated rekey_child_sa_job_t to INIT/METHOD macros
Diffstat (limited to 'src/libcharon/processing')
-rw-r--r--src/libcharon/processing/jobs/rekey_child_sa_job.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/libcharon/processing/jobs/rekey_child_sa_job.c b/src/libcharon/processing/jobs/rekey_child_sa_job.c
index b797d181e..2bcee2ddf 100644
--- a/src/libcharon/processing/jobs/rekey_child_sa_job.c
+++ b/src/libcharon/processing/jobs/rekey_child_sa_job.c
@@ -45,18 +45,14 @@ struct private_rekey_child_sa_job_t {
u_int32_t spi;
};
-/**
- * Implementation of job_t.destroy.
- */
-static void destroy(private_rekey_child_sa_job_t *this)
+METHOD(job_t, destroy, void,
+ private_rekey_child_sa_job_t *this)
{
free(this);
}
-/**
- * Implementation of job_t.execute.
- */
-static void execute(private_rekey_child_sa_job_t *this)
+METHOD(job_t, execute, void,
+ private_rekey_child_sa_job_t *this)
{
ike_sa_t *ike_sa;
@@ -82,16 +78,19 @@ rekey_child_sa_job_t *rekey_child_sa_job_create(u_int32_t reqid,
protocol_id_t protocol,
u_int32_t spi)
{
- private_rekey_child_sa_job_t *this = malloc_thing(private_rekey_child_sa_job_t);
-
- /* interface functions */
- this->public.job_interface.execute = (void (*) (job_t *)) execute;
- this->public.job_interface.destroy = (void (*)(job_t*)) destroy;
+ private_rekey_child_sa_job_t *this;
- /* private variables */
- this->reqid = reqid;
- this->protocol = protocol;
- this->spi = spi;
+ INIT(this,
+ .public = {
+ .job_interface = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
+ },
+ .reqid = reqid,
+ .protocol = protocol,
+ .spi = spi,
+ );
return &this->public;
}