diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
commit | b34738ed08c2227300d554b139e2495ca5da97d6 (patch) | |
tree | 62f33b52820f2e49f0e53c0f8c636312037c8054 /src/libcharon/processing/jobs/mediation_job.c | |
parent | 0a9d51a49042a68daa15b0c74a2b7f152f52606b (diff) | |
download | vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.tar.gz vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.zip |
Imported Upstream version 4.6.4
Diffstat (limited to 'src/libcharon/processing/jobs/mediation_job.c')
-rw-r--r-- | src/libcharon/processing/jobs/mediation_job.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/libcharon/processing/jobs/mediation_job.c b/src/libcharon/processing/jobs/mediation_job.c index b5b8af3b3..6f02f2a0a 100644 --- a/src/libcharon/processing/jobs/mediation_job.c +++ b/src/libcharon/processing/jobs/mediation_job.c @@ -66,10 +66,8 @@ struct private_mediation_job_t { bool response; }; -/** - * Implements job_t.destroy. - */ -static void destroy(private_mediation_job_t *this) +METHOD(job_t, destroy, void, + private_mediation_job_t *this) { DESTROY_IF(this->target); DESTROY_IF(this->source); @@ -79,10 +77,8 @@ static void destroy(private_mediation_job_t *this) free(this); } -/** - * Implementation of job_t.execute. - */ -static void execute(private_mediation_job_t *this) +METHOD(job_t, execute, void, + private_mediation_job_t *this) { ike_sa_id_t *target_sa_id; @@ -137,26 +133,27 @@ static void execute(private_mediation_job_t *this) destroy(this); } +METHOD(job_t, get_priority, job_priority_t, + private_mediation_job_t *this) +{ + return JOB_PRIO_MEDIUM; +} + /** * Creates an empty mediation job */ static private_mediation_job_t *mediation_job_create_empty() { - private_mediation_job_t *this = malloc_thing(private_mediation_job_t); - - /* interface functions */ - this->public.job_interface.execute = (void (*) (job_t *)) execute; - this->public.job_interface.destroy = (void (*) (job_t *)) destroy; - - /* private variables */ - this->target = NULL; - this->source = NULL; - this->callback = FALSE; - this->connect_id = chunk_empty; - this->connect_key = chunk_empty; - this->endpoints = NULL; - this->response = FALSE; - + private_mediation_job_t *this; + INIT(this, + .public = { + .job_interface = { + .execute = _execute, + .get_priority = _get_priority, + .destroy = _destroy, + }, + }, + ); return this; } |