Migrated update_sa_job_t to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2011-02-10 08:31:46 +01:00
parent 51d6a0d44a
commit 3cd805a115
+15 -14
View File
@@ -43,19 +43,15 @@ struct private_update_sa_job_t {
host_t *new;
};
/**
* Implements job_t.destroy.
*/
static void destroy(private_update_sa_job_t *this)
METHOD(job_t, destroy, void,
private_update_sa_job_t *this)
{
this->new->destroy(this->new);
free(this);
}
/**
* Implementation of job_t.execute.
*/
static void execute(private_update_sa_job_t *this)
METHOD(job_t, execute, void,
private_update_sa_job_t *this)
{
ike_sa_t *ike_sa;
@@ -83,13 +79,18 @@ static void execute(private_update_sa_job_t *this)
*/
update_sa_job_t *update_sa_job_create(u_int32_t reqid, host_t *new)
{
private_update_sa_job_t *this = malloc_thing(private_update_sa_job_t);
private_update_sa_job_t *this;
this->public.job_interface.execute = (void (*) (job_t *)) execute;
this->public.job_interface.destroy = (void (*) (job_t *)) destroy;
this->reqid = reqid;
this->new = new;
INIT(this,
.public = {
.job_interface = {
.execute = _execute,
.destroy = _destroy,
},
},
.reqid = reqid,
.new = new,
);
return &this->public;
}