diff options
Diffstat (limited to 'src/libcharon/processing/jobs')
-rw-r--r-- | src/libcharon/processing/jobs/acquire_job.c | 25 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/delete_child_sa_job.c | 27 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/delete_ike_sa_job.c | 30 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/migrate_job.c | 29 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/process_message_job.c | 25 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/rekey_child_sa_job.c | 27 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/rekey_ike_sa_job.c | 26 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/retransmit_job.c | 26 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/roam_job.c | 23 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/send_dpd_job.c | 25 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/send_keepalive_job.c | 25 | ||||
-rw-r--r-- | src/libcharon/processing/jobs/update_sa_job.c | 28 |
12 files changed, 2 insertions, 314 deletions
diff --git a/src/libcharon/processing/jobs/acquire_job.c b/src/libcharon/processing/jobs/acquire_job.c index 7a38d2553..3544dd332 100644 --- a/src/libcharon/processing/jobs/acquire_job.c +++ b/src/libcharon/processing/jobs/acquire_job.c @@ -45,30 +45,16 @@ struct private_acquire_job_t { traffic_selector_t *dst_ts; }; -<<<<<<< HEAD -/** - * Implementation of job_t.destroy. - */ -static void destroy(private_acquire_job_t *this) -======= METHOD(job_t, destroy, void, private_acquire_job_t *this) ->>>>>>> upstream/4.5.1 { DESTROY_IF(this->src_ts); DESTROY_IF(this->dst_ts); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_acquire_job_t *this) -======= METHOD(job_t, execute, void, private_acquire_job_t *this) ->>>>>>> upstream/4.5.1 { charon->traps->acquire(charon->traps, this->reqid, this->src_ts, this->dst_ts); @@ -82,16 +68,6 @@ acquire_job_t *acquire_job_create(u_int32_t reqid, traffic_selector_t *src_ts, traffic_selector_t *dst_ts) { -<<<<<<< HEAD - private_acquire_job_t *this = malloc_thing(private_acquire_job_t); - - this->public.job_interface.execute = (void (*) (job_t *)) execute; - this->public.job_interface.destroy = (void (*)(job_t*)) destroy; - - this->reqid = reqid; - this->src_ts = src_ts; - this->dst_ts = dst_ts; -======= private_acquire_job_t *this; INIT(this, @@ -105,7 +81,6 @@ acquire_job_t *acquire_job_create(u_int32_t reqid, .src_ts = src_ts, .dst_ts = dst_ts, ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/delete_child_sa_job.c b/src/libcharon/processing/jobs/delete_child_sa_job.c index 12b4dc1e2..29122cd03 100644 --- a/src/libcharon/processing/jobs/delete_child_sa_job.c +++ b/src/libcharon/processing/jobs/delete_child_sa_job.c @@ -46,28 +46,14 @@ struct private_delete_child_sa_job_t { u_int32_t spi; }; -<<<<<<< HEAD -/** - * Implementation of job_t.destroy. - */ -static void destroy(private_delete_child_sa_job_t *this) -======= METHOD(job_t, destroy, void, private_delete_child_sa_job_t *this) ->>>>>>> upstream/4.5.1 { free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_delete_child_sa_job_t *this) -======= METHOD(job_t, execute, void, private_delete_child_sa_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -94,18 +80,6 @@ delete_child_sa_job_t *delete_child_sa_job_create(u_int32_t reqid, protocol_id_t protocol, u_int32_t spi) { -<<<<<<< HEAD - private_delete_child_sa_job_t *this = malloc_thing(private_delete_child_sa_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->reqid = reqid; - this->protocol = protocol; - this->spi = spi; -======= private_delete_child_sa_job_t *this; INIT(this, @@ -119,7 +93,6 @@ delete_child_sa_job_t *delete_child_sa_job_create(u_int32_t reqid, .protocol = protocol, .spi = spi, ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/delete_ike_sa_job.c b/src/libcharon/processing/jobs/delete_ike_sa_job.c index 2297f3fba..468c9ef94 100644 --- a/src/libcharon/processing/jobs/delete_ike_sa_job.c +++ b/src/libcharon/processing/jobs/delete_ike_sa_job.c @@ -41,29 +41,15 @@ struct private_delete_ike_sa_job_t { }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_delete_ike_sa_job_t *this) -======= METHOD(job_t, destroy, void, private_delete_ike_sa_job_t *this) ->>>>>>> upstream/4.5.1 { this->ike_sa_id->destroy(this->ike_sa_id); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_delete_ike_sa_job_t *this) -======= METHOD(job_t, execute, void, private_delete_ike_sa_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -90,8 +76,8 @@ METHOD(job_t, execute, void, } else { - /* destroy only if not ESTABLISHED */ - if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED) + /* destroy IKE_SA did not complete connecting phase */ + if (ike_sa->get_state(ike_sa) != IKE_CONNECTING) { charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); } @@ -112,17 +98,6 @@ METHOD(job_t, execute, void, delete_ike_sa_job_t *delete_ike_sa_job_create(ike_sa_id_t *ike_sa_id, bool delete_if_established) { -<<<<<<< HEAD - private_delete_ike_sa_job_t *this = malloc_thing(private_delete_ike_sa_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->ike_sa_id = ike_sa_id->clone(ike_sa_id); - this->delete_if_established = delete_if_established; -======= private_delete_ike_sa_job_t *this; INIT(this, @@ -135,7 +110,6 @@ delete_ike_sa_job_t *delete_ike_sa_job_create(ike_sa_id_t *ike_sa_id, .ike_sa_id = ike_sa_id->clone(ike_sa_id), .delete_if_established = delete_if_established, ); ->>>>>>> upstream/4.5.1 return &(this->public); } diff --git a/src/libcharon/processing/jobs/migrate_job.c b/src/libcharon/processing/jobs/migrate_job.c index 7ddd0a82b..5e7c7ae88 100644 --- a/src/libcharon/processing/jobs/migrate_job.c +++ b/src/libcharon/processing/jobs/migrate_job.c @@ -57,15 +57,8 @@ struct private_migrate_job_t { host_t *remote; }; -<<<<<<< HEAD -/** - * Implementation of job_t.destroy. - */ -static void destroy(private_migrate_job_t *this) -======= METHOD(job_t, destroy, void, private_migrate_job_t *this) ->>>>>>> upstream/4.5.1 { DESTROY_IF(this->src_ts); DESTROY_IF(this->dst_ts); @@ -74,15 +67,8 @@ METHOD(job_t, destroy, void, free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_migrate_job_t *this) -======= METHOD(job_t, execute, void, private_migrate_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa = NULL; @@ -143,20 +129,6 @@ migrate_job_t *migrate_job_create(u_int32_t reqid, policy_dir_t dir, host_t *local, host_t *remote) { -<<<<<<< HEAD - private_migrate_job_t *this = malloc_thing(private_migrate_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->reqid = reqid; - this->src_ts = (dir == POLICY_OUT) ? src_ts : dst_ts; - this->dst_ts = (dir == POLICY_OUT) ? dst_ts : src_ts; - this->local = local; - this->remote = remote; -======= private_migrate_job_t *this; INIT(this, @@ -172,7 +144,6 @@ migrate_job_t *migrate_job_create(u_int32_t reqid, .local = local, .remote = remote, ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/process_message_job.c b/src/libcharon/processing/jobs/process_message_job.c index 733775cfa..b6de4fc0f 100644 --- a/src/libcharon/processing/jobs/process_message_job.c +++ b/src/libcharon/processing/jobs/process_message_job.c @@ -35,29 +35,15 @@ struct private_process_message_job_t { message_t *message; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_process_message_job_t *this) -======= METHOD(job_t, destroy, void, private_process_message_job_t *this) ->>>>>>> upstream/4.5.1 { this->message->destroy(this->message); free(this); } -<<<<<<< HEAD -/** - * 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) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -103,16 +89,6 @@ METHOD(job_t, execute, void, */ process_message_job_t *process_message_job_create(message_t *message) { -<<<<<<< HEAD - 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 variables */ - this->message = message; -======= private_process_message_job_t *this; INIT(this, @@ -124,7 +100,6 @@ process_message_job_t *process_message_job_create(message_t *message) }, .message = message, ); ->>>>>>> upstream/4.5.1 return &(this->public); } diff --git a/src/libcharon/processing/jobs/rekey_child_sa_job.c b/src/libcharon/processing/jobs/rekey_child_sa_job.c index 5e147fda6..2bcee2ddf 100644 --- a/src/libcharon/processing/jobs/rekey_child_sa_job.c +++ b/src/libcharon/processing/jobs/rekey_child_sa_job.c @@ -45,28 +45,14 @@ struct private_rekey_child_sa_job_t { u_int32_t spi; }; -<<<<<<< HEAD -/** - * Implementation of job_t.destroy. - */ -static void destroy(private_rekey_child_sa_job_t *this) -======= METHOD(job_t, destroy, void, private_rekey_child_sa_job_t *this) ->>>>>>> upstream/4.5.1 { free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_rekey_child_sa_job_t *this) -======= METHOD(job_t, execute, void, private_rekey_child_sa_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -92,18 +78,6 @@ rekey_child_sa_job_t *rekey_child_sa_job_create(u_int32_t reqid, protocol_id_t protocol, u_int32_t spi) { -<<<<<<< HEAD - private_rekey_child_sa_job_t *this = malloc_thing(private_rekey_child_sa_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->reqid = reqid; - this->protocol = protocol; - this->spi = spi; -======= private_rekey_child_sa_job_t *this; INIT(this, @@ -117,7 +91,6 @@ rekey_child_sa_job_t *rekey_child_sa_job_create(u_int32_t reqid, .protocol = protocol, .spi = spi, ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/rekey_ike_sa_job.c b/src/libcharon/processing/jobs/rekey_ike_sa_job.c index 5f43b2cd5..dc86ba9b3 100644 --- a/src/libcharon/processing/jobs/rekey_ike_sa_job.c +++ b/src/libcharon/processing/jobs/rekey_ike_sa_job.c @@ -39,29 +39,15 @@ struct private_rekey_ike_sa_job_t { bool reauth; }; -<<<<<<< HEAD -/** - * Implementation of job_t.destroy. - */ -static void destroy(private_rekey_ike_sa_job_t *this) -======= METHOD(job_t, destroy, void, private_rekey_ike_sa_job_t *this) ->>>>>>> upstream/4.5.1 { this->ike_sa_id->destroy(this->ike_sa_id); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_rekey_ike_sa_job_t *this) -======= METHOD(job_t, execute, void, private_rekey_ike_sa_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; status_t status = SUCCESS; @@ -100,17 +86,6 @@ METHOD(job_t, execute, void, */ rekey_ike_sa_job_t *rekey_ike_sa_job_create(ike_sa_id_t *ike_sa_id, bool reauth) { -<<<<<<< HEAD - private_rekey_ike_sa_job_t *this = malloc_thing(private_rekey_ike_sa_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->ike_sa_id = ike_sa_id->clone(ike_sa_id); - this->reauth = reauth; -======= private_rekey_ike_sa_job_t *this; INIT(this, @@ -123,7 +98,6 @@ rekey_ike_sa_job_t *rekey_ike_sa_job_create(ike_sa_id_t *ike_sa_id, bool reauth) .ike_sa_id = ike_sa_id->clone(ike_sa_id), .reauth = reauth, ); ->>>>>>> upstream/4.5.1 return &(this->public); } diff --git a/src/libcharon/processing/jobs/retransmit_job.c b/src/libcharon/processing/jobs/retransmit_job.c index 0b73f1485..1c78abd27 100644 --- a/src/libcharon/processing/jobs/retransmit_job.c +++ b/src/libcharon/processing/jobs/retransmit_job.c @@ -40,29 +40,15 @@ struct private_retransmit_job_t { ike_sa_id_t *ike_sa_id; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_retransmit_job_t *this) -======= METHOD(job_t, destroy, void, private_retransmit_job_t *this) ->>>>>>> upstream/4.5.1 { this->ike_sa_id->destroy(this->ike_sa_id); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_retransmit_job_t *this) -======= METHOD(job_t, execute, void, private_retransmit_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -89,17 +75,6 @@ METHOD(job_t, execute, void, */ retransmit_job_t *retransmit_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa_id) { -<<<<<<< HEAD - private_retransmit_job_t *this = malloc_thing(private_retransmit_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->message_id = message_id; - this->ike_sa_id = ike_sa_id->clone(ike_sa_id); -======= private_retransmit_job_t *this; INIT(this, @@ -112,7 +87,6 @@ retransmit_job_t *retransmit_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa .message_id = message_id, .ike_sa_id = ike_sa_id->clone(ike_sa_id), ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/roam_job.c b/src/libcharon/processing/jobs/roam_job.c index bcc96686c..74ef8bd6d 100644 --- a/src/libcharon/processing/jobs/roam_job.c +++ b/src/libcharon/processing/jobs/roam_job.c @@ -38,28 +38,14 @@ struct private_roam_job_t { bool address; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_roam_job_t *this) -======= METHOD(job_t, destroy, void, private_roam_job_t *this) ->>>>>>> upstream/4.5.1 { free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_roam_job_t *this) -======= METHOD(job_t, execute, void, private_roam_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; linked_list_t *list; @@ -104,14 +90,6 @@ METHOD(job_t, execute, void, */ roam_job_t *roam_job_create(bool address) { -<<<<<<< HEAD - private_roam_job_t *this = malloc_thing(private_roam_job_t); - - this->public.job_interface.execute = (void (*) (job_t *)) execute; - this->public.job_interface.destroy = (void (*) (job_t *)) destroy; - - this->address = address; -======= private_roam_job_t *this; INIT(this, @@ -123,7 +101,6 @@ roam_job_t *roam_job_create(bool address) }, .address = address, ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/send_dpd_job.c b/src/libcharon/processing/jobs/send_dpd_job.c index 0a0fd2144..47b525363 100644 --- a/src/libcharon/processing/jobs/send_dpd_job.c +++ b/src/libcharon/processing/jobs/send_dpd_job.c @@ -38,29 +38,15 @@ struct private_send_dpd_job_t { ike_sa_id_t *ike_sa_id; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_send_dpd_job_t *this) -======= METHOD(job_t, destroy, void, private_send_dpd_job_t *this) ->>>>>>> upstream/4.5.1 { this->ike_sa_id->destroy(this->ike_sa_id); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_send_dpd_job_t *this) -======= METHOD(job_t, execute, void, private_send_dpd_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -85,16 +71,6 @@ METHOD(job_t, execute, void, */ send_dpd_job_t *send_dpd_job_create(ike_sa_id_t *ike_sa_id) { -<<<<<<< HEAD - private_send_dpd_job_t *this = malloc_thing(private_send_dpd_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->ike_sa_id = ike_sa_id->clone(ike_sa_id); -======= private_send_dpd_job_t *this; INIT(this, @@ -106,7 +82,6 @@ send_dpd_job_t *send_dpd_job_create(ike_sa_id_t *ike_sa_id) }, .ike_sa_id = ike_sa_id->clone(ike_sa_id), ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/send_keepalive_job.c b/src/libcharon/processing/jobs/send_keepalive_job.c index 21b78919f..8d98aad7e 100644 --- a/src/libcharon/processing/jobs/send_keepalive_job.c +++ b/src/libcharon/processing/jobs/send_keepalive_job.c @@ -38,29 +38,15 @@ struct private_send_keepalive_job_t { ike_sa_id_t *ike_sa_id; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_send_keepalive_job_t *this) -======= METHOD(job_t, destroy, void, private_send_keepalive_job_t *this) ->>>>>>> upstream/4.5.1 { this->ike_sa_id->destroy(this->ike_sa_id); free(this); } -<<<<<<< HEAD -/** - * Implementation of job_t.execute. - */ -static void execute(private_send_keepalive_job_t *this) -======= METHOD(job_t, execute, void, private_send_keepalive_job_t *this) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -79,16 +65,6 @@ METHOD(job_t, execute, void, */ send_keepalive_job_t *send_keepalive_job_create(ike_sa_id_t *ike_sa_id) { -<<<<<<< HEAD - private_send_keepalive_job_t *this = malloc_thing(private_send_keepalive_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->ike_sa_id = ike_sa_id->clone(ike_sa_id); -======= private_send_keepalive_job_t *this; INIT(this, @@ -100,7 +76,6 @@ send_keepalive_job_t *send_keepalive_job_create(ike_sa_id_t *ike_sa_id) }, .ike_sa_id = ike_sa_id->clone(ike_sa_id), ); ->>>>>>> upstream/4.5.1 return &this->public; } diff --git a/src/libcharon/processing/jobs/update_sa_job.c b/src/libcharon/processing/jobs/update_sa_job.c index eeaf9f1c4..3b4e9949f 100644 --- a/src/libcharon/processing/jobs/update_sa_job.c +++ b/src/libcharon/processing/jobs/update_sa_job.c @@ -43,29 +43,15 @@ struct private_update_sa_job_t { host_t *new; }; -<<<<<<< HEAD -/** - * Implements job_t.destroy. - */ -static void destroy(private_update_sa_job_t *this) -======= METHOD(job_t, destroy, void, private_update_sa_job_t *this) ->>>>>>> upstream/4.5.1 { this->new->destroy(this->new); free(this); } -<<<<<<< HEAD -/** - * 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) ->>>>>>> upstream/4.5.1 { ike_sa_t *ike_sa; @@ -81,11 +67,7 @@ METHOD(job_t, execute, void, if (ike_sa->has_condition(ike_sa, COND_NAT_THERE) && !ike_sa->has_condition(ike_sa, COND_NAT_HERE)) { -<<<<<<< HEAD - ike_sa->update_hosts(ike_sa, NULL, this->new); -======= ike_sa->update_hosts(ike_sa, NULL, this->new, FALSE); ->>>>>>> upstream/4.5.1 } charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); } @@ -97,15 +79,6 @@ METHOD(job_t, execute, void, */ update_sa_job_t *update_sa_job_create(u_int32_t reqid, host_t *new) { -<<<<<<< HEAD - 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, @@ -118,7 +91,6 @@ update_sa_job_t *update_sa_job_create(u_int32_t reqid, host_t *new) .reqid = reqid, .new = new, ); ->>>>>>> upstream/4.5.1 return &this->public; } |