Moved IKE_SA rekey task creation to protocol specific task manager
authorMartin Willi <martin@revosec.ch>
Mon, 19 Dec 2011 13:35:14 +0000 (14:35 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:27 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev2/task_manager_v2.c
src/libcharon/sa/task_manager.h

index 4747030..7e2fccd 100644 (file)
@@ -1325,11 +1325,7 @@ METHOD(ike_sa_t, delete_, status_t,
 METHOD(ike_sa_t, rekey, status_t,
        private_ike_sa_t *this)
 {
-       ike_rekey_t *ike_rekey;
-
-       ike_rekey = ike_rekey_create(&this->public, TRUE);
-
-       this->task_manager->queue_task(this->task_manager, &ike_rekey->task);
+       this->task_manager->queue_ike_rekey(this->task_manager);
        return this->task_manager->initiate(this->task_manager);
 }
 
index 012890a..f135d02 100644 (file)
@@ -1023,6 +1023,12 @@ METHOD(task_manager_t, queue_ike, void,
        queue_task(this, (task_t*)isakmp_natd_create(this->ike_sa, TRUE));
 }
 
+METHOD(task_manager_t, queue_ike_rekey, void,
+       private_task_manager_t *this)
+{
+       /* TODO-IKEv1: IKE_SA rekeying */
+}
+
 METHOD(task_manager_t, queue_ike_delete, void,
        private_task_manager_t *this)
 {
@@ -1132,6 +1138,7 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
                                .process_message = _process_message,
                                .queue_task = _queue_task,
                                .queue_ike = _queue_ike,
+                               .queue_ike_rekey = _queue_ike_rekey,
                                .queue_ike_delete = _queue_ike_delete,
                                .queue_child = _queue_child,
                                .queue_child_rekey = _queue_child_rekey,
index 5aa96cc..fd9572d 100644 (file)
@@ -1200,6 +1200,12 @@ METHOD(task_manager_t, queue_ike, void,
 #endif /* ME */
 }
 
+METHOD(task_manager_t, queue_ike_rekey, void,
+       private_task_manager_t *this)
+{
+       queue_task(this, (task_t*)ike_rekey_create(this->ike_sa, TRUE));
+}
+
 METHOD(task_manager_t, queue_ike_delete, void,
        private_task_manager_t *this)
 {
@@ -1357,6 +1363,7 @@ task_manager_v2_t *task_manager_v2_create(ike_sa_t *ike_sa)
                                .process_message = _process_message,
                                .queue_task = _queue_task,
                                .queue_ike = _queue_ike,
+                               .queue_ike_rekey = _queue_ike_rekey,
                                .queue_ike_delete = _queue_ike_delete,
                                .queue_child = _queue_child,
                                .queue_child_rekey = _queue_child_rekey,
index eeccb1a..6ea48fa 100644 (file)
@@ -130,6 +130,11 @@ struct task_manager_t {
        void (*queue_ike)(task_manager_t *this);
 
        /**
+        * Queue IKE_SA rekey tasks.
+        */
+       void (*queue_ike_rekey)(task_manager_t *this);
+
+       /**
         * Queue IKE_SA delete tasks.
         */
        void (*queue_ike_delete)(task_manager_t *this);