Migrated rekey_ike_sa_job_t to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2011-02-10 08:16:23 +01:00
parent 44836c50ff
commit 84e8fa47dc
@@ -39,19 +39,15 @@ struct private_rekey_ike_sa_job_t {
bool reauth; bool reauth;
}; };
/** METHOD(job_t, destroy, void,
* Implementation of job_t.destroy. private_rekey_ike_sa_job_t *this)
*/
static void destroy(private_rekey_ike_sa_job_t *this)
{ {
this->ike_sa_id->destroy(this->ike_sa_id); this->ike_sa_id->destroy(this->ike_sa_id);
free(this); free(this);
} }
/** METHOD(job_t, execute, void,
* Implementation of job_t.execute. private_rekey_ike_sa_job_t *this)
*/
static void execute(private_rekey_ike_sa_job_t *this)
{ {
ike_sa_t *ike_sa; ike_sa_t *ike_sa;
status_t status = SUCCESS; status_t status = SUCCESS;
@@ -90,15 +86,18 @@ static void execute(private_rekey_ike_sa_job_t *this)
*/ */
rekey_ike_sa_job_t *rekey_ike_sa_job_create(ike_sa_id_t *ike_sa_id, bool reauth) rekey_ike_sa_job_t *rekey_ike_sa_job_create(ike_sa_id_t *ike_sa_id, bool reauth)
{ {
private_rekey_ike_sa_job_t *this = malloc_thing(private_rekey_ike_sa_job_t); private_rekey_ike_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->ike_sa_id = ike_sa_id->clone(ike_sa_id); },
this->reauth = reauth; },
.ike_sa_id = ike_sa_id->clone(ike_sa_id),
.reauth = reauth,
);
return &(this->public); return &(this->public);
} }