diff options
| author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-02-10 08:22:57 +0100 |
|---|---|---|
| committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-02-10 08:22:57 +0100 |
| commit | e76d12bb9ebc00a100ef9d38319eee12be56f452 (patch) | |
| tree | 5a3948a43b3eb986a0315fed58ef8819cbe211be /src/libcharon/processing | |
| parent | ac226a1a6060ea72d3e550be0d4f4201d94134f4 (diff) | |
| download | strongswan-e76d12bb9ebc00a100ef9d38319eee12be56f452.tar.bz2 strongswan-e76d12bb9ebc00a100ef9d38319eee12be56f452.tar.xz | |
Migrated roam_job_t to INIT/METHOD macros
Diffstat (limited to 'src/libcharon/processing')
| -rw-r--r-- | src/libcharon/processing/jobs/roam_job.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/libcharon/processing/jobs/roam_job.c b/src/libcharon/processing/jobs/roam_job.c index adc884a8a..74ef8bd6d 100644 --- a/src/libcharon/processing/jobs/roam_job.c +++ b/src/libcharon/processing/jobs/roam_job.c @@ -38,18 +38,14 @@ struct private_roam_job_t { bool address; }; -/** - * Implements job_t.destroy. - */ -static void destroy(private_roam_job_t *this) +METHOD(job_t, destroy, void, + private_roam_job_t *this) { free(this); } -/** - * Implementation of job_t.execute. - */ -static void execute(private_roam_job_t *this) +METHOD(job_t, execute, void, + private_roam_job_t *this) { ike_sa_t *ike_sa; linked_list_t *list; @@ -94,12 +90,17 @@ static void execute(private_roam_job_t *this) */ roam_job_t *roam_job_create(bool address) { - private_roam_job_t *this = malloc_thing(private_roam_job_t); - - this->public.job_interface.execute = (void (*) (job_t *)) execute; - this->public.job_interface.destroy = (void (*) (job_t *)) destroy; - - this->address = address; + private_roam_job_t *this; + + INIT(this, + .public = { + .job_interface = { + .execute = _execute, + .destroy = _destroy, + }, + }, + .address = address, + ); return &this->public; } |
