Migrated delete_child_sa_job_t to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2011-02-10 07:53:34 +01:00
parent be02b8a094
commit 1328423985
@@ -46,18 +46,14 @@ struct private_delete_child_sa_job_t {
u_int32_t spi; u_int32_t spi;
}; };
/** METHOD(job_t, destroy, void,
* Implementation of job_t.destroy. private_delete_child_sa_job_t *this)
*/
static void destroy(private_delete_child_sa_job_t *this)
{ {
free(this); free(this);
} }
/** METHOD(job_t, execute, void,
* Implementation of job_t.execute. private_delete_child_sa_job_t *this)
*/
static void execute(private_delete_child_sa_job_t *this)
{ {
ike_sa_t *ike_sa; ike_sa_t *ike_sa;
@@ -74,7 +70,7 @@ static void execute(private_delete_child_sa_job_t *this)
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
} }
destroy(this); _destroy(this);
} }
/* /*
@@ -84,16 +80,19 @@ delete_child_sa_job_t *delete_child_sa_job_create(u_int32_t reqid,
protocol_id_t protocol, protocol_id_t protocol,
u_int32_t spi) u_int32_t spi)
{ {
private_delete_child_sa_job_t *this = malloc_thing(private_delete_child_sa_job_t); private_delete_child_sa_job_t *this;
/* interface functions */ INIT(this,
this->public.job_interface.execute = (void (*) (job_t *)) execute; .public = {
this->public.job_interface.destroy = (void (*)(job_t*)) destroy; .job_interface = {
.execute = _execute,
/* private variables */ .destroy = _destroy,
this->reqid = reqid; },
this->protocol = protocol; },
this->spi = spi; .reqid = reqid,
.protocol = protocol,
.spi = spi,
);
return &this->public; return &this->public;
} }