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;
*/
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);
-
- this->public.job_interface.execute = (void (*) (job_t *)) execute;
- this->public.job_interface.destroy = (void (*) (job_t *)) destroy;
-
- this->reqid = reqid;
- this->new = new;
+ private_update_sa_job_t *this;
+
+ INIT(this,
+ .public = {
+ .job_interface = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
+ },
+ .reqid = reqid,
+ .new = new,
+ );
return &this->public;
}