ike-sa: Expose task_manager_t::adopt_child_tasks()
authorTobias Brunner <tobias@strongswan.org>
Tue, 20 Nov 2018 09:48:01 +0000 (10:48 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 7 Dec 2018 09:32:12 +0000 (10:32 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index 27b0c33..3cc645e 100644 (file)
@@ -2739,6 +2739,15 @@ METHOD(ike_sa_t, queue_task_delayed, void,
        this->task_manager->queue_task_delayed(this->task_manager, task, delay);
 }
 
+METHOD(ike_sa_t, adopt_child_tasks, void,
+       private_ike_sa_t *this, ike_sa_t *other_public)
+{
+       private_ike_sa_t *other = (private_ike_sa_t*)other_public;
+
+       this->task_manager->adopt_child_tasks(this->task_manager,
+                                                                                 other->task_manager);
+}
+
 METHOD(ike_sa_t, inherit_pre, void,
        private_ike_sa_t *this, ike_sa_t *other_public)
 {
@@ -3057,6 +3066,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
                        .flush_queue = _flush_queue,
                        .queue_task = _queue_task,
                        .queue_task_delayed = _queue_task_delayed,
+                       .adopt_child_tasks = _adopt_child_tasks,
 #ifdef ME
                        .act_as_mediation_server = _act_as_mediation_server,
                        .get_server_reflexive_host = _get_server_reflexive_host,
index c1d3e1d..bfec009 100644 (file)
@@ -1148,6 +1148,13 @@ struct ike_sa_t {
        void (*queue_task_delayed)(ike_sa_t *this, task_t *task, uint32_t delay);
 
        /**
+        * Adopt child creating tasks from the given IKE_SA.
+        *
+        * @param other                 other IKE_SA to adopt tasks from
+        */
+       void (*adopt_child_tasks)(ike_sa_t *this, ike_sa_t *other);
+
+       /**
         * Inherit required attributes to new SA before rekeying.
         *
         * Some properties of the SA must be applied before starting IKE_SA