ikev2: Add possibility to delay initiation of a queued task
[strongswan.git] / src / libcharon / sa / ikev1 / task_manager_v1.c
index 126863a..b0c4f5f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2007-2016 Tobias Brunner
  * Copyright (C) 2007-2011 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * HSR Hochschule fuer Technik Rapperswil
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -1513,8 +1513,8 @@ static bool has_queued(private_task_manager_t *this, task_type_t type)
        return found;
 }
 
-METHOD(task_manager_t, queue_task, void,
-       private_task_manager_t *this, task_t *task)
+METHOD(task_manager_t, queue_task_delayed, void,
+       private_task_manager_t *this, task_t *task, uint32_t delay)
 {
        task_type_t type = task->get_type(task);
 
@@ -1535,6 +1535,12 @@ METHOD(task_manager_t, queue_task, void,
        this->queued_tasks->insert_last(this->queued_tasks, task);
 }
 
+METHOD(task_manager_t, queue_task, void,
+       private_task_manager_t *this, task_t *task)
+{
+       queue_task_delayed(this, task, 0);
+}
+
 METHOD(task_manager_t, queue_ike, void,
        private_task_manager_t *this)
 {
@@ -1975,6 +1981,7 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
                        .task_manager = {
                                .process_message = _process_message,
                                .queue_task = _queue_task,
+                               .queue_task_delayed = _queue_task_delayed,
                                .queue_ike = _queue_ike,
                                .queue_ike_rekey = _queue_ike_rekey,
                                .queue_ike_reauth = _queue_ike_reauth,