ike-sa: Expose task_manager_t::remove_task()
authorTobias Brunner <tobias@strongswan.org>
Wed, 28 Nov 2018 13:54:31 +0000 (14:54 +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 3cc645e..cbd1703 100644 (file)
@@ -2721,6 +2721,12 @@ METHOD(ike_sa_t, create_task_enumerator, enumerator_t*,
        return this->task_manager->create_task_enumerator(this->task_manager, queue);
 }
 
+METHOD(ike_sa_t, remove_task, void,
+       private_ike_sa_t *this, enumerator_t *enumerator)
+{
+       return this->task_manager->remove_task(this->task_manager, enumerator);
+}
+
 METHOD(ike_sa_t, flush_queue, void,
        private_ike_sa_t *this, task_queue_t queue)
 {
@@ -3063,6 +3069,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
                        .create_attribute_enumerator = _create_attribute_enumerator,
                        .set_kmaddress = _set_kmaddress,
                        .create_task_enumerator = _create_task_enumerator,
+                       .remove_task = _remove_task,
                        .flush_queue = _flush_queue,
                        .queue_task = _queue_task,
                        .queue_task_delayed = _queue_task_delayed,
index bfec009..be480ea 100644 (file)
@@ -1125,6 +1125,16 @@ struct ike_sa_t {
        enumerator_t* (*create_task_enumerator)(ike_sa_t *this, task_queue_t queue);
 
        /**
+        * Remove the task the given enumerator points to.
+        *
+        * @note This should be used with caution, in partciular, for tasks in the
+        * active and passive queues.
+        *
+        * @param enumerator    enumerator created with the method above
+        */
+       void (*remove_task)(ike_sa_t *this, enumerator_t *enumerator);
+
+       /**
         * Flush a task queue, cancelling all tasks in it.
         *
         * @param queue                 queue type to flush