summaryrefslogtreecommitdiff
path: root/src/libcharon/processing/jobs/process_message_job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/processing/jobs/process_message_job.c')
-rw-r--r--src/libcharon/processing/jobs/process_message_job.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/libcharon/processing/jobs/process_message_job.c b/src/libcharon/processing/jobs/process_message_job.c
index a47d48e38..b6de4fc0f 100644
--- a/src/libcharon/processing/jobs/process_message_job.c
+++ b/src/libcharon/processing/jobs/process_message_job.c
@@ -35,19 +35,15 @@ struct private_process_message_job_t {
message_t *message;
};
-/**
- * Implements job_t.destroy.
- */
-static void destroy(private_process_message_job_t *this)
+METHOD(job_t, destroy, void,
+ private_process_message_job_t *this)
{
this->message->destroy(this->message);
free(this);
}
-/**
- * Implementation of job_t.execute.
- */
-static void execute(private_process_message_job_t *this)
+METHOD(job_t, execute, void,
+ private_process_message_job_t *this)
{
ike_sa_t *ike_sa;
@@ -93,14 +89,17 @@ static void execute(private_process_message_job_t *this)
*/
process_message_job_t *process_message_job_create(message_t *message)
{
- private_process_message_job_t *this = malloc_thing(private_process_message_job_t);
-
- /* interface functions */
- this->public.job_interface.execute = (void (*) (job_t *)) execute;
- this->public.job_interface.destroy = (void(*)(job_t*))destroy;
+ private_process_message_job_t *this;
- /* private variables */
- this->message = message;
+ INIT(this,
+ .public = {
+ .job_interface = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
+ },
+ .message = message,
+ );
return &(this->public);
}