Wrap task enumerator in ike_sa
authorMartin Willi <martin@revosec.ch>
Mon, 7 Jun 2010 09:37:55 +0000 (11:37 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 7 Jun 2010 09:37:55 +0000 (11:37 +0200)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index 5145da2..a2190ff 100644 (file)
@@ -1786,6 +1786,12 @@ METHOD(ike_sa_t, add_configuration_attribute, void,
        this->attributes->insert_last(this->attributes, entry);
 }
 
+METHOD(ike_sa_t, create_task_enumerator, enumerator_t*,
+       private_ike_sa_t *this, task_queue_t queue)
+{
+       return this->task_manager->create_task_enumerator(this->task_manager, queue);
+}
+
 METHOD(ike_sa_t, inherit, status_t,
        private_ike_sa_t *this, ike_sa_t *other_public)
 {
@@ -2020,6 +2026,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
                        .get_virtual_ip = _get_virtual_ip,
                        .add_configuration_attribute = _add_configuration_attribute,
                        .set_kmaddress = _set_kmaddress,
+                       .create_task_enumerator = _create_task_enumerator,
 #ifdef ME
                        .act_as_mediation_server = _act_as_mediation_server,
                        .get_server_reflexive_host = _get_server_reflexive_host,
index c61502e..372405e 100644 (file)
@@ -37,7 +37,7 @@ typedef struct ike_sa_t ike_sa_t;
 #include <encoding/payloads/configuration_attribute.h>
 #include <sa/ike_sa_id.h>
 #include <sa/child_sa.h>
-#include <sa/tasks/task.h>
+#include <sa/task_manager.h>
 #include <sa/keymat.h>
 #include <config/peer_cfg.h>
 #include <config/ike_cfg.h>
@@ -888,6 +888,14 @@ struct ike_sa_t {
        void (*set_kmaddress) (ike_sa_t *this, host_t *local, host_t *remote);
 
        /**
+        * Create enumerator over a task queue of this IKE_SA.
+        *
+        * @param                               queue type to enumerate
+        * @return                              enumerator over task_t
+        */
+       enumerator_t* (*create_task_enumerator)(ike_sa_t *this, task_queue_t queue);
+
+       /**
         * Inherit all attributes of other to this after rekeying.
         *
         * When rekeying is completed, all CHILD_SAs, the virtual IP and all